API Image Edit (Enhanced)
Qwen-Image-Edit, without the 20B model in your case
- image1
- image2
- image3
- image4
- edited_image
- response_text
APIImageEditNode (listed as "API Image Edit (Enhanced)") is a remote-image-editing client wearing a ComfyUI costume. You hand it an image, a plain-language instruction, and an API key; it sends all three to a cloud image-editing provider - ModelScope's hosted Qwen-Image-Edit by default, but also OpenRouter, OpenAI, Google Gemini, PixelWords, or any OpenAI-compatible endpoint - and hands the edited image back into your graph. Nothing is generated on your machine. No weights, no sampler, no VRAM. For a 20B model like Qwen-Image-Edit, that is the entire pitch.
Qwen-Image-Edit is where the "describe the change in a sentence" era of editing lives: change her dress to blue, remove the watermark. It displaced masks and adapters for a whole class of work. But 20B at bf16 doesn't fit a consumer card, and while the community runs it locally via GGUF, that's still a real setup commitment. This node is the zero-install path: the same sentence-level editing, someone else's GPUs. It's also a decent way to A/B a handful of providers from one graph. Don't reach for it if you already run a local Qwen-Edit GGUF - local is cheaper at volume, and it keeps your images on your box. A key here goes to a third party, and your image leaves with it; that's the trade you're signing.
How it works
Under the hood it's an HTTP client, not a diffusion pipeline. The image tensor becomes a PIL image, gets base64-encoded, and is POSTed to the provider's endpoint: DashScope's multimodal-generation API for ModelScope, an OpenAI-compatible /chat/completions for OpenRouter/OpenAI/PixelWords/Custom, and generateContent for Gemini. The returned base64 image is decoded back into a tensor. One thing to know before you judge it by its output: Qwen-Edit re-emits the whole frame, so pixels you never asked about drift - that's a property of the model, not this node, and it's the same behavior you'd get running it locally.
The inputs that matter
api_provider+model- the model dropdown has 82 entries grouped under--- Provider ---separator rows. Pick a model inside the provider you selected; the backend validates this and refuses mismatches.api_key- paste the real thing. The frontend saves keys inlocalStorage, and there's a check that catches you pasting a masked●●●key.prompt- the multiline instruction. This does the actual editing.image1–image4- up to four input images. For Qwen-Edit that's the multi-image mode (person+product, person+scene compositing).generation_mode-single(default),multiple(batchimage_count, 1–16),chat(multi-turn, withreset_chatand a session kept inside the node), oredit_history.seed--1means random.backup_api_url- a custom base URL. Required for theCustomprovider, and useful for pointing any provider at a proxy.custom_model- the model name when you pickCustom.
The two outputs are edited_image (IMAGE - wire it to a Save/Preview) and response_text (STRING - a status log with the seed and the actual prompt sent, handy when things go sideways).
Installing it
Same as any node: ComfyUI Manager, search "ComfyUI API Image Edit", install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/aiaiaikkk/comfyui-api-image-edit
Then restart ComfyUI. There are no model downloads - that's the point of an API node. Dependencies are light: requests, Pillow, numpy, torch (already present in ComfyUI), plus google-genai for the Gemini path.
Where people get burned
- Black 512×512 image out - a missing key or a failed call. The node doesn't crash; it returns an error string in
response_text. Read that first. - Model mismatch - the dropdown mixes providers in one list. A model under the wrong provider returns an error, not a picture.
- Gemini single mode is the least-tested path - the source references a
stepsvariable the node never defines on that route. If it blows up, it's the node, not you; use the REST fallback or another provider. - ModelScope content-filtering - the source notes the API filters prompts and auto-retries 422s with simplified parameters. Keep instructions plain.
- The README is stale. It's written in Chinese and describes an older version with
mask,strength, andstepsinputs - the shipped "Enhanced" node doesn't have those. Trust the widgets you actually see, not the README.
One honest caveat: this pack is tiny and unknown - zero community presence, single author, single node file. Custom nodes are arbitrary Python running on your machine, so give the source a glance before pasting a paid key into it.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| api_provider | COMBO | ModelScope | 6 options: ModelScope, OpenRouter, OpenAI, Google Gemini, PixelWords, Custom |
| api_key | STRING | — | |
| model | COMBO | Qwen/Qwen-Image-Edit | 82 options: --- ModelScope ---, Qwen/Qwen-Image-Edit, MusePublic/Qwen-Image-Edit, Qwen/Qwen-Image, iic/Qwen-Image-Edit, qwen-image-edit, +76 |
| prompt | STRING | Generate or edit images based on the provided inputs | — |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| generation_modeopt | COMBO | single | 4 options: single, multiple, chat, edit_history |
| image_countopt | INT | 11–16 | — |
| seedopt | INT | -1-1–2147483647 | — |
| chat_historyopt | STRING | — | |
| edit_historyopt | STRING | — | |
| reset_chatopt | BOOLEAN | false | — |
| backup_api_urlopt | STRING | — | |
| custom_modelopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | — |
| response_text | STRING | — |