ComfyUI Node

FLUX API

The DashScope API node with no model download

By modelscope·Created 2 years ago·Updated 2 years ago· 4
FLUX API
    • IMAGE
    modelflux-schnell
    api_key
    prompt
    size1024*1024
    seed0
    steps30

    The name is half a lie: this node never runs FLUX. It rents it. DashScopeFLUXAPI (display name "FLUX API") is a cloud node from ModelScope, Alibaba's model hub, and it hands your prompt to Alibaba Cloud's DashScope platform, where FLUX.1 runs on their servers and you get a finished image back. No model download, no VRAM, no T5-XXL, no quantization dance. Paste an API key, type a prompt, save.

    So when do you reach for it? Honestly: when you can't run FLUX locally. The full FLUX.1 stack is 12B parameters, and running it on consumer hardware means juggling fp8, NF4, or GGUF quant files and praying about VRAM. If your machine is a potato - or you're already inside Alibaba Cloud's ecosystem with credentials burning a hole in your pocket - this gets you FLUX.1 output for the price of an API call. The counterpoint, and it's a real one: by 2026 FLUX.1 has been superseded as the quality bar, with Qwen-Image, Z-Image, and Klein all beating it locally. If you own any half-decent GPU, run those instead. This node is for the no-GPU laptop, the capped colab, or the APAC user who already pays for DashScope. A niche, but a legitimate one.

    How it works

    Under the hood the node calls dashscope.ImageSynthesis.call(model=..., prompt=..., size=..., seed=..., steps=...). The API runs the model server-side, returns a URL to the result, and the node downloads that PNG and converts it to a float tensor in [0,1] range - a standard ComfyUI IMAGE. The nice part: it's a finished image, not latents, so you wire the IMAGE output straight into a SaveImage or PreviewImage. No checkpoint loader, no VAE decode, no KSampler - the whole "loading a model" side of ComfyUI simply doesn't exist here, because the model never touches your disk. The provided example workflow is exactly that: node → SaveImage.

    The inputs that matter

    Six widgets, and only a few you'll touch:

    • api_key - the whole ballgame. You get one from Alibaba Cloud's DashScope (Model Studio) console, and it's the difference between working and a wall of "Invalid Api-Key" errors (more below).
    • model - flux-schnell (default), flux-dev, or flux-merged, a third hosted variant DashScope lists alongside the two FLUX tiers. Schnell is the cheap fast one; dev is the quality tier.
    • prompt - plain natural language, which suits FLUX. Write full sentences, not a soup of tags.
    • size - six fixed presets, default 1024*1024, the resolution FLUX is most comfortable at.
    • steps - 1–50, default 30. That's fine for dev; if you're on schnell, remember it's a step-distilled 1–4 step model and pull this down a lot if output looks over-processed.
    • seed - leave it alone until you want reproducibility; it's remapped before sending.

    Notice what's not there: no negative prompt, no guidance slider. That's not an oversight - FLUX.1 dev and schnell are guidance-distilled, so they have no native negative prompt or CFG anyway.

    Installing it

    ComfyUI Manager: search "ComfyScope" (or the pack title "Dashscope FLUX API for ComfyUI") and install, then restart. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/modelscope/comfyscope
    # then restart ComfyUI
    

    The only new dependency is dashscope - requirements.txt is a one-liner, and ComfyUI already ships the torch/numpy/PIL/requests the node also imports. Manager usually handles the pip install; if not, pip install dashscope in ComfyUI's Python environment. Zero model downloads, because the model never comes to you.

    Where people get burned

    The classic DashScope wall is "Invalid Api-Key provided" even with a valid key. The usual cause: DashScope splits China-Mainland and international consoles, and a key from the wrong side doesn't authenticate against the SDK's default (China) endpoint. If you're outside mainland China, grab the international key and you may need to point the SDK at https://dashscope-intl.aliyuncs.com/api/v1 before the node will accept it.

    Second trap: the API key is a plain widget, which means it gets saved in your workflow JSON in plaintext. Never share a workflow containing this node without scrubbing the key first, and don't paste one into a bug report. It's a real leak vector people forget about.

    Third: when the API call fails, the node doesn't raise - it prints the error to your ComfyUI console and returns nothing, so you get an empty output and a confusing "missing IMAGE" error downstream. Check the console log, not the canvas.

    And the meta-gotcha: this is metered cloud generation. Your prompt leaves your machine for Alibaba's servers, each image costs a few cents of usage, and you're hostage to their queue and your connection. Great for a zero-GPU setup; a poor default when a local model is the better tool.

    CategoryDashScope

    Inputs (6)

    NameTypeDefaultDescription
    modelCOMBOflux-schnell3 options: flux-schnell, flux-dev, flux-merged
    api_keySTRING
    promptSTRING
    sizeCOMBO1024*10246 options: 512*1024, 768*512, 768*1024, 1024*576, 576*1024, 1024*1024
    seedINT00–18446744073709550000
    stepsINT301–50

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE