Allow any number of input frames in VAE.

This commit is contained in:
comfyanonymous 2025-11-20 18:15:44 -05:00 committed by comfyanonymous
parent 023036ef9d
commit 8ccd4ca886

View File

@ -232,8 +232,8 @@ class Encoder(nn.Module):
if self.refiner_vae: if self.refiner_vae:
xl = [x[:, :, :1, :, :]] xl = [x[:, :, :1, :, :]]
if x.shape[2] > 1: if x.shape[2] > self.ffactor_temporal:
xl += torch.split(x[:, :, 1:, :, :], self.ffactor_temporal, dim=2) xl += torch.split(x[:, :, 1: 1 + ((x.shape[2] - 1) // self.ffactor_temporal) * self.ffactor_temporal, :, :], self.ffactor_temporal, dim=2)
x = xl x = xl
else: else:
x = [x] x = [x]