Nodes/ComfyUI_pandai/Pandai DSK Node
ComfyUI Node

Pandai DSK Node

A DeepSeek LLM inside ComfyUI, no GPU required — the Pandai DSK Node

By pandaer119·Created 2 years ago·Updated about a year ago· 14
Pandai DSK Node
  • history
  • generated_text
  • polished_text
  • history
api_keyyour_api_key_here
model
max_tokens4096
temperature1.0
top_p1.0
presence_penalty0.0
frequency_penalty0.0
system_promptYou are a helpful assistant.
user_prompt
enable_translationdisable
enable_polishdisable

Pandai DSK Node is a small ComfyUI node that phones home to DeepSeek's API and hands you back text: raw generation, automatic Chinese↔English translation, or a prompt-expansion pass tuned for Flux-style models. The name is a lie, sort of - it doesn't need a local model, a GPU, or any of your VRAM. It needs an API key, an internet connection, and a couple of yuan's worth of credit.

Why would you put a cloud LLM in your graph at all? Because the modern text encoders in the models you're actually running want sentences, not comma tags. The T5 encoder behind Flux, and the general-purpose LLM encoders on newer models, are fed an instruction; the tag-list prompting habits from SDXL silently do nothing on them. That's the whole argument for a prompt-expansion node, and DeepSeek is the usual candidate for it: it's dramatically cheaper than the big OpenAI/Anthropic endpoints, the API is OpenAI-compatible, and the community has been wiring it into prompt-expansion nodes since DeepSeek V3 shipped. This node is one more wrapper in that genre - from a solo Chinese author who bundled it with a document reader in one pack.

How it works. Under the hood it's a thin OpenAI-SDK client pointed at https://api.deepseek.com. The node builds a chat message list (system + your user prompt, or a carried-over history), calls chat.completions.create with your sampling knobs, and returns the model's reply. Then the two extras kick in:

  • Translation (enable_translation) scans the generated text for CJK characters. Found Chinese → translate to English; otherwise → translate to Chinese. Auto-direction, no target field.
  • Polish (enable_polish) asks DeepSeek to expand the text into a richer scene description - lighting, textures, colors, atmosphere - explicitly framed as "make this suitable for Flux model input."

The inputs that matter. The full sampler row is there (max_tokens, temperature, top_p, presence_penalty, frequency_penalty) with sane ranges, but a beginner sets three things:

  • api_key - the placeholder your_api_key_here will fail until you paste a real key from platform.deepseek.com. Note the key lives in the workflow JSON, so scrub it before sharing a workflow.
  • user_prompt - what you actually want; system_prompt defaults to "You are a helpful assistant."
  • enable_translation / enable_polish - dropdowns, both default to disable.

Model is fixed to deepseek-chat; history is optional and expects the node's own history output.

Outputs. Three of them: generated_text and polished_text (both STRING) and history (the conversation, for chaining back into the node for multi-turn). generated_text wires straight into a CLIP Text Encode or a text-to-prompt path; polished_text is the Flux-ready expansion.

Install. It's part of the tiny ComfyUI_pandai pack, so install the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/pandaer119/ComfyUI_pandai
cd ComfyUI_pandai
pip install -r requirements.txt

Then restart ComfyUI. Or skip all that and use ComfyUI Manager - search "ComfyUI_pandai". No model downloads; the only real dependency for this node is openai>=1.0.0 (the rest of requirements.txt serves the pack's other node).

Where people get burned. First, the polish trap: polished_text is only actually polished when both enable_translation and enable_polish are set to enable. Turn polish on alone and it silently does nothing - the code gates it behind the translation flag. That's a genuine footgun in the source. Second, history is passed around as a raw dict with no validation; feed it anything other than this node's own history output and the call dies. Third, remember it's a live API call: every run costs a little and needs a working network, so it's great for prompt ideation and terrible for batch-loops that re-fire a thousand times.

It's a scrappy solo node - a couple of quirks, README is a stub, no stars to speak of - but if you already use DeepSeek, it's the quickest on-ramp to an LLM in your workflow. Just flip both enable toggles or don't expect polish.

CategoryPandai Nodes

Inputs (12)

NameTypeDefaultDescription
api_keySTRINGyour_api_key_here
modelCOMBO1 options: deepseek-chat
max_tokensINT40961–8192
temperatureFLOAT1.00–2
top_pFLOAT1.00–1
presence_penaltyFLOAT0.0-2–2
frequency_penaltyFLOAT0.0-2–2
system_promptSTRINGYou are a helpful assistant.
user_promptSTRING
enable_translationCOMBOdisable2 options: enable, disable
enable_polishCOMBOdisable2 options: enable, disable
historyoptDEEPSEEK_HISTORY

Outputs (3)

NameTypeDescription
generated_textSTRING
polished_textSTRING
historyDEEPSEEK_HISTORY