Run this model with HF Jobs
Run stabilityai/stable-diffusion-xl-base-1.0 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/stabilityai/stable-diffusion-xl-base-1.0. 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/stabilityai/stable-diffusion-xl-base-1.0 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 stabilityai/stable-diffusion-xl-base-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use stabilityai/stable-diffusion-xl-base-1.0 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
readme-optimum
#22
by echarlaix HF Staff - opened
87 unmodified lines88899091929323 unmodified lines11711811912087 unmodified lines```## Uses### Direct Use23 unmodified lines- The autoencoding part of the model is lossy.### BiasWhile the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.87 unmodified lines88899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314423 unmodified lines16816917017187 unmodified lines```### Optimum[Optimum](https://github.com/huggingface/optimum) provides a Stable Diffusion pipeline compatible with both [OpenVINO](https://docs.openvino.ai/latest/index.html) and [ONNX Runtime](https://onnxruntime.ai/).#### OpenVINOTo install Optimum with the dependencies required for OpenVINO :```bashpip install optimum[openvino]```To load an OpenVINO model and run inference with OpenVINO Runtime, you need to replace `StableDiffusionXLPipeline` with Optimum `OVStableDiffusionXLPipeline`. In case you want to load a PyTorch model and convert it to the OpenVINO format on-the-fly, you can set `export=True`.```diff- from diffusers import StableDiffusionPipeline+ from optimum.intel import OVStableDiffusionPipelinemodel_id = "stabilityai/stable-diffusion-xl-base-1.0"- pipeline = StableDiffusionPipeline.from_pretrained(model_id)+ pipeline = OVStableDiffusionPipeline.from_pretrained(model_id)prompt = "A majestic lion jumping from a big stone at night"image = pipeline(prompt).images[0]```You can find more examples (such as static reshaping and model compilation) in optimum [documentation](https://huggingface.co/docs/optimum/main/en/intel/inference#stable-diffusion-xl).#### ONNXTo install Optimum with the dependencies required for ONNX Runtime inference :```bashpip install optimum[onnxruntime]```To load an ONNX model and run inference with ONNX Runtime, you need to replace `StableDiffusionXLPipeline` with Optimum `ORTStableDiffusionXLPipeline`. In case you want to load a PyTorch model and convert it to the ONNX format on-the-fly, you can set `export=True`.```diff- from diffusers import StableDiffusionPipeline+ from optimum.onnxruntime import ORTStableDiffusionPipelinemodel_id = "stabilityai/stable-diffusion-xl-base-1.0"- pipeline = StableDiffusionPipeline.from_pretrained(model_id)+ pipeline = ORTStableDiffusionPipeline.from_pretrained(model_id)prompt = "A majestic lion jumping from a big stone at night"image = pipeline(prompt).images[0]```You can find more examples in optimum [documentation](https://huggingface.co/docs/optimum/main/en/onnxruntime/usage_guides/models#stable-diffusion-xl).## Uses### Direct Use23 unmodified lines- The autoencoding part of the model is lossy.### BiasWhile the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.
README.md+52-1