Nodes/Continuity Director/CD · Idempotency Key
ComfyUI Node

CD · Idempotency Key

Give every request a stable fingerprint so double-submits don't double-run

By xinjian0101·Created 3 months ago·Updated 2 months ago· 0
CD · Idempotency Key
    • idempotency_key
    • canonical_json
    namespacegeneration
    payload_json{}

    You've queued a generation, the UI hiccupped, and you hit submit again - now there are two identical jobs burning GPU time, or worse, two renders of the same take that will silently disagree. CDIdempotencyKey is the node that makes duplicate submissions harmless by giving each request a stable fingerprint: same payload in, same key out, every time. It's how you tell "this is a retry of that job" from "this is a genuinely new job" without thinking about it.

    It's from Continuity Director, a 20-node pack for repeatable AI video production, and it's one of the reliability nodes - the ones that exist so long batches don't turn into duplicated or lost work.

    What you feed it

    • namespace - a label that scopes the key, default generation. Use a different namespace per pipeline so a character-lock key never collides with a render key.
    • payload_json - the request you're fingerprinting. This is the whole point: the exact content of the job.

    How it works

    The node does two things. First, it canonicalizes the payload - serializes it with sorted keys and stable formatting, so {"a":1,"b":2} and {"b":2,"a":1} produce the same fingerprint instead of two different ones. Key order chaos is the classic source of "identical" requests that hash differently, and this kills it. Then it computes SHA-256 of that canonical form and prefixes the namespace: the output looks like generation:6f4e... - the full 64-hex SHA-256 after the colon.

    Outputs: idempotency_key (the stable fingerprint, the thing you store or hand to your queue) and canonical_json (the normalized payload - useful for debugging exactly what was fingerprinted, and for storing alongside the key as your dedup record).

    Installing it

    Continuity Director is one of the cleanest packs to install in the ecosystem: no model downloads, no API keys, and requirements.txt is a comment declaring no mandatory Python dependencies. All standard library - nothing to conflict. Search "Continuity Director" in ComfyUI Manager and restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xinjian0101/continuity-director.git ComfyUI-ContinuityDirector
    

    Restart ComfyUI - nodes appear as CD · ..., plus a Continuity Director sidebar with an "Add starter chain" scaffold. Update with git pull.

    The honest take

    This node produces the key; it doesn't enforce anything. Nothing here checks a ledger or blocks a duplicate - the enforcement is up to you (store the key with the job, and on submit, "if this key already ran, skip"). Which means it's genuinely thin on its own, and that's fine: idempotency keys are a convention, and this node just makes the convention deterministic and hash-linked like the rest of the pack. The subtle part people miss is the namespace. Leave everything under generation and you'll dedup across workflows that shouldn't dedup - a manifest build and a render with the same payload content would share a key. Namespace per logical operation, and the whole system stays honest.

    CategoryContinuity Director/07 Reliability

    Inputs (2)

    NameTypeDefaultDescription
    namespaceSTRINGgeneration
    payload_jsonSTRING{}

    Outputs (2)

    NameTypeDescription
    idempotency_keySTRING
    canonical_jsonSTRING