Nodes/CGlide/Glide Audio Lock
ComfyUI Node

Glide Audio Lock

Make MiniMax H3 build the picture around your actual song

By CGlide·Created 4 months ago·Updated a day ago· 127
Glide Audio Lock
  • latent
  • audio_vae
  • audio
  • latent
  • audio
◄start_seconds0.00►
◄lock_strength1.00►

H3 generates the sound along with the picture - dialogue, room tone and drums in one pass. That's great until you have a track you actually like. Point H3 at a music video and it will happily re-perform your song: a voice that's sort of the singer and not really the singer, a mouth moving to whatever it decided the line was. The fix people asked for on day one: let me feed it my own audio file.

Glide Audio Lock is that fix, as a node. It pins your real audio into H3's audio latent so the model builds the picture around your track instead of covering it.

What it's for

If you use the pack's H3 Studio you already have this: 1.4.0 added Song mode and timeline audio slots that hold placed sound at real times. This node is the standalone twin - same hold, no H3 Studio in the graph. Drop it between your AV latent and the sampler's latent input.

The payoff is that H3 hears the actual performance while it renders: lip sync on the real vocal, hits on the real beat, the ending you wrote. For a music video or a character speaking a fixed line, that's the difference between usable and re-rolling seeds for an hour.

How it works

H3's latent is a pair - video and audio packed into one nested tensor - and the audio half runs at 40 latent frames per second. The node reads the clip length off the latent itself, takes that much of your song from start_seconds, and encodes it with the audio VAE into a 32-channel stereo latent, overwriting the first rows of the audio half. Whatever the song can't fill stays generated, mono gets duplicated to stereo, and the segment is resampled to the VAE's rate (32 kHz by default).

Then the actual trick, and it's ComfyUI's, not the pack's. The node attaches a noise_mask, where MiniMaxH3 takes a mask per audio latent frame: a row at mask 0 runs at AUDIO_COND_TIMESTEP and is re-injected clean every step, so the sampler never redraws it. Mask 1 is generated normally; anything between is held that much. lock_strength is that number inverted - 1.0 pins the whole segment, 0.0 hands the song back as a loose suggestion. A video mask already on the latent (keyframes, a continuation tail) survives if its shape fits.

Two outputs. latent goes to the sampler. audio is the untouched original samples, trimmed to the clip and padded with silence if the song ran out - no VAE round trip. Wire it into Glide Video's audio input and the real track is muxed in the same ffmpeg pass; chaining clips, Glide Join's locked_audio does the same across a sequence.

The inputs that matter

latent has to be an H3 audio+video latent - H3 Studio's, or EmptyMiniMaxH3LatentAV. Anything else gives you Glide Audio Lock needs an H3 audio+video latent (video, audio pair).

audio_vae is the H3 audio VAE; the pack's source names it minimax_h3_audio_vae_fp32. The picture VAE being wired elsewhere doesn't count - this one encodes sound.

audio takes any AUDIO, so a LoadAudio node is fine. start_seconds is where in the song the clip begins, and the clip drives the rest: ask for six and a half seconds and you get six and a half seconds of track from that point. Leave lock_strength at 1.0; drop it to 0.5–0.85 only when you want H3 to rework the mix.

Install

Search CGlide in ComfyUI Manager, or:

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

Restart ComfyUI. You need the H3 model set regardless - reference-to-video checkpoint into models/diffusion_models/, text encoder into models/text_encoders/, video and audio VAEs into models/vae/. The README's model list is still a TODO with filenames unfilled, so take the audio VAE name from the source. Dependencies are PyAV and torchaudio (this node only needs the latter as a fallback) plus ffmpeg on your PATH, which is Glide Video's business.

Where people get burned

  • start_seconds is past the end of the audio - your window starts past the end of the file. A 15-second clip needs 15 seconds of track after your start point, not before.
  • The console line. It prints locked N/M audio latent frames (X.XXs of Y.YYs). If N is under M, that tail is generated sound. H3 also rounds its audio grid up, so every clip carries ~8 ms more sound than picture and that accumulates at joins - hence Glide Join's match_tail.
  • Black video with sound. Not this node: that's the w4a8 model on a ComfyUI too old for it, failing silently. Update before hunting through your graph.
  • A .py change needs a full restart, and if a node's widget list changed shape between versions, delete and re-add the node - ComfyUI matches saved widget values by position and will smear your lock_strength onto something else.
CategoryCGlide

Inputs (5)

NameTypeDefaultDescription
latentLATENT—
audio_vaeVAE—
audioAUDIO—
start_secondsFLOAT0.000–3600Where in the song the clip starts.
lock_strengthFLOAT1.000–11.0 = audio kept exactly. Lower lets H3 rework it a little.

Outputs (2)

NameTypeDescription
latentLATENT—
audioAUDIO—