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
f7037008
Unverified
Commit
f7037008
authored
Oct 10, 2025
by
gushiqiao
Committed by
GitHub
Oct 10, 2025
Browse files
[Feat] support convert qwen-image to 8bit (#357)
parent
a14288d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
tools/convert/converter.py
tools/convert/converter.py
+6
-1
tools/convert/readme.md
tools/convert/readme.md
+25
-0
tools/convert/readme_zh.md
tools/convert/readme_zh.md
+25
-0
No files found.
tools/convert/converter.py
View file @
f7037008
...
...
@@ -642,7 +642,7 @@ def main():
parser
.
add_argument
(
"-t"
,
"--model_type"
,
choices
=
[
"wan_dit"
,
"hunyuan_dit"
,
"wan_t5"
,
"wan_clip"
,
"wan_animate_dit"
],
choices
=
[
"wan_dit"
,
"hunyuan_dit"
,
"wan_t5"
,
"wan_clip"
,
"wan_animate_dit"
,
"qwen_image_dit"
],
default
=
"wan_dit"
,
help
=
"Model type"
,
)
...
...
@@ -686,6 +686,11 @@ def main():
args
.
non_linear_dtype
=
eval
(
args
.
non_linear_dtype
)
model_type_keys_map
=
{
"qwen_image_dit"
:
{
"key_idx"
:
2
,
"target_keys"
:
[
"attn"
,
"img_mlp"
,
"txt_mlp"
],
"ignore_key"
:
None
,
},
"wan_dit"
:
{
"key_idx"
:
2
,
"target_keys"
:
[
"self_attn"
,
"cross_attn"
,
"ffn"
],
...
...
tools/convert/readme.md
View file @
f7037008
...
...
@@ -72,6 +72,31 @@ python converter.py \
--quantized
```
### QWen-Image DIT
```
bash
python converter.py
\
--source
/path/to/Qwen-Image-Edit/transformer
\
--output
/Path/To/output
\
--output_ext
.safetensors
\
--output_name
qwen_int8
\
--linear_dtype
torch.int8
\
--model_type
qwen_image_dit
\
--quantized
\
--save_by_block
```
```
bash
python converter.py
\
--source
/path/to/Qwen-Image-Edit/transformer
\
--output
/Path/To/output
\
--output_ext
.safetensors
\
--output_name
qwen_fp8
\
--linear_dtype
torch.float8_e4m3fn
\
--model_type
qwen_image_dit
\
--quantized
\
--save_by_block
```
### Wan T5EncoderModel
...
...
tools/convert/readme_zh.md
View file @
f7037008
...
...
@@ -72,6 +72,31 @@ python converter.py \
--quantized
```
### QWen-Image DIT
```
bash
python converter.py
\
--source
/path/to/Qwen-Image-Edit/transformer
\
--output
/Path/To/output
\
--output_ext
.safetensors
\
--output_name
qwen_int8
\
--linear_dtype
torch.int8
\
--model_type
qwen_image_dit
\
--quantized
\
--save_by_block
```
```
bash
python converter.py
\
--source
/path/to/Qwen-Image-Edit/transformer
\
--output
/Path/To/output
\
--output_ext
.safetensors
\
--output_name
qwen_fp8
\
--linear_dtype
torch.float8_e4m3fn
\
--model_type
qwen_image_dit
\
--quantized
\
--save_by_block
```
### Wan T5EncoderModel
...
...
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