Nodes/ComfyUI Replicate Image Generation & Edit/Qwen Image Edit (Single Image)
ComfyUI Node

Qwen Image Edit (Single Image)

Qwen-Image-Edit in one node — no 24 GB card required

By charlyad142·Created 10 months ago·Updated 10 months ago· 0
Qwen Image Edit (Single Image)
  • image
  • image
  • output_url
prompt
api_token
seed-1
go_fasttrue
aspect_ratiomatch_input_image
output_formatwebp
output_quality95
disable_safety_checkerfalse

Qwen-Image-Edit is the open instruction editor that quietly ate a bunch of jobs that used to need a mask, a ControlNet and an IP-Adapter. You hand it a picture and a sentence - "make the person wear a red shirt", "change the background to a beach" - and the change happens. The catch is the weights: it's a 20B MMDiT, so running it locally means a GGUF stack and a serious card. This node skips all of that by renting the model on Replicate's servers. No VRAM, no quantized checkpoints, no 40 GB download. Just a token and a few cents per edit.

That's the honest trade here. Everything this node does, you can do locally if you have the hardware and the patience for the quantized setup. The node is a convenience tax - you're paying per edit for something that's otherwise free. For most people, that tax is worth it: it turns a laptop into a machine that does instruction editing at flagship quality.

How it works

The mechanism is simple and it's the same across every node in the pack. The image gets converted to a base64 PNG data URL, stuffed into the qwen/qwen-image-edit API call along with your prompt and settings, and Replicate runs the model in the cloud. When it's done, the node downloads the resulting URL and converts it back into a ComfyUI tensor. You never see any of it; the whole thing is one node on the canvas.

Your API token comes from one of two places: the api_token input on the node, or the REPLICATE_API_TOKEN environment variable. The node checks the input field first, then the env var. One note: the README mentions a config.ini option, but the code ignores it - don't go hunting for a config file that does nothing.

The inputs that matter

The three required inputs are what you'll touch every run:

  • image - the image you're editing. Any ComfyUI IMAGE tensor works: a Load Image, the output of another node, whatever.
  • prompt - a plain-language instruction. Be specific; this model rewards clear directions.
  • api_token - your Replicate token. Leave it blank if REPLICATE_API_TOKEN is set.

The optional stuff is mostly set-and-forget. seed is -1 (random) by default; set it to a number if you want a reproducible edit. go_fast defaults to true and runs a faster, slightly less careful pass - flip it off if a rerun comes back sloppier than you expect. aspect_ratio defaults to match_input_image, which is what you want for an edit. output_format (webp/jpg/png) and output_quality control the delivered file. disable_safety_checker is there if the checker is killing legit results; leave it false unless it bites you.

Outputs

Two outputs, and both matter: image - the edited result as a normal IMAGE tensor, ready to wire into a Save Image, a VAE decode chain, or downstream nodes - and output_url, a STRING with the direct URL of the result on Replicate. The URL is handy if you want the original file, not a re-encoded copy.

Installing it

This node ships in the comfyUI_charly_replicate_api pack alongside three siblings (Qwen Edit Plus, Seedream 4, SeedEdit 3). Easiest path is ComfyUI Manager: search for "ComfyUI Replicate Image Generation & Edit" and install. Manual, same result:

cd ComfyUI/custom_nodes
git clone https://github.com/charlyad142/comfyUI_charly_replicate_api

Restart ComfyUI after that. The only dependencies are the replicate Python client plus requests and Pillow, which requirements.txt installs for you and you mostly have already. There are no model downloads - that's the entire point of an API node. You do need a Replicate account and a token from replicate.com/account/api-tokens, and since this is a paid API, keep an eye on your usage.

Where people get burned

The pack's error handling has a trap you should know about: when anything fails, the node doesn't throw - it returns a solid red 512×512 image and shoves "Error: ..." into the output_url string. So if your preview suddenly goes red, check the URL output for the actual error message instead of staring at the tensor.

The usual failure is the token: empty api_token and no env var means the node raises before it even calls the API. Beyond that, know the model's limits. Qwen-Image-Edit re-emits the whole frame rather than patching it, so pixels you didn't ask to change can drift, and faces are the worst offender - the community regularly inpainting faces back in. That's a property of the model, not this node, but it's why you should judge results on a clean rerun with go_fast off before you blame the API.

CategoryReplicate/Qwen

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
promptSTRING
api_tokenSTRING
seedoptINT-1
go_fastoptBOOLEANtrue
aspect_ratiooptCOMBOmatch_input_image6 options: match_input_image, 1:1, 16:9, 9:16, 4:3, 3:4
output_formatoptCOMBOwebp3 options: webp, jpg, png
output_qualityoptINT950–100
disable_safety_checkeroptBOOLEANfalse

Outputs (2)

NameTypeDescription
imageIMAGE
output_urlSTRING