Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
fix: rework the Extend canvas fix; restore board in webv2 templates
Lincoln Stein4c04dbf606a6
diff --git a/invokeai/app/invocations/video_concat.py b/invokeai/app/invocations/video_concat.pyindex bd8db7f9b5..1f9537f4c4 100644--- a/invokeai/app/invocations/video_concat.py+++ b/invokeai/app/invocations/video_concat.py@@ -27,6 +27,7 @@ from pathlib import Pathfrom typing import Callable, Iterable, Iterator, Literal, Optionalimport numpy as np+from PIL import Imagefrom invokeai.app.invocations.baseinvocation import BaseInvocation, Classification, invocationfrom invokeai.app.invocations.fields import (@@ -43,6 +44,23 @@ from invokeai.app.util.video_encoding import make_mp4_writer, write_stereo_wavfrom invokeai.app.util.video_thumbnails import iter_video_frames, probe_videoTransitionMode = Literal["cut", "crossfade", "fade_through_black"]+SizeMismatchMode = Literal["error", "match_first"]+++def _iter_frames_on_canvas(frames: Iterator[np.ndarray], canvas: tuple[int, int]) -> Iterator[np.ndarray]:+ """Yields each frame at ``canvas`` (a ``(width, height)`` pair) as it streams past.++ A frame already on the canvas is passed through untouched, so this is free for the+ common case where every clip matches. Resizing happens one frame at a time, so the+ O(transition_frames) memory bound of the join is preserved.+ """+ for frame in frames:+ if (frame.shape[1], frame.shape[0]) == canvas:+ yield frame+ else:+ yield np.asarray(Image.fromarray(frame).resize(canvas, Image.LANCZOS))++MAX_TRANSITION_MEMORY_BYTES = 512 * 1024 * 1024_BLEND_WORKING_FRAMES = 13@@ -78,7 +96,7 @@ def _fade_through_black(a_tail: list[np.ndarray], b_head: list[np.ndarray]) -> Ititle="Concatenate Videos",tags=["video", "concat", "transition"],category="video",- version="1.1.0",+ version="1.2.0",classification=Classification.Prototype,)class VideoConcatInvocation(BaseInvocation, WithMetadata, WithBoard):@@ -103,9 +121,15 @@ class VideoConcatInvocation(BaseInvocation, WithMetadata, WithBoard):so the total emitted is exactly ``transition_frames`` per boundary — even for odd``transition_frames`` — and the overall length equals the sum of inputs.- All inputs must share the same pixel dimensions. Output frame rate defaults to the- first input's fps; override with ``fps`` to force a specific rate (the frames are not- resampled, only the container is encoded at the new rate).+ Inputs must share the same pixel dimensions. ``size_mismatch`` decides what happens+ when they do not: ``error`` (the default) refuses the join, and ``match_first``+ resamples every later clip onto the first clip's canvas. ``match_first`` is what lets a+ generated clip be appended to source footage — video models render onto their own fixed+ canvas family, so a generated continuation rarely matches the clip it extends.++ Output frame rate defaults to the first input's fps; override with ``fps`` to force a+ specific rate (the frames are not resampled in time, only the container is encoded at+ the new rate)."""videos: list[VideoField] = InputField(@@ -128,6 +152,14 @@ class VideoConcatInvocation(BaseInvocation, WithMetadata, WithBoard):le=120,description="Output frame rate. Defaults to the first input's fps.",)+ size_mismatch: SizeMismatchMode = InputField(+ default="error",+ description=(+ "What to do when the inputs do not all share the same pixel dimensions. 'error' "+ "refuses the join; 'match_first' resamples every later clip onto the first clip's "+ "canvas, so a generated clip can be appended to source footage it does not match."+ ),+ )def invoke(self, context: InvocationContext) -> VideoOutput:if len(self.videos) < 2:@@ -135,24 +167,31 @@ class VideoConcatInvocation(BaseInvocation, WithMetadata, WithBoard):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.+ # Probe inputs up front: settle the output canvas 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:+ width, height, _, _first_fps = probes[0]+ sizes = {(w, h) for (w, h, _, _) in probes}+ if len(sizes) > 1 and self.size_mismatch == "error":raise ValueError(- f"All inputs must share the same dimensions. Got: "- f"{sorted(widths)}. Re-render at a single resolution before concatenating."+ f"All inputs must share the same dimensions. Got: {sorted(sizes)}. Re-render at a "+ "single resolution before concatenating, or set Size Mismatch to 'match_first' to "+ "resample the later clips onto the first clip's canvas.")- 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."+ f"The output canvas is {width}x{height}, taken from the first input; H.264 encoding "+ "requires even dimensions. Re-encode or crop that clip to an even width and height "+ "first.")self._validate_transition_memory(width, height)output_fps = self._resolve_output_fps([probe[3] for probe in probes])+ mismatched = sum(1 for (w, h, _, _) in probes if (w, h) != (width, height))+ if mismatched:+ context.logger.info(+ f"Resampling {mismatched} of {len(paths)} clip(s) onto the first clip's {width}x{height} canvas"+ )context.util.signal_progress(f"Joining {len(self.videos)} clip(s) ({self.transition}) @ {output_fps:.2f} fps")@@ -168,7 +207,13 @@ class VideoConcatInvocation(BaseInvocation, WithMetadata, WithBoard):num_frames = 0frame_counts: list[int] = []try:- clip_iters = [iter_video_frames(p, is_canceled=context.util.is_canceled) for p in paths]+ # Every clip goes through the canvas guard, including the first: frames already+ # on it pass straight through, so nothing can reach the writer at a size the+ # file is not being encoded at.+ clip_iters = [+ _iter_frames_on_canvas(iter_video_frames(p, is_canceled=context.util.is_canceled), (width, height))+ for p in paths+ ]for frame in self._iter_joined_frames(clip_iters, is_canceled=context.util.is_canceled, frame_counts=frame_counts):diff --git a/invokeai/app/invocations/video_frame_extract_range.py b/invokeai/app/invocations/video_frame_extract_range.pyindex 78badebfaa..0104cbc08a 100644--- a/invokeai/app/invocations/video_frame_extract_range.py+++ b/invokeai/app/invocations/video_frame_extract_range.py@@ -20,7 +20,6 @@ from pathlib import Pathfrom typing import Callable, Iterator, Optional, Protocolimport numpy as np-from PIL import Imagefrom invokeai.app.invocations.baseinvocation import (BaseInvocation,@@ -68,7 +67,6 @@ def _write_frame_range(start: int,end: int,is_canceled: Optional[Callable[[], bool]] = None,- resize_to: Optional[tuple[int, int]] = None,) -> int:"""Streams frames[start..end] (inclusive) from a lazy decoder into the writer.@@ -77,9 +75,6 @@ def _write_frame_range(tens of gigabytes, so peak memory here must stay one-frame-sized regardless of therequested range. Decoding stops as soon as ``end`` has been written. Returns thenumber of frames written.-- ``resize_to`` is a ``(width, height)`` pair; each frame is resampled to it on the way- past, one frame at a time, so the streaming memory profile is unchanged."""written = 0for idx, frame in enumerate(islice(frames, end + 1)):@@ -87,8 +82,6 @@ def _write_frame_range(raise CanceledExceptionif idx < start:continue- if resize_to is not None and (frame.shape[1], frame.shape[0]) != resize_to:- frame = np.asarray(Image.fromarray(frame).resize(resize_to, Image.LANCZOS))writer.append_data(np.ascontiguousarray(frame))written += 1return written@@ -105,6 +98,10 @@ class ExtractVideoRangeOutput(BaseInvocationOutput):"""video: VideoField = OutputField(description="The trimmed video")+ # Echoed back so a graph can record what the user actually picked: the `video` output is a+ # freshly-encoded intermediate, so naming it as a generation's provenance would point at a+ # clip that never appears in the gallery.+ source_video: VideoField = OutputField(description="The video the range was taken from", title="Source Video")width: int = OutputField(description="The width of the video in pixels")height: int = OutputField(description="The height of the video in pixels")num_frames: int = OutputField(description="The number of frames in the trimmed video")@@ -134,15 +131,11 @@ class ExtractVideoRangeInvocation(BaseInvocation, WithMetadata, WithBoard):with the video when the output fps changes playback speed); silentsources stay silent.- Setting ``width``/``height`` conforms the trimmed clip to that canvas (0 on an- axis keeps the source's). This is what lets a trimmed source be concatenated- with a generated clip: Concatenate Videos rejects mismatched dimensions, and- video models render onto their own fixed canvas family, so the source segment- has to be brought onto the same canvas first.-The resolved (positive) ``start_frame`` and ``end_frame`` are also emitted asoutputs, so chained workflows can re-use the boundary indices — e.g. feeding- them into a downstream Frame from Video to extract the same boundary frame.+ them into a downstream Frame from Video to extract the same boundary frame, and the+ input video is echoed back on ``source_video`` so a graph can record the clip the user+ chose rather than the freshly-encoded trim."""video: VideoField = InputField(description="The video to extract a frame range from.")@@ -163,19 +156,6 @@ class ExtractVideoRangeInvocation(BaseInvocation, WithMetadata, WithBoard):description="Output frame rate. 0 = match the source video's frame rate ""(falls back to 16 fps if the source rate can't be probed).",)- width: int = InputField(- default=0,- ge=0,- description="Output width in pixels. 0 = keep the source width. Set both width and height "- "to conform the trimmed clip to a specific canvas — e.g. to match a generated clip before "- "concatenating, since Concatenate Videos rejects mismatched dimensions.",- )- height: int = InputField(- default=0,- ge=0,- description="Output height in pixels. 0 = keep the source height. Aspect ratio is not "- "preserved: the frame is resampled to exactly the requested canvas.",- )def invoke(self, context: InvocationContext) -> ExtractVideoRangeOutput:video_path = context.videos.get_path(self.video.video_name)@@ -211,22 +191,9 @@ class ExtractVideoRangeInvocation(BaseInvocation, WithMetadata, WithBoard):else:output_fps = 16.0- # Conform to the requested canvas when either axis is set; 0 on an axis keeps the- # source's. Everything downstream (the encoder, the even-dimension check, the saved- # video record) uses the output dimensions, not the source's.- out_width = self.width or width- out_height = self.height or height- resize_to = (out_width, out_height) if (out_width, out_height) != (width, height) else None-- # libx264 + yuv420p needs even dimensions. Reject odd sizes up front with a clear- # message instead of surfacing an opaque ffmpeg error mid-encode.- if resize_to is None:- _validate_even_dimensions(out_width, out_height, self.video.video_name)- elif out_width % 2 or out_height % 2:- raise ValueError(- f"Requested output size is {out_width}x{out_height}; H.264 encoding requires even "- "dimensions. Choose an even width and height."- )+ # libx264 + yuv420p needs even dimensions. Reject odd sources up front with a+ # clear message instead of surfacing an opaque ffmpeg error mid-encode.+ _validate_even_dimensions(width, height, self.video.video_name)context.util.signal_progress(f"Transcoding frames {start}-{end} of {n_frames} @ {output_fps:.2f} fps")@@ -246,7 +213,6 @@ class ExtractVideoRangeInvocation(BaseInvocation, WithMetadata, WithBoard):start,end,is_canceled=context.util.is_canceled,- resize_to=resize_to,)finally:writer.close()@@ -289,13 +255,12 @@ class ExtractVideoRangeInvocation(BaseInvocation, WithMetadata, WithBoard):out_duration = num_frames / output_fpscontext.logger.info(f"Encoded trimmed MP4: {num_frames} frames @ {output_fps:.2f} fps "- f"({out_duration:.2f}s) at {out_width}x{out_height}"- + (", with AAC audio" if audio is not None else ", silent")+ f"({out_duration:.2f}s) at {width}x{height}" + (", with AAC audio" if audio is not None else ", silent"))video_dto = context.videos.save(source_path=source_path,- width=out_width,- height=out_height,+ width=width,+ height=height,duration=out_duration,fps=output_fps,)@@ -303,6 +268,7 @@ class ExtractVideoRangeInvocation(BaseInvocation, WithMetadata, WithBoard):base = VideoOutput.build(video_dto)return ExtractVideoRangeOutput(video=base.video,+ source_video=self.video,width=base.width,height=base.height,num_frames=base.num_frames,diff --git a/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json b/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.jsonindex 87c567b7c6..5c495f6b84 100644--- a/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json+++ b/invokeai/app/services/workflow_records/default_workflows/Extend Video - MiniMax H3.json@@ -5,10 +5,10 @@"version": "1.0.0","contact": "","tags": "minimax h3, extend video, video, audio",- "notes": "Drop in a video, use the Start Frame and End Frame fields to choose the span you want to keep, and describe what should happen next in the prompt. The frame at End Frame becomes the first frame of the generated continuation, and the two clips are joined with a short cross-fade over that hand-off point. Frames counts here are 0-based and accept negative indices, so End Frame -1 means 'the last frame'.\n\nOnly the newly generated segment is described by the recorded frame count and canvas -- the length of the joined result is the source span plus that segment.\n\nYour footage is conformed to the model's canvas before the join. H3 renders only onto its own canvas family, and Concatenate Videos refuses clips of differing size or rate, so the trimmed source is resampled to the resolved canvas (aspect is snapped to the nearest supported size, so a 16:9 source is stretched very slightly) and retimed to 24 fps. A source shot at another rate therefore plays faster or slower than the original, audio included -- trim from a 24 fps clip if that matters.\n\nEach InvokeAI install assigns its own internal model IDs, so every model field ships blank -- pick your installed models in the form after loading:\n\n- Model: the MiniMax H3 FL2VA install (diffusers layout). Required.\n- Transformer (single file) / Text Encoder (single file): optional single-file replacements for the install's transformer and Qwen3-VL encoder (e.g. the pruned int8 repacks). Leave blank to use the ones in the main install.\n- LoRA: the MiniMax H3 Turbo step-distillation LoRA.\n\nSteps default to 6, which assumes the Turbo LoRA is loaded. The LoRA field is required: with it blank the workflow will not run. To generate without a step-distillation LoRA, edit the graph -- delete the 'Apply LoRA - MiniMax H3' node and the 'LoRAs (metadata)' Collect node next to it, connect Main Model's Transformer output straight to Denoise's Transformer input, and raise Steps to about 50 (the reference default) or the result will be badly under-denoised.\n\nMiniMax H3 generates the video and a synchronized stereo soundtrack together; the soundtrack is muxed into the MP4 automatically (AAC, 32 kHz). The frame rate is fixed at 24 fps and frame counts snap to a 17n+5 grid: 124 frames = ~5.2 s, up to 345 frames = 14.4 s. Width and height must be multiples of 32; the native canvas has a 768 px short edge (max 768x1344).\n\nThe model is guidance-distilled: no negative prompt, no CFG.\n\nA keyframe is part of BOTH the text conditioning (vision context) and the VAE frame conditioning -- the denoise node rejects the graph if the two disagree. Each image node here feeds Prompt - MiniMax H3 and Frame Conditioning - MiniMax H3 together, and one MiniMax H3 Ideal Dimensions node feeds the canvas to all three consumers, so the coupling holds automatically. Keep it that way if you edit a copy.\n\nThe Core Metadata node records the prompt, steps, seed, canvas size, frame count, any keyframe images and every model ID onto the saved video, so the gallery's Metadata tab is filled in and the video is findable by searching its prompt text. Each value is read over an edge from the node that actually used it, so nothing recorded can drift from what the form is set to. If you rewire the graph, keep those edges attached.",+ "notes": "Drop in a video, use the Start Frame and End Frame fields to choose the span you want to keep, and describe what should happen next in the prompt. The frame at End Frame becomes the first frame of the generated continuation, and the two clips are joined with a short cross-fade over that hand-off point. Frames counts here are 0-based and accept negative indices, so End Frame -1 means 'the last frame'.\n\nOnly the newly generated segment is described by the recorded frame count and canvas -- the length of the joined result is the source span plus that segment.\n\nThe generated segment is resampled onto your source clip's canvas before the join. The model renders only onto its own canvas family, so the two clips will rarely match, and Concatenate Videos refuses clips of differing size -- 'Size Mismatch' on that node is set to 'match_first' to reconcile them. Your footage keeps its own resolution, so a continuation generated at a smaller canvas is upscaled and will look softer than the source.\n\nEach InvokeAI install assigns its own internal model IDs, so every model field ships blank -- pick your installed models in the form after loading:\n\n- Model: the MiniMax H3 FL2VA install (diffusers layout). Required.\n- Transformer (single file) / Text Encoder (single file): optional single-file replacements for the install's transformer and Qwen3-VL encoder (e.g. the pruned int8 repacks). Leave blank to use the ones in the main install.\n- LoRA: the MiniMax H3 Turbo step-distillation LoRA.\n\nSteps default to 6, which assumes the Turbo LoRA is loaded. Without a step-distillation LoRA, raise steps to about 50 -- the reference default -- or the result will be badly under-denoised.\n\nMiniMax H3 generates the video and a synchronized stereo soundtrack together; the soundtrack is muxed into the MP4 automatically (AAC, 32 kHz). The frame rate is fixed at 24 fps and frame counts snap to a 17n+5 grid: 124 frames = ~5.2 s, up to 345 frames = 14.4 s. Width and height must be multiples of 32; the native canvas has a 768 px short edge (max 768x1344).\n\nThe model is guidance-distilled: no negative prompt, no CFG.\n\nA keyframe is part of BOTH the text conditioning (vision context) and the VAE frame conditioning -- the denoise node rejects the graph if the two disagree. Each image node here feeds Prompt - MiniMax H3 and Frame Conditioning - MiniMax H3 together, and one MiniMax H3 Ideal Dimensions node feeds the canvas to all three consumers, so the coupling holds automatically. Keep it that way if you edit a copy.\n\nThe Core Metadata node records the prompt, steps, seed, canvas size, frame count, any keyframe images and every model ID onto the saved video, so the gallery's Metadata tab is filled in and the video is findable by searching its prompt text. Each value is read over an edge from the node that actually used it, so nothing recorded can drift from what the form is set to. If you rewire the graph, keep those edges attached.","exposedFields": [{- "nodeId": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",+ "nodeId": "52e0f43e-0593-4ba6-bb50-df63464a6189","fieldName": "video"},{@@ -380,32 +380,6 @@"y": -60}},- {- "id": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",- "type": "invocation",- "data": {- "id": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",- "version": "1.0.0",- "nodePack": "invokeai",- "label": "Source Video",- "notes": "The clip to continue. Its dimensions decide the canvas: MiniMax H3 renders onto its own canvas family, so the aspect ratio here is snapped to the nearest supported size and the trimmed source is resampled onto it before the two clips are joined.",- "type": "video",- "inputs": {- "video": {- "name": "video",- "label": "Source Video",- "description": ""- }- },- "isOpen": true,- "isIntermediate": true,- "useCache": true- },- "position": {- "x": -560,- "y": -220- }- },{"id": "52e0f43e-0593-4ba6-bb50-df63464a6189","type": "invocation",@@ -414,13 +388,14 @@"version": "1.3.0","nodePack": "invokeai","label": "",- "notes": "Trims the source clip to the part you want to keep, and resamples it onto the canvas resolved above; the generated continuation starts from the frame at End Frame. Both clips have to share a size and a rate before Concatenate Videos will join them, so the output rate is pinned to 24 fps as well -- H3 only generates at 24 fps. A source at another rate is retimed here, video and audio together, so its segment plays faster or slower than the original.",+ "notes": "Trims the source clip to the part you want to keep; the generated continuation starts from the frame at End Frame. The output rate is pinned to 24 fps -- H3 only generates at 24 fps, and the two clips have to share a rate before they can be joined. A source at another rate is retimed here, video and audio together.","type": "extract_video_range","inputs": {"video": {"name": "video","label": "",- "description": ""+ "description": "",+ "value": null},"start_frame": {"name": "start_frame",@@ -440,17 +415,11 @@"description": "","value": 24},- "width": {- "name": "width",+ "board": {+ "name": "board","label": "","description": "",- "value": 0- },- "height": {- "name": "height",- "label": "",- "description": "",- "value": 0+ "value": "auto"}},"isOpen": true,@@ -478,6 +447,12 @@"label": "","description": "","value": -1+ },+ "board": {+ "name": "board",+ "label": "",+ "description": "",+ "value": "auto"}},"isOpen": true,@@ -653,7 +628,7 @@"type": "invocation","data": {"id": "4b32c22b-679d-4d5e-a167-c3309265fcd9",- "version": "1.1.0",+ "version": "1.2.0","nodePack": "invokeai","label": "","notes": "Joins the trimmed source and the generated continuation, cross-fading over the hand-off frame so the seam is not visible.",@@ -670,6 +645,18 @@"label": "","description": "","value": 2+ },+ "board": {+ "name": "board",+ "label": "",+ "description": "",+ "value": "auto"+ },+ "size_mismatch": {+ "name": "size_mismatch",+ "label": "",+ "description": "",+ "value": "match_first"}},"isOpen": true,@@ -947,6 +934,22 @@"targetHandle": "frame_conditioning","type": "default"},+ {+ "id": "edge-52e0f43e-width-9e8d7c6b-width",+ "source": "52e0f43e-0593-4ba6-bb50-df63464a6189",+ "sourceHandle": "width",+ "target": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",+ "targetHandle": "width",+ "type": "default"+ },+ {+ "id": "edge-52e0f43e-height-9e8d7c6b-height",+ "source": "52e0f43e-0593-4ba6-bb50-df63464a6189",+ "sourceHandle": "height",+ "target": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",+ "targetHandle": "height",+ "type": "default"+ },{"id": "edge-9e8d7c6b-width-9a73db93-width","source": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",@@ -1020,52 +1023,12 @@"type": "default"},{- "id": "edge-9b6d1f04-video-52e0f43e-video",- "source": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",- "sourceHandle": "video",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "targetHandle": "video",- "type": "default"- },- {- "id": "edge-9b6d1f04-video-9e2b5033-source_video",- "source": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",- "sourceHandle": "video",+ "id": "edge-52e0f43e-source_video-9e2b5033-source_video",+ "source": "52e0f43e-0593-4ba6-bb50-df63464a6189",+ "sourceHandle": "source_video","target": "9e2b5033-4c5d-4e7f-a081-9c0d1e2f3a04","targetHandle": "source_video","type": "default"- },- {- "id": "edge-9b6d1f04-width-9e8d7c6b-width",- "source": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",- "sourceHandle": "width",- "target": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",- "targetHandle": "width",- "type": "default"- },- {- "id": "edge-9b6d1f04-height-9e8d7c6b-height",- "source": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",- "sourceHandle": "height",- "target": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",- "targetHandle": "height",- "type": "default"- },- {- "id": "edge-9e8d7c6b-width-52e0f43e-width",- "source": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",- "sourceHandle": "width",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "targetHandle": "width",- "type": "default"- },- {- "id": "edge-9e8d7c6b-height-52e0f43e-height",- "source": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",- "sourceHandle": "height",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "targetHandle": "height",- "type": "default"}],"form": {@@ -1102,7 +1065,7 @@"type": "node-field","data": {"fieldIdentifier": {- "nodeId": "9b6d1f04-3c2a-4e58-9f71-2b8c4d6e0a10",+ "nodeId": "52e0f43e-0593-4ba6-bb50-df63464a6189","fieldName": "video"},"showDescription": falsediff --git a/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning w_ Concept LoRAs.json b/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning w_ Concept LoRAs.jsonindex 62cb680485..c5c783c9fb 100644--- a/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning w_ Concept LoRAs.json+++ b/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning w_ Concept LoRAs.json@@ -5,7 +5,7 @@"version": "1.1.0","contact": "","tags": "wan2.2, video to video, video, lightning, lora",- "notes": "Your footage is conformed to the model's canvas before the join. Wan renders onto a 16-pixel grid at the resolution you pick in the form, and Concatenate Videos refuses clips of differing size, so the trimmed source is resampled onto the resolved canvas (aspect is snapped to the nearest grid size, so a 16:9 source is stretched very slightly). Changing Target Resolution rescales the source segment to match.\n\nEach InvokeAI install assigns its own internal model IDs, so the model fields are left blank -- select these in the form after loading:\n\nMain Model node:\n- Main Model: Wan 2.2 I2V A14B High Noise (Q4_K_M GGUF recommended for <=16 GB VRAM)\n- Transformer (Low Noise): Wan 2.2 I2V A14B Low Noise (Q4_K_M)\n- VAE: Wan 2.2 A14B VAE\n- T5 Encoder: Wan T5 Encoder (UMT5-XXL)\n\nLightning LoRAs (4-step distillation, I2V variant):\n- Apply Lightning LoRA (High Noise): Wan 2.2 I2V Lightning High Noise (4-step)\n- Apply Lightning LoRA (Low Noise): Wan 2.2 I2V Lightning Low Noise (4-step)\n\nOptional concept LoRAs (your own style/subject LoRAs):\n- Apply Concept LoRA (High Noise) / (Low Noise): leave empty, or select a high/low-noise concept LoRA pair.\n\nManually edit the \"Concatenate Videos\" node to fine-tune the transition type and number of transition frames.",+ "notes": "The generated segment is resampled onto your source clip's canvas before the join. The model renders only onto its own canvas family, so the two clips will rarely match, and Concatenate Videos refuses clips of differing size -- 'Size Mismatch' on that node is set to 'match_first' to reconcile them. Your footage keeps its own resolution, so a continuation generated at a smaller canvas is upscaled and will look softer than the source.\n\nEach InvokeAI install assigns its own internal model IDs, so the model fields are left blank -- select these in the form after loading:\n\nMain Model node:\n- Main Model: Wan 2.2 I2V A14B High Noise (Q4_K_M GGUF recommended for <=16 GB VRAM)\n- Transformer (Low Noise): Wan 2.2 I2V A14B Low Noise (Q4_K_M)\n- VAE: Wan 2.2 A14B VAE\n- T5 Encoder: Wan T5 Encoder (UMT5-XXL)\n\nLightning LoRAs (4-step distillation, I2V variant):\n- Apply Lightning LoRA (High Noise): Wan 2.2 I2V Lightning High Noise (4-step)\n- Apply Lightning LoRA (Low Noise): Wan 2.2 I2V Lightning Low Noise (4-step)\n\nOptional concept LoRAs (your own style/subject LoRAs):\n- Apply Concept LoRA (High Noise) / (Low Noise): leave empty, or select a high/low-noise concept LoRA pair.\n\nManually edit the \"Concatenate Videos\" node to fine-tune the transition type and number of transition frames.","exposedFields": [{"nodeId": "1a0e6c7b-9d2f-4b3c-8e1a-2f3d4c5b6a7e",@@ -570,10 +570,10 @@"type": "invocation","data": {"id": "4b32c22b-679d-4d5e-a167-c3309265fcd9",- "version": "1.1.0",+ "version": "1.2.0","nodePack": "invokeai","label": "",- "notes": "",+ "notes": "Joins the source clip and the generated continuation. Size Mismatch is 'match_first', so the generated clip is resampled onto the source clip's canvas -- the model renders onto its own fixed canvas family and will rarely match your footage, and without this the join fails outright. Your source keeps its own resolution; the generated segment is the part that gets rescaled.","type": "video_concat","inputs": {"board": {@@ -609,6 +609,12 @@"label": "","description": "","value": 0+ },+ "size_mismatch": {+ "name": "size_mismatch",+ "label": "",+ "description": "",+ "value": "match_first"}},"dynamicInputTemplates": {},@@ -725,33 +731,6 @@"y": 229.5}},- {- "id": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "type": "invocation",- "data": {- "id": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "version": "1.0.0",- "nodePack": "invokeai",- "label": "Source Video",- "notes": "The clip to continue. Its dimensions decide the canvas: the aspect ratio here is snapped to the nearest size Wan can render, and the trimmed source is resampled onto that canvas before the two clips are joined.",- "type": "video",- "inputs": {- "video": {- "name": "video",- "label": "Source Video",- "description": "",- "value": null- }- },- "isOpen": true,- "isIntermediate": true,- "useCache": true- },- "position": {- "x": -350,- "y": 0- }- },{"id": "52e0f43e-0593-4ba6-bb50-df63464a6189","type": "invocation",@@ -760,7 +739,7 @@"version": "1.3.0","nodePack": "invokeai","label": "",- "notes": "Trims the source clip to the part you want to keep, and resamples it onto the canvas resolved by Wan 2.2 I2V Ideal Dimensions. Both clips must share a size before Concatenate Videos will join them, and Wan renders only onto its own 16-pixel grid, so the source segment is brought onto that canvas here. Output frame rate still follows the source (fps 0).",+ "notes": "","type": "extract_video_range","inputs": {"board": {@@ -796,18 +775,6 @@"label": "","description": "","value": 0- },- "width": {- "name": "width",- "label": "",- "description": "",- "value": 0- },- "height": {- "name": "height",- "label": "",- "description": "",- "value": 0}},"dynamicInputTemplates": {},@@ -1035,6 +1002,22 @@"sourceHandle": "value","targetHandle": "num_frames"},+ {+ "id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73awidth-d27f29bf-6f26-4088-b1cc-c722ecd9fd61width",+ "type": "default",+ "source": "c2b5afb3-d079-4afb-9354-4c1a7aeae73a",+ "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",+ "sourceHandle": "width",+ "targetHandle": "width"+ },+ {+ "id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73aheight-d27f29bf-6f26-4088-b1cc-c722ecd9fd61height",+ "type": "default",+ "source": "c2b5afb3-d079-4afb-9354-4c1a7aeae73a",+ "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",+ "sourceHandle": "height",+ "targetHandle": "height"+ },{"id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73aimage-97c6fecb-8354-4ace-b337-e544b0ba9982image","type": "default",@@ -1122,46 +1105,6 @@"target": "4d3b9faf-c05b-7e6f-bf4d-5c6a7f8e9dab","sourceHandle": "transformer","targetHandle": "transformer"- },- {- "id": "edge-srcvideo-extract",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "video",- "targetHandle": "video"- },- {- "id": "edge-srcvideo-ideal-w",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "sourceHandle": "width",- "targetHandle": "width"- },- {- "id": "edge-srcvideo-ideal-h",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "sourceHandle": "height",- "targetHandle": "height"- },- {- "id": "edge-ideal-extract-w",- "type": "default",- "source": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "width",- "targetHandle": "width"- },- {- "id": "edge-ideal-extract-h",- "type": "default",- "source": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "height",- "targetHandle": "height"}],"form": {@@ -1583,7 +1526,7 @@"parentId": "container-1lpcsDWjRx","data": {"fieldIdentifier": {- "nodeId": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",+ "nodeId": "52e0f43e-0593-4ba6-bb50-df63464a6189","fieldName": "video"},"showDescription": falsediff --git a/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning.json b/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning.jsonindex fe888c3531..ed115aa6b7 100644--- a/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning.json+++ b/invokeai/app/services/workflow_records/default_workflows/Extend Video - Wan 2.2 Lightning.json@@ -5,7 +5,7 @@"version": "1.1.0","contact": "","tags": "wan2.2, video to video, video, lightning, lora",- "notes": "Your footage is conformed to the model's canvas before the join. Wan renders onto a 16-pixel grid at the resolution you pick in the form, and Concatenate Videos refuses clips of differing size, so the trimmed source is resampled onto the resolved canvas (aspect is snapped to the nearest grid size, so a 16:9 source is stretched very slightly). Changing Target Resolution rescales the source segment to match.\n\nEach InvokeAI install assigns its own internal model IDs, so the model fields are left blank -- select these in the form after loading:\n\nMain Model node:\n- Main Model: Wan 2.2 I2V A14B High Noise (Q4_K_M GGUF recommended for <=16 GB VRAM)\n- Transformer (Low Noise): Wan 2.2 I2V A14B Low Noise (Q4_K_M)\n- VAE: Wan 2.2 A14B VAE\n- T5 Encoder: Wan T5 Encoder (UMT5-XXL)\n\nLightning LoRAs (4-step distillation, I2V variant):\n- Apply Lightning LoRA (High Noise): Wan 2.2 I2V Lightning High Noise (4-step)\n- Apply Lightning LoRA (Low Noise): Wan 2.2 I2V Lightning Low Noise (4-step)\n\nEdit the \"Concatenate Videos\" node to adjust the transition and number of transition frames.",+ "notes": "The generated segment is resampled onto your source clip's canvas before the join. The model renders only onto its own canvas family, so the two clips will rarely match, and Concatenate Videos refuses clips of differing size -- 'Size Mismatch' on that node is set to 'match_first' to reconcile them. Your footage keeps its own resolution, so a continuation generated at a smaller canvas is upscaled and will look softer than the source.\n\nEach InvokeAI install assigns its own internal model IDs, so the model fields are left blank -- select these in the form after loading:\n\nMain Model node:\n- Main Model: Wan 2.2 I2V A14B High Noise (Q4_K_M GGUF recommended for <=16 GB VRAM)\n- Transformer (Low Noise): Wan 2.2 I2V A14B Low Noise (Q4_K_M)\n- VAE: Wan 2.2 A14B VAE\n- T5 Encoder: Wan T5 Encoder (UMT5-XXL)\n\nLightning LoRAs (4-step distillation, I2V variant):\n- Apply Lightning LoRA (High Noise): Wan 2.2 I2V Lightning High Noise (4-step)\n- Apply Lightning LoRA (Low Noise): Wan 2.2 I2V Lightning Low Noise (4-step)\n\nEdit the \"Concatenate Videos\" node to adjust the transition and number of transition frames.","exposedFields": [{"nodeId": "1a0e6c7b-9d2f-4b3c-8e1a-2f3d4c5b6a7e",@@ -564,10 +564,10 @@"type": "invocation","data": {"id": "4b32c22b-679d-4d5e-a167-c3309265fcd9",- "version": "1.1.0",+ "version": "1.2.0","nodePack": "invokeai","label": "",- "notes": "",+ "notes": "Joins the source clip and the generated continuation. Size Mismatch is 'match_first', so the generated clip is resampled onto the source clip's canvas -- the model renders onto its own fixed canvas family and will rarely match your footage, and without this the join fails outright. Your source keeps its own resolution; the generated segment is the part that gets rescaled.","type": "video_concat","inputs": {"board": {@@ -603,6 +603,12 @@"label": "","description": "","value": 0+ },+ "size_mismatch": {+ "name": "size_mismatch",+ "label": "",+ "description": "",+ "value": "match_first"}},"isOpen": true,@@ -715,33 +721,6 @@"y": 105.04759620704448}},- {- "id": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "type": "invocation",- "data": {- "id": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "version": "1.0.0",- "nodePack": "invokeai",- "label": "Source Video",- "notes": "The clip to continue. Its dimensions decide the canvas: the aspect ratio here is snapped to the nearest size Wan can render, and the trimmed source is resampled onto that canvas before the two clips are joined.",- "type": "video",- "inputs": {- "video": {- "name": "video",- "label": "Source Video",- "description": "",- "value": null- }- },- "isOpen": true,- "isIntermediate": true,- "useCache": true- },- "position": {- "x": -560.7591703842118,- "y": 102.45237449232519- }- },{"id": "52e0f43e-0593-4ba6-bb50-df63464a6189","type": "invocation",@@ -750,7 +729,7 @@"version": "1.3.0","nodePack": "invokeai","label": "",- "notes": "Trims the source clip to the part you want to keep, and resamples it onto the canvas resolved by Wan 2.2 I2V Ideal Dimensions. Both clips must share a size before Concatenate Videos will join them, and Wan renders only onto its own 16-pixel grid, so the source segment is brought onto that canvas here. Output frame rate still follows the source (fps 0).",+ "notes": "","type": "extract_video_range","inputs": {"board": {@@ -786,18 +765,6 @@"label": "","description": "","value": 0- },- "width": {- "name": "width",- "label": "",- "description": "",- "value": 0- },- "height": {- "name": "height",- "label": "",- "description": "",- "value": 0}},"isOpen": true,@@ -998,6 +965,22 @@"sourceHandle": "value","targetHandle": "num_frames"},+ {+ "id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73awidth-d27f29bf-6f26-4088-b1cc-c722ecd9fd61width",+ "type": "default",+ "source": "c2b5afb3-d079-4afb-9354-4c1a7aeae73a",+ "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",+ "sourceHandle": "width",+ "targetHandle": "width"+ },+ {+ "id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73aheight-d27f29bf-6f26-4088-b1cc-c722ecd9fd61height",+ "type": "default",+ "source": "c2b5afb3-d079-4afb-9354-4c1a7aeae73a",+ "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",+ "sourceHandle": "height",+ "targetHandle": "height"+ },{"id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73aimage-97c6fecb-8354-4ace-b337-e544b0ba9982image","type": "default",@@ -1069,46 +1052,6 @@"target": "6f5dcb1c-e27d-9fb0-d16f-7e8cbaa1fcbd","sourceHandle": "value","targetHandle": "fps"- },- {- "id": "edge-srcvideo-extract",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "video",- "targetHandle": "video"- },- {- "id": "edge-srcvideo-ideal-w",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "sourceHandle": "width",- "targetHandle": "width"- },- {- "id": "edge-srcvideo-ideal-h",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "sourceHandle": "height",- "targetHandle": "height"- },- {- "id": "edge-ideal-extract-w",- "type": "default",- "source": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "width",- "targetHandle": "width"- },- {- "id": "edge-ideal-extract-h",- "type": "default",- "source": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "height",- "targetHandle": "height"}],"form": {@@ -1526,7 +1469,7 @@"parentId": "container-1lpcsDWjRx","data": {"fieldIdentifier": {- "nodeId": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",+ "nodeId": "52e0f43e-0593-4ba6-bb50-df63464a6189","fieldName": "video"},"showDescription": falsediff --git a/invokeai/app/services/workflow_records/default_workflows/Extend Video to Image - Wan 2.2 Lightning.json b/invokeai/app/services/workflow_records/default_workflows/Extend Video to Image - Wan 2.2 Lightning.jsonindex e058ce343e..6c58d083d1 100644--- a/invokeai/app/services/workflow_records/default_workflows/Extend Video to Image - Wan 2.2 Lightning.json+++ b/invokeai/app/services/workflow_records/default_workflows/Extend Video to Image - Wan 2.2 Lightning.json@@ -5,7 +5,7 @@"version": "1.1.0","contact": "","tags": "wan2.2, video to video, video, lightning, lora",- "notes": "Your footage is conformed to the model's canvas before the join. Wan renders onto a 16-pixel grid at the resolution you pick in the form, and Concatenate Videos refuses clips of differing size, so the trimmed source is resampled onto the resolved canvas (aspect is snapped to the nearest grid size, so a 16:9 source is stretched very slightly). Changing Target Resolution rescales the source segment to match.\n\nEach InvokeAI install assigns its own internal model IDs, so the model fields are left blank -- select these in the form after loading:\n\nMain Model node:\n- Main Model: Wan 2.2 I2V A14B High Noise (Q4_K_M GGUF recommended for <=16 GB VRAM)\n- Transformer (Low Noise): Wan 2.2 I2V A14B Low Noise (Q4_K_M)\n- VAE: Wan 2.2 A14B VAE\n- T5 Encoder: Wan T5 Encoder (UMT5-XXL)\n\nLightning LoRAs (4-step distillation, I2V variant):\n- Apply Lightning LoRA (High Noise): Wan 2.2 I2V Lightning High Noise (4-step)\n- Apply Lightning LoRA (Low Noise): Wan 2.2 I2V Lightning Low Noise (4-step)\n\nEdit the \"Concatenate Videos\" node to adjust the transition and number of transition frames.",+ "notes": "The generated segment is resampled onto your source clip's canvas before the join. The model renders only onto its own canvas family, so the two clips will rarely match, and Concatenate Videos refuses clips of differing size -- 'Size Mismatch' on that node is set to 'match_first' to reconcile them. Your footage keeps its own resolution, so a continuation generated at a smaller canvas is upscaled and will look softer than the source.\n\nEach InvokeAI install assigns its own internal model IDs, so the model fields are left blank -- select these in the form after loading:\n\nMain Model node:\n- Main Model: Wan 2.2 I2V A14B High Noise (Q4_K_M GGUF recommended for <=16 GB VRAM)\n- Transformer (Low Noise): Wan 2.2 I2V A14B Low Noise (Q4_K_M)\n- VAE: Wan 2.2 A14B VAE\n- T5 Encoder: Wan T5 Encoder (UMT5-XXL)\n\nLightning LoRAs (4-step distillation, I2V variant):\n- Apply Lightning LoRA (High Noise): Wan 2.2 I2V Lightning High Noise (4-step)\n- Apply Lightning LoRA (Low Noise): Wan 2.2 I2V Lightning Low Noise (4-step)\n\nEdit the \"Concatenate Videos\" node to adjust the transition and number of transition frames.","exposedFields": [{"nodeId": "1a0e6c7b-9d2f-4b3c-8e1a-2f3d4c5b6a7e",@@ -485,7 +485,7 @@"parentId": "container-1lpcsDWjRx","data": {"fieldIdentifier": {- "nodeId": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",+ "nodeId": "52e0f43e-0593-4ba6-bb50-df63464a6189","fieldName": "video"},"showDescription": false@@ -1062,10 +1062,10 @@"type": "invocation","data": {"id": "4b32c22b-679d-4d5e-a167-c3309265fcd9",- "version": "1.1.0",+ "version": "1.2.0","nodePack": "invokeai","label": "",- "notes": "",+ "notes": "Joins the source clip and the generated continuation. Size Mismatch is 'match_first', so the generated clip is resampled onto the source clip's canvas -- the model renders onto its own fixed canvas family and will rarely match your footage, and without this the join fails outright. Your source keeps its own resolution; the generated segment is the part that gets rescaled.","type": "video_concat","inputs": {"board": {@@ -1101,6 +1101,12 @@"label": "","description": "","value": 0+ },+ "size_mismatch": {+ "name": "size_mismatch",+ "label": "",+ "description": "",+ "value": "match_first"}},"isOpen": true,@@ -1213,33 +1219,6 @@"y": 105.04759620704448}},- {- "id": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "type": "invocation",- "data": {- "id": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "version": "1.0.0",- "nodePack": "invokeai",- "label": "Source Video",- "notes": "The clip to continue. Its dimensions decide the canvas: the aspect ratio here is snapped to the nearest size Wan can render, and the trimmed source is resampled onto that canvas before the two clips are joined.",- "type": "video",- "inputs": {- "video": {- "name": "video",- "label": "Source Video",- "description": "",- "value": null- }- },- "isOpen": true,- "isIntermediate": true,- "useCache": true- },- "position": {- "x": -560.7591703842118,- "y": 102.45237449232519- }- },{"id": "52e0f43e-0593-4ba6-bb50-df63464a6189","type": "invocation",@@ -1248,7 +1227,7 @@"version": "1.3.0","nodePack": "invokeai","label": "",- "notes": "Trims the source clip to the part you want to keep, and resamples it onto the canvas resolved by Wan 2.2 I2V Ideal Dimensions. Both clips must share a size before Concatenate Videos will join them, and Wan renders only onto its own 16-pixel grid, so the source segment is brought onto that canvas here. Output frame rate still follows the source (fps 0).",+ "notes": "","type": "extract_video_range","inputs": {"board": {@@ -1284,18 +1263,6 @@"label": "","description": "","value": 0- },- "width": {- "name": "width",- "label": "",- "description": "",- "value": 0- },- "height": {- "name": "height",- "label": "",- "description": "",- "value": 0}},"isOpen": true,@@ -1577,6 +1544,22 @@"sourceHandle": "value","targetHandle": "num_frames"},+ {+ "id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73awidth-d27f29bf-6f26-4088-b1cc-c722ecd9fd61width",+ "type": "default",+ "source": "c2b5afb3-d079-4afb-9354-4c1a7aeae73a",+ "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",+ "sourceHandle": "width",+ "targetHandle": "width"+ },+ {+ "id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73aheight-d27f29bf-6f26-4088-b1cc-c722ecd9fd61height",+ "type": "default",+ "source": "c2b5afb3-d079-4afb-9354-4c1a7aeae73a",+ "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",+ "sourceHandle": "height",+ "targetHandle": "height"+ },{"id": "reactflow__edge-c2b5afb3-d079-4afb-9354-4c1a7aeae73aimage-97c6fecb-8354-4ace-b337-e544b0ba9982image","type": "default",@@ -1680,46 +1663,6 @@"target": "97c6fecb-8354-4ace-b337-e544b0ba9982","sourceHandle": "image","targetHandle": "end_image"- },- {- "id": "edge-srcvideo-extract",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "video",- "targetHandle": "video"- },- {- "id": "edge-srcvideo-ideal-w",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "sourceHandle": "width",- "targetHandle": "width"- },- {- "id": "edge-srcvideo-ideal-h",- "type": "default",- "source": "7c3a1e58-4b62-4d09-9a17-5e8f2c0b6d31",- "target": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "sourceHandle": "height",- "targetHandle": "height"- },- {- "id": "edge-ideal-extract-w",- "type": "default",- "source": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "width",- "targetHandle": "width"- },- {- "id": "edge-ideal-extract-h",- "type": "default",- "source": "d27f29bf-6f26-4088-b1cc-c722ecd9fd61",- "target": "52e0f43e-0593-4ba6-bb50-df63464a6189",- "sourceHandle": "height",- "targetHandle": "height"}]}diff --git a/invokeai/frontend/web/openapi.json b/invokeai/frontend/web/openapi.jsonindex 239890f6a6..395ef8ea78 100644--- a/invokeai/frontend/web/openapi.json+++ b/invokeai/frontend/web/openapi.json@@ -28506,7 +28506,7 @@"category": "video","class": "invocation","classification": "prototype",- "description": "Trim a video to a contiguous frame range and re-encode as MP4.\n\nBoth bounds are inclusive and 0-based \u2014 ``start_frame=10, end_frame=50``\nemits 41 frames. Negative indices count from the end (``end_frame=-1``\nis the final frame), matching ``video_frame_extract``. The output frame\nrate defaults to the source video's frame rate; set ``fps=0`` to inherit\nit (or 16 fps if the source rate can't be probed). If the source has an\naudio track, the same range of it is carried into the output (retimed\nwith the video when the output fps changes playback speed); silent\nsources stay silent.\n\nSetting ``width``/``height`` conforms the trimmed clip to that canvas (0 on an\naxis keeps the source's). This is what lets a trimmed source be concatenated\nwith a generated clip: Concatenate Videos rejects mismatched dimensions, and\nvideo models render onto their own fixed canvas family, so the source segment\nhas to be brought onto the same canvas first.\n\nThe resolved (positive) ``start_frame`` and ``end_frame`` are also emitted as\noutputs, so chained workflows can re-use the boundary indices \u2014 e.g. feeding\nthem into a downstream Frame from Video to extract the same boundary frame.",+ "description": "Trim a video to a contiguous frame range and re-encode as MP4.\n\nBoth bounds are inclusive and 0-based \u2014 ``start_frame=10, end_frame=50``\nemits 41 frames. Negative indices count from the end (``end_frame=-1``\nis the final frame), matching ``video_frame_extract``. The output frame\nrate defaults to the source video's frame rate; set ``fps=0`` to inherit\nit (or 16 fps if the source rate can't be probed). If the source has an\naudio track, the same range of it is carried into the output (retimed\nwith the video when the output fps changes playback speed); silent\nsources stay silent.\n\nThe resolved (positive) ``start_frame`` and ``end_frame`` are also emitted as\noutputs, so chained workflows can re-use the boundary indices \u2014 e.g. feeding\nthem into a downstream Frame from Video to extract the same boundary frame, and the\ninput video is echoed back on ``source_video`` so a graph can record the clip the user\nchose rather than the freshly-encoded trim.","node_pack": "invokeai","properties": {"board": {@@ -28614,28 +28614,6 @@"title": "Fps","type": "integer"},- "width": {- "default": 0,- "description": "Output width in pixels. 0 = keep the source width. Set both width and height to conform the trimmed clip to a specific canvas \u2014 e.g. to match a generated clip before concatenating, since Concatenate Videos rejects mismatched dimensions.",- "field_kind": "input",- "input": "any",- "minimum": 0,- "orig_default": 0,- "orig_required": false,- "title": "Width",- "type": "integer"- },- "height": {- "default": 0,- "description": "Output height in pixels. 0 = keep the source height. Aspect ratio is not preserved: the frame is resampled to exactly the requested canvas.",- "field_kind": "input",- "input": "any",- "minimum": 0,- "orig_default": 0,- "orig_required": false,- "title": "Height",- "type": "integer"- },"type": {"const": "extract_video_range","default": "extract_video_range",@@ -28663,6 +28641,13 @@"field_kind": "output","ui_hidden": false},+ "source_video": {+ "$ref": "#/components/schemas/VideoField",+ "description": "The video the range was taken from",+ "field_kind": "output",+ "title": "Source Video",+ "ui_hidden": false+ },"width": {"description": "The width of the video in pixels","field_kind": "output",@@ -28723,6 +28708,7 @@"required": ["output_meta","video",+ "source_video","width","height","num_frames",@@ -92039,7 +92025,7 @@"category": "video","class": "invocation","classification": "prototype",- "description": "Join two or more videos into a single MP4.\n\nAudio: if any input carries an audio track, the output gets an AAC track assembled on\nthe emitted timeline \u2014 silent inputs contribute silence, `cut` splices the tracks,\n`crossfade` blends them equal-power over the transition window, and\n`fade_through_black` fades the outgoing track to silence and the incoming one up from\nit, mirroring the video. An fps override retimes audio with the video (a deliberate\nspeed/pitch change). If no input has audio, the output has no audio stream.\n\nTransitions:\n\n* ``cut`` \u2014 hard splice, no blending. Fastest; total length is the sum of inputs.\n* ``crossfade`` \u2014 linear A\u2192B cross-dissolve over ``transition_frames``. Each boundary\n consumes ``transition_frames`` from both adjacent clips, so total length is\n ``sum(inputs) - transition_frames * (n - 1)``.\n* ``fade_through_black`` \u2014 A fades to black, then B fades in from black. Each boundary\n consumes ``transition_frames // 2`` frames from the preceding clip's tail and the\n remainder (``transition_frames - transition_frames // 2``) from the next clip's head,\n so the total emitted is exactly ``transition_frames`` per boundary \u2014 even for odd\n ``transition_frames`` \u2014 and the overall length equals the sum of inputs.\n\nAll inputs must share the same pixel dimensions. Output frame rate defaults to the\nfirst input's fps; override with ``fps`` to force a specific rate (the frames are not\nresampled, only the container is encoded at the new rate).",+ "description": "Join two or more videos into a single MP4.\n\nAudio: if any input carries an audio track, the output gets an AAC track assembled on\nthe emitted timeline \u2014 silent inputs contribute silence, `cut` splices the tracks,\n`crossfade` blends them equal-power over the transition window, and\n`fade_through_black` fades the outgoing track to silence and the incoming one up from\nit, mirroring the video. An fps override retimes audio with the video (a deliberate\nspeed/pitch change). If no input has audio, the output has no audio stream.\n\nTransitions:\n\n* ``cut`` \u2014 hard splice, no blending. Fastest; total length is the sum of inputs.\n* ``crossfade`` \u2014 linear A\u2192B cross-dissolve over ``transition_frames``. Each boundary\n consumes ``transition_frames`` from both adjacent clips, so total length is\n ``sum(inputs) - transition_frames * (n - 1)``.\n* ``fade_through_black`` \u2014 A fades to black, then B fades in from black. Each boundary\n consumes ``transition_frames // 2`` frames from the preceding clip's tail and the\n remainder (``transition_frames - transition_frames // 2``) from the next clip's head,\n so the total emitted is exactly ``transition_frames`` per boundary \u2014 even for odd\n ``transition_frames`` \u2014 and the overall length equals the sum of inputs.\n\nInputs must share the same pixel dimensions. ``size_mismatch`` decides what happens\nwhen they do not: ``error`` (the default) refuses the join, and ``match_first``\nresamples every later clip onto the first clip's canvas. ``match_first`` is what lets a\ngenerated clip be appended to source footage \u2014 video models render onto their own fixed\ncanvas family, so a generated continuation rarely matches the clip it extends.\n\nOutput frame rate defaults to the first input's fps; override with ``fps`` to force a\nspecific rate (the frames are not resampled in time, only the container is encoded at\nthe new rate).","node_pack": "invokeai","properties": {"board": {@@ -92160,6 +92146,17 @@"orig_required": false,"title": "Fps"},+ "size_mismatch": {+ "default": "error",+ "description": "What to do when the inputs do not all share the same pixel dimensions. 'error' refuses the join; 'match_first' resamples every later clip onto the first clip's canvas, so a generated clip can be appended to source footage it does not match.",+ "enum": ["error", "match_first"],+ "field_kind": "input",+ "input": "any",+ "orig_default": "error",+ "orig_required": false,+ "title": "Size Mismatch",+ "type": "string"+ },"type": {"const": "video_concat","default": "video_concat",@@ -92172,7 +92169,7 @@"tags": ["video", "concat", "transition"],"title": "Concatenate Videos","type": "object",- "version": "1.1.0",+ "version": "1.2.0","output": {"$ref": "#/components/schemas/VideoOutput"}diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.tsindex bd27b6dc1a..c45c7814d0 100644--- a/invokeai/frontend/web/src/services/api/schema.ts+++ b/invokeai/frontend/web/src/services/api/schema.ts@@ -11119,15 +11119,11 @@ export type components = {* with the video when the output fps changes playback speed); silent* sources stay silent.*- * Setting ``width``/``height`` conforms the trimmed clip to that canvas (0 on an- * axis keeps the source's). This is what lets a trimmed source be concatenated- * with a generated clip: Concatenate Videos rejects mismatched dimensions, and- * video models render onto their own fixed canvas family, so the source segment- * has to be brought onto the same canvas first.- ** The resolved (positive) ``start_frame`` and ``end_frame`` are also emitted as* outputs, so chained workflows can re-use the boundary indices — e.g. feeding- * them into a downstream Frame from Video to extract the same boundary frame.+ * them into a downstream Frame from Video to extract the same boundary frame, and the+ * input video is echoed back on ``source_video`` so a graph can record the clip the user+ * chose rather than the freshly-encoded trim.*/ExtractVideoRangeInvocation: {/**@@ -11180,18 +11176,6 @@ export type components = {* @default 0*/fps?: number;- /**- * Width- * @description Output width in pixels. 0 = keep the source width. Set both width and height to conform the trimmed clip to a specific canvas — e.g. to match a generated clip before concatenating, since Concatenate Videos rejects mismatched dimensions.- * @default 0- */- width?: number;- /**- * Height- * @description Output height in pixels. 0 = keep the source height. Aspect ratio is not preserved: the frame is resampled to exactly the requested canvas.- * @default 0- */- height?: number;/*** type* @default extract_video_range@@ -11211,6 +11195,11 @@ export type components = {ExtractVideoRangeOutput: {/** @description The trimmed video */video: components["schemas"]["VideoField"];+ /**+ * Source Video+ * @description The video the range was taken from+ */+ source_video: components["schemas"]["VideoField"];/*** Width* @description The width of the video in pixels@@ -40849,9 +40838,15 @@ export type components = {* so the total emitted is exactly ``transition_frames`` per boundary — even for odd* ``transition_frames`` — and the overall length equals the sum of inputs.*- * All inputs must share the same pixel dimensions. Output frame rate defaults to the- * first input's fps; override with ``fps`` to force a specific rate (the frames are not- * resampled, only the container is encoded at the new rate).+ * Inputs must share the same pixel dimensions. ``size_mismatch`` decides what happens+ * when they do not: ``error`` (the default) refuses the join, and ``match_first``+ * resamples every later clip onto the first clip's canvas. ``match_first`` is what lets a+ * generated clip be appended to source footage — video models render onto their own fixed+ * canvas family, so a generated continuation rarely matches the clip it extends.+ *+ * Output frame rate defaults to the first input's fps; override with ``fps`` to force a+ * specific rate (the frames are not resampled in time, only the container is encoded at+ * the new rate).*/VideoConcatInvocation: {/**@@ -40906,6 +40901,13 @@ export type components = {* @default null*/fps?: number | null;+ /**+ * Size Mismatch+ * @description What to do when the inputs do not all share the same pixel dimensions. 'error' refuses the join; 'match_first' resamples every later clip onto the first clip's canvas, so a generated clip can be appended to source footage it does not match.+ * @default error+ * @enum {string}+ */+ size_mismatch?: "error" | "match_first";/*** type* @default video_concatdiff --git a/invokeai/frontend/webv2/src/features/workflow/core/validation.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/validation.test.tsindex 637bfd9eb0..859967608a 100644--- a/invokeai/frontend/webv2/src/features/workflow/core/validation.test.ts+++ b/invokeai/frontend/webv2/src/features/workflow/core/validation.test.ts@@ -207,22 +207,46 @@ describe('getCompatibleInputTemplate', () => {expect(getCompatibleInputTemplate(template, null)?.name).toBe('early');});- it('never auto-connects to an internal-kind input', () => {+ it('skips internal-kind inputs when the source type is unresolved', () => {// `metadata` has no `ui_order` and precedes the authored fields in the schema, so it- // sorts first on every WithMetadata node. Dragging onto the canvas must still land on- // the node's real input -- including when the source type could not be resolved, which- // skips the type check entirely.+ // sorts first on every WithMetadata node. With an unresolved source the type check is+ // skipped entirely, so without the guard it would bury the node's real input.const baseInput = templates.number.inputs.value;+ const metadata = {+ ...baseInput,+ fieldKind: 'internal' as const,+ input: 'connection' as const,+ name: 'metadata',+ type: { batch: false, cardinality: 'SINGLE' as const, name: 'MetadataField' },+ };+ const template = {+ ...templates.number,+ inputs: { metadata, value: { ...baseInput, name: 'value' } },+ };++ expect(getCompatibleInputTemplate(template, null)?.name).toBe('value');+ });++ it('still offers an internal-kind input to a source that genuinely matches it', () => {+ // Dragging a real MetadataField output onto a save node must land on `metadata` -- and+ // this function also decides which nodes the Add Node dialog offers for that drag, so+ // excluding internal fields outright would make every WithMetadata node unreachable.+ const baseInput = templates.number.inputs.value;+ const metadataType = { batch: false, cardinality: 'SINGLE' as const, name: 'MetadataField' };const template = {...templates.number,inputs: {- metadata: { ...baseInput, fieldKind: 'internal' as const, input: 'connection' as const, name: 'metadata' },- value: { ...baseInput, name: 'value' },+ metadata: {+ ...baseInput,+ fieldKind: 'internal' as const,+ input: 'connection' as const,+ name: 'metadata',+ type: metadataType,+ },},};- expect(getCompatibleInputTemplate(template, single('IntegerField'))?.name).toBe('value');- expect(getCompatibleInputTemplate(template, null)?.name).toBe('value');+ expect(getCompatibleInputTemplate(template, metadataType)?.name).toBe('metadata');});});diff --git a/invokeai/frontend/webv2/src/features/workflow/core/validation.ts b/invokeai/frontend/webv2/src/features/workflow/core/validation.tsindex 7f61733593..0703896b00 100644--- a/invokeai/frontend/webv2/src/features/workflow/core/validation.ts+++ b/invokeai/frontend/webv2/src/features/workflow/core/validation.ts@@ -176,10 +176,13 @@ export const getCompatibleInputTemplate = ((inputTemplate) =>!inputTemplate.uiHidden &&// `metadata` sorts first on every WithMetadata node (no `ui_order`, and it precedes- // the authored fields in the schema), so without this it would win the drag-to-canvas- // auto-connect for any source whose type it accepts — or for any source whose type- // could not be resolved, which skips the type check below entirely.- inputTemplate.fieldKind !== 'internal' &&+ // the authored fields in the schema). When the source type could not be resolved we+ // skip the type check below entirely and take the first candidate, so it would win+ // every time and bury the node's real input. A resolved source type still reaches it+ // — dragging an actual MetadataField output onto a save node should land on+ // `metadata`, and this function also gates which nodes the Add Node dialog offers+ // for a pending connection.+ !(sourceType === null && inputTemplate.fieldKind === 'internal') &&inputTemplate.input !== 'direct' &&(sourceType === null || validateConnectionTypes(sourceType, inputTemplate.type))) ?? nulldiff --git a/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts b/invokeai/frontend/webv2/src/features/workflow/data/templates.test.tsindex a39e3d0716..852e392df9 100644--- a/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts+++ b/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts@@ -184,16 +184,18 @@ describe('parseOpenApiToTemplates', () => {expect(denoise?.inputs.scheduler?.options).toEqual(['euler', 'ddim']);});- it('keeps the internal-kind metadata input, but drops board and node attributes', () => {- // `metadata` and `board` are the only two internal-kind properties in the schema.- // `metadata` has to be here or a bundled workflow's Core Metadata edge has no handle to- // land on and is dropped on re-save. `board` stays out: this app re-homes results onto- // the active gallery board after every run, so a per-node board control would do nothing.+ it('keeps internal-kind metadata and board inputs, but drops node attributes', () => {+ // `metadata` and `board` are the only two internal-kind properties in the schema, and+ // both are real inputs. Without `metadata` a bundled workflow's Core Metadata edge has+ // no handle to land on and is dropped on re-save; without `board` the seven bundled+ // workflows that expose it get an error in place of a Linear-tab control.const saveVideo = templates.save_video;- expect(Object.keys(saveVideo?.inputs ?? {}).sort()).toEqual(['latents', 'metadata']);+ expect(Object.keys(saveVideo?.inputs ?? {}).sort()).toEqual(['board', 'latents', 'metadata']);expect(saveVideo?.inputs.metadata?.type.name).toBe('MetadataField');+ expect(saveVideo?.inputs.board?.type.name).toBe('BoardField');expect(saveVideo?.inputs.metadata?.fieldKind).toBe('internal');+ expect(saveVideo?.inputs.board?.fieldKind).toBe('internal');expect(saveVideo?.inputs.latents?.fieldKind).toBe('input');});diff --git a/invokeai/frontend/webv2/src/features/workflow/data/templates.ts b/invokeai/frontend/webv2/src/features/workflow/data/templates.tsindex aaed625666..124d575797 100644--- a/invokeai/frontend/webv2/src/features/workflow/data/templates.ts+++ b/invokeai/frontend/webv2/src/features/workflow/data/templates.ts@@ -42,8 +42,6 @@ const isJsonObject = (value: unknown): value is JsonObject => typeof value === 'const INVOCATION_DENYLIST = new Set(['graph', 'linear_ui_output']);const RESERVED_INPUT_FIELD_NAMES = new Set(['id', 'type', 'use_cache', 'is_intermediate']);-/** `field_kind: 'internal'` properties that are nonetheless real, connectable inputs here. */-const CONNECTABLE_INTERNAL_FIELD_NAMES = new Set(['metadata']);const RESERVED_FIELD_TYPE_NAMES = new Set(['IsIntermediate']);const OPENAPI_TO_FIELD_TYPE_MAP: Record<string, string> = {@@ -284,21 +282,25 @@ const parseInvocationSchema = (schema: JsonObject, schemas: JsonObject): Invocat}// `internal` covers exactly two properties across the whole schema: `metadata` and- // `board`. `metadata` is admitted because it is a real, connectable input — a workflow- // that wires a Core Metadata node into a save node needs that handle to exist, and- // without it the edge is invisible in the editor and dropped on re-save.+ // `board`. Both are real inputs and both must be here.//- // `board` stays out. It is a direct input whose value this app does not honour: the- // queue runtime re-homes every result onto the active gallery board after a run- // (see `addImagesToDestination`), and `toBoardGraphValue` reads `'auto'` as "no board"- // where the v6 editor reads it as "the auto-add board". Admitting it would render a- // control on ~104 node types that silently does nothing. Revisit if those two are fixed.+ // `metadata`: a workflow that wires a Core Metadata node into a save node needs that+ // handle to exist, or the edge is invisible in the editor and dropped on re-save.+ //+ // `board`: seven bundled workflows expose it as a linear-UI field. The+ // exposedFields -> form migration does not check that a field has a template, and+ // NodeFieldControl renders "This field no longer exists in the project graph." when it+ // does not — so excluding `board` puts a red error in those workflows' Linear tab. It is+ // also in v6's templates, which reports a missing-field error for any node instance that+ // lacks it. Note the value is not fully honoured yet: the queue runtime re-homes results+ // onto the active gallery board after a run, and `toBoardGraphValue` reads 'auto' as "no+ // board" where v6 reads it as "the auto-add board".//// The node-level attributes (`id`, `type`, `use_cache`, `is_intermediate`) are// `node_attribute`, so they stay excluded here as well as by RESERVED_INPUT_FIELD_NAMES.- const isConnectableInternal = rawProperty.field_kind === 'internal' && CONNECTABLE_INTERNAL_FIELD_NAMES.has(name);+ const isInternal = rawProperty.field_kind === 'internal';- if (rawProperty.field_kind !== 'input' && !isConnectableInternal) {+ if (rawProperty.field_kind !== 'input' && !isInternal) {continue;}@@ -308,7 +310,7 @@ const parseInvocationSchema = (schema: JsonObject, schemas: JsonObject): Invocatcontinue;}- inputs[name] = buildInputTemplate(name, rawProperty, fieldType, isConnectableInternal ? 'internal' : 'input');+ inputs[name] = buildInputTemplate(name, rawProperty, fieldType, isInternal ? 'internal' : 'input');}const outputRefName = isJsonObject(schema.output) ? getRef(schema.output) : null;diff --git a/tests/app/invocations/test_video_concat.py b/tests/app/invocations/test_video_concat.pyindex 03c7715569..018ddbf595 100644--- a/tests/app/invocations/test_video_concat.py+++ b/tests/app/invocations/test_video_concat.py@@ -19,13 +19,20 @@ implementing the contract (the surrounding ``invoke()`` deals with imageioencode/decode plumbing that isn't germane to the math)."""+from pathlib import Pathfrom typing import Iterator+from unittest.mock import MagicMock, patchimport numpy as npimport pytestfrom invokeai.app.invocations.fields import VideoField-from invokeai.app.invocations.video_concat import MAX_TRANSITION_MEMORY_BYTES, VideoConcatInvocation, _crossfade+from invokeai.app.invocations.video_concat import (+ MAX_TRANSITION_MEMORY_BYTES,+ VideoConcatInvocation,+ _crossfade,+ _iter_frames_on_canvas,+)from invokeai.app.services.session_processor.session_processor_common import CanceledException@@ -228,3 +235,66 @@ class TestFrameRateValidation:fps=20,)assert invocation._resolve_output_fps([16.0, 24.0]) == 20.0+++class TestSizeMismatch:+ """Mismatched inputs: refuse by default, resample onto the first clip on request.++ A generated continuation never matches the footage it extends -- video models render+ onto their own fixed canvas family -- so the Extend workflows set `match_first` and let+ the source clip, which is first in the collect order, decide the output canvas.+ """++ @staticmethod+ def _invoke(size_mismatch: str, sizes: list[tuple[int, int]]) -> MagicMock:+ invocation = VideoConcatInvocation(+ videos=[VideoField(video_name=f"v{i}") for i in range(len(sizes))],+ transition="cut",+ size_mismatch=size_mismatch, # type: ignore[arg-type]+ )+ context = MagicMock()+ context.videos.get_path.side_effect = lambda name: Path(f"{name}.mp4")+ context.util.is_canceled.return_value = False+ probes = [(w, h, 1.0, 16.0) for (w, h) in sizes]+ # Each clip decodes at its own size; the node is what brings them onto one canvas.+ by_path = {f"v{i}.mp4": (w, h) for i, (w, h) in enumerate(sizes)}++ def frames(path: Path, **_: object) -> Iterator[np.ndarray]:+ w, h = by_path[path.name]+ return iter([np.full((h, w, 3), 7, dtype=np.uint8) for _ in range(4)])++ with (+ patch("invokeai.app.invocations.video_concat.probe_video", side_effect=probes),+ patch("invokeai.app.invocations.video_concat.make_mp4_writer", return_value=MagicMock()),+ patch("invokeai.app.invocations.video_concat.iter_video_frames", side_effect=frames),+ patch("invokeai.app.invocations.video_concat.extract_audio_pcm", return_value=None),+ patch("invokeai.app.invocations.video_concat.VideoOutput.build", return_value=MagicMock()),+ ):+ invocation.invoke(context)++ return context++ def test_mismatched_inputs_are_refused_by_default(self) -> None:+ with pytest.raises(ValueError, match="must share the same dimensions"):+ self._invoke("error", [(1920, 1080), (848, 480)])++ def test_match_first_saves_the_first_clips_canvas(self) -> None:+ context = self._invoke("match_first", [(1920, 1080), (848, 480)])+ saved = context.videos.save.call_args.kwargs+ assert (saved["width"], saved["height"]) == (1920, 1080)++ def test_matching_inputs_need_no_policy(self) -> None:+ context = self._invoke("error", [(848, 480), (848, 480)])+ saved = context.videos.save.call_args.kwargs+ assert (saved["width"], saved["height"]) == (848, 480)+++class TestIterFramesOnCanvas:+ def test_frames_are_resampled_to_the_target(self) -> None:+ frames = _clip(120, 3)+ assert [f.shape for f in _iter_frames_on_canvas(iter(frames), (8, 6))] == [(6, 8, 3)] * 3++ def test_frames_already_on_target_are_untouched(self) -> None:+ frames = _clip(120, 2)+ out = list(_iter_frames_on_canvas(iter(frames), (4, 4)))+ assert all(a is b for a, b in zip(out, frames, strict=True))diff --git a/tests/app/invocations/test_video_frame_extract_range.py b/tests/app/invocations/test_video_frame_extract_range.pyindex b679eaf7dd..c773312c67 100644--- a/tests/app/invocations/test_video_frame_extract_range.py+++ b/tests/app/invocations/test_video_frame_extract_range.py@@ -114,60 +114,16 @@ def test_invocation_only_saves_complete_requested_range(written: int, should_raicontext.videos.save.assert_called_once()-class TestWriteFrameRangeResizes:- """`resize_to` conforms the trimmed clip to a target canvas (see the concat pairing below)."""+def test_invocation_echoes_the_source_video_it_was_given() -> None:+ """`video` is a freshly-encoded trim; `source_video` is what the user actually picked.- def test_frames_are_resampled_to_the_requested_canvas(self) -> None:- writer = RecordingWriter()- written = _write_frame_range(_lazy_frames(4, [0]), writer, start=0, end=3, resize_to=(8, 6))- assert written == 4- assert [f.shape for f in writer.frames] == [(6, 8, 3)] * 4-- def test_matching_frames_pass_through_untouched(self) -> None:- writer = RecordingWriter()- _write_frame_range(_lazy_frames(2, [0]), writer, start=0, end=1, resize_to=(4, 4))- assert [f.shape for f in writer.frames] == [(4, 4, 3)] * 2---def _resize_invocation(**kwargs: object) -> tuple[ExtractVideoRangeInvocation, MagicMock]:- invocation = ExtractVideoRangeInvocation(- video=VideoField(video_name="input.mp4"), start_frame=0, end_frame=4, **kwargs- )+ Extend Video records the latter as the generation's provenance -- the trim is an+ intermediate that never surfaces in the gallery.+ """+ invocation = ExtractVideoRangeInvocation(video=VideoField(video_name="input.mp4"), start_frame=0, end_frame=4)context = MagicMock()context.videos.get_path.return_value = Path("input.mp4")context.util.is_canceled.return_value = False- return invocation, context---def test_invocation_saves_the_requested_canvas() -> None:- """A 1920x1080 source trimmed onto a 1344x768 canvas must be recorded as 1344x768.-- This is what lets Extend Video concatenate the trimmed source with the generated- clip -- `video_concat` rejects mismatched dimensions outright.- """- invocation, context = _resize_invocation(width=1344, height=768)- base_output = MagicMock(- video=VideoField(video_name="output.mp4"), width=1344, height=768, num_frames=5, fps=8.0, duration=0.625- )-- with (- patch("invokeai.app.invocations.video_frame_extract_range.probe_video", return_value=(1920, 1080, 0.625, 8.0)),- patch("invokeai.app.invocations.video_frame_extract_range.decoder_frame_count", return_value=5),- patch("invokeai.app.invocations.video_frame_extract_range.make_mp4_writer", return_value=MagicMock()),- patch("invokeai.app.invocations.video_frame_extract_range._write_frame_range", return_value=5) as write,- patch("invokeai.app.invocations.video_frame_extract_range.extract_audio_pcm", return_value=None),- patch("invokeai.app.invocations.video_frame_extract_range.VideoOutput.build", return_value=base_output),- ):- output = invocation.invoke(context)-- assert write.call_args.kwargs["resize_to"] == (1344, 768)- saved = context.videos.save.call_args.kwargs- assert (saved["width"], saved["height"]) == (1344, 768)- assert output.video.video_name == "output.mp4"---def test_invocation_keeps_source_dimensions_when_canvas_is_unset() -> None:- invocation, context = _resize_invocation()base_output = MagicMock(video=VideoField(video_name="output.mp4"), width=32, height=32, num_frames=5, fps=8.0, duration=0.625)@@ -176,24 +132,11 @@ def test_invocation_keeps_source_dimensions_when_canvas_is_unset() -> None:patch("invokeai.app.invocations.video_frame_extract_range.probe_video", return_value=(32, 32, 0.625, 8.0)),patch("invokeai.app.invocations.video_frame_extract_range.decoder_frame_count", return_value=5),patch("invokeai.app.invocations.video_frame_extract_range.make_mp4_writer", return_value=MagicMock()),- patch("invokeai.app.invocations.video_frame_extract_range._write_frame_range", return_value=5) as write,+ patch("invokeai.app.invocations.video_frame_extract_range._write_frame_range", return_value=5),patch("invokeai.app.invocations.video_frame_extract_range.extract_audio_pcm", return_value=None),patch("invokeai.app.invocations.video_frame_extract_range.VideoOutput.build", return_value=base_output),):- invocation.invoke(context)-- assert write.call_args.kwargs["resize_to"] is None- saved = context.videos.save.call_args.kwargs- assert (saved["width"], saved["height"]) == (32, 32)---def test_invocation_rejects_an_odd_requested_canvas() -> None:- invocation, context = _resize_invocation(width=1345, height=768)+ output = invocation.invoke(context)- with (- patch("invokeai.app.invocations.video_frame_extract_range.probe_video", return_value=(1920, 1080, 0.625, 8.0)),- patch("invokeai.app.invocations.video_frame_extract_range.decoder_frame_count", return_value=5),- pytest.raises(ValueError, match="Requested output size is 1345x768"),- ):- invocation.invoke(context)- context.videos.save.assert_not_called()+ assert output.source_video.video_name == "input.mp4"+ assert output.video.video_name == "output.mp4"