Nodes/ComfyUI-EditUtils/EditUtils: Qwen Edit Text Encode lrzjason
ComfyUI Node

EditUtils: Qwen Edit Text Encode lrzjason

The one-node Qwen edit encode — three images, one wire in, sampler-ready out

By lrzjason·Created 7 months ago·Updated 16 days ago· 207
EditUtils: Qwen Edit Text Encode lrzjason
  • clip
  • vae
  • image1
  • image2
  • image3
  • mask
  • conditioning
  • latent
  • custom_output
  • main_image
  • mask
prompt
ref_longest_edge1024

If you've just installed ComfyUI-EditUtils to do Qwen-Image-Edit and want the least configuration possible, this is the node you reach for. QwenEditTextEncode_EditUtils is the "simple workflow" encoder: one node takes a clip, a vae, a prompt, up to three image inputs, and one ref_longest_edge knob, and does the whole encode dance internally - reference latents, Qwen2.5-VL vision stream, padding, the works. Out come conditioning, latent, custom_output, main_image, and mask.

Mechanically, it's a thin wrapper over the pack's EditTextEncode_EditUtils. It builds a fixed Qwen config (the same {"model_name": "qwen", "vae_unit": 8, "llama_template": <default prompt>} that QwenModelConfig_EditUtils produces) and a configs list where image1 is the main image, all images go to both the reference latent and the VL stream, crop is pad, upscale is lanczos, VL target is 384. Then it calls the real encoder. So you get the full pipeline with one node instead of a ModelConfig + three ConfigPreparers.

What the wires are for:

  • conditioning (CONDITIONING) → the sampler's positive input. Carries the reference latents inside, so sampling "sees" your source image.
  • latent (LATENT) → the main image's reference latent, i.e. your starting point. Wire it into the sampler's latent input and you're doing proper image-edit (the model regenerates from this latent rather than from noise).
  • custom_output (ANY) → the same kitchen-sink dict; pipe it into QwenEditOutputExtractor_EditUtils when you want the individual pieces (like no_refs_cond for the negative, or full_prompt for debugging).
  • main_image, mask → the processed main image and mask, for previews or down-stream compositing.

The hidden default that matters: mask only applies to image1. If you're masking an edit region, it has to be the main/first image, which is the standard "mask the source" workflow anyway.

The real-world catch is the model, not the node. Qwen-Image-Edit is a 20B model - on a consumer card you're running a GGUF quant or fp8, and the VL stream plus VAE on top of that adds VRAM. The KB's summary of the model's known limitation applies here too: it re-emits the whole frame, so pixels you didn't ask about can drift, and faces degrade across chains of edits. The pack's own answer to that is pairing it with a consistency LoRA (the author publishes one, and it's a recurring recommendation in the README). Keep ref_longest_edge reasonable (1024 is the default and a sane starting point) and don't fight the model's drift with prompts - fix it with a mask or a consistency LoRA.

Install

Part of lrzjason/ComfyUI-EditUtils. ComfyUI Manager → "ComfyUI-EditUtils", or cd ComfyUI/custom_nodes && git clone https://github.com/lrzjason/ComfyUI-EditUtils, then restart. No pip deps. You still need the Qwen weights themselves (UNET, CLIP/text-encoder, VAE - quantized GGUF is the realistic path on most cards).

Troubleshooting

The node hard-errors if no image is connected ("At least one image must be provided") - this is not a text-only encoder, unlike its parent. If your edit ignores the source or comes out looking like plain generation, check that latent is actually wired into the sampler; many a "Qwen edit did nothing" complaint is really a missing latent wire. And if the output has black bars or the composition shifts, revisit ref_longest_edge - padded references at mismatched resolutions are the usual culprit.

Categoryadvanced/conditioning

Inputs (8)

NameTypeDefaultDescription
clipCLIP
vaeVAE
promptSTRING
image1optIMAGE
image2optIMAGE
image3optIMAGE
ref_longest_edgeoptINT10248–4096Longest edge of the output latent
maskoptMASK

Outputs (5)

NameTypeDescription
conditioningCONDITIONING
latentLATENT
custom_outputANY
main_imageIMAGE
maskMASK