Nodes/KIE.ai Nodes Next/Claude Sonnet 5
ComfyUI Node

Claude Sonnet 5

Still fine, and the cheaper half of the Sonnet pair

By felipederosilva·Created 2 months ago·Updated 5 days ago· 3
Claude Sonnet 5
    • text
    • raw_json
    • credits_consumed
    • usage_json
    • credits_left
    ◄prompt►
    ◄system_prompt►
    ◄streamfalse►
    ◄tools_json[]►
    ◄history_json[]►
    ◄max_tokens4096►
    ◄thinkingfalse►
    ◄expert_override_json{}►

    Two Sonnet nodes in the same folder is a little confusing the first time you see it - Claude Sonnet 5 and Claude Sonnet 5.5 sitting one above the other in KIE Next / LLM / Claude / Sonnet. They're not duplicates. They're two model IDs from KIE's catalog, turned into two separate nodes because the pack's whole design rule is "one model, one node, no dropdown". The point of keeping Sonnet 5 around is that it's the cheaper of the two and still perfectly capable of the jobs people actually run in a graph.

    So: should you reach for it? If the task is "rewrite this into a structured prompt", "turn this script into six shot descriptions", "clean up this JSON" - yes, and you'll pay less per call than for 5.5. If the task is genuinely hard, or the output format keeps slipping, spend the extra on 5.5 and stop fighting it.

    How it's wired

    It's a catalog-generated node: model ID claude-sonnet-5 fixed at build time, POSTing to KIE's /claude/v1/messages. history_json becomes the message array, your prompt is appended as the final user message, system_prompt goes into the request's proper system field, and thinking sets a thinkingFlag. The returned assistant text gets flattened into a single STRING for the text output, with the full provider response kept in raw_json.

    No image socket on the Claude nodes. Anything multimodal needs history_json assembled by hand - not worth it for most people, and the reason the pack's OpenAI-shaped nodes exist.

    What to set, what to ignore

    • prompt - required, and the pack's local preflight won't let an empty one through to a paid call.
    • system_prompt - the format contract. "Output only the prompt, one paragraph, no commentary." Never skip this.
    • max_tokens - 4096 default, 131072 ceiling. Truncated JSON is almost always this.
    • history_json - [] by default; keep it that way unless you need the model to remember the last turn.
    • thinking - boolean, off. Turning it on buys latency and cost, not better comma placement.
    • tools_json, stream, expert_override_json - leave them. Streaming still resolves to one finished string in ComfyUI, so it's transport-only.

    Outputs: text plus raw_json, usage_json, credits_consumed, credits_left. The node prints spend and live balance on itself after each run, so you can watch a rewrite loop's cost add up without opening a browser tab.

    Install (once, for the whole pack)

    cd ComfyUI/custom_nodes
    git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
    cd ComfyUI-KIE-Nodes-Next && pip install -r requirements.txt
    # restart ComfyUI
    

    Manager search: "KIE.ai Nodes Next". The real dependency list is four ordinary Python packages (requests, Pillow, numpy, PyYAML) - no CUDA, no model files, no VRAM. Then one key paste in Settings → KIE.ai Nodes Next → Connection; it's validated against KIE before it replaces a working key, stored in ComfyUI's user config area, and never embedded in workflow JSON.

    One install-time thing to expect: on first load the pack pulls KIE's documentation index and builds the node library from it, which reloads the frontend once. If Claude Sonnet 5 isn't in the menu yet, the sync hasn't finished (KIE's docs being down just means you keep the cached library).

    Traps and honest limits

    An unconnected LLM node doesn't run at all - it's not an output node, so execution only reaches it through its text output. That surprises people who run a graph and see no spend and no output.

    Malformed JSON in history_json or tools_json fails locally, before any upload or billing. Good.

    Then the structural objections, which no node fixes: your prompt leaves the machine and hits Anthropic's moderation, and paid means paid. For the narrow job of making prompts more descriptive, a local abliterated 8B is free per call and uncensored - the reason to choose a hosted Sonnet is quality on structured text, not adjectives. Pick the cheaper Sonnet for batch rewrite loops; save 5.5 for the passes where you keep re-running because the output isn't good enough.

    CategoryKIE Next/LLM/Claude/Sonnet

    Inputs (8)

    NameTypeDefaultDescription
    promptSTRINGUser prompt / message.
    system_promptoptSTRING—
    streamoptBOOLEANfalse—
    tools_jsonoptSTRING[]Optional function/tool definitions supported by this model endpoint.
    history_jsonoptSTRING[]Optional prior message/input array as JSON.
    max_tokensoptINT40961–131072—
    thinkingoptBOOLEANfalse—
    expert_override_jsonoptSTRING{}Expert-only request overrides. Normal use does not require this.

    Outputs (5)

    NameTypeDescription
    textSTRING—
    raw_jsonSTRING—
    credits_consumedFLOAT—
    usage_jsonSTRING—
    credits_leftFLOAT—