Revert "Add FP32 fallback support on sd_vae_approx"

This reverts commit 58c19545c8.
Since the modification is expected to move to mac_specific.py
(https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14046#issuecomment-1826731532)
This commit is contained in:
hidenorly 2023-11-29 04:07:48 +09:00
parent 58c19545c8
commit 39eae9f009

View File

@ -21,13 +21,7 @@ class VAEApprox(nn.Module):
def forward(self, x):
extra = 11
try:
x = nn.functional.interpolate(x, (x.shape[2] * 2, x.shape[3] * 2))
except RuntimeError as e:
if "not implemented for" in str(e) and "Half" in str(e):
x = nn.functional.interpolate(x.to(torch.float32), (x.shape[2] * 2, x.shape[3] * 2)).to(x.dtype)
else:
print(f"An unexpected RuntimeError occurred: {str(e)}")
x = nn.functional.interpolate(x, (x.shape[2] * 2, x.shape[3] * 2))
x = nn.functional.pad(x, (extra, extra, extra, extra))
for layer in [self.conv1, self.conv2, self.conv3, self.conv4, self.conv5, self.conv6, self.conv7, self.conv8, ]: