Nodes/comfyui_qwen_image_edit/Qwen-Image-Edit-2509 by OpenAI Image API
ComfyUI Node

Qwen-Image-Edit-2509 by OpenAI Image API

It Doesn't Run Qwen Image Edit. It Calls It.

By aslanxie·Created 9 months ago·Updated 9 months ago· 0
Qwen-Image-Edit-2509 by OpenAI Image API
  • image
  • IMAGE
promptA beautiful image
base_url
api_key
model
size
quality

The QWen-Image-Edit node - displayed as "Qwen-Image-Edit-2509 by OpenAI Image API" - looks like the thing that finally lets you run Alibaba's famous 20B instruction editor inside ComfyUI. It isn't. Read the class and you find a ~150-line API client: no weights, no GGUF download, no VRAM math. It takes a base_url and an api_key and phones whatever OpenAI-compatible images service you point it at. Leave the key empty and it just raises "API key is empty."

So is it for you?

Qwen-Image-Edit is the model that ate masks and ControlNets. You hand it a picture and a sentence - "change her dress to blue", "remove the watermark" - and the change happens, no mask, no inpainting crop-and-stitch. Normally in ComfyUI that means hauling around 20B of weights: bf16 is off the table for consumer cards, and the community Q4 GGUFs work but are heavy. This node is the zero-footprint alternative: it ships the job to an API serving Qwen-Image-Edit-2509 and pulls the result back as a normal IMAGE tensor. If you already pay for an endpoint - Alibaba's DashScope / Model Studio exposes Qwen through an OpenAI-compatible API, and plenty of hosting providers and internal proxies do the same - this is the tidy way to drop a 20B editor into a graph that otherwise runs on your own GPU.

The catch: if you don't have such an endpoint, you have nothing - no bundled key, no free tier, no model download. The author's own code comment mentions an "Intel internal endpoint," so it's clearly internal-facing. You're bringing the entire backend.

How it works

The mechanism is small. With no image wired in, it calls client.images.generate() with the prompt, size, and quality, then decodes the returned base64 into a ComfyUI IMAGE tensor. Wire an image into the image input and it flips to edit mode: it converts each batch frame to a PNG, POSTs multipart form data to {base_url}/v1/images/edits, and decodes data[0].b64_json back out. Either way you get one IMAGE out.

Two quirks to know before you build around it. First, IS_CHANGED returns random.random(), so the node never caches - every queue hit is a fresh API call. That was a deliberate fix commit, but it means you can burn credits just re-running an unchanged workflow. Second, the endpoint paths are hardcoded and the two modes disagree about /v1: generation uses the OpenAI client's normal base_url + /images/generations, while edit mode does base_url + /v1/images/edits itself. If your base_url already ends in /v1, one of the two modes will 404.

The inputs that matter

You only really set a handful:

  • base_url - the OpenAI-compatible endpoint. Leave empty only if the client's default is right.
  • api_key - your key for that endpoint; the node errors immediately if it's blank.
  • prompt - plain-language instructions, which is the model's whole thing. No mask, no negative prompt.
  • size - one of 1024x1024, 1536x1024, 1024x1536.
  • quality - low, medium, or high.
  • image (optional) - leave empty to generate from scratch, wire it in to edit. That single wire is the entire mode switch.

One honest gripe: model is a single-entry dropdown, Qwen-Image-Edit-2509, hardcoded. The 2511 revision that actually improved image drift and character consistency isn't selectable, so even if your endpoint serves 2511 you can't ask for it. You get 2509 or nothing.

Installing

Easiest route is ComfyUI Manager: search comfyui_qwen_image_edit and install. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aslanxie/comfyui_qwen_image_edit

Then restart ComfyUI. There's no requirements.txt in the repo, so Manager has nothing to auto-install - you need the openai package yourself (httpx, which it imports for proxy support, ships alongside):

pip install openai

That's the entire install. No model files, no heavy dependencies.

Troubleshooting

  • "API key is empty" - nothing pasted, or you genuinely have no backend. Can't be used without an endpoint.
  • Generation works but edits 404 (or vice versa) - the /v1 double-path issue above; adjust base_url.
  • It just hangs - edit-mode requests carry a 600-second timeout because API image editing is slow. Patience, not a bug.
  • Your key ends up in your PNGs - the api_key sits in the workflow JSON, and ComfyUI embeds that JSON into saved images. Swap in a dummy key before exporting a workflow you'll share.

The bottom line: a thin, working API shim with no surprises beyond the /v1 quirk and the pinned model. Got an endpoint? Five minutes of setup. Don't? Skip it and grab a local GGUF workflow instead - there's nothing here without a service behind it.

Categoryimage/OpenAI

Inputs (7)

NameTypeDefaultDescription
promptSTRINGA beautiful image
base_urlSTRING
api_keySTRING
modelCOMBO1 options: Qwen-Image-Edit-2509
sizeCOMBO3 options: 1024x1024, 1536x1024, 1024x1536
qualityCOMBO3 options: low, medium, high
imageoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE