KIE • Reuse Completed Image
Pull a paid render back by task ID
- config
- image
- url
- task_id
- all_urls_json
- historical_credits
What it is
Paste in a KIE task ID for an image job that already completed, and this node hands you the image as a normal IMAGE socket. It queries, it downloads, it converts. It never submits a job and never charges you again.
The reason this matters more than it sounds: every generation node in this pack is a paid, non-deterministic call. When you're iterating on the downstream half of a graph - upscaling, muxing, compositing, consistency boards - you do not want the expensive upstream half re-rolling because you nudged a slider. Freezing the result and working from a fixed input is how you keep a session cheap and reproducible.
How it works
The task ID goes to KIE's status endpoint. The node insists the task state is success; anything else errors with the state named, so a job that's still running tells you so instead of handing you an empty socket. From the success payload it extracts every result URL, then filters them for image extensions (.png, .jpg, .jpeg, .webp, .gif) - image endpoints often return several files, thumbnails or extras included - and falls back to the unfiltered list if nothing matches.
result_index (0–20) picks which one. Most image models return one or two; some return a grid plus slices. If you ask for an index that doesn't exist, the error tells you how many candidates the task actually has, which is the fastest way to learn a model's output shape.
The chosen URL is downloaded and decoded into a ComfyUI image tensor. historical_credits reports the original spend from the task record - a report, not a new charge. The node's own description is explicit that credits are never counted twice, and the mechanism supports that: there's no create-task call anywhere in it.
Inputs and outputs
task_id- required text. Paste it; don't wire a generator into it. The source comment spells out why: connecting a generation node means the frozen result is gone and you've paid for a new one.result_index- 0 to 20, default 0.config- optionalKIE_CONFIG, for legacy v0.1-style workflows. Leave it empty; the key comes from Settings.
Outputs: image, url, task_id, all_urls_json, historical_credits. all_urls_json is worth printing through a Review Text node when you're learning a model - it shows you every artefact the endpoint returned, including ones the node didn't pick.
Where to find the ID
The task_id output on the generator node itself, while you're still in that session. KIE • Task Board, which refreshes the last twenty IDs this ComfyUI profile submitted. Or KIE • Load Generation Recipe, if you saved a recipe with the ID in it - that's the durable path, since the local journal is per-profile and the recipe is a file you own.
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
Set the key once in Settings → KIE.ai Nodes Next → Connection - retrieval needs it, even though it's free. Dependencies are requests, Pillow, numpy, PyYAML.
Where people get burned
- A failed job is not retrievable. Failed tasks error out. The node won't resurrect a result that doesn't exist, and no amount of re-queuing changes that.
- The URL has to still resolve. Each run re-queries KIE and re-downloads. There's no local cache, so this node is not a backup - the file, or a recipe recording the URLs, is your backup.
- Wrong index. On grid-returning models, index 0 can be the composite rather than the single image you meant. Print
all_urls_jsononce and stop guessing. - Credits confusion.
historical_creditsis what the original run cost. Don't add it to a session total twice; the pack's credit tracker is already designed not to double-count.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| task_id | STRING | — | |
| result_index | INT | 00–20 | — |
| configopt | KIE_CONFIG | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| url | STRING | — |
| task_id | STRING | — |
| all_urls_json | STRING | — |
| historical_credits | FLOAT | — |