CoolFace
Modelpublic

simota1987/Sana_Sprint

sourceHugging Faceotherupdated 1mo agoView on Hugging Face
0likes
Model Card

SANA-Sprint 0.6B for Local Dream (MNN)

1024×1024 in 1–2 steps, running entirely on-device through MNN (CPU + OpenCL). No NPU required, so this also works on non-Snapdragon devices.

Measured on a Snapdragon 8 Gen 3 (SM8650), 1024px / 2 steps:

stagebackendtime
text encoder (Gemma-2-2B)CPU~31 s cold, ~0 s once the prompt is cached
DiT ×2 stepsOpenCL fp16~1.7 s each
DC-AE decodeOpenCL, 4×640px tiles~19 s

≈ 29 s with the prompt cached, ≈ 60 s for a brand-new prompt.

Layout

SANA                     marker file: tells Local Dream this is a SANA model dir
dit.mnn (+ .weight)      SANA-Sprint DiT, fp16
vae_decoder.mnn          DC-AE decoder, full 1024px (CPU path)
vae_decoder_tile.mnn     DC-AE decoder, 640px tile (GPU path; optional)
gemma/
  tokenizer.json
  token_emb.bin          [256000, 2304] fp16 embedding table, looked up on CPU
  gemma_meta.json
  gemma_chunk0..3.mnn (+ .weight)   the 26 layers, split four ways

Place the whole directory under Local Dream's models folder; it appears as a custom model.

Licensing

Notes on the conversion

Three things are easy to get wrong and are baked into these files:

  • —The text encoder runs over 506 tokens, not 300. SANA prepends a fixed 208-token instruction, runs Gemma over 208 + 300 − 2 positions, and only then selects [0] + last 299.
  • —The encoder is split into four chunks on purpose. Each boundary acts as an fp32 checkpoint; merged into fewer, longer graphs, MNN's fp16 error compounds badly — the same 13 layers differ by 44% as one graph vs two.
  • —The DiT's linear attention is rewritten for fp16: value is scaled (not query, which would drag the attention denominator under the clamp) and the denominator is clamped at the smallest fp16 normal. Both are exactly neutral in fp32; without them some prompts decode to a fully black image.