A multi-functional audio generation tool powered by the ControlFoley model, integrating video sound effect (SFX) generation, video background music composition, text-to-audio and other functions to realize diversified creative audio generation.
This tool supports four modes: Video-to-Audio (V2A), Text-Controlled Video-to-Audio (TC-V2A), Audio-Controlled Video-to-Audio (AC-V2A), and Text-to-Audio (T2A).
FieldValueService OperatorXiaomi LLM Plus TeamAPI Endpointhttps://controlfoley.ai.xiaomi.comOpen Source Repohttps://github.com/xiaomi-research/controlfoleyProject Pagehttps://yjx-research.github.io/ControlFoley_web_page/Online Demohttps://yjx-research.github.io/ControlFoley_web_page/#try-genModel Weightshttps://huggingface.co/YJX-Xiaomi/ControlFoley/API KeyNot requiredScript Pathscripts/foley.py
bash
python3 --version # Python 3.x
curl --version # curl for API submission
ffmpeg -version # optional, for audio format conversion
ModeCommandInputOutputDescriptionV2Av2a video.mp4Video file.mp4 + .flacGenerate audio matching the video contentTC-V2Av2a video.mp4 --prompt "text"Video + text.mp4 + .flacGenerate audio aligned with text prompts while staying synchronized with the videoAC-V2Av2a video.mp4 --ref-audio ref.wavVideo + reference audio.mp4 + .flacGenerate audio with timbre matching reference audio while staying synchronized with the videoT2At2a "prompt"Text description.flacGenerate audio from text descriptions
bash
python3 scripts/foley.py t2a "dog barking loudly in a park"
bash
python3 scripts/foley.py v2a input.mp4
bash
python3 scripts/foley.py v2a input.mp4 --prompt "footsteps on gravel with birds chirping"
bash
python3 scripts/foley.py v2a input.mp4 --ref-audio reference.wav
bash
python3 scripts/foley.py t2a "A mountain stream murmurs, its gentle current lapping against the pebbles." --duration 15
bash
python3 scripts/foley.py t2a "cat purring softly" --count 3
bash
python3 scripts/foley.py t2a "rain on a tin roof" --seed 42
bash
python3 scripts/foley.py models
bash
curl -X POST "https://controlfoley.ai.xiaomi.com/api/v1/v2a/submit" -F "file=@video_path" -F "prompt=footsteps on gravel with birds chirping"
return
json
{"taskId": "xxx", "message": "Task submitted successfully"}
bash
curl -X GET "https://controlfoley.ai.xiaomi.com/api/v1/v2a/models"
return
json
{"models":[{"name":"ControlFoley","enabled":true}]}
bash
curl -X GET "https://controlfoley.ai.xiaomi.com/api/v1/v2a/status/{taskId}"
return
json
{"urls":["{Domain name}/ControlFoley_output/{taskId}/{filename}"],"status":"success","done":true}
json
{"status":"processing","done":false}
json
{"status":"pending","queue_pos":1,"queue_position":1,"total_queue":2,"done":false}
bash
curl -X GET "https://controlfoley.ai.xiaomi.com/ControlFoley_output/{taskId}/{filename}" --output ./output.flac
bash
curl -X GET "https://controlfoley.ai.xiaomi.com/api/v1/v2a/status_download/{taskId}" --output-dir ./output --output audio.zip
ParameterDescriptionDefaultExamplepromptAudio description text (required)—"dog barking in park"``--modelModel IDControlFoley``--model ControlFoley``--durationAudio length in seconds (max 30)8``--duration 15``--negativeNegative prompt to exclude unwanted sounds—--negative "noise, human voice"``--cfgCFG strength — higher = stricter prompt adherence4.5``--cfg 6.0``--countNumber of variants to generate (1–5)1``--count 3``--seedFixed random seed for reproducibility—--seed 42``-o/--outdirOutput directory./output``-o ./my_audio
ParameterDescriptionDefaultExamplevideoInput video path (required)—input.mp4``--modelModel IDControlFoley``--model ControlFoley``--promptText prompt to guide audio generation (TC-V2A)—--prompt "keyboard tapping"``--negativeNegative prompt to exclude unwanted sounds—--negative "music, noise"``--ref-audioReference audio file for timbre control (AC-V2A)—--ref-audio reference.wav``--cfgCFG strength4.5``--cfg 7.0``--countNumber of variants to generate (1–5)1``--count 2``--seedFixed random seed (not forwarded to API currently)—--seed 42``-o/--outdirOutput directory./output``-o ./results
"cat footsteps on wooden floor" beats "cat sound"--negative "human voice, music, noise" to filter unwanted audio.flac (44100 Hz, lossless).mp4 (original video + generated audio track)--outdir, paths printed to stdoutConvert to MP3 for sharing:
bash
ffmpeg -i output.flac -codec:a libmp3lame -qscale:a 2 output.mp3
IssueCauseFixInternal URL inaccessibleResult URL uses .xiaomi.srv internal domainScript auto-falls back to /api/v1/v2a/ControlFoley_output/{task_id}/{filename}Queue busyTask is waitingScript auto-polls up to ~5 min; check load via curl $API_BASE/healthModel unavailableModel not enabledRun foley.py models to see available modelsTask timeoutService overloadedResubmit the task
See ./references/api-reference.md for full endpoint documentation.
https://controlfoley.ai.xiaomi.com