--- license: apache-2.0 base_model: Wan-AI/Wan2.1-T2V-14B library_name: peft pipeline_tag: text-to-video model_name: Wan2.1 T2V 14B CFG5-to-CFG1 native-50-step LoRA r128 iter500 tags: - wan2.1 - wan2.1-t2v-14b - text-to-video - lora - cfg-distillation - native-step - rank128 - iter500 --- # Wan2.1-T2V-14B CFG-only distillation LoRA This repository contains the iteration-500 generator LoRA from a CFG-only distillation run on [Wan-AI/Wan2.1-T2V-14B](https://huggingface.co/Wan-AI/Wan2.1-T2V-14B). The training target is the base model's standard CFG=5 guided flow; the student is trained and evaluated at CFG=1. The repository name records the complete contract: CFG5-to-CFG1, native 50 steps, rank 128, and iteration 500. This is **not** a few-step, DMD, SFP, or autoregressive checkpoint. It keeps the native 50-step schedule and removes the unconditional inference branch. ## CFG scales and inference contract | Setting | Value | | --- | ---: | | Teacher CFG used for distillation | **5.0** | | Student CFG during training | **1.0** | | Recommended inference CFG | **1.0** | | Default LoRA weight scale | **1.0** | | Teacher to student denoising steps | **50 to 50** | | Scheduler / timestep shift | FlowUniPC / **5.0** | | LoRA rank / alpha / dropout | **128 / 128 / 0** | | Training iteration | **500** | Wan inference uses `v_cfg = v_uncond + g * (v_cond - v_uncond)`. Therefore `g=5` is standard CFG 5, while `g=1` is exactly the conditional prediction and requires one transformer call per denoising step. CFG and LoRA weight scale are different controls. ## Adapter contents - Generator-only LoRA; optimizer and training-state files are not published - 800 finite FP32 tensors, 400 complete A/B pairs - 613,416,960 LoRA parameters - 400 Linear targets across all 40 transformer blocks - Per block: self-attention q/k/v/o, cross-attention q/k/v/o, and FFN 0/2 - Native and Safetensors exports match the source checkpoint tensor-for-tensor ## Files - `adapter_model.safetensors`: safe portable generator LoRA state dict - `adapter_config.json`: PEFT rank, alpha, and exact target-module names - `generator_lora.pt`: native LongLive payload with `generator_lora` and `step=500` - `training_config.yaml`: exact executed training configuration - `inference_overrides.yaml`: matched native-50-step CFG=1 settings - `release_metadata.json`: machine-readable training and evaluation contract - `provenance.json`: source hashes and export validation - `SHA256SUMS`: checksums for every published artifact PyTorch pickle files should only be loaded from trusted sources. Prefer the Safetensors file when the target runtime supports it. ## Download and LongLive usage ```python from huggingface_hub import hf_hub_download lora_path = hf_hub_download( repo_id="Perflow-Shuai/Wan2.1-T2V-14B-CFG5-to-CFG1-50Step-LoRA-r128-iter500", filename="generator_lora.pt", ) print(lora_path) ``` Configure the LongLive Wan2.1-T2V-14B inference path with: ```yaml checkpoints: lora_ckpt: /path/to/generator_lora.pt inference: sampling_steps: 50 guidance_scale: 1.0 lora_weight_scale: 1.0 adapter: type: lora rank: 128 alpha: 128 dropout: 0.0 ``` ## Validation The step-500 adapter was evaluated on eight held-out prompts using matched prompt, seed, initial noise, and scheduler state for three arms: Base CFG=5, Base CFG=1, and Distilled CFG=1 at LoRA scale 1. All 24 videos decoded with 81 unique frames at 832x480, 16 FPS. The auxiliary latent-distance gap ratio was below 1 for all eight cases (mean 0.7671, or 23.29% mean gap closure toward the CFG=5 reference). This is a small diagnostic suite, not a broad benchmark. ## Training provenance and limitation The run reached 500 cumulative optimizer updates at effective global batch 32. At step 92 it migrated from 16 data-parallel ranks with accumulation 2 to 8 ranks with accumulation 4. LoRA bytes, optimizer state, global sample order, and update boundaries were preserved, but FSDP reduction order and per-rank RNG streams changed; the continuation is sample-equivalent, not bitwise identical to an uninterrupted run. The adapter is validated only for Wan2.1-T2V-14B with the matched 50-step, CFG=1, LoRA-scale-1 contract. Other schedulers, resolutions, lengths, CFG values, LoRA scales, and downstream fine-tunes are not established here. ## Integrity | Weight file | Bytes | SHA-256 | | --- | ---: | --- | | `generator_lora.pt` | 2453955566 | `0ceb9d5f8a16e413900e59c8643465da896cafcb4eb2d42481423cd666115344` | | `adapter_model.safetensors` | 2453769728 | `1a311f6030a74e739d9705347079a131bd5a5579bd693c993026d63e36d4bea0` | Original step-500 checkpoint SHA-256: `af81887d941dcf6d0fb6c6925f7b38eecfbed5cfe444cc8e92988c10963d904f`. Training configuration SHA-256: `f0ec25972040e12912f02704d69193085e47b7acc692173ad88339cb13ed4e2b`. Executed training code commit: `011a1d04a1f084fae1de1ee421da7f70efabf378`. The public commit [`b1d380ffaaad8706b6a9b4d4f3e80867db88a300`](https://github.com/AndysonYs/LongLive-LoRA/commit/b1d380ffaaad8706b6a9b4d4f3e80867db88a300) has the identical Git tree `7f576cd6ed371befa1a0afd408af100b55b63f99`; the commit IDs differ only because the same change was replayed onto a different parent. This is a research checkpoint. The release records artifact integrity and the executed training contract; it does not claim universal prompt quality.