Nodes/ComfyUI_NYJY/BailianChat(NYJY)
ComfyUI Node

BailianChat(NYJY)

A whole frontier-grade LLM, parked in your ComfyUI graph

By aidenli·Created 2 years ago·Updated 4 months ago· 146
BailianChat(NYJY)
    • Answer
    modelqwen-plus
    prompt
    max_tokens1024
    api_key
    seed1234
    history

    ComfyUI is mostly about generating images, but the workflows people actually build keep needing a brain somewhere in the middle - rewrite this prompt, summarize these tags, decide which branch to take. You could run a local LLM for that, but that's another model to download and another chunk of VRAM you probably don't have spare. This node skips all of that: it calls Alibaba's Bailian (百炼 / DashScope) API from inside the graph, and the default model, qwen-plus, is a serious model - the same Qwen family that went on to power Qwen-Image and Wan. You're renting someone else's GPU instead of loading a 4-bit Llama into yours.

    It's a text-in, text-out node: you give it a prompt, it gives you an Answer STRING, and you wire that string into whatever needs it - a prompt for the sampler, a file saver, another LLM call, anything.

    How it works

    BailianChat makes an OpenAI-compatible chat completion request to https://dashscope.aliyuncs.com/compatible-mode/v1 (Alibaba's DashScope endpoint), which is the same API surface the model marketplace on bailian.console.aliyun.com uses. The node sends your prompt as the user message, passes your history in as prior messages if you gave one, and returns the model's text.

    Under the hood the pack hashes your inputs and caches the result, so re-running a workflow with the same prompt doesn't burn another API call. Nice touch if you're iterating on the rest of the graph.

    The inputs and outputs that matter

    • model - default qwen-plus. This is a free-text STRING, so you can type any model ID Bailian exposes (like qwen-max or deepseek-r1). If you want a picker instead of typing, wire the sibling BailianChatOption node into this field.
    • prompt - the thing you're asking, multiline.
    • api_key (optional) - leave blank and it reads bailian.api_key from the pack's config.json. Fill it in per-node if you'd rather not touch the config file.
    • max_tokens - cap on the reply, default 1024, up to 8192.
    • seed - fixed sampling seed (default 1234); helps get reproducible replies.
    • history (optional) - a JSON array of prior {role, content} messages if you want a multi-turn conversation across nodes.

    Output: a single Answer STRING.

    Getting a key

    Register on bailian.console.aliyun.com, create an API key, and either drop it in config.json under bailian.api_key or paste it into the node. Two gotchas straight from the author's docs:

    • Your Alibaba account needs real-name verification or the API quietly refuses to work.
    • A proxy/VPN can break the request. Bailian is a mainland-China service; the author explicitly warns that keeping a tunnel up causes failures. If you're getting errors, try with your proxy off.

    Installing

    Same pack install as every NYJY node: ComfyUI Manager → Install via Git URL → https://github.com/aidenli/ComfyUI_NYJY, restart, then make sure the pack's requirements.txt is satisfied (the openai dependency is the one this node needs). If Manager handled the install, you're done.

    Where people get burned

    The two failure modes are (1) no key / wrong key, and (2) proxy interference. Both show up as the node returning an error string instead of an answer - note that this node returns the raw error text through the Answer output rather than crashing, so check the preview text if you get silence. And remember every call costs you real money on the Bailian billing, tiny as it is per call - the caching at least saves you from paying for the same prompt twice.

    CategoryNYJY/llm

    Inputs (6)

    NameTypeDefaultDescription
    modelSTRINGqwen-plus
    promptSTRING
    max_tokensoptINT10241–8192
    api_keyoptSTRING
    seedoptINT12340–2147483647
    historyoptSTRING

    Outputs (1)

    NameTypeDescription
    AnswerSTRING