Commit b1df7600 authored by gaclove's avatar gaclove
Browse files

fix(lora): update config

parent a1d35e4c
{
"infer_steps": 4,
"target_video_length": 81,
"target_height": 480,
"target_width": 832,
"self_attn_1_type": "flash_attn3",
"cross_attn_1_type": "flash_attn3",
"cross_attn_2_type": "flash_attn3",
"seed": 42,
"sample_guide_scale": 5,
"sample_shift": 5,
"enable_cfg": false,
"cpu_offload": false,
"denoising_step_list": [1000, 750, 500, 250],
"lora_path": [
"Wan2.1-I2V-14B-480P/loras/Wan21_I2V_14B_lightx2v_cfg_step_distill_lora_rank64.safetensors"
]
"infer_steps": 4,
"target_video_length": 81,
"target_height": 480,
"target_width": 832,
"self_attn_1_type": "flash_attn3",
"cross_attn_1_type": "flash_attn3",
"cross_attn_2_type": "flash_attn3",
"seed": 42,
"sample_guide_scale": 5,
"sample_shift": 5,
"enable_cfg": false,
"cpu_offload": false,
"denoising_step_list": [1000, 750, 500, 250],
"lora_configs": [
{
"path": "Wan2.1-I2V-14B-480P/loras/Wan21_I2V_14B_lightx2v_cfg_step_distill_lora_rank64.safetensors",
"strength": 1.0
}
]
}
{
"infer_steps": 4,
"target_video_length": 81,
"text_len": 512,
"target_height": 480,
"target_width": 832,
"self_attn_1_type": "flash_attn3",
"cross_attn_1_type": "flash_attn3",
"cross_attn_2_type": "flash_attn3",
"seed": 42,
"sample_guide_scale": 6,
"sample_shift": 5,
"enable_cfg": false,
"cpu_offload": false,
"denoising_step_list": [1000, 750, 500, 250],
"lora_path": [
"Wan2.1-T2V-14B/loras/Wan21_T2V_14B_lightx2v_cfg_step_distill_lora_rank64.safetensors"
]
"infer_steps": 4,
"target_video_length": 81,
"text_len": 512,
"target_height": 480,
"target_width": 832,
"self_attn_1_type": "flash_attn3",
"cross_attn_1_type": "flash_attn3",
"cross_attn_2_type": "flash_attn3",
"seed": 42,
"sample_guide_scale": 6,
"sample_shift": 5,
"enable_cfg": false,
"cpu_offload": false,
"denoising_step_list": [1000, 750, 500, 250],
"lora_configs": [
{
"path": "Wan2.1-T2V-14B/loras/Wan21_T2V_14B_lightx2v_cfg_step_distill_lora_rank64.safetensors",
"strength": 1.0
}
]
}
......@@ -17,14 +17,17 @@ Specify LoRA path in configuration file:
```json
{
"lora_path": [
"/path/to/your/lora.safetensors"
],
"strength_model": 1.0
"lora_configs": [
{
"path": "/path/to/your/lora.safetensors",
"strength": 1.0
}
]
}
```
**Configuration Parameter Description:**
- `lora_path`: LoRA weight file path list, supports loading multiple LoRAs simultaneously
- `strength_model`: LoRA strength coefficient (alpha), controls LoRA's influence on the original model
......@@ -137,6 +140,7 @@ python tools/extract/lora_extractor.py \
### Advanced Usage Examples
**Extract High-Rank LoRA:**
```bash
python tools/extract/lora_extractor.py \
--source-model /path/to/base/model \
......@@ -147,6 +151,7 @@ python tools/extract/lora_extractor.py \
```
**Save Weight Differences Only:**
```bash
python tools/extract/lora_extractor.py \
--source-model /path/to/base/model \
......@@ -185,6 +190,7 @@ python tools/extract/lora_merger.py \
### Advanced Usage Examples
**Partial Strength Merging:**
```bash
python tools/extract/lora_merger.py \
--source-model /path/to/base/model \
......@@ -195,6 +201,7 @@ python tools/extract/lora_merger.py \
```
**Multi-Format Support:**
```bash
python tools/extract/lora_merger.py \
--source-model /path/to/base/model.pt \
......
......@@ -38,8 +38,11 @@ Multiple configuration options are provided in the [configs/distill/](https://gi
"infer_steps": 4, // Inference steps
"denoising_step_list": [999, 750, 500, 250], // Denoising timestep list
"enable_cfg": false, // Disable CFG for speed improvement
"lora_path": [ // LoRA weights path (optional)
"path/to/distill_lora.safetensors"
"lora_configs": [ // LoRA weights path (optional)
{
"path": "path/to/distill_lora.safetensors",
"strength": 1.0
}
]
}
```
......@@ -50,21 +53,25 @@ Multiple configuration options are provided in the [configs/distill/](https://gi
**Complete Model:**
Place the downloaded model (`distill_model.pt` or `distill_model.safetensors`) in the `distill_models/` folder under the Wan model root directory:
- For T2V: `Wan2.1-T2V-14B/distill_models/`
- For I2V-480P: `Wan2.1-I2V-14B-480P/distill_models/`
**LoRA:**
1. Place the downloaded LoRA in any location
2. Modify the `lora_path` parameter in the configuration file to the LoRA storage path
### Inference Scripts
**T2V Complete Model:**
```bash
bash scripts/wan/run_wan_t2v_distill_4step_cfg.sh
```
**I2V Complete Model:**
```bash
bash scripts/wan/run_wan_i2v_distill_4step_cfg.sh
```
......@@ -72,11 +79,13 @@ bash scripts/wan/run_wan_i2v_distill_4step_cfg.sh
### Step Distillation LoRA Inference Scripts
**T2V LoRA:**
```bash
bash scripts/wan/run_wan_t2v_distill_4step_cfg_lora.sh
```
**I2V LoRA:**
```bash
bash scripts/wan/run_wan_i2v_distill_4step_cfg_lora.sh
```
......
......@@ -16,14 +16,17 @@ LoRA (Low-Rank Adaptation) 是一种高效的模型微调技术,通过低秩
```json
{
"lora_path": [
"/path/to/your/lora.safetensors"
],
"strength_model": 1.0
"lora_configs": [
{
"path": "/path/to/your/lora.safetensors",
"strength": 1.0
}
]
}
```
**配置参数说明:**
- `lora_path`: LoRA 权重文件路径列表,支持多个 LoRA 同时加载
- `strength_model`: LoRA 强度系数 (alpha),控制 LoRA 对原模型的影响程度
......@@ -136,6 +139,7 @@ python tools/extract/lora_extractor.py \
### 高级用法示例
**提取高秩 LoRA:**
```bash
python tools/extract/lora_extractor.py \
--source-model /path/to/base/model \
......@@ -146,6 +150,7 @@ python tools/extract/lora_extractor.py \
```
**仅保存权重差值:**
```bash
python tools/extract/lora_extractor.py \
--source-model /path/to/base/model \
......@@ -184,6 +189,7 @@ python tools/extract/lora_merger.py \
### 高级用法示例
**部分强度合并:**
```bash
python tools/extract/lora_merger.py \
--source-model /path/to/base/model \
......@@ -194,6 +200,7 @@ python tools/extract/lora_merger.py \
```
**多格式支持:**
```bash
python tools/extract/lora_merger.py \
--source-model /path/to/base/model.pt \
......
......@@ -38,8 +38,11 @@
"infer_steps": 4, // 推理步数
"denoising_step_list": [999, 750, 500, 250], // 去噪时间步列表
"enable_cfg": false, // 关闭CFG以提升速度
"lora_path": [ // LoRA权重路径(可选)
"path/to/distill_lora.safetensors"
"lora_configs": [ // LoRA权重路径(可选)
{
"path": "path/to/distill_lora.safetensors",
"strength": 1.0
}
]
}
```
......@@ -50,21 +53,25 @@
**完整模型:**
将下载好的模型(`distill_model.pt` 或者 `distill_model.safetensors`)放到 Wan 模型根目录的 `distill_models/` 文件夹下即可
- 对于 T2V:`Wan2.1-T2V-14B/distill_models/`
- 对于 I2V-480P:`Wan2.1-I2V-14B-480P/distill_models/`
**LoRA:**
1. 将下载好的 LoRA 放到任意位置
2. 修改配置文件中的 `lora_path` 参数为 LoRA 存放路径即可
### 推理脚本
**T2V 完整模型:**
```bash
bash scripts/wan/run_wan_t2v_distill_4step_cfg.sh
```
**I2V 完整模型:**
```bash
bash scripts/wan/run_wan_i2v_distill_4step_cfg.sh
```
......@@ -72,11 +79,13 @@ bash scripts/wan/run_wan_i2v_distill_4step_cfg.sh
### 步数蒸馏 LoRA 推理脚本
**T2V LoRA:**
```bash
bash scripts/wan/run_wan_t2v_distill_4step_cfg_lora.sh
```
**I2V LoRA:**
```bash
bash scripts/wan/run_wan_i2v_distill_4step_cfg_lora.sh
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment