possible fix: Seamless not working with Custom VAE's

This commit is contained in:
blessedcoolant
2024-02-14 23:01:49 +05:30
committed by Kent Keirsey
parent 17d5f7bebd
commit ff9bd040cc
4 changed files with 32 additions and 18 deletions

View File

@ -30,7 +30,7 @@ def set_seamless(model: Union[UNet2DConditionModel, AutoencoderKL], seamless_axe
# Callable: (input: Tensor, weight: Tensor, bias: Optional[Tensor]) -> Tensor
to_restore: list[tuple[nn.Conv2d | nn.ConvTranspose2d, Callable]] = []
try:
# Hard coded to skip down block layers, allowing for seamless tiling at the expense of prompt adherence
# Hard coded to skip down block layers, allowing for seamless tiling at the expense of prompt adherence
skipped_layers = 1
for m_name, m in model.named_modules():
if not isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):