Nodes/KIE.ai Nodes Next/KIE • Save Generation Recipe
ComfyUI Node

KIE • Save Generation Recipe

The receipt for the shot you'll want to redo in six weeks

By felipederosilva·Created 2 months ago·Updated 3 days ago· 3
KIE • Save Generation Recipe
    • recipe_id
    • recipe_json
    ◄model►
    ◄prompt►
    ◄task_id►
    ◄credits_consumed0.00►
    ◄camera_plan_json{}►
    ◄references_json[]►
    ◄result_urls_json[]►

    What it is

    A local, immutable record of one paid generation: which model, the exact prompt, the camera plan, the references, the KIE task ID, the result URLs, and how much it cost.

    It's the difference between "I made something great last Tuesday" and "here is the prompt, here is the ID, here is what it cost, and here is the URL I can re-download it from." If you're running metered API nodes - and this pack is nothing but metered API nodes - then you're running a small production shop, and production shops keep receipts.

    How it works

    Feed it four required fields: model, prompt, task_id and credits_consumed. The first two must be non-empty; a recipe without a model or prompt is refused. credits_consumed must be a finite non-negative number, and every field is capped at 30,000 characters - if you're pasting a novel into the references array, the node tells you to summarise instead.

    Three optional JSON widgets carry the rest: camera_plan_json (an object or array - KIE • Camera Path's camera_path_json drops in here), references_json (an array), and result_urls_json (an array - the generator's all_urls_json connects straight in). All three are parsed at run time and type-checked, so a bad paste is a clear error, not a corrupt record.

    The record's ID is derived, not random: task-<slug of the task id> when you supplied one, otherwise draft-<first 20 hex chars of the content hash>. Content is hashed with sorted keys, and that hash is written into the file as content_sha256 - which is what KIE • Load Generation Recipe uses to detect a hand-edited recipe later.

    Writes are atomic: a .saving partial file is written and then renamed into place. And if a recipe for that task ID already exists with different content, the node refuses and tells you to keep the original - the same immutability discipline the pack applies to Elements and Character Variants. No API key is ever stored in the record.

    Inputs and outputs

    Outputs are recipe_id (the derived key) and recipe_json (the whole pretty-printed record). The record JSON is the thing you'd archive; the ID is what you paste into KIE • Load Generation Recipe later.

    The wiring that makes this pleasant: on a generation node, take task_id, prompt, all_urls_json and credits_consumed and connect them all here. Add camera_path_json from Camera Path if you planned the move. One node per generation and you have a searchable history of everything you paid for.

    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
    

    Recipes are written under the pack's user-data folder (KIE-Nodes-Next/recipes), outside the extension install, so an update doesn't take them with it. No key needed here - it never calls KIE. It is an output node, so it writes on every queue.

    Where people get burned

    • Nothing is automatic. The README says it outright: record creation is explicit, not automatic for every generator. If you don't wire one of these, you have no receipt. Which is exactly when you'll want one.
    • You have to be disciplined about the folder. Recipes are per ComfyUI profile, and nothing syncs them anywhere. If this is a business workflow, back the folder up.
    • Wrong task ID, no collision. A typo produces a task-<garbage> recipe that references nothing. You won't get an error - just a record you can't retrieve from. Copy IDs from the task_id output or from KIE • Task Board.
    • It's a receipt, not a backup. The record stores the result URLs, not the media. KIE • Reuse Completed Video fetches from those URLs; if KIE stops serving them, export the file too and point the recipe's notes at where it went.
    CategoryKIE Next/Studio/Production

    Inputs (7)

    NameTypeDefaultDescription
    modelSTRING—
    promptSTRING—
    task_idSTRING—
    credits_consumedFLOAT0.00—
    camera_plan_jsonoptSTRING{}—
    references_jsonoptSTRING[]—
    result_urls_jsonoptSTRING[]—

    Outputs (2)

    NameTypeDescription
    recipe_idSTRING—
    recipe_jsonSTRING—