Text-to-Image
Diffusers
TensorBoard
Safetensors
English
StableDiffusionPipeline
diffusers-training
lora
template:sd-lora
stable-diffusion-xl
stable-diffusion-xl-diffusers
Instructions to use ZB-Tech/Text-to-Image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ZB-Tech/Text-to-Image 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") pipe.load_lora_weights("ZB-Tech/Text-to-Image") prompt = "Draw a picture of two female boxers fighting each other." image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Update README.md
Browse files
README.md
CHANGED
|
@@ -34,6 +34,26 @@ LoRA for the text encoder was enabled: False.
|
|
| 34 |
|
| 35 |
Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
## Download model
|
| 38 |
|
| 39 |
Weights for this model are available in Safetensors format.
|
|
|
|
| 34 |
|
| 35 |
Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
|
| 36 |
|
| 37 |
+
##### How to use
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import requests
|
| 41 |
+
|
| 42 |
+
API_URL = "https://api-inference.huggingface.co/models/ZB-Tech/Text-to-Image"
|
| 43 |
+
headers = {"Authorization": "Bearer HF_API_KEY"}
|
| 44 |
+
|
| 45 |
+
def query(payload):
|
| 46 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 47 |
+
return response.content
|
| 48 |
+
image_bytes = query({
|
| 49 |
+
"inputs": "Astronaut riding a horse",
|
| 50 |
+
})
|
| 51 |
+
# You can access the image with PIL.Image for example
|
| 52 |
+
import io
|
| 53 |
+
from PIL import Image
|
| 54 |
+
image = Image.open(io.BytesIO(image_bytes))
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
## Download model
|
| 58 |
|
| 59 |
Weights for this model are available in Safetensors format.
|