Nodes/ComfyUI_StarNodes/⭐ Star Qwen Edit Encoder
ComfyUI Node

⭐ Star Qwen Edit Encoder

The encoder that gets Qwen-Edit conditioning actually right

By Starnodes2024·Created 2 years ago·Updated 3 days ago· 102
⭐ Star Qwen Edit Encoder
  • clip
  • vae
  • image
  • reference_latent
  • CONDITIONING
prompt
resize_modelanczos
skip_upscale_if_matchtrue
ar_skip_epsilon0.0020
cache_tokensfalse
cache_bust
debug_timingfalse

Qwen-Image-Edit works in a way that punishes sloppy conditioning. The reference image gets encoded to a latent, the prompt gets encoded to conditioning, and if those two don't line up in size and aspect, the sampler doesn't explode - it just quietly produces a worse edit. A generic CLIPTextEncode node doesn't know or care about any of this. StarQwenEditEncoder does, which is why it exists.

It's a conditioning node built specifically for the Qwen-Edit workflow: prompt in, reference in, CONDITIONING out, with the resolution bookkeeping handled internally.

What it does

  • Encodes your prompt with the Qwen text encoder - feed it the clip from your Qwen text encoder loader and your multiline prompt.
  • Handles the reference image. Give it a vae plus an image, and it encodes the reference to a latent - but first it resizes the image to the target resolution so the conditioning and the latent match. resize_mode picks the upscaling algorithm (lanczos or bicubic) used when the reference is smaller than the target.
  • Or takes a ready latent. Prefer encoding the reference yourself? reference_latent accepts an already-encoded latent and skips the image path entirely. This is the input you want if you're reusing the same reference latent across runs.

The rest of the inputs are fine-tuning for the resize behavior: skip_upscale_if_match (default on) skips resizing when the image already matches, ar_skip_epsilon controls how close counts as "matching" (0.002 by default - it's a tolerance, not a slider you need to touch), and cache_tokens plus cache_bust let you cache the encoded tokens so you don't re-encode the same prompt every queue. debug_timing prints timing info when you're trying to figure out where a slow graph is stuck.

What it's for, honestly

If you're building the Qwen-Edit graph from scratch - checkpoint + VAE + Qwen text encoder, reference image, prompt, KSampler - this node replaces the two-node song-and-dance of "VAE-encode the image, CLIP-encode the text" with one box that keeps the sizes consistent. That consistency is the whole game: Qwen-Image-Edit is the community's default open instruction editor (Apache 2.0, the model everyone standardized on after the Kontext license mess), and its main practical foot-gun is feeding it mismatched conditioning.

Wire the CONDITIONING output into your sampler's positive input, alongside the reference_latent from your input-prep nodes. The standard Qwen-Edit graph on Comfy's own docs follows exactly this shape.

Install & gotchas

The pack: ComfyUI_StarBetaNodes is the retired beta repo; install ComfyUI_StarNodes via Manager (search Starnodes) or git clone https://github.com/Starnodes2024/ComfyUI_StarNodes into custom_nodes. Then make sure you actually have the Qwen text encoder CLIP loaded - this node takes a clip in, and it will happily sit there erroring if you wired it nothing. And yes, the model is 20B: run a GGUF quant if your VRAM complains. The node fixes your conditioning, not your memory budget.

Category⭐StarNodes/Conditioning

Inputs (11)

NameTypeDefaultDescription
clipCLIP
promptSTRING
vaeoptVAE
imageoptIMAGE
reference_latentoptLATENT
resize_modeoptCOMBOlanczos2 options: lanczos, bicubic
skip_upscale_if_matchoptBOOLEANtrue
ar_skip_epsilonoptFLOAT0.00200–0.5
cache_tokensoptBOOLEANfalse
cache_bustoptSTRING
debug_timingoptBOOLEANfalse

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING