Nodes/DeepSeek Prompt Chat/DeepSeek 连续对话 · 确认后出图
ComfyUI Node

DeepSeek 连续对话 · 确认后出图

Chat your way to a prompt, then press Confirm — this node won't render until you do

By lh658459·Created 25 days ago·Updated 25 days ago· 0
DeepSeek 连续对话 · 确认后出图
    • 已确认提示词
    ◄approved_prompt►
    ◄confirmedfalse►

    This is the API branch of the "LLM in the graph" pattern, with one opinionated twist: the chat is not allowed to generate anything. You argue with DeepSeek until the prompt reads right, press a button, and only then does your local workflow run.

    Want a node that silently rewrites every prompt you queue instead? Look elsewhere.

    What's actually in the pack

    One node, DeepSeekPromptChat (displayed as DeepSeek 连续对话 · 确认后出图), category DeepSeek/对话提示词. The node itself is a two-field gate; the bulk of the pack is front-end - a three-column chat panel in web/chat-v1.4.1.js plus a small aiohttp backend.

    The short version. It does not run a model locally: it posts your conversation to https://api.deepseek.com/chat/completions with your key, billed to your DeepSeek account. It's a light install, too - requirements.txt is just aiohttp>=3.9,<4. You pay in API calls, not disk. And there's basically no community discussion of this pack yet, so treat the below as a code-reading tour rather than crowd-tested consensus.

    How it works

    The backend adds two routes to ComfyUI's own web server: GET /deepseek_prompt_chat/status (does a key exist?) and POST /deepseek_prompt_chat/chat. The panel posts your history; the backend wraps and forwards it.

    What shapes your output is the system prompt, hardcoded in __init__.py. It tells the model it's editing prompts for one specific checkpoint - rinFlanimeIllustrious_v30, the author's own Illustrious merge - and demands JSON back with reply, positive_prompt and translations. Requests go out as response_format: json_object, temperature: 0.7, max_tokens: 4096, thinking disabled, 150-second timeout.

    Then it validates hard: reply and positive_prompt must be strings, the English prompt must contain zero CJK characters, and translations needs exactly one entry per comma-split tag with en matching that tag exactly. A mismatch errors out rather than returning a half-result. That's why the Chinese labels line up with the tags, and why no Chinese can reach the sampler.

    There's also an optional TXT knowledge base in browser localStorage: keyword overlap, top four fragments. Search, not embeddings, so tidy files beat big ones.

    The inputs and outputs that matter

    info_schema is short, and the two inputs are the whole story:

    • approved_prompt - STRING, multiline, default empty. The English prompt. You're not meant to type here; the Confirm button writes into it.
    • confirmed - BOOLEAN, default false. This is the gate.
    • Output: one STRING named 已确认提示词, wired into a CLIPTextEncode node's text. Right-click that text widget and Convert widget to input if the socket isn't showing.

    仅确认提示词 writes the prompt in and tells you to press Run yourself; 确认并生成图片 writes it and calls app.queuePrompt(0, 1) to submit everything.

    The boolean earns its keep in emit(): not confirmed, empty prompt, or a stray Chinese character in the English box, and the node raises instead of returning a value. "Confirm your prompt first" in your console is the design working. The node isn't an output node either, so the panel submits rather than the graph - in a busy workflow your other output branches fire too. The Flash/Pro dropdown maps to an allowlist of deepseek-v4-flash and deepseek-v4-pro, and if DeepSeek renames those, the node is what needs updating.

    Installing it

    ComfyUI Manager → search DeepSeek Prompt Chat (registry publisher bridow). Or by hand, using ComfyUI's own Python:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lh658459/ComfyUI-DeepSeek-Prompt-Chat
    python -m pip install -r ComfyUI-DeepSeek-Prompt-Chat/requirements.txt
    

    Restart the backend, then hard-refresh the tab - the panel is JS served from web/, so a cached page after a backend-only restart is the classic "no button".

    Key order, from the code: panel input → DEEPSEEK_API_KEY env var → a .env in the node folder → a neighbouring llm-toolkit/.env. Copy .env.example if you want it to survive a refresh; the panel box is memory-only and never lands in your workflow.

    Where people get burned

    No button, or a doubled UI. The button is created in JavaScript and isn't serialized into the workflow: two bare fields means the web assets didn't load, usually a leftover chat*.js from an older release. On upgrade, keep only chat-v1.4.1.js.

    It opens but won't send. 401 is a bad key, 402 an empty DeepSeek balance, 429 rate limiting - the panel translates all three.

    Too long, or losing your place. More than 160 messages is rejected - start a new conversation instead of pruning. Sessions live in the browser and merge with the workflow by update time, so Ctrl+S is your real backup; clearing site data means restoring from a saved workflow. (The 50-unarchived cap nags, never deletes.)

    Hand-edited English. Tweak the prompt yourself and the Chinese labels go stale and say so - send it back to DeepSeek to re-align. Older versions aren't retro-translated.

    Expecting neutral prompting. The system prompt names an anime Illustrious checkpoint and returns comma-separated booru-style tags, so photoreal Flux or Krea work keeps getting dragged back toward tag soup.

    Sharing the workflow. Conversation records and prompts are saved into the workflow, and workflow metadata rides into generated PNGs. Check before you post it.

    CategoryDeepSeek/对话提示词

    Inputs (2)

    NameTypeDefaultDescription
    approved_promptSTRING—
    confirmedBOOLEANfalse—

    Outputs (1)

    NameTypeDescription
    已确认提示词STRING—