{"record":{"id":"88b24122e25bd101","repo":"invoke-ai/InvokeAI","slug":"all-inputs-must-share-the-same-dimensions-got-s","errorCode":null,"errorMessage":"All inputs must share the same dimensions. Got: {sorted(widths)}. Re-render at a single resolution before concatenating.","messagePattern":"All inputs must share the same dimensions\\. Got: (.+?)\\. Re-render at a single resolution before concatenating\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/video_concat.py","lineNumber":126,"sourceCode":"    )\n    fps: Optional[int] = InputField(\n        default=None,\n        ge=1,\n        le=120,\n        description=\"Output frame rate. Defaults to the first input's fps.\",\n    )\n\n    def invoke(self, context: InvocationContext) -> VideoOutput:\n        if len(self.videos) < 2:\n            raise ValueError(\"video_concat requires at least two input videos.\")\n\n        paths: list[Path] = [context.videos.get_path(v.video_name) for v in self.videos]\n\n        # Probe inputs up front: enforce matching dims and pick the default output fps.\n        probes = [probe_video(p) for p in paths]\n        widths = {(w, h) for (w, h, _, _) in probes}\n        if len(widths) > 1:\n            raise ValueError(\n                f\"All inputs must share the same dimensions. Got: \"\n                f\"{sorted(widths)}. Re-render at a single resolution before concatenating.\"\n            )\n        width, height, _, _first_fps = probes[0]\n        # libx264 + yuv420p needs even dimensions; we encode with macro_block_size=1 to\n        # preserve the source dimensions exactly, so reject odd sources with a clear error.\n        if width % 2 or height % 2:\n            raise ValueError(\n                f\"Input videos are {width}x{height}; H.264 encoding requires even dimensions. \"\n                \"Re-encode or crop the sources to even width and height first.\"\n            )\n        self._validate_transition_memory(width, height)\n        output_fps = self._resolve_output_fps([probe[3] for probe in probes])\n\n        context.util.signal_progress(f\"Joining {len(self.videos)} clip(s) ({self.transition}) @ {output_fps:.2f} fps\")\n\n        tmp = tempfile.NamedTemporaryFile(prefix=\"invokeai_video_concat_\", suffix=\".mp4\", delete=False)\n        tmp.close()","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/video_concat.py#L108-L144","documentation":"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.","triggerScenarios":"Concatenating a 1920x1080 clip with a 1080x1920 or 1280x720 clip in the videos list.","commonSituations":"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.","solutions":["Re-render/resize all inputs to a single resolution before concatenating","Add resize/scale video nodes for mismatched inputs in the workflow","Check probe output dimensions (e.g. ffprobe) on all clips before wiring the graph"],"exampleFix":"// before\nvideos=[clip_1920x1080, clip_1280x720]\n// after\nvideos=[clip_1920x1080, resize(clip_1280x720, 1920x1080)]","handlingStrategy":"validation","validationCode":"from invokeai.app.invocations.video_concat import probe_video  # or your own ffprobe wrapper\ndims = {(w, h) for (w, h, *_ ) in (probe_video(p) for p in paths)}\nif len(dims) > 1:\n    raise ValueError(f\"mixed dimensions {sorted(dims)}; resize all inputs first\")","typeGuard":"def same_dimensions(probes: list) -> bool:\n    return len({(w, h) for (w, h, *_ ) in probes}) == 1","tryCatchPattern":"try:\n    output = concat.invoke(context)\nexcept ValueError as e:\n    if \"must share the same dimensions\" in str(e):\n        target = min(dims)\n        videos = [resize_to(v, target) for v in videos]\n        output = concat.invoke(context)\n    else:\n        raise","preventionTips":["Normalize all clips to one resolution before the concat node","Apply resize nodes consistently to all branches feeding video_concat","Run ffprobe on every input when building graphs programmatically"],"tags":["validation","video","dimensions"],"backgroundTag":"resolution-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}