stable-diffusion-webui/modules
hidenorly 58c19545c8 Add FP32 fallback support on sd_vae_approx
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.
2023-11-21 01:13:53 +09:00
..
api repair unload sd checkpoint button 2023-10-15 09:41:02 +03:00
codeformer Autofix Ruff W (not W605) (mostly whitespace) 2023-05-11 20:29:11 +03:00
hypernetworks fix whitespace for #13084 2023-09-09 09:15:09 +03:00
models/diffusion Simplify a bunch of len(x) > 0/len(x) == 0 style expressions 2023-06-02 15:07:10 +03:00
processing_scripts Restore missing tooltips 2023-09-01 17:01:08 -06:00
textual_inversion remove duplicated code 2023-10-14 12:17:59 +03:00
cache.py use an atomic operation to replace the cache with the new version 2023-08-22 17:45:47 +03:00
call_queue.py feat: replace threading.Lock() to FIFOLock 2023-08-21 17:49:58 +08:00
cmd_args.py correct a typo 2023-11-05 11:37:23 +09:00
codeformer_model.py added torch.mps.empty_cache() to torch_gc() 2023-07-08 17:13:18 +03:00
config_states.py Config states time ISO in system time zone 2023-09-16 09:11:54 +09:00
deepbooru_model.py Add option for float32 sampling with float16 UNet 2023-01-25 01:13:02 -05:00
deepbooru.py ruff auto fixes 2023-05-10 11:05:02 +03:00
devices.py fix for crash when running #12924 without --device-id 2023-09-09 09:39:37 +03:00
errors.py update gradio to 3.41.2 2023-08-27 08:45:40 +03:00
esrgan_model_arch.py Autofix Ruff W (not W605) (mostly whitespace) 2023-05-11 20:29:11 +03:00
esrgan_model.py Upscaler.load_model: don't return None, just use exceptions 2023-06-13 12:44:25 +03:00
extensions.py rework extensions metadata: use custom sorter that doesn't mess the order as much and ignores cyclic errors, use classes with named fields instead of dictionaries, eliminate some duplicated code 2023-11-20 14:47:09 +03:00
extra_networks_hypernet.py Simplify a bunch of len(x) > 0/len(x) == 0 style expressions 2023-06-02 15:07:10 +03:00
extra_networks.py fix error that causes some extra networks to be disabled if both <lora:> and <lyco:> are present in the prompt 2023-08-27 08:41:48 +03:00
extras.py add metadata to checkpoint merger 2023-08-01 08:27:54 +03:00
face_restoration.py
fifo_lock.py feat: replace threading.Lock() to FIFOLock 2023-08-21 17:49:58 +08:00
generation_parameters_copypaste.py fix re_param_code (regression bug PR #13458) 2023-10-03 01:16:41 +09:00
gfpgan_model.py fix Blank line contains whitespace 2023-10-22 04:32:13 +08:00
gitpython_hack.py Fix some deprecated types 2023-08-29 00:54:57 -06:00
gradio_extensons.py remove unneeded example_inputs from gradio config 2023-08-22 08:18:01 +03:00
hashes.py cache git extension repo information 2023-07-15 09:20:43 +03:00
images.py write infotext to gif image as comment 2023-09-30 09:34:50 +03:00
img2img.py Option to show batch img2img results in UI 2023-11-19 17:37:32 +09:00
import_hook.py add a comment for disable xformers hack 2022-12-24 07:57:56 +03:00
initialize_util.py add an option to not print stack traces on ctrl+c. 2023-10-15 08:45:38 +03:00
initialize.py add --skip-load-model-at-start 2023-09-14 18:42:56 +08:00
interrogate.py add --medvram-sdxl 2023-08-22 18:49:08 +03:00
launch_utils.py save sysinfo as .json 2023-11-20 01:38:31 +09:00
localization.py Update localization.py 2023-09-11 09:22:27 +08:00
logging_config.py actually adds handler to logging_config.py 2023-11-16 17:53:57 -03:00
lowvram.py add --medvram-sdxl 2023-08-22 18:49:08 +03:00
mac_specific.py Remove duplicate code for torchsde randn 2023-08-13 10:07:52 -04:00
masking.py Autofix Ruff W (not W605) (mostly whitespace) 2023-05-11 20:29:11 +03:00
memmon.py attempt to fix memory monitor with multiple CUDA devices 2023-03-12 21:04:17 +03:00
modelloader.py Merge pull request #10823 from akx/model-loady 2023-06-27 09:20:49 +03:00
ngrok.py Merge branch 'dev' into ngrok-py 2023-05-18 10:12:17 +03:00
options.py fix add_option overriding config with default 2023-09-12 22:53:09 +09:00
patches.py store patches for Lora in a specialized module 2023-08-15 19:23:40 +03:00
paths_internal.py correct webpath when webui_dir is not work_dir 2023-09-13 16:05:55 +09:00
paths.py correct webpath when webui_dir is not work_dir 2023-09-13 16:05:55 +09:00
postprocessing.py hotfix: call shared.state.end() after postprocessing done 2023-11-15 14:26:37 +09:00
processing.py fix pix2pix producing bad results 2023-11-07 11:33:33 +03:00
progress.py actual solution to the uncommon hanging problem that is seemingly caused by multiple progress requests working on same tensor 2023-08-22 10:41:10 +03:00
prompt_parser.py Merge pull request #13797 from Meerkov/master 2023-11-03 20:11:54 +03:00
realesrgan_model.py tell RealESRGANer which device to run on, could be cuda, M1, or other GPU 2023-08-23 14:31:38 +08:00
restart.py alternative solution to #13434 2023-09-30 08:23:12 +03:00
rng_philox.py minor performance improvements for philox 2023-08-03 07:53:03 +03:00
rng.py feat: fix randn found element of type float at pos 2 2023-11-17 09:48:18 +00:00
Roboto-Regular.ttf Drop fonts + font-roboto deps since we only use the single regular cut of Roboto 2023-05-11 10:07:28 +03:00
safe.py rename print_error to report, use it with together with package name 2023-05-31 19:56:37 +03:00
script_callbacks.py Merge pull request #12846 from a666/deprecated-types 2023-09-09 10:31:56 +03:00
script_loading.py add backwards compatibility --lyco-dir-backcompat option, use that for LyCORIS directory instead of hardcoded value 2023-07-18 20:11:30 +03:00
scripts_auto_postprocessing.py ruff auto fixes 2023-05-10 11:05:02 +03:00
scripts_postprocessing.py suggestions and fixes from the PR 2023-05-10 21:21:32 +03:00
scripts.py rework extensions metadata: use custom sorter that doesn't mess the order as much and ignores cyclic errors, use classes with named fields instead of dictionaries, eliminate some duplicated code 2023-11-20 14:47:09 +03:00
sd_disable_initialization.py send weights to target device instead of CPU memory 2023-08-16 12:11:01 +03:00
sd_hijack_checkpoint.py add option to show/hide warnings 2023-01-18 23:04:24 +03:00
sd_hijack_clip_old.py Simplify a bunch of len(x) > 0/len(x) == 0 style expressions 2023-06-02 15:07:10 +03:00
sd_hijack_clip.py fix missing TI hash 2023-08-03 18:46:49 +09:00
sd_hijack_ip2p.py imports cleanup for ruff 2023-05-10 08:43:42 +03:00
sd_hijack_open_clip.py repair --medvram for SD2.x too after SDXL update 2023-07-24 11:57:59 +03:00
sd_hijack_optimizations.py Make sub-quadratic the default for MPS 2023-08-13 10:06:25 -04:00
sd_hijack_unet.py Add support for --upcast-sampling with SD XL 2023-07-18 00:39:50 -04:00
sd_hijack_utils.py Fix full previews, --no-half-vae 2023-01-26 01:43:35 -05:00
sd_hijack_xlmr.py imports cleanup for ruff 2023-05-10 08:43:42 +03:00
sd_hijack.py fix exception related to the pix2pix 2023-11-06 11:17:36 +03:00
sd_models_config.py fix linter issues 2023-10-01 12:25:19 +08:00
sd_models_types.py linter 2023-11-05 19:32:21 +03:00
sd_models_xl.py option to keep multiple models in memory 2023-08-01 00:24:48 +03:00
sd_models.py more changes for #13865: fix formatting, rename the function, add comment and add a readme entry 2023-11-05 19:46:20 +03:00
sd_samplers_cfg_denoiser.py ditch --always-batch-cond-uncond in favor of an UI setting 2023-08-21 15:07:10 +03:00
sd_samplers_common.py fix an issue where VAE would remain in fp16 after an auto-switch to fp32 2023-08-30 21:13:24 +03:00
sd_samplers_compvis.py Merge branch 'dev' into refiner 2023-08-08 21:49:47 +03:00
sd_samplers_extra.py some stylistic changes for the sampler code 2023-07-29 08:38:00 +03:00
sd_samplers_kdiffusion.py Merge pull request #12856 from catboxanon/extra-noise-noisy-latent 2023-08-30 08:23:37 +03:00
sd_samplers_timesteps_impl.py repair DDIM/PLMS/UniPC batches 2023-08-14 08:49:02 +03:00
sd_samplers_timesteps.py Merge pull request #12856 from catboxanon/extra-noise-noisy-latent 2023-08-30 08:23:37 +03:00
sd_samplers.py pass samplers from UI by name, make it possible to use a sampler from infotext even if it's hidden in the dropdown 2023-08-08 21:28:34 +03:00
sd_unet.py initial work on sd_unet for SDXL 2023-09-11 21:17:40 +03:00
sd_vae_approx.py Add FP32 fallback support on sd_vae_approx 2023-11-21 01:13:53 +09:00
sd_vae_taesd.py add TAESD for i2i and t2i 2023-08-04 13:38:52 +08:00
sd_vae.py Merge pull request #12797 from Madrawn/vae_resolve_bug 2023-08-27 09:45:00 +03:00
shared_cmd_options.py consolidate local check 2023-08-28 03:43:27 +09:00
shared_gradio_themes.py Add NoCrypt/miku gradio theme 2023-08-15 13:22:44 +07:00
shared_init.py split webui.py's initialization and utility functions into separate files 2023-08-09 18:11:13 +03:00
shared_items.py added compact prompt option 2023-11-05 19:19:55 +03:00
shared_options.py Merge pull request #14009 from AUTOMATIC1111/Option-to-show-batch-img2img-results-in-UI 2023-11-20 17:44:58 +03:00
shared_state.py initialize state.time_start befroe state.job_count 2023-09-13 16:27:02 +09:00
shared_total_tqdm.py split shared.py into multiple files; should resolve all circular reference import errors related to shared.py 2023-08-09 10:25:35 +03:00
shared.py add type annotations for extra fields of shared.sd_model 2023-08-22 19:05:03 +03:00
styles.py add style editor dialog 2023-08-03 23:31:13 +03:00
sub_quadratic_attention.py Fix some deprecated types 2023-08-29 00:54:57 -06:00
sysinfo.py hide --gradio-auth and --api-auth values from /internal/sysinfo report 2023-08-27 20:17:01 +03:00
timer.py add --log-startup option to print detailed startup progress 2023-07-22 17:15:38 +03:00
txt2img.py lint 2023-09-09 15:59:22 +09:00
ui_checkpoint_merger.py gradio 3.39 2023-08-04 08:04:23 +03:00
ui_common.py added compact prompt option 2023-11-05 19:19:55 +03:00
ui_components.py make resize handle available to extensions 2023-08-21 08:48:46 +03:00
ui_extensions.py Config states time ISO in system time zone 2023-09-16 09:11:54 +09:00
ui_extra_networks_checkpoints_user_metadata.py SD VAE rework 2 2023-08-07 08:07:20 +03:00
ui_extra_networks_checkpoints.py Merge pull request #13014 from AUTOMATIC1111/thread-safe-extranetworks-list_items 2023-11-19 09:09:21 +03:00
ui_extra_networks_hypernets.py add comment 2023-09-12 09:29:07 +09:00
ui_extra_networks_textual_inversion.py add comment 2023-09-12 09:29:07 +09:00
ui_extra_networks_user_metadata.py Merge pull request #12864 from AUTOMATIC1111/extension-time-format-time-zone 2023-08-30 09:45:23 +03:00
ui_extra_networks.py Adds 'Path' sorting for Extra network cards 2023-11-13 22:01:52 +06:00
ui_gradio_extensions.py correct webpath when webui_dir is not work_dir 2023-09-13 16:05:55 +09:00
ui_loadsave.py make InputAccordion work with ui-config 2023-09-11 13:47:44 +09:00
ui_postprocessing.py gradio 3.39 2023-08-04 08:04:23 +03:00
ui_prompt_styles.py Merge pull request #13931 from AUTOMATIC1111/style-hotkeys 2023-11-19 09:11:49 +03:00
ui_settings.py repair unload sd checkpoint button 2023-10-15 09:41:02 +03:00
ui_tempdir.py Make Gradio temp directory if it doesn't exist 2023-08-21 17:36:17 -04:00
ui_toprow.py added compact prompt option 2023-11-05 19:19:55 +03:00
ui.py save sysinfo as .json 2023-11-20 01:38:31 +09:00
upscaler.py Fix missing ext_filter kwarg 2023-06-03 22:28:00 +07:00
util.py split shared.py into multiple files; should resolve all circular reference import errors related to shared.py 2023-08-09 10:25:35 +03:00
xlmr_m18.py fix linter issues 2023-10-01 12:25:19 +08:00
xlmr.py Autofix Ruff W (not W605) (mostly whitespace) 2023-05-11 20:29:11 +03:00