Nodes/KIE.ai Nodes Next/KIE • Reuse Completed Audio
ComfyUI Node

KIE • Reuse Completed Audio

Get your paid track back without paying twice

By felipederosilva·Created 2 months ago·Updated 3 days ago· 3
KIE • Reuse Completed Audio
  • config
  • audio
  • url
  • task_id
  • all_urls_json
  • historical_credits
◄task_id►
◄result_index0►

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 - optional KIE_CONFIG for 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 Video alongside 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_json if a track sounds like the wrong take.
CategoryKIE Next/Utility/Tasks

Inputs (3)

NameTypeDefaultDescription
task_idSTRING—
result_indexINT00–20—
configoptKIE_CONFIG—

Outputs (5)

NameTypeDescription
audioAUDIO—
urlSTRING—
task_idSTRING—
all_urls_jsonSTRING—
historical_creditsFLOAT—