Nodes/comfyui-am-vfx-tools/AM Reverse Sequence
ComfyUI Node

AM Reverse Sequence

Reverse the frame order of an IMAGE batch or VIDEO. Drop-in replacement for KJNodes' Reverse Image Batch, with an added VIDEO output socket so the reversed sequence can feed a lazy AM transform chain (Reformat / Grade / OCIO / Image Write) without materialising the batch again at each node.

By am-pipeline-prod·Created 4 months ago·Updated 2 months ago· 3
AM Reverse Sequence
  • image
  • mask
  • video
  • image
  • mask
  • video
show_previewtrue
CategoryAM VFX Tools

Inputs (4)

NameTypeDefaultDescription
show_previewBOOLEANtrueShow a thumbnail of the FIRST frame of the reversed sequence (= LAST frame of the input) on the node — visual confirmation the reverse fired.
imageoptIMAGEImage batch to reverse along the frame dimension. Cheap — `torch.flip` per the time axis. Peak RAM during the flip is 2× the batch.
maskoptMASKOptional MASK batch to reverse alongside the IMAGE. If unwired and IMAGE has no alpha, the output MASK is zeros (stock-ComfyUI 'nothing to inpaint' convention).
videooptVIDEOOptional VIDEO input. When wired, this node materialises the source via `get_components()` to access frames in random order, flips the in-memory tensors, and returns a fresh `VideoFromComponents`. Peak RAM during the flip is ~2× source — reverse can't be lazy because PyAV doesn't decode backward. The wrapped output IS consumable by downstream lazy AM chains. `image` and `mask` are ignored when `video` is wired. See invariant 28.

Outputs (3)

NameTypeDescription
imageIMAGEReversed image batch (same shape / dtype as input). RGB only.
maskMASKReversed mask batch (same shape / dtype as input mask). Zeros when no mask was wired and the source had no alpha.
videoVIDEOLazy-friendly VIDEO output — wraps the reversed IMAGE batch in a zero-copy `VideoFromComponents`. Downstream AM transforms can consume this lazily (one frame at a time) without further materialisations. None when no input is wired.