Pitch MMAudio Sampler
Give it frames (or just a prompt) — get back audio matched to your video
- mmaudio_model
- feature_utils
- images
- audio
PitchMMAudioSampler is where the MMAudio chain actually pays off: it takes the model from PitchMMAudioModelLoader, the conditioning stack from PitchMMAudioFeatureUtilsLoader, and your words - and optionally your video frames - and produces audio. Wire the AUDIO output to a save node and you have foley for a silent Wan or Hunyuan render, the classic job MMAudio exists for. It's a flow-matching sampler, so the mental model is closer to a KSampler than to any image node you know: prompt, steps, CFG, seed, generate.
How it works
The sampler runs a flow-matching Euler scheduler over the steps you set, with text as the required conditioning. The interesting twist is the optional images input (IMAGE): feed it your video frames and the node encodes them two ways - a CLIP pass at 384px and a Synchformer sync pass at 224px - and uses both to steer the audio so it matches what's on screen. Leave images unplugged and it generates pure text-to-audio with empty video conditioning instead. The one input beginners actually reach for:
prompt- what the audio is. "A spaceship engine humming in deep space," "rain on a tin roof." This is the steering wheel.negative_prompt- what it shouldn't be. Loose but useful.duration(FLOAT, default 8s) - how long the clip is. The tooltip says it plainly: duration in seconds.steps(INT, default 25) - sampler steps. More steps, cleaner audio, slower.cfg(FLOAT, default 4.5) - conditioning strength. The tooltip's words: strength of the conditioning.seed- set it and lock it to reproduce a take.mask_away_clip(BOOLEAN, default off) - if on, the video conditioning is discarded and it's text-only, even with frames wired in.force_offload(BOOLEAN, default on) - after sampling, the models get pushed off the GPU. Leave it on unless you're chaining generations back-to-back and want the speed.
Output: audio (AUDIO) - a waveform tensor plus a 44100 Hz sample rate, ready for ComfyUI's audio save/playback nodes.
Installing it
Same pack as the rest of the chain: pitch7900/ComfyUI-PitchCustomNodes. Install via ComfyUI Manager (search "Pitch Mask Fallback") or:
cd ComfyUI/custom_nodes
git clone https://github.com/pitch7900/ComfyUI-PitchCustomNodes
Restart, then load the models into ComfyUI/models/mmaudio - the MMAudio checkpoint, VAE, Synchformer, and CLIP. In 44k mode the NVIDIA vocoder auto-downloads on first run; 16k mode needs PitchMMAudioVoCoderLoader wired in. Dependencies (accelerate, open_clip_torch, huggingface_hub, omegaconf, einops) install with the pack. The README is empty, so the source is your only doc - but the defaults are sane, so you can mostly just click generate.
Common issues
- No video conditioning applied. Either
imagesisn't wired, ormask_away_clipis on. Both are easy to miss, and the result is audio that ignores the visuals. - Audio shorter than you asked. The node silently truncates
durationif your input video has fewer frames than the requested length - there's a console warning about it. Match your frame count to your duration or you'll get a shorter clip. - "AttributeError: seq_cfg" on the model - the 44k/16k filename gotcha from the model loader. Keep
16or44in the checkpoint filename. - Old-torch errors ("torch.nn has no attribute Buffer") are the underlying MMAudio code fighting an old torch. Update ComfyUI's torch.
The honest verdict: the pack is rough around the edges - empty README, filename quirks - but this sampler is the working core of a real foley pipeline, and the defaults are good enough that your first successful render is a text prompt and one click away.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| mmaudio_model | MMAUDIO_MODEL | — | |
| feature_utils | MMAUDIO_FEATUREUTILS | — | |
| duration | FLOAT | 8.00 | Duration of the audio in seconds |
| steps | INT | 25 | Number of steps to interpolate |
| cfg | FLOAT | 4.5 | Strength of the conditioning |
| seed | INT | 00–18446744073709550000 | — |
| prompt | STRING | — | |
| negative_prompt | STRING | — | |
| mask_away_clip | BOOLEAN | false | If true, the clip video will be masked away |
| force_offload | BOOLEAN | true | If true, the model will be offloaded to the offload device |
| imagesopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |