Mastering Qwen-Image-Edit in ComfyUI: The Real Way to Reference Images

When working with ComfyUI and advanced models like Qwen-Image-Edit, it is easy to get confused about how to reference multiple images in a workflow. Initially, one might assume that referencing images works by embedding filenames or text tags directly into the prompt. However, this approach completely overlooks the actual architecture of the model’s input system.

Technical diagram showing ComfyUI nodes connecting to image1, image2, and image3 inputs on the TextEncodeQwenImageEditPlus node.
Visual breakdown of how Load Image nodes connect directly to Qwen's specific input slots, proving that filenames are not used for referencing.

The Node-Based Input System

The reality is that referencing images for Qwen-Image-Edit is entirely tied to specific input slots on a dedicated node, such as the TextEncodeQwenImageEditPlus. These nodes possess distinct inputs explicitly labeled image1, image2, and image3. The workflow connects images directly to these specific ports. Consequently, the model does not scan filenames or search for image tags within your text; it simply reads the data fed into those exact slots.

Prompt Engineering: Vague vs. Explicit

Once you understand the inputs, you must address a common issue with instruction clarity. You might think that asking the model to perform an edit—such as placing the face of one image onto another—is sufficient for precise results. However, LLMs can be surprisingly vague about what constitutes a «face swap.» When you provide a generic request, the model may decide to alter the character’s expression or clothing entirely rather than performing a localized transfer.

Diagram comparing generic versus explicit prompt strategies for image-to-image tasks.
Comparison between vague prompts that fail and explicit prompts that enforce precise constraints for better AI editing results.

To solve this, you must be much more explicit. Instead of relying on vague instructions, you should provide clear constraints like «Keep the body, pose, and clothing unchanged» or «Preserve the background.» This forces the model to focus its attention on the specific regions it needs to edit while maintaining the integrity of the rest of the composition.

Input Order and Dynamic Workflows

Finally, a crucial detail is that input order matters significantly. The identity of an image in your workflow isn’t defined by where it appears visually on the screen, but by which Load Image node you connect to the specific slots. If you swap the connections between two Load nodes, you instantly redefine what Qwen perceives as «image 1» versus «image 2.» This allows for highly dynamic workflows where you can reorganize your inputs without modifying any text prompts.

Abstract graphic illustrating that changing workflow connections swaps the identity of images for the AI model.
Visual representation of input order dynamics, showing how swapping node connections redefines which image is perceived by the model.

By mastering these three core concepts—node slots, explicit prompting, and input order—you can build robust workflows for complex tasks. If you are currently struggling with a specific edit, don’t hesitate to share your results or the images you’re using; analyzing exactly where the model is failing allows us to pinpoint whether it’s an issue with your prompt phrasing or your node connections.