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
e7f3a737
Unverified
Commit
e7f3a737
authored
Apr 21, 2025
by
Aryan
Committed by
GitHub
Apr 21, 2025
Browse files
Fix Wan I2V prepare_latents dtype (#11371)
update
parent
7a4a126d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/diffusers/pipelines/wan/pipeline_wan_i2v.py
src/diffusers/pipelines/wan/pipeline_wan_i2v.py
+2
-1
No files found.
src/diffusers/pipelines/wan/pipeline_wan_i2v.py
View file @
e7f3a737
...
...
@@ -409,7 +409,7 @@ class WanImageToVideoPipeline(DiffusionPipeline, WanLoraLoaderMixin):
[
image
,
image
.
new_zeros
(
image
.
shape
[
0
],
image
.
shape
[
1
],
num_frames
-
2
,
height
,
width
),
last_image
],
dim
=
2
,
)
video_condition
=
video_condition
.
to
(
device
=
device
,
dtype
=
dtype
)
video_condition
=
video_condition
.
to
(
device
=
device
,
dtype
=
self
.
vae
.
dtype
)
latents_mean
=
(
torch
.
tensor
(
self
.
vae
.
config
.
latents_mean
)
...
...
@@ -429,6 +429,7 @@ class WanImageToVideoPipeline(DiffusionPipeline, WanLoraLoaderMixin):
latent_condition
=
retrieve_latents
(
self
.
vae
.
encode
(
video_condition
),
sample_mode
=
"argmax"
)
latent_condition
=
latent_condition
.
repeat
(
batch_size
,
1
,
1
,
1
,
1
)
latent_condition
=
latent_condition
.
to
(
dtype
)
latent_condition
=
(
latent_condition
-
latents_mean
)
*
latents_std
mask_lat_size
=
torch
.
ones
(
batch_size
,
1
,
num_frames
,
latent_height
,
latent_width
)
...
...
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