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
4f7c54d8
Commit
4f7c54d8
authored
Aug 01, 2025
by
helloyongyang
Browse files
fix wan model bug
parent
984cd6c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lightx2v/models/networks/wan/model.py
lightx2v/models/networks/wan/model.py
+7
-3
No files found.
lightx2v/models/networks/wan/model.py
View file @
4f7c54d8
...
...
@@ -187,10 +187,10 @@ class WanModel:
self
.
pre_infer
=
self
.
pre_infer_class
(
self
.
config
)
self
.
post_infer
=
self
.
post_infer_class
(
self
.
config
)
self
.
transformer_infer
=
self
.
transformer_infer_class
(
self
.
config
)
if
self
.
config
.
parallel
and
self
.
config
.
parallel
.
get
(
"cfg_p_size"
,
False
)
and
self
.
config
.
parallel
.
cfg_p_size
>
1
:
self
.
infer
=
self
.
infer_with_cfg_parallel
if
self
.
config
[
"enable_cfg"
]
and
self
.
config
.
parallel
and
self
.
config
.
parallel
.
get
(
"cfg_p_size"
,
False
)
and
self
.
config
.
parallel
.
cfg_p_size
>
1
:
self
.
infer
_func
=
self
.
infer_with_cfg_parallel
else
:
self
.
infer
=
self
.
infer_wo_cfg_parallel
self
.
infer
_func
=
self
.
infer_wo_cfg_parallel
def
set_scheduler
(
self
,
scheduler
):
self
.
scheduler
=
scheduler
...
...
@@ -208,6 +208,10 @@ class WanModel:
self
.
post_weight
.
to_cuda
()
self
.
transformer_weights
.
to_cuda
()
@
torch
.
no_grad
()
def
infer
(
self
,
inputs
):
return
self
.
infer_func
(
inputs
)
@
torch
.
no_grad
()
def
infer_wo_cfg_parallel
(
self
,
inputs
):
if
self
.
cpu_offload
:
...
...
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