Instructions to use diffusers/tiny-stable-diffusion-torch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers/tiny-stable-diffusion-torch with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers/tiny-stable-diffusion-torch", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
encounter error ,OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory
The OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory error I encountered is because the requires_safety_checker parameter in model_index.json is no longer functional in diffusers version v0.34.0. This parameter seems to have been removed.
To resolve this issue, pls do one of the following:
Add the
safety_checker=Noneparameter when loading the pipeline.
For example:
pipeline = StableDiffusionPipeline.from_pretrained("hf-internal-testing/tiny-stable-diffusion-torch", safety_checker=None)Remove the
safety_checkerconfiguration from yourmodel_index.jsonfile.
The safety_checker component is used to check for and filter out images that may violate ethical and legal guidelines.