aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_vae_approx.py
Commit message (Collapse)AuthorAgeFilesLines
* Add FP32 fallback support on sd_vae_approxhidenorly2023-11-201-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: ``` "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' ``` In this case, ```--no-half``` doesn't help to solve. Therefore this commits add the FP32 fallback execution to solve it. Note that the submodule may require additional modifications. The following is the example modification on the other submodule. ```repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/openaimodel.py class Upsample(nn.Module): ..snip.. def forward(self, x): assert x.shape[1] == self.channels if self.dims == 3: x = F.interpolate( x, (x.shape[2], x.shape[3] * 2, x.shape[4] * 2), mode="nearest" ) else: try: x = F.interpolate(x, scale_factor=2, mode="nearest") except: x = F.interpolate(x.to(th.float32), scale_factor=2, mode="nearest").to(x.dtype) if self.use_conv: x = self.conv(x) return x ..snip.. ``` You can see the FP32 fallback execution as same as sd_vae_approx.py.
* add TAESD for i2i and t2iKohaku-Blueleaf2023-08-041-1/+1
|
* add cheap VAE approximation coeffs for SDXLAUTOMATIC11112023-07-141-6/+16
|
* add XL support for live previews: approx and TAESDAUTOMATIC11112023-07-131-11/+26
|
* modules/sd_vae_approx.py: fix VAE-approx pathZhang Hua2023-03-111-1/+4
|
* Fix Approx NN on devices other than CUDAbrkirch2023-01-151-1/+1
|
* added cheap NN approximation for VAEAUTOMATIC2022-12-241-0/+58