Extensions/ComfyUI-video-warptrans
ComfyUI Extension

ComfyUI-video-warptrans

Beat-synced flashback video generator with optical flow morphing for ComfyUI

By GuardSkill·Created 6 months ago·Updated 6 months ago· 0
GuardSkill/ComfyUI-video-warptrans
Nodes2
On cloudLocal install
Categoryvideo-dada
Stars0
Updated6 months ago
Readme

ComfyUI Video WarpTrans

Beat-synced flashback video generator for ComfyUI. Morphs between original/edited image pairs using dense optical flow, triggered in sync with music beats.

Features

  • Optical flow morphing — Farneback dense flow + bidirectional grid_sample warp with Gaussian motion blur
  • Beat-sync modes
    • Auto — librosa onset detection automatically finds beat triggers
    • Manual — hardcoded precise timecodes for frame-accurate sync
  • GPU accelerated — warp rendering via torch.nn.functional.grid_sample (CUDA/CPU auto-detect)
  • Glitch effects — horizontal scanline displacement + chromatic aberration, triggered at segment boundaries and randomly on hold frames
  • 4-segment / 8-image workflow — each segment has its own orig+edit image pair

Nodes

Flashback Auto Sync

Automatically detects beats from the audio using librosa onset detection.

| Input | Type | Description | |---|---|---| | ori1..4 | IMAGE | Original images (one per segment) | | edit1..4 | IMAGE | Edited images (one per segment) | | audio | AUDIO | From Load Audio node | | fps | INT | Output frame rate (default 30) | | width / height | INT | Output resolution (default 1080×1080) | | glitch_intensity | FLOAT | Glitch effect strength (default 8.0) | | trans_dur | FLOAT | Warp transition duration in seconds (default 0.12) | | inter_trans_dur | FLOAT | Inter-segment transition duration (default 0.35) | | onset_delta | FLOAT | Beat detection sensitivity — lower = more sensitive (default 0.08) | | glitch_prob | FLOAT | Probability of random glitch on hold frames (default 0.25) | | glitch_hold_strength | FLOAT | Glitch intensity on hold frames, relative to main (default 0.35) |

Flashback Manual Sync

Uses hardcoded frame-accurate timecodes. Intended for a specific music track where precise sync has been manually tuned.

Same inputs as Auto Sync minus trans_dur, inter_trans_dur, onset_delta.

Output

Both nodes output frames (IMAGE batch, T×H×W×C float32). Connect to VHS Video Combine or any video-save node set to 30 fps.

Workflow

Load Image (ori1)  ─┐
Load Image (edit1) ─┤
Load Image (ori2)  ─┤
Load Image (edit2) ─┤  Flashback Auto Sync  ──► frames ──► VHS Video Combine
Load Image (ori3)  ─┤
Load Image (edit3) ─┤
Load Image (ori4)  ─┤
Load Image (edit4) ─┤
Load Audio         ─┘

Beat Pattern (Auto mode)

The node expects music with a bass + 5-beat (da-da-da-da-da) pattern per segment:

[bass] hold_orig → da1 warp→edit → da2 warp→orig → da3 warp→edit
                → da4 warp→orig → da5 warp→edit (STAY)
                → [inter-segment transition to next orig]

Installation

Via ComfyUI Manager

Search for Video WarpTrans in the Custom Nodes tab.

Manual

cd ComfyUI/custom_nodes
git clone https://github.com/GuardSkill/ComfyUI-video-warptrans
pip install -r ComfyUI-video-warptrans/requirements.txt

Requirements

  • Python 3.10+
  • PyTorch 2.0+ (CUDA recommended)
  • opencv-python-headless
  • librosa

License

MIT