@echo off
setlocal

set "SCRIPT_DIR=C:\"
set "VENV_ACTIVATE=C:\sd-scripts\venv\Scripts\Activate.bat"

set "MODEL=C:\anima-preview3-base.safetensors"
set "QWEN3=C:\qwen_3_06b_base.safetensors"
set "VAE=C:\qwen_image_vae.safetensors"

set "OUTPUT_DIR=C:\Lora"

set "PROMPTS_FILE=%SCRIPT_DIR%\prompts.toml"
set "OUTPUT_NAME=anima_p3_leco"

cd /d "%SCRIPT_DIR%"
call "%VENV_ACTIVATE%"

accelerate launch --num_cpu_threads_per_process 1 anima_train_leco.py ^
--pretrained_model_name_or_path="%MODEL%" ^
--qwen3="%QWEN3%" ^
--vae="%VAE%" ^
--prompts_file="%PROMPTS_FILE%" ^
--output_dir="%OUTPUT_DIR%" ^
--save_model_as=safetensors ^
--network_module=networks.lora_anima ^
--network_dim=16 ^
--network_alpha=8 ^
--network_train_unet_only ^
--learning_rate=1e-4 ^
--optimizer_type="AdamW" ^
--lr_scheduler="constant" ^
--mixed_precision="bf16" ^
--gradient_checkpointing ^
--attn_mode=flash ^
--timestep_sampling="sigmoid" ^
--sigmoid_scale=1 ^
--discrete_flow_shift=1.0 ^
--weighting_scheme="none" ^
--max_train_steps=800 ^
--save_every_n_steps=200 ^
--max_denoising_steps=20 ^
--leco_denoise_guidance_scale=3.0 ^
--vae_chunk_size=64 ^
--vae_disable_cache ^
--output_name="%OUTPUT_NAME%"

pause