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
renzhc
diffusers_dcu
Commits
843e3f93
Unverified
Commit
843e3f93
authored
Jul 30, 2025
by
Ömer Karışman
Committed by
GitHub
Jul 30, 2025
Browse files
wan2.2 i2v FirstBlockCache fix (#12013)
* enable caching for WanImageToVideoPipeline * ruff format
parent
d8854b8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
src/diffusers/pipelines/wan/pipeline_wan_i2v.py
src/diffusers/pipelines/wan/pipeline_wan_i2v.py
+15
-13
No files found.
src/diffusers/pipelines/wan/pipeline_wan_i2v.py
View file @
843e3f93
...
@@ -750,6 +750,7 @@ class WanImageToVideoPipeline(DiffusionPipeline, WanLoraLoaderMixin):
...
@@ -750,6 +750,7 @@ class WanImageToVideoPipeline(DiffusionPipeline, WanLoraLoaderMixin):
latent_model_input
=
torch
.
cat
([
latents
,
condition
],
dim
=
1
).
to
(
transformer_dtype
)
latent_model_input
=
torch
.
cat
([
latents
,
condition
],
dim
=
1
).
to
(
transformer_dtype
)
timestep
=
t
.
expand
(
latents
.
shape
[
0
])
timestep
=
t
.
expand
(
latents
.
shape
[
0
])
with
current_model
.
cache_context
(
"cond"
):
noise_pred
=
current_model
(
noise_pred
=
current_model
(
hidden_states
=
latent_model_input
,
hidden_states
=
latent_model_input
,
timestep
=
timestep
,
timestep
=
timestep
,
...
@@ -760,6 +761,7 @@ class WanImageToVideoPipeline(DiffusionPipeline, WanLoraLoaderMixin):
...
@@ -760,6 +761,7 @@ class WanImageToVideoPipeline(DiffusionPipeline, WanLoraLoaderMixin):
)[
0
]
)[
0
]
if
self
.
do_classifier_free_guidance
:
if
self
.
do_classifier_free_guidance
:
with
current_model
.
cache_context
(
"uncond"
):
noise_uncond
=
current_model
(
noise_uncond
=
current_model
(
hidden_states
=
latent_model_input
,
hidden_states
=
latent_model_input
,
timestep
=
timestep
,
timestep
=
timestep
,
...
...
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