Sound for a silent video: MMAudio
Lesson "audio-foley", in the group Sound and speech of the lesson list. Steps: 10.
What you will be able to do
You build a graph that listens to the frames of a silent clip and gives it a sound in time with them.
What you need
- Node packs: ComfyUI-MMAudio, ComfyUI-VideoHelperSuite. You install them in ComfyUI yourself, then choose Sync ▸ Sync now. Until then the card says the lesson does not fit and names the pack.
- Model files the lesson checks:
- for
mmaudio_modelof MMAudio ModelLoader: a file whose name has44k; - for
vae_modelof MMAudio FeatureUtilsLoader: a file whose name has44k.
- for
- Nodes: Load Video (Upload) 🎥🅥🅗🅢, MMAudio ModelLoader, MMAudio FeatureUtilsLoader, MMAudio Sampler, Video Combine 🎥🅥🅗🅢.
- The app downloads and installs nothing. The step texts below say which files and folders, and which ComfyUI template names them.
The steps
The words of each step, as the lesson shows them. Node names are in bold.
What MMAudio does (reading)
MMAudio watches a clip and makes the sound of what happens in it: steps, splashes, the engine of a passing car. The sound falls in time with the picture.
This is how a clip made by a video model gets its sound. A short text can steer the result, but the frames lead.
The nodes of this lesson come from the ComfyUI-MMAudio pack. A pack runs other people's code on your computer: install it yourself through ComfyUI's manager, and only a pack you trust. The frames are loaded and the clip is put together by the ComfyUI-VideoHelperSuite pack, as in the pack's own example.
The lesson builds the graph from an empty canvas: "File ▸ New project".
Load the clip
Add a Load Video (Upload) 🎥🅥🅗🅢 node and choose the clip in its
videofield.The model hears about 8 seconds best. For a longer clip, set
frame_load_capso that only the part you need is read.Load the model
Add a MMAudio ModelLoader node and choose the file in
mmaudio_model. The pack's example usesmmaudio_large_44k_v2_fp16.safetensors.All the files of this lesson lie in the folder models/mmaudio, which the pack adds to ComfyUI. Take them from the model's official page, the one the pack's prompt names.
Load the helper models
Add a MMAudio FeatureUtilsLoader node. It loads three small models in three fields:
vae_model: the decoder of the sound,mmaudio_vae_44k_fp16.safetensors;synchformer_model: the one that matches the sound to the frames,mmaudio_synchformer_fp16.safetensors;clip_model: the one that sees what is in the frames,apple_DFN5B-CLIP-ViT-H-14-384_fp16.safetensors.
Set
modeto44k. The large model and its decoder work at 44 kHz; with16kthey do not fit together.Files in the old formats (.ckpt, .pt, .pth, .bin) can run code when they are loaded. Take them only from the model's official page.
Add the sampler
Add a MMAudio Sampler node and connect three inputs:
mmaudio_modelfrom MMAudio ModelLoader;feature_utilsfrom MMAudio FeatureUtilsLoader;imagesfrom theIMAGEoutput of Load Video (Upload) 🎥🅥🅗🅢.
The frames go straight from the loader into the sampler: the model watches them.
Set the length and the steps
In MMAudio Sampler set:
duration: 8, the length of the sound in seconds; the clip and the sound must be equally long;steps: 25;cfg: 4.5.
These are the pack's own values. In the example
durationcomes from a node that measures the clip; you may type it by hand.A prompt, if you want one (reading)
The
promptfield may stay empty: the model hears the frames. A few words help when the frames say little: "rain on leaves", "crowd in a stadium". Thenegative_promptfield takes what must not be heard, for example "music, speech".mask_away_clipswitches off the model's look at the frames. Leave it off unless you want sound from the text alone.Put the sound into the clip
Add a Video Combine 🎥🅥🅗🅢 node. Connect the
IMAGEoutput of Load Video (Upload) 🎥🅥🅗🅢 to itsimagesinput and theaudiooutput of MMAudio Sampler to itsaudioinput.Set its
frame_rateto the frame rate of your clip, otherwise the picture runs faster or slower than the sound. In ComfyUI the finished clip goes into the output folder.When the sound is bad (reading)
- The sound lags behind the picture:
frame_ratein Video Combine 🎥🅥🅗🅢 is not the frame rate of the clip. - The sound is wrong for the scene: write two or three words in
prompt. - The sound stops before the clip ends:
durationis shorter than the clip. - Not enough memory: shorter pieces, or
force_offloadleft on.
The ComfyUI-HunyuanVideo-Foley pack does the same job with a larger model. Its files go into models/foley.
- The sound lags behind the picture:
The graph is ready (reading)
Save the graph with "File ▸ Save workflow for ComfyUI…", open the file in ComfyUI and run it there. This app runs nothing in ComfyUI itself.
What the lesson checks
A reading step is done when you press Got it, next. A doing step ticks itself off when the canvas holds:
- Step 2, Load the clip:
- a Load Video (Upload) 🎥🅥🅗🅢 node.
videoof Load Video (Upload) 🎥🅥🅗🅢: a value is chosen.
- Step 3, Load the model:
- a MMAudio ModelLoader node.
mmaudio_modelof MMAudio ModelLoader holds a file whose name has44k(capitals, dots and dashes do not matter).
- Step 4, Load the helper models:
- a MMAudio FeatureUtilsLoader node.
vae_modelof MMAudio FeatureUtilsLoader holds a file whose name has44k(capitals, dots and dashes do not matter).synchformer_modelof MMAudio FeatureUtilsLoader is not the same file asvae_modelof MMAudio FeatureUtilsLoader.clip_modelof MMAudio FeatureUtilsLoader is not the same file assynchformer_modelof MMAudio FeatureUtilsLoader.modeof MMAudio FeatureUtilsLoader is44k.
- Step 5, Add the sampler:
- a MMAudio Sampler node.
mmaudio_modelof MMAudio ModelLoader intommaudio_modelof MMAudio Sampler.mmaudio_featureutilsof MMAudio FeatureUtilsLoader intofeature_utilsof MMAudio Sampler.IMAGEof Load Video (Upload) 🎥🅥🅗🅢 intoimagesof MMAudio Sampler.
- Step 6, Set the length and the steps:
durationof MMAudio Sampler is from 1 to 10; Do this for me sets 8.stepsof MMAudio Sampler is from 20 to 30; Do this for me sets 25.cfgof MMAudio Sampler is from 3 to 6; Do this for me sets 4.5.
- Step 8, Put the sound into the clip:
- a Video Combine 🎥🅥🅗🅢 node.
IMAGEof Load Video (Upload) 🎥🅥🅗🅢 intoimagesof Video Combine 🎥🅥🅗🅢.audioof MMAudio Sampler intoaudioof Video Combine 🎥🅥🅗🅢.