Extensions/ComfyUI-H3-Bridge
ComfyUI Extension

ComfyUI-H3-Bridge

ComfyUI custom node for video bridge generation, head cuts, loops, and retakes with timeline trimming, waveform view, and overlap blending.

By javawock7618·Created 2 days ago·Updated a day ago· 1
javawock7618/ComfyUI-H3-Bridge
Nodes—
On cloudLocal install
Stars1
Updateda day ago
Readme

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:

  1. Top Sockets (Inputs & Outputs)
    • Inputs: model (MODEL), clip (CLIP), vae_video (VAE), vae_audio (VAE), optional prompt_input (STRING), optional latent_upscale_model (LATENT_UPSCALE_MODEL), and optional optical_flow_model (*).
    • Outputs: cut_image (IMAGE), cut_audio (AUDIO), combined_image (IMAGE), combined_audio (AUDIO), and fps (FLOAT).
  2. Left Column — Timeline, Trim Bar, Waveform, Reference Images & Prompt
    • Top Status & Mode Bar: Shows active durations for A, Bridge (duration in 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% to 100%) 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 and fps rather than the source trim width.
    • 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 in localStorage and node properties.
    • Prompt Section: Multiline prompt box with a prompt_input (STRING) connection status button.
  3. 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, and fps, along with a Compact / Expand toggle.

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_retake accepts 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 shows Warning: Retake requires interior trim in real time and raises ValueError: 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 conditioning
  • Sampling... (40%–65%): Running sampling
  • Upscaling... (65%): Running latent upscale when enable_latent_upscale is enabled
  • VAE decoding... (82%): Decoding video and audio latents and resizing
  • Deflickering... (91%): Running deflicker when enable_deflicker is enabled
  • Combining timeline... (94%): Assembling and overlap-blending output tracks
  • Completed (100%): Finished

Unconnected Optional Model Fallback

  • If enable_latent_upscale is enabled without latent_upscale_model connected, upscaling is skipped and execution continues at base resolution.
  • If enable_deflicker is enabled without optical_flow_model connected, execution still completes using built-in temporal luminance smoothing and frame blending when an external deflicker node is not available.

Installation

  1. Place ComfyUI-H3-Bridge inside ComfyUI/custom_nodes/ComfyUI-H3-Bridge.
  2. Install dependencies if needed (pip install -r requirements.txt).
  3. Restart ComfyUI and hard-refresh your browser (Ctrl+F5 or Cmd+Shift+R).
  4. See workflows/ComfyUI-H3-Bridge-example.json for a generic example workflow.