Cosmos3 快速开始¶
为 NVIDIA Cosmos3 训练 LyCORIS LoKr。
模型说明¶
model_family:cosmos3- 默认
model_flavour:nano - 支持的 flavours:
| Flavour | Hub model | Notes |
|---|---|---|
edge |
nvidia/Cosmos3-Edge |
4B edge 全模态模型 |
nano |
nvidia/Cosmos3-Nano |
16B omni model |
super |
nvidia/Cosmos3-Super |
65B omni model |
super-t2i |
nvidia/Cosmos3-Super-Text2Image |
65B text-to-image model |
super-i2v |
nvidia/Cosmos3-Super-Image2Video |
65B image-to-video model, silent video |
- Cosmos3 直接使用 tokenizer ID。
- 正向 prompts 会在 tokenization 中转换为 Cosmos3 JSON captions。
- 负向 prompts 不会转换为 JSON。
- 不要添加
text_embedsbackend。 - 图像和视频样本使用普通 VAE cache。
- 视频 + 音频样本使用普通 VAE cache 和 audio VAE cache。
super-i2v需要 conditioning latents。- 本指南不覆盖 action 和 policy dataset。
Components¶
SimpleTuner 默认使用拆分的 Cosmos3 transformer components:
| Flavour | Reasoner | Generator |
|---|---|---|
edge |
SimpleTuner/cosmos3-component-reasoning-layers-bf16-edge |
SimpleTuner/cosmos3-component-generation-layers-bf16-edge |
nano |
SimpleTuner/cosmos3-component-reasoning-layers-bf16-nano |
SimpleTuner/cosmos3-component-generation-layers-bf16-nano |
super |
SimpleTuner/cosmos3-component-reasoning-layers-bf16-super |
SimpleTuner/cosmos3-component-generation-layers-bf16-super |
super-t2i |
SimpleTuner/cosmos3-component-reasoning-layers-bf16-super-t2i |
SimpleTuner/cosmos3-component-generation-layers-bf16-super-t2i |
super-i2v |
SimpleTuner/cosmos3-component-reasoning-layers-bf16-super-i2v |
SimpleTuner/cosmos3-component-generation-layers-bf16-super-i2v |
- 保持
cosmos3_reasoner_component: auto。 - 保持
cosmos3_generator_component: auto。 - Reasoner outputs 通过 text embed cache path 缓存。
text_cache_disable: true会在 training 中重新运行 frozen reasoner。
Hardware¶
- 从
model_flavour: nano开始。 - 使用
mixed_precision: bf16。 - 从
base_model_precision: no_change开始。 - 保持
train_batch_size: 1。 - 启用
gradient_checkpointing。 - 使用拆分的 generator components 来降低 transformer 加载时内存。
Installation¶
pip install 'simpletuner[cuda]'
# CUDA 13 / Blackwell users
pip install 'simpletuner[cuda13]' --extra-index-url https://download.pytorch.org/whl/cu130
Development install:
Example Configs¶
| Example | Flavour | Dataset | Media | Backend |
|---|---|---|---|---|
cosmos3/nano/default/image.lycoris-lokr |
nano |
RareConcepts/Domokun |
image | multidatabackend-cosmos3-domokun-512px.json |
cosmos3/nano/48g/legacy-image.lycoris-lokr |
nano |
RareConcepts/Domokun |
图像,48 GB 调优 | multidatabackend-cosmos3-domokun-1024-arb.json |
cosmos3/nano/80g/legacy-image.lycoris-lokr |
nano |
RareConcepts/Domokun |
图像,80 GB 调优 | multidatabackend-cosmos3-domokun-1024-arb.json |
cosmos3/nano/default/video.lycoris-lokr |
nano |
sayakpaul/video-dataset-disney-organized |
video | multidatabackend-cosmos3-disney-video-480p+49f.json |
cosmos3/nano/default/video-audio.lycoris-lokr |
nano |
bghira/Synchronised-Drumming-Gemini3Captions |
video + audio | multidatabackend-cosmos3-drumming-video-audio-480p+49f.json |
cosmos3/super-i2v/default/lycoris-lokr |
super-i2v |
sayakpaul/video-dataset-disney-organized |
image-to-video | multidatabackend-cosmos3-disney-i2v-480p+49f.json |
48g 和 80g 图像示例是按显存容量调优的 nano 图像 LoKr 配方变体。两者都使用 1024px 宽高比后端。48g 配置使用 gradient_checkpointing_interval: 2 保留 gradient checkpointing;80g 配置禁用 gradient checkpointing 并启用 flash-attn-3-hub。
Required Fields¶
model_family:cosmos3model_type:loralora_type:lycorisbase_model_precision:no_changemixed_precision:bf16train_batch_size:1gradient_checkpointing:true
Dataset Notes¶
Image¶
- Dataset:
RareConcepts/Domokun - Backend:
config/examples/_shared/multidatabackend-cosmos3-domokun-512px.json - Backend type:
huggingface - Caption strategy:
instanceprompt - Text embed cache: reasoner cache only
- Audio cache: not used
Video¶
- Dataset:
sayakpaul/video-dataset-disney-organized - Backend:
config/examples/_shared/multidatabackend-cosmos3-disney-video-480p+49f.json - Backend type:
huggingface - Columns:
video,prompt - Text embed cache: reasoner cache only
- Audio cache: not used
Video With Audio¶
- Dataset:
bghira/Synchronised-Drumming-Gemini3Captions - Backend:
config/examples/_shared/multidatabackend-cosmos3-drumming-video-audio-480p+49f.json - Backend type:
local - Files:
.mpegvideos with adjacent.txtcaptions - Text embed cache: reasoner cache only
- Audio cache: generated from the video backend
训练前下载 dataset:
huggingface-cli download \
--repo-type=dataset \
bghira/Synchronised-Drumming-Gemini3Captions \
--local-dir datasets/Synchronised-Drumming-Gemini3Captions
Audio backend block:
"audio": {
"auto_split": true,
"sample_rate": 16000,
"channels": 1,
"duration_interval": 3.0,
"allow_zero_audio": false
}
Super-I2V¶
- Dataset:
sayakpaul/video-dataset-disney-organized - Backend:
config/examples/_shared/multidatabackend-cosmos3-disney-i2v-480p+49f.json - Backend type:
huggingface - Columns:
video,prompt video.is_i2v:true- Conditioning type:
reference_strict - Conditioning latents: required
- Audio cache: not used
I2V backend 在 video dataset 上设置:
SimpleTuner 会根据这个 flag 创建 paired strict reference conditioning backend。
Run¶
simpletuner train example=cosmos3/nano/default/image.lycoris-lokr
simpletuner train example=cosmos3/nano/48g/legacy-image.lycoris-lokr
simpletuner train example=cosmos3/nano/80g/legacy-image.lycoris-lokr
simpletuner train example=cosmos3/nano/default/video.lycoris-lokr
simpletuner train example=cosmos3/nano/default/video-audio.lycoris-lokr
simpletuner train example=cosmos3/super-i2v/default/lycoris-lokr
Validation¶
- Image example:
validation_resolution: 512x512 - Video examples:
validation_resolution: 768x432 - Video examples:
validation_num_video_frames: 49 - Super-I2V example: uses conditioning validation inputs.