Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xuwx1
LightX2V
Commits
9fcb2cf8
Unverified
Commit
9fcb2cf8
authored
Oct 22, 2025
by
gushiqiao
Committed by
GitHub
Oct 22, 2025
Browse files
update config and fix wan22 lora bug (#396)
parent
b56dbb85
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
11 deletions
+54
-11
configs/wan22/wan_moe_i2v_distil_with_lora.json
configs/wan22/wan_moe_i2v_distil_with_lora.json
+40
-0
configs/wan22/wan_moe_i2v_distill_quant.json
configs/wan22/wan_moe_i2v_distill_quant.json
+1
-1
lightx2v/models/networks/wan/model.py
lightx2v/models/networks/wan/model.py
+1
-1
tools/convert/converter.py
tools/convert/converter.py
+6
-5
tools/convert/readme.md
tools/convert/readme.md
+3
-2
tools/convert/readme_zh.md
tools/convert/readme_zh.md
+3
-2
No files found.
configs/wan22/wan_moe_i2v_distil_with_lora.json
0 → 100755
View file @
9fcb2cf8
{
"infer_steps"
:
4
,
"target_video_length"
:
81
,
"text_len"
:
512
,
"target_height"
:
720
,
"target_width"
:
1280
,
"self_attn_1_type"
:
"sage_attn2"
,
"cross_attn_1_type"
:
"sage_attn2"
,
"cross_attn_2_type"
:
"sage_attn2"
,
"sample_guide_scale"
:
[
3.5
,
3.5
],
"sample_shift"
:
5.0
,
"enable_cfg"
:
false
,
"cpu_offload"
:
true
,
"offload_granularity"
:
"block"
,
"t5_cpu_offload"
:
false
,
"vae_cpu_offload"
:
false
,
"use_image_encoder"
:
false
,
"boundary_step_index"
:
2
,
"denoising_step_list"
:
[
1000
,
750
,
500
,
250
],
"lora_configs"
:
[
{
"name"
:
"high_noise_model"
,
"path"
:
"lightx2v/Wan2.2-Distill-Loras/wan2.2_i2v_A14b_high_noise_lora_rank64_lightx2v_4step_1022.safetensors"
,
"strength"
:
1.0
},
{
"name"
:
"low_noise_model"
,
"path"
:
"lightx2v/Wan2.2-Distill-Loras/wan2.2_i2v_A14b_low_noise_lora_rank64_lightx2v_4step_1022.safetensors"
,
"strength"
:
1.0
}
]
}
configs/wan22/wan_moe_i2v_distill_quant.json
View file @
9fcb2cf8
...
@@ -28,5 +28,5 @@
...
@@ -28,5 +28,5 @@
"dit_quantized"
:
true
,
"dit_quantized"
:
true
,
"dit_quant_scheme"
:
"fp8-sgl"
,
"dit_quant_scheme"
:
"fp8-sgl"
,
"t5_quantized"
:
true
,
"t5_quantized"
:
true
,
"t5_quant_scheme"
:
"fp8"
"t5_quant_scheme"
:
"fp8
-sgl
"
}
}
lightx2v/models/networks/wan/model.py
View file @
9fcb2cf8
...
@@ -107,7 +107,7 @@ class WanModel(CompiledMethodsMixin):
...
@@ -107,7 +107,7 @@ class WanModel(CompiledMethodsMixin):
return
False
return
False
def
_should_init_empty_model
(
self
):
def
_should_init_empty_model
(
self
):
if
self
.
config
.
get
(
"lora_configs"
)
and
self
.
config
.
lora_configs
:
if
self
.
config
.
get
(
"lora_configs"
)
and
self
.
config
[
"
lora_configs
"
]
:
if
self
.
model_type
in
[
"wan2.1"
]:
if
self
.
model_type
in
[
"wan2.1"
]:
return
True
return
True
if
self
.
model_type
in
[
"wan2.2_moe_high_noise"
]:
if
self
.
model_type
in
[
"wan2.2_moe_high_noise"
]:
...
...
tools/convert/converter.py
View file @
9fcb2cf8
...
@@ -715,10 +715,11 @@ def convert_weights(args):
...
@@ -715,10 +715,11 @@ def convert_weights(args):
index
[
"metadata"
][
"total_size"
]
+=
os
.
path
.
getsize
(
output_path
)
index
[
"metadata"
][
"total_size"
]
+=
os
.
path
.
getsize
(
output_path
)
# Save index file
# Save index file
index_path
=
os
.
path
.
join
(
args
.
output
,
"diffusion_pytorch_model.safetensors.index.json"
)
if
not
args
.
single_file
:
with
open
(
index_path
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
index_path
=
os
.
path
.
join
(
args
.
output
,
"diffusion_pytorch_model.safetensors.index.json"
)
json
.
dump
(
index
,
f
,
indent
=
2
)
with
open
(
index_path
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
logger
.
info
(
f
"Index file written to:
{
index_path
}
"
)
json
.
dump
(
index
,
f
,
indent
=
2
)
logger
.
info
(
f
"Index file written to:
{
index_path
}
"
)
if
os
.
path
.
isdir
(
args
.
source
)
and
args
.
copy_no_weight_files
:
if
os
.
path
.
isdir
(
args
.
source
)
and
args
.
copy_no_weight_files
:
copy_non_weight_files
(
args
.
source
,
args
.
output
)
copy_non_weight_files
(
args
.
source
,
args
.
output
)
...
@@ -783,7 +784,7 @@ def main():
...
@@ -783,7 +784,7 @@ def main():
parser
.
add_argument
(
parser
.
add_argument
(
"--device"
,
"--device"
,
type
=
str
,
type
=
str
,
default
=
"c
p
u"
,
default
=
"cu
da
"
,
help
=
"Device to use for quantization (cpu/cuda)"
,
help
=
"Device to use for quantization (cpu/cuda)"
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
...
...
tools/convert/readme.md
View file @
9fcb2cf8
...
@@ -48,7 +48,7 @@ A powerful model weight conversion tool that supports format conversion, quantiz
...
@@ -48,7 +48,7 @@ A powerful model weight conversion tool that supports format conversion, quantiz
-
`torch.bfloat16`
: BF16
-
`torch.bfloat16`
: BF16
-
`torch.float16`
: FP16
-
`torch.float16`
: FP16
-
`torch.float32`
: FP32 (default)
-
`torch.float32`
: FP32 (default)
-
`--device`
: Device for quantization,
`cpu`
(default) or
`cuda`
-
`--device`
: Device for quantization,
`cpu`
or
`cuda`
(default)
-
`--comfyui_mode`
: ComfyUI compatible mode
-
`--comfyui_mode`
: ComfyUI compatible mode
-
`--full_quantized`
: Full quantization mode (effective in ComfyUI mode)
-
`--full_quantized`
: Full quantization mode (effective in ComfyUI mode)
...
@@ -391,7 +391,8 @@ python converter.py \
...
@@ -391,7 +391,8 @@ python converter.py \
--source
/path/to/model.pth
\
--source
/path/to/model.pth
\
--output
/path/to/output
\
--output
/path/to/output
\
--output_ext
.safetensors
\
--output_ext
.safetensors
\
--output_name
model
--output_name
model
\
--single_file
```
```
#### 4.2 Multiple .safetensors → Single File
#### 4.2 Multiple .safetensors → Single File
...
...
tools/convert/readme_zh.md
View file @
9fcb2cf8
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
-
`torch.bfloat16`
: BF16
-
`torch.bfloat16`
: BF16
-
`torch.float16`
: FP16
-
`torch.float16`
: FP16
-
`torch.float32`
: FP32(默认)
-
`torch.float32`
: FP32(默认)
-
`--device`
: 量化使用的设备,可选
`cpu`
(默认)
或
`cuda`
-
`--device`
: 量化使用的设备,可选
`cpu`
或
`cuda`
(默认)
-
`--comfyui_mode`
: ComfyUI 兼容模式
-
`--comfyui_mode`
: ComfyUI 兼容模式
-
`--full_quantized`
: 全量化模式(ComfyUI 模式下有效)
-
`--full_quantized`
: 全量化模式(ComfyUI 模式下有效)
...
@@ -391,7 +391,8 @@ python converter.py \
...
@@ -391,7 +391,8 @@ python converter.py \
--source
/path/to/model.pth
\
--source
/path/to/model.pth
\
--output
/path/to/output
\
--output
/path/to/output
\
--output_ext
.safetensors
\
--output_ext
.safetensors
\
--output_name
model
--output_name
model
\
--single_file
```
```
#### 4.2 多个 .safetensors → 单文件
#### 4.2 多个 .safetensors → 单文件
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment