motif64

Image generation · Sana 1.5 1.6B · diffusers · GB10 · 16 GB VRAM

published by @dh7 on

m64 m64_5a4e4d2fbe6f
Download .tar.gz

SANA 1.5 1.6B text-to-image on GB10 (diffusers). SANA 1.5 1.6B at 1024x1024, 20 steps, guidance 4.5, bf16. A few seconds per image on a DGX Spark (GB10).

Lineage

parent
none declared
derived from
no published capsule shares half its files
children
none

Files

6 files

AGENT.md

SANA 1.5 1.6B text-to-image

This service turns a text prompt into a 1024x1024 PNG. It runs NVIDIA/MIT's SANA 1.5 1.6B diffusion model (diffusers, bf16) on one GPU. Generation settings are fixed: 1024x1024, 20 steps, guidance scale 4.5. You send a prompt and, optionally, a seed.

Base URL: {{BASE_URL}}

Routes

POST /v1/images/generations

OpenAI-style image generation. Returns one image as base64 PNG.

curl -s {{BASE_URL}}/v1/images/generations {{AUTH}} \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a lighthouse at sunset", "seed": 7}' \
  | python3 -c 'import sys,json,base64; d=json.load(sys.stdin); open("out.png","wb").write(base64.b64decode(d["data"][0]["b64_json"])); print(d["seed"], d["params_used"])'

Request fields:

  • prompt (string, required): what to draw. English works best.
  • seed (integer >= 0, optional): the random seed. The same prompt and seed give the same image. Leave it out for a random one; the response's top-level seed field says which seed was used, so you can reproduce a result you liked.

Also accepted, for stock OpenAI clients: model (any string), n (must be 1), response_format (must be "b64_json"), size (must be "1024x1024"), user. Any other field, or a different value for a fixed one (for example "num_inference_steps": 4), is rejected with 400.

Response:

{"created": 1761530000, "model": "sana-1.5-1.6b", "seed": 7, "elapsed_seconds": 4.1,
 "data": [{"b64_json": "<PNG, base64>"}],
 "params_used": {"size": "1024x1024", "num_inference_steps": 20, "guidance_scale": 4.5}}

The OpenAI Python SDK works too:

from openai import OpenAI
client = OpenAI(base_url="{{BASE_URL}}/v1", api_key="unused")
r = client.images.generate(model="sana-1.5-1.6b", prompt="a lighthouse at sunset",
                           response_format="b64_json", extra_body={"seed": 7})

GET /v1/config

The fixed settings and the request fields this service accepts.

curl -s {{BASE_URL}}/v1/config {{AUTH}}

GET /status

Where the service is in its start-up: phase is one of building, downloading, starting, loading, warming, ready, error, with eta_seconds and, while starting, a wait_hint.

curl -s {{BASE_URL}}/status {{AUTH}}

Timings and concurrency

  • First start: builds a container image and downloads about 10 GB of weights. After that, loading and a warm-up take about 70 s (budgeted at 180 s).
  • Each image takes about 5 s on a DGX Spark (GB10).
  • Requests run one at a time; extra requests wait in line. Send them one by one, or a few in parallel at most, and allow at least 60 s per request in your client timeout.

Errors

  • 503 with Retry-After while the service is still starting: wait that many seconds and retry. GET /status shows progress.
  • 400: a field was rejected; the body's error says which and why.
  • 422: a request field has the wrong type (for example prompt missing or empty, seed negative).
  • 5xx otherwise: retry once, then check GET /status.

capsule.toml

schema = "m64/capsule@1"description = "SANA 1.5 1.6B text-to-image on GB10 (diffusers). SANA 1.5 1.6B at 1024x1024, 20 steps, guidance 4.5, bf16. A few seconds per image on a DGX Spark (GB10)."kinds = ["image.generate"]authors = ["dh7"]license = "apache-2.0"[hardware]platform = "linux-aarch64"gpu = "NVIDIA GB10"gpu_count = 1vram_gb = 16driver = ">=580"disk_gb = 10[runtime]sandbox = "container"# No image: the Dockerfile builds on vllm/vllm-openai (gemma4-cu130) pinned by digest.gpu = trueshm_gb = 8internal_port = 9007health = "/health"expected_load_seconds = 180model_name = "sana-1.5-1.6b"user = "65534:65534"[[artifacts]]type = "hf"repo = "Efficient-Large-Model/SANA1.5_1.6B_1024px_diffusers"revision = "b77948f2b4eed5c728e9b828ccff07f7427b43cc"include = ["*.json", "*.safetensors", "*.txt", "tokenizer*"]mount = "/weights/sana"[params]size = "1024x1024"num_inference_steps = 20guidance_scale = 4.5[routes]extra = ["/v1/config"]