ComfyUI Node

AM Frame Range

A ComfyUI node in AM VFX Tools/Util with 5 inputs and 2 outputs.

By am-pipeline-prod·Created 4 months ago·Updated 2 months ago· 3
AM Frame Range
  • image
  • video
  • image
  • video
frame_modesingle
first_frame1
last_frame-1
CategoryAM VFX Tools/Util

Inputs (5)

NameTypeDefaultDescription
frame_modeCOMBOsingleWhich frames to emit from the input batch. single = only `first_frame`. range = `first_frame`..`last_frame` inclusive. all = pass the batch through unchanged.
first_frameINT1-999999–999999Frame index in single mode; lower bound in range mode (1-based). Ignored in all mode. Clamped to [1, N].
last_frameINT-1-1–999999Range upper bound (inclusive, 1-based). -1 = end of batch. Ignored in single / all modes. Clamped to [first_frame, N].
imageoptIMAGEImage batch to slice.
videooptVIDEOOptional VIDEO input. When wired, returns a lazy `FrameRangeVideo` wrapper that filters frames on consumption — no IMAGE materialisation here. With a `VideoFromFile` source, PyAV decodes ONLY the frames in the requested range and early-terminates after the last requested frame is yielded. Combined with a downstream AM consumer, peak RAM stays at one frame and the source's unwanted tail frames are never decoded. `image` is ignored when `video` is wired. See invariant 28.

Outputs (2)

NameTypeDescription
imageIMAGESelected image batch. Shape (1,H,W,C) in single mode, (N,H,W,C) in range mode, identical to the input in all mode.
videoVIDEOLazy VIDEO output — emits a `FrameRangeVideo` wrapper when `video` is wired, else a zero-copy `VideoFromComponents` around the sliced IMAGE batch. None when no input is wired.