Commit 39eae9f0 authored by hidenorly's avatar hidenorly

Revert "Add FP32 fallback support on sd_vae_approx"

This reverts commit 58c19545.
Since the modification is expected to move to mac_specific.py
(https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14046#issuecomment-1826731532)
parent 58c19545
......@@ -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.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, ]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment