huggingface / huggingface/diffusers

Qwen-Image-Edit Inferior Results Compared to ComfyUI

Aperta
#12,216 21 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug stale
Lingua principale
Python
Stelle
34.5k
Fork
7.3k
Merge medio
3g 3h
PR unite (30g)
91

Descrizione

### Describe the bug

I am trying to do multi-image editing with Qwen-Image-Edit (It is a simplified version of [this](https://x.com/hellorob/status/1958197227135906087)). 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
```python
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](https://github.com/user-attachments/files/21935108/qwen_image_edit-multi_image-v1.0-compare.json)
Image

### Logs

```shell

```

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the provided Python reproduction and the QwenImageEditPipeline entry point, then compare its parameters and outputs with the linked ComfyUI workflow. Reproduce the quality difference using the stated versions and seed; done means identifying and fixing the Diffusers-side cause so the generated image preserves details comparably to the reference.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, pytorch
Ambito
computer-vision, machine-learning
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.