Nodes/KIE.ai Nodes Next/Claude Opus 4.7
ComfyUI Node

Claude Opus 4.7

The Reasoning Toggle Is the Whole Story

By felipederosilva·Created about a month ago·Updated about 22 hours ago· 3
Claude Opus 4.7
    • text
    • raw_json
    • credits_consumed
    • usage_json
    • credits_left
    ◄prompt►
    ◄system_prompt►
    ◄streamfalse►
    ◄tools_json[]►
    ◄history_json[]►
    ◄max_tokens4096►
    ◄thinkingfalse►
    ◄expert_override_json{}►

    Most Claude nodes in this pack are interchangeable at the widget level: same inputs, same outputs, one model string different. Opus 4.7 has one control that actually matters in day-to-day use, and it's the thinking boolean. Turn it on and you're paying for deliberation. Turn it off and you're paying for an answer. For prompt work, off is almost always right.

    Why the thinking toggle isn't free money

    Here's the counterintuitive part, and it's the reason I'd steer a beginner off it: an LLM bolt-on in ComfyUI is doing short structured rewriting, not solving a maths problem. The KB's llm-in-comfyui.md makes the case bluntly - the job selects for small and obedient, not large and clever, and reasoning models are more likely to leak their scratch-work into your prompt, which is strictly worse than no enhancer at all. Once "Let me think about this step by step..." lands in your conditioning, you have a problem your sampler can't fix.

    Where thinking earns its keep: one-off, hard, multi-constraint briefs. Writing a six-shot video plan where shot 4 has to inherit continuity from shot 2. Resolving a contradictory prompt into something a model can render. That's a run-twice-a-week job, not a loop. Flip it on for that, off for everything else.

    How it works

    The class is generated from KIE's published Claude API page at startup and posts an Anthropic-shaped body - model, messages, stream, max_tokens, optional system, tools, and thinkingFlag - to /claude/v1/messages on KIE's API domain. Note the field name: thinking on the widget becomes thinkingFlag in the request, which is KIE's spelling, not Anthropic's budgeted thinking object. If you specifically need the documented raw shape, expert_override_json merges into the request body after everything else is built - it's a genuine last-resort override, and it wins.

    history_json is parsed from JSON and used as the messages array verbatim; your prompt is appended as the final user turn. That's how multi-turn works here, and it's also the mechanism that lets you pre-seed a conversation with an assistant turn if you know what you're doing.

    Inputs and outputs

    Required: prompt. Optional and worth setting: system_prompt (your output contract - "reply with the prompt only"), max_tokens (4096 default, 131072 ceiling), thinking. Leave tools_json at [] unless you're handing a function schema to a chat model, which is not what this node is for in a Comfy graph.

    Outputs: text goes downstream into a text-encode node or another model's prompt socket. raw_json is the full provider response - the thing you read when the text looks wrong. usage_json carries the provider's token accounting; credits_consumed and credits_left are floats, and the node stamps a credits receipt onto itself each run.

    No IMAGE socket on Claude nodes - multimodal bodies have to go through history_json or expert_override_json, with the image uploaded first via KIE • Upload Image.

    Install

    ComfyUI Manager, search ComfyUI-KIE-Nodes-Next. The README positions Registry publishing as prepared rather than shipped, so if Manager turns up nothing:

    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, then Settings → KIE.ai Nodes Next → Connection, paste the key, confirm the CONNECTED row. KIE_API_KEY overrides the stored key for headless setups. Python 3.10+, no GPU, no model files.

    Common issues

    Thinking on, output got worse and the bill went up. Already covered, but it's the #1 thing people get wrong with this node. Test both.

    Truncated or empty text. Raise max_tokens. A thinking pass can consume a big chunk of the budget before it writes anything you can see, so if you're using both thinking and a low max_tokens, you've created a call that reliably returns nothing useful.

    Role delimiters and preambles in your prompt. Chat scaffolding is the characteristic failure of every LLM-as-prompter. Fix it in system_prompt; the downstream node won't silently strip it.

    Not in the menu after install. Startup builds the node library from KIE's docs index and reloads the frontend once. Restart first, panic later.

    Everything is metered. Every run is a billable call, and a loop of 50 runs is 50 bills. The node's credits receipt is there precisely so you can watch that happen.

    CategoryKIE Next/LLM/Claude/Opus

    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—