Audio Output to Conditioning Queue
Chain generations — feed the last track back in for a continuation
- audio_input
- conditioning_audio
- queue_info
- loaded_file
Here's the thing that makes this pack feel like a real music tool instead of a one-shot generator: AudioOutputToConditioningQueue lets you take audio you already generated and feed it back into HuggingFaceMusicGen's conditioning_audio input, so the next generation continues the previous one. One prompt becomes a progression. A two-bar loop becomes a full track, stitched generation by generation.
Displayed as "Audio Output to Conditioning Queue", it's the connective tissue between runs. You run MusicGen, it stores its output, this node retrieves it, hands it back as conditioning audio, and the next generation extends it.
How it works
There's a bit of plumbing under the hood that's actually clever. The HuggingFaceMusicGen node automatically stores every generation it produces into a class-level store under the queue id main_chain - no extra wiring needed. This node then grabs that stored audio (or loads from a file, or takes a direct socket input) and trims it to your max_conditioning_duration, so you're not conditioning on an arbitrarily long history. It also keeps a queue of up to 10 previous entries per queue_id, so a longer continuation chain is possible.
The inputs that matter:
- queue_id - default
main_chain. This must match how you run your MusicGen node, because that's the key the generated audio is stored under. Keep the default and it just works. - source_mode -
last_generated(default, grabs the most recent MusicGen output),load_file(reads fromfile_path, resolving relative paths against ComfyUI's output then input directories), ordirect_input(uses theaudio_inputsocket you connect). - max_conditioning_duration - 1–30s, default 10. Cap on how much history feeds the next generation. Lower = faster, more focused continuations.
- file_path - only for
load_filemode.
Outputs: conditioning_audio (AUDIO, the thing you wire into MusicGen), queue_info (STRING, queue length and what got loaded), and loaded_file (STRING, the filename or source used).
Where it fits
HuggingFaceMusicGen → audio ──┐
↓
AudioOutputToConditioningQueue
↓ conditioning_audio
HuggingFaceMusicGen (next)
A classic continuation chain: generate part one, let this node catch the output, generate part two with part one as conditioning, repeat. Or in load_file mode, point it at a saved track and have MusicGen extend something you made yesterday.
Install
Same pack, same drill - ebrinz/ComfyUI-MusicGen-HF via Manager (search the pack title) or:
cd ComfyUI/custom_nodes
git clone https://github.com/ebrinz/ComfyUI-MusicGen-HF
cd ComfyUI-MusicGen-HF
pip install -r requirements.txt
Restart ComfyUI.
Troubleshooting
The most common failure is silence in the output plus a queue_info that says "No last generated audio available" - that means MusicGen hasn't run yet in this ComfyUI session, or it stored under a different queue_id than you're reading. Run the generation node first, keep queue ids consistent, and you're fine. If load_file says "File not found", remember relative paths resolve against output/input dirs - an absolute path always wins. And don't use direct_input mode without connecting audio_input; it returns a silence stub with an error string. When in doubt, read the queue_info output - it's honest about what happened.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| queue_id | STRING | main_chain | Unique identifier for this conditioning chain |
| source_mode | COMBO | last_generated | Source of conditioning audio |
| max_conditioning_duration | FLOAT | 10.01–30 | Maximum duration for conditioning audio |
| audio_inputopt | AUDIO | Direct audio input (for direct_input mode) | |
| file_pathopt | STRING | Path to audio file (for load_file mode) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| conditioning_audio | AUDIO | — |
| queue_info | STRING | — |
| loaded_file | STRING | — |