modelscope / modelscope/DiffSynth-Studio
Error: AttributeError: 'list' object has no attribute 'size' in example code of Qwen-Image-Edit
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.1k
- Forks
- 1.3k
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 45
Description
Key Code:
edit_image = [Image.open("image1.jpg"), Image.open("image2.jpg")]
image_3 = pipe(prompt, edit_image=edit_image, seed=1, num_inference_steps=40, height=1328, width=1024, edit_image_auto_resize=True)
Comment:
It looks like 'List' is not match the argument 'edit_image' of pipe.
Error Details:
Traceback (most recent call last):
File "/data/source/opensource/video_ai/qwen-image-edit-test.py", line 40, in
image_3 = pipe(prompt, edit_image=edit_image, seed=1, num_inference_steps=40, height=1328, width=1024, edit_image_auto_resize=True)
File "/data/source/opensource/video_ai/.venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
File "/data/source/opensource/video_ai/.venv/lib/python3.10/site-packages/diffsynth/pipelines/qwen_image.py", line 422, in call
inputs_shared, inputs_posi, inputs_nega = self.unit_runner(unit, self, inputs_shared, inputs_posi, inputs_nega)
File "/data/source/opensource/video_ai/.venv/lib/python3.10/site-packages/diffsynth/utils/init.py", line 273, in call
processor_outputs = unit.process(pipe, **processor_inputs)
File "/data/source/opensource/video_ai/.venv/lib/python3.10/site-packages/diffsynth/pipelines/qwen_image.py", line 714, in process
resized_edit_image = self.edit_image_auto_resize(edit_image) if edit_image_auto_resize else edit_image
File "/data/source/opensource/video_ai/.venv/lib/python3.10/site-packages/diffsynth/pipelines/qwen_image.py", line 707, in edit_image_auto_resize
calculated_width, calculated_height = self.calculate_dimensions(1024 * 1024, edit_image.size[0] / edit_image.size[1])
AttributeError: 'list' object has no attribute 'size'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in diffsynth/pipelines/qwen_image.py, especially the process method and edit_image_auto_resize shown in the traceback. Reproduce the Qwen-Image-Edit example with the two-image list and inspect the expected edit_image input shape. Done means the example no longer raises AttributeError and the supported input behavior is clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100