diff options
author | brkirch <brkirch@users.noreply.github.com> | 2023-07-18 03:39:38 +0000 |
---|---|---|
committer | brkirch <brkirch@users.noreply.github.com> | 2023-07-18 04:39:50 +0000 |
commit | f0e2098f1a533c88396536282c1d6cd7d847a51c (patch) | |
tree | c6df7315687e0692837655c2b2b62bed64d7b529 /modules/sd_models.py | |
parent | a99d5708e6d603e8f7cfd1b8c6595f8026219ba0 (diff) | |
download | stable-diffusion-webui-gfx803-f0e2098f1a533c88396536282c1d6cd7d847a51c.tar.gz stable-diffusion-webui-gfx803-f0e2098f1a533c88396536282c1d6cd7d847a51c.tar.bz2 stable-diffusion-webui-gfx803-f0e2098f1a533c88396536282c1d6cd7d847a51c.zip |
Add support for `--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)
|