mirror of
https://github.com/Wan-Video/Wan2.2.git
synced 2026-08-29 01:52:54 +08:00
fix the frame num calculation for i2v
This commit is contained in:
+3
-3
@@ -279,14 +279,14 @@ class WanI2V:
|
||||
seed_g.manual_seed(seed)
|
||||
noise = torch.randn(
|
||||
16,
|
||||
21,
|
||||
(F - 1) // self.vae_stride[0] + 1,
|
||||
lat_h,
|
||||
lat_w,
|
||||
dtype=torch.float32,
|
||||
generator=seed_g,
|
||||
device=self.device)
|
||||
|
||||
msk = torch.ones(1, 81, lat_h, lat_w, device=self.device)
|
||||
msk = torch.ones(1, F, lat_h, lat_w, device=self.device)
|
||||
msk[:, 1:] = 0
|
||||
msk = torch.concat([
|
||||
torch.repeat_interleave(msk[:, 0:1], repeats=4, dim=1), msk[:, 1:]
|
||||
@@ -316,7 +316,7 @@ class WanI2V:
|
||||
torch.nn.functional.interpolate(
|
||||
img[None].cpu(), size=(h, w), mode='bicubic').transpose(
|
||||
0, 1),
|
||||
torch.zeros(3, 80, h, w)
|
||||
torch.zeros(3, F - 1, h, w)
|
||||
],
|
||||
dim=1).to(self.device)
|
||||
])[0]
|
||||
|
||||
Reference in New Issue
Block a user