diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-18 05:08:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 05:08:19 +0000 |
commit | 871b8687a82bb2ca907d8a49c87aed7635b8fc33 (patch) | |
tree | 1667c35ac0fde25ee60183de4b01a6c0581f5f73 /modules/sd_models.py | |
parent | 20c41364ccba1319e68e6b4a58f53f110c5d4828 (diff) | |
parent | f0e2098f1a533c88396536282c1d6cd7d847a51c (diff) | |
download | stable-diffusion-webui-gfx803-871b8687a82bb2ca907d8a49c87aed7635b8fc33.tar.gz stable-diffusion-webui-gfx803-871b8687a82bb2ca907d8a49c87aed7635b8fc33.tar.bz2 stable-diffusion-webui-gfx803-871b8687a82bb2ca907d8a49c87aed7635b8fc33.zip |
Merge pull request #11846 from brkirch/sd-xl-upcast-sampling-fix
Add support for using `--upcast-sampling` with SD XL
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 4d9382dd..5813b550 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -326,7 +326,7 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer timer.record("apply half()")
- devices.dtype_unet = model.model.diffusion_model.dtype
+ devices.dtype_unet = torch.float16 if model.is_sdxl and not shared.cmd_opts.no_half else model.model.diffusion_model.dtype
devices.unet_needs_upcast = shared.cmd_opts.upcast_sampling and devices.dtype == torch.float16 and devices.dtype_unet == torch.float16
model.first_stage_model.to(devices.dtype_vae)
|