riffusion: AttributeError: module 'PIL.Image' has no attribute 'Resampling'

Getting this error: AttributeError: module 'PIL.Image' has no attribute 'Resampling'

Any idea how to solve this?

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 2
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@tralala87 Thanks! I was able to reproduce the issue.

Commenting out the last line in the Install requirements cell fixed it for me, so:

#@title Install requirements (you may need to restart the kernel after this)
!pip install -r requirements.txt
!pip install gradio
# !pip install --upgrade pillow

For some reason that last line was causing issues for me.

I recommend running

import PIL
PIL.__version__

and making sure the output is 9.4.0. If it’s not, restart the runtime and try again. It was 7.1.2 for me until I commented out that line. Colab environment management can be finnicky.

9.4 has taken out the deprecated method to call this Resampling thing so that from diffusers import StableDiffusionImg2ImgPipeline import fails.

It works if you use pillow 9.1 to 9.3

I believe you just need an upgraded verison of pillow. Have you tried pillow>=9.1.0 per the requirements file?