huggingface / huggingface/diffusers

[Qwen-image-edit] Batch Inference Issue / Feature Request

Open
#12,458 13 comments 0 reactions 0 assignees View on GitHub
advanced stale
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

### Describe the bug

I am trying to run the batch inference for 'Qwen-Image-Edit-2509', but it will raise inference error

```
AttributeError Traceback (most recent call last)
.venv/lib/python3.10/site-packages/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py:633) height = height or calculated_height

AttributeError: 'tuple' object has no attribute 'size'
```

### Reproduction

```
import os
import torch
from PIL import Image
from diffusers import QwenImageEditPlusPipeline
from diffusers.utils import load_image

pipeline = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", torch_dtype=torch.bfloat16)
print("pipeline loaded")

pipeline.to('cuda')
pipeline.set_progress_bar_config(disable=None)
image1 = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/inpaint.png"),
image2 = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png"),
prompts = [
"cinematic photo of a beautiful sunset over mountains, 35mm photograph, film, professional, 4k, highly detailed",
"cinematic film still of a cat basking in the sun on a roof in Turkey, highly detailed, high budget hollywood movie, cinemascope, moody, epic, gorgeous, film grain",
]

with torch.inference_mode():
output = pipeline(
image=[image1, image2],
prompt=prompts,
generator=[torch.manual_seed(0), torch.manual_seed(0)],
true_cfg_scale=4.0,
negative_prompt=" ",
num_inference_steps=40,
guidance_scale=1.0,
)
output_image = output.images
```

### Logs

```shell

```

### System Info

- 🤗 Diffusers version: 0.36.0.dev0
- Platform: Linux-6.8.0-63-generic-x86_64-with-glibc2.39
- Running on Google Colab?: No
- Python version: 3.10.18
- PyTorch version (GPU?): 2.8.0+cu128 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Huggingface_hub version: 0.35.3
- Transformers version: 4.57.0
- Accelerate version: 1.10.1
- PEFT version: not installed
- Bitsandbytes version: not installed
- Safetensors version: 0.6.2
- xFormers version: not installed
- Accelerator: NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB
NVIDIA H100 NVL, 95830 MiB

### Who can help?

@naykun

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction and inspect diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py around line 633, where the traceback occurs. Check how QwenImageEditPlusPipeline handles the batched image and prompt inputs, then run the provided example to determine whether the reported batch behavior is supported and what test should capture the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.