deep-floyd / IF

Other
7.63k stars 495 forks source link

Tensor error for basic example usage #136

Open abasu0713 opened 1 year ago

abasu0713 commented 1 year ago

Can't seem to run the basic example usage from here. Throws the following error:

`

AttributeError Traceback (most recent call last) in <cell line: 40>() 38 39 # stage 3 ---> 40 image = stage_3(prompt=prompt, image=image, generator=generator, noise_level=100).images 41 pt_to_pil(image)[0].save("./if_stage_III.png")

4 frames /usr/local/lib/python3.10/dist-packages/diffusers/utils/pil_utils.py in numpy_to_pil(images) 41 if images.ndim == 3: 42 images = images[None, ...] ---> 43 images = (images * 255).numpy().round().astype("uint8") 44 if images.shape[-1] == 1: 45 # special case for grayscale (single channel) images

AttributeError: 'Tensor' object has no attribute 'astype'

adavies25 commented 1 year ago

I'm getting the same error. I have diffusers v0.20.2.

adavies25 commented 1 year ago

I avoided the error by rolling back diffusers library with "pip install diffusers==0.16" however, the final output image was not what the prompt stated. This colab page does work however here

abasu0713 commented 1 year ago

Thank you @adavies25. I got it working too! The stage 3 is where the upscaler is being used.. And that was where it was failing. I was able to use it simply with my own diffuser. And building the diffuser library from source. But this bug should remain Open since the documentation is wrong.. It doesn't mention anything about using an old diffuser version. Just my opinion