Nodes/ComfyUI_QWEN3VL_API/QWEN3 文本生成
ComfyUI Node

QWEN3 文本生成

A multi-turn Qwen3 chat that lives on your ComfyUI canvas

By flywhale-666·Created 10 months ago·Updated 9 months ago· 6
QWEN3 文本生成
    • response
    • conversation_history
    model
    user_prompt你好,请介绍一下你自己
    system_promptYou are a helpful assistant.
    temperature0.7
    top_p0.80
    seed0
    conversation_history
    api_key

    This is the text half of the ComfyUI_QWEN3VL_API pack: a node that puts a Qwen3 chat session directly in your graph, complete with conversation memory. No local model, no transformers upgrade, no VRAM - it calls Alibaba's DashScope API under the hood and hands you the reply as a plain string you can pipe anywhere.

    Why would you want an LLM sitting in a ComfyUI graph at all? Because the LLM-in-the-graph pattern is one of the most useful things this ecosystem has settled on: you use it to turn a rough idea into a structured prompt, to rewrite and reformat text between stages, or to generate dialogue that then feeds a text-to-video pipeline. It's a tool that operates on text upstream of the sampler - it never touches your images directly. The tradeoff here is that it's a cloud call, so it costs a little per message and, unlike a local abliterated 8B, it's not something you use for the uncensored stuff.

    How it works

    The node builds an OpenAI-compatible chat request and sends it to DashScope's compatible endpoint (https://dashscope.aliyuncs.com/compatible-mode/v1). That's why the only dependency is the openai library - DashScope speaks the same protocol, so the pack never needed a custom SDK.

    The clever bit is conversation_history. It's a JSON string, and the node's two outputs are designed to be wired back into itself: response is the assistant's answer, and conversation_history is that answer appended to everything you've said so far. Loop the second output back into the node's own input and you get genuine multi-turn conversation. Skip the loop and you get a stateless one-shot, which is honestly what most workflows want.

    Inputs worth knowing: model (qwen3-max for the heavy lifting, qwen-plus for general use, qwen-flash when you want speed), system_prompt to set the role, temperature and top_p for creativity, and seed for reproducible output. All the usual suspects, all in one node.

    A caching trap to know about

    The node's IS_CHANGED returns the seed - ComfyUI uses that to decide whether to cache the result. What that means in practice: if you edit user_prompt but leave seed the same, ComfyUI may hand you the previous cached reply instead of calling the API again. Bump the seed (or any other parameter) when you want a fresh call. It's a small thing, but it confuses people for the first hour.

    How to install it

    Same story as every node in this pack - no weights to download, just the client:

    cd ComfyUI/custom_nodes
    git clone https://github.com/flywhale-666/ComfyUI_QWEN3VL_API
    cd ComfyUI_QWEN3VL_API
    pip install -r requirements.txt
    

    Restart ComfyUI, and you'll also need a DashScope API key (see the QWEN_APIKey node in this pack - that's the clean way to supply it). You can also just search "ComfyUI_QWEN3VL_API" in ComfyUI Manager.

    Troubleshooting

    • "API 调用失败" / an exception in the node - nine times out of ten it's the key. Check the api_key.ini file or the key node before anything else.
    • Cached/stale replies - you hit the IS_CHANGED trap above. Change the seed.
    • Conversation goes weird after several turns - the history is just a JSON string, and if you've got another node mangling it, the parser will silently ignore malformed history and start fresh. If the multi-turn context suddenly forgets itself, suspect the JSON, not the model.
    • It's an API, so it filters - DashScope applies its own content policy server-side. If your prompt needs no filtering, a local model is the honest answer; this node is for when you want Qwen3 quality without running it.

    One more honest note: this is a small, fresh pack with no real community track record yet, so read the source if you plan to depend on it. The text-formatting and key plumbing are all plain to follow.

    Category🤖QWEN3VL_API

    Inputs (8)

    NameTypeDefaultDescription
    modelCOMBO3 options: qwen3-max, qwen-plus, qwen-flash
    user_promptSTRING你好,请介绍一下你自己
    system_promptSTRINGYou are a helpful assistant.
    temperatureFLOAT0.70–2
    top_pFLOAT0.800–1
    seedINT00–18446744073709550000
    conversation_historyoptSTRING
    api_keyoptSTRING

    Outputs (2)

    NameTypeDescription
    responseSTRING
    conversation_historySTRING