Nodes/ComfyUI-MaxedOut/Select Frames MXD
ComfyUI Node

Select Frames MXD

Grab the exact frame (or run) you need from either end of a clip

By Maxed-Out-99·Created about a year ago·Updated 21 days ago· 9
Select Frames MXD
  • frames
  • image
count1
offset1
modeend

WAN 2.2 image-to-video has a workflow where the ending frame matters as much as the first: generate a clip, then use its final frame as the seed for the next segment, chaining scenes together. Select Frames MXD is the tiny node that makes that painless - it slices a run of frames out of either end of your sequence, and it's the tool the author's WAN 2.2 workflows reach for when they need a specific frame or a short tail.

How it works

Three inputs, one output:

  • frames - your image batch
  • count - number of frames to grab (default 1)
  • offset - how far into the sequence to start grabbing (default 1)
  • mode - start or end (default end)

Output image is the selected slice. With the defaults you get the very last frame of the clip, which is exactly the "here's where we left off" image you'd feed into the next generation as a reference. Want the last 9 frames for a mini-loop? Set count to 9, mode to end, offset 1. Want the first frame of a clip? Flip mode to start. The offset just shifts where you begin counting from - useful for skipping past a known-clean frame.

That last-frame use is the big one. In a video-extension pipeline, taking the tail frame and feeding it back as the starting image (or last-frame conditioning) keeps the next segment visually continuous, which is how you get longer, coherent takes out of models that generate short clips natively.

Where it sits in the pack

It's a frame-level sibling of Frames_Remove_From_Start_MXD (which drops frames off the front) and GroupVideoFramesMXD (which chunks a batch into groups). This one is the extractor. Pure tensor slicing under the hood - fast, deterministic, no re-encoding - so it's safe to drop into a loop that runs every frame through a batch operation.

Gotchas

  • count and offset are frame counts, not seconds. Do the FPS math yourself before wiring it in.
  • Asking for more frames than remain just returns what's there - no error, no padding. If you need exactly N frames for a downstream node (say, a batch sampler expecting a fixed size), make sure the sequence is long enough or you'll get a shape mismatch later.
  • Default mode is end, which trips people up the first time: connect a fresh clip and it grabs the last frame, not the first.

Install

ComfyUI Manager → search Maxed Out → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Maxed-Out-99/ComfyUI-MaxedOut

No dependencies beyond ComfyUI itself - no requirements.txt, no model files. Look for it under MXD/images. If you've ever manually sliced a tensor or fiddled with an image-batch-to-list node just to grab one frame, this is the node that saves you the ceremony.

CategoryMXD/images

Inputs (4)

NameTypeDefaultDescription
framesIMAGE
countINT11–10000Number of frames to select
offsetINT11–10000How far into the video to start selection (from start or end)
modeCOMBOendSelect frames from the start or end of the sequence

Outputs (1)

NameTypeDescription
imageIMAGE