Make t2i adapter work with any latent resolution.

This commit is contained in:
comfyanonymous 2023-05-08 18:15:19 -04:00
parent a8705dbfe2
commit c6e34963e4

View File

@ -56,7 +56,12 @@ class Downsample(nn.Module):
def forward(self, x):
assert x.shape[1] == self.channels
return self.op(x)
if not self.use_conv:
padding = [x.shape[2] % 2, x.shape[3] % 2]
self.op.padding = padding
x = self.op(x)
return x
class ResnetBlock(nn.Module):