Hi, I want to report a bug in Kandinsky pipelines.
| ifnotisinstance(image, list): |
| image= [image] |
| ifnotall(isinstance(i, (PIL.Image.Image, torch.Tensor)) foriinimage): |
| raiseValueError( |
| f"Input is in incorrect format: {[type(i) foriinimage]}. Currently, we only support PIL image and pytorch tensor" |
| ) |
| |
| image=torch.cat([prepare_image(i, width, height) foriinimage], dim=0) |
According to the above contents, elements in image can be either PIL.Image.Image or torch.Tensor.
| defprepare_image(pil_image, w=512, h=512): |
| pil_image=pil_image.resize((w, h), resample=Image.BICUBIC, reducing_gap=1) |
| arr=np.array(pil_image.convert("RGB")) |
| arr=arr.astype(np.float32) /127.5-1 |
| arr=np.transpose(arr, [2, 0, 1]) |
| image=torch.from_numpy(arr).unsqueeze(0) |
| returnimage |
However, the prepare_image function is only for PIL.Image.Image, and does not support torch.Tensor.
Can you resolve this problem by implementing an image resize function for torch.Tensor?
Hi, I want to report a bug in Kandinsky pipelines.
diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py
Lines 413 to 420 in 2f0f281
According to the above contents, elements in
imagecan be eitherPIL.Image.Imageortorch.Tensor.diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py
Lines 98 to 104 in 2f0f281
However, the
prepare_imagefunction is only forPIL.Image.Image, and does not supporttorch.Tensor.Can you resolve this problem by implementing an image resize function for
torch.Tensor?