3.6 KiB
3.6 KiB
Text Encode QwenImageEdit - Qwen image-edit prompt encoder
Node Purpose: Text Encode QwenImageEdit builds a QwenImageEdit-compatible prompt with one or more image placeholders, resizes images for the vision encoder, and outputs a CONDITIONING. With an optional VAE, it also attaches reference_latents for image-reference guidance.
Inputs
| Name | Port | Type | Default | Range | Description |
|---|---|---|---|---|---|
clip |
- | CLIP | - | - | QwenImageEdit-compatible CLIP model used for tokenize and encode. |
vae |
optional | VAE | - | - | When connected, the node generates reference_latents for each provided image. |
image_1 |
optional | IMAGE | - | - | First input image. The UI supports dynamic image_2..image_10 ports. |
prompt |
- | STRING(multiline) | "" |
- | User instruction appended after the image placeholders. |
reference_skip_prep |
- | COMBO | first |
none / first / all |
Reference-latents strategy for preserving original size on 8-aligned inputs. |
reference_sq_area |
- | INT | 1024 | 64-8192 | Side length used to derive the target area (reference_sq_area²) for reference-latents normalization. |
vision_embed |
- | COMBO | stretch |
crop / pad / stretch / area |
Vision-image resize strategy used by clip.tokenize(images=...). |
Outputs
| Name | Type | Description |
|---|---|---|
conditioning |
CONDITIONING | Text/image conditioning. When vae is connected, reference_latents are appended into conditioning values. |
Features
- Multi-image prompt: assembles
Picture 1..Nwith Qwen vision placeholders and feeds them intoclip.tokenize(images=...). - Vision resize modes: provides
crop,pad,stretch, andareafor stable vision-encoder input preparation. - Reference latents: generates per-image VAE latents and attaches them to the conditioning for reference-based image editing.
- 8-alignment aware: preserves original VAE encode size on 8-aligned images according to
reference_skip_prep.
vision_embed Modes
area: aspect-preserving resize to a target area of384×384pixels; output width/height followsqrt((384²)/(W×H)).crop: aspect-preserving resize that covers384×384, then center-crop to384×384.pad: aspect-preserving resize that fits inside384×384, then center-pad to384×384with zeros.stretch: direct resize to384×384, allowing aspect change.
reference_latents Rules
- Generation scope:
none: all images use area-normalized resize toreference_sq_area²and 8-alignment, then VAE encode.first: the first image uses original size VAE encode when width/height align to 8; remaining images follownonebehavior.all: each image uses original size VAE encode when width/height align to 8; each remaining image followsnonebehavior.
- Normalization behavior (area + 8-alignment):
scale = sqrt((reference_sq_area²) / (W×H))W' = round((W×scale)/8)×8,H' = round((H×scale)/8)×8- VAE encodes the resized RGB image (
:3channels).
Typical Usage
- Text-only conditioning: connect
clip, setprompt, and keepvaeempty. - Image-edit conditioning: connect
clip, connect one or moreimage_*, setvision_embed, and provide an instruction inprompt. - Reference-guided editing: connect
vaeand tunereference_skip_prepplusreference_sq_areafor reference-latents behavior.
Notes & Tips
- Image ports are consumed in numeric order:
image_1,image_2,image_3, ... - For consistent vision behavior across images, use the same
vision_embedmode for a workflow.