Nodes/XB_ToolBox/XB-BOX - 📝 Qwen图像编辑编码
ComfyUI Node

XB-BOX - 📝 Qwen图像编辑编码

Tell a picture what to change, no mask required

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-BOX - 📝 Qwen图像编辑编码
  • clip
  • vae
  • image1
  • 条件
prompt

Qwen-Image-Edit changed the workflow math for a whole class of image work: you hand it a picture and a sentence - "remove the person in the background," "make it night," "swap the shirt to red" - and the edit happens, no mask, no ControlNet, no inpaint dance. The KB's panel on it is blunt: "You hand it a picture and a sentence, and the change happens." XB_TextEncodeQwenImageEdit is how you use that model inside XB_ToolBox: it turns your image plus your instruction into the conditioning the Qwen-Image-Edit diffusion model samples from.

It's a port of ComfyUI's official TextEncodeQwenImageEdit into the pack's node style, and the real difference is the socket design: image inputs are dynamic, growing up to 9 reference images instead of a fixed count. The mechanism mirrors the official node - the prompt is wrapped in the Qwen editing system template ("Describe the key features of the input image... then explain how the user's text instruction should alter or modify the image"), the images are tokenized as vision-language input, and if you supply a VAE, the references are also VAE-encoded and attached to the conditioning as reference_latents.

Inputs

  • clip - a CLIP loaded from a Qwen-Image-Edit text encoder. This is the pairing that matters: the pack's CLIPLoaderINT8ROCm / Qwen loaders, or the stock Qwen-Image-Edit CLIP loader, must be the model that matches the base. Get this wrong and the conditioning won't line up with the model.
  • prompt - your editing instruction, in plain language. Multiline enabled.
  • vae (optional) - provide it and the reference image gets encoded into latent form inside the conditioning. That's what gives Qwen-Edit its "maintain consistency with the original" behavior.
  • image1 (optional) - your input picture; more slots appear dynamically up to 9.

Output is 条件 (conditioning) - wire it into the positive (and for img2img-style flows, the same or a variant into negative) of a sampler driving a Qwen-Image-Edit UNet.

The honest caveats

Quality of edit tracks quality of instruction. The model "re-emits the whole frame," so pixels you didn't ask about can drift - the KB flags this as the structural limit, and power users bolt a mask back on around it for surgical changes. Also, this node is only half the story: you still need the Qwen-Image-Edit CLIP loader and the matching base model/checkpoint on the other side. If you see garbage or "the prompt did nothing," check the encoder/base pairing before blaming the node.

Install: Manager → XB_ToolBox, or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart. Under "XB_ToolBox/Qwen". The node itself needs no extra pip deps, but the Qwen-Image-Edit model files do - download the CLIP and base model per QwenLM's repo, into ComfyUI's text_encoders and diffusion_models folders respectively.

CategoryXB_ToolBox/Qwen

Inputs (4)

NameTypeDefaultDescription
clipCLIP
promptSTRING
vaeoptVAE
image1optIMAGE

Outputs (1)

NameTypeDescription
条件CONDITIONING