Instructions to use socialtrait/stable-diffusion-xl-base-1.0-infendpoint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use socialtrait/stable-diffusion-xl-base-1.0-infendpoint with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("socialtrait/stable-diffusion-xl-base-1.0-infendpoint", 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 Settings
- Draw Things
- DiffusionBee
removed `variant=fp16`
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -17,7 +17,7 @@ class EndpointHandler:
|
|
| 17 |
def __init__(self, path=""):
|
| 18 |
# load StableDiffusionInpaintPipeline pipeline
|
| 19 |
self.base = DiffusionPipeline.from_pretrained(
|
| 20 |
-
path, torch_dtype=torch.float16, variant="fp16"
|
| 21 |
)
|
| 22 |
# use DPMSolverMultistepScheduler
|
| 23 |
self.base.scheduler = DPMSolverMultistepScheduler.from_config(
|
|
@@ -33,7 +33,7 @@ class EndpointHandler:
|
|
| 33 |
vae=self.base.vae,
|
| 34 |
torch_dtype=torch.float16,
|
| 35 |
use_safetensors=True,
|
| 36 |
-
variant="fp16",
|
| 37 |
)
|
| 38 |
# use DPMSolverMultistepScheduler
|
| 39 |
self.refiner.scheduler = DPMSolverMultistepScheduler.from_config(
|
|
|
|
| 17 |
def __init__(self, path=""):
|
| 18 |
# load StableDiffusionInpaintPipeline pipeline
|
| 19 |
self.base = DiffusionPipeline.from_pretrained(
|
| 20 |
+
path, torch_dtype=torch.float16, use_safetensors=True # variant="fp16"
|
| 21 |
)
|
| 22 |
# use DPMSolverMultistepScheduler
|
| 23 |
self.base.scheduler = DPMSolverMultistepScheduler.from_config(
|
|
|
|
| 33 |
vae=self.base.vae,
|
| 34 |
torch_dtype=torch.float16,
|
| 35 |
use_safetensors=True,
|
| 36 |
+
# variant="fp16",
|
| 37 |
)
|
| 38 |
# use DPMSolverMultistepScheduler
|
| 39 |
self.refiner.scheduler = DPMSolverMultistepScheduler.from_config(
|