Instructions to use glowforge-prod/stable-diffusion-2-1-custom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use glowforge-prod/stable-diffusion-2-1-custom with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("glowforge-prod/stable-diffusion-2-1-custom", 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
Add second param to init function
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -11,7 +11,7 @@ if device.type != 'cuda':
|
|
| 11 |
model_id = "stabilityai/stable-diffusion-2-1-base"
|
| 12 |
|
| 13 |
class EndpointHandler():
|
| 14 |
-
def __init__(self):
|
| 15 |
# load the optimized model
|
| 16 |
self.pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 17 |
self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
|
|
|
|
| 11 |
model_id = "stabilityai/stable-diffusion-2-1-base"
|
| 12 |
|
| 13 |
class EndpointHandler():
|
| 14 |
+
def __init__(self, path=""):
|
| 15 |
# load the optimized model
|
| 16 |
self.pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 17 |
self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
|