ComfyUI Node
AM Frame Range
A ComfyUI node in AM VFX Tools/Util with 5 inputs and 2 outputs.
AM Frame Range
- image
- video
- image
- video
◄frame_modesingle►
◄first_frame1►
◄last_frame-1►
CategoryAM VFX Tools/Util
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_mode | COMBO | single | Which frames to emit from the input batch. single = only `first_frame`. range = `first_frame`..`last_frame` inclusive. all = pass the batch through unchanged. |
| first_frame | INT | 1-999999–999999 | Frame index in single mode; lower bound in range mode (1-based). Ignored in all mode. Clamped to [1, N]. |
| last_frame | INT | -1-1–999999 | Range upper bound (inclusive, 1-based). -1 = end of batch. Ignored in single / all modes. Clamped to [first_frame, N]. |
| imageopt | IMAGE | Image batch to slice. | |
| videoopt | VIDEO | Optional 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)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Selected image batch. Shape (1,H,W,C) in single mode, (N,H,W,C) in range mode, identical to the input in all mode. |
| video | VIDEO | Lazy 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. |