KIE • Reuse Completed Audio
Get your paid track back without paying twice
- config
- audio
- url
- task_id
- all_urls_json
- historical_credits
What it is
The most obviously useful node in the pack and the least glamorous: paste a KIE task ID for an audio job that already finished, and get the audio back into your graph. No new task, no second charge, no re-roll.
This exists because ComfyUI re-runs things. You tweak a downstream node, queue, and suddenly your music generation fires again and your balance drops. Splitting the expensive, non-deterministic step away from the cheap iterative steps is the single biggest cost-control habit in an API-node workflow, and this node is how you do it.
How it works
task_id goes to KIE's task-lookup endpoint. The node requires state == "success" - a pending or failed task gets an error naming the state rather than a silent empty output. Then it pulls the result URLs out of the response, filters them by media kind (for audio: .mp3, .wav, .flac, .m4a, .aac, .ogg; if nothing matches it falls back to the full list rather than failing), takes the one at result_index, downloads it, and converts it to a native ComfyUI AUDIO object.
The historical_credits output reports what KIE says the task originally consumed. This is a lookup, not a charge - the node never submits and never re-bills, which is exactly what the pack's own description promises.
Both the ID and the index matter. Suno-family jobs typically return more than one track, so result_index 0 and 1 are different songs. If the task has fewer candidates than your index, you get told how many it does have.
Inputs and outputs
task_id- required, pasted as text. This is the point: you feed it an ID, not a generator node. The source comment is blunt about why: connecting a generation node here would defeat the entire purpose.result_index- 0 to 20, default 0.config- optionalKIE_CONFIGfor legacy graphs. Normal use leaves it empty and the key comes from Settings.
Outputs: audio, url, task_id, all_urls_json, historical_credits.
Where the task ID comes from
Three places. The generator node's own task_id output, if you're still in the same session. Your ComfyUI-local task journal - KIE • Task Board lists the last twenty IDs this profile submitted, and Settings → KIE.ai Nodes Next → Tasks shows the last five. And KIE • Load Generation Recipe, if you saved a recipe that recorded the ID.
That journal is worth knowing about: it stores IDs, model names, state and spend, not prompts and never your key. It's per-profile, not an account-wide history.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
python -m pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
Then set the key once: Settings → KIE.ai Nodes Next → Connection. Retrieval still needs a working key, even though it costs nothing.
Where people get burned
- Pending tasks. If the job is still running you get the state in an error. That's usually a job whose node timed out earlier - wait, then retrieve by ID instead of re-running.
- A dead URL. The node re-fetches the task record and downloads from KIE's returned URL each run. It's a lookup, not a local cache; if those result URLs stop resolving, the retrieval stops working. That's the argument for also saving the actual file with
KIE • Save Videoalongside the ID. - Wiring a generator into
task_id. It's a string input, so Comfy lets you connect one - and then the generator runs and you've paid for a brand new job to hand this node a fresh ID. Paste the ID instead. - Wrong index on a multi-track job. Index 0 is not "the good one". Check
all_urls_jsonif a track sounds like the wrong take.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| task_id | STRING | — | |
| result_index | INT | 00–20 | — |
| configopt | KIE_CONFIG | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| url | STRING | — |
| task_id | STRING | — |
| all_urls_json | STRING | — |
| historical_credits | FLOAT | — |