diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-13 14:32:35 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-13 14:32:35 +0000 |
commit | e16ebc917dfc902f041963df0d4e99e8141cf82f (patch) | |
tree | a7f502f92f87f3f006b576eb5e1cfed54355b552 /modules/sd_models.py | |
parent | b8159d0919dcaa3a1a8f29e3aa30c25fe8e5f13b (diff) | |
download | stable-diffusion-webui-gfx803-e16ebc917dfc902f041963df0d4e99e8141cf82f.tar.gz stable-diffusion-webui-gfx803-e16ebc917dfc902f041963df0d4e99e8141cf82f.tar.bz2 stable-diffusion-webui-gfx803-e16ebc917dfc902f041963df0d4e99e8141cf82f.zip |
repair --no-half for SDXL
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index e4aae597..9e8cb3cf 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -395,10 +395,11 @@ def repair_config(sd_config): if not hasattr(sd_config.model.params, "use_ema"):
sd_config.model.params.use_ema = False
- if shared.cmd_opts.no_half:
- sd_config.model.params.unet_config.params.use_fp16 = False
- elif shared.cmd_opts.upcast_sampling:
- sd_config.model.params.unet_config.params.use_fp16 = True
+ if hasattr(sd_config.model.params, 'unet_config'):
+ if shared.cmd_opts.no_half:
+ sd_config.model.params.unet_config.params.use_fp16 = False
+ elif shared.cmd_opts.upcast_sampling:
+ sd_config.model.params.unet_config.params.use_fp16 = True
if getattr(sd_config.model.params.first_stage_config.params.ddconfig, "attn_type", None) == "vanilla-xformers" and not shared.xformers_available:
sd_config.model.params.first_stage_config.params.ddconfig.attn_type = "vanilla"
|