Nodes/ComfyUI-ModelScope/ModelScope LLM
ComfyUI Node

ModelScope LLM

A real LLM inside your workflow — Qwen3 chat in ComfyUI, no model download

By neverbiasu·Created 12 months ago·Updated 5 months ago· 3
ModelScope LLM
    • response
    model_idQwen/Qwen3-235B-A22B
    prompt
    system_prompt
    api_key
    request_timeout30

    ComfyUI is great at moving tensors around and terrible at understanding what you meant. ModelScope LLM fills that gap: give it a prompt, get a string back, and wire that string into anything else in your graph. It's a hosted text model, not a local one - nothing gets downloaded and no GPU is touched, because the whole pack is a client for Alibaba's ModelScope inference API. If you've ever wanted a Qwen3 chat model to write your prompts, caption your batches, or just argue with your workflow, this is the node.

    The honest framing: for serious text work you'd stay in a chat UI, and it's an API so your prompts leave the machine. But inside a workflow it unlocks things a chat box can't - feeding a model's output straight into prompt assembly, or automating caption pass-through. Think of it as a text node with a brain.

    How it works

    Under the hood it's one non-streaming POST to the OpenAI-compatible endpoint at https://api-inference.modelscope.cn/v1/chat/completions, with the familiar messages array - a system message plus your user prompt. Two things worth knowing: stream is hard-coded false, so the node blocks until the whole reply arrives, and enable_thinking is hard-coded false too, which means Qwen's reasoning models give you the answer but not the chain-of-thought. The response is pulled from choices[0].message.content, run through a sanitizer, and handed to you as a clean STRING ready for the ShowText node.

    The inputs that matter

    • prompt (required) - what you're asking. The only thing you must fill in.
    • model_id (required) - defaults to Qwen/Qwen3-235B-A22B. That's a 235-billion-parameter MoE model, which is enormous - and it's the reason the default timeout will bite you (below). You can drop in any chat model ID ModelScope serves; smaller Qwen3 sizes are a lot snappier.
    • system_prompt (optional) - primes the assistant's tone. There's a sensible default, so you can skip it.
    • request_timeout - default 30 seconds, up to 300. This is the one you'll actually touch.
    • api_key - leave empty if you've set MODELSCOPE_API_KEY or MODELSCOPE_ACCESS_TOKEN.

    The single output, response (STRING), plugs straight into ShowText|pysssss - that's literally the pack's own example workflow - or into any node that accepts a text input.

    Install

    ComfyUI Manager, search "ComfyUI-ModelScope", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/neverbiasu/ComfyUI-ModelScope.git
    

    Restart ComfyUI. There are no Python dependencies to install - requirements.txt is empty, and the node only uses requests, which ComfyUI already has. The only real requirement is an API key from modelscope.cn:

    export MODELSCOPE_API_KEY="your-key-here"
    

    You can also paste the key directly into the node's api_key field, which is handy for testing.

    Common issues

    • Timeout - the most common failure, and the node's error message says exactly what to do: bump request_timeout. The default 30s is tight even for a modest model, and borderline absurd for the default 235B MoE on a slow network. Set it to 120+ if you're using the default model.
    • "API key missing" - env var not set and the field empty. Set one or the other.
    • HTTP 401 / wrong model - the key is wrong, or the model_id isn't a chat model that's actually served for inference. Double-check the model's page on ModelScope.
    • Empty response - the node raises a clear error for this; usually the model's still loading on the cloud's side. Retry, or switch models.

    One more tip: because it's non-streaming, the whole generation has to finish before the node returns - so a slow model can feel frozen. That's not a crash, that's a 235B model thinking. Raise the timeout, grab a coffee, and it'll come back.

    CategoryModelScope

    Inputs (5)

    NameTypeDefaultDescription
    model_idSTRINGQwen/Qwen3-235B-A22BThe ModelScope model ID to use.
    promptSTRINGThe user prompt text to send to the model.
    system_promptoptSTRINGOptional system prompt to prime the assistant.
    api_keyoptSTRINGModelScope API key; if empty, read from MODELSCOPE_API_KEY env var.
    request_timeoutoptINT3010–300Request timeout in seconds. Increase for larger models or slow networks.

    Outputs (1)

    NameTypeDescription
    responseSTRINGModelScope text response.