Nodes/Comfyui Krs Nodes/Text Encode Qwen Image Edit Advanced Krs
ComfyUI Node

Text Encode Qwen Image Edit Advanced Krs

Get clarity AND prompt adherence from Qwen Edit — the two-pass trick, in one node

By KursatAs·Created 10 months ago·Updated 10 months ago· 0
Text Encode Qwen Image Edit Advanced Krs
  • clip
  • vae
  • image1
  • image2
  • image3
  • CONDITIONING
  • output_image1
  • output_image2
  • output_image3
  • latent
prompt
alignment32
vl_resolution384
upscale_methodbicubic
system_promptdefault
custom_system_prompt

Qwen Image Edit hands you an annoying dial: high vl_resolution gives better clarity and identity, but the model starts ignoring parts of your prompt. Low it, and adherence comes back while detail fades. The Advanced version of this pack's text encoder exists to let you have both, via a two-pass workflow the author spells out in the README - and unlike the Simple node, it hands you the latent and resized images you need to build it.

Same core, more plumbing

Under the hood it's the same idea as TextEncodeQwenImageEditKrsSimple: resize each input to vl_resolution for the Qwen2.5-VL encoder, resize toward 1024×1024 at your alignment, VAE-encode that as a reference latent, and attach it to the conditioning. The extra controls are:

  • upscale_method - lanczos, bicubic (default), area, nearest. Sharpness on the resizes that feed the model. Lanczos is the crisp one; you can usually leave bicubic.
  • system_prompt - default, minimal, or custom. The custom path even strips stray template tags if you paste in a full prompt by accident. Nice touch.
  • Three image outputs - output_image1/2/3, the VAE-resized version of each input (useful for multi-image edits on 2509+).
  • A latent output - the VAE latent of your first image (or an empty latent if nothing's connected). This is what unlocks the advanced workflow.

The two-pass workflow (why you'd use this node)

The trick: use two of these nodes. The author's recipe, condensed:

  1. First node at vl_resolution 512, system_prompt set to minimal - a fast, adherence-friendly pass that establishes the edit.
  2. Send its CONDITIONING into a KSampler.
  3. Feed that KSampler's output into the second node's latent input, same prompt (or a tightened one - the README's example is a wall of "keep the face and head pose exactly as-is"), same seed, and run your main KSampler.

Same seed for both samplers is the load-bearing detail. This gives you the clarity of a low-resolution first pass plus the adherence of telling the model exactly what must not change on the second. Cost: it runs the model twice, so more VRAM and more time. The latent output is what makes the second node's state continuous with the first.

Installation

cd ComfyUI/custom_nodes
git clone https://github.com/KursatAs/KrsNodes

Restart, or search "KrsNodes" in ComfyUI Manager. No extra dependencies - the pack ships nothing beyond ComfyUI's own libraries - but remember the model itself is 20B, so you're almost certainly running a GGUF quant. If a multi-GPU or 24GB+ setup isn't yours, budget for it.

Gotchas

  • The latent output is only a real latent when a VAE is connected and an image is present; otherwise it's an empty 4-channel tensor. Feed the image straight into the node, always.
  • Don't expect this to beat masked inpainting for pixel-exact work. Qwen re-emits the whole frame, and even with the reference latent the unedited pixels come back "close but not identical." The two-pass setup mitigates drift; it doesn't eliminate it.
  • Higher vl_resolution still costs prompt coherence here - the whole reason the two-pass workflow exists is that you can keep it at 512 in both passes and get the best of both.

This is the node in the pack you'd actually reach for once you've outgrown the Simple version - same fix, but with the extra outputs that let you build the workflow people post about getting right.

Categoryutils/conditioning

Inputs (11)

NameTypeDefaultDescription
clipCLIP
promptSTRING
alignmentCOMBO326 options: 8, 16, 24, 32, 56, 64
vl_resolutionINT384256–2048
upscale_methodCOMBObicubic4 options: lanczos, bicubic, area, nearest
system_promptCOMBOdefault3 options: default, minimal, custom
vaeoptVAE
image1optIMAGE
image2optIMAGE
image3optIMAGE
custom_system_promptoptSTRING

Outputs (5)

NameTypeDescription
CONDITIONINGCONDITIONING
output_image1IMAGE
output_image2IMAGE
output_image3IMAGE
latentLATENT