invoke-ai/InvokeAI · error · ValueError

video_concat requires at least two input videos.

Error message

video_concat requires at least two input videos.

What it means

The video_concat invocation requires at least two input videos to concatenate. Invoking it with fewer than two entries in self.videos raises ValueError immediately.

Source

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

        default="cut",
        description="Transition between consecutive clips.",
    )
    transition_frames: int = InputField(
        default=8,
        ge=0,
        le=240,
        description="Length of each transition in frames. Ignored when transition is 'cut'.",
    )
    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."

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Provide at least two videos in the videos list
  2. Fix the upstream node producing an empty/single video collection
  3. Use the video node directly instead of video_concat when only one clip is needed

Example fix

// before
videos=[video_a]
// after
videos=[video_a, video_b]
Defensive patterns

Strategy: validation

Validate before calling

if len(videos) < 2:
    raise ValueError("video_concat needs at least 2 videos; got %d" % len(videos))
# alternatively: pass through the single video unchanged

Type guard

def can_concat(videos: list) -> bool:
    return len(videos) >= 2

Try / catch

try:
    output = concat.invoke(context)
except ValueError as e:
    if "at least two input videos" in str(e):
        output = passthrough_single_video(videos[0]) if len(videos) == 1 else None
    else:
        raise

Prevention

When it happens

Trigger: Invoking VideoConcat with videos=[] or a single-element list.

Common situations: An upstream node failed and returned an empty collection that was fed into video_concat; a workflow where the second video's output was disconnected; user building a graph with one clip expecting passthrough.

Related errors


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