Instructions to use poctexttoimage/checking-model-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use poctexttoimage/checking-model-1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("poctexttoimage/checking-model-1", 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
update handler
Browse files- handler.py +2 -1
handler.py
CHANGED
|
@@ -19,9 +19,10 @@ class EndpointHandler():
|
|
| 19 |
|
| 20 |
def __call__(self, data:Any) -> List[List[Dict[str, float]]]:
|
| 21 |
print(data)
|
|
|
|
| 22 |
print(device)
|
| 23 |
with autocast(device.type):
|
| 24 |
-
image = self.pipe(
|
| 25 |
|
| 26 |
buffered = BytesIO()
|
| 27 |
image.save(buffered, format="JPEG")
|
|
|
|
| 19 |
|
| 20 |
def __call__(self, data:Any) -> List[List[Dict[str, float]]]:
|
| 21 |
print(data)
|
| 22 |
+
inputs = data.pop("inputs", data)
|
| 23 |
print(device)
|
| 24 |
with autocast(device.type):
|
| 25 |
+
image = self.pipe(inputs, guidance_scale=7.5).images[0]
|
| 26 |
|
| 27 |
buffered = BytesIO()
|
| 28 |
image.save(buffered, format="JPEG")
|