-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
It would be better if img2img pipeline checks if the type of image is valid. Currently, this pipeline only supports tensor, PIL.Image, or a list of PIL.Image, but this type check is missing in https://github.com/huggingface/diffusers/blob/62608a9102e423ad0fe79f12a8ceb1710d2027b2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#LL378C10-L378C10
As a result, if the user gives incorrectly typed image (for example, an numpy array), some unhelpful message will appear such as
File "path\to\diffusers\pipelines\stable_diffusion\pipeline_stable_diffusion_img2img.py", line 403, in prepare_latents
image = image.to(device=device, dtype=dtype)
AttributeError: 'numpy.ndarray' object has no attribute 'to'
We can also add this check in
diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
Line 45 in 62608a9
| def preprocess(image): |
Metadata
Metadata
Assignees
Labels
No labels