SimpleTuner Training Script विकल्प¶
Overview¶
यह गाइड SimpleTuner के train.py स्क्रिप्ट में उपलब्ध command‑line विकल्पों का user‑friendly विवरण देती है। ये विकल्प उच्च स्तर का customization देते हैं, जिससे आप मॉडल को अपनी आवश्यकताओं के अनुसार ट्रेन कर सकते हैं।
Kubeflow single‑GPU server विकल्प¶
वैकल्पिक Kubeflow integration GPU admission को Kueue को सौंप देता है और Kubeflow Trainer के माध्यम से एक‑बार उपयोग होने वाले Workers बनाता है। pip install 'simpletuner[kubernetes]' से install करें, फिर Server को cluster के अंदर चलाएँ:
simpletuner server --mode trainer --kubeflow \
--kubeflow-namespace training \
--kubeflow-runtime simpletuner-worker \
--kubeflow-queue gpu-training \
--kubeflow-worker-image registry.example.com/simpletuner:latest \
--kubeflow-orchestrator-url http://simpletuner-server.training.svc:8001
--kubeflow-poll-interval TrainJob reconciliation को नियंत्रित करता है और इसका default पाँच सेकंड है। Cluster administrator TrainingRuntime, Kueue queue, ServiceAccount permissions, image pull configuration और shared model/data storage प्रदान करता है।
JSON Configuration file format¶
अपेक्षित JSON फ़ाइल‑नाम config.json है और key नाम नीचे दिए --arguments जैसे ही हैं। JSON फ़ाइल में अग्रणी -- आवश्यक नहीं है, लेकिन चाहें तो रख सकते हैं।
Ready‑to‑run उदाहरण ढूँढ रहे हैं? simpletuner/examples/README.md में curated presets देखें।
Easy configure script (RECOMMENDED)¶
simpletuner configure कमांड से config.json फ़ाइल को अधिकतर आदर्श डिफ़ॉल्ट सेटिंग्स के साथ सेट किया जा सकता है।
मौजूदा कॉन्फ़िगरेशन बदलना¶
configure कमांड एक ही argument स्वीकार कर सकता है, एक compatible config.json, जिससे आप training setup को इंटरैक्टिव तरीके से बदल सकते हैं:
यहाँ foo आपका config environment है — या यदि आप config environments उपयोग नहीं कर रहे हैं, तो config/config.json का उपयोग करें।
⚠️ जिन देशों में Hugging Face Hub आसानी से उपलब्ध नहीं है, वहाँ के उपयोगकर्ताओं को अपने सिस्टम के
$SHELLके अनुसार~/.bashrcया~/.zshrcमेंHF_ENDPOINT=https://hf-mirror.comजोड़ना चाहिए।
🌟 Core Model Configuration¶
--model_type¶
- What: यह चुनता है कि LoRA या full fine‑tune बनाया जाएगा।
- Choices: lora, full.
- Default: lora
- यदि lora उपयोग हो, तो
--lora_typeतय करता है कि PEFT या LyCORIS उपयोग हो रहा है। कुछ मॉडल (PixArt) केवल LyCORIS adapters के साथ काम करते हैं।
--model_family¶
- What: यह निर्धारित करता है कि कौन‑सा model architecture train किया जा रहा है।
- Choices: pixart_sigma, flux, flux3_image, sd3, sdxl, kolors, legacy
--model_flavour¶
--model_family के भीतर checkpoint का प्रकार चुनता है। qwen_image के लिए डिफ़ॉल्ट v2.1 (Qwen/Qwen-Image-2.1) है। पुराने आर्किटेक्चर को प्रशिक्षित करने के लिए v1.0, v2.0 या मौजूदा edit-* प्रकार स्पष्ट रूप से सेट करें; adapters और embedding/latent कैश 2.1 के साथ अदला-बदली नहीं किए जा सकते। Qwen Image quickstart देखें।
5.6B पैरामीटर वाले इमेज Transformer के लिए model_family: "flux3_image" चुनें। डिफ़ॉल्ट klein-base, black-forest-labs/flux-3-image-klein-base लोड करता है; klein, डिस्टिल्ड black-forest-labs/flux-3-image-klein लोड करता है। डाउनलोड से पहले चुने गए रिपॉज़िटरी की एक्सेस स्वीकार करें। FLUX [Kom]munity लाइसेंस देखें।
moss_image में डिफ़ॉल्ट sft विकल्प OpenMOSS-Team/MOSS-Image-SFT लोड करता है। OpenMOSS-Team/MOSS-Image-Base के लिए model_flavour: "base" चुनें। प्रशिक्षण उदाहरण 512×512 के बराबर क्षेत्र इस्तेमाल करते हैं। MOSS-Image क्विकस्टार्ट देखें।
रेफ़रेंस इमेज के साथ ट्रेन करने के लिए model_flavour: "sft-edit" या "base-edit" चुनें। ये फ़्लेवर संबंधित SFT या Base checkpoint से शुरू होते हैं और आपके adapter के माध्यम से रेफ़रेंस कंडीशनिंग सीखते हैं। simpletuner/examples/moss_image/sft-edit/default/peft-lora या moss_image/base-edit/default/peft-lora से शुरू करें; इनमें प्रति बैच एक लक्ष्य इमेज, 512-स्केल ट्रेनिंग, REPA और डेटासेट वैलिडेशन शामिल हैं।
--lora_format¶
- What: load/save के लिए LoRA checkpoint key format चुनता है।
- Choices:
diffusers(डिफ़ॉल्ट),comfyui - Notes:
diffusersstandard PEFT/Diffusers layout है।comfyuikeys को ComfyUI‑style में convert करता है (diffusion_model.*के साथlora_A/lora_Bऔर.alphatensors)। Flux, Flux2, Lumina2, और Z‑Image ComfyUI inputs को auto‑detect करेंगे भले ही यहdiffusersपर हो, लेकिन saving के लिए ComfyUI output force करने के लिएcomfyuiसेट करें।
--minimax_music_train_component¶
- क्या: चुनता है कि MiniMax Music 3 का कौन सा घटक प्रशिक्षित होगा।
- विकल्प:
transformer(डिफ़ॉल्ट),language_model - नोट्स:
transformerकैश किए गए Flow-VAE latents पर फ्लो-मैचिंग संगीत DiT को प्रशिक्षित करता है (मानक पथ)।language_modelRVQ सिमेंटिक कोड पर नेक्स्ट-टोकन क्रॉस-एंट्रॉपी के साथ Qwen3 ऑटोरिग्रेसिव चरण को प्रशिक्षित करता है।dataset_type=audioके लिए, SimpleTuner VAE cache समय raw waveform को MiniMax Music DAV और default v4 RVQ encoder से कोड में बदलता है। डेटासेट फिर भीprompt(याtags) औरlyricsके साथ पूर्व-गणित कच्चे प्रति-कोडबुक ऑडियो टोकन (audio_tokensयाaudio_tokens_path, आकार[frames, codebooks]) दे सकते हैं। केवल मानक PEFT LoRA समर्थित है,--lora_format comfyuiअस्वीकार किया जाता है, और ट्रेनर के भीतर सत्यापन ऑडियो अक्षम है — सहेजे गए चेकपॉइंट से रेंडर करें।
--minimax_music_lm_max_frames¶
- क्या:
--minimax_music_train_component=language_modelके लिए,prefixऔर अलगrandomwindows को 25Hz audio frames में सीमित करता है। - डिफ़ॉल्ट:
0(पूर्ण ट्रैक पर प्रशिक्षण) - नोट्स:
- एक फ्रेम 40ms का है; 7500 फ्रेम पाँच मिनट हैं।
continuationmode नीचे दिए अलग target-frame और duration settings इस्तेमाल करता है।- काटे गए नमूनों को ऑडियो-समाप्ति लक्ष्य नहीं मिलता, इसलिए मॉडल जल्दी रुकना नहीं सीखता।
--minimax_music_lm_window_mode¶
- क्या: Language-model training sequence कैसे बनेगा, यह चुनता है।
- विकल्प:
prefix(डिफ़ॉल्ट),random,continuation - नोट्स:
prefixट्रैक की शुरुआत लेता है। इससे पूरी lyrics सबसे ज़्यादा उपयुक्त रहती हैं, लेकिन छोटे caps ज़्यादातर intro सिखाते हैं।randomcollate समय एक सतत RVQ window sample करता है, prompt में start/end/duration text जोड़ता है, और cropped windows के लिए full-track lyrics हटा देता है जब तक samplelyrics_windowन दे।continuationसीमित visible span sample करता है और loss केवल उसके अंतिम target frames पर लगाता है।- अलग
randomके लिए positive--minimax_music_lm_max_framesचाहिए;continuationयह option इस्तेमाल नहीं करता।
--minimax_music_lm_target_frames¶
- क्या:
continuationमें अंतिम कितने 25Hz frames पर next-token loss लगेगा। - डिफ़ॉल्ट:
128(एक native RVQ segment, 5.12 सेकंड) - नोट्स: पहले के visible frames causal context रहते हैं और cross-entropy से mask होते हैं।
--minimax_music_lm_continuation_crop_mode¶
- क्या:
continuationvisible span कहाँ से शुरू होगा। - विकल्प:
full(डिफ़ॉल्ट),random - नोट्स:
fullहमेशा song frame zero से शुरू होता है और duration bounds के बीच endpoint sample करता है।randomशुरुआत छोड़ सकता है, लेकिन target से पहले कम-से-कम एक native 128-frame context segment रखता है और prompt में position जोड़ता है।- Positioned random spans full-track lyrics हटाते हैं, जब तक
lyrics_windowन हो। बहुत छोटे tracks full prefix पर fallback करते हैं।
--minimax_music_lm_min_duration_seconds¶
- क्या:
continuationमें model-visible span की न्यूनतम अवधि। - डिफ़ॉल्ट:
5.12 - नोट्स: यह native 128-frame (5.12-second) intervals में ऊपर round होती है। Random spans context segment रखने के लिए इससे लंबे हो सकते हैं।
--minimax_music_lm_max_duration_seconds¶
- क्या: Cached RVQ track बदले बिना
continuationvisible duration को सीमित करता है। - डिफ़ॉल्ट:
0(उपलब्ध track length) - नोट्स:
- Positive limits native 128-frame intervals में नीचे round होते हैं।
randomमें cap के अंदर target और कम-से-कम एक context segment आना चाहिए।- End-of-audio target तभी मिलता है जब sampled span वास्तविक track end तक पहुँचे।
- जब terminal और non-terminal दोनों spans उपलब्ध हों, 25% continuation samples स्पष्ट रूप से वास्तविक track end चुनते हैं। बाकी 75% valid non-terminal endpoints या offsets पर uniform रहते हैं, इसलिए लंबे tracks पर EOS supervision कम नहीं होती।
--minimax_music_rvq_encoder_model_name_or_path¶
- क्या: केवल MiniMax Music
language_modeltraining के लिए: Hub repository या local directory जिसमें RVQ encoder हो, जो cached DAV audio latents को प्रति-codebook audio codes में बदलता है। - डिफ़ॉल्ट:
SimpleTuner/open-rvq-encoder-minimax-music3-169m-v4 - संबंधित:
--minimax_music_rvq_encoder_subfolderका defaultfinalहै;--minimax_music_rvq_encoder_revisionHub revision pin कर सकता है। - नोट्स: Default package में
rvq_encoder_config.json,rvq_encoder.safetensors, और muP base-shape metadata शामिल हैं। इसे केवल तब बदलें जब आप MiniMax Music 3 codebooks के लिए trained compatible RVQ encoder इस्तेमाल कर रहे हों।
--minimax_music_rvq_encoder_subfolder¶
- क्या: RVQ encoder repository या local directory के अंदर subfolder।
- डिफ़ॉल्ट:
final - नोट्स: चुने गए folder में
rvq_encoder_config.json,rvq_encoder.safetensors, और जरूरी muP base-shape metadata होना चाहिए।
--minimax_music_rvq_encoder_revision¶
- क्या:
--minimax_music_rvq_encoder_model_name_or_pathके लिए optional Hub revision। - डिफ़ॉल्ट: unset; जब main
--revisionदिया जाता है तो वही इस्तेमाल होता है। - नोट्स: इसे तब इस्तेमाल करें जब RVQ encoder को MiniMax Music 3 base checkpoint से अलग pin करना हो।
--minimax_music_rvq_vae_model_name_or_path¶
- क्या: केवल MiniMax Music
language_modeltraining के लिए: VAE caching के दौरान RVQ encoder से पहले इस्तेमाल होने वाला DAV/audio VAE repository, local directory, याdav.pthfile। - डिफ़ॉल्ट: unset; पहले
--pretrained_vae_model_name_or_pathइस्तेमाल होता है, फिरSimpleTuner/MiniMax-Music-3-Encoder। - नोट्स: यह waveform से DAV latent बनाने वाला encoder stage है। फिर RVQ encoder उन DAV latents को उस code tensor में बदलता है जिसे global LM predict करना सीखता है।
--minimax_music_lm_adapter¶
- क्या: DiT कंडीशनिंग के प्री-कैश के दौरान Qwen3 योजनाकार पर लागू भाषा-मॉडल LoRA का पथ (
language_model.उपसर्ग कुंजियों वालाpytorch_lora_weights.safetensors,--minimax_music_train_component=language_modelसे निर्मित)। - संबंधित:
--minimax_music_lm_adapter_strength(डिफ़ॉल्ट1.0) अडैप्टर डेल्टा को स्केल करता है। - नोट्स: अडैप्टर या शक्ति बदलते समय नई टेक्स्ट-एम्बेड कैश निर्देशिका उपयोग करें; कैश स्वतः अमान्य नहीं होती।
--minimax_music_lm_precache_mode¶
- क्या: Qwen3 योजनाकार DiT प्रशिक्षण के लिए कैश की गई कंडीशनिंग कैसे बनाता है।
- विकल्प:
text-only(डिफ़ॉल्ट),audio-only,audio+text - नोट्स:
text-onlyकैप्शन और गीत से ऑटोरिग्रेसिव रोलआउट सैंपल करता है (मूल व्यवहार)। छिपी अवस्थाएँ योजनाकार की कल्पित ट्रैक का वर्णन करती हैं, प्रशिक्षण ऑडियो का नहीं।audio-onlyनमूने के वास्तविक RVQ कोड (audio_tokens_pathमेटाडेटा, कच्चे प्रति-कोडबुक सूचकांक) बिना टेक्स्ट उपसर्ग के योजनाकार से टीचर-फोर्स करता है;audio+textकैप्शन और गीत आगे जोड़ता है। दोनों प्रति-फ्रेम छिपी अवस्थाओं को DAV latents के साथ एक-से-एक संरेखित करते हैं और कोड को VAE कैश द्वारा कवर की गई ऑडियो विंडो तक काटते हैं।- मोड बदलते समय नई टेक्स्ट-एम्बेड कैश निर्देशिका उपयोग करें।
--minimax_h3_target_mode¶
- What: MiniMax-H3 target audio rows शामिल करे या नहीं, इसे नियंत्रित करता है।
- Choices:
auto,video,av - Default:
auto - Notes:
autoenabled audio data मिलने परav, अन्यथाvideoमें resolve होता है। Validation भी इसी detected-data default का उपयोग करता है।- auto-split या explicit audio backend को joint audio-video training में opt in करने के लिए data backend entry में
minimax_h3_target_modeयाh3_target_modeकोavसेट करें।
--minimax_h3_sparse_attention¶
- What: MiniMax-H3 target-video tokens के लिए experimental train-aware 3D block sparse attention enable करता है।
- Choices:
disabled,moba3d - Default:
disabled - Related options:
minimax_h3_sparse_block_shape: comma याxसे separated(T,H,W)dimensions जिनका product 128 हो। Default:1,8,16।minimax_h3_sparse_video_kv_fraction: हर target-video query block के लिए चुने जाने वाले target-video KV blocks का fraction। Default:0.5।minimax_h3_sparse_share_heads: attention heads के बीच routes share करता है। Default:false।minimax_h3_sparse_start_layer: इससे पहले की transformer layers dense attention पर रखता है। Default:0।- Notes:
- Text, audio, reference context, और non-target queries dense रहते हैं।
- CUDA FlexAttention चाहिए। Ulysses context parallelism
context_parallel_strategy=alltoallके साथ supported है; ring context parallelism और TREAD incompatible हैं। - MiniMax ने H3 का exact sparse routing config release नहीं किया है। यह approximation controlled fine-tuning experiments के लिए है और performance improvement guarantee नहीं करता।
--fuse_qkv_projections¶
- What: मॉडल के attention blocks में QKV projections को fuse करता है ताकि hardware का अधिक कुशल उपयोग हो।
- Note: केवल NVIDIA H100 या H200 पर उपलब्ध है जब Flash Attention 3 मैन्युअली install हो।
--offload_during_startup¶
- What: VAE caching चलने के दौरान text encoder weights को CPU पर offload करता है।
- Why: HiDream और Wan 2.1 जैसे बड़े मॉडल्स में VAE cache लोड करते समय OOM हो सकता है। यह विकल्प training quality को प्रभावित नहीं करता, लेकिन बहुत बड़े text encoders या धीमे CPUs के साथ, कई datasets पर startup time काफ़ी बढ़ सकता है। इसी कारण यह डिफ़ॉल्ट रूप से disabled है।
--offload_during_save¶
- What:
save_hooks.pycheckpoints तैयार करते समय पूरे pipeline को अस्थायी रूप से CPU पर ले जाता है ताकि सभी FP8/quantized weights device से बाहर लिखे जाएँ। - Why: fp8‑quanto weights सेव करने पर VRAM उपयोग अचानक बढ़ सकता है (उदा.,
state_dict()serialization के दौरान)। यह विकल्प training के लिए मॉडल को accelerator पर रखता है, लेकिन save trigger होने पर थोड़ी देर के लिए offload करता है ताकि CUDA OOM से बचा जा सके। - Tip: केवल तब सक्षम करें जब saving OOM errors दे रही हो; loader बाद में मॉडल वापस ले आता है ताकि training seamless रहे।
--delete_model_after_load¶
- What: मॉडल files को HuggingFace cache से delete करता है जब वे memory में load हो जाते हैं।
- Why: उन सेटअप्स में disk usage घटाता है जहाँ GB के हिसाब से billing होती है। मॉडल VRAM/RAM में लोड हो जाने के बाद on‑disk cache अगली run तक आवश्यक नहीं रहता। यह भार storage से network bandwidth पर शिफ्ट करता है अगली रन में।
- Notes:
- यदि validation सक्षम है तो VAE delete नहीं होगा, क्योंकि validation images बनाने के लिए इसकी आवश्यकता है।
- Text encoders को data backend factory के startup पूरा होने के बाद delete किया जाता है (embed caching के बाद)।
- Transformer/UNet मॉडल्स load होने के तुरंत बाद delete होते हैं।
- Multi‑node setups में, हर node पर केवल local‑rank 0 deletion करता है। Shared network storage पर race conditions संभालने के लिए deletion failures silently ignore की जाती हैं।
- यह saved training checkpoints पर प्रभाव नहीं डालता — केवल pre‑trained base model cache पर लागू होता है।
--text_embed_full_cache¶
- What: text embed cache में पूरा raw text encoder output store करता है।
- Default:
False - Why: default setting model-specific compact cache layouts को allow करती है। उदाहरण के लिए, Ideogram 4 cache files लिखने से पहले अपने 13-layer Qwen hidden-state stack को transformer की frozen
llm_cond_normऔरllm_cond_projlayers से project करता है; ये layers LoRA और full transformer training दोनों में frozen रहती हैं। - When to use: cache compatibility debugging के लिए, जब आपको raw unprojected text encoder features चाहिए हों, या जब आप Ideogram-style architecture को scratch training के लिए adapt कर रहे हों और text projection fixed pretrained component न हो।
--text_cache_ondemand¶
- What: पूरे text cache की pre-computation छोड़ता है और training या validation द्वारा माँगे जाने पर missing prompt embeddings encode करता है।
- Default:
False - Behavior: मौजूदा cache entries पढ़ी जाती हैं और नए encoded misses लिखे जाते हैं। Startup के बाद आवश्यकता होने के कारण text encoders loaded रहते हैं।
- Dataloader override: कोई
text_embedsbackend इसे"text_cache_ondemand": trueसे independently enable कर सकता है।
--cosmos3_reasoner_component¶
- What: frozen Cosmos3 reasoner component के लिए Hugging Face repo id या local path।
- Default:
auto - Use: Cosmos3 text cache इस component से per-layer reasoner K/V entries लिखता है।
- Auto choices:
SimpleTuner/cosmos3-component-reasoning-layers-bf16-edge,SimpleTuner/cosmos3-component-reasoning-layers-bf16-nano,SimpleTuner/cosmos3-component-reasoning-layers-bf16-super,SimpleTuner/cosmos3-component-reasoning-layers-bf16-super-i2v,SimpleTuner/cosmos3-component-reasoning-layers-bf16-super-t2i. - Note: Cosmos3 on-demand text cache force करता है क्योंकि reasoner cache keys में sample geometry शामिल होती है।
--cosmos3_generator_component¶
- What: Cosmos3 generation-only transformer component के लिए Hugging Face repo id या local path।
- Default:
auto - Use:
automatching Edge, Nano, Super, Super-I2V, या Super-T2I component चुनता है। - Auto choices:
SimpleTuner/cosmos3-component-generation-layers-bf16-edge,SimpleTuner/cosmos3-component-generation-layers-bf16-nano,SimpleTuner/cosmos3-component-generation-layers-bf16-super,SimpleTuner/cosmos3-component-generation-layers-bf16-super-i2v,SimpleTuner/cosmos3-component-generation-layers-bf16-super-t2i. - Note: यह component transformer के अंदर के reasoner weights हटाता है और reasoner K/V entries require करता है।
--text_cache_disable¶
- What: मौजूदा entries को पढ़ते हुए सभी text embedding cache writes disable करता है।
- Default:
False - Behavior:
--text_cache_ondemandको implicitly enable करता है; missing embeddings request पर encode होते हैं लेकिन store नहीं होते। - Dataloader override: global option false होने पर individual
text_embedsbackends इसे"text_cache_disable": trueसे enable कर सकते हैं।
--trust_remote_code¶
- What: जब checkpoint upstream custom classes पर निर्भर हो, तब Transformers और tokenizer को model repository से custom Python code चलाने की अनुमति देता है।
- Default:
False - Why: ACE-Step v1.5 checkpoints के लिए आवश्यक है, क्योंकि upstream repository में custom
AutoModelऔर tokenizer code शामिल है। - Warning: इसे केवल उन्हीं model repositories के लिए सक्षम करें जिन पर आप भरोसा करते हैं।
--diffusion_blocks_config¶
- What: Diffusion Transformer block-wise training enable करने वाला JSON object या JSON file path।
- Required key:
layers_per_blockहर noise range में चलने वाली consecutive denoiser layers की अधिकतम संख्या तय करता है। - Optional keys:
overlap(default0.05),blocks_to_train,block_paths, औरtimestep_boundaries। - Behavior: हर batch में एक noise block sample करता है, केवल उसका layer group चलाता है, और DDP unused-parameter detection अपने आप enable करता है।
- Limits: केवल Transformer denoisers। DiffusionBlocks देखें।
--musubi_blocks_to_swap¶
- What: LongCat‑Video, Wan, LTXVideo, Kandinsky5‑Video, Qwen‑Image, Flux, Flux.2, zlab i1, Cosmos2Image, HunyuanVideo, और Krea 2 के लिए Musubi block swap — आख़िरी N transformer blocks को CPU पर रखें और forward के दौरान प्रति block weights stream करें।
- Default:
0(disabled) - Notes: Musubi‑style weight offload; throughput लागत पर VRAM कम करता है और gradients सक्षम होने पर skip हो जाता है।
--musubi_block_swap_device¶
- What: swapped transformer blocks को स्टोर करने के लिए device string (उदा.
cpu,cuda:0)। - Default:
cpu - Notes: केवल तब उपयोग होता है जब
--musubi_blocks_to_swap> 0 हो।
--ramtorch¶
- What:
nn.Linearlayers को RamTorch CPU‑streamed implementations से replace करता है। - Why: Linear weights को CPU memory में साझा करता है और उन्हें accelerator पर stream करता है ताकि VRAM pressure कम हो।
- Notes:
- CUDA या ROCm आवश्यक है (Apple/MPS पर समर्थित नहीं)।
--set_grads_to_noneस्वतः सक्षम करता है।
--ramtorch_target_modules¶
- What: Comma‑separated glob patterns जो यह सीमित करते हैं कि कौन‑से Linear modules को RamTorch में बदला जाए।
- Default: यदि कोई pattern नहीं दिया गया, तो सभी Linear layers convert होती हैं।
- Notes:
fnmatchglob syntax का उपयोग करके fully qualified module names या class names को match करता है।- किसी block के अंदर की layers को match करने के लिए patterns में trailing
.*wildcard शामिल होना चाहिए। उदाहरण के लिए,transformer_blocks.0.*block 0 के अंदर सभी layers को match करता है, जबकिtransformer_blocks.*सभी transformer blocks को match करता है।transformer_blocks.0जैसा bare name बिना.*के भी काम करेगा (यह automatically expand होता है), लेकिन clarity के लिए explicit wildcard form recommended है। - उदाहरण:
"transformer_blocks.*,single_transformer_blocks.0.*,single_transformer_blocks.1.*"
--ramtorch_text_encoder¶
- What: सभी text encoder Linear layers पर RamTorch replacements लागू करता है।
- Default:
False
--ramtorch_vae¶
- What: VAE mid‑block Linear layers के लिए experimental RamTorch conversion।
- Default:
False - Notes: VAE up/down convolutional blocks unchanged रहते हैं।
--ramtorch_controlnet¶
- What: ControlNet training के दौरान ControlNet Linear layers पर RamTorch replacements लागू करता है।
- Default:
False
--ramtorch_transformer_percent¶
- What: RamTorch के साथ offload करने के लिए transformer Linear layers का प्रतिशत (0-100)।
- Default:
100(सभी eligible layers) - Why: VRAM बचत और performance के बीच संतुलन के लिए partial offloading की अनुमति देता है। कम values GPU पर अधिक layers रखती हैं जिससे training तेज होती है जबकि memory usage भी कम होती है।
- Notes: Layers module traversal order की शुरुआत से select की जाती हैं।
--ramtorch_target_modulesके साथ combine किया जा सकता है।
--ramtorch_text_encoder_percent¶
- What: RamTorch के साथ offload करने के लिए text encoder Linear layers का प्रतिशत (0-100)।
- Default:
100(सभी eligible layers) - Why: जब
--ramtorch_text_encoderenabled हो तब text encoders की partial offloading की अनुमति देता है। - Notes: केवल तब लागू होता है जब
--ramtorch_text_encoderenabled हो।
--ramtorch_disable_sync_hooks¶
- What: RamTorch layers के बाद add किए गए CUDA synchronization hooks को disable करता है।
- Default:
False(sync hooks enabled) - Why: Sync hooks RamTorch के ping-pong buffering system में race conditions को fix करते हैं जो non-deterministic outputs का कारण बन सकते हैं। Disable करने से performance बेहतर हो सकता है लेकिन incorrect results का risk है।
- Notes: केवल तब disable करें जब sync hooks में समस्या हो या उनके बिना test करना हो।
--ramtorch_disable_extensions¶
- What: केवल Linear layers पर RamTorch apply करता है, Embedding/RMSNorm/LayerNorm/Conv को skip करता है।
- Default:
True(extensions disabled) - Why: SimpleTuner RamTorch को Linear layers से आगे बढ़ाकर Embedding, RMSNorm, LayerNorm, और Conv layers को include करता है। इन extensions को disable करके केवल Linear layers offload करने के लिए इसका उपयोग करें।
- Notes: VRAM savings कम हो सकती है लेकिन extended layer types की समस्याओं को debug करने में मदद कर सकता है।
--pretrained_model_name_or_path¶
- What: pretrained model का path या https://huggingface.co/models से उसका identifier.
- Why: उस base model को निर्दिष्ट करने के लिए जिससे training शुरू होगी। Repository से specific versions चुनने के लिए
--revisionऔर--variantउपयोग करें। यह SDXL, Flux, और SD3.x के लिए single‑file.safetensorspaths भी सपोर्ट करता है।
--pretrained_transformer_model_name_or_path¶
- What: pretrained transformer weights का optional path या https://huggingface.co/models से उनका identifier.
- Default:
None(जो loaders इस override को support करते हैं उनमें transformer source--pretrained_model_name_or_pathसे जुड़ा रहता है) - Why: जब transformer component base model package से अलग repository, local folder, या checkpoint में हो तब इसका उपयोग करें।
- Notes: अगर transformer weights उस path के subfolder में हैं, तो इसे
--pretrained_transformer_subfolderके साथ उपयोग करें।
--pretrained_t5_model_name_or_path¶
- What: pretrained T5 model का path या https://huggingface.co/models से उसका identifier.
- Why: PixArt ट्रेन करते समय आप अपने T5 weights के लिए कोई specific source चुनना चाह सकते हैं ताकि base model switch करने पर बार‑बार download न करना पड़े।
--pretrained_gemma_model_name_or_path¶
- What: pretrained Gemma model का path या https://huggingface.co/models से उसका identifier.
- Why: Gemma‑based models (जैसे LTX-2, Sana, Lumina2) ट्रेन करते समय आप base diffusion model path बदले बिना Gemma weights का source specify कर सकते हैं।
--qwen_text_encoder_model_name_or_path¶
- What: pretrained Qwen text encoder model का path या https://huggingface.co/models से उसका identifier.
- Default:
None(selected model में defined Qwen text encoder source उपयोग होता है). - Why: Qwen-based model families में Qwen text encoder को share या replace करने के लिए इसका उपयोग करें, बिना Hugging Face cache edit किए।
- Notes: यह उन model families पर लागू होता है जिनमें एक Qwen text encoder है। अगर कोई model family multiple Qwen encoders define करती है, तो option ignore होता है और SimpleTuner warning log करता है।
--max_grounding_entities¶
- GLIGEN-style spatial annotations के लिए प्रति image grounding entities की अधिकतम संख्या। Default: 0 (disabled)। सामान्य मान: 4-16।
--pretrained_grounding_model_name_or_path¶
- प्रति entity image feature extraction के लिए वैकल्पिक pretrained model। Default: None।
--custom_text_encoder_intermediary_layers¶
- What: FLUX.2 models के लिए text encoder से extract होने वाली hidden state layers को override करें।
- Format: Layer indices का JSON array, जैसे
[10, 20, 30] - Default: सेट न होने पर model-specific defaults उपयोग होते हैं:
- FLUX.2-dev (Mistral-3):
[10, 20, 30] - FLUX.2-klein (Qwen3):
[9, 18, 27] - Why: Custom alignment या research के लिए विभिन्न text encoder hidden state combinations के साथ experiment करने की सुविधा देता है।
- Note: यह option experimental है और केवल FLUX.2 models पर लागू होता है। Layer indices बदलने से cached text embeddings invalid हो जाएंगे और regenerate करने होंगे। Layers की संख्या model की expected input (3 layers) से match होनी चाहिए।
--gradient_checkpointing¶
- What: Training के दौरान gradients layerwise compute होकर accumulate होते हैं ताकि peak VRAM कम हो, लेकिन training धीमी होती है।
--gradient_checkpointing_interval¶
- What: Transformer block checkpointing के लिए model-dependent interval। 1 का मान लगभग
--gradient_checkpointingenabled जैसा है। - Note: Flux, Flux.2, Flux.3 Image Klein, Krea 2, LTXVideo2, MageFlow, Qwen Image 2.1, Z-Image, और Wan whole-block paths पर n contiguous block chunks use करते हैं। इस option को expose करने वाली दूसरी families अभी भी पुराने "हर n-th block checkpoint" behavior का उपयोग कर सकती हैं। बड़े contiguous groups कम boundary states सहेजते हैं, लेकिन checkpoint किए गए blocks फिर भी recompute होते हैं। गति और peak memory का संतुलन मापें; Segmented Checkpointing देखें।
--gradient_checkpointing_segment_stride¶
- What: Supported segmented whole-block paths पर हर n blocks में checkpointed segment शुरू करें।
- Example:
--gradient_checkpointing_interval=2और--gradient_checkpointing_segment_stride=4के साथ SimpleTuner दो blocks checkpoint करता है, अगले दो blocks normally चलाता है, और repeat करता है। - Note: यह केवल उन model families पर प्रभावी होता है जो installed SimpleTuner version में segmented whole-block support expose करती हैं। Unsupported families warning log करती हैं और value ignore करती हैं। stride interval से कम नहीं हो सकता। Segmented Checkpointing देखें।
--gradient_checkpointing_backend¶
- Choices:
torch,torch-ffn,unsloth,unsloth-ffn - What: Gradient checkpointing के लिए implementation और scope चुनें।
torch(default): पूरे supported block को checkpoint करता है और backward में activations recompute करता है।torch-ffn: साफ FFN boundary वाले models पर केवल feed-forward side checkpoint करता है।unsloth: पूरे supported block को checkpoint करता है और saved tensors CPU पर offload करता है।unsloth-ffn: केवल feed-forward side checkpoint करता है और उसके saved tensors CPU पर offload करता है।- Note: केवल
--gradient_checkpointingenabled होने पर प्रभावी।unslothvariants के लिए CUDA आवश्यक है। FFN-only variants अभी Chroma, Flux, Krea 2, LTXVideo2, MageFlow, Wan, और Z-Image support करते हैं, और unsupported scope पर साफ error मिलता है। Measured tradeoffs के लिए Unsloth-style checkpointing देखें।
--gradient_checkpointing_offload_attention¶
- What: साफ attention/FFN boundary वाले models पर attention-side saved activations CPU पर offload करें।
- Why: जब transfer attention recompute से सस्ता हो, तो full attention rematerialization cost दिए बिना VRAM घट सकती है।
- Note: इसे अकेले enable किया जा सकता है। Model जिस भी checkpoint backend को support करे, उसके साथ भी combine किया जा सकता है। यह केवल उन model families पर प्रभावी होता है जो installed SimpleTuner version में साफ attention/FFN boundary expose करती हैं; unsupported model families साफ error देती हैं।
--gradient_checkpointing_offload_pin_memory_max_buckets¶
- Default:
12 - What: activation offload द्वारा इस्तेमाल किए जाने वाले अलग-अलग pinned CPU tensor buckets की maximum संख्या।
- Why: pinned memory CPU/GPU transfer में मदद करती है, लेकिन variable resolution और text length rare tensor shapes बना सकते हैं। limit पूरी होने के बाद नए bucket shapes normal CPU memory use करेंगे।
- Note: activation offload के pinned-memory pooling को बंद करने के लिए
0set करें।
--gradient_checkpointing_offload_prefetch¶
- Default:
false - What: offloaded activations के backward restore order को learn करके likely next tensor को GPU पर prefetch करता है।
- Why: JIT H2D restore अक्सर overlap नहीं कर पाता। order stable होने के बाद prefetch transfer के कुछ हिस्से को backward compute के पीछे छिपा सकता है।
- Note: Experimental है और केवल
--gradient_checkpointing_offload_attentionके साथ active होता है।
--refiner_training¶
- What: custom mixture‑of‑experts मॉडल श्रृंखला training सक्षम करता है। इन विकल्पों पर अधिक जानकारी के लिए Mixture-of-Experts देखें।
Precision¶
--quantize_via¶
- Choices:
cpu,accelerator,pipeline acceleratorपर यह मध्यम रूप से तेज़ हो सकता है लेकिन Flux जैसे बड़े मॉडल के लिए 24G cards पर OOM का जोखिम रहता है।cpuपर quantisation में लगभग 30 seconds लगते हैं। (Default)pipelineDiffusers को--quantization_configया pipeline‑capable presets (उदा.nf4-bnb,int8-torchao,fp8-torchao,int8-quanto, या.ggufcheckpoints) के साथ quantization delegate करता है।
--base_model_precision¶
- What: model precision घटाएँ और कम memory में training करें। तीन समर्थित quantisation backends हैं: BitsAndBytes (pipeline), TorchAO (pipeline या manual), और Optimum Quanto (pipeline या manual)।
Diffusers pipeline presets¶
nf4-bnbDiffusers के माध्यम से 4‑bit NF4 BitsAndBytes config के साथ लोड होता है (CUDA only)।bitsandbytesऔर BnB support वाली diffusers build आवश्यक है।int4-torchao,int8-torchao,fp8-torchao, औरfp8wo-torchaoDiffusers के माध्यम से TorchAoConfig का उपयोग करते हैं (CUDA)।torchaoऔर recent diffusers/transformers आवश्यक है।int8-quanto,int4-quanto,int2-quanto,fp8-quanto, औरfp8uz-quantoDiffusers के माध्यम से QuantoConfig का उपयोग करते हैं। Diffusers FP8-NUZ को float8 weights पर map करता है; NUZ variant के लिए manual quanto quantization उपयोग करें।.ggufcheckpoints auto‑detect होकर उपलब्ध होने परGGUFQuantizationConfigके साथ लोड होते हैं। GGUF support के लिए recent diffusers/transformers install करें।
Optimum Quanto¶
Hugging Face द्वारा प्रदान की गई optimum‑quanto लाइब्रेरी सभी समर्थित प्लेटफ़ॉर्म्स पर मजबूत समर्थन देती है।
int8-quantoसबसे व्यापक रूप से compatible है और संभवतः सर्वोत्तम परिणाम देता है- RTX4090 और संभवतः अन्य GPUs पर सबसे तेज़ training
- CUDA devices पर int8, int4 के लिए hardware‑accelerated matmul उपयोग करता है
- int4 अभी भी बहुत धीमा है
TRAINING_DYNAMO_BACKEND=inductor(torch.compile()) के साथ काम करता हैfp8uz-quantoCUDA और ROCm devices के लिए experimental fp8 variant है।- Instinct या नई architecture वाले AMD silicon पर बेहतर supported
- 4090 पर training में
int8-quantoसे थोड़ा तेज़ हो सकता है, लेकिन inference में नहीं (1 second धीमा) TRAINING_DYNAMO_BACKEND=inductor(torch.compile()) के साथ काम करता हैfp8-quantoफिलहाल fp8 matmul उपयोग नहीं करेगा, Apple systems पर काम नहीं करता।- CUDA या ROCm पर hardware fp8 matmul अभी नहीं है, इसलिए संभवतः int8 से काफी धीमा होगा
- fp8 GEMM के लिए MARLIN kernel उपयोग करता है
- dynamo के साथ असंगत, इस संयोजन की कोशिश होने पर dynamo स्वतः disabled हो जाएगा।
TorchAO¶
PyTorch की एक नई लाइब्रेरी, AO हमें linears और 2D convolutions (उदा. unet style models) को quantised counterparts से बदलने देती है।
int8-torchaomemory consumption को Quanto के precision levels जैसा कम कर देता है- लिखते समय, Apple MPS पर Quanto (9s/iter) की तुलना में थोड़ा धीमा (11s/iter)
torch.compileउपयोग न करने पर CUDA devices परint8-quantoजैसी speed और memory, ROCm पर speed profile अज्ञातtorch.compileउपयोग करने परint8-quantoसे धीमाfp8-nativeandfp8-torchaoके लिए FP8 scaled matmul support वाले Ada Lovelace (RTX 40/L40S), Hopper (H100/H200), या newer accelerators चाहिएfp8-transformerengineeligible Linear layers को TransformerEngine FP8 modules से बदलता है और model forward को TE FP8 autocast से wrap करता है।pip install 'simpletuner[transformerengine]'से install करें; यह preset Ada Lovelace, Hopper, या newer CUDA accelerators के लिए है।
Optimisers¶
TorchAO में सामान्य 4bit और 8bit optimisers हैं: ao-adamw8bit, ao-adamw4bit
यह Hopper (H100 या बेहतर) users के लिए दो optimisers भी देता है: ao-adamfp8, और ao-adamwfp8
SDNQ (SD.Next Quantization Engine)¶
SDNQ एक training‑optimized quantization लाइब्रेरी है जो सभी प्लेटफ़ॉर्म्स पर काम करती है: AMD (ROCm), Apple (MPS), और NVIDIA (CUDA)। यह stochastic rounding और quantized optimizer states के साथ memory‑efficient quantized training प्रदान करती है।
Recommended Precision Levels¶
Full finetuning के लिए (model weights update होती हैं):
- uint8-sdnq - memory बचत और training quality का सबसे अच्छा संतुलन
- uint16-sdnq - अधिकतम quality के लिए उच्च precision (उदा. Stable Cascade)
- int16-sdnq - signed 16‑bit विकल्प
- fp16-sdnq - quantized FP16, SDNQ लाभों के साथ अधिकतम precision
- fp8-sdnq - SDNQ native FP8 matmul के साथ FP8 weights, H100/H200 class accelerators के लिए
LoRA training के लिए (base model weights frozen):
- int8-sdnq - signed 8‑bit, अच्छा general purpose विकल्प
- int6-sdnq, int5-sdnq - lower precision, छोटा memory footprint
- uint5-sdnq, uint4-sdnq, uint3-sdnq, uint2-sdnq - aggressive compression
Note: int7-sdnq उपलब्ध है लेकिन अनुशंसित नहीं (धीमा और int8 से बहुत छोटा नहीं)।
Important: 5‑bit से नीचे SDNQ गुणवत्ता बनाए रखने के लिए स्वतः SVD (Singular Value Decomposition) को 8 steps के साथ सक्षम करता है। SVD quantize करने में अधिक समय लेता है और non‑deterministic है, इसलिए Disty0 HuggingFace पर pre‑quantized SVD मॉडल देता है। SVD training के दौरान compute overhead जोड़ता है, इसलिए full finetuning में (जहाँ weights सक्रिय रूप से update होती हैं) इससे बचें।
Key features: - Cross‑platform: AMD, Apple, और NVIDIA हार्डवेयर पर समान रूप से काम करता है - Training‑optimized: stochastic rounding से quantization error accumulation कम होता है - Memory efficient: quantized optimizer state buffers सपोर्ट करता है - Decoupled matmul: weight precision और matmul precision स्वतंत्र हैं (INT8/FP8/FP16 matmul उपलब्ध)
SDNQ Native Matmul Options¶
--sdnq_weights_dtype- SDNQ storage dtype override करें, जैसेfloat8_e4m3fn,int8, याuint4।--sdnq_quantized_matmul_dtype- Matmul dtype:auto,int8,float8_e4m3fn,fp8,float16, याfp16।--sdnq_group_size- Quantization group size। पूरे tensor/static matmul के लिए-1;fp8-sdnqdefault-1है।--sdnq_use_quantized_matmul- SDNQ quantized matmul enable/disable करें। Unset होने पर,fp8-sdnqnative FP8 matmul तभी इस्तेमाल करता है जब SDNQ compile mode और FP8 matmul support दोनों available हों; दूसरे presets SDNQ compile availability follow करते हैं।--sdnq_compile_mode-auto,compile, याeager। SDNQ के internaltorch.compileuse को control करता है। SDNQ currently quantized matmul के लिए compile mode require करता है; eager mode dequantized matmul use करता है।--sdnq_use_static_quantization,--sdnq_use_stochastic_rounding,--sdnq_dequantize_fp32- SDNQ training quantization defaults override करें।--sdnq_use_svd,--sdnq_svd_rank,--sdnq_svd_steps- Low-bit SDNQ presets के लिए SVDQuant configure करें।--sdnq_use_hadamard,--sdnq_hadamard_group_size- SDNQ Hadamard rotation enable/configure करें।--sdnq_modules_to_not_convert,--sdnq_modules_to_not_use_matmul- JSON array, file path, या comma-separated module patterns।--sdnq_modules_dtype_dict,--sdnq_modules_quant_config- Per-module dtype और quantization overrides के JSON objects या file paths।
SDNQ Optimisers¶
SDNQ में अतिरिक्त memory बचत के लिए optional quantized state buffers वाले optimizers शामिल हैं:
sdnq-adamw- AdamW with quantized state buffers (uint8, group_size=32)sdnq-adamw+no_quant- बिना quantized states के AdamW (comparison के लिए)sdnq-adafactor- quantized state buffers के साथ Adafactorsdnq-came- quantized state buffers के साथ CAME optimizersdnq-lion- quantized state buffers के साथ Lion optimizersdnq-muon- quantized state buffers के साथ Muon optimizersdnq-muon+quantized_matmul- zeropower computation में INT8 matmul के साथ Muon
सभी SDNQ optimizers डिफ़ॉल्ट रूप से stochastic rounding उपयोग करते हैं और custom settings के लिए --optimizer_config के साथ कॉन्फ़िगर किए जा सकते हैं, जैसे use_quantized_buffers=false जिससे state quantization बंद हो जाती है।
Muon‑specific options:
- use_quantized_matmul - zeropower_via_newtonschulz5 में INT8/FP8/FP16 matmul सक्षम करें
- quantized_matmul_dtype - matmul precision: int8 (consumer GPUs), fp8 (datacenter), fp16
- zeropower_dtype - zeropower computation के लिए precision (जब use_quantized_matmul=True हो तब ignore)
- Muon बनाम AdamW fallback के लिए अलग values सेट करने हेतु args को muon_ या adamw_ prefix करें
Pre‑quantized models: Disty0 pre‑quantized uint4 SVD models huggingface.co/collections/Disty0/sdnq पर देता है। इन्हें सामान्य रूप से लोड करें, फिर SDNQ import करने के बाद convert_sdnq_model_to_training() से convert करें (register करने के लिए loading से पहले SDNQ import होना चाहिए)।
Note on checkpointing: SDNQ training models को training resumption के लिए native PyTorch format (.pt) और inference के लिए safetensors format दोनों में सेव किया जाता है। Proper training resumption के लिए native format आवश्यक है क्योंकि SDNQ की SDNQTensor class custom serialization उपयोग करती है।
Disk space tip: disk space बचाने के लिए आप केवल quantized weights रख सकते हैं और inference के लिए ज़रूरत पड़ने पर SDNQ की dequantize_sdnq_training.py script से dequantize कर सकते हैं।
--quantization_config¶
- What:
--quantize_via=pipelineउपयोग करते समय Diffusersquantization_configoverrides का JSON object या file path. - How: inline JSON (या file) स्वीकार करता है जिसमें per‑component entries हों। Keys में
unet,transformer,text_encoder, याdefaultशामिल हो सकते हैं। - Examples:
{
"unet": {"load_in_4bit": true, "bnb_4bit_quant_type": "nf4", "bnb_4bit_compute_dtype": "bfloat16"},
"text_encoder": {"quant_type": {"group_size": 128}}
}
यह उदाहरण UNet पर 4‑bit NF4 BnB और text encoder पर TorchAO int4 सक्षम करता है।
Torch Dynamo¶
WebUI से torch.compile() सक्षम करने के लिए Hardware → Accelerate (advanced) पर जाएँ और Torch Dynamo Backend को अपने पसंदीदा compiler (उदा. inductor) पर सेट करें। अतिरिक्त toggles आपको optimisation mode चुनने, dynamic shape guards सक्षम करने, या regional compilation opt‑in करने देते हैं ताकि बहुत गहरे transformer models पर cold starts तेज़ हो सकें।
वही कॉन्फ़िगरेशन config/config.env में इस तरह व्यक्त की जा सकती है:
आप इसे वैकल्पिक रूप से --dynamo_mode=max-autotune या UI में उपलब्ध अन्य Dynamo flags के साथ pair कर सकते हैं ताकि finer control मिले।
ध्यान दें कि training के पहले कई steps सामान्य से धीमे होंगे क्योंकि compilation background में हो रही होती है।
Settings को config.json में persist करने के लिए समान keys जोड़ें:
{
"dynamo_backend": "inductor",
"dynamo_mode": "max-autotune",
"dynamo_fullgraph": false,
"dynamo_dynamic": false,
"dynamo_use_regional_compilation": true
}
यदि आप Accelerate defaults inherit करना चाहते हैं तो संबंधित entries छोड़ दें (उदा., dynamo_mode न दें ताकि automatic selection उपयोग हो)।
--dynamo_wrapper¶
TorchInductor का host wrapper चुनता है। cpp default है और dispatch overhead घटाता है; python पुराने releases का behavior बनाए रखता है। यह चयन Mega-Cache filename और manifest में शामिल होता है।
--dynamo_cache_export¶
PyTorch Mega-Cache के cumulative blob की optional path। SimpleTuner compilation से पहले compatible blob load करता है, पहले सफल optimizer step के बाद export करता है, और हर checkpoint तथा shutdown पर नई artifact keys की जांच करता है। <path>.manifest.json में PyTorch/Triton/GPU runtime और SHA256 दर्ज होते हैं। किसी नई shape के लिए cache entry न मिलने पर PyTorch सामान्य compilation करता है और अगला export नए artifacts जोड़ देता है। केवल trusted cache blobs load करें।
यदि value directory है, separator पर समाप्त होती है, या उसकी extension नहीं है, तो SimpleTuner model, runtime, accelerator और graph-relevant config से stable filename बनाता है और Hub पर भी वही नाम खोजता है।
--dynamo_cache_export_after_first_step¶
true (default) होने पर पहले सफल optimizer step के बाद Mega-Cache export होती है। केवल इस early export को छोड़ने के लिए false करें; checkpoint और final exports सक्रिय रहते हैं।
--dynamo_hub_repo_id¶
--dynamo_cache_export blob को retrieve और publish करने के लिए optional Hugging Face repository। Blob और manifest एक ही commit में upload होते हैं; missing repository private रूप में बनाई जाती है। Hub failure training को abort नहीं करता और local export सुरक्षित रहता है।
--attention_mechanism¶
Alternative attention mechanisms समर्थित हैं, जिनके compatibility स्तर या trade‑offs अलग होते हैं:
diffusersPyTorch के native SDPA kernels उपयोग करता है।xformersMeta के xformers attention kernel (training + inference) सक्षम करता है, जब underlying मॉडलenable_xformers_memory_efficient_attentionexpose करता है।flash-attn,flash-attn-2,flash-attn-3, औरflash-attn-3-varlenDiffusers के नएattention_backendhelper के जरिए FlashAttention v½/3 kernels में route करते हैं। संबंधितflash-attn/flash-attn-interfacewheels install करें और ध्यान दें कि FA3 फिलहाल Hopper GPUs की मांग करता है।flexPyTorch 2.5 का FlexAttention backend चुनता है (CUDA पर FP16/BF16)। आपको Flex kernels अलग से compile/install करने होंगे — देखें documentation/attention/FLEX.md।kohaku-faSM86 Ampere GPU (RTX 30 सीरीज़/A40), Ada GPU (RTX 40 सीरीज़/L40S, sm_89), H100 (sm_90) और RTX Blackwell (sm_120) पर स्थानीय CuTe कर्नेल तथा B200/B300 (sm_100/sm_103) पर शामिल KohakuFA कर्नेल उपयोग करता है। CuTe के लिएpip install "simpletuner[attention-cute]"चलाएँ: PyTorch >= 2.11, CUTLASS DSL >= 4.8, TVM FFI >= 0.1.14, Ninja >= 1.11 और C++17 कंपाइलर आवश्यक हैं। नेटिव एक्सटेंशन पहली बार उपयोग करने पर बनता है। B200/B300 के लिए PyTorch >= 2.9 और Triton >= 3.7 आवश्यक हैं। किसी बाहरी attention पैकेज की आवश्यकता नहीं है। सीधे PyTorch SDPA और Diffusers का नेटिव attention इसी बैकएंड का उपयोग करते हैं। समान प्रकार के FP16/BF16 Q/K/V, बूलियन मास्क, 1..512 हेड आयाम और grouped-query attention समर्थित हैं। FP32 इनपुट, additive मास्क, dropout, context parallelism और MiniMax-H3 sparse attention अस्वीकार किए जाते हैं। CuTe बिना स्केल किए पंक्ति अधिकतम को लॉगरिदमिक सामान्यीकरण से अलग रखता है, केंद्रित FP32 backward सुधार का उपयोग करता है और FP32 संचय के बाद ग्रेडिएंट स्केल करता है। RTX Blackwell केंद्रित backward और आर्किटेक्चर के अनुसार ट्यून किए गए टाइल कॉन्फ़िगरेशन उपयोग करता है।kohaku-fa-autoप्रशिक्षण के लिए डिफ़ॉल्ट स्वचालित नीति है। आवश्यक निर्भरताएँ स्थापित होने पर यह समर्थित CUDA कॉल के लिए Kohaku चुनती है; CPU/MPS, असमर्थित GPU, FP32, dropout, additive masks, असमर्थित head dimensions और मॉडल सुविधाएँ native SDPA का उपयोग करती हैं। मूल्यांकन में native attention बना रहता है। चुने गए Kohaku के import, build और kernel errors छिपाए नहीं जाते। सभी कॉल के लिए native SDPA बनाए रखने हेतुdiffusersस्पष्ट रूप से सेट करें। अधिक सटीक गणना से प्रशिक्षण के प्रत्येक चरण का समय बढ़ सकता है; H100 पर मापे गए compiled Flux और MiniMax ब्लॉक ने native SDPA से लगभग 7.9% और 6.0% अधिक समय लिया। स्वचालित CuTe चयन sm_86/sm_89/sm_90/sm_120 का समर्थन करता है, जहाँ केंद्रित backward संतृप्त attention के सूक्ष्म ग्रेडिएंट सुरक्षित रखता है; इस नीति में B200/B300 मूल SDPA उपयोग करते हैं।metal-flash-attentionApple Silicon पर Universal Metal Flash Attention के PyTorch custom-op backend को उपयोग करता है। पहले UMFA काexamples/pytorch-custom-op-ffipackage install करें; SimpleTuner attention को PyTorch के MPS SDPA dispatcher से route करता है, जिसे मौजूदा UMFA builds register करते हैं। योग्य MPS FP32/FP16/BF16 4D SDPA calls — single-head समेत कोई भी head count, कोई भी sequence length, transposed FLUX-style layouts, 4D तक के bool/additive masks, और causal calls (training समेत — causal backward exact gradient parity पास करता है) — बिना per-call synchronization के PyTorch के MPS command stream में सीधे encode होती हैं, और FP16/BF16 inputs बिना FP32 promotion के native low-precision kernels पर चलते हैं। dropout याenable_gqaवाली calls PyTorch SDPA पर fallback करती हैं; पुरानेPrivateUse1buildstorch.device("mps")tensors द्वारा bypass हो जाते हैं। SimpleTuner startup पर FP32/FP16/BF16 forward और autograd parity checks तथा causal forward parity चलाता है, और numerically न मिलने वाले याget_dispatch_stats()expose न करने वाले UMFA builds को reject करता है।metal-flash-attention-int8औरmetal-flash-attention-int4set_quantization_mode(ext.QUANT_INT8, ext.QUANT_BLOCK_WISE)याset_quantization_mode(ext.QUANT_INT4, ext.QUANT_BLOCK_WISE)से UMFA का global blockwise quantization mode सेट करते हैं, backend बदलने पर उसे clear करते हैं, और attached autograd outputs, finite multi-head gradients, dispatcher-level bool/additive mask support तथा कोई PyTorch fallback न होने की अतिरिक्त startup check मांगते हैं। run के दौरानmetal_sdpa_extension.get_dispatch_stats()से पुष्टि करें किfp32_instream(quantized aliases के लिएquantized_autograd) बढ़ता है औरpytorch_fallback0रहता है; all-true bool masksmask_all_true_skippedभी बढ़ाते हैं। extensionrope_scaled_dot_product_attentionभी expose करता है — FLUX.1/FLUX.2/Krea2/Z-Image की interleaved-pair rotary convention से मेल खाता fused RoPE+SDPA entry point; training एक fused autograd से चलती है (backward में dQ/dK पर inverse rotation); masked या GQA gradient calls eager rotation पर fallback करती हैं।cudnn,native-efficient,native-flash,native-math,native-npu, औरnative-xlatorch.nn.attention.sdpa_kernelद्वारा expose किए गए matching SDPA backend चुनते हैं। ये तब उपयोगी हैं जब आपको determinism (native-math), CuDNN SDPA kernel, या vendor‑native accelerators (NPU/XLA) चाहिए।slaSparse–Linear Attention (SLA) सक्षम करता है, जो fine‑tunable sparse/linear hybrid kernel देता है और training तथा validation दोनों में बिना अतिरिक्त gating के उपयोग किया जा सकता है।- SLA package install करें (उदा.
pip install -e ~/src/SLA) इस backend को चुनने से पहले। - SimpleTuner SLA के learned projection weights हर checkpoint में
sla_attention.ptमें सेव करता है; resume और inference के लिए इस फ़ाइल को बाकी checkpoint के साथ रखें। - क्योंकि backbone को SLA के mixed sparse/linear behavior के अनुसार ट्यून किया गया है, inference समय पर भी SLA आवश्यक होगा। focused गाइड के लिए
documentation/attention/SLA.mdदेखें। - यदि जरूरत हो तो SLA runtime defaults override करने के लिए
--sla_config '{"topk":0.15,"blkq":32,"tie_feature_map_qk":false}'(JSON या Python dict syntax) उपयोग करें। sageattention,sageattention-int8-fp16-triton,sageattention-int8-fp16-cuda, औरsageattention-int8-fp8-cudaसंबंधित SageAttention kernels को wrap करते हैं। ये inference‑oriented हैं और accidental training से बचने के लिए--sageattention_usageके साथ उपयोग होने चाहिए।- सरल शब्दों में, SageAttention inference के compute requirement को कम करता है
ℹ️ Flash/Flex/PyTorch backend selectors Diffusers के
attention_backenddispatcher पर निर्भर हैं, इसलिए वे वर्तमान में transformer‑style models में अधिक लाभ देते हैं जो पहले से इस code path को उपयोग करते हैं (Flux, Wan 2.x, LTXVideo, QwenImage, आदि)। Classic SD/SDXL UNets अभी सीधे PyTorch SDPA उपयोग करते हैं।
--sageattention_usage के जरिए SageAttention के साथ training सक्षम करना सावधानी से करना चाहिए, क्योंकि यह QKV linears के लिए अपनी custom CUDA implementations से gradients track या propagate नहीं करता।
- इससे ये layers पूरी तरह untrained रह जाते हैं, जो model collapse या छोटे training runs में हल्का सुधार कर सकते हैं।
📰 Publishing¶
--push_to_hub¶
- What: यदि दिया गया, तो training पूरी होने पर आपका मॉडल Huggingface Hub पर upload होगा।
--push_checkpoints_to_hubउपयोग करने पर हर intermediary checkpoint भी push होगा।
--push_to_hub_background¶
- What: Hugging Face Hub पर background worker से uploads करता है ताकि checkpoint pushes training loop को pause न करें।
- Why: Hub uploads asynchronous रहते हुए training और validation चलती रहती है। Run समाप्त होने से पहले final uploads की प्रतीक्षा की जाती है ताकि failures surface हों।
--webhook_config¶
- What: webhook targets (उदा. Discord, custom endpoints) के लिए कॉन्फ़िगरेशन ताकि real‑time training events मिल सकें।
- Why: बाहरी tools और dashboards के साथ training runs मॉनिटर करने देता है और मुख्य training चरणों पर notifications भेजता है।
- Notes: webhook payloads में
job_idफ़ील्डSIMPLETUNER_JOB_IDenvironment variable सेट करके भरी जा सकती है: यह उन monitoring tools के लिए उपयोगी है जो कई training runs से webhooks प्राप्त करते हैं ताकि यह पता चले कि किस config ने event भेजा। यदि SIMPLETUNER_JOB_ID सेट नहीं है, तो webhook payloads में job_id null होगा।
--publishing_config¶
- What: non‑Hugging Face publishing targets (S3‑compatible storage, Backblaze B2, Azure Blob Storage, Dropbox) को वर्णित करने वाला optional JSON/dict/file path.
- Why:
--webhook_configparsing को mirror करता है ताकि artifacts को Hub के बाहर भी fan out किया जा सके। Publishing validation के बाद main process पर currentoutput_dirका उपयोग करके चलता है। - Notes: Providers
--push_to_hubके additive हैं। provider SDKs (जैसेboto3,azure-storage-blob,dropbox) को.venvमें install करें जब आप इन्हें enable करें। पूर्ण उदाहरणों के लिएdocumentation/publishing/README.mdदेखें।
--hub_model_id¶
- What: Huggingface Hub मॉडल और local results directory का नाम।
- Why: यह मान
--output_dirद्वारा निर्दिष्ट स्थान के अंतर्गत directory नाम के रूप में उपयोग होता है। यदि--push_to_hubदिया गया है, तो यही Huggingface Hub पर मॉडल का नाम होगा।
--model_card_base_model¶
- क्या: जनरेट किए गए मॉडल कार्ड और सामान्य LoRA इन्फरेंस उदाहरण में इस्तेमाल होने वाला Hugging Face बेस रिपॉज़िटरी ID।
- डिफ़ॉल्ट: सेट नहीं; यदि
--pretrained_model_name_or_pathएक Hub ID है तो उसका उपयोग होता है। स्थानीय पथों की जगह<model_family>/unknown-modelलिखा जाता है। - कब: जब स्थानीय या कंटेनर में शामिल चेकपॉइंट से प्रशिक्षण कर रहे हों और उसकी मूल रिपॉज़िटरी जानते हों, तब इसे सेट करें। यह प्रकाशित मेटाडेटा बदलता है, प्रशिक्षण के लिए लोड किए गए वज़न नहीं।
black-forest-labs/flux-3-image-klein-baseजैसा रिपॉज़िटरी ID दें, फ़ाइल सिस्टम पथ या URL नहीं।
--modelspec_comment¶
- What: safetensors फ़ाइल metadata में
modelspec.commentके रूप में embedded text - Default: None (disabled)
- Notes:
- बाहरी model viewers (ComfyUI, model info tools) में दिखाई देता है
- string या strings की array (newlines से जुड़ी) स्वीकार करता है
- environment variable substitution के लिए
{env:VAR_NAME}placeholders support करता है - metadata लिखते समय
{current_step},{current_epoch}, और{timestamp}support करता है {timestamp}UTC ISO 8601 value का उपयोग करता है- प्रत्येक checkpoint save के समय current config value उपयोग करता है
Example (string):
Example (array multi-line के लिए):
"modelspec_comment": [
"Training run: experiment-42",
"Dataset: custom-portraits-v2",
"Notes: {env:TRAINING_NOTES}"
]
--disable_benchmark¶
- What: step 0 पर base model के लिए होने वाली startup validation/benchmark को disable करता है। ये outputs आपकी trained model validation images के बाएँ हिस्से में stitched होते हैं।
📂 Data Storage and Management¶
--data_backend_config¶
- What: आपके SimpleTuner dataset कॉन्फ़िगरेशन का path.
- Why: अलग‑अलग storage माध्यमों पर कई datasets को एक training session में जोड़ा जा सकता है।
- Notes:
config.jsonऔरconfig.tomlसे load की गई string values{env:VAR_NAME}support करती हैं- referenced
multidatabackend.jsonके अंदर की string values भी{env:VAR_NAME}support करती हैं - Example: उदाहरण कॉन्फ़िगरेशन के लिए multidatabackend.json.example देखें, और data loader कॉन्फ़िगर करने के लिए यह दस्तावेज़ देखें।
--override_dataset_config¶
- What: दिया जाने पर, SimpleTuner cached config और current values के बीच अंतर को ignore करेगा।
- Why: किसी dataset पर SimpleTuner पहली बार चलने पर यह dataset की हर चीज़ की जानकारी वाला cache document बनाता है, जिसमें dataset config भी शामिल होता है, जैसे इसके "crop" और "resolution" संबंधित मान। इन्हें मनमाने रूप से या गलती से बदलने पर training jobs बेतरतीब रूप से crash हो सकते हैं, इसलिए इस parameter का उपयोग न करने और बदलाव किसी अन्य तरीके से करने की सिफ़ारिश है।
--data_backend_sampling¶
- What: कई data backends के साथ sampling अलग strategies से की जा सकती है।
- Options:
uniform- v0.9.8.1 और पहले का behavior जहाँ dataset length consider नहीं होती, केवल manual probability weightings ली जाती थीं।auto-weighting- डिफ़ॉल्ट behavior जहाँ dataset length का उपयोग करके सभी datasets को समान रूप से sample किया जाता है, ताकि पूरे data distribution पर uniform sampling बनी रहे।- यह तब आवश्यक है जब आपके datasets अलग‑अलग sizes के हों और आप चाहते हों कि मॉडल उन्हें समान रूप से सीखे।
- लेकिन Dreambooth images को regularisation set के विरुद्ध सही तरह sample करने के लिए
repeatsको manually adjust करना आवश्यक है
--vae_cache_scan_behaviour¶
- What: integrity scan check का व्यवहार कॉन्फ़िगर करता है।
- Why: dataset के लिए गलत settings training के कई चरणों पर लागू हो सकते हैं, जैसे यदि आप गलती से dataset से
.jsoncache files delete कर दें और data backend config को aspect‑crops की जगह square images के लिए switch कर दें। इससे data cache inconsistent हो जाता है, जिसेmultidatabackend.jsonमेंscan_for_errorsकोtrueसेट करके ठीक किया जा सकता है। जब यह scan चलता है, तो यह--vae_cache_scan_behaviourके मान के अनुसार inconsistency को resolve करता है:recreate(डिफ़ॉल्ट) offending cache entry को हटाता है ताकि वह फिर से बनाई जा सके, औरsyncbucket metadata को वास्तविक training sample के अनुरूप अपडेट करता है। अनुशंसित मान:recreate.
--enable_nsfw_check¶
- What: VAE cache preprocessing के दौरान NSFW classifier enforcement सक्षम करता है।
- Default:
false. - Notes: केवल उन uncached samples को scan किया जाता है जिन्हें VAE cache अभी process करने वाला है। मौजूदा VAE caches और
skip_file_discovery=vaetrusted माने जाते हैं और दुबारा scan नहीं होते। - More info: Privacy और responsibility notes के लिए NSFW.hi.md, और VAE cache details के लिए DATALOADER.hi.md#nsfw-classifier-checks-during-vae-caching देखें।
--nsfw_check_models¶
- What: Hugging Face Transformers image-classification models की CSV list। हर model के साथ
:threshold=0.5जोड़ा जा सकता है। - Default:
Falconsai/nsfw_image_detection:threshold=0.5,AdamCodd/vit-base-nsfw-detector:threshold=0.5. - Notes: केवल standard Transformers models supported हैं।
trust_remote_codeenabled नहीं होता, औरtimmपर आधारित classifiers load नहीं किए जाते।
--nsfw_check_min_votes¶
- What: किसी frame को reject करने से पहले NSFW verdict देने वाले configured classifiers की संख्या।
- Default:
2. - Notes: यह कम से कम
1और configured classifier models की संख्या से अधिक नहीं होना चाहिए।
--nsfw_check_backend_types¶
- What: जिन data backend
typevalues को scan करना है उनकी CSV list। - Default:
all. - Example:
local,huggingface,csv,aws.
--nsfw_check_sample_types¶
- What: जिन dataset
dataset_typevalues को scan करना है उनकी CSV list। - Default:
image,conditioning. - Notes: Evaluation datasets scan नहीं होते।
--delete_nsfw_images¶
- What: backend deletion support करता हो तो NSFW classifier से rejected source samples को delete करता है।
- Default:
false. - Notes: Disabled होने पर rejected samples current run के metadata से हटते हैं, पर source dataset में बने रहते हैं।
--nsfw_check_video_frame_count¶
- What: video या multi-frame conditioning inputs से sample किए जाने वाले frames की संख्या।
- Default:
3.
--nsfw_check_video_frame_selection¶
- What: video NSFW checks के लिए frame selection mode।
- Default:
uniform. - Options:
uniform,first,middle.
--nsfw_check_video_min_flagged_frames¶
- What: पूरे sample को reject करने से पहले reject होने वाले checked video frames की संख्या।
- Default:
1.
--dataloader_prefetch¶
- What: batches को ahead‑of‑time retrieve करता है।
- Why: विशेष रूप से बड़े batch sizes के साथ, samples disk (यहाँ तक कि NVMe) से लोड होने पर training "pause" होती है, जिससे GPU utilisation metrics प्रभावित होते हैं। Dataloader prefetch सक्षम करने पर पूरे batches का buffer भरकर रखा जाता है ताकि वे तुरंत load हो सकें।
⚠️ यह वास्तव में केवल H100 या बेहतर GPU पर कम resolution में उपयोगी है जहाँ I/O bottleneck बनता है। अधिकांश अन्य उपयोग मामलों में यह अनावश्यक जटिलता है।
--dataloader_prefetch_qlen¶
- What: memory में रखे गए batches की संख्या बढ़ाता या घटाता है।
- Why: dataloader prefetch के साथ, डिफ़ॉल्ट रूप से प्रति GPU/process 10 entries memory में रखी जाती हैं। यह बहुत अधिक या बहुत कम हो सकता है। इस मान को बदलकर batches की संख्या समायोजित की जा सकती है।
--dataloader_prefetch_device_threshold_mb¶
- What: MiB में न्यूनतम unique CPU batch payload जिसे dataloader prefetch page-lock करके dedicated CUDA stream पर transfer करता है।
0device staging बंद करता है। - Why: बहुत बड़े cached embeddings host-to-device transfer को model work के साथ serial कर सकते हैं। यह विकल्प transfer और GPU compute को overlap करता है।
- Memory: हर staged queue entry pinned host memory और accelerator memory दोनों उपयोग करती है।
dataloader_prefetch_qlen: 2से शुरू करें और बढ़ाने से पहले profile करें। - Compatibility:
dataloader_prefetch: trueऔर CUDA आवश्यक हैं। Context parallelism के साथ यह समर्थित नहीं है।
--compress_disk_cache¶
- What: VAE और text embed caches को disk पर compress करता है।
- Why: DeepFloyd, SD3, और PixArt में उपयोग होने वाला T5 encoder बहुत बड़े text embeds बनाता है जो छोटे या redundant captions के लिए mostly empty space होते हैं।
--compress_disk_cacheसक्षम करने से space उपयोग 75% तक घट सकता है, औसतन 40% बचत के साथ।
⚠️ आपको मौजूदा cache directories मैन्युअल रूप से हटाने होंगे ताकि trainer उन्हें compression के साथ फिर से बना सके।
🌈 Image और Text Processing¶
कई सेटिंग्स dataloader config में सेट होती हैं, लेकिन ये global रूप से लागू होंगी।
--resolution_type¶
- What: यह SimpleTuner को बताता है कि
areasize calculations उपयोग करनी हैं याpixeledge calculations।pixel_areaका hybrid approach भी समर्थित है, जोareameasurements के लिए megapixel की बजाय pixel उपयोग करने देता है। - Options:
resolution_type=pixel_arearesolutionका मान 1024 होने पर यह internally efficient aspect bucketing के लिए सटीक area measurement में मैप होगा।1024के लिए उदाहरण आकार: 1024x1024, 1216x832, 832x1216
resolution_type=pixel- dataset की सभी images का छोटा edge इस resolution तक resize होगा, जिससे resulting images बड़े हो सकते हैं और VRAM उपयोग बढ़ सकता है।
1024के लिए उदाहरण आकार: 1024x1024, 1766x1024, 1024x1766
resolution_type=area- Deprecated. इसकी जगह
pixel_areaउपयोग करें।
- Deprecated. इसकी जगह
--resolution¶
- What: input image resolution, pixel edge length में व्यक्त
- Default: 1024
- Note: यदि dataset में resolution सेट नहीं है, तो यही global default उपयोग होगा।
--validation_resolution¶
- What: output image resolution, pixels में; या
widthxheightफ़ॉर्मैट में, जैसे1024x1024। Multiple resolutions को comma से अलग कर सकते हैं। - Why: validation के दौरान बनने वाली सभी images इसी resolution पर होंगी। यह तब उपयोगी है जब मॉडल अलग resolution पर train हो रहा हो।
--validation_method¶
- What: validation runs कैसे execute हों, यह चुनें।
- Options:
simpletuner-local(डिफ़ॉल्ट) built‑in pipeline चलाता है;external-scriptuser‑provided executable चलाता है। - Why: training को local pipeline work में रोके बिना validation को external system में हैंड‑ऑफ करने देता है।
--validation_external_script¶
- What:
--validation_method=external-scriptहोने पर चलाया जाने वाला executable। यह shell‑style splitting उपयोग करता है, इसलिए command string को ठीक से quote करें। - Placeholders: आप training context पास करने के लिए इन tokens को embed कर सकते हैं (
.formatके साथ)। Missing values खाली string से replace होती हैं जब तक कि उल्लेख न किया गया हो: {local_checkpoint_path}→output_dirके अंतर्गत latest checkpoint directory (कम से कम एक checkpoint आवश्यक)।{global_step}→ current global step.{tracker_run_name}→--tracker_run_nameका मान.{tracker_project_name}→--tracker_project_nameका मान.{model_family}→--model_familyका मान.{model_type}/{lora_type}→ model type और LoRA flavour.{huggingface_path}→--hub_model_idका मान (यदि सेट हो)।{remote_checkpoint_path}→ last upload का remote URL (validation hook के लिए empty)।- कोई भी
validation_*config value (उदा.,validation_num_inference_steps,validation_guidance,validation_noise_scheduler). - Example:
--validation_external_script="/opt/tools/validate.sh {local_checkpoint_path} {global_step}"
--validation_external_background¶
- What: सेट होने पर
--validation_external_scriptbackground में launch होता है (fire‑and‑forget)। - Why: external script का इंतज़ार किए बिना training चलती रहती है; इस मोड में exit codes check नहीं होते।
--post_upload_script¶
- हर पूर्ण अंतर्निहित सत्यापन (WebUI से मैन्युअल, निर्धारित या बेस मॉडल बेंचमार्क) के बाद, कोई प्रकाशन प्रदाता कॉन्फ़िगर न होने पर भी स्क्रिप्ट चलती है। इस स्थिति में
{local_checkpoint_path}का मानoutput_dirहोता है (चेकपॉइंट आवश्यक नहीं है), और{remote_checkpoint_path}खाली होता है। कॉन्फ़िगर किए गए प्रदाताओं के लिए हर सफल अपलोड पर लौटाए गए पथों के साथ एक हुक चलता है; असफल अपलोड स्थानीय हुक नहीं चलाते। छोड़े गए, असफल या रद्द किए गए सत्यापन और बाहरी स्क्रिप्ट का लॉन्च इस पूर्णता हुक को नहीं चलाते। - What: हर publishing provider और Hugging Face Hub upload (final model और checkpoint uploads) के बाद optional executable चलता है। यह asynchronous चलता है ताकि training block न हो।
- Placeholders:
--validation_external_scriptजैसे replacements, साथ ही{remote_checkpoint_path}(provider द्वारा लौटाया गया URI) ताकि आप published URL downstream systems को भेज सकें। - Notes:
- scripts हर provider/upload पर चलती हैं; errors लॉग होते हैं लेकिन training रोकते नहीं।
- जब कोई remote upload न हो तब भी scripts invoke होती हैं, ताकि आप local automation (उदा., दूसरे GPU पर inference) चला सकें।
- SimpleTuner आपकी script के परिणाम ingest नहीं करता — metrics या images रिकॉर्ड करने के लिए सीधे अपने tracker पर लॉग करें।
- Example:
जहाँ
--post_upload_script='/opt/hooks/notify.sh {remote_checkpoint_path} {tracker_project_name} {tracker_run_name}'/opt/hooks/notify.shआपके tracking system को post कर सकता है: - Working samples:
simpletuner/examples/_shared/external-validation/replicate_post_upload.pyएक Replicate hook दिखाता है जो{remote_checkpoint_path},{model_family},{model_type},{lora_type}, और{huggingface_path}consume करके uploads के बाद inference ट्रिगर करता है।simpletuner/examples/_shared/external-validation/wavespeed_post_upload.pyवही placeholders के साथ WaveSpeed hook दिखाता है और WaveSpeed की async polling उपयोग करता है।simpletuner/examples/_shared/external-validation/fal_post_upload.pyfal.ai Flux LoRA hook दिखाता है (FAL_KEYआवश्यक)।simpletuner/examples/_shared/external-validation/use_second_gpu.pysecondary GPU पर Flux LoRA inference चलाता है और remote uploads के बिना भी काम करता है।
--post_checkpoint_script¶
- What: हर checkpoint directory disk पर लिखे जाने के तुरंत बाद चलाया जाने वाला executable (uploads शुरू होने से पहले)। main process पर asynchronous चलता है।
- Placeholders:
--validation_external_scriptजैसे replacements, जिनमें{local_checkpoint_path},{global_step},{tracker_run_name},{tracker_project_name},{model_family},{model_type},{lora_type},{huggingface_path}और कोई भीvalidation_*config value शामिल हैं।{remote_checkpoint_path}इस hook के लिए खाली होता है। - Notes:
- Scheduled, manual, और rolling checkpoints पर यह तब fire होता है जब local save पूरा हो जाए।
- Local automation (दूसरे volume पर copy, eval jobs चलाना) के लिए उपयोगी है, uploads के खत्म होने का इंतज़ार किए बिना।
- Example:
--deepfloyd_validation_pipeline_mode¶
- What: DeepFloyd validation में stage chaining control करता है।
- Choices:
auto,trained-stage,full-pipeline - Default:
auto - Why:
autoprompt validation के लिए DeepFloyd stage I -> stage II चलाता है, जबकि explicit dataset image validation में केवल trained stage चलता है। Single-stage validation बनाए रखने के लिएtrained-stage, और fixed peer stages force-load करने के लिएfull-pipelineउपयोग करें।
--deepfloyd_validation_stage1_model¶
- What: Trained stage II को full pipeline से validate करते समय उपयोग होने वाला fixed DeepFloyd stage I model.
- Default:
DeepFloyd/IF-I-XL-v1.0
--deepfloyd_validation_stage2_model¶
- What: Trained stage I को full pipeline से validate करते समय उपयोग होने वाला fixed DeepFloyd stage II model.
- Default:
DeepFloyd/IF-II-M-v1.0
--deepfloyd_validation_stage3_mode¶
- What: DeepFloyd stage II के बाद optional terminal upscaler.
- Choices:
none,sd-x4-upscaler - Default:
none - Why: DeepFloyd का unreleased stage III मूल रूप से 4x upscaler था।
sd-x4-upscalerउस role के लिएstabilityai/stable-diffusion-x4-upscalerउपयोग करता है।
--deepfloyd_validation_stage3_model¶
- What:
--deepfloyd_validation_stage3_mode=sd-x4-upscalerहोने पर उपयोग होने वाला model repository. - Default:
stabilityai/stable-diffusion-x4-upscaler
--deepfloyd_validation_stage1_num_inference_steps¶
- What: Stage I validation step count का optional override.
- Default:
--validation_num_inference_stepsउपयोग करता है, stage I के लिए 30 तक capped.
--deepfloyd_validation_stage2_num_inference_steps¶
- What: Stage II validation step count का optional override.
- Default:
--validation_num_inference_steps
--deepfloyd_validation_stage1_guidance¶
- What: Stage I validation guidance का optional override.
- Default:
--validation_guidance
--deepfloyd_validation_stage2_guidance¶
- What: Stage II validation guidance का optional override.
- Default:
--validation_guidance
--deepfloyd_validation_stage3_guidance¶
- What: SD x4 upscaler guidance का optional override.
- Default:
--validation_guidance
--deepfloyd_validation_stage3_noise_level¶
- What: SD x4 upscaler को दिया जाने वाला noise level.
- Default:
100
--wan_validation_load_other_stage¶
- What: Validation के दौरान Wan 2.2 का opposite stage लोड करता है।
- Default:
false - Why: Wan 2.2 और AnimeGen जैसे compatible staged flavours में किसी भी stage को अलग से train किया जा सकता है। इसे enable करने पर fixed peer stage लोड होता है, ताकि validation full paired-stage pipeline उपयोग करे और configured boundary पर denoiser switch करे।
--sdxl_validation_pipeline_mode¶
- Choices:
trained-stage,full-pipeline - Default:
trained-stage - What: SDXL validation में केवल trained stage चलाना है या split base/refiner pipeline चलानी है, यह चुनता है।
- Why:
full-pipelinestage 1 को1 - refiner_training_strengthतक latent output के साथ चलाता है, फिर उसी schedule boundary से stage 2 resume करता है।
--sdxl_validation_stage1_model¶
- What: Full-pipeline validation में trained stage 2 model को refine कराते समय उपयोग होने वाला fixed SDXL stage 1/base model.
- Default: चुने गए SDXL version से infer होता है, आम तौर पर
stabilityai/stable-diffusion-xl-base-1.0
--sdxl_validation_stage2_model¶
- What: Full-pipeline validation में trained stage 1 model पहले चलाते समय उपयोग होने वाला fixed SDXL stage 2/refiner model.
- Default: चुने गए SDXL version से infer होता है, आम तौर पर
stabilityai/stable-diffusion-xl-refiner-1.0
--pixart_validation_pipeline_mode¶
- Choices:
trained-stage,full-pipeline - Default:
trained-stage - What: PixArt validation में केवल trained stage चलाना है या v0.7 split pipeline चलानी है, यह चुनता है।
- Why:
full-pipelinestage 1 को1 - refiner_training_strengthतक latent output के साथ चलाता है, फिर उसी schedule boundary से stage 2 resume करता है।
--pixart_validation_stage1_model¶
- What: Full-pipeline validation में trained stage 2 model को refine कराते समय उपयोग होने वाला fixed PixArt stage 1 model.
- Default:
terminusresearch/pixart-900m-1024-ft-v0.7-stage1
--pixart_validation_stage2_model¶
- What: Full-pipeline validation में trained stage 1 model पहले चलाते समय उपयोग होने वाला fixed PixArt stage 2 model.
- Default:
terminusresearch/pixart-900m-1024-ft-v0.7-stage2
--validation_adapter_path¶
- What: scheduled validations चलाते समय अस्थायी रूप से एक single LoRA adapter लोड करता है।
- Formats:
- Hugging Face repo:
org/repoयाorg/repo:weight_name.safetensors(डिफ़ॉल्टpytorch_lora_weights.safetensors). - Local file या directory path जो safetensors adapter की ओर इशारा करे।
- Notes:
--validation_adapter_configके साथ mutually exclusive; दोनों देने पर error आता है।- adapter केवल validation runs के लिए attach होता है (baseline training weights untouched रहते हैं)।
--validation_adapter_name¶
- What:
--validation_adapter_pathसे लोड किए गए अस्थायी adapter के लिए optional identifier. - Why: logs/Web UI में adapter run को label करने और कई adapters sequentially test होने पर predictable names सुनिश्चित करने के लिए।
--validation_adapter_strength¶
- What: अस्थायी adapter enable होने पर strength multiplier (डिफ़ॉल्ट
1.0). - Why: training state बदले बिना validation के दौरान हल्का/तेज़ LoRA scaling sweep करने देता है; शून्य से बड़ा कोई भी मान स्वीकार होता है।
--validation_adapter_mode¶
- Choices:
adapter_only,comparison,none - What:
adapter_only: केवल अस्थायी adapter के साथ validations चलाएँ।comparison: base‑model और adapter‑enabled samples दोनों जनरेट करें ताकि side‑by‑side समीक्षा हो सके।none: adapter attach करना छोड़ दें (CLI flags हटाए बिना फीचर disable करने के लिए उपयोगी)।
--validation_adapter_config¶
- What: multiple validation adapter combinations को iterate करने के लिए JSON file या inline JSON.
- Format: entries की array या
runsarray वाला object। हर entry में शामिल हो सकता है: label: logs/UI में दिखने वाला friendly name.path: Hugging Face repo ID या local path (--validation_adapter_pathजैसा format)।adapter_name: प्रति adapter optional identifier.strength: optional scalar override.target_stage: इस adapter के लिए optional multi-stage validation target. Supported aliases model पर निर्भर करते हैं; common values मेंone,two,stage1,stage2, और Wanhigh/lowशामिल हैं.adapters/paths: एक ही run में multiple adapters लोड करने के लिए objects/strings की array.- Notes:
- यह प्रदान होने पर single‑adapter options (
--validation_adapter_path,--validation_adapter_name,--validation_adapter_strength,--validation_adapter_mode) UI में ignore/disable हो जाते हैं। - हर run को एक‑एक करके load किया जाता है और अगला शुरू होने से पहले पूरी तरह detach किया जाता है।
--validation_preview¶
- What: Tiny AutoEncoders का उपयोग करके diffusion sampling के दौरान intermediate validation previews stream करता है
- Default: False
- Why: validation images के generate होने के दौरान real‑time preview सक्षम करता है; lightweight Tiny AutoEncoder models द्वारा decode होकर webhook callbacks से भेजे जाते हैं। इससे आप पूरी generation का इंतज़ार किए बिना step‑by‑step progress देख सकते हैं।
- Notes:
- केवल Tiny AutoEncoder support वाले model families पर उपलब्ध (उदा., Flux, SDXL, SD3)
- preview images प्राप्त करने के लिए webhook configuration आवश्यक
- previews कितनी बार decode हों, यह नियंत्रित करने के लिए
--validation_preview_stepsउपयोग करें
--validation_preview_steps¶
- What: validation previews decode और stream करने का interval
- Default: 1
- Why: validation sampling के दौरान intermediate latents कितनी बार decode हों, यह नियंत्रित करता है। उच्च मान (उदा. 3) Tiny AutoEncoder का overhead घटाता है क्योंकि हर N steps पर decode होता है।
- Example:
--validation_num_inference_steps=20और--validation_preview_steps=5के साथ, generation process के दौरान 4 preview images मिलेंगी (steps 5, 10, 15, 20 पर)।
--evaluation_type¶
- What: validations के दौरान generated images की CLIP evaluation सक्षम करें।
- Why: CLIP scores validation prompt के साथ generated image features की दूरी निकालते हैं। इससे prompt adherence में सुधार का संकेत मिल सकता है, लेकिन सार्थक परिणामों के लिए बड़ी संख्या में validation prompts चाहिए।
- Options: "none" या "clip"
- Scheduling: step‑based scheduling के लिए
--eval_steps_intervalया epoch‑based scheduling के लिए--eval_epoch_intervalउपयोग करें (fractions जैसे0.5प्रति epoch कई बार चलेंगे)। यदि दोनों सेट हों, trainer warning लॉग करेगा और दोनों schedules चलाएगा।
--eval_loss_disable¶
- What: validation के दौरान evaluation loss गणना disable करें।
- Why: जब eval dataset कॉन्फ़िगर हो, loss स्वतः गणना होता है। यदि CLIP evaluation सक्षम है, तो दोनों चलेंगे। यह flag eval loss को disable करने देता है जबकि CLIP evaluation चालू रहता है।
--validation_using_datasets¶
- What: pure text-to-image generation के बजाय training datasets से images validation के लिए use करें।
- Why: image-to-image (img2img) या image-to-video (i2v) validation mode enable करता है जहाँ model training images को conditioning inputs के रूप में use करता है। उपयोगी है:
- Edit/inpainting models test करने के लिए जिन्हें input images चाहिए
- Model image structure को कितना preserve करता है evaluate करने के लिए
- Dual text-to-image AND image-to-image workflows support करने वाले models के लिए (जैसे, Flux2, LTXVideo2)
- I2V video models (HunyuanVideo, WAN, Kandinsky5Video): image dataset से images को video generation validation के लिए first-frame conditioning input के रूप में use करें
- Notes:
- Model में
IMG2IMGयाIMG2VIDEOpipeline registered होना चाहिए --eval_dataset_idके साथ combine कर सकते हैं specific dataset से images लेने के लिए- i2v models के लिए, यह training में use होने वाली complex conditioning dataset pairing setup के बिना simple image dataset validation के लिए use करने देता है
- Flux Kontext validation के लिए इस flag का उपयोग नहीं करता; इसे disabled रखें और edit dataset चुनने के लिए
--eval_dataset_idउपयोग करें, जबकि Kontext paired reference dataset अपने आप load कर लेता है - Denoising strength normal validation timestep settings से control होती है
--validation_input¶
- What: Validation input image paths और prompts की JSON list, जैसे
[{"path": "/data/val/frame.png", "prompt": "a slow push-in shot"}]। - Why: Validation dataset बनाए बिना image-conditioned validation चलाने देता है।
- Notes:
- हर entry में
pathऔरpromptहोना चाहिए; optionalshortnameयाnameoutput label control करता है। - Validation prompts prepare होते समय image path local machine पर exist करना चाहिए।
- Set होने पर ये entries datasets से validation samples discover करने के बजाय validation input images के रूप में use होती हैं।
--eval_dataset_id¶
- What: Evaluation/validation image sourcing के लिए specific dataset ID।
- Why:
--validation_using_datasetsया conditioning-based validation use करते समय, यह control करता है कौन सा dataset input images provide करे: - इस option के बिना, images सभी training datasets से randomly select होती हैं
- इस option के साथ, केवल specified dataset validation inputs के लिए use होता है
- Notes:
- Dataset ID आपके dataloader config में configured dataset से match होना चाहिए
- Dedicated eval dataset use करके consistent evaluation maintain करने के लिए useful
- Conditioning models के लिए, dataset का conditioning data (यदि हो) भी use होगा
- Flux Kontext के लिए validation dataset चुनने का सही तरीका यही है;
--validation_using_datasetsenable न करें
Conditioning और Validation Modes को समझना¶
SimpleTuner conditioning inputs (reference images, control signals, आदि) use करने वाले models के लिए तीन मुख्य paradigms support करता है:
1. Models जो Conditioning REQUIRE करते हैं¶
कुछ models conditioning inputs के बिना function नहीं कर सकते:
- Flux Kontext: Edit-style training के लिए हमेशा reference images चाहिए
- ControlNet training: Control signal images require करता है
इन models के लिए, conditioning dataset mandatory है। WebUI conditioning options को required दिखाएगी, और training इनके बिना fail होगी।
Flux Kontext validation भी इसी conditioning-based path पर रहती है। Validation के लिए edit dataset चुनने हेतु --eval_dataset_id उपयोग करें और --validation_using_datasets disabled रखें।
2. Models जो Optional Conditioning SUPPORT करते हैं¶
कुछ models text-to-image AND image-to-image दोनों modes में operate कर सकते हैं:
- Flux2: Optional reference images के साथ dual T2I/I2I training support करता है
- LTXVideo2: Optional first-frame conditioning के साथ T2V और I2V (image-to-video) दोनों support करता है
- LongCat-Video: Optional frame conditioning support करता है
- HunyuanVideo i2v: First-frame conditioning के साथ I2V support करता है (flavours:
i2v-480p,i2v-720p, आदि) - WAN i2v: First-frame conditioning के साथ I2V support करता है
- Kandinsky5Video i2v: First-frame conditioning के साथ I2V support करता है
इन models के लिए, आप conditioning datasets ADD कर सकते हैं पर जरूरी नहीं। WebUI conditioning options को optional दिखाएगी।
I2V Validation Shortcut: i2v video models के लिए, आप --validation_using_datasets को image dataset (via --eval_dataset_id specified) के साथ use कर सकते हैं validation conditioning images directly प्राप्त करने के लिए, training में use होने वाली full conditioning dataset pairing setup की जरूरत के बिना।
3. Validation Modes¶
| Mode | Flag | Behavior |
|---|---|---|
| Text-to-Image/Video | (default) | केवल text prompts से generate |
| Dataset-based (img2img) | --validation_using_datasets |
Datasets से images partially denoise |
| Dataset-based (i2v) | --validation_using_datasets |
i2v video models के लिए, images को first-frame conditioning के रूप में use |
| Conditioning-based | (auto जब conditioning configured हो) | Validation के दौरान conditioning inputs use |
Modes combine करना: जब model conditioning support करता है AND --validation_using_datasets enabled है:
- Validation system datasets से images लेता है
- यदि उन datasets में conditioning data है, तो automatically use होता है
- --eval_dataset_id use करें control करने के लिए कौन सा dataset inputs provide करे
I2V models के साथ --validation_using_datasets: i2v video models (HunyuanVideo, WAN, Kandinsky5Video) के लिए, यह flag enable करने पर validation के लिए simple image dataset use कर सकते हैं। Images validation videos generate करने के लिए first-frame conditioning inputs के रूप में use होती हैं, complex conditioning dataset pairing setup की जरूरत के बिना।
Flux Kontext के साथ --validation_using_datasets: यह flag enable न करें। Kontext edit-only है और validation अपनी सामान्य paired image + conditioning dataset path से चलाता है। इसके बजाय edit dataset चुनने के लिए --eval_dataset_id उपयोग करें।
Conditioning Data Types¶
Different models different conditioning data expect करते हैं:
| Type | Models | Dataset Setting |
|---|---|---|
conditioning |
ControlNet, Control | Dataset config में type: conditioning |
image |
Flux Kontext | type: image (standard image dataset) |
latents |
Flux, Flux2 | Conditioning automatically VAE-encoded होता है |
--caption_strategy¶
- What: image captions derive करने की रणनीति। Choices:
textfile,filename,parquet,instanceprompt - Why: training images के captions कैसे बनाए जाएँ, यह तय करता है।
textfileimage के समान फ़ाइल‑नाम वाली.txtफ़ाइल के contents उपयोग करेगाfilenameफ़ाइल‑नाम को कुछ cleanup करके caption के रूप में उपयोग करेगा।parquetdataset में parquet फ़ाइल होने परcaptioncolumn उपयोग करेगा जब तकparquet_caption_columnन दिया गया हो। सभी captions मौजूद होने चाहिए जब तकparquet_fallback_caption_columnन दिया गया हो।instancepromptdataset config मेंinstance_promptमान को हर image के prompt के रूप में उपयोग करेगा।
--conditioning_multidataset_sampling¶
- What: multiple conditioning datasets से sampling कैसे की जाए। Choices:
combined,random - Why: multiple conditioning datasets (उदा., multiple reference images या control signals) के साथ training करते समय यह तय करता है कि उन्हें कैसे उपयोग किया जाए:
combinedconditioning inputs को stitch करके training में एक साथ दिखाता है। यह multi‑image compositing tasks के लिए उपयोगी है।randomहर sample के लिए एक conditioning dataset रैंडम रूप से चुनता है, training के दौरान conditions बदलते हुए।- Note:
combinedउपयोग करने पर आप conditioning datasets पर अलगcaptionsपरिभाषित नहीं कर सकते; source dataset के captions ही उपयोग होते हैं। - See also: multiple conditioning datasets कॉन्फ़िगर करने के लिए DATALOADER.md देखें।
--flux3_prompt_upsample¶
डिफ़ॉल्ट: false
यह डिफ़ॉल्ट रूप से बंद है। चालू करने पर SimpleTuner अलग Qwen3.5-9B मॉडल (लगभग 19 GB weights) डाउनलोड करता है और text embeddings कैश करने से पहले positive prompts को विस्तार देता है। एडिट के लिए जोड़ी गई रेफ़रेंस इमेज इस्तेमाल होती हैं। Negative prompts, dropout के खाली captions और मूल caption फ़ाइलें वैसे ही रहती हैं।
अतिरिक्त system RAM और preprocessing समय रखें। Upsampler और text encoder बारी-बारी से GPU इस्तेमाल करते हैं; बनी embeddings प्रशिक्षण में दोबारा इस्तेमाल होती हैं। SimpleTuner expanded और मूल embeddings अलग रखता है और वही references दोबारा चुनने पर कैश परिणाम फिर इस्तेमाल करता है।
--moss_image_auto_json¶
सकारात्मक captions को MOSS-Image के मूल summary/items JSON layout schema में encode करता है। डिफ़ॉल्ट: false। सामान्य captions को वस्तुओं की स्थिति गढ़े बिना JSON में रखा जाता है; मौजूदा layouts की जाँच और serialization होता है। खाली और नकारात्मक prompts सुरक्षित रहते हैं।
--moss_image_prompt_upsample¶
Text embeddings कैश करने से पहले vision-language मॉडल से सकारात्मक captions को विस्तृत मूल JSON layouts में बदलता है। डिफ़ॉल्ट: false। प्रशिक्षण चित्रों के आधार पर विवरण और bounding boxes बनते हैं, जो वास्तविक bucket dimensions इस्तेमाल करते हैं। Validation prompts भी विस्तृत होते हैं और मूल JSON conversion सक्रिय हो जाता है।
--moss_image_prompt_upsampler_model_id¶
Caption मॉडल का repository या स्थानीय पथ। डिफ़ॉल्ट: Qwen/Qwen3.5-27B। moss_image_prompt_upsample के साथ इस्तेमाल होता है। डिफ़ॉल्ट मॉडल के लिए 80 GB GPU और अतिरिक्त system RAM चाहिए; यह text encoder के साथ बारी-बारी GPU इस्तेमाल करता है। मॉडल बदलने या JSON सक्रिय करने पर अलग embedding cache इस्तेमाल होता है।
--moss_image_validation_shift¶
MOSS-Image वैलिडेशन का इन्फ़रेंस flow shift। डिफ़ॉल्ट: 5.0। शिफ़्ट को noise से शून्य तक समान अंतराल वाले ग्रिड पर केवल एक बार लागू किया जाता है; शिफ़्ट 1 पर चार स्टेप [1, 0.75, 0.5, 0.25, 0] होते हैं, जो AnyFlow प्रशिक्षण रोलआउट से मेल खाते हैं। प्रशिक्षण बिना-शिफ़्ट वाले 1,000-बिंदु ग्रिड पर तकनीकी रिपोर्ट, परिशिष्ट A.2 के अनुसार truncated और rescaled logit-normal वितरण तथा 1% uniform मिश्रण का उपयोग करता है। flow_sigmoid_scale मूल मानक विचलन 0.95 का गुणक है; शून्य पर point mass के साथ uniform मिश्रण मिलता है। uniform, beta, cubic और custom timestep विकल्प भी चुने जा सकते हैं।
--moss_image_uncond_skip_layers¶
MOSS-Image की नकारात्मक CFG शाखा में छोड़ी जाने वाली Transformer लेयर की JSON सूची। इंडेक्स शून्य से शुरू होते हैं और सीमा 0 से 41 है। परियोजना की रेसिपी के अनुसार डिफ़ॉल्ट [22] है। मानक CFG के लिए [] दें। सकारात्मक शाखा को validation_guidance_skip_layers और validation_guidance_skip_scale से अलग सेट करें।
--krea2_reference_latents¶
- What: Krea 2 reference dataset training enable करें।
- Why: Enable होने पर Krea 2 Qwen3VL prompt embeddings cache करते समय paired conditioning image use करता है, और training के दौरान उस conditioning image के clean VAE latents को transformer token stream में append करता है।
- Dataset setup: Main image dataset में
conditioning_dataको paired conditioning dataset की ओर point करें। Target और reference images के filenames match होने चाहिए। - Scope: यह Krea 2 model-side option है। यह conditioning datasets generate नहीं करता; उसके लिए normal dataloader reference-dataset settings use करें।
LTX-2 validation options¶
--ltx2_validation_pipeline_mode: चुनें कि LTX-2 validation केवल trained model चलाए (trained-stage) या spatial upscaler वाली two-stage validation pipeline चलाए (spatial-upscale)।--ltx2_validation_spatial_upsampler_model: LTX-2 spatial latent upsampler के लिए Hugging Face repo, local directory, या local.safetensorsfile। DefaultLightricks/LTX-2.3है।--ltx2_validation_spatial_upsampler_filename: जब model option repo या directory की ओर point करे, तब upsampler filename। Defaultltx-2.3-spatial-upscaler-x2-1.1.safetensorsहै।--ltx2_validation_audio_guidance: validation के दौरान LTX-2 audio latents के लिए optional separate CFG guidance scale। unset रखने पर--validation_guidancereuse होता है; Comfy-style dual CFG में video और audio के अलग scales चाहिए हों तो इसे सेट करें।- spatial-upscale क्या करता है: Stage 1 requested validation resolution की आधी resolution पर video latents बनाता है, spatial upsampler latents को 2x करता है, और stage 2 LTX-2 stage-2 sigma schedule से requested resolution पर re-denoise करता है।
- Limit: Spatial-upscale validation video के लिए है;
--validation_audio_onlynormal single-stage validation path रखता है।
LTX-2 conditioning options¶
ये LTX-2 training के optional advanced settings हैं। इन्हें JSON/TOML config files में नीचे दिए गए names से सेट करें, या matching CLI flags जैसे --ltx2_first_frame_conditioning_probability से पास करें।
- Intrinsic target-token conditioning: चुने गए target video tokens clean latents से copy किए जाते हैं, उनके timesteps
0किए जाते हैं, और उन्हें video loss से exclude किया जाता है। ltx2_intrinsic_conditioning: condition objects का JSON array, जैसे[{"type":"first_frame","probability":1.0}]। Supportedtypevalues:first_frame,prefix,suffix,spatial_crop, औरmask।- Shorthand keys:
ltx2_first_frame_conditioning_probability,ltx2_prefix_conditioning_probability,ltx2_prefix_conditioning_frames,ltx2_suffix_conditioning_probability,ltx2_suffix_conditioning_frames, औरltx2_mask_conditioning_probability। maskके लिए value1का अर्थ clean conditioning/no loss है; value0normal noisy training है।- IC-LoRA reference scaling:
ltx2_reference_spatial_scale_factorऔरltx2_reference_temporal_scale_factorreference-token coordinates adjust करते हैं। unset होने पर spatial scale reference/target latent sizes से infer होता है। - IC-LoRA validation reference:
validation_ltx2_video_conditioningvalidation के लिए local reference videos की JSON list है, जैसे[{"path":"data/reference.mp4","strength":1.0}]। - Scope: ये settings केवल model-side LTX-2 conditioning behavior control करती हैं। Dataset pairing, mask files, reference datasets, WebUI controls, और dataset templates अलग से configure होते हैं।
🎛 Training Parameters¶
--num_train_epochs¶
- What: training epochs की संख्या (कितनी बार सभी images देखी जाती हैं)। इसे 0 सेट करने पर
--max_train_stepsको प्राथमिकता मिलती है। - Why: image repeats की संख्या तय करता है, जो training duration को प्रभावित करता है। अधिक epochs आम तौर पर overfitting का कारण बनते हैं, लेकिन आपके concepts सीखने के लिए आवश्यक हो सकते हैं। उचित मान 5 से 50 के बीच हो सकता है।
--max_train_steps¶
- What: इतने training steps के बाद training बंद होती है। 0 सेट करने पर
--num_train_epochsको प्राथमिकता मिलती है। - Why: training को छोटा करने के लिए उपयोगी।
--strict_epoch_limit¶
- What: epoch counter के
--num_train_epochsतक पहुंचते ही training रोकता है, भले ही--max_train_stepsअभी पूरा न हुआ हो। - Why: इसे explicit
--max_train_stepsruns के लिए बंद करें, जहां step limit तक पहुंचने के लिए अतिरिक्त epoch passes जारी रखने हैं।--max_train_steps=0वाली runs हमेशा epoch-driven होती हैं और strict epoch limit इस्तेमाल करती हैं।
--learning_rate¶
- What: संभावित warmup के बाद initial learning rate।
- Why: learning rate gradient updates के लिए एक तरह का "step size" है — बहुत अधिक होने पर solution से आगे निकल जाते हैं, बहुत कम होने पर ideal solution तक नहीं पहुँचते।
fulltune के लिए न्यूनतम मान1e-7और अधिकतम1e-6तक हो सकता है, जबकिloratuning के लिए न्यूनतम1e-5और अधिकतम1e-3तक हो सकता है। उच्च learning rate उपयोग करने पर EMA network और warmup लाभदायक होते हैं — देखें--use_ema,--lr_warmup_steps, और--lr_scheduler।
--lr_scheduler¶
- What: समय के साथ learning rate कैसे scale हो।
- Choices: constant, constant_with_warmup, cosine, cosine_with_restarts, polynomial (अनुशंसित), linear
- Why: loss landscape को explore करने के लिए learning rate को समय‑समय पर बदलना उपयोगी है। cosine schedule डिफ़ॉल्ट है, जिससे training दो extremes के बीच smooth तरीके से चलती है। constant learning rate में अक्सर बहुत ऊँचा या बहुत कम मान चुन लिया जाता है, जिससे divergence (बहुत ऊँचा) या local minima में फँसना (बहुत कम) होता है। polynomial schedule warmup के साथ सबसे अच्छा रहता है, जहाँ यह धीरे‑धीरे
learning_rateतक पहुँचता है और फिर धीरे‑धीरे--lr_endके पास पहुँचता है।
--optimizer¶
- What: training के लिए optimizer।
- Choices: adamw_bf16, ao-adamw8bit, ao-adamw4bit, ao-adamfp8, ao-adamwfp8, adamw_schedulefree, adamw_schedulefree+aggressive, adamw_schedulefree+no_kahan, optimi-stableadamw, optimi-adamw, optimi-lion, optimi-radam, optimi-ranger, optimi-adan, optimi-adam, optimi-sgd, soap, bnb-adagrad, bnb-adagrad8bit, bnb-adam, bnb-adam8bit, bnb-adamw, bnb-adamw8bit, bnb-adamw-paged, bnb-adamw8bit-paged, bnb-lion, bnb-lion8bit, bnb-lion-paged, bnb-lion8bit-paged, bnb-ademamix, bnb-ademamix8bit, bnb-ademamix-paged, bnb-ademamix8bit-paged, prodigy
Note: कुछ optimisers non‑NVIDIA hardware पर उपलब्ध नहीं हो सकते।
--optimizer_config¶
- What: optimizer settings को fine‑tune करें।
- Why: optimizers में बहुत सारे settings होते हैं, हर एक के लिए CLI argument देना व्यावहारिक नहीं है। इसलिए आप comma‑separated सूची देकर default settings override कर सकते हैं।
- Example: prodigy optimizer के लिए
d_coefसेट करना:--optimizer_config=d_coef=0.1
Note: Optimizer betas dedicated parameters
--optimizer_beta1,--optimizer_beta2से override किए जाते हैं।
--train_batch_size¶
- What: Training data loader के लिए global default batch size। Primary dataset अपने sampler microbatch size को
train_batch_sizeसे override कर सकता है; बिना override वाले datasets इस value का उपयोग करते हैं। - Why: model memory consumption, convergence quality, और training speed प्रभावित करता है। बड़ा batch size सामान्यतः बेहतर परिणाम देता है, लेकिन बहुत बड़ा batch size overfitting या destabilized training का कारण बन सकता है और training अवधि भी बढ़ा सकता है। प्रयोग ज़रूरी है, लेकिन सामान्यतः लक्ष्य यह है कि training speed घटाए बिना VRAM अधिकतम उपयोग में हो।
- Static configuration: Trainer-level learning-rate scaling और अन्य configuration या reporting, जहाँ एक fixed batch size चाहिए, dataset microbatch overrides के बावजूद इस global value का उपयोग करते हैं।
- Gradient accumulation: चुने गए datasets के resolved microbatch sizes अलग होने पर एक optimizer update का global sample total सभी accumulation microsteps और data-parallel ranks के actual local microbatch sizes का योग है। बिना override वाला selected dataset उस rank पर इस global default का उपयोग करता है। सामान्य global/effective batch-size formula exact per-update sample count के बजाय configured reference रहता है। Gradient checkpointing इस arithmetic को नहीं बदलता।
--gradient_accumulation_steps¶
- What: backward/update pass करने से पहले accumulate किए जाने वाले steps की संख्या; यह memory बचाने के लिए काम को कई batches में बाँट देता है, लेकिन training runtime बढ़ता है।
- Why: बड़े models या datasets को संभालने में उपयोगी।
Note: gradient accumulation steps उपयोग करते समय किसी भी optimizer के लिए fused backward pass enable न करें।
--allow_dataset_oversubscription¶
- What: aspect bucket उस dataset की bucket-sizing requirement से छोटा होने पर
repeatsस्वतः adjust करता है। - Why: multi‑GPU कॉन्फ़िगरेशन के लिए न्यूनतम requirements पूरी न होने पर training failure को रोकता है।
- How it works:
- हर dataset की bucket-sizing requirement की गणना करता है:
resolved dataset train_batch_size × num_gpus × gradient_accumulation_steps - यदि किसी aspect bucket में उस dataset की bucket-sizing requirement से कम samples हैं, तो
repeatsस्वतः बढ़ाता है - केवल तब लागू होता है जब dataset config में
repeatsexplicitly सेट न हो - adjustment और reasoning दिखाने के लिए warning लॉग करता है
- Use cases:
- कई GPUs के साथ छोटे datasets (< 100 images)
- datasets फिर से कॉन्फ़िगर किए बिना अलग batch sizes के साथ experimentation
- full dataset इकट्ठा करने से पहले prototyping
- Example: 25 images, 8 GPUs, और
train_batch_size=4के साथ dataset की bucket-sizing requirement 32 होती है। यह flagrepeats=1स्वतः सेट करेगा ताकि 50 samples (25 × 2) मिलें। - Note: यह dataloader कॉन्फ़िग में manually‑set
repeatsvalues को override नहीं करेगा।--disable_bucket_pruningकी तरह, यह flag बिना surprising behavior के सुविधा देता है।
Multi‑GPU training के लिए dataset sizing पर अधिक विवरण DATALOADER.md में देखें।
🛠 Advanced Optimizations¶
--use_ema¶
- What: मॉडल के training जीवनकाल में weights का exponential moving average रखना, मॉडल को समय‑समय पर खुद में back‑merge करने जैसा है।
- Why: अधिक system resources और थोड़ा अधिक runtime खर्च करके training stability बेहतर होती है।
--ema_device¶
- Choices:
cpu,accelerator; default:cpu - What: EMA weights updates के बीच कहाँ रखी जाएँ।
- Why: EMA को accelerator पर रखने से updates तेज़ होते हैं लेकिन VRAM लागत बढ़ती है। CPU पर रखने से memory दबाव कम होता है, लेकिन
--ema_cpu_onlyसेट न होने पर weights को शटल करना पड़ता है।
--ema_cpu_only¶
- What:
--ema_device=cpuहोने पर EMA weights को updates के लिए accelerator पर वापस ले जाने से रोकता है। - Why: बड़े EMAs के लिए host‑to‑device transfer समय और VRAM उपयोग बचाता है।
--ema_device=acceleratorहोने पर इसका प्रभाव नहीं है क्योंकि weights पहले से accelerator पर हैं।
--ema_foreach_disable¶
- What: EMA updates के लिए
torch._foreach_*kernels का उपयोग disable करता है। - Why: कुछ back‑ends या hardware combinations में foreach ops समस्याग्रस्त होते हैं। इन्हें disable करने पर scalar implementation उपयोग होती है, जिससे updates थोड़ा धीमे हो जाते हैं।
--ema_update_interval¶
- What: EMA shadow parameters कितनी बार update हों, यह कम करता है।
- Why: हर step पर update करना कई workflows के लिए आवश्यक नहीं। उदाहरण के लिए,
--ema_update_interval=100हर 100 optimizer steps पर EMA update करेगा, जिससे--ema_device=cpuया--ema_cpu_onlyके साथ overhead घटता है।
--ema_decay¶
- What: EMA updates लागू करते समय smoothing factor नियंत्रित करता है।
- Why: उच्च मान (उदा.
0.999) EMA को धीरे प्रतिक्रिया देने देते हैं लेकिन बहुत स्थिर weights देते हैं। कम मान (उदा.0.99) नए training signals के साथ तेज़ adapt होते हैं।
--ema_warmup_steps¶
- What: Configured optimizer step से पहले current weights को EMA में copy करता है, फिर सीधे
--ema_decayपर switch करता है। - Why: उन training recipes से match करता है जो EMA smoothing delay करती हैं पर EMA को initialization पर frozen नहीं छोड़ना चाहतीं। Default
0SimpleTuner का existing EMA ramp preserve करता है।
--snr_gamma¶
- What: min‑SNR weighted loss factor उपयोग करता है।
- Why: Minimum SNR gamma loss factor को schedule में timestep की स्थिति के अनुसार weigh करता है। बहुत noisy timesteps का योगदान कम होता है और कम‑noise timesteps का योगदान बढ़ता है। मूल पेपर द्वारा अनुशंसित मान 5 है, लेकिन आप 1 से 20 तक मान उपयोग कर सकते हैं (आमतौर पर 20 को max माना जाता है; 20 से ऊपर बदलाव कम होता है)। 1 सबसे मजबूत प्रभाव देता है।
--use_soft_min_snr¶
- What: loss landscape पर अधिक gradual weighting के साथ मॉडल ट्रेन करता है।
- Why: pixel diffusion models training में विशिष्ट loss weighting schedule के बिना degrade हो सकते हैं। DeepFloyd में soft‑min‑snr‑gamma लगभग अनिवार्य पाया गया। Latent diffusion models में आपको सफलता मिल सकती है, लेकिन छोटे प्रयोगों में इससे blurry results होने की संभावना दिखी।
--flow_cubic_schedule_weights¶
- What: 0 से 1 तक समान दूरी वाले points पर non-negative weights से density बनाकर flow-matching timesteps sample करता है। JSON array या comma-separated values दें। शून्य या एक weight uniform distribution चुनता है, दो weights linear density बनाते हैं, और तीन या अधिक monotone cubic-Hermite interpolation उपयोग करते हैं।
- Why: Schedule को discrete timesteps तक सीमित किए बिना training को चुने हुए noise regions पर केंद्रित करता है। Model की native timestep convention और configured flow schedule shift लागू रहते हैं।
- Conflicts:
--flow_use_uniform_schedule,--flow_use_beta_schedule,--flux_fast_schedule, या--flow_custom_timestepsके साथ उपयोग नहीं किया जा सकता। - Example:
"flow_cubic_schedule_weights": [0.1, 1.0, 0.3, 2.0]
--diff2flow_enabled¶
- What: epsilon या v‑prediction models के लिए Diffusion‑to‑Flow bridge सक्षम करता है।
- Why: model architecture बदले बिना standard diffusion objectives वाले मॉडल्स को flow‑matching targets (noise - latents) उपयोग करने देता है।
- Note: Experimental फीचर।
--diff2flow_loss¶
- What: native prediction loss की बजाय Flow Matching loss पर training।
- Why:
--diff2flow_enabledके साथ enabled होने पर, loss को model के native target (epsilon या velocity) की जगह flow target (noise - latents) के खिलाफ compute करता है। - Note:
--diff2flow_enabledआवश्यक है।
--mixflow_enabled¶
- What: Flow Matching models के लिए MixFlow slowed-interpolation post-training सक्षम करता है।
- Why: Model architecture बदले बिना timestep sampling और interpolation speed बदलता है।
- Note: इसे अन्य timestep schedules के साथ उपयोग नहीं किया जा सकता। MixFlow guide देखें।
--mixflow_gamma¶
- What: MixFlow slowed-interpolation range को नियंत्रित करता है।
- Range:
0.0से1.0; default:0.8। - Note:
0.0standard interpolation को बनाए रखते हुए MixFlow timestep sampling का उपयोग करता है।
--scheduled_sampling_max_step_offset¶
- What: training के दौरान "roll out" होने वाले steps की अधिकतम संख्या।
- Why: Scheduled Sampling (Rollout) सक्षम करता है, जहाँ मॉडल training के दौरान कुछ steps के लिए अपने inputs खुद generate करता है। इससे मॉडल अपनी गलतियाँ सुधारना सीखता है और exposure bias घटता है।
- Default: 0 (disabled). सक्षम करने के लिए सकारात्मक integer (उदा., 5 या 10) दें।
--scheduled_sampling_strategy¶
- What: rollout offset चुनने की रणनीति।
- Choices:
uniform,biased_early,biased_late. - Default:
uniform. - Why: rollout लंबाइयों का distribution नियंत्रित करता है।
uniformसमान रूप से sample करता है;biased_earlyछोटे rollouts को प्राथमिकता देता है;biased_lateलंबे rollouts को प्राथमिकता देता है।
--scheduled_sampling_probability¶
- What: किसी sample के लिए non‑zero rollout offset लागू होने की संभावना।
- Default: 0.0.
- Why: scheduled sampling कितनी बार लागू हो, यह नियंत्रित करता है। 0.0 इसे disable करता है चाहे
max_step_offset> 0 हो। 1.0 हर sample पर लागू करता है।
--scheduled_sampling_prob_start¶
- What: ramp की शुरुआत में scheduled sampling की initial probability।
- Default: 0.0.
--scheduled_sampling_prob_end¶
- What: ramp के अंत में scheduled sampling की final probability।
- Default: 0.5.
--scheduled_sampling_ramp_steps¶
- What:
prob_startसेprob_endतक probability बढ़ाने के steps की संख्या। - Default: 0 (कोई ramp नहीं)।
--scheduled_sampling_start_step¶
- What: scheduled sampling ramp शुरू करने का global step।
- Default: 0.0.
--scheduled_sampling_ramp_shape¶
- What: probability ramp का आकार।
- Choices:
linear,cosine. - Default:
linear.
--scheduled_sampling_sampler¶
- What: rollout generation steps के लिए उपयोग किया जाने वाला solver।
- Choices:
unipc,euler,dpm. - Default:
unipc.
--scheduled_sampling_order¶
- What: rollout के लिए solver का order।
- Default: 2.
--scheduled_sampling_reflexflow¶
- What: flow‑matching models के लिए scheduled sampling के दौरान ReflexFlow‑style enhancements (anti‑drift + frequency‑compensated weighting) सक्षम करें।
- Why: directional regularization और bias‑aware loss weighting जोड़कर flow‑matching models में exposure bias घटाता है।
- Default:
--scheduled_sampling_max_step_offset> 0 होने पर flow‑matching models के लिए auto‑enable;--scheduled_sampling_reflexflow=falseसे override करें।
--scheduled_sampling_reflexflow_alpha¶
- What: exposure bias से निकले frequency‑compensation weight का scaling factor।
- Default: 1.0.
- Why: flow‑matching models में rollout के दौरान बड़े exposure bias वाले क्षेत्रों को अधिक weight देता है।
--scheduled_sampling_reflexflow_beta1¶
- What: ReflexFlow anti‑drift (directional) regularizer का weight।
- Default: 10.0.
- Why: flow‑matching models में scheduled sampling उपयोग करते समय मॉडल को target clean sample के साथ अपनी predicted direction align करने के लिए कितना मजबूती से प्रोत्साहित किया जाए, यह नियंत्रित करता है।
--scheduled_sampling_reflexflow_beta2¶
- What: ReflexFlow frequency‑compensation (loss reweighting) term का weight।
- Default: 1.0.
- Why: reweighted flow‑matching loss को scale करता है, जैसा ReflexFlow paper में β₂ knob के रूप में बताया गया है।
🎯 iREPA (Improved Representation Alignment)¶
iREPA convolution projector और per-frame spatial normalization से representation alignment में spatial structure बनाए रखता है। यह Transformers के CREPA और UNets के U-REPA को बेहतर बनाता है। iREPA guide देखें।
--irepa_enabled¶
- Type: Boolean flag
- Default:
false - What: चालू CREPA या U-REPA path में iREPA spatial operations जोड़ता है।
- Note: Transformer के लिए
crepa_enabledया UNet के लिएurepa_enabledभी चालू करें। - Training mode: Full-model या standard PEFT LoRA। Auxiliary projector save न कर पाने के कारण LyCORIS supported नहीं है।
--irepa_spatial_norm_alpha¶
- Type: Float
- Default:
0.6 - What: Spatial standard deviation से divide करने से पहले teacher-feature mean subtraction को scale करता है।
- Note:
0.6latent-diffusion reference setting है;1.0हर channel को पूरी तरह center करता है।
--irepa_projector_kernel_size¶
- Type: Integer (
1,3,5, या7) - Default:
3 - What: Alignment projector का spatial convolution kernel सेट करता है।
🎯 CREPA (Cross-frame Representation Alignment)¶
CREPA एक regularization तकनीक है जो video diffusion models की fine‑tuning में temporal consistency सुधारती है, adjacent frames से pretrained visual features के साथ hidden states align करके। यह पेपर "Cross-Frame Representation Alignment for Fine-Tuning Video Diffusion Models" पर आधारित है।
--crepa_enabled¶
- What: training के दौरान CREPA regularization सक्षम करें।
- Why: पड़ोसी frames के DINOv2 features के साथ DiT hidden states align करके वीडियो frames में semantic consistency बढ़ाता है।
- Default:
false - Note: केवल Transformer-आधारित diffusion models (DiT शैली) पर लागू। UNet models (SDXL, SD1.5, Kolors) के लिए U-REPA का उपयोग करें।
--crepa_block_index¶
- What: alignment के लिए किस transformer block के hidden states उपयोग हों।
- Why: पेपर CogVideoX के लिए block 8 और Hunyuan Video के लिए block 10 सुझाता है। शुरुआती blocks अक्सर बेहतर काम करते हैं क्योंकि वे DiT का "encoder" हिस्सा होते हैं।
- Required: हाँ, जब CREPA enabled हो।
--crepa_lambda¶
- What: मुख्य training loss के मुकाबले CREPA alignment loss का weight।
- Why: alignment regularization training को कितना प्रभावित करे, यह नियंत्रित करता है। पेपर CogVideoX के लिए 0.5 और Hunyuan Video के लिए 1.0 उपयोग करता है।
- Default:
0.5
--crepa_adjacent_distance¶
- What: neighbor frame alignment के लिए दूरी
d। - Why: पेपर की Equation 6 के अनुसार, \(K = \{f-d, f+d\}\) बताता है कि किन neighboring frames से align करना है।
d=1होने पर हर frame अपने immediate neighbors से align करता है। - Default:
1
--crepa_adjacent_tau¶
- What: exponential distance weighting के लिए temperature coefficient।
- Why: \(e^{-|k-f|/\tau}\) के जरिए alignment weight कितनी जल्दी decay हो, यह नियंत्रित करता है। कम मान immediate neighbors पर अधिक जोर देता है।
- Default:
1.0
--crepa_cumulative_neighbors¶
- What: adjacent mode की जगह cumulative mode उपयोग करें।
- Why:
- Adjacent mode (डिफ़ॉल्ट): केवल exact दूरी
dवाले frames से align करता है (पेपर के \(K = \{f-d, f+d\}\) जैसा) - Cumulative mode: दूरी 1 से
dतक सभी frames से align करता है, smoother gradients देता है - Default:
false
--crepa_normalize_neighbour_sum¶
- What: neighbor‑sum alignment को per‑frame weight sum से normalize करें।
- Why:
crepa_alignment_scoreको [-1, 1] में रखता है और loss scale को अधिक literal बनाता है। यह पेपर की Eq. (6) से experimental deviation है। - Default:
false
--crepa_normalize_by_frames¶
- What: alignment loss को frames की संख्या से normalize करें।
- Why: video length के बावजूद loss scale consistent रहता है। Disable करने पर लंबे videos को stronger alignment signal मिलता है।
- Default:
true
--crepa_spatial_align¶
- What: जब DiT और encoder के token counts अलग हों तो spatial interpolation उपयोग करें।
- Why: DiT hidden states और DINOv2 features की spatial resolutions अलग हो सकती हैं। सक्षम होने पर bilinear interpolation उन्हें spatially align करता है; disabled होने पर global pooling fallback होता है।
- Default:
true
--crepa_model¶
- What: feature extraction के लिए कौन‑सा pretrained encoder उपयोग हो।
- Why: पेपर DINOv2‑g (ViT‑Giant) उपयोग करता है। छोटे DINO variants कम memory लेते हैं, जबकि Qwen-VL teacher अधिक मजबूत semantic visual features दे सकते हैं।
- Default:
dinov2_vitg14 - Choices:
dinov2_vitg14,dinov2_vitb14,dinov2_vits14,qwen3-vl-4b,qwen2.5-vl-7b, या Hugging Face Qwen-VL model id।
--crepa_encoder_frames_batch_size¶
- What: external feature encoder parallel में कितने frames प्रोसेस करे। 0 या negative होने पर पूरे batch के सभी frames एक साथ प्रोसेस होते हैं। यदि संख्या divisor नहीं है, तो remainder छोटे batch के रूप में संभाला जाएगा।
- Why: external vision encoders VRAM बचाने के लिए frames को sliced batches में प्रोसेस कर सकते हैं, गति की कीमत पर।
- Default:
-1
--crepa_use_backbone_features¶
- What: external encoder skip करें और diffusion model के अंदर student block को teacher block के साथ align करें।
- Why: जब backbone के पास पहले से मजबूत semantic layer हो, तब DINOv2 लोड करने से बचता है।
- Default:
false
--crepa_feature_source¶
- What: चुनता है कि CREPA अपना teacher signal कहां से ले।
- Why: classic external encoder path के लिए
encoder, internal block-to-block alignment के लिएbackbone, और Self-Flow के cleaner EMA teacher view के लिएself_flowउपयोग करें। - Choices:
encoder,backbone,self_flow - Default:
encoder
--crepa_self_flow¶
- What: Self-Flow mode enable करने वाला legacy boolean alias।
- Why: पुराने configs अब भी इसका उपयोग कर सकते हैं, लेकिन नए configs को
crepa_feature_source=self_flowउपयोग करना चाहिए। - Default:
false - Note: यह
crepa_use_backbone_featuresऔर किसी दूसरे mode वालेcrepa_feature_sourceके साथ conflict करता है।
--crepa_self_flow_mask_ratio¶
- What: Self-Flow में alternate timestep पाने वाले tokens का fraction।
- Why: यह cleaner और noisier tokens के बीच information asymmetry नियंत्रित करता है। ऊंचे values self-supervised signal को मजबूत करते हैं, लेकिन training unstable भी कर सकते हैं।
- Default:
0.1 - Range:
0.0से0.5
--crepa_teacher_block_index¶
- What: backbone features या Self-Flow उपयोग करते समय teacher block index।
- Why: external encoder के बिना earlier student block को later teacher block से align करने देता है। Self-Flow में यह explicitly जरूरी है ताकि EMA teacher deeper semantic layer से पढ़े।
- Default: backbone mode में नहीं दिया गया तो
crepa_block_indexउपयोग होगा; Self-Flow mode में यह required है।
--crepa_encoder_image_size¶
- What: encoder के लिए input resolution।
- Why: DINOv2 models अपने training resolution पर बेहतर काम करते हैं। giant model 518x518 उपयोग करता है।
- Default:
518
--crepa_scheduler¶
- What: training के दौरान CREPA coefficient decay का schedule।
- Why: जैसे-जैसे training आगे बढ़े, CREPA regularization strength को कम करने देता है, deep encoder features पर overfitting रोकता है।
- Options:
constant,linear,cosine,polynomial - Default:
constant
--crepa_warmup_steps¶
- What: CREPA weight को 0 से
crepa_lambdaतक linearly ramp करने के लिए steps की संख्या। - Why: gradual warmup CREPA regularization शुरू होने से पहले early training को stabilize करने में मदद कर सकता है।
- Default:
0
--crepa_decay_steps¶
- What: decay के लिए कुल steps (warmup के बाद)। 0 सेट करने पर पूरी training run पर decay होगा।
- Why: decay phase की duration नियंत्रित करता है। warmup पूरा होने के बाद decay शुरू होता है।
- Default:
0(max_train_stepsउपयोग होगा)
--crepa_lambda_end¶
- What: decay पूरा होने के बाद final CREPA weight।
- Why: 0 सेट करने पर training के अंत में CREPA प्रभावी रूप से disable हो जाता है, text2video के लिए उपयोगी जहाँ CREPA artifacts पैदा कर सकता है।
- Default:
0.0
--crepa_power¶
- What: polynomial decay के लिए power factor। 1.0 = linear, 2.0 = quadratic, आदि।
- Why: higher values शुरुआत में तेज decay करते हैं जो अंत की ओर धीमा हो जाता है।
- Default:
1.0
--crepa_cutoff_step¶
- What: hard cutoff step जिसके बाद CREPA disable हो जाता है।
- Why: model temporal alignment पर converge होने के बाद CREPA disable करने के लिए उपयोगी।
- Default:
0(कोई step-based cutoff नहीं)
--crepa_similarity_threshold¶
- What: similarity EMA threshold जिस पर CREPA cutoff trigger होता है।
- Why: जब alignment score (
crepa_alignment_score) का exponential moving average इस मान तक पहुँचता है, तो deep encoder features पर overfitting रोकने के लिए CREPA disable हो जाता है। text2video training के लिए विशेष रूप से उपयोगी।crepa_normalize_neighbour_sumenable न होने पर alignment score 1.0 से ऊपर जा सकता है। - Default: None (disabled)
--crepa_similarity_ema_decay¶
- What: similarity tracking के लिए exponential moving average decay factor।
- Why: higher values smoother tracking देते हैं (0.99 ≈ 100-step window), lower values changes पर तेज react करते हैं।
- Default:
0.99
--crepa_threshold_mode¶
- What: similarity threshold पहुँचने पर व्यवहार।
- Options:
permanent(threshold hit होने पर CREPA permanently off रहता है),recoverable(similarity गिरने पर CREPA फिर से enable होता है) - Default:
permanent
Example Configuration¶
# Enable CREPA for video fine-tuning
crepa_enabled = true
crepa_block_index = 8 # Adjust based on your model
crepa_lambda = 0.5
crepa_adjacent_distance = 1
crepa_adjacent_tau = 1.0
crepa_cumulative_neighbors = false
crepa_normalize_neighbour_sum = false
crepa_normalize_by_frames = true
crepa_spatial_align = true
crepa_model = "dinov2_vitg14" # या Qwen-VL visual features के लिए "qwen3-vl-4b"
crepa_encoder_frames_batch_size = -1
crepa_use_backbone_features = false
# crepa_teacher_block_index = 16
crepa_encoder_image_size = 518
# CREPA Scheduling (optional)
# crepa_scheduler = "cosine" # Decay type: constant, linear, cosine, polynomial
# crepa_warmup_steps = 100 # Warmup before CREPA kicks in
# crepa_decay_steps = 1000 # Steps for decay (0 = entire training)
# crepa_lambda_end = 0.0 # Final weight after decay
# crepa_cutoff_step = 5000 # Hard cutoff step (0 = disabled)
# crepa_similarity_threshold = 0.9 # Similarity-based cutoff
# crepa_threshold_mode = "permanent" # permanent or recoverable
🎯 U-REPA (UNet Representation Alignment)¶
U-REPA UNet आधारित diffusion models (SDXL, SD1.5, Kolors) के लिए regularization तकनीक है। यह UNet mid-block features को pretrained vision features के साथ align करता है और relative similarity structure रखने के लिए manifold loss जोड़ता है।
--urepa_enabled¶
- What: training के दौरान U-REPA enable करें।
- Why: frozen vision encoder के साथ UNet mid-block features का representation alignment जोड़ता है।
- Default:
false - Note: केवल UNet models (SDXL, SD1.5, Kolors) पर लागू।
--urepa_lambda¶
- What: मुख्य training loss के मुकाबले U-REPA alignment loss का weight।
- Why: regularization की strength नियंत्रित करता है।
- Default:
0.5
--urepa_manifold_weight¶
- What: manifold loss का weight (alignment loss के मुकाबले)।
- Why: relative similarity structure पर ज़ोर देता है (paper default 3.0)।
- Default:
3.0
--urepa_model¶
- What: frozen vision encoder के लिए torch hub identifier।
- Why: default DINOv2 ViT-G/14; छोटे मॉडल (जैसे
dinov2_vits14) तेज़ होते हैं। - Default:
dinov2_vitg14
--urepa_encoder_image_size¶
- What: vision encoder preprocessing के लिए input resolution।
- Why: encoder की native resolution रखें (DINOv2 ViT-G/14 के लिए 518; ViT-S/14 के लिए 224)।
- Default:
518
--urepa_use_tae¶
- What: full VAE की जगह Tiny AutoEncoder उपयोग करें।
- Why: तेज़ और कम VRAM, लेकिन decoded image quality कम।
- Default:
false
--urepa_scheduler¶
- What: training के दौरान U-REPA coefficient decay schedule।
- Why: training बढ़ने के साथ regularization strength कम करने में मदद।
- Options:
constant,linear,cosine,polynomial - Default:
constant
--urepa_warmup_steps¶
- What: U-REPA weight को 0 से
urepa_lambdaतक linearly बढ़ाने के steps। - Why: शुरुआती training को stabilize करता है।
- Default:
0
--urepa_decay_steps¶
- What: decay के लिए कुल steps (warmup के बाद)। 0 मतलब पूरे training में decay।
- Why: decay phase की duration नियंत्रित करता है।
- Default:
0(max_train_steps)
--urepa_lambda_end¶
- What: decay के बाद final U-REPA weight।
- Why: 0 रखने पर training के अंत में U-REPA effectively disable हो जाता है।
- Default:
0.0
--urepa_power¶
- What: polynomial decay power। 1.0 = linear, 2.0 = quadratic आदि।
- Why: बड़ा मान शुरुआत में तेज़ decay और अंत में धीमा करता है।
- Default:
1.0
--urepa_cutoff_step¶
- What: इस step के बाद U-REPA बंद।
- Why: alignment converge होने के बाद बंद करने के लिए।
- Default:
0(no cutoff)
--urepa_similarity_threshold¶
- What: similarity EMA threshold जिस पर U-REPA cutoff ट्रिगर हो।
- Why:
urepa_similarityका EMA इस मान तक पहुंचते ही U-REPA disable होता है, overfitting रोकने के लिए। - Default: None (disabled)
--urepa_similarity_ema_decay¶
- What: similarity tracking के लिए EMA decay factor।
- Why: बड़ा मान smooth (0.99 ≈ 100-step window), छोटा मान तेज़ प्रतिक्रिया।
- Default:
0.99
--urepa_threshold_mode¶
- What: threshold पहुंचने पर व्यवहार।
- Options:
permanent(एक बार बंद तो हमेशा बंद),recoverable(similarity गिरने पर फिर enable) - Default:
permanent
Example Configuration¶
# UNet fine-tuning के लिए U-REPA enable करें (SDXL, SD1.5, Kolors)
urepa_enabled = true
urepa_lambda = 0.5
urepa_manifold_weight = 3.0
urepa_model = "dinov2_vitg14"
urepa_encoder_image_size = 518
urepa_use_tae = false
# U-REPA Scheduling (optional)
# urepa_scheduler = "cosine" # Decay type: constant, linear, cosine, polynomial
# urepa_warmup_steps = 100 # U-REPA शुरू होने से पहले warmup
# urepa_decay_steps = 1000 # Decay steps (0 = पूरे training में)
# urepa_lambda_end = 0.0 # Decay के बाद final weight
# urepa_cutoff_step = 5000 # Hard cutoff step (0 = disabled)
# urepa_similarity_threshold = 0.9 # Similarity-based cutoff
# urepa_threshold_mode = "permanent" # permanent या recoverable
🔄 Checkpointing and Resumption¶
--checkpoint_step_interval (alias: --checkpointing_steps)¶
- What: training state checkpoints कितने steps पर सेव हों (steps में interval)।
- Why: training resume और inference के लिए उपयोगी। हर n iterations पर Diffusers filesystem layout में
.safetensorsformat का partial checkpoint सेव होगा।
Internal Guidance¶
Internal Guidance शुरुआती diffusion-transformer block को final output head वाले denoising target से supervise करता है। Internal Guidance देखें।
--internal_guidance_enabled¶
- क्या: Auxiliary denoising head और loss enable करता है।
- Support: Standard PEFT LoRA या full-model diffusion transformer training। UNet, autoregressive और LyCORIS reject होते हैं।
- Default:
false
--internal_guidance_loss_weight¶
- क्या: Intermediate loss multiplier।
- Default:
0.5; zero से अधिक होना चाहिए।
--internal_guidance_block_index¶
- क्या: Zero-based transformer block।
- Default: Transformer depth का एक चौथाई।
--validation_internal_guidance_scale¶
- क्या: Validation sampling में
intermediate + scale * (final - intermediate)लागू करता है। - Default:
1.0(disabled); reference1.4उपयोग करता है।
Explorative Modeling (XM)¶
XM कई training candidates score करता है और हर supervised sample या token block को सबसे अच्छी तरह explain करने वाले candidate पर ही backprop करता है। चुने गए target के लिए model family में support implement होना चाहिए। User guide के लिए Explorative Modeling देखें।
--xm_enabled¶
- क्या: XM candidate selection enable करता है।
- Default:
false
--xm_candidate_count¶
- क्या: हर sample के लिए score किए जाने वाले noise या route latent candidates की संख्या।
- Default:
1; XM enabled होने पर कम से कम2होना चाहिए।
--xm_training_target¶
- क्या: Candidate type। Diffusion/flow models के लिए
noise, AR/RVQ planners के लिएrouteउपयोग करें। - Choices:
noise,route - Default:
noise
--xm_selection_scope¶
- क्या: Winners को
sampleया token/frameblockपर चुनता है। - Default:
sample
--xm_block_size¶
- क्या: Block-level XM के लिए token या frame span।
0पूरी supervised sequence उपयोग करता है। - Default:
0
NextLat¶
NextLat एक छोटा auxiliary predictor जोड़ता है जो हर captured hidden token को अगले hidden token पर map करता है। इसके लिए ऐसा transformer model family चाहिए जो SimpleTuner hidden-state buffer से hidden states expose करे। User guide के लिए NextLat देखें।
--nextlat_enabled¶
- क्या: NextLat hidden-state prediction enable करता है।
- Default:
false
--nextlat_block_index¶
- क्या: Capture करने वाला zero-based transformer block।
- Default:
-1, यानी अंतिम supported block।
--nextlat_weight¶
- क्या: NextLat auxiliary loss multiplier।
- Default:
0.0; NextLat enabled होने पर zero से अधिक होना चाहिए।
--nextlat_state_loss¶
- क्या: अगले hidden state prediction के लिए distance function।
- Choices:
smooth_l1,mse - Default:
smooth_l1
--nextlat_kl_weight¶
- क्या: जब model family predicted hidden states के लिए logits head देती है तो optional KL agreement weight।
- Default:
0.0
🔁 LayerSync (Hidden State Self-Alignment)¶
LayerSync एक "student" layer को उसी transformer के एक मजबूत "teacher" layer से match करने के लिए प्रोत्साहित करता है, hidden tokens पर cosine similarity का उपयोग करके।
--layersync_enabled¶
- What: एक ही मॉडल के अंदर दो transformer blocks के बीच LayerSync hidden‑state alignment सक्षम करें।
- Notes: hidden‑state buffer allocate करता है; required flags missing हों तो startup पर error देता है।
- Default:
false
--layersync_student_block¶
- What: student anchor के रूप में उपयोग होने वाला transformer block index।
- Indexing: LayerSync पेपर‑style 1‑based depths या 0‑based layer ids स्वीकार करता है; implementation पहले
idx-1आज़माता है, फिरidx। - Required: हाँ, जब LayerSync enabled हो।
--layersync_teacher_block¶
- What: teacher target के रूप में उपयोग होने वाला transformer block index (student से गहरा हो सकता है)।
- Indexing: student block की तरह ही 1‑based‑first, फिर 0‑based fallback।
- Default: omit होने पर student block ही उपयोग होता है ताकि loss self‑similarity बन जाए।
--layersync_lambda¶
- What: student और teacher hidden states के बीच LayerSync cosine alignment loss (negative cosine similarity) का weight।
- Effect: base loss के ऊपर जोड़ा गया auxiliary regularizer scale करता है; उच्च मान student tokens को teacher tokens से अधिक alignment के लिए push करते हैं।
- Upstream name: मूल LayerSync codebase में
--reg-weight. - Required: LayerSync enabled होने पर > 0 होना चाहिए (अन्यथा training abort होती है)।
- Default: LayerSync enabled होने पर
0.2(reference repo से मेल), अन्यथा0.0.
Upstream option mapping (LayerSync → SimpleTuner):
- --encoder-depth → --layersync_student_block (upstream जैसा 1‑based depth या 0‑based layer index स्वीकार करता है)
- --gt-encoder-depth → --layersync_teacher_block (1‑based preferred; omit होने पर student पर डिफ़ॉल्ट)
- --reg-weight → --layersync_lambda
Notes: LayerSync हमेशा similarity से पहले teacher hidden state detach करता है, reference implementation से मेल खाते हुए। यह उन मॉडलों पर निर्भर करता है जो transformer hidden states expose करते हैं (SimpleTuner के अधिकांश transformer backbones) और hidden‑state buffer के लिए per‑step memory जोड़ता है; VRAM tight हो तो disable करें।
--checkpoint_epoch_interval¶
- What: हर N पूर्ण epochs पर checkpointing चलाएँ।
- Why: step‑based checkpoints को पूरक करता है, ताकि multi‑dataset sampling के कारण step counts बदलने पर भी epoch boundaries पर state capture हो सके।
--resume_from_checkpoint¶
- What: training resume करना है या नहीं और कहाँ से।
latest, local checkpoint नाम/पथ, या S3/R2 URI स्वीकार करता है। - Why: saved state से training जारी रखने देता है, manual रूप से या latest उपलब्ध checkpoint से।
- Remote resume: पूरा URI (
s3://bucket/jobs/.../checkpoint-100) या bucket-relative key (jobs/.../checkpoint-100) दें।latestकेवल localoutput_dirपर काम करता है。 - Requirements: remote resume के लिए publishing_config में S3 entry (bucket + credentials) चाहिए जो checkpoint read कर सके।
- Notes: remote checkpoints में
checkpoint_manifest.jsonहोना चाहिए (हाल की SimpleTuner runs से generated)। एक checkpoint मेंunetऔर वैकल्पिक रूप सेunet_emasubfolder होता है।unetको किसी भी Diffusers layout SDXL मॉडल में रखा जा सकता है, जिससे इसे सामान्य मॉडल की तरह उपयोग किया जा सकता है।
ℹ️ PixArt, SD3, या Hunyuan जैसे transformer मॉडल
transformerऔरtransformer_emasubfolder नाम उपयोग करते हैं।
--init_lora_step¶
- What:
--init_loraसे load किए गए model-only adapter के global-step accounting को जारी रखें। - When: इसका उपयोग केवल तभी करें जब full trainer checkpoint उपलब्ध न हो, लेकिन LoRA weights उपलब्ध हों।
- Automatic inference: यह option न देने पर, local
--init_lorasafetensors file मेंglobal_stepmetadata मौजूद हो तो SimpleTuner उसका उपयोग करता है।0सहित कोई explicit value metadata को override करती है। - Requirements: मान non-negative और
--max_train_stepsसे छोटा होना चाहिए;--init_loraआवश्यक है और इसे--resume_from_checkpointके साथ उपयोग नहीं किया जा सकता। - State: Checkpoint और validation cadence इस step से जारी रहते हैं, लेकिन optimizer, sampler और RNG state नए सिरे से शुरू होते हैं।
constantऔरconstant_with_warmuplearning-rate schedules संबंधित step पर restore होते हैं।
--init_lora_ema¶
- What:
--init_loraसे संबंधित raw SimpleTunerema_model.ptstate load करें। - Requirements:
--init_loraऔर--use_ema=trueदोनों आवश्यक हैं। - Note: यह checkpoint के साथ save किए गए raw EMA state की अपेक्षा करता है, exported EMA LoRA safetensors file की नहीं।
--delete_invalid_checkpoints¶
- What: resume करते समय जो local checkpoints load नहीं हो सकते उन्हें delete करें।
- Behavior:
--resume_from_checkpoint=latestके साथ SimpleTuner invalid local checkpoints हटाकर next latest checkpoint आज़माता है। नए checkpoints resume के लिए जरूरी files सेव होने के बाद.guardfile लिखते हैं, इसलिए किसी पुराने guarded checkpoint के मौजूद होने पर बिना guard वाला नया checkpoint discard किया जा सकता है। - Safety: केवल
output_dirके अंदर local checkpoint directories delete होते हैं। explicit checkpoint paths deletion के बाद भी original load failure raise करते हैं। - Default:
false
--disk_low_threshold¶
- What: checkpoint saves और TorchInductor graph compilation (दोबारा compilation सहित) से पहले आवश्यक न्यूनतम खाली disk space।
- Why: कम space का जल्दी पता लगाकर checkpoint या compiler cache के filesystem पर configured action लागू करता है।
- Format: size string जैसे
100G,50M,1T,500K, या plain bytes। - Default: None (feature disabled)
- Scope: compilation करने वाला हर process
TORCHINDUCTOR_CACHE_DIR(या PyTorch की default directory) और configured होने पर अलगTRITON_CACHE_DIRकी जाँच करता है। यह केवल पहले की जाँच है, space आरक्षित नहीं करता: compilation शुरू होने के बाद भी disk भर सकती है और backend initialization जाँच से पहले लिख सकता है। compilation के लिए पर्याप्त threshold चुनें। यह CUDA out-of-memory errors से recovery या failed compilation को retry नहीं करता।
--disk_low_action¶
- What: disk space threshold से कम होने पर लिया जाने वाला action।
- Choices:
stop,wait,script - Default:
stop - Behavior:
stop: error message के साथ training तुरंत समाप्त करता है।wait: space उपलब्ध होने तक हर 30 seconds में loop करता है। अनिश्चित काल तक प्रतीक्षा कर सकता है।script: space खाली करने के लिए--disk_low_scriptद्वारा specified script चलाता है।
--disk_low_script¶
- What: disk space कम होने पर चलाने के लिए cleanup script का path।
- Why: disk space कम होने पर automated cleanup (जैसे पुराने checkpoints हटाना, cache clear करना) की अनुमति देता है।
- Notes: केवल
--disk_low_action=scriptहोने पर उपयोग होता है। script executable होना चाहिए। यदि script fail होती है या पर्याप्त space खाली नहीं करती, training error के साथ रुक जाएगी। - Default: None
📊 Logging and Monitoring¶
--logging_dir¶
- What: TensorBoard logs के लिए directory।
- Why: training progress और performance metrics मॉनिटर करने देता है।
--report_to¶
- What: results और logs रिपोर्ट करने के लिए platform निर्दिष्ट करता है।
- Why: स्थानीय या external monitoring चालू करता है।
simpletuner,output_dirमें JSONL, manifest, validation media metadata और self-contained HTML report लिखता है। multiple trackers के लिए comma-separated values उपयोग करें। - Choices: simpletuner, wandb, tensorboard, swanlab, comet_ml, custom-tracker, none
--validation_image_format¶
- What:
output_dir/validation_imagesमें save होने वाली images का format। - Choices: png, webp, jpeg
- Default: png
--validation_image_quality¶
- What: WebP और JPEG quality, 1 से 100।
- Default: 90। PNG के लिए ignored है।
Environment configuration variables¶
ऊपर दिए गए विकल्प अधिकतर config.json पर लागू होते हैं — लेकिन कुछ entries config.env में सेट करनी पड़ती हैं।
TRAINING_NUM_PROCESSESको सिस्टम में GPUs की संख्या पर सेट करें। अधिकांश उपयोग‑मामलों में इससे DistributedDataParallel (DDP) training सक्षम हो जाती है। यदि आपconfig.envउपयोग नहीं करना चाहते, तोconfig.jsonमेंnum_processesउपयोग करें।TRAINING_DYNAMO_BACKENDडिफ़ॉल्ट रूप सेnoहै, लेकिन इसे किसी भी समर्थित torch.compile backend (उदा.inductor,aot_eager,cudagraphs) पर सेट किया जा सकता है और--dynamo_mode,--dynamo_fullgraph, या--dynamo_use_regional_compilationके साथ finer tuning के लिए जोड़ा जा सकता हैSIMPLETUNER_LOG_LEVELडिफ़ॉल्ट रूप सेINFOहै, लेकिन issue reports के लिएdebug.logमें अधिक जानकारी जोड़ने हेतु इसेDEBUGपर सेट किया जा सकता हैSIMPLETUNER_ALLOW_MODIFYING_BSZ=1checkpoint से resume करते समय sampler batch_size मेल न खाने की जांच को छोड़ देता है। इसे केवल तभी उपयोग करें जब आपने जानबूझकरtrain_batch_sizeबदला हो और असंगत sampler state के जोखिम को स्वीकार करते हों।--i_know_what_i_am_doingके समकक्ष है।VENV_PATHको आपके python virtual env की लोकेशन पर सेट किया जा सकता है यदि वह सामान्य.venvलोकेशन में नहीं हैACCELERATE_EXTRA_ARGSको unset छोड़ा जा सकता है, या इसमें--multi_gpuया FSDP‑specific flags जैसे अतिरिक्त arguments जोड़े जा सकते हैं
यह एक बेसिक overview है ताकि आप शुरुआत कर सकें। पूर्ण options सूची और अधिक विस्तृत स्पष्टीकरण के लिए, कृपया पूरी specification देखें:
कमांड लाइन संदर्भ¶
उपयोग¶
usage: train.py [-h] --model_family
{kolors,auraflow,omnigen,flux,deepfloyd,cosmos2image,sana,qwen_image,pixart_sigma,sdxl,sd1x,sd2x,wan,hidream,sd3,lumina2,ltxvideo}
[--model_flavour MODEL_FLAVOUR] [--controlnet [CONTROLNET]]
[--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH]
--output_dir OUTPUT_DIR [--logging_dir LOGGING_DIR]
--model_type {full,lora} [--seed SEED]
[--resolution RESOLUTION]
[--resume_from_checkpoint RESUME_FROM_CHECKPOINT]
[--prediction_type {epsilon,v_prediction,sample,flow_matching,flow_map}]
[--pretrained_vae_model_name_or_path PRETRAINED_VAE_MODEL_NAME_OR_PATH]
[--vae_dtype {default,fp32,fp16,bf16}]
[--vae_cache_ondemand [VAE_CACHE_ONDEMAND]]
[--accelerator_cache_clear_interval ACCELERATOR_CACHE_CLEAR_INTERVAL]
[--aspect_bucket_rounding {1,2,3,4,5,6,7,8,9}]
[--base_model_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}]
[--text_encoder_1_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}]
[--text_encoder_2_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}]
[--text_encoder_3_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}]
[--text_encoder_4_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}]
[--gradient_checkpointing_interval GRADIENT_CHECKPOINTING_INTERVAL]
[--gradient_checkpointing_segment_stride GRADIENT_CHECKPOINTING_SEGMENT_STRIDE]
[--offload_during_startup [OFFLOAD_DURING_STARTUP]]
[--quantize_via {cpu,accelerator,pipeline}]
[--quantization_config QUANTIZATION_CONFIG]
[--fuse_qkv_projections [FUSE_QKV_PROJECTIONS]]
[--control [CONTROL]]
[--controlnet_custom_config CONTROLNET_CUSTOM_CONFIG]
[--controlnet_model_name_or_path CONTROLNET_MODEL_NAME_OR_PATH]
[--tread_config TREAD_CONFIG]
[--pretrained_transformer_model_name_or_path PRETRAINED_TRANSFORMER_MODEL_NAME_OR_PATH]
[--pretrained_transformer_subfolder PRETRAINED_TRANSFORMER_SUBFOLDER]
[--pretrained_unet_model_name_or_path PRETRAINED_UNET_MODEL_NAME_OR_PATH]
[--pretrained_unet_subfolder PRETRAINED_UNET_SUBFOLDER]
[--pretrained_t5_model_name_or_path PRETRAINED_T5_MODEL_NAME_OR_PATH]
[--pretrained_gemma_model_name_or_path PRETRAINED_GEMMA_MODEL_NAME_OR_PATH]
[--qwen_text_encoder_model_name_or_path QWEN_TEXT_ENCODER_MODEL_NAME_OR_PATH]
[--revision REVISION] [--variant VARIANT]
[--base_model_default_dtype {bf16,fp32}]
[--unet_attention_slice [UNET_ATTENTION_SLICE]]
[--num_train_epochs NUM_TRAIN_EPOCHS]
[--max_train_steps MAX_TRAIN_STEPS]
[--train_batch_size TRAIN_BATCH_SIZE]
[--learning_rate LEARNING_RATE] --optimizer
{adamw_bf16,ao-adamw8bit,ao-adamw4bit,ao-adamfp8,ao-adamwfp8,adamw_schedulefree,adamw_schedulefree+aggressive,adamw_schedulefree+no_kahan,optimi-stableadamw,optimi-adamw,optimi-lion,optimi-radam,optimi-ranger,optimi-adan,optimi-adam,optimi-sgd,soap,prodigy}
[--optimizer_config OPTIMIZER_CONFIG]
[--lr_scheduler {linear,sine,cosine,cosine_with_restarts,polynomial,constant,constant_with_warmup}]
[--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS]
[--lr_warmup_steps LR_WARMUP_STEPS]
[--checkpoints_total_limit CHECKPOINTS_TOTAL_LIMIT]
[--gradient_checkpointing [GRADIENT_CHECKPOINTING]]
[--train_text_encoder [TRAIN_TEXT_ENCODER]]
[--text_encoder_lr TEXT_ENCODER_LR]
[--lr_num_cycles LR_NUM_CYCLES] [--lr_power LR_POWER]
[--use_soft_min_snr [USE_SOFT_MIN_SNR]] [--use_ema [USE_EMA]]
[--ema_device {accelerator,cpu}]
[--ema_cpu_only [EMA_CPU_ONLY]]
[--ema_update_interval EMA_UPDATE_INTERVAL]
[--ema_foreach_disable [EMA_FOREACH_DISABLE]]
[--ema_decay EMA_DECAY] [--lora_rank LORA_RANK]
[--lora_alpha LORA_ALPHA] [--lora_type {standard,lycoris}]
[--lora_dropout LORA_DROPOUT]
[--lora_init_type {default,gaussian,loftq,olora,pissa}]
[--peft_lora_mode {standard,singlora}]
[--peft_lora_target_modules PEFT_LORA_TARGET_MODULES]
[--singlora_ramp_up_steps SINGLORA_RAMP_UP_STEPS]
[--init_lora INIT_LORA] [--init_lora_step INIT_LORA_STEP]
[--init_lora_ema INIT_LORA_EMA]
[--lycoris_config LYCORIS_CONFIG]
[--init_lokr_norm INIT_LOKR_NORM]
[--flux_lora_target {mmdit,context,context+ffs,all,all+ffs,ai-toolkit,tiny,nano,controlnet,all+ffs+embedder,all+ffs+embedder+controlnet}]
[--use_dora [USE_DORA]]
[--resolution_type {pixel,area,pixel_area}]
--data_backend_config DATA_BACKEND_CONFIG
[--caption_strategy {filename,textfile,instance_prompt,parquet}]
[--conditioning_multidataset_sampling {combined,random}]
[--instance_prompt INSTANCE_PROMPT]
[--parquet_caption_column PARQUET_CAPTION_COLUMN]
[--parquet_filename_column PARQUET_FILENAME_COLUMN]
[--ignore_missing_files [IGNORE_MISSING_FILES]]
[--vae_cache_scan_behaviour {recreate,sync}]
[--vae_enable_slicing [VAE_ENABLE_SLICING]]
[--vae_enable_tiling [VAE_ENABLE_TILING]]
[--vae_enable_patch_conv [VAE_ENABLE_PATCH_CONV]]
[--vae_batch_size VAE_BATCH_SIZE]
[--caption_dropout_probability CAPTION_DROPOUT_PROBABILITY]
[--tokenizer_max_length TOKENIZER_MAX_LENGTH]
[--validation_step_interval VALIDATION_STEP_INTERVAL]
[--validation_epoch_interval VALIDATION_EPOCH_INTERVAL]
[--validate_after_step VALIDATE_AFTER_STEP]
[--validate_after_epoch VALIDATE_AFTER_EPOCH]
[--disable_benchmark [DISABLE_BENCHMARK]]
[--validation_prompt VALIDATION_PROMPT]
[--validation_input VALIDATION_INPUT]
[--num_validation_images NUM_VALIDATION_IMAGES]
[--num_eval_images NUM_EVAL_IMAGES]
[--eval_steps_interval EVAL_STEPS_INTERVAL]
[--eval_epoch_interval EVAL_EPOCH_INTERVAL]
[--eval_timesteps EVAL_TIMESTEPS]
[--eval_dataset_pooling [EVAL_DATASET_POOLING]]
[--evaluation_type {none,clip}]
[--pretrained_evaluation_model_name_or_path PRETRAINED_EVALUATION_MODEL_NAME_OR_PATH]
[--validation_guidance VALIDATION_GUIDANCE]
[--validation_num_inference_steps VALIDATION_NUM_INFERENCE_STEPS]
[--validation_on_startup [VALIDATION_ON_STARTUP]]
[--validation_using_datasets [VALIDATION_USING_DATASETS]]
[--validation_torch_compile [VALIDATION_TORCH_COMPILE]]
[--validation_guidance_real VALIDATION_GUIDANCE_REAL]
[--validation_no_cfg_until_timestep VALIDATION_NO_CFG_UNTIL_TIMESTEP]
[--validation_negative_prompt VALIDATION_NEGATIVE_PROMPT]
[--validation_randomize [VALIDATION_RANDOMIZE]]
[--validation_seed VALIDATION_SEED]
[--validation_disable [VALIDATION_DISABLE]]
[--validation_prompt_library [VALIDATION_PROMPT_LIBRARY]]
[--user_prompt_library USER_PROMPT_LIBRARY]
[--eval_dataset_id EVAL_DATASET_ID]
[--validation_stitch_input_location {left,right}]
[--validation_guidance_rescale VALIDATION_GUIDANCE_RESCALE]
[--validation_disable_unconditional [VALIDATION_DISABLE_UNCONDITIONAL]]
[--validation_guidance_skip_layers VALIDATION_GUIDANCE_SKIP_LAYERS]
[--validation_guidance_skip_layers_start VALIDATION_GUIDANCE_SKIP_LAYERS_START]
[--validation_guidance_skip_layers_stop VALIDATION_GUIDANCE_SKIP_LAYERS_STOP]
[--validation_guidance_skip_scale VALIDATION_GUIDANCE_SKIP_SCALE]
[--validation_lycoris_strength VALIDATION_LYCORIS_STRENGTH]
[--validation_noise_scheduler {ddim,ddpm,euler,euler-a,unipc,dpm++,perflow}]
[--validation_num_video_frames VALIDATION_NUM_VIDEO_FRAMES]
[--validation_audio_only [VALIDATION_AUDIO_ONLY]]
[--validation_resolution VALIDATION_RESOLUTION]
[--validation_seed_source {cpu,gpu}]
[--i_know_what_i_am_doing [I_KNOW_WHAT_I_AM_DOING]]
[--flow_sigmoid_scale FLOW_SIGMOID_SCALE]
[--flux_fast_schedule [FLUX_FAST_SCHEDULE]]
[--flow_use_uniform_schedule [FLOW_USE_UNIFORM_SCHEDULE]]
[--flow_use_beta_schedule [FLOW_USE_BETA_SCHEDULE]]
[--flow_beta_schedule_alpha FLOW_BETA_SCHEDULE_ALPHA]
[--flow_beta_schedule_beta FLOW_BETA_SCHEDULE_BETA]
[--flow_cubic_schedule_weights FLOW_CUBIC_SCHEDULE_WEIGHTS]
[--flow_schedule_shift FLOW_SCHEDULE_SHIFT]
[--flow_schedule_auto_shift [FLOW_SCHEDULE_AUTO_SHIFT]]
[--mixflow_enabled [MIXFLOW_ENABLED]]
[--mixflow_gamma MIXFLOW_GAMMA]
[--audio_flow_schedule_shift AUDIO_FLOW_SCHEDULE_SHIFT]
[--flow_custom_timesteps FLOW_CUSTOM_TIMESTEPS]
[--flow_timesteps_mode {fixed-list,round-robin}]
[--flux_guidance_mode {constant,random-range}]
[--flux_attention_masked_training [FLUX_ATTENTION_MASKED_TRAINING]]
[--flux_guidance_value FLUX_GUIDANCE_VALUE]
[--flux_guidance_min FLUX_GUIDANCE_MIN]
[--flux_guidance_max FLUX_GUIDANCE_MAX]
[--t5_padding {zero,unmodified}]
[--sd3_clip_uncond_behaviour {empty_string,zero}]
[--sd3_t5_uncond_behaviour {empty_string,zero}]
[--soft_min_snr_sigma_data SOFT_MIN_SNR_SIGMA_DATA]
[--mixed_precision {no,fp16,bf16,fp8}]
[--attention_mechanism {diffusers,xformers,flash-attn,flash-attn-2,flash-attn-3,flash-attn-3-varlen,flex,kohaku-fa,kohaku-fa-auto,metal-flash-attention,metal-flash-attention-int8,metal-flash-attention-int4,cudnn,native-efficient,native-flash,native-math,native-npu,native-xla,sla,sageattention,sageattention-int8-fp16-triton,sageattention-int8-fp16-cuda,sageattention-int8-fp8-cuda}]
[--sageattention_usage {training,inference,training+inference}]
[--disable_tf32 [DISABLE_TF32]]
[--set_grads_to_none [SET_GRADS_TO_NONE]]
[--noise_offset NOISE_OFFSET]
[--noise_offset_probability NOISE_OFFSET_PROBABILITY]
[--input_perturbation INPUT_PERTURBATION]
[--input_perturbation_steps INPUT_PERTURBATION_STEPS]
[--lr_end LR_END] [--lr_scale [LR_SCALE]]
[--lr_scale_sqrt [LR_SCALE_SQRT]]
[--strict_epoch_limit [STRICT_EPOCH_LIMIT]]
[--freeze_encoder_before FREEZE_ENCODER_BEFORE]
[--freeze_encoder_after FREEZE_ENCODER_AFTER]
[--freeze_encoder_strategy {before,between,after}]
[--layer_freeze_strategy {none,bitfit}]
[--fully_unload_text_encoder [FULLY_UNLOAD_TEXT_ENCODER]]
[--save_text_encoder [SAVE_TEXT_ENCODER]]
[--text_encoder_limit TEXT_ENCODER_LIMIT]
[--prepend_instance_prompt [PREPEND_INSTANCE_PROMPT]]
[--only_instance_prompt [ONLY_INSTANCE_PROMPT]]
[--data_aesthetic_score DATA_AESTHETIC_SCORE]
[--delete_unwanted_images [DELETE_UNWANTED_IMAGES]]
[--delete_problematic_images [DELETE_PROBLEMATIC_IMAGES]]
[--disable_bucket_pruning [DISABLE_BUCKET_PRUNING]]
[--disable_segmented_timestep_sampling [DISABLE_SEGMENTED_TIMESTEP_SAMPLING]]
[--preserve_data_backend_cache [PRESERVE_DATA_BACKEND_CACHE]]
[--override_dataset_config [OVERRIDE_DATASET_CONFIG]]
[--cache_dir CACHE_DIR] [--cache_dir_text CACHE_DIR_TEXT]
[--text_cache_ondemand [TEXT_CACHE_ONDEMAND]]
[--text_cache_disable [TEXT_CACHE_DISABLE]]
[--cache_dir_vae CACHE_DIR_VAE]
[--compress_disk_cache [COMPRESS_DISK_CACHE]]
[--aspect_bucket_disable_rebuild [ASPECT_BUCKET_DISABLE_REBUILD]]
[--keep_vae_loaded [KEEP_VAE_LOADED]]
[--skip_file_discovery SKIP_FILE_DISCOVERY]
[--data_backend_sampling {uniform,auto-weighting}]
[--image_processing_batch_size IMAGE_PROCESSING_BATCH_SIZE]
[--write_batch_size WRITE_BATCH_SIZE]
[--read_batch_size READ_BATCH_SIZE]
[--text_encoder_batch_size TEXT_ENCODER_BATCH_SIZE]
[--enable_multiprocessing [ENABLE_MULTIPROCESSING]]
[--max_workers MAX_WORKERS]
[--aws_max_pool_connections AWS_MAX_POOL_CONNECTIONS]
[--torch_num_threads TORCH_NUM_THREADS]
[--dataloader_prefetch [DATALOADER_PREFETCH]]
[--dataloader_prefetch_qlen DATALOADER_PREFETCH_QLEN]
[--dataloader_prefetch_device_threshold_mb DATALOADER_PREFETCH_DEVICE_THRESHOLD_MB]
[--aspect_bucket_worker_count ASPECT_BUCKET_WORKER_COUNT]
[--aspect_bucket_alignment {8,16,24,32,64}]
[--minimum_image_size MINIMUM_IMAGE_SIZE]
[--maximum_image_size MAXIMUM_IMAGE_SIZE]
[--target_downsample_size TARGET_DOWNSAMPLE_SIZE]
[--max_upscale_threshold MAX_UPSCALE_THRESHOLD]
[--metadata_update_interval METADATA_UPDATE_INTERVAL]
[--debug_aspect_buckets [DEBUG_ASPECT_BUCKETS]]
[--debug_dataset_loader [DEBUG_DATASET_LOADER]]
[--print_filenames [PRINT_FILENAMES]]
[--print_sampler_statistics [PRINT_SAMPLER_STATISTICS]]
[--timestep_bias_strategy {earlier,later,range,none}]
[--timestep_bias_begin TIMESTEP_BIAS_BEGIN]
[--timestep_bias_end TIMESTEP_BIAS_END]
[--timestep_bias_multiplier TIMESTEP_BIAS_MULTIPLIER]
[--timestep_bias_portion TIMESTEP_BIAS_PORTION]
[--training_scheduler_timestep_spacing {leading,linspace,trailing}]
[--inference_scheduler_timestep_spacing {leading,linspace,trailing}]
[--loss_type {l2,huber,smooth_l1}]
[--huber_schedule {snr,exponential,constant}]
[--huber_c HUBER_C] [--snr_gamma SNR_GAMMA]
[--masked_loss_probability MASKED_LOSS_PROBABILITY]
[--hidream_use_load_balancing_loss [HIDREAM_USE_LOAD_BALANCING_LOSS]]
[--hidream_load_balancing_loss_weight HIDREAM_LOAD_BALANCING_LOSS_WEIGHT]
[--adam_beta1 ADAM_BETA1] [--adam_beta2 ADAM_BETA2]
[--optimizer_beta1 OPTIMIZER_BETA1]
[--optimizer_beta2 OPTIMIZER_BETA2]
[--optimizer_cpu_offload_method {none}]
[--gradient_precision {unmodified,fp32}]
[--adam_weight_decay ADAM_WEIGHT_DECAY]
[--adam_epsilon ADAM_EPSILON] [--prodigy_steps PRODIGY_STEPS]
[--max_grad_norm MAX_GRAD_NORM]
[--grad_clip_method {value,norm}]
[--optimizer_offload_gradients [OPTIMIZER_OFFLOAD_GRADIENTS]]
[--fuse_optimizer [FUSE_OPTIMIZER]]
[--optimizer_release_gradients [OPTIMIZER_RELEASE_GRADIENTS]]
[--push_to_hub [PUSH_TO_HUB]]
[--push_to_hub_background [PUSH_TO_HUB_BACKGROUND]]
[--push_checkpoints_to_hub [PUSH_CHECKPOINTS_TO_HUB]]
[--publishing_config PUBLISHING_CONFIG]
[--hub_model_id HUB_MODEL_ID]
[--model_card_private [MODEL_CARD_PRIVATE]]
[--model_card_safe_for_work [MODEL_CARD_SAFE_FOR_WORK]]
[--model_card_note MODEL_CARD_NOTE]
[--model_card_base_model MODEL_CARD_BASE_MODEL]
[--modelspec_comment MODELSPEC_COMMENT]
[--report_to {simpletuner,tensorboard,wandb,swanlab,comet_ml,custom-tracker,none}]
[--checkpoint_step_interval CHECKPOINT_STEP_INTERVAL]
[--checkpoint_epoch_interval CHECKPOINT_EPOCH_INTERVAL]
[--checkpointing_rolling_steps CHECKPOINTING_ROLLING_STEPS]
[--checkpointing_use_tempdir [CHECKPOINTING_USE_TEMPDIR]]
[--delete_invalid_checkpoints [DELETE_INVALID_CHECKPOINTS]]
[--checkpoints_rolling_total_limit CHECKPOINTS_ROLLING_TOTAL_LIMIT]
[--tracker_run_name TRACKER_RUN_NAME]
[--tracker_project_name TRACKER_PROJECT_NAME]
[--tracker_image_layout {gallery,table}]
[--enable_watermark [ENABLE_WATERMARK]]
[--framerate FRAMERATE]
[--seed_for_each_device [SEED_FOR_EACH_DEVICE]]
[--snr_weight SNR_WEIGHT]
[--rescale_betas_zero_snr [RESCALE_BETAS_ZERO_SNR]]
[--webhook_config WEBHOOK_CONFIG]
[--webhook_reporting_interval WEBHOOK_REPORTING_INTERVAL]
[--distillation_method {lcm,dcm,dmd,perflow,flow_dpo,anyflow,assistant_lora,h3_drift,self_transcendence}]
[--distillation_config DISTILLATION_CONFIG]
[--ema_validation {none,ema_only,comparison}]
[--local_rank LOCAL_RANK] [--ltx_train_mode {t2v,i2v}]
[--ltx_i2v_prob LTX_I2V_PROB]
[--ltx_partial_noise_fraction LTX_PARTIAL_NOISE_FRACTION]
[--ltx_protect_first_frame [LTX_PROTECT_FIRST_FRAME]]
[--offload_param_path OFFLOAD_PARAM_PATH]
[--offset_noise [OFFSET_NOISE]]
[--quantize_activations [QUANTIZE_ACTIVATIONS]]
[--refiner_training [REFINER_TRAINING]]
[--refiner_training_invert_schedule [REFINER_TRAINING_INVERT_SCHEDULE]]
[--refiner_training_strength REFINER_TRAINING_STRENGTH]
[--sdxl_refiner_uses_full_range [SDXL_REFINER_USES_FULL_RANGE]]
[--sana_complex_human_instruction SANA_COMPLEX_HUMAN_INSTRUCTION]
The following SimpleTuner command-line options are available:
आर्ग्युमेंट¶
options:
-h, --help show this help message and exit
--model_family {kolors,auraflow,omnigen,flux,deepfloyd,cosmos2image,sana,qwen_image,pixart_sigma,sdxl,sd1x,sd2x,wan,hidream,sd3,lumina2,ltxvideo,ace_step,heartmula}
The base model architecture family to train
--model_flavour MODEL_FLAVOUR
Specific variant of the selected model family.
ACE-Step flavours `base`, `v15-turbo`, `v15-base`,
और `v15-sft` हैं। v1.5 flavours अब training और
built-in validation audio generation को support करते
हैं, और upstream repository के लिए
`--trust_remote_code` आवश्यक है।
--controlnet [CONTROLNET]
Train ControlNet (full or LoRA) branches alongside the
primary network.
--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH
Optional override of the model checkpoint. Leave blank
to use the default path for the selected model
flavour.
--output_dir OUTPUT_DIR
Directory where model checkpoints and logs will be
saved
--logging_dir LOGGING_DIR
Directory for TensorBoard logs
--model_type {full,lora}
Choose between full model training or LoRA adapter
training
--seed SEED Seed used for deterministic training behaviour
--resolution RESOLUTION
Resolution for training images
--resume_from_checkpoint RESUME_FROM_CHECKPOINT
Select checkpoint to resume training from
--prediction_type {epsilon,v_prediction,sample,flow_matching,flow_map}
The parameterization type for the diffusion model
--pretrained_vae_model_name_or_path PRETRAINED_VAE_MODEL_NAME_OR_PATH
Path to pretrained VAE model
--vae_dtype {default,fp32,fp16,bf16}
Precision for VAE encoding/decoding. Lower precision
saves memory.
--vae_cache_ondemand [VAE_CACHE_ONDEMAND]
Process VAE latents during training instead of
precomputing them
--vae_cache_disable [VAE_CACHE_DISABLE]
Implicitly enables on-demand caching and disables
writing embeddings to disk.
--accelerator_cache_clear_interval ACCELERATOR_CACHE_CLEAR_INTERVAL
Clear the cache from VRAM every X steps to prevent
memory leaks
--aspect_bucket_rounding {1,2,3,4,5,6,7,8,9}
Number of decimal places to round aspect ratios to for
bucket creation
--base_model_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}
Precision for loading the base model. Lower precision
saves memory.
--text_encoder_1_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}
Precision for text encoders. Lower precision saves
memory.
--text_encoder_2_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}
Precision for text encoders. Lower precision saves
memory.
--text_encoder_3_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}
Precision for text encoders. Lower precision saves
memory.
--text_encoder_4_precision {no_change,int8-quanto,int4-quanto,int2-quanto,int8-torchao,int8dq-torchao,int8dq-int4-torchao,nf4-bnb,int4-torchao,fp8-quanto,fp8uz-quanto,fp8-native,fp8-torchao,fp8wo-torchao,fp8-int4-torchao,fp8-transformerengine}
Precision for text encoders. Lower precision saves
memory.
--gradient_checkpointing_interval GRADIENT_CHECKPOINTING_INTERVAL
Checkpoint every N transformer blocks
--gradient_checkpointing_segment_stride GRADIENT_CHECKPOINTING_SEGMENT_STRIDE
Start a checkpointed segment every N transformer blocks
--offload_during_startup [OFFLOAD_DURING_STARTUP]
Offload text encoders to CPU during VAE caching
--quantize_via {cpu,accelerator,pipeline}
Where to perform model quantization
--quantization_config QUANTIZATION_CONFIG
JSON or file path describing Diffusers quantization
config for pipeline quantization
--fuse_qkv_projections [FUSE_QKV_PROJECTIONS]
Enables Flash Attention 3 when supported; otherwise
falls back to PyTorch SDPA.
--control [CONTROL] Enable channel-wise control style training
--controlnet_custom_config CONTROLNET_CUSTOM_CONFIG
Custom configuration for ControlNet models
--controlnet_model_name_or_path CONTROLNET_MODEL_NAME_OR_PATH
Path to ControlNet model weights to preload
--tread_config TREAD_CONFIG
Configuration for TREAD training method
--diffusion_blocks_config DIFFUSION_BLOCKS_CONFIG
Configuration for DiffusionBlocks training
--pretrained_transformer_model_name_or_path PRETRAINED_TRANSFORMER_MODEL_NAME_OR_PATH
Path to pretrained transformer model
--pretrained_transformer_subfolder PRETRAINED_TRANSFORMER_SUBFOLDER
Subfolder containing transformer model weights
--pretrained_unet_model_name_or_path PRETRAINED_UNET_MODEL_NAME_OR_PATH
Path to pretrained UNet model
--pretrained_unet_subfolder PRETRAINED_UNET_SUBFOLDER
Subfolder containing UNet model weights
--pretrained_t5_model_name_or_path PRETRAINED_T5_MODEL_NAME_OR_PATH
Path to pretrained T5 model
--pretrained_gemma_model_name_or_path PRETRAINED_GEMMA_MODEL_NAME_OR_PATH
Path to pretrained Gemma model
--qwen_text_encoder_model_name_or_path QWEN_TEXT_ENCODER_MODEL_NAME_OR_PATH
Path to pretrained Qwen text encoder model
--revision REVISION Git branch/tag/commit for model version
--variant VARIANT Model variant (e.g., fp16, bf16)
--base_model_default_dtype {bf16,fp32}
Default precision for quantized base model weights
--unet_attention_slice [UNET_ATTENTION_SLICE]
Enable attention slicing for SDXL UNet
--num_train_epochs NUM_TRAIN_EPOCHS
Number of times to iterate through the entire dataset
--max_train_steps MAX_TRAIN_STEPS
Maximum number of training steps (0 = use epochs
instead)
--train_batch_size TRAIN_BATCH_SIZE
Number of samples processed per forward/backward pass
(per device).
--learning_rate LEARNING_RATE
Base learning rate for training
--optimizer {adamw_bf16,ao-adamw8bit,ao-adamw4bit,ao-adamfp8,ao-adamwfp8,adamw_schedulefree,adamw_schedulefree+aggressive,adamw_schedulefree+no_kahan,optimi-stableadamw,optimi-adamw,optimi-lion,optimi-radam,optimi-ranger,optimi-adan,optimi-adam,optimi-sgd,soap,prodigy}
Optimization algorithm for training
--optimizer_config OPTIMIZER_CONFIG
Comma-separated key=value pairs forwarded to the
selected optimizer
--lr_scheduler {linear,sine,cosine,cosine_with_restarts,polynomial,constant,constant_with_warmup}
How learning rate changes during training
--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS
Number of steps to accumulate gradients
--lr_warmup_steps LR_WARMUP_STEPS
Number of steps to gradually increase LR from 0
--checkpoints_total_limit CHECKPOINTS_TOTAL_LIMIT
Maximum number of checkpoints to keep on disk
--gradient_checkpointing [GRADIENT_CHECKPOINTING]
Trade compute for memory during training
--train_text_encoder [TRAIN_TEXT_ENCODER]
Also train the text encoder (CLIP) model
--text_encoder_lr TEXT_ENCODER_LR
Separate learning rate for text encoder
--lr_num_cycles LR_NUM_CYCLES
Number of cosine annealing cycles
--lr_power LR_POWER Power for polynomial decay scheduler
--use_soft_min_snr [USE_SOFT_MIN_SNR]
Use soft clamping instead of hard clamping for Min-SNR
--use_ema [USE_EMA] Maintain an exponential moving average copy of the
model during training.
--ema_device {accelerator,cpu}
Where to keep the EMA weights in-between updates.
--ema_cpu_only [EMA_CPU_ONLY]
Keep EMA weights exclusively on CPU even when
ema_device would normally move them.
--ema_update_interval EMA_UPDATE_INTERVAL
Update EMA weights every N optimizer steps
--ema_foreach_disable [EMA_FOREACH_DISABLE]
Fallback to standard tensor ops instead of
torch.foreach updates.
--ema_decay EMA_DECAY
Smoothing factor for EMA updates (closer to 1.0 =
slower drift).
--lora_rank LORA_RANK
Dimension of LoRA update matrices
--lora_alpha LORA_ALPHA
Scaling factor for LoRA updates
--lora_type {standard,lycoris}
LoRA implementation type
--lora_dropout LORA_DROPOUT
LoRA dropout randomly ignores neurons during training.
This can help prevent overfitting.
--lora_init_type {default,gaussian,loftq,olora,pissa}
The initialization type for the LoRA model
--peft_lora_mode {standard,singlora}
PEFT LoRA training mode
--peft_lora_target_modules PEFT_LORA_TARGET_MODULES
JSON array (or path to a JSON file) listing PEFT
LoRA target module names. Overrides preset targets.
--singlora_ramp_up_steps SINGLORA_RAMP_UP_STEPS
Number of ramp-up steps for SingLoRA
--slider_lora_target [SLIDER_LORA_TARGET]
Route LoRA training to slider-friendly targets
(self-attn + conv/time embeddings). Only affects
standard PEFT LoRA.
--init_lora INIT_LORA
Specify an existing LoRA or LyCORIS safetensors file
to initialize the adapter
--init_lora_step INIT_LORA_STEP
Continue global-step accounting from a model-only LoRA
checkpoint without optimizer state
--init_lora_ema INIT_LORA_EMA
Load a raw SimpleTuner EMA state alongside init_lora
--lycoris_config LYCORIS_CONFIG
Path to LyCORIS configuration JSON file
--init_lokr_norm INIT_LOKR_NORM
Perturbed normal initialization for LyCORIS LoKr
layers
--flux_lora_target {mmdit,context,context+ffs,all,all+ffs,ai-toolkit,tiny,nano,controlnet,all+ffs+embedder,all+ffs+embedder+controlnet}
Which layers to train in Flux models
--use_dora [USE_DORA]
Enable DoRA (Weight-Decomposed LoRA)
--resolution_type {pixel,area,pixel_area}
How to interpret the resolution value
--data_backend_config DATA_BACKEND_CONFIG
Select a saved dataset configuration (managed in
Datasets & Environments tabs)
--caption_strategy {filename,textfile,instance_prompt,parquet}
How to load captions for images
--conditioning_multidataset_sampling {combined,random}
How to sample from multiple conditioning datasets
--instance_prompt INSTANCE_PROMPT
Instance prompt for training
--parquet_caption_column PARQUET_CAPTION_COLUMN
Column name containing captions in parquet files
--parquet_filename_column PARQUET_FILENAME_COLUMN
Column name containing image paths in parquet files
--ignore_missing_files [IGNORE_MISSING_FILES]
Continue training even if some files are missing
--vae_cache_scan_behaviour {recreate,sync}
How to scan VAE cache for missing files
--vae_enable_slicing [VAE_ENABLE_SLICING]
Enable VAE attention slicing for memory efficiency
--vae_enable_tiling [VAE_ENABLE_TILING]
Enable VAE tiling for large images
--vae_enable_patch_conv [VAE_ENABLE_PATCH_CONV]
Enable patch-based 3D conv for HunyuanVideo VAE to
reduce peak VRAM (slight slowdown)
--vae_batch_size VAE_BATCH_SIZE
Batch size for VAE encoding during caching
--caption_dropout_probability CAPTION_DROPOUT_PROBABILITY
Caption dropout will randomly drop captions and, for
SDXL, size conditioning inputs based on this
probability
--tokenizer_max_length TOKENIZER_MAX_LENGTH
Override the tokenizer sequence length (advanced).
--validation_step_interval VALIDATION_STEP_INTERVAL
Run validation every N training steps (deprecated alias: --validation_steps)
--validation_epoch_interval VALIDATION_EPOCH_INTERVAL
Run validation every N training epochs
--validate_after_step VALIDATE_AFTER_STEP
Skip scheduled validation until the global training
step reaches this value
--validate_after_epoch VALIDATE_AFTER_EPOCH
Skip scheduled validation until the training epoch
reaches this value
--disable_benchmark [DISABLE_BENCHMARK]
Skip generating baseline comparison images before
training starts
--validation_prompt VALIDATION_PROMPT
Prompt to use for validation images
--validation_input VALIDATION_INPUT
JSON list of validation input image paths and prompts
--num_validation_images NUM_VALIDATION_IMAGES
Number of images to generate per validation
--num_eval_images NUM_EVAL_IMAGES
Number of images to generate for evaluation metrics
--eval_steps_interval EVAL_STEPS_INTERVAL
Run evaluation every N training steps
--eval_epoch_interval EVAL_EPOCH_INTERVAL
Run evaluation every N training epochs (decimals run
multiple times per epoch)
--eval_timesteps EVAL_TIMESTEPS
Number of timesteps for evaluation
--eval_dataset_pooling [EVAL_DATASET_POOLING]
Combine evaluation metrics from all datasets into a
single chart
--evaluation_type {none,clip}
Type of evaluation metrics to compute
--pretrained_evaluation_model_name_or_path PRETRAINED_EVALUATION_MODEL_NAME_OR_PATH
Path to pretrained model for evaluation metrics
--validation_guidance VALIDATION_GUIDANCE
CFG guidance scale for validation images
--validation_num_inference_steps VALIDATION_NUM_INFERENCE_STEPS
Number of diffusion steps for validation renders
--validation_on_startup [VALIDATION_ON_STARTUP]
Run validation on the base model before training
starts
--validation_using_datasets [VALIDATION_USING_DATASETS]
Use random images from training datasets for
validation
--validation_torch_compile [VALIDATION_TORCH_COMPILE]
Use torch.compile() on validation pipeline for speed
--validation_guidance_real VALIDATION_GUIDANCE_REAL
CFG value for distilled models (e.g., FLUX schnell)
--validation_no_cfg_until_timestep VALIDATION_NO_CFG_UNTIL_TIMESTEP
Skip CFG for initial timesteps (Flux only)
--validation_negative_prompt VALIDATION_NEGATIVE_PROMPT
Negative prompt for validation images
--validation_randomize [VALIDATION_RANDOMIZE]
Use random seeds for each validation
--validation_seed VALIDATION_SEED
Fixed seed for reproducible validation images
--validation_disable [VALIDATION_DISABLE]
Completely disable validation image generation
--validation_prompt_library [VALIDATION_PROMPT_LIBRARY]
SimpleTuner की built-in prompt library इस्तेमाल करें।
music/audio caption + lyrics prompts के लिए "audio"
इस्तेमाल करें।
--user_prompt_library USER_PROMPT_LIBRARY
custom JSON prompt library का path। Entries prompt या
caption और optional lyrics इस्तेमाल कर सकती हैं।
--eval_dataset_id EVAL_DATASET_ID
Specific dataset to use for evaluation metrics
--validation_stitch_input_location {left,right}
Where to place input image in img2img validations
--validation_guidance_rescale VALIDATION_GUIDANCE_RESCALE
CFG rescale value for validation
--validation_disable_unconditional [VALIDATION_DISABLE_UNCONDITIONAL]
Disable unconditional image generation during
validation
--validation_guidance_skip_layers VALIDATION_GUIDANCE_SKIP_LAYERS
JSON list of transformer layers to skip during
classifier-free guidance
--validation_guidance_skip_layers_start VALIDATION_GUIDANCE_SKIP_LAYERS_START
Starting layer index to skip guidance
--validation_guidance_skip_layers_stop VALIDATION_GUIDANCE_SKIP_LAYERS_STOP
Ending layer index to skip guidance
--validation_guidance_skip_scale VALIDATION_GUIDANCE_SKIP_SCALE
Scale guidance strength when applying layer skipping
--validation_lycoris_strength VALIDATION_LYCORIS_STRENGTH
Strength multiplier for LyCORIS validation
--validation_noise_scheduler {ddim,ddpm,euler,euler-a,unipc,dpm++,perflow}
Noise scheduler for validation
--validation_num_video_frames VALIDATION_NUM_VIDEO_FRAMES
Number of frames for video validation
--validation_audio_only [VALIDATION_AUDIO_ONLY]
Disable video generation during validation and emit
audio only
--validation_resolution VALIDATION_RESOLUTION
Override resolution for validation images (pixels or
megapixels)
--validation_seed_source {cpu,gpu}
Source device used to generate validation seeds
--i_know_what_i_am_doing [I_KNOW_WHAT_I_AM_DOING]
Unlock experimental overrides and bypass built-in
safety limits. Also bypasses the sampler batch-size
mismatch check on resume (same effect as
SIMPLETUNER_ALLOW_MODIFYING_BSZ=1).
--flow_sigmoid_scale FLOW_SIGMOID_SCALE
Scale factor for sigmoid timestep sampling for flow-
matching models.
--flux_fast_schedule [FLUX_FAST_SCHEDULE]
Use experimental fast schedule for Flux training
--flow_use_uniform_schedule [FLOW_USE_UNIFORM_SCHEDULE]
Use uniform schedule instead of sigmoid for flow-
matching
--flow_use_beta_schedule [FLOW_USE_BETA_SCHEDULE]
Use beta schedule instead of sigmoid for flow-matching
--flow_beta_schedule_alpha FLOW_BETA_SCHEDULE_ALPHA
Alpha value for beta schedule (default: 2.0)
--flow_beta_schedule_beta FLOW_BETA_SCHEDULE_BETA
Beta value for beta schedule (default: 2.0)
--flow_cubic_schedule_weights FLOW_CUBIC_SCHEDULE_WEIGHTS
Sample flow timesteps from a smooth density through
equally spaced non-negative weights. Use a JSON array
or comma-separated values; zero or one weight produces
a uniform distribution.
--flow_schedule_shift FLOW_SCHEDULE_SHIFT
Shift the noise schedule for flow-matching models
--flow_schedule_auto_shift [FLOW_SCHEDULE_AUTO_SHIFT]
Auto-adjust schedule shift based on image resolution
--mixflow_enabled [MIXFLOW_ENABLED]
Enable MixFlow slowed-interpolation post-training for
flow-matching models.
--mixflow_gamma MIXFLOW_GAMMA
Set the MixFlow slowed-interpolation range coefficient
(default: 0.8).
--audio_flow_schedule_shift AUDIO_FLOW_SCHEDULE_SHIFT
Shift the audio noise schedule for flow-matching
models with audio latents
--flow_custom_timesteps FLOW_CUSTOM_TIMESTEPS
Override flow-matching timestep sampling with a fixed
comma-separated list. The list is interpreted as
sigmas only when every value is in [0,1]; otherwise
all values are interpreted as timesteps [0,1000].
--flow_timesteps_mode {fixed-list,round-robin}
Select how flow_custom_timesteps values are assigned
to samples.
--flux_guidance_mode {constant,random-range}
Guidance mode for Flux training
--flux_attention_masked_training [FLUX_ATTENTION_MASKED_TRAINING]
Enable attention masked training for Flux models
--flux_guidance_value FLUX_GUIDANCE_VALUE
Guidance value for constant mode
--flux_guidance_min FLUX_GUIDANCE_MIN
Minimum guidance value for random-range mode
--flux_guidance_max FLUX_GUIDANCE_MAX
Maximum guidance value for random-range mode
--t5_padding {zero,unmodified}
Padding behavior for T5 text encoder
--sd3_clip_uncond_behaviour {empty_string,zero}
How SD3 handles unconditional prompts
--sd3_t5_uncond_behaviour {empty_string,zero}
How SD3 T5 handles unconditional prompts
--soft_min_snr_sigma_data SOFT_MIN_SNR_SIGMA_DATA
Sigma data for soft min SNR weighting
--mixed_precision {no,fp16,bf16,fp8}
Precision for training computations
--attention_mechanism {diffusers,xformers,flash-attn,flash-attn-2,flash-attn-3,flash-attn-3-varlen,flex,kohaku-fa,kohaku-fa-auto,metal-flash-attention,metal-flash-attention-int8,metal-flash-attention-int4,cudnn,native-efficient,native-flash,native-math,native-npu,native-xla,sla,sageattention,sageattention-int8-fp16-triton,sageattention-int8-fp16-cuda,sageattention-int8-fp8-cuda}
Attention computation backend
--sageattention_usage {training,inference,training+inference}
When to use SageAttention
--disable_tf32 [DISABLE_TF32]
Force IEEE FP32 precision (disables TF32) using
PyTorch's fp32_precision controls when available
--set_grads_to_none [SET_GRADS_TO_NONE]
Set gradients to None instead of zero
--noise_offset NOISE_OFFSET
Add noise offset to training
--noise_offset_probability NOISE_OFFSET_PROBABILITY
Probability of applying noise offset
--input_perturbation INPUT_PERTURBATION
Add additional noise only to the inputs fed to the
model during training
--input_perturbation_steps INPUT_PERTURBATION_STEPS
Only apply input perturbation over the first N steps
with linear decay
--lr_end LR_END A polynomial learning rate will end up at this value
after the specified number of warmup steps
--lr_scale [LR_SCALE]
Scale the learning rate by the number of GPUs,
gradient accumulation steps, and batch size
--lr_scale_sqrt [LR_SCALE_SQRT]
If using --lr_scale, use the square root of (number of
GPUs * gradient accumulation steps * batch size)
--strict_epoch_limit [STRICT_EPOCH_LIMIT]
Stop training when the epoch counter reaches
--num_train_epochs, even if --max_train_steps
has not been reached
--freeze_encoder_before FREEZE_ENCODER_BEFORE
When using 'before' strategy, we will freeze layers
earlier than this
--freeze_encoder_after FREEZE_ENCODER_AFTER
When using 'after' strategy, we will freeze layers
later than this
--freeze_encoder_strategy {before,between,after}
When freezing the text encoder, we can use the
'before', 'between', or 'after' strategy
--layer_freeze_strategy {none,bitfit}
When freezing parameters, we can use the 'none' or
'bitfit' strategy
--fully_unload_text_encoder [FULLY_UNLOAD_TEXT_ENCODER]
If set, will fully unload the text_encoder from memory
when not in use
--save_text_encoder [SAVE_TEXT_ENCODER]
If set, will save the text encoder after training
--text_encoder_limit TEXT_ENCODER_LIMIT
When training the text encoder, we want to limit how
long it trains for to avoid catastrophic loss
--prepend_instance_prompt [PREPEND_INSTANCE_PROMPT]
When determining the captions from the filename,
prepend the instance prompt as an enforced keyword
--only_instance_prompt [ONLY_INSTANCE_PROMPT]
Use the instance prompt instead of the caption from
filename
--data_aesthetic_score DATA_AESTHETIC_SCORE
Since currently we do not calculate aesthetic scores
for data, we will statically set it to one value. This
is only used by the SDXL Refiner
--delete_unwanted_images [DELETE_UNWANTED_IMAGES]
If set, will delete images that are not of a minimum
size to save on disk space for large training runs
--delete_problematic_images [DELETE_PROBLEMATIC_IMAGES]
If set, any images that error out during load will be
removed from the underlying storage medium
--disable_bucket_pruning [DISABLE_BUCKET_PRUNING]
When training on very small datasets, you might not
care that the batch sizes will outpace your image
count. Setting this option will prevent SimpleTuner
from deleting your bucket lists that do not meet the
minimum image count requirements. Use at your own
risk, it may end up throwing off your statistics or
epoch tracking
--disable_segmented_timestep_sampling [DISABLE_SEGMENTED_TIMESTEP_SAMPLING]
By default, the timestep schedule is divided into
roughly `train_batch_size` number of segments, and
then each of those are sampled from separately. This
improves the selection distribution, but may not be
desired in certain training scenarios, eg. when
limiting the timestep selection range
--preserve_data_backend_cache [PRESERVE_DATA_BACKEND_CACHE]
For very large cloud storage buckets that will never
change, enabling this option will prevent the trainer
from scanning it at startup, by preserving the cache
files that we generate. Be careful when using this,
as, switching datasets can result in the preserved
cache being used, which would be problematic.
Currently, cache is not stored in the dataset itself
but rather, locally. This may change in a future
release
--override_dataset_config [OVERRIDE_DATASET_CONFIG]
When provided, the dataset's config will not be
checked against the live backend config
--cache_dir CACHE_DIR
The directory where the downloaded models and datasets
will be stored
--cache_dir_text CACHE_DIR_TEXT
This is the path to a local directory that will
contain your text embed cache
--text_cache_ondemand [TEXT_CACHE_ONDEMAND]
पूरा text cache precompute करने के बजाय training के दौरान missing
embeddings encode करता है। मौजूदा entries reuse होती हैं।
--text_cache_disable [TEXT_CACHE_DISABLE]
cache writes disable करके misses को on demand encode करता है।
मौजूदा entries पढ़ी जाती हैं। --text_cache_ondemand implied है।
--text_embed_full_cache [TEXT_EMBED_FULL_CACHE]
Store full raw text encoder outputs in the text embed
cache. This opts out of model-specific cache size
optimisations, such as Ideogram 4's frozen text
projection cache.
--cache_dir_vae CACHE_DIR_VAE
This is the path to a local directory that will
contain your VAE outputs
--compress_disk_cache [COMPRESS_DISK_CACHE]
If set, will gzip-compress the disk cache for Pytorch
files. This will save substantial disk space, but may
slow down the training process
--aspect_bucket_disable_rebuild [ASPECT_BUCKET_DISABLE_REBUILD]
When using a randomised aspect bucket list, the VAE
and aspect cache are rebuilt on each epoch. With a
large and diverse enough dataset, rebuilding the
aspect list may take a long time, and this may be
undesirable. This option will not override
vae_cache_clear_each_epoch. If both options are
provided, only the VAE cache will be rebuilt
--keep_vae_loaded [KEEP_VAE_LOADED]
If set, will keep the VAE loaded in memory. This can
reduce disk churn, but consumes VRAM during the
forward pass
--skip_file_discovery SKIP_FILE_DISCOVERY
Comma-separated values of which stages to skip
discovery for. Skipping any stage will speed up
resumption, but will increase the risk of errors, as
missing images or incorrectly bucketed images may not
be caught. Valid options: aspect, vae, text, metadata
--data_backend_sampling {uniform,auto-weighting}
When using multiple data backends, the sampling
weighting can be set to 'uniform' or 'auto-weighting'
--image_processing_batch_size IMAGE_PROCESSING_BATCH_SIZE
When resizing and cropping images, we do it in
parallel using processes or threads. This defines how
many images will be read into the queue before they
are processed
--write_batch_size WRITE_BATCH_SIZE
When using certain storage backends, it is better to
batch smaller writes rather than continuous
dispatching. In SimpleTuner, write batching is
currently applied during VAE caching, when many small
objects are written. This mostly applies to S3, but
some shared server filesystems may benefit as well.
Default: 64
--read_batch_size READ_BATCH_SIZE
Used by the VAE cache to prefetch image data. This is
the number of images to read ahead
--text_encoder_batch_size TEXT_ENCODER_BATCH_SIZE
Batch size used when precomputing uncached text
embeddings. A value of 1 preserves the original one-
caption-per-forward behavior.
--enable_multiprocessing [ENABLE_MULTIPROCESSING]
If set, will use processes instead of threads during
metadata caching operations
--max_workers MAX_WORKERS
How many active threads or processes to run during VAE
caching
--aws_max_pool_connections AWS_MAX_POOL_CONNECTIONS
When using AWS backends, the maximum number of
connections to keep open to the S3 bucket at a single
time
--torch_num_threads TORCH_NUM_THREADS
The number of threads to use for PyTorch operations.
This is not the same as the number of workers
--dataloader_prefetch [DATALOADER_PREFETCH]
When provided, the dataloader will read-ahead and
attempt to retrieve latents, text embeds, and other
metadata ahead of the time when the batch is required,
so that it can be immediately available
--dataloader_prefetch_qlen DATALOADER_PREFETCH_QLEN
Set the number of prefetched batches
--dataloader_prefetch_device_threshold_mb DATALOADER_PREFETCH_DEVICE_THRESHOLD_MB
Minimum CPU batch payload in MiB to page-lock and
transfer on a dedicated CUDA stream during dataloader
prefetch; 0 disables device staging
--aspect_bucket_worker_count ASPECT_BUCKET_WORKER_COUNT
The number of workers to use for aspect bucketing.
This is a CPU-bound task, so the number of workers
should be set to the number of CPU threads available.
If you use an I/O bound backend, an even higher value
may make sense. Default: 12
--aspect_bucket_alignment {8,16,24,32,64}
When training diffusion models, the image sizes
generally must align to a 64 pixel interval
--minimum_image_size MINIMUM_IMAGE_SIZE
The minimum resolution for both sides of input images
--maximum_image_size MAXIMUM_IMAGE_SIZE
When cropping images that are excessively large, the
entire scene context may be lost, eg. the crop might
just end up being a portion of the background. To
avoid this, a maximum image size may be provided,
which will result in very-large images being
downsampled before cropping them. This value uses
--resolution_type to determine whether it is a pixel
edge or megapixel value
--target_downsample_size TARGET_DOWNSAMPLE_SIZE
When using --maximum_image_size, very-large images
exceeding that value will be downsampled to this
target size before cropping
--max_upscale_threshold MAX_UPSCALE_THRESHOLD
Limit upscaling of small images to prevent quality
degradation (opt-in). When set, filters out aspect
buckets requiring upscaling beyond this threshold.
For example, 0.2 allows up to 20% upscaling. Default
(None) allows unlimited upscaling. Must be between 0
and 1.
--metadata_update_interval METADATA_UPDATE_INTERVAL
When generating the aspect bucket indicies, we want to
save it every X seconds
--debug_aspect_buckets [DEBUG_ASPECT_BUCKETS]
If set, will print excessive debugging for aspect
bucket operations
--debug_dataset_loader [DEBUG_DATASET_LOADER]
If set, will print excessive debugging for data loader
operations
--print_filenames [PRINT_FILENAMES]
If any image files are stopping the process eg. due to
corruption or truncation, this will help identify
which is at fault
--print_sampler_statistics [PRINT_SAMPLER_STATISTICS]
If provided, will print statistics about the dataset
sampler. This is useful for debugging
--timestep_bias_strategy {earlier,later,range,none}
Strategy for biasing timestep sampling
--timestep_bias_begin TIMESTEP_BIAS_BEGIN
Beginning of timestep bias range
--timestep_bias_end TIMESTEP_BIAS_END
End of timestep bias range
--timestep_bias_multiplier TIMESTEP_BIAS_MULTIPLIER
Multiplier for timestep bias probability
--timestep_bias_portion TIMESTEP_BIAS_PORTION
Portion of training steps to apply timestep bias
--training_scheduler_timestep_spacing {leading,linspace,trailing}
Timestep spacing for training scheduler
--inference_scheduler_timestep_spacing {leading,linspace,trailing}
Timestep spacing for inference scheduler
--loss_type {l2,huber,smooth_l1}
Loss function for training
--huber_schedule {snr,exponential,constant}
Schedule for Huber loss transition threshold
--huber_c HUBER_C Transition point between L2 and L1 regions for Huber
loss
--snr_gamma SNR_GAMMA
SNR weighting gamma value (0 = disabled)
--masked_loss_probability MASKED_LOSS_PROBABILITY
Probability of applying masked loss weighting per
batch
--hidream_use_load_balancing_loss [HIDREAM_USE_LOAD_BALANCING_LOSS]
Apply experimental load balancing loss when training
HiDream models.
--hidream_load_balancing_loss_weight HIDREAM_LOAD_BALANCING_LOSS_WEIGHT
Strength multiplier for HiDream load balancing loss.
--adam_beta1 ADAM_BETA1
First moment decay rate for Adam optimizers
--adam_beta2 ADAM_BETA2
Second moment decay rate for Adam optimizers
--optimizer_beta1 OPTIMIZER_BETA1
First moment decay rate for optimizers
--optimizer_beta2 OPTIMIZER_BETA2
Second moment decay rate for optimizers
--optimizer_cpu_offload_method {none}
Method for CPU offloading optimizer states
--gradient_precision {unmodified,fp32}
Precision for gradient computation
--adam_weight_decay ADAM_WEIGHT_DECAY
L2 regularisation strength for Adam-family optimizers.
--adam_epsilon ADAM_EPSILON
Small constant added for numerical stability.
--prodigy_steps PRODIGY_STEPS
Number of steps Prodigy should spend adapting its
learning rate.
--max_grad_norm MAX_GRAD_NORM
Gradient clipping threshold to prevent exploding
gradients.
--grad_clip_method {value,norm}
Strategy for applying max_grad_norm during clipping.
--optimizer_offload_gradients [OPTIMIZER_OFFLOAD_GRADIENTS]
Move optimizer gradients to CPU to save GPU memory.
--fuse_optimizer [FUSE_OPTIMIZER]
Enable fused kernels when offloading to reduce memory
overhead.
--optimizer_release_gradients [OPTIMIZER_RELEASE_GRADIENTS]
Free gradient tensors immediately after optimizer step
when using Optimi optimizers.
--push_to_hub [PUSH_TO_HUB]
Automatically upload the trained model to your Hugging
Face Hub repository.
--push_to_hub_background [PUSH_TO_HUB_BACKGROUND]
Run Hub uploads in a background worker so training is
not blocked while pushing.
--push_checkpoints_to_hub [PUSH_CHECKPOINTS_TO_HUB]
Upload intermediate checkpoints to the same Hugging
Face repository during training.
--publishing_config PUBLISHING_CONFIG
Optional JSON/file path describing additional
publishing targets (S3/Backblaze B2/Azure Blob/Dropbox).
--hub_model_id HUB_MODEL_ID
If left blank, SimpleTuner derives a name from the
project settings when pushing to Hub.
--model_card_private [MODEL_CARD_PRIVATE]
Create the Hugging Face repository as private instead
of public.
--model_card_safe_for_work [MODEL_CARD_SAFE_FOR_WORK]
Remove the default NSFW warning from the generated
model card on Hugging Face Hub.
--model_card_base_model MODEL_CARD_BASE_MODEL
Base repository for model-card metadata when training from a local checkpoint.
--model_card_note MODEL_CARD_NOTE
Optional note that appears at the top of the generated
model card.
--modelspec_comment MODELSPEC_COMMENT
Text embedded in safetensors file metadata as
modelspec.comment, visible in external model viewers.
--report_to {simpletuner,tensorboard,wandb,swanlab,comet_ml,custom-tracker,none}
Where to log training metrics
--checkpoint_step_interval CHECKPOINT_STEP_INTERVAL
Save model checkpoint every N steps (deprecated alias: --checkpointing_steps)
--checkpoint_epoch_interval CHECKPOINT_EPOCH_INTERVAL
Save model checkpoint every N epochs
--checkpointing_rolling_steps CHECKPOINTING_ROLLING_STEPS
Rolling checkpoint window size for continuous
checkpointing
--checkpointing_use_tempdir [CHECKPOINTING_USE_TEMPDIR]
Use temporary directory for checkpoint files before
final save
--delete_invalid_checkpoints [DELETE_INVALID_CHECKPOINTS]
Delete local checkpoints that cannot be loaded while
resuming.
--checkpoints_rolling_total_limit CHECKPOINTS_ROLLING_TOTAL_LIMIT
Maximum number of rolling checkpoints to keep
--tracker_run_name TRACKER_RUN_NAME
Name for this training run in tracking platforms
--tracker_project_name TRACKER_PROJECT_NAME
Project name in tracking platforms
--tracker_image_layout {gallery,table}
How validation images are displayed in trackers
--enable_watermark [ENABLE_WATERMARK]
Add invisible watermark to generated images
--framerate FRAMERATE
Framerate for video model training
--seed_for_each_device [SEED_FOR_EACH_DEVICE]
Use a unique deterministic seed per GPU instead of
sharing one seed across devices.
--snr_weight SNR_WEIGHT
Weight factor for SNR-based loss scaling
--rescale_betas_zero_snr [RESCALE_BETAS_ZERO_SNR]
Rescale betas for zero terminal SNR
--webhook_config WEBHOOK_CONFIG
Path to webhook configuration file
--webhook_reporting_interval WEBHOOK_REPORTING_INTERVAL
Interval for webhook reports (seconds)
--distillation_method {lcm,dcm,dmd,perflow,flow_dpo,anyflow,assistant_lora,h3_drift,self_transcendence}
Method for model distillation
Distillation methods cannot be combined with
--train_text_encoder.
--distillation_config DISTILLATION_CONFIG
Path to distillation configuration file
--ema_validation {none,ema_only,comparison}
Control how EMA weights are used during validation
runs.
--local_rank LOCAL_RANK
Local rank for distributed training
--ltx_train_mode {t2v,i2v}
Training mode for LTX models
--ltx_i2v_prob LTX_I2V_PROB
Probability of using image-to-video training for LTX
--ltx_partial_noise_fraction LTX_PARTIAL_NOISE_FRACTION
Fraction of noise to add for LTX partial training
--ltx_protect_first_frame [LTX_PROTECT_FIRST_FRAME]
Protect the first frame from noise in LTX training
--offload_param_path OFFLOAD_PARAM_PATH
Path to offloaded parameter files
--offset_noise [OFFSET_NOISE]
Enable offset-noise training
--quantize_activations [QUANTIZE_ACTIVATIONS]
Quantize model activations during training
--refiner_training [REFINER_TRAINING]
Enable refiner model training mode
--refiner_training_invert_schedule [REFINER_TRAINING_INVERT_SCHEDULE]
Invert the noise schedule for refiner training
--refiner_training_strength REFINER_TRAINING_STRENGTH
Strength of refiner training
--sdxl_refiner_uses_full_range [SDXL_REFINER_USES_FULL_RANGE]
Use full timestep range for SDXL refiner
--sana_complex_human_instruction SANA_COMPLEX_HUMAN_INSTRUCTION
Complex human instruction for Sana model training
--distillation_method=assistant_lora¶
--distillation_method=assistant_lora कैप्शन डेटासेट से, अडैप्टर बंद रखकर हर बार बनाए गए बेस मॉडल आउटपुट पर सकारात्मक सहायक अडैप्टर प्रशिक्षित करता है। प्रारंभिक समर्थन Qwen Image 2.1 के लिए है। distillation_config.assistant_lora में num_inference_steps (40), resolutions ([[1024, 1024]], पहले चौड़ाई फिर ऊँचाई, 32 के गुणज) और seed (42) हैं। टेक्स्ट एम्बेडिंग पहले कैश होनी चाहिए; अंतिम लेटेंट कैश नहीं होते। Qwen गाइड देखें।
कैप्शन डेटासेट के लिए dataloader_prefetch: false आवश्यक है, ताकि चेकपॉइंट कर्सर उपयोग किए गए कैप्शन को दर्शाए। पुनः शुरू करते समय कैप्शन पहचान या पाठ, बैच, दोहराव, शफ़ल, बीज, ग्रेडिएंट संचय या वितरित व्यवस्था में बदलाव स्वीकार नहीं होते। सहायक LoRA के चेकपॉइंट जनरेशन बीज, रिज़ॉल्यूशन सूची या शिक्षक के इन्फरेंस चरणों में बदलाव भी अस्वीकार करते हैं।
Assistant LoRA और AnyFlow, teacher, training और validation variants के लिए Dynamo की प्रति-code compile-cache सीमा अस्थायी रूप से कम से कम 32 करते हैं। उपयोगकर्ता की अधिक सीमा बनी रहती है; बाहर निकलने पर, त्रुटि होने पर भी, मूल सीमा बहाल होती है।