diffusers
diffusers copied to clipboard
cannot import name 'StableDiffusionSafetyChecker' from 'diffusers.pipelines.stable_diffusion
Describe the bug
Whenever you run the convert_original_stable_diffusion_to_diffusers.py in google colab it results in the error cannot import name 'StableDiffusionSafetyChecker' from 'diffusers.pipelines.stable_diffusion
Reproduction
run the code on google colab
Logs
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-9-9a9734a4a917> in <module>
38 )
39 from diffusers.pipelines.latent_diffusion.pipeline_latent_diffusion import LDMBertConfig, LDMBertModel
---> 40 from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
41 from transformers import AutoFeatureExtractor, BertTokenizerFast, CLIPTextModel, CLIPTokenizer
42
ImportError: cannot import name 'StableDiffusionSafetyChecker' from 'diffusers.pipelines.stable_diffusion' (/usr/local/lib/python3.7/dist-packages/diffusers/pipelines/stable_diffusion/__init__.py)
System Info
Google CoLab
Hey @The-Ramosian,
Thanks for the issue, could you link a copy of a google colab here?
sure, here https://colab.research.google.com/drive/1dYH64Jc9qgfZlyDRUnl96v15FE0KxK3o?usp=sharing
Hey @The-Ramosian,
Could you instead use the following code snippet to import the safety checker:
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
-> tested this and it should work
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.