> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# TextEncodeQwenImage21 - ComfyUI Built-in Node Documentation

> The TextEncodeQwenImage21 node encodes a prompt and a negative prompt for the Qwen-Image 2.1 model, optionally attaching reference images.

The TextEncodeQwenImage21 node encodes a prompt and a negative prompt for the Qwen-Image 2.1 model, optionally attaching reference images. Reference images are seen by the text encoder and, when a VAE is connected, are also encoded as latents that are spliced into the sequence, so the conditioning carries both the text instruction and the visual reference. The node returns positive and negative conditioning together with an empty latent sized to the first reference image, ready to be sampled.

## Inputs

| Parameter         | Description                                                                                                                                                                                                 | Data Type | Required | Range               |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | ------------------- |
| `clip`            | The Qwen-Image 2.1 text encoder used to tokenize and encode the prompts.                                                                                                                                    | CLIP      | Yes      | -                   |
| `prompt`          | Text prompt describing the image to generate or the edit to apply. Supports multiline input and dynamic prompts.                                                                                            | STRING    | Yes      | Any text            |
| `negative_prompt` | Text prompt describing what the result should avoid. Supports multiline input and dynamic prompts.                                                                                                          | STRING    | Yes      | Any text            |
| `vae`             | VAE used to encode the reference images into reference latents. When omitted, the reference images condition the result through the text encoder only.                                                      | VAE       | No       | -                   |
| `resolution`      | Reference images are resized to about `resolution` x `resolution` pixels, at multiples of 32, preserving aspect ratio. 0 keeps each reference at its own size, rounded to a multiple of 32 (default: 1024). | INT       | Yes      | 0 to 4096 (step 32) |
| `images`          | Reference images, seen by the text encoder and spliced into the sequence as VAE latents. Growable slot: connect up to 16 images (`image_1` ... `image_16`).                                                 | IMAGE     | No       | 0 to 16 images      |

The empty latent output is sized to the first connected reference image, or to `resolution` when no reference image is connected. Sample at the latent this node returns: any other size shifts the edit. When a VAE is connected, the same reference latents are attached to both the positive and the negative conditioning, so a single sampler step can denoise both.

## Outputs

| Output Name | Description                                                                                            | Data Type    |
| ----------- | ------------------------------------------------------------------------------------------------------ | ------------ |
| `positive`  | Encoded conditioning for the prompt, carrying the reference latents when a VAE is connected.           | CONDITIONING |
| `negative`  | Encoded conditioning for the negative prompt, with the same reference latents.                         | CONDITIONING |
| `latent`    | Empty latent on the first reference image's size, or 1024 x 1024 when no reference image is connected. | LATENT       |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/TextEncodeQwenImage21/en.md)

***

**Source fingerprint (SHA-256):** `3870f04597d12b593498c12ca139428af2d717b65aa40c889de9373ae9eb475e`
