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.
AM Reverse Sequence
- image
- mask
- video
- image
- mask
- video
◄show_previewtrue►
CategoryAM VFX Tools
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| show_preview | BOOLEAN | true | Show a thumbnail of the FIRST frame of the reversed sequence (= LAST frame of the input) on the node — visual confirmation the reverse fired. |
| imageopt | IMAGE | Image batch to reverse along the frame dimension. Cheap — `torch.flip` per the time axis. Peak RAM during the flip is 2× the batch. | |
| maskopt | MASK | Optional 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). | |
| videoopt | VIDEO | Optional 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)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Reversed image batch (same shape / dtype as input). RGB only. |
| mask | MASK | Reversed mask batch (same shape / dtype as input mask). Zeros when no mask was wired and the source had no alpha. |
| video | VIDEO | Lazy-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. |