|
|
---
|
|
|
title: Z-Image-Turbo API
|
|
|
emoji: 🎨
|
|
|
colorFrom: purple
|
|
|
colorTo: blue
|
|
|
sdk: docker
|
|
|
pinned: false
|
|
|
license: apache-2.0
|
|
|
---
|
|
|
|
|
|
# 🎨 Z-Image-Turbo API
|
|
|
|
|
|
Generate high-quality images from text using Alibaba's **Z-Image-Turbo** model.
|
|
|
|
|
|
## ⚠️ Performance Note
|
|
|
|
|
|
This Space runs on **CPU only**. Expect generation times of **2-5 minutes per image**.
|
|
|
|
|
|
## 📡 API Usage
|
|
|
|
|
|
### POST /generate
|
|
|
|
|
|
```python
|
|
|
import requests
|
|
|
|
|
|
response = requests.post(
|
|
|
"https://YOUR_SPACE.hf.space/generate",
|
|
|
json={
|
|
|
"prompt": "a beautiful sunset over mountains",
|
|
|
"width": 512,
|
|
|
"height": 512,
|
|
|
"seed": -1,
|
|
|
"num_steps": 8
|
|
|
}
|
|
|
)
|
|
|
|
|
|
data = response.json()
|
|
|
# data["image_base64"] contains the PNG image as base64
|
|
|
# data["seed"] contains the seed used
|
|
|
```
|
|
|
|
|
|
### cURL
|
|
|
|
|
|
```bash
|
|
|
curl -X POST "https://YOUR_SPACE.hf.space/generate" \
|
|
|
-H "Content-Type: application/json" \
|
|
|
-d '{"prompt": "a cat in space", "width": 512, "height": 512, "seed": -1, "num_steps": 8}'
|
|
|
```
|
|
|
|