Commit 39eae9f0 authored by hidenorly's avatar hidenorly
Browse files

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
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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, ]: