invoke-ai/InvokeAI · error · ValueError

All inputs must share the same dimensions. Got: {sorted(widt

Error message

All inputs must share the same dimensions. Got: {sorted(widths)}. Re-render at a single resolution before concatenating.

What it means

Before concatenating, video_concat probes every input with probe_video and collects the (width, height) set. If more than one distinct resolution is present it raises ValueError, because ffmpeg/imageio concatenation with mixed dimensions would produce broken or letterboxed output.

Source

Thrown at invokeai/app/invocations/video_concat.py:126

    )
    fps: Optional[int] = InputField(
        default=None,
        ge=1,
        le=120,
        description="Output frame rate. Defaults to the first input's fps.",
    )

    def invoke(self, context: InvocationContext) -> VideoOutput:
        if len(self.videos) < 2:
            raise ValueError("video_concat requires at least two input videos.")

        paths: list[Path] = [context.videos.get_path(v.video_name) for v in self.videos]

        # Probe inputs up front: enforce matching dims and pick the default output fps.
        probes = [probe_video(p) for p in paths]
        widths = {(w, h) for (w, h, _, _) in probes}
        if len(widths) > 1:
            raise ValueError(
                f"All inputs must share the same dimensions. Got: "
                f"{sorted(widths)}. Re-render at a single resolution before concatenating."
            )
        width, height, _, _first_fps = probes[0]
        # libx264 + yuv420p needs even dimensions; we encode with macro_block_size=1 to
        # preserve the source dimensions exactly, so reject odd sources with a clear error.
        if width % 2 or height % 2:
            raise ValueError(
                f"Input videos are {width}x{height}; H.264 encoding requires even dimensions. "
                "Re-encode or crop the sources to even width and height first."
            )
        self._validate_transition_memory(width, height)
        output_fps = self._resolve_output_fps([probe[3] for probe in probes])

        context.util.signal_progress(f"Joining {len(self.videos)} clip(s) ({self.transition}) @ {output_fps:.2f} fps")

        tmp = tempfile.NamedTemporaryFile(prefix="invokeai_video_concat_", suffix=".mp4", delete=False)
        tmp.close()

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Re-render/resize all inputs to a single resolution before concatenating
  2. Add resize/scale video nodes for mismatched inputs in the workflow
  3. Check probe output dimensions (e.g. ffprobe) on all clips before wiring the graph

Example fix

// before
videos=[clip_1920x1080, clip_1280x720]
// after
videos=[clip_1920x1080, resize(clip_1280x720, 1920x1080)]
Defensive patterns

Strategy: validation

Validate before calling

from invokeai.app.invocations.video_concat import probe_video  # or your own ffprobe wrapper
dims = {(w, h) for (w, h, *_ ) in (probe_video(p) for p in paths)}
if len(dims) > 1:
    raise ValueError(f"mixed dimensions {sorted(dims)}; resize all inputs first")

Type guard

def same_dimensions(probes: list) -> bool:
    return len({(w, h) for (w, h, *_ ) in probes}) == 1

Try / catch

try:
    output = concat.invoke(context)
except ValueError as e:
    if "must share the same dimensions" in str(e):
        target = min(dims)
        videos = [resize_to(v, target) for v in videos]
        output = concat.invoke(context)
    else:
        raise

Prevention

When it happens

Trigger: Concatenating a 1920x1080 clip with a 1080x1920 or 1280x720 clip in the videos list.

Common situations: Mixing clips from different cameras or export presets; a previous node (e.g. resize) applied to only part of the inputs; screen recordings captured at different window sizes.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/88b24122e25bd101. Report an issue: GitHub.