Instructions to use CompVis/stable-diffusion-safety-checker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CompVis/stable-diffusion-safety-checker with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, SafetyChecker processor = AutoProcessor.from_pretrained("CompVis/stable-diffusion-safety-checker") model = SafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
Fix: Invalid import of SafetyChecker in example code
Verified signature## Description The example code in the model card fails with the following error: ```python from transformers import AutoProcessor, SafetyChecker # ImportError: cannot import name 'SafetyChecker' from 'transformers' ``` ## Changes Replaced: ```python from transformers import AutoProcessor, SafetyChecker ``` with: ```python from transformers import CLIPFeatureExtractor as AutoProcessor from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker as SafetyChecker ``` ## Testing The code has been successfully tested and runs without error. ## Note This contribution is part of an ongoing research initiative to systematically identify and correct faulty example code in Hugging Face Model Cards. We would appreciate a timely review and integration of this patch to support code reliability and enhance reproducibility for downstream users.176edb4
-
Model Car (#34)
- Model Car (887555445a78a73f686573b8bae0d440c1a50ce2) Co-authored-by: Ezi Ozoani <Ezi@users.noreply.huggingface.co>cb41f3a
-
add weights
4bb648a -
initial commit
e311038