aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_models.py
diff options
context:
space:
mode:
authorMrCheeze <fishycheeze@yahoo.ca>2023-03-26 16:55:29 -0400
committerMrCheeze <fishycheeze@yahoo.ca>2023-03-26 16:55:29 -0400
commit1f08600345298fac0bcb66cc215a81875a84d7b9 (patch)
treed650c82866e99f5d395138a92c3216273977ed14 /modules/sd_models.py
parent8a34671fe91e142bce9e5556cca2258b3be9dd6e (diff)
overwrite xformers in the unclip model config if not available
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r--modules/sd_models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py
index c1a80d82..e741470a 100644
--- a/modules/sd_models.py
+++ b/modules/sd_models.py
@@ -383,6 +383,9 @@ def repair_config(sd_config):
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"
+
# For UnCLIP-L, override the hardcoded karlo directory
if hasattr(sd_config.model.params, "noise_aug_config") and hasattr(sd_config.model.params.noise_aug_config.params, "clip_stats_path"):
karlo_path = os.path.join(paths.models_path, 'karlo')