Nodes/Mickmumpitz-Nodes/Boundary Frame Extractor
ComfyUI Node

Boundary Frame Extractor

Hand your video's broken frames to an interpolator

By mickmumpitz·Created 8 months ago·Updated 9 days ago· 47
Boundary Frame Extractor
  • images
  • images
  • frame_before
  • frame_after
  • enabled
  • num_start_frames
  • frame_offset
  • num_replace
enabledtrue
num_start_frames1
frame_offset1
num_replace1

Sometimes the frames a video model makes are just bad - a corrupt region, a glitch, a set of frames you'd rather not show anyone. The fix isn't to regenerate the whole clip, it's to replace just the bad frames with interpolated ones. BoundaryFrameExtractor is the "cut around the wound" node: it hands you the frame immediately before the bad region and the frame immediately after, so you can feed those two to an interpolation model (RIFE, FILM, whatever) and get replacements.

It's one half of a pair with BoundaryFrameSplicer, which puts the interpolated frames back. The extractor answers "what are the edges of the hole?" and the splicer answers "fill it in."

How it works

Required: images - the video batch containing the broken region.

The optional inputs define where the hole is, in relation to the iteration's start frames:

  • enabled - turn the whole behavior off; when off, images pass through and both boundary outputs are just the first frame.
  • num_start_frames - the number of overlap/start frames (the tooltip says to connect this from IterVideoRouter).
  • frame_offset - where the first broken frame sits relative to the end of the start frames. 1 = the first frame after the overlap.
  • num_replace - how many consecutive frames are broken (default 1).

The mechanics are precise: it computes the target window from num_start_frames + frame_offset - 1 through + num_replace, then outputs:

  • frame_before - the frame just before the window (a 1-frame image).
  • frame_after - the frame just after it.
  • Plus passthrough outputs: images, enabled, and the three parameters, so downstream nodes can read the exact values this node actually used.

On iteration 0, nothing is broken yet, so the images pass through and the boundaries are set to the first frame - the node is a no-op until iteration 1+, which matches how the iteration loop works.

Where it fits

Wire frame_before and frame_after into an interpolation node (RIFE is the classic choice, or FILM for fancier motion), let it generate the middle frames, then feed the result into BoundaryFrameSplicer with matching parameters. This whole "extract → interpolate → splice" repair is how you rescue an iterative workflow whose middle segments glitched without re-running the expensive generation from scratch.

Installing it

Part of Mickmumpitz-Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git

or ComfyUI Manager → search "Mickmumpitz" → install → restart. No downloads from this pack; the interpolation model (RIFE/FILM) is a separate install you bring yourself.

Troubleshooting

  • Boundary frames are duplicates - if the window math lands outside the batch (e.g. frame_offset too large), the node falls back to the first/last frame as a safety net. Check your offset against the actual frame count.
  • Interpolator gets the wrong edges - num_start_frames, frame_offset, and num_replace must agree with how the batch was assembled. When in doubt, match them to the values IterVideoRouter is using.
  • Nothing happens on iteration 0 - correct. It's designed to only act once there's a previous iteration whose tail might contain the break.
  • Replaced region misaligned - the window is counted from the end of the start frames; if your router uses a different definition of "start frames," the hole lands elsewhere.
CategoryMickmumpitz/video/iteration

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
enabledoptBOOLEANtrue
num_start_framesoptINT11–99Number of overlap/start frames (connect from IterVideoRouter)
frame_offsetoptINT10–99Position of first broken frame relative to end of start frames (1 = first frame after overlap)
num_replaceoptINT11–99Number of consecutive frames to replace

Outputs (7)

NameTypeDescription
imagesIMAGE
frame_beforeIMAGE
frame_afterIMAGE
enabledBOOLEAN
num_start_framesINT
frame_offsetINT
num_replaceINT