Instructions to use Elvenson/diffuser_inference with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Elvenson/diffuser_inference with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Elvenson/diffuser_inference", 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
Quoc Bao Bui commited on
Commit ·
eddf5bd
1
Parent(s): e762c44
Add access token
Browse files- handler.py +1 -1
handler.py
CHANGED
|
@@ -20,7 +20,7 @@ def decode_base64_image(image_string):
|
|
| 20 |
class EndpointHandler:
|
| 21 |
def __init__(self, path=""):
|
| 22 |
self.pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16,
|
| 23 |
-
revision="fp16")
|
| 24 |
self.pipe = self.pipe.to("cuda")
|
| 25 |
|
| 26 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|
|
|
|
| 20 |
class EndpointHandler:
|
| 21 |
def __init__(self, path=""):
|
| 22 |
self.pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16,
|
| 23 |
+
revision="fp16", use_auth_token="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")
|
| 24 |
self.pipe = self.pipe.to("cuda")
|
| 25 |
|
| 26 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|