Diffusers
English
stable-diffusion
stable-diffusion-diffusers
inpainting
art
artistic
anime
absolute-realism
Instructions to use diffusers/tools with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers/tools 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/tools", 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
Download load_lora.py from diffusers/tools: direct link, hf CLI and curl.
- Browser
- Download file 448 Bytes
-
https://huggingface.co/diffusers/tools/resolve/e6c75db9bb6071b3cf3be898f42fe0847a4a8889/load_lora.py
- Command line
-
hf download hf://diffusers/tools@e6c75db9bb6071b3cf3be898f42fe0847a4a8889/load_lora.py
-
curl -L -o load_lora.py https://huggingface.co/diffusers/tools/resolve/e6c75db9bb6071b3cf3be898f42fe0847a4a8889/load_lora.py
448 Bytes
| #!/usr/bin/env python3 | |
| import torch | |
| from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler | |
| pipeline = StableDiffusionPipeline.from_pretrained( | |
| "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, safety_checker=None | |
| ).to("cuda") | |
| pipeline.scheduler = DPMSolverMultistepScheduler.from_config( | |
| pipeline.scheduler.config, use_karras_sigmas=True | |
| ) | |
| pipeline.load_lora_weights("sayakpaul/sd-model-finetuned-lora-t4") | |