Diffusers
English
stable-diffusion
stable-diffusion-diffusers
inpainting
art
artistic
anime
absolute-realism
Run this model with HF Jobs
Run diffusers/tools on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/diffusers/tools. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/diffusers/tools on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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
Commit ·
2438a7d
1
Parent(s): 69f6fc2
Create README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839# Diffusers Tools
This is a collection of scripts that can be useful for various tasks related to the [diffusers library](https://github.com/huggingface/diffusers)
## Test against original checkpoints
**It's very important to have visually the exact same results as the original code bases.!**
E.g. to make use `diffusers` is identical to the original [CompVis codebase](https://github.com/CompVis/stable-diffusion), you can run the following script in the original CompVis codebase:
1. Download the original [SD-1-4 checkpoint](https://huggingface.co/CompVis/stable-diffusion-v1-4) and put it in the correct folder following the instructions on: https://github.com/CompVis/stable-diffusion
2. Run the following command```python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --seed 0 --n_samples 1 --n_rows 1 --n_iter 1```
and compare this to the same command in diffusers:
```pythonfrom diffusers import DiffusionPipeline, StableDiffusionPipeline, DDIMSchedulerimport torch
# python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --seed 0 --n_samples 1 --n_rows 1 --n_iter 1seed = 0
prompt = "a photograph of an astronaut riding a horse"pipe = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16)
pipe = pipe.to("cuda")pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)torch.manual_seed(0)image = pipe(prompt, num_inference_steps=50).images[0]
image.save("/home/patrick_huggingface_co/images/aa_comp.png")```
Both commands should give the following image on a V100:
README.mdAdded+39