StableDiffusion/ldm
hidenorly ca92a1406b Add FP32 fallback support on ldm/modules/diffusionmodules/openaimodel.py
This tries to execute interpolate with FP32 if it failed.

Background is that
on some environment such as Mx chip MacOS devices, we get error as follows:

```
"      File "ldm/modules/diffusionmodules/openaimodel.py", line 115, in forward
        x = F.interpolate(x, scale_factor=2, mode="nearest")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "torch/nn/functional.py", line 3931, in interpolate
        return torch._C._nn.upsample_nearest2d(input, output_size, scale_factors)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: "upsample_nearest2d_channels_last" not implemented for 'Half'
```

Therefore this commit adds the FP32 fallback execution to solve it.
2023-11-22 00:21:19 +09:00
..
data release more models 2022-11-24 01:22:28 +01:00
models merge unclip into main 2023-03-24 13:02:54 +01:00
modules Add FP32 fallback support on ldm/modules/diffusionmodules/openaimodel.py 2023-11-22 00:21:19 +09:00
util.py add stable unclip 2023-03-24 11:18:44 +01:00