DeepSeek Reasoner
The R1 node that keeps the thinking out of your prompt
- reasoning_content
- content
If you've ever run a reasoning model through a ComfyUI text node, you know the exact problem this one fixes: the model doesn't just answer, it thinks out loud, and all that chain-of-thought spills into your prompt. ComfyUI isn't great at cropping that, so people end up hacking in text-split nodes to cut everything before </think>. DeepSeek Reasoner just hands you two separate outputs - the thinking and the answer - and lets you pick. It's the second node in the same yanhuifair/comfyui-deepseek pack as Chat Pro, and it's the one that makes the pack worth installing.
What it is
Like its sibling, it's an API wrapper: the openai client pointed at https://api.deepseek.com, this time with model="deepseek-reasoner" - DeepSeek's R1, the reasoning model. Nothing runs locally, no weights to download. The interesting part is the mechanism on the ComfyUI side. Where Chat Pro is stateless, this node keeps a running conversation list (self.history_content) in memory on the node instance. Every call appends your prompt, and after the reply it appends the assistant's answer back, so you get genuine multi-turn dialogue in a single node.
Inputs and outputs
Only three inputs, all in the "required" bucket:
- prompt (multiline string) - the message you send.
- clear_history_content (boolean, default false) - set it true to wipe the conversation before this call. That's your reset button, and you'll use it more than you expect.
- max_tokens (default 4096, max 8192) - and read this tooltip carefully, because it trails off mid-sentence in the source (this pack is terse): it caps the length of the final response only. The chain-of-thought can run up to ~32K tokens on its own.
Two outputs, and this is the whole selling point:
- reasoning_content (STRING) - R1's visible reasoning. Mostly you ignore it; it's there for debugging or curiosity.
- content (STRING) - the final answer. This is what you wire into your prompt path.
Why pick this over Chat Pro
The two-output split is the reason. A reasoning model is the wrong default for short structured rewriting - it spends tokens deliberating and tends to leak scratch-work into its output, which is exactly the failure mode that bites people wiring an LLM into a sampler. This node doesn't fight that; it lets you take only the clean answer. Where it genuinely shines is anything that benefits from deliberation: rewriting a vague idea into a structured prompt with actual reasoning behind it, or chaining a multi-turn conversation where each turn builds on the last.
If you just want a quick rewrite, use Chat Pro instead - it's faster, cheaper, and has the temperature/presence dials you'll actually want. This node deliberately has no temperature or penalty knobs because DeepSeek's reasoner API doesn't accept them. Don't go hunting for them; they're not missing, they're unsupported.
Installing it
Same as the rest of the pack: ComfyUI Manager, search comfyui-deepseek, install, restart. The only dependency is openai; no model files, no GPU footprint. Then drop an api_key.txt file containing your DeepSeek API key into the pack's folder - there's no other configuration.
The gotchas, spelled out
- It's stateful, and ComfyUI doesn't warn you. The conversation lives on the node instance in memory. Run the queue twice and your second call arrives with the first exchange as context. Duplicate the node or reload the workflow and the history resets. If you want one-shot behavior, keep
clear_history_contenton true. - The key is read once at node creation. Edit
api_key.txtand re-add the node or the old key lingers. - Reasoning is slow and chatty. R1 takes far longer and burns far more tokens than V3 before it answers - a long CoT is billed too, and it's all metered. For cheap-and-fast, that's Chat Pro's job.
- Your prompt leaves the machine. It's an API node: data goes to DeepSeek's servers, subject to their filters and logging. Same privacy math as every cloud call.
Wire content into your text encode, keep reasoning_content disconnected, and you've got an R1 in your workflow without the </think> cleanup dance.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| clear_history_content | BOOLEAN | false | — |
| max_tokens | INT | 40961–8192 | The maximum length of the final response after the CoT output is completed, defaulting to 4K, with a maximum of 8K. Note that the CoT output can reach up to 32K tokens, and the parameter to control the CoT length |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| reasoning_content | STRING | — |
| content | STRING | — |