huggingface / huggingface/diffusers

Qwen-Image-Edit Inferior Results Compared to ComfyUI

Offen
#12,216 21 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug stale
Vorherrschende Sprache
Python
Sterne
34.5k
Forks
7.3k
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
91

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, pytorch
Bereich
computer-vision, machine-learning
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.