fix the frame num calculation for i2v

This commit is contained in:
huangyitong.hyt
2025-07-29 12:54:11 +08:00
parent 4e24c3d54f
commit 8691b0d4f2
+3 -3
View File
@@ -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]