Nodes/KIE.ai Nodes Next/Qwen 2.1 - Text to Image
ComfyUI Node

Qwen 2.1 - Text to Image

The transparent-background trick is the reason to use it

By felipederosilva·Created about a month ago·Updated a day ago· 3
Qwen 2.1 - Text to Image
    • image
    • url
    • all_urls_json
    • task_id
    • raw_json
    • credits_consumed
    • credits_left
    ◄promptA corgi wearing a yellow rain hat sitting on stone steps after the rain, shallow depth of field►
    ◄aspect_ratio16:9►
    ◄resolution1K►
    ◄backgroundopaque►
    ◄output_formatpng►
    ◄enhance_prompttrue►
    ◄seed20260921►
    ◄nsfw_checkerfalse►
    ◄timeout_seconds1200►
    ◄callback_url►

    What it is

    KIE's hosted Qwen text-to-image endpoint, wrapped as one ComfyUI node. Prompt in, image out, no model files, no VRAM, per-call billing.

    The honest read on the model family: the Qwen-Image 20B base is respected locally but it's not what people reach for as a daily driver - it's heavy, and smaller models like Z-Image outrun it on consumer cards (see kg/entities/qwen-image.json). What Qwen's line is genuinely famous for is editing - Qwen-Image-Edit is the open instruction editor everyone built on. This node is the generation side of that family on someone else's GPU.

    The distinguishing feature here isn't quality, it's background: transparent. Getting a real alpha channel out of a hosted generator, on demand, is the thing I'd actually wire this into a workflow for: product cutouts, sprite work, anything you'd otherwise spend a segmentation pass on.

    How it works

    The node is built from KIE's request schema for the endpoint. Your prompt and settings go out as a task, the node polls until the job is done (default timeout_seconds of 1200, i.e. 20 minutes), then the returned image is downloaded and handed back as a native ComfyUI IMAGE. If a widget is left alone, its documented default is what gets sent.

    Because the node is generated from the live catalog, the widgets here are exactly the fields KIE documents - nothing invented, nothing hidden.

    Inputs and outputs

    Required:

    • prompt (STRING) - describes the image. Any language, up to 5000 characters; longer input returns a 422.

    The optional settings that matter:

    • background - opaque or transparent. Transparent gives you a real alpha channel and requires PNG or WebP; it can't be combined with JPEG. When you use it, describe only the subject. Prompts that mention a background, scene or surface tend to produce a non-transparent result.
    • resolution - 1K or 2K. 1K runs roughly 7–12 seconds, 2K roughly 30–55 seconds. Anything else (including 4K) is a 422.
    • aspect_ratio - nine options from 16:9 to 9:21. Watch this one: the widget ships defaulted to 16:9 while the underlying doc text says 1:1, so set it explicitly rather than trusting the default.
    • enhance_prompt - on by default. It rewrites your prompt into a fuller scene description first, which per the author "noticeably improves quality". Leave it on unless you're testing prompt phrasing.
    • seed - same seed plus same prompt and settings reproduces an image within the same service version.
    • nsfw_checker - defaults to false, and the tooltip explains the semantics: off means KIE's content filtering is disabled and results come back from the model as-is. Be honest with yourself about what that does and doesn't guarantee.
    • output_format (png / webp / jpeg), timeout_seconds, callback_url.

    Outputs: image (the picture, wire it to a preview or a Qwen image-to-image node for a second pass), url, all_urls_json, task_id, raw_json, credits_consumed, credits_left.

    Install

    Manager: search KIE-Nodes-Next, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
    

    The pack's requirements.txt is small - requests, Pillow, numpy, PyYAML - so installation is quick. Windows users can use the one-click .vbs installer from dist/.

    Then save your key: Settings → KIE.ai Nodes Next → Connection → Paste / replace KIE.ai API key. It's validated before it's stored, and you get a masked fingerprint and a ✅ CONNECTED status with your credit balance. KIE_API_KEY as an environment variable still works and takes priority, which is what you want on a headless box.

    Where people get burned

    Two defaults disagree, so decide for yourself. That 16:9-versus-1:1 aspect ratio mismatch is the kind of thing that produces "why is my square prompt coming out wide" posts. Pick the ratio you want.

    Transparency is a naming thing, not a slider. If your prompt says "on a marble countertop", you asked for a background and you'll get one. Describe the object; let the alpha do the rest.

    Filtering off is not the same as unfiltered. The tooltip is candid: filtering can't be guaranteed to catch everything, and results are returned as-is. That cuts both ways.

    Credits are reported, not capped. There's no budget guard in the node. If you're looping prompts, watch credits_left - or wire it to a text node and log a run.

    CategoryKIE Next/Image/Qwen

    Inputs (10)

    NameTypeDefaultDescription
    promptSTRINGA corgi wearing a yellow rain hat sitting on stone steps after the rain, shallow depth of fieldThe prompt that describes the image content, style and composition you want to generate. Required. Any language is supported, up to 5000 characters; longer input returns 422.
    aspect_ratiooptCOMBO16:9The output aspect ratio. Default `1:1`. The actual pixel size also depends on `resolution` — see the aspect ratio table above for the exact dimensions of each combination.
    resolutionoptCOMBO1KThe output resolution tier. `1K` is the faster option at roughly 7-12 seconds; `2K` produces four times the pixels and takes roughly 30-55 seconds. Only `1K` and `2K` are accepted — any other value, including `4K`, returns 422.
    backgroundoptCOMBOopaqueBackground type. transparent outputs a PNG or WebP with a real alpha channel and cannot be used with JPEG. When using transparent, describe only the subject — prompts that mention a background, scene, surface, etc. may produce a non-transparent result.
    output_formatoptCOMBOpngThe output image format. `png` (default) and `webp` both carry an alpha channel and can be used with `background: transparent`. `jpeg` has no alpha channel and cannot be combined with a transparent background.
    enhance_promptoptBOOLEANtrueRewrites the prompt into a fuller scene description before generating, which noticeably improves quality. Enabled by default (also when the parameter is omitted); pass false to turn it off.
    seedoptINT20260921-2147483648–2147483647The random seed. Omit it to generate with a random seed; the seed actually used is returned with the result. Passing the same seed together with the same prompt and parameters reproduces the same image within the same service version.
    nsfw_checkeroptBOOLEANfalseDefaults to false. You can set it to false based on your needs. If set to false, our content filtering will be disabled, and all results will be returned directly by the model itself. Note: There is no guarantee that everything can be filtered out; if you are not satisfied with the results, you will need to make your own arrangements.
    timeout_secondsoptINT120030–7200—
    callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

    Outputs (7)

    NameTypeDescription
    imageIMAGE—
    urlSTRING—
    all_urls_jsonSTRING—
    task_idSTRING—
    raw_jsonSTRING—
    credits_consumedFLOAT—
    credits_leftFLOAT—