개요
SANA는 효율적인 고해상도 이미지 및 비디오 생성을 위한 오픈소스 코드베이스로, 전체 학습 및 추론 파이프라인을 제공합니다. Linear Diffusion Transformer를 기반으로 하며, 텍스트-이미지 생성, 텍스트-비디오 생성 및 월드 모델 등의 작업을 지원합니다.
README 미리보기
\n \n\n\n\n📚 Docs | SANA | SANA-1.5 | SANA-Sprint | SANA-Video | SANA-WM | Sol-RL\n \nDemo | 🤗 HuggingFace | ComfyUI | SGLang | Cosmos-RL\n\n\n\n\n  \n  \n  \n  \n  \n\n\n\n  \n  \n\n\nICLR 2025 Oral | ICML 2025 | ICCV 2025 Highlight | ICLR 2026 Oral \n\n**SANA** is an efficiency-oriented codebase for high-resolution image and video generation, providing complete training and inference pipelines. This repository contains code for [SANA](https://nvlabs.github.io/Sana/), [SANA-1.5](https://nvlabs.github.io/Sana/Sana-1.5/), [SANA-Sprint](https://nvlabs.github.io/Sana/Sprint/), [SANA-Video](https://nvlabs.github.io/Sana/Video/), [SANA-WM](https://nvlabs.github.io/Sana/WM/), and [Sol-RL](https://nvlabs.github.io/Sana/Sol-RL/). More details can be found in our [📚 documentation](https://nvlabs.github.io/Sana/docs/).\n\nJoin our [Discord](https://discord.gg/rde6eaE5Ta) to engage in discussions with the community! If you have any questions, run into issues, or are interested in contributing, don't hesitate to reach out!\n\n\n \n\n\n## News\n\n- 🔥 [2026/05] 🌍 **SANA-WM: 2.6B Controllable World Model** is released! Supports 720p, 1-min video generation with 6-DoF camera control. A new baseline for World Modeling and Embodied AI. See [Project](https://nvlabs.github.io/Sana/WM/) | [Paper](https://huggingface.co/papers/2605.15178).\n- 🔥 [2026/04] ⚡ **Sol-RL: NVFP4 Rollout, BF16 Training RL** is available! All training recipes for **SANA**, **FLUX.1**, and **SD3.5-L**, together with bundled post-training datasets, are released. See [Sol-RL doc](https://nvlabs.github.io/Sana/docs/sol_rl/) | [Page](https://nvlabs.github.io/Sana/Sol-RL/) | [Paper](https://arxiv.org/abs/2604.06916).\n- 🔥 [2026/03] 📺 **SANA-Video 720p model with LTX-VAE** is released. Use it with LTX2 Refiner to upscale the videos to 2K resolution! See [Model Zoo](https://nvlabs.github.io/Sana/docs/model_zoo/#sana-video), [SANA-Video doc](https://nvlabs.github
FAQ (4)
문제 해결커스텀 학습된 기본 확산 모델을 Dreambooth + LoRA 미세 조정을 위해 diffusers 형식으로 변환하는 방법?
제공된 스크립트를 사용하세요: python tools/convert_sana_to_diffusers.py. 이 스크립트는 diffusers 형식이 아닌 가중치를 예상된 diffusers 상태 사전 형식으로 변환하여, 모델이 Dreambooth 및 LoRA 훈련 스크립트와 호환되도록 합니다.
문제 해결Sol-H3 Stage 2에서 아무도 말하지 않는데 입술이 움직이는 등 립싱크가 좋지 않게 생성되는 이유는 무엇이며, 어떻게 해결할 수 있나요?
Sol-H3-Spark / Sol-H3-RTX5090에서 Stage 2는 H3 오디오를 인코딩하고, 첫 번째 Stage-2 sigma(0.909375)로 다시 노이즈를 입힌 뒤 비디오와 함께 디노이징합니다. 그런 다음 해당 오디오를 버리고 원본 H3 PCM을 먹싱합니다. 입술은 재생성된 트랙에 맞춰 정제되는데, 이 트랙은 영어처럼 들리는 옹알이로 무음 구간에서조차 음성이 포함될 수 있습니다. 따라서 립싱크가 어긋나고(SyncNet LSE-C가 ~8.2에서 ~4.4로 하락) 룸 톤 중에도 입이 움직일 수 있습니다. 수정 사항(PR #543에 머지됨): LTX-2의 a2vid_two_stage.py와 정확히 동일하게, Stage-2 정제 동안 오디오를 깨끗하고 동결된 상태로 유지합니다 — 노이즈를 입히는 대신 ModalitySpec(frozen=True, noise_scale=0.0, initial_latent=encoded_audio_latent)로 전달합니다. 이렇게 하면 렌더링 시간은 동일하고 출력 오디오도 변경되지 않은 채로 립싱크가 복원됩니다(LSE-C ~4.4 → 7.8). 수정 사항을 적용하려면 commit 62da34b 이후로 업데이트하세요.
문제 해결Ascend NPU에서 'Torch not compiled with CUDA enabled' 또는 NCCL 오류로 인해 LongSana가 크래시되는 문제를 해결하는 방법은?
LongSana는 분산 초기화 및 FSDP 디바이스에 CUDA/NCCL을 하드코딩하므로 CUDA가 아닌 가속기(예: torch_npu를 사용하는 Ascend NPU 910B)에서 실패합니다. PR #514에서 수정되었습니다. 다음 변경 사항을 적용하세요: (1) diffusion/longsana/utils/distributed.py에 디바이스/백엔드 판별 헬퍼인 get_device_type(), get_current_device(), get_default_dtype(), set_device(), get_distributed_backend()를 추가합니다. 이들은 Ascend에서는 npu/hccl, CUDA에서는 cuda/nccl, CPU 전용 환경에서는 cpu/gloo를 반환합니다. (2) 하드코딩된 호출을 교체합니다: launch_distributed_job(backend="nccl")(83행)이 get_distributed_backend()를 사용하도록 변경하고, torch.cuda.set_device(local_rank)(97행)를 set_device(local_rank)로, FSDP 래핑(69행)의 device_id=torch.cuda.current_device()를 get_current_device()로 교체합니다. (3) diffusion/longsana/trainer/ode.py:41과 trainer/self_forcing_trainer.py:47에서 self.device = torch.cuda.current_device()를 리졸버로 교체합니다. (4) 파이프라인 파일(sana_training_pipeline.py, sana_inference_pipeline.py, sana_inference_interactive_pipeline.py, sana_inference_interactive_pipeline_long_chunk.py)에서 torch.device("cuda" if torch.cuda.is_available() else "cpu")와 fp32 폴백 dtype을 get_device_type()/get_default_dtype()로 교체하여, CPU/fp32로 자동 폴백되지 않고 NPU가 감지되도록 합니다. 패치 후 torchrun --nproc_per_node=N longsana_trainer.py는 HCCL을 올바르게 초기화하고 FSDP는 npu:<rank>에서 파라미터를 래핑합니다. CUDA 동작은 변경되지 않습니다.
문제 해결왜 LongSanaVideoPipeline이 diffusers에서 누락되었으며 LongSana를 어떻게 실행할 수 있나요?
LongSanaVideoPipeline은 아직 diffusers 라이브러리(최신 dev 버전에서도)에 구현되지 않았습니다. Hugging Face 모델 페이지에는 'coming soon'이라고 명시되어 있습니다. 임시 해결책으로 공식 Sana 저장소를 클론(git clone https://github.com/nvlabs/Sana.git)하고 추론 가이드를 따르세요. 비디오 생성이 필요하다면 이미 사용 가능한 SANA-Video 파이프라인을 시도해볼 수도 있습니다.