ComfyUI Node

Audio Reverser

Reverse any audio track in one node — and get the time-map a video editor actually needs

By Code2Collapse·Created 6 months ago·Updated a day ago· 52
Audio Reverser
  • audio
  • audio
  • time_map

Sound in ComfyUI is a thin layer that got bolted on once video got good enough to want a soundtrack. So when a node shows up that does one audio thing cleanly, it's worth a look. AudioReverserMEC is exactly that: it takes any ComfyUI AUDIO and plays it backward. torch.flip on the sample dimension, sample rate and channel count preserved, done.

Why would you want that? Reverse audio is a classic sound-design move - backmasking effects, reversed cymbal swells, that eerie "tape run backward" feel. And if you're doing video work, there's a legit use case: you generate a video clip, then want its audio reversed to match a reversed playback, or you're building lip-sync-adjacent effects where the audio needs to run backward while the picture runs forward. The node is deliberately tiny, and the tiny part is the point.

How it works

ComfyUI audio is a dict - {'waveform': tensor[B, C, S], 'sample_rate': int} - where B is batch, C is channels, S is samples. The node flips along the sample dimension (torch.flip(dims=[-1])), so the waveform plays in reverse with channels untouched and the sample rate identical. Nothing gets resampled, nothing gets re-encoded; it's a pure tensor flip.

The interesting bit is the second output, time_map, a TIMEMAP that describes the relationship between original and reversed timestamps. Its formula is exactly what you'd hope: t_new = duration - t_orig, with the endpoints mapping [0, duration] → [duration, 0]. If you're building anything downstream that needs to sync reversed audio to a video timeline - for example, an effect where a timestamp in the original should land at a specific moment in the reversed track - that map is the contract. If you don't have a node that consumes TIMEMAP, just ignore it; it rides along.

The inputs and outputs

Only one input: audio, the standard ComfyUI AUDIO from any audio-loading or video-with-audio node. Outputs are the reversed audio and the time_map. That's the entire surface. The source in nodes/fluid_shots_audio.py validates that you actually passed an audio dict - a ValueError with a clear message otherwise.

Installing it

This ships in the Code2Collapse/ComfyUI-CustomNodePacks umbrella. ComfyUI Manager → search "CustomNodePacks", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git

Restart ComfyUI. No extra dependencies for this node, no model downloads, no VRAM. (The pack's requirements.txt lists opencv-python, scipy, safetensors for its other nodes - only install those if you're missing them, and never run a blanket pip install -r requirements.txt over ComfyUI's own torch/numpy.)

Gotchas

The one thing that trips people up is feeding it the wrong type. This node needs a real AUDIO dict from a loading node - not an IMAGE, not a path string. If you see "expected AUDIO dict with a 'waveform' tensor," that's exactly the problem. Also worth knowing: it's a silent, one-shot reversal. There's no playback preview inside the node, so if you want to hear the result you'll need to save or play it downstream. And the TIMEMAP output is genuinely useful only if you have a consumer for it - for a quick one-off effect, it's harmless baggage.

For such a narrow job, it's refreshingly honest: reverse the audio, hand you the mapping, get out of the way.

CategoryMEC/Audio

Inputs (1)

NameTypeDefaultDescription
audioAUDIOStandard ComfyUI audio ({'waveform': [B,C,S], 'sample_rate': int}).

Outputs (2)

NameTypeDescription
audioAUDIO
time_mapTIMEMAP