metadata
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
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
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}'