Nodes/ComfyUI-QING/Qwen语言丨API
ComfyUI Node

Qwen语言丨API

Chat with Qwen inside your workflow — without running a single local parameter

By sheengoa·Created about a year ago·Updated 19 days ago· 16
Qwen语言丨API
    • generated_text
    • conversation_info
    • total_tokens
    text_input请帮我分析一下这个问题,并提供详细的解决方案。
    platform阿里云百炼
    modelqwen-turbo
    max_tokens4096
    history20
    temperature0.3
    top_p0.85
    repetition_penalty1.10
    clear_historyfalse

    You want an LLM's judgment inside a ComfyUI graph - a prompt rewritten, a caption generated, a decision made - but you don't want to download a 30GB model or babysit VRAM. QwenLanguageAPI is the QING pack's hosted answer: it calls Qwen's language models through an OpenAI-compatible API and drops the text back into your workflow. No local GPU involved, just a key and a network connection. It's the LLM-as-node pattern from the KB's llm-in-comfyui doc, wired for Alibaba's Qwen family.

    How it works

    The node talks to Qwen through two providers, both OpenAI-compatible (the pack uses the openai client):

    • 阿里云百炼 (DashScope) - base URL dashscope.aliyuncs.com/compatible-mode/v1, key env DASHSCOPE_API_KEY.
    • 硅基流动 (SiliconFlow) - base URL api.siliconflow.cn/v1, key env SILICONFLOW_API_KEY.

    Inputs: text_input (your prompt), platform, model (a dropdown with qwen3-max, qwen-plus, qwen-turbo, qwq-plus, and several sized variants), max_tokens (default 4096), and history (default 20 - how many conversation turns to keep in memory). Optionals: temperature (0.3), top_p (0.85), repetition_penalty (1.1), and clear_history (dump the cached conversation).

    Outputs: generated_text, conversation_info (a summary of the dialogue state), and total_tokens (so you can watch your spend).

    Two behaviors worth knowing: the conversation is cached per platform+model, so successive runs actually hold a multi-turn chat - until you set clear_history. And the model names are mapped to real API IDs under the hood (qwq-plusqwq-32b-preview, for example), plus qwq reasoning models automatically get their temperature capped at 0.5 because they hate heat.

    Where you'd reach for it

    Prompt enhancement and rewriting are the flagship uses: rough idea in, structured model-appropriate prompt out, fed straight to your CLIP Text Encode. Captioning rough drafts, summarization, and any "ask a model a question and branch on the answer" logic all work - pair the output with QING_ModelFallback so a rate-limit failure hands the graph a backup model instead of a dead batch.

    Installing and configuring

    cd ComfyUI/custom_nodes
    git clone https://github.com/GAO-SHIQING/ComfyUI-QING
    cd ComfyUI-QING
    python install_dependencies.py
    

    Restart ComfyUI after. The install script pulls the openai client, which this node needs. Then the key: Settings → QING → API configuration (the pack's config panel), or set the env vars above. Keys are stored locally and auto-injected at runtime - they never sit in your workflow JSON. Grab a DashScope key at bailian.console.aliyun.com or a SiliconFlow key at cloud.siliconflow.cn. (README's GAOSHI-QING clone-URL typo - the repo is GAO-SHIQING/ComfyUI-QING.)

    Things to know

    It's a network call - needs internet, needs the key, and SiliconFlow caps max_tokens at 4096 while DashScope supports more, so the same workflow behaves differently per platform. Watch total_tokens if you're worried about cost; a long history multiplies the tokens on every call. And the usual LLM-in-a-pipeline caveat applies: the output is freeform text, so if you're parsing it programmatically (JSON out, decision values), a chat model's rambling will bite you - scope the request narrowly and validate the result downstream.

    CategoryQING/API

    Inputs (9)

    NameTypeDefaultDescription
    text_inputSTRING请帮我分析一下这个问题,并提供详细的解决方案。输入要发送给Qwen模型的文本内容,Qwen擅长逻辑推理、数学计算、代码生成和多语言处理
    platformCOMBO阿里云百炼选择API服务提供商
    modelCOMBOqwen-turbo选择要使用的Qwen模型 📋 模型特点: 🔸 qwen3-max:最新旗舰版本,超强推理能力,适合复杂任务 🔸 qwen-plus:高性能版本,平衡效果与速度 🔸 qwen-turbo:快速响应版本,适合简单对话 🔸 qwq-plus:专业推理版本,擅长逻辑分析和数学问题 🔸 qwen3-235b:超大参数模型,顶级性能 💡 Qwen模型在中文理解、代码生成、数学推理方面表现优异
    max_tokensINT40961–32768模型生成文本时最多能使用的token数量。注意:硅基流动平台限制最大4096,阿里云百炼支持更高值
    historyINT201–40保持的历史对话轮数
    temperatureoptFLOAT0.30–2控制生成文本的随机性
    top_poptFLOAT0.850–1控制生成文本的多样性
    repetition_penaltyoptFLOAT1.101–1.3控制重复文本的惩罚程度
    clear_historyoptBOOLEANfalse是否清除历史对话记录

    Outputs (3)

    NameTypeDescription
    generated_textSTRING
    conversation_infoSTRING
    total_tokensINT