Frame Replacer ✂️
Cut-and-paste for individual frames of a video
- source_video
- replacement_frames
- modified_video
FrameReplacer is the frame-accurate edit node. Where FrameExtender splices whole clips together, this one swaps out a specific run of frames inside a video: frame 40 through 55 becomes a new sequence you feed in, everything else stays untouched. It's what you reach for when a re-render left a glitched face for a few frames, you want to swap in a better take of one shot, or you need to overwrite a segment of a video with new content at an exact timestamp.
How it works
You give it source_video (the video to edit) and replacement_frames (what goes in), then point at the spot with target_frame (0-based index) and say how many frames to replace with replace_count. It slices the source around that window and drops the replacement in. Two flags control the edges of the behavior:
loop_replacement(default on) - if your replacement batch has fewer frames thanreplace_count, it tiles the batch to fill the gap, like a stamp. Turn it off and the replacement just ends early.preserve_length(default on) - keeps the output the same length as the source. This matters more than it sounds: with it on, if the replacement overshoots the end of the video it gets capped; with it off, the length changes to match what you actually fed in. Keep it on unless you're deliberately re-timing the clip.
The boundary problem is the same one any video editor solves with a dissolve: a hard cut where your replacement meets the original frames can pop. blend_edges (default off) fixes that by crossfading the join, and blend_strength (0.0–1.0) controls how heavy the fade is. With a small blend_strength like 0.3–0.5 you get a soft landing instead of a visible seam.
The inputs that matter
target_frameandreplace_count- the window. This is the whole job.blend_edges/blend_strength- flip the first on when you see a seam at the boundaries.preserve_length- leave on unless you specifically want the video to grow or shrink.
The rest (width, height, interpolation, method, condition, multiple_of) is the pack's shared advanced-resize system. Same caveat as the rest of this pack: defaults are 512×512 with condition: always, so set width/height to your real resolution and switch condition to if different unless you want an unexpected downscale. Output is modified_video, an IMAGE tensor you can feed to SaveImage/VideoCombine or keep processing.
Use cases
- Fix glitches: rerun one bad section through a rediffusion or inpainting pass, then patch the clean frames back in.
- Frame-accurate timing: swap a single frame to fix a flicker or a double-exposure.
- Localized edits: replace just the segment you changed instead of re-rendering the whole video.
Installing
Manager: search "ComfyUI-FrameUtilitys". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/lum3on/ComfyUI-FrameUtilitys
Restart. No models, no extra dependencies - the pack's requirements.txt is comments only, and everything runs on ComfyUI's bundled torch/numpy.
Troubleshooting
- "Frame index out of bounds" -
target_frame+replace_countexceeds the video length. Shortenreplace_countor check your frame math; the readme's own advice is to verifyreplace_countdoesn't overshoot available frames. - Replacement isn't showing up - check
preserve_length; if it's on and your replacement overshoots, the tail gets cut to keep the length constant. - Visible seam at the join - enable
blend_edgesand nudgeblend_strengthup until the pop disappears.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| source_video | IMAGE | Source video sequence to modify (IMAGE tensor format) | |
| replacement_frames | IMAGE | Frames to use as replacements | |
| target_frame | INT | 00–10000 | Starting frame index for replacement (0-based) |
| replace_count | INT | 11–1000 | Number of frames to replace |
| width | INT | 51264–8192 | Target width for frame resizing |
| height | INT | 51264–8192 | Target height for frame resizing |
| interpolation | COMBO | bilinear | Interpolation method for resizing |
| method | COMBO | keep proportion | Resizing method |
| condition | COMBO | always | When to apply resizing |
| multiple_of | INT | 00–512 | Round dimensions to multiple of this value (0 = disabled) |
| blend_edgesopt | BOOLEAN | false | Smooth blend at replacement boundaries |
| blend_strengthopt | FLOAT | 0.50–1 | Strength of edge blending (0.0 = no blend, 1.0 = full blend) |
| loop_replacementopt | BOOLEAN | true | Loop replacement frames if fewer than replace_count |
| preserve_lengthopt | BOOLEAN | true | Maintain original video length |
| memory_efficientopt | BOOLEAN | true | Process in chunks to save memory |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| modified_video | IMAGE | — |