Interactive Image Editing with Qwen Image Edit and Fusion LoRA in ComfyUI
This guide will walk you through creating an interactive image editing workflow in ComfyUI using the Qwen Image Edit 2509 model, Fusion LoRA, and a compositor node. You'll learn how to place up to eight objects in a scene and control their size, rotation, and placement, making it ideal for product mockups, scene editing, and rapid prototyping.
Special Offer - $5 Credit Included!
When you sign up for RunPod using our affiliate link, you'll receive a $5 credit that can be used to generate up to 9,000 images and 300 videos. This gives you plenty of resources to explore ComfyUI and AI image/video generation without any upfront cost!
What You'll Learn
Prerequisites
Before starting, ensure you have:
- ComfyUI installed and set up. If not, refer to the ComfyUI Installation Guide.
- The ComfyUI Manager installed for easy custom node installation. See the ComfyUI Installation Guide for details.
- Basic familiarity with ComfyUI workflows.
Step-by-Step Process
Step 1: Download the Required Models and LoRAs
Download all the necessary models and LoRAs for this workflow. These files are crucial for the image editing process.
- Download Qwen ImageEdit 25009 Base Model: Obtain the base model in either BF-16 or FP8 scaled safe tensor formats from here. If you have limited VRAM, consider using the GGUF version available here.
- Download Qwen ImageEdit Lightning LoRA: Download the four-step LoRA from here. This LoRA allows for faster image generation.
- Download Qwen ImageEdit Fusion LoRA: Get the Fusion LoRA from here. This LoRA is responsible for blending the inserted objects into the background.
- Download Qwen Image VAE: Download the default Qwen image VAE from here.
- Download Text Encoder: Load the standard Qwen 2.5 VL7B FP8 scale safe tensors file.
- Download Upscaling Model: Prepare a good 4K upscaling model. Some options include: ClearRealityV1, 4x_NMKD-Siax_200k, RealESRGAN_x4plus, and 4x-AnimeSharp.
Model Storage Location
Place the downloaded models in the appropriate ComfyUI directories:
- Diffusion Models:
ComfyUI/models/diffusion_models/ - GGUF Models:
ComfyUI/models/unet/ - LoRAs:
ComfyUI/models/loras/ - VAE:
ComfyUI/models/vae/ - Text Encoders:
ComfyUI/models/text_encoders/ - Upscale Models:
ComfyUI/models/upscale_models/
Pro Tip
If you're using the GGUF version of the base model, enable the unit loader node, connect its output to the LoRA loader, and disable the diffusion loader node.
GGUF Model Considerations
Using the GGUF version can significantly reduce VRAM usage, making it suitable for systems with limited resources. However, it may also impact processing speed.
Step 2: Load Images into the Workflow
Load the background image and the foreground objects you want to composite into the scene.
- Load Background Image: Use the Load Image node to import your main background image.
- Load Foreground Objects: Use additional Load Image nodes to import up to seven foreground objects. These are the elements you will place and arrange on top of the background.
Image Requirements
Ensure your foreground objects have transparent backgrounds for seamless integration.
Pro Tip
Use high-resolution images for the best results, especially for the background.
Image Format
PNG format is recommended for foreground objects to preserve transparency. JPEG can be used for the background, but be mindful of potential compression artifacts.
Step 3: Configure the Compositor Section
This is where you'll interactively edit the scene, placing, resizing, and rotating the foreground objects.
- Access the Compositor Node: Locate the compositor node in the workflow.
- Place Objects: Drag and drop each object onto the canvas within the compositor node.
- Resize and Rotate: Use the controls within the compositor node to adjust the size, rotation, and position of each object.
- Fine-Tune Placement: Adjust the position of each object until it sits exactly where you want it in the scene.
Compositor Functionality
The compositor node allows you to manipulate each object independently, giving you precise control over the final composition.
Pro Tip
Experiment with different placements and sizes to find the most visually appealing arrangement.
Object Order
The order in which you place objects in the compositor node can affect their layering. Ensure objects are layered correctly for the desired visual effect.
Step 4: Set Up Prompts
Configure the positive and negative prompts to guide the image generation process.
- Define Positive Prompt: Enter your desired positive prompt. The default settings often work well, especially since the Fusion LoRA relies on a specific built-in prompt.
- Define Negative Prompt: Enter your desired negative prompt to avoid unwanted elements in the generated image.
- Maintain Fusion LoRA Prompt: If you customize your prompt, ensure you keep the default Fusion LoRA prompt attached to whatever text you add. This ensures consistent and natural blending.
Fusion LoRA Prompt
The Fusion LoRA prompt is crucial for ensuring the inserted objects blend naturally into the background.
Pro Tip
Start with simple prompts and gradually add complexity to refine the image generation.
Prompt Engineering
Experiment with different prompt combinations to achieve the desired artistic style and content.
Step 5: Configure Sampling
This section handles the actual image generation process.
- Connect Nodes: Ensure all necessary nodes are connected, including the arranged scene from the compositor, the prompts, and the loaded models.
- Adjust Sampling Parameters: Adjust the sampling parameters such as the number of steps, CFG scale, and sampler type.
- Run the Workflow: Execute the workflow to generate the final image.
Sampling Process
The sampling nodes combine your arranged scene, prompts, and loaded models to create the final image output.
Pro Tip
Experiment with different sampling parameters to achieve the desired image quality and style.
Sampling Steps
Increasing the number of sampling steps can improve image quality but also increases processing time.
Step 6: Upscale the Final Image
Upscale the generated image to 4K resolution to restore sharpness and details.
- Connect Upscaling Node: Connect the output of the sampling section to an upscaling node.
- Select Upscaling Model: Choose a suitable 4K upscaling model.
- Run Upscaling: Execute the upscaling node to enhance the final image.
Upscaling Importance
Fusion LoRA can sometimes soften the image, so upscaling is essential to restore sharpness and detail.
Pro Tip
Experiment with different upscaling models to find the one that best suits your image style.
Upscaling Considerations
Different upscaling models have varying strengths and weaknesses. Some are better at preserving fine details, while others excel at removing artifacts.
Related Guides
- ComfyUI Installation Guide - Complete installation process for ComfyUI
- Running ComfyUI on RunPod - Run ComfyUI workflows in the cloud with RunPod
Next Steps
Now that you've mastered interactive image editing with Qwen Image Edit and Fusion LoRA:
- Explore different scenes and object combinations.
- Experiment with various prompts and sampling parameters.
- Share your creations with the ComfyUI community.
