Nodes/ComfyUI DeepSeek_R1 Chat Node/DeepSeek-R1 Chat/Instruct
ComfyUI Node

DeepSeek-R1 Chat/Instruct

DeepSeek-R1 in your node graph — no GPU, just an API key

By ShmuelRonen·Created 2 years ago·Updated 2 years ago· 18
DeepSeek-R1 Chat/Instruct
    • latest_response
    • full_chat_history
    modechat
    promptHello, how can I help you?
    max_tokens4096
    show_reasoningtrue
    clear_historyfalse
    remember_chatyes
    vision_description

    Let's get the important thing out of the way first, because the name will trip you up: this node does not run a local model. Despite "DeepSeek_R1" and "Chat" in the title, there's no GGUF to download, no llama.cpp under the hood, no VRAM touched. ComfyUIDeepSeekChat is a thin wrapper around DeepSeek's hosted API. You feed it a prompt, it POSTs to https://api.deepseek.com/v1/chat/completions with the deepseek-reasoner model, and it hands the reply back as a string you can wire anywhere in your graph.

    That's exactly why you'd reach for it. ComfyUI has no built-in LLM, and a lot of good workflows want one - prompt rewriting, prompt-to-prompt chains, turning a caption into a better prompt. This gets you a genuinely strong reasoning model in the graph with zero local setup. The tradeoffs are the usual cloud ones: your prompts leave your machine, you're paying per token, and a DeepSeek API outage takes the node down with it. If you wanted R1 running offline, this isn't the tool - look at a local GGUF node instead. If you just want a smart text brain wired into a workflow, this works.

    How it works

    The node is a single class (ComfyUIDeepSeekChat) with two modes. chat keeps a running conversation in memory and, if remember_chat is "yes", persists it to a chat_history.json next to the node file - so re-running the workflow continues the conversation. instruct sends a one-shot message with no history, which is what you want for deterministic prompt-rewrite steps. Because deepseek-reasoner is a reasoning model, the API returns a separate reasoning_content field alongside the answer; show_reasoning prepends it to the output as Reasoning: ... text.

    Two quirks worth knowing from the source. First, there's a built-in 1-second minimum between requests, so hammering a graph with chat mode on gets sluggish - it's deliberate rate-limit protection. Second, failures don't crash the graph: an API error is returned as text in the output. So "API Error 401: ..." sitting in your preview is the node working exactly as designed, telling you the key is bad.

    The inputs that matter

    You mostly set three things:

    • mode - chat (with memory) or instruct (single turn). Default chat.
    • prompt - the text you send. That's it.
    • max_tokens - reply length, 1–8192, default 4096. For short rephrasing jobs, drop it to a few hundred; you'll feel the difference in latency.

    Also on the panel: show_reasoning (default on), clear_history (a boolean that wipes the conversation), and remember_chat (yes/no). The one that will bite you is the optional vision_description input. It's a string, not an image - if it's filled, the code just prepends "Image description: {text}" to your prompt. There's no real vision here. To feed an actual image you chain a captioning node (the pack ships a Florence-2 workflow example) and pipe its text into this field.

    The two outputs are both strings: latest_response (the reply, optionally with reasoning) and full_chat_history (the whole conversation, formatted). Both go straight into a Preview Text or Save Text node.

    Installation

    ComfyUI Manager: search "DeepSeek" and install. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ShmuelRonen/ComfyUI-DeepSeek_R1-Chat
    

    Then restart ComfyUI. The only real dependency is requests, which your ComfyUI environment already has - there are no model downloads because nothing runs locally.

    Then get a key at platform.deepseek.com/api_keys (you'll need a funded account) and drop it in config.json inside the installed node's folder - the code reads that file relative to its own directory, so the path is custom_nodes/ComfyUI-DeepSeek_R1-Chat/config.json:

    {
        "deepseek_api_key": "your-api-key-here"
    }
    

    Minor warning: the README's clone URL says comfyui-deepseek-chat, which is stale. Clone the ComfyUI-DeepSeek_R1-Chat repo above, or use Manager and you'll sidestep it.

    Common issues

    • Output reads "Please add your DeepSeek API key to config.json" - the key is missing or still the placeholder. Edit the file in the node's own folder and restart.
    • 401 - wrong or expired key. 429 - out of credit or hitting limits. DeepSeek's API is pay-per-token and has had real availability wobbles; the README points at their status page, and it's worth a glance when calls start failing for no obvious reason.
    • I connected an image and nothing happened - vision_description is text, not pixels. Add a captioning node (Florence-2) and feed its output in.
    • The workflow feels slow - the 1-second rate limiter is on, and chat mode re-sends the whole history every run. For quick experiments, use instruct.

    It's a small, single-purpose node, and for what it does it's honest: a cheap way to hang a real reasoning LLM off your workflow without buying compute. Just don't expect it to be a local model - that's the one expectation it won't meet.

    CategoryComfyUI/DeepSeek Chat

    Inputs (7)

    NameTypeDefaultDescription
    modeCOMBOchat2 options: chat, instruct
    promptSTRINGHello, how can I help you?
    max_tokensINT40961–8192
    show_reasoningBOOLEANtrue
    clear_historyBOOLEANfalse
    remember_chatCOMBOyes2 options: yes, no
    vision_descriptionoptSTRING

    Outputs (2)

    NameTypeDescription
    latest_responseSTRING
    full_chat_historySTRING