SANA-Sprint

SANA-Sprint 0.6B is a text-to-image model by NVIDIA: a 0.6-billion-parameter linear diffusion transformer distilled to sample in one to four steps, with a Gemma 2 2B text encoder. LibreYOLO runs it through its diffusers pipeline behind the LibreGen factory.

Tác vụ
image generation
Cài đặt
pip install "libreyolo[gen]"
Bậc hỗ trợ
Bậc song hành, từ v1.7.0. Một bề mặt sản phẩm riêng với factory và contract riêng.
Thượng nguồn
SANA-Sprint 0.6B của NVIDIA, Apache-2.0; Gemma Terms of Use for the Gemma 2 text encoder. Bài báo, mã nguồn
Giấy phép
Mã nguồn MIT, trọng số Apache-2.0; Gemma Terms of Use for the Gemma 2 text encoder. Sử dụng thương mại

Install

bash
pip install "libreyolo[gen]"

The gen extra installs diffusers, transformers and accelerate. SANA-Sprint loads as the diffusers SanaSprintPipeline, which needs diffusers 0.38.0 or later. Importing LibreGen imports none of them; they load on first use.

Generation runs on a CUDA GPU or on Apple silicon through MPS. device="auto" picks CUDA, then MPS, then the CPU, where the pipeline loads in fp32 and image generation is not practical.

Predict

Python
from libreyolo import LibreGen # Needs a CUDA GPU or Apple silicon (MPS); generation is not practical on CPU.model = LibreGen("sana-sprint-0.6b")   # weights download on first useresult = model("a red fox sleeping in fresh snow", seed=0) result.save("fox.png")                 # the PNG also records prompt, seed and settingsprint(result.generated.array.shape)    # (1024, 1024, 3)
CLI
# Saves four images as .png under runs/generate/predict.libreyolo generate prompt="a red fox sleeping in fresh snow" model=sana-sprint-0.6b seed=0 n=4
Settings
from libreyolo import LibreGen model = LibreGen("sana-sprint-0.6b") result = model("a red fox sleeping in fresh snow", imgsz=(768, 1024))  # height, widthresult = model("a red fox sleeping in fresh snow", steps=4)            # more sampling stepsresult = model("a red fox sleeping in fresh snow", guidance=3.0) # Two prompts, two images each (seeds 0 and 1), written to runs/generate/predict.results = model(    ["a red fox sleeping in fresh snow", "a lighthouse on a rocky coast"],    seed=0,    n=2,    save=True,)
Results
from libreyolo import LibreGen model = LibreGen("sana-sprint-0.6b")result = model("a red fox sleeping in fresh snow", seed=0) g = result.generatedprint(g.array.shape, g.array.dtype)   # (1024, 1024, 3) uint8, RGBprint(g.prompt, g.seed)               # what to pass to make it againprint(g.params)                       # model, imgsz, steps, guidance g.image.save("fox.jpg")               # a PIL imageprint(result.summary())               # one JSON-ready row

One prompt with n=1 returns a Results; a list of prompts or n > 1 returns a flat list in prompt order, and stream=True a generator. A string is always a prompt, never a path. result.generated is a GeneratedImage: array is the (H, W, 3) uint8 RGB image and image the same image as a PIL.Image, prompt the text, seed the integer that reproduces it, and params the model, imgsz and every setting in effect, defaults included. result.save(path) writes the image, and a PNG also stores prompt, seed and params as JSON in a libreyolo text chunk. result.plot() returns the image. save=True writes each image to a new runs/generate/predict folder per call, the file named after its index, prompt and seed; output_path names the file instead, for one prompt with n=1.

The first call downloads about 7.7 GB at a pinned revision, with nothing gated and no Hugging Face login, from Efficient-Large-Model/Sana_Sprint_0.6B_1024px_diffusers into weights/LibreSanaSprint0.6b/. Only the pipeline's component folders are fetched. LibreGen(path) loads a local directory that holds a SanaSprintPipeline in the diffusers layout instead, such as an offline copy or a fine-tune made with upstream tooling. sana-sprint is an alias of sana-sprint-0.6b.

A seed, with the same model and settings, gives the same image. Image i of a prompt uses seed + i, and every prompt in a list starts from the same seed. Without a seed, a fresh one is drawn for each prompt and recorded in result.generated.seed. The seed drives a random generator on the CPU, so the starting noise is the same on every device; the image can still differ across devices and precisions by numerical error.

Image-conditioned generation is not available yet: source= raises NotImplementedError.

Settings

Every setting has a default, so all are optional. A name the model does not have raises TypeError and lists the supported ones.

SettingDefaultMeaning
imgsz1024Output size: an int for a square image, or (height, width). Each side is rounded up to a multiple of 32, with a warning.
steps2Sampling steps. The model is distilled for 1 to 4. At 2 the pipeline uses its own intermediate timestep; any other count runs an evenly spaced schedule.
guidance4.5Prompt guidance.

The constructor takes device, dtype and offload. dtype="auto" is bf16 on CUDA (fp16 on a GPU without bf16), bf16 on MPS from macOS 14, and fp32 on the CPU and on older macOS; "bf16", "fp16" and "fp32" force one. offload=True keeps idle pipeline components off the GPU; it needs CUDA and raises on any other device. model.pipeline is the loaded diffusers SanaSprintPipeline, for anything the LibreGen call does not cover.

Export

Tác vụONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
Image generationImage generation to ONNX: không được hỗ trợImage generation to TorchScript: không được hỗ trợImage generation to ExecuTorch: không được hỗ trợImage generation to TensorRT: không được hỗ trợImage generation to OpenVINO: không được hỗ trợImage generation to Paddle: không được hỗ trợImage generation to MNN: không được hỗ trợImage generation to RKNN: không được hỗ trợImage generation to ncnn: không được hỗ trợImage generation to TFLite: không được hỗ trợImage generation to CoreML: không được hỗ trợImage generation to Core AI: không được hỗ trợ

Export is not implemented: the model is a sampling loop over several networks, and LibreYOLO has no exportable graph contract for that yet (ADR 0030 in the library). export(), train() and val() raise NotImplementedError. train(data=...) is reserved for fine-tuning on captioned images, and val(data=...) for generation metrics on a captioned image set.

Licensing

Hãy kiểm tra giấy phép trong repo Hugging Face của trọng số cụ thể mà bạn tải xuống. Mỗi checkpoint trong tổ chức LibreYOLO đều có giấy phép riêng và giấy phép có thể khác nhau trong cùng một họ. Repo đó là nguồn có thẩm quyền; phần tóm tắt dưới đây mô tả các điều khoản áp dụng khi trang này được kiểm chứng lần gần nhất.

Đây là phần mô tả các giấy phép liên quan, không phải tư vấn pháp lý. Nếu câu trả lời có ý nghĩa về mặt thương mại, hãy tự đọc các giấy phép và tham khảo cố vấn của riêng bạn.

Công trình gốc
SANA-Sprint 0.6B, NVIDIA
Giấy phép thượng nguồn
Apache-2.0; Gemma Terms of Use for the Gemma 2 text encoder
Nguồn thượng nguồn
github.com/NVlabs/Sana
Mã nguồn LibreYOLO
MIT
Trọng số
Apache-2.0; Gemma Terms of Use for the Gemma 2 text encoder, do tác giả phân phối. LibreYOLO không lưu trữ hoặc sao chép chúng.
Diễn giải
SANA-Sprint weights are Apache-2.0. The bundled Gemma 2 text encoder is under the Gemma Terms of Use (https://ai.google.dev/gemma/terms) and the Gemma Prohibited Use Policy. Apache-2.0 is a permissive license, so the SANA-Sprint transformer and autoencoder can be used in commercial and closed-source products; it asks you to keep its license text and attribution notices with any copy you redistribute, and it grants a patent license. NVIDIA declares it on the Hugging Face repository LibreYOLO downloads, Efficient-Large-Model/Sana_Sprint_0.6B_1024px_diffusers, in its license tag and LICENSE file, and the model card names the Gemma terms for Gemma-2-2B-IT alongside it. The Gemma Terms of Use are Google's own agreement, not an OSI-approved license: redistributing the encoder means passing the Prohibited Use Policy's restrictions on to your users as an enforceable provision, with a copy of the terms. LibreYOLO's loader prints the notice above the first time it loads the model in a session. Read both documents before shipping a product on this model. LibreYOLO's adapter is its own MIT code that calls the Apache-2.0 diffusers SanaSprintPipeline; no upstream source is ported. The weights are not redistributed: they download from that repository at revision aa76e7f4f4928f378716b6716a2130fba3caf5b1.

SANA-Sprint is the work of NVIDIA. Its code is NVlabs/Sana and its weights are Efficient-Large-Model/Sana_Sprint_0.6B_1024px_diffusers, both Apache-2.0. The pipeline bundles Google's Gemma 2 2B as its text encoder, which stays under the Gemma Terms of Use and the Gemma Prohibited Use Policy. LibreYOLO adds no content filter; the upstream usage terms apply.

Citation

@misc{chen2025sana-sprint,
      title={SANA-Sprint: One-Step Diffusion with Continuous-Time Consistency Distillation},
      author={Junsong Chen and Shuchen Xue and Yuyang Zhao and Jincheng Yu and Sayak Paul and Junyu Chen and Han Cai and Song Han and Enze Xie},
      year={2025},
      eprint={2503.09641},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2503.09641},
    }

Được sao chép từ khối trích dẫn của tác giả tại nvlabs.github.io/Sana/Sprint/#BibTeX.

Đã kiểm chứng với LibreYOLO v1.7.0. Các bảng hỗ trợ, checkpoint và số liệu benchmark trên trang này được tạo từ thư viện đã phát hành và trọng số đã công bố, không phải viết thủ công.