HunyuanVideo-Foley Generate Audio
HunyuanVideo-Foley Generate Audio
- video
- audio
The demo reel for this thing is honestly unfair. Feed it a clip of a hand drumming a table and it comes back with thumps; give it a street scene and you hear traffic, wind, the works. That's HunyuanVideo-Foley, Tencent's open TextVideo2Audio model (released August 2025 to a very warm r/StableDiffusion welcome), and this node is the ComfyUI wrapper that runs it entirely on your machine - no API, no key, no cloud bill. If you've been staring at generated videos that play in awkward silence, this is the node you've been missing.
It slots right into the native video pipeline: LoadVideo (or CreateVideo) → this node → SaveAudio, or chain it into the pack's VideoAudioMerger for a final mp4 with sound. Text prompt goes in alongside the video; audio comes out.
How it works
This isn't a reimplementation, it's the official Tencent inference code vendored into the pack. The node saves your incoming VIDEO to a temp file, pulls frames out with PyAV, and encodes what it sees with SigLIP2 while your text prompt is encoded with a CLAP audio-language model. A Synchformer fuses the visual and text features, then a flow-matching denoiser runs for however many steps you set, and a DAC VAE turns the latents into a 48 kHz waveform. Same weights as the reference repo, wearing a ComfyUI hat.
The inputs that matter
- video - any VIDEO input:
LoadVideoorCreateVideooutput. - prompt - a free-text description of the audio you want. This is the single most important dial; the model leans on it heavily.
- model - auto-lists config directories under
models/hunyuan_foley. You can usually ignore it. - guidance_scale - default 4.5. Crank it up to make the prompt win over the video; drop it and the audio follows the footage more literally.
- num_inference_steps - 50 default. Lower it for speed once you trust the results.
- device -
autopicks CUDA, then MPS, then CPU.gpu_idselects the card when you have more than one.
Output: audio - an AUDIO object ({waveform, sample_rate}). Wire it into SaveAudio or straight into VideoAudioMerger.
Installing it
ComfyUI Manager - search "HunyuanVideo-Foley Audio Generator" - or the old-fashioned way:
cd ComfyUI/custom_nodes
git clone https://github.com/Jarcis-cy/ComfyUI-HunyuanVideoFoley
# restart ComfyUI
Here's the trap: the pack ships a requirements.txt but deliberately does not auto-install it. ComfyUI Manager will happily install the pack and give you a node that fails the moment you hit Run, because you still need the heavy stack in ComfyUI's Python env - torch, torchvision, torchaudio, av, einops, transformers, diffusers, numpy==1.26.4, ffmpeg-python, plus huggingface_hub. Install those manually, then restart.
First run triggers a big auto-download from HuggingFace: four model files (hunyuanvideo_foley.pth, vae_128d_48k.pth, synchformer_state_dict.pth, config.yaml) plus SigLIP2 and CLAP snapshots. Internet required, and it's gigabytes, so go make tea.
Where people get burned
- numpy is pinned to 1.26.4 - a real conflict risk in newer ComfyUI environments. If unrelated nodes start misbehaving after you install this, that pin is the suspect.
- It's built for short clips. The model is designed around ~15-second shots; feeding it a long render produces garbage or just wastes GPU time. Slice first, foley later.
- It runs in bf16, so it's consumer-GPU friendly, but CPU inference is painfully slow -
device: cudais the sane choice when you have the option. - You need a recent ComfyUI. This pack speaks the native VIDEO/AUDIO types, so older builds that predate ComfyUI's built-in video nodes will fail at the socket. If
LoadVideoisn't in your node menu, update ComfyUI first.
It's a young, low-star wrapper around a very good official model. The wrapper is thin and the docs are sparse, but when it works, it's the difference between a silent clip and one you can actually watch.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | 输入视频(VIDEO 类型) | |
| prompt | STRING | 音频提示词 | |
| model | COMBO | default | 选择 models/hunyuan_foley 下的模型配置目录 |
| guidance_scale | FLOAT | 4.50–20 | — |
| num_inference_steps | INT | 501–1000 | — |
| device | COMBO | auto | 推理设备 |
| gpu_id | INT | 00–8 | CUDA 设备 ID |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |