ControlNet-for-Diffusers icon indicating copy to clipboard operation
ControlNet-for-Diffusers copied to clipboard

ImportError: cannot import name 'KarrasDiffusionSchedulers' from 'diffusers.schedulers'

Open little-misfit opened this issue 1 year ago • 2 comments

Thank you for your work. When I tried to reproduce your second part of image repair work, an error occurred. Your code included KarrasDiffusionSchedulers, but this class does not exist in the diffusers library. Is there a problem with my operation? How should I fix it?

Traceback (most recent call last): File "/root/autodl-tmp/ControlNet-for-Diffusers/test.py", line 2, in from diffusers.utils import load_image File "/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/init.py", line 39, in from .pipelines import ( File "/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/pipelines/init.py", line 42, in from .alt_diffusion import AltDiffusionImg2ImgPipeline, AltDiffusionPipeline File "/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/pipelines/alt_diffusion/init.py", line 33, in from .pipeline_alt_diffusion import AltDiffusionPipeline File "/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py", line 36, in from ..stable_diffusion.safety_checker import StableDiffusionSafetyChecker File "/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/init.py", line 46, in from .pipeline_stable_diffusion_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline File "/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet_inpaint.py", line 25, in from ...schedulers import KarrasDiffusionSchedulers ImportError: cannot import name 'KarrasDiffusionSchedulers' from 'diffusers.schedulers' (/root/miniconda3/envs/lora/lib/python3.10/site-packages/diffusers/schedulers/init.py)

little-misfit avatar Mar 09 '23 12:03 little-misfit

Please install use a specific diffusers version for now. We will make our tutorial compatible to the latest official diffusers soon.

haofanwang avatar Mar 10 '23 05:03 haofanwang

Please install use a specific diffusers version for now. We will make our tutorial compatible to the latest official diffusers soon.

Thank you for your reply. Can you tell me how to install this special version of diffuser before you update the latest version of diffusers?

little-misfit avatar Mar 10 '23 07:03 little-misfit