Skip to content

Qwen-Image-Edit Inferior Results Compared to ComfyUIΒ #12216

@enesmsahin

Description

@enesmsahin

Describe the bug

I am trying to do multi-image editing with Qwen-Image-Edit (It is a simplified version of this). The ComfyUI workflow and diffusers script are shared below for reproducibility. I am using the same (unquantized) models and the same parameters.

The results I get with diffusers are noticeably inferior compared to ComfyUI especially in terms of preservation of the details.

Here is the input image and prompt:
Image
Prompt: The woman is displaying a plush toy product in her hand, while preserving her exact facial features, expression, clothing, and pose. Maintain the same background, natural lighting, and overall photographic composition and style.

Here are the outputs from Comfy:
Image
Image

Here are the outputs from Diffusers:
Image
Image

It changes both the woman and the toy a lot compared to Comfy implementation.

Reproduction

Diffusers reproduction script

import torch
from PIL import Image
from diffusers import QwenImageEditPipeline

pipeline = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit", torch_dtype=torch.bfloat16, device_map="cuda")
pipeline.set_progress_bar_config(disable=None)

input_image = Image.open("qwen_image_edit_input.png")

seed = 43
prompt = "The woman is displaying a plush toy product in her hand, while preserving her exact facial features, expression, clothing, and pose. Maintain the same background, natural lighting, and overall photographic composition and style."
inputs = {
    "image": input_image,
    "prompt": prompt,
    "generator": torch.manual_seed(seed),
    "true_cfg_scale": 4.5,
    "negative_prompt": " ",
    "num_inference_steps": 50,
    "height": 1024,
    "width": 1024,
}

with torch.inference_mode():
    output = pipeline(**inputs)
    output_image = output.images[0]
    output_image.save(f"diffusers_qwen_image_edit_out_{seed}.png")

Comfy Workflow file and image:
qwen_image_edit-multi_image-v1.0-compare.json
Image

Logs

System Info

  • πŸ€— Diffusers version: 0.35.1
  • Platform: Linux-5.15.0-122-generic-x86_64-with-glibc2.35
  • Running on Google Colab?: No
  • Python version: 3.10.18
  • PyTorch version (GPU?): 2.5.1+cu124 (True)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Huggingface_hub version: 0.34.4
  • Transformers version: 4.55.2
  • Accelerate version: 1.2.1
  • PEFT version: 0.17.0
  • Bitsandbytes version: not installed
  • Safetensors version: 0.4.5
  • xFormers version: not installed
  • Accelerator: NVIDIA A100-SXM4-80GB, 81920 MiB
  • Using GPU in script?: Yes
  • Using distributed or parallel set-up in script?: No

Who can help?

@asomoza @yiyixuxu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions