Nodes/Comfyui-PixNodes/DeepSeek API Assistant (PixNodes)
ComfyUI Node

DeepSeek API Assistant (PixNodes)

A real LLM in your graph, cheap

By pixixai·Created 8 months ago·Updated 6 months ago· 24
DeepSeek API Assistant (PixNodes)
    • text_response
    • history
    api_key
    base_urlhttps://api.deepseek.com
    modeldeepseek-chat
    prompt
    system_instructionYou are a helpful assistant.
    seed0
    max_tokensauto
    temperatureauto
    top_pauto
    history
    input_file_text

    An LLM inside your ComfyUI graph is the difference between "I have to write this prompt myself" and "I describe the image and a model writes the prompt for me." Pix_DeepSeekApiNode is the PixNodes way to bolt one on: it calls the DeepSeek API - the Chinese model that became famous for near-frontier quality at remarkably low prices - and hands you the text back as a STRING ready to feed your encoder. It's the LLM node of this pack that English-speaking users are most likely to recognize, because DeepSeek's API is cheap enough that it's a credible default.

    Inputs worth knowing: api_key (persisted to api_key.json after the first run - leave blank after that), base_url (default https://api.deepseek.com, and the fact it's editable means you can point it at compatible proxies), model (deepseek-chat for general work, deepseek-reasoner for the thinking variant), prompt, system_instruction, seed (for reproducible outputs), and the three "auto" fields - max_tokens, temperature, and optional top_p. The "auto" convention is a nice touch: leave them as auto and the model picks sensible defaults; type a number and it's used. Optional inputs include history (feed back the history output for multi-turn) and input_file_text (long external text appended as context - how you analyze a whole document without pasting it into the prompt widget).

    Outputs: text_response (the answer) and history (the full message list as JSON). The loop-back pattern - history out → history in - is how you get multi-turn conversation through the node; the pack's own docs show it as a first-class feature.

    A couple of implementation facts shape the failure modes. The node uses the official openai Python client against DeepSeek's OpenAI-compatible endpoint, and it deliberately doesn't send temperature/top_p for deepseek-reasoner - reasoning models reject or ignore those params, so the node silently skips them. If you set a temperature and the reasoning model ignores it, that's correct behavior, not a bug. It also hashes its inputs (IS_CHANGED) so the node always re-runs when anything changes - which is what you want for an LLM call, but it means every queue pass costs a request, so don't leave it in a workflow you batch 500 times.

    Errors come back as strings prefixed Error: rather than exceptions - "Error: API Key invalid." on auth failure is a literal output, not a crash, so check the text you get back when things look wrong.

    Install is the standard PixNodes path - ComfyUI Manager, search PixNodes, restart - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pixixai/Comfyui-PixNodes
    cd Comfyui-PixNodes
    pip install -r requirements.txt
    

    then restart. This is the node the openai dependency in requirements.txt is for, so if installs are broken, that's the first thing to check.

    Security hygiene, briefly: this is an API node carrying a credential - the exact shape the KB's LLM essay warns about (the ComfyUI_LLMVISION incident is the cautionary tale). It writes your key to a JSON file in the user dir and sends your prompts to a cloud API. That's the deal with any API assistant; just don't install random forks, and know your prompts leave your machine.

    CategoryPixNodes/LLM

    Inputs (11)

    NameTypeDefaultDescription
    api_keySTRING
    base_urlSTRINGhttps://api.deepseek.com
    modelCOMBOdeepseek-chat2 options: deepseek-chat, deepseek-reasoner
    promptSTRING
    system_instructionSTRINGYou are a helpful assistant.
    seedINT00–18446744073709550000
    max_tokensSTRINGauto
    temperatureSTRINGauto
    top_poptSTRINGauto
    historyoptSTRING
    input_file_textoptSTRING

    Outputs (2)

    NameTypeDescription
    text_responseSTRING
    historySTRING