ComfyUI-H3-Bridge
ComfyUI custom node for video bridge generation, head cuts, loops, and retakes with timeline trimming, waveform view, and overlap blending.
ComfyUI-H3-Bridge
A ComfyUI custom node for generating intermediate bridge cuts between Video A and Video B, adding leading head cuts, creating loops, or retaking interior video segments—all with timeline preview, frame-strip trimming, waveform inspection, persistent prompts/reference images, optional latent upscaling and deflickering, and overlap-blended assembly.
This custom node was coded with Gemini and is released under the GNU General Public License v3.0 (GPL-3.0) — see LICENSE.
Overview & Layout (Text Guide)
Even without viewing screenshots, the node interface is arranged into clear sections:
- Top Sockets (Inputs & Outputs)
- Inputs:
model(MODEL),clip(CLIP),vae_video(VAE),vae_audio(VAE), optionalprompt_input(STRING), optionallatent_upscale_model(LATENT_UPSCALE_MODEL), and optionaloptical_flow_model(*). - Outputs:
cut_image(IMAGE),cut_audio(AUDIO),combined_image(IMAGE),combined_audio(AUDIO), andfps(FLOAT).
- Inputs:
- Left Column — Timeline, Trim Bar, Waveform, Reference Images & Prompt
- Top Status & Mode Bar: Shows active durations for A, Bridge (
durationin seconds and frames), and B, mode buttons (ab,head_b,a_loop,a_retake), a real-time status/warning readout, and a progress bar (0%to100%) reflecting the active stage. - Video A / Bridge / Video B Track Row:
- Video A & Video B Slots: Load clips via drag-and-drop or the folder button (e.g.,
sample_clip_a.mp4,sample_clip_b.mp4). Each slot has a video preview area above a dedicated frame-strip trim bar with-/1.0x/+zoom buttons and draggable start/end trim handles, plus play/pause, seek, mute, and volume controls. - Bridge Slot: Sets the generated bridge duration (
bridgeSec/duration) via slider or direct numeric input. Frame count is computed from this duration andfpsrather than the source trim width.
- Video A & Video B Slots: Load clips via drag-and-drop or the folder button (e.g.,
- Audio Waveform Section: Displays waveforms for Video A and Video B with trimmed active segments and the bridge region.
- Reference Images Section (
REF 0–REF 3): Four optional image slots supporting file drop, folder selection, clearing (×), and drag-and-drop reordering. Prompts and reference image entries are persisted inlocalStorageand node properties. - Prompt Section: Multiline prompt box with a
prompt_input(STRING) connection status button.
- Top Status & Mode Bar: Shows active durations for A, Bridge (
- Right Column — Sampler & Upscale Panel
- Includes
overlap_offset(5,22,39,56),aspect_ratio,megapixels,sampler_name,scheduler,steps,cfg,noise_seed(with post-run seed mode selector),ref_image_size,enable_latent_upscale,latent_upscale_steps,upscale_width,upscale_height,enable_deflicker,deflicker_strength, andfps, along with aCompact/Expandtoggle.
- Includes
Bridge Modes & Assembly Order
ab (Video A -> Bridge -> Video B)
Uses Video A tail and Video B head as guides and overlap-blends Video A -> Generated Bridge -> Video B.
head_b (Head Cut -> Video B)
Generates a leading cut into Video B and overlap-blends Generated Cut -> Video B.
a_loop (Video A Loop)
Uses Video A tail as start guide and Video A head as end guide, trims the trailing overlap portion from the generated segment during assembly, and overlap-blends Video A + Trimmed Generated Bridge so repeat playback loops smoothly back to the start.
a_retake (Video A Retake)
Splits Video A by trim bounds into leading ([0, a_start]), retake ([a_start, a_end]), and trailing ([a_end, 1]) segments, generates the retake cut, and overlap-blends Video A leading -> Generated retake -> Video A trailing aligned to the original Video A frame count and audio duration (e.g., 134F) with smooth tail continuity.
- Interior Range Requirement:
a_retakeaccepts interior trim ranges only (both leading and trailing segments must remain non-empty). - Edge Trim Warning & Stop: If the trim reaches the start (
<= 0.005) or end (>= 0.995) leaving either side empty, the UI showsWarning: Retake requires interior trimin real time and raisesValueError: Warning: Retake mode requires an interior range (both before and after trim must remain).when queued.
Progress Stages
Progress updates follow the execution pipeline:
Conditioning...(15%): Loading media/guides and preparing conditioningSampling...(40%–65%): Running samplingUpscaling...(65%): Running latent upscale whenenable_latent_upscaleis enabledVAE decoding...(82%): Decoding video and audio latents and resizingDeflickering...(91%): Running deflicker whenenable_deflickeris enabledCombining timeline...(94%): Assembling and overlap-blending output tracksCompleted(100%): Finished
Unconnected Optional Model Fallback
- If
enable_latent_upscaleis enabled withoutlatent_upscale_modelconnected, upscaling is skipped and execution continues at base resolution. - If
enable_deflickeris enabled withoutoptical_flow_modelconnected, execution still completes using built-in temporal luminance smoothing and frame blending when an external deflicker node is not available.
Installation
- Place
ComfyUI-H3-BridgeinsideComfyUI/custom_nodes/ComfyUI-H3-Bridge. - Install dependencies if needed (
pip install -r requirements.txt). - Restart ComfyUI and hard-refresh your browser (
Ctrl+F5orCmd+Shift+R). - See workflows/ComfyUI-H3-Bridge-example.json for a generic example workflow.