Skip to content

Commit 1f08600

Browse files
committed
overwrite xformers in the unclip model config if not available
1 parent 8a34671 commit 1f08600

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/sd_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ def repair_config(sd_config):
383383
elif shared.cmd_opts.upcast_sampling:
384384
sd_config.model.params.unet_config.params.use_fp16 = True
385385

386+
if getattr(sd_config.model.params.first_stage_config.params.ddconfig, "attn_type", None) == "vanilla-xformers" and not shared.xformers_available:
387+
sd_config.model.params.first_stage_config.params.ddconfig.attn_type = "vanilla"
388+
386389
# For UnCLIP-L, override the hardcoded karlo directory
387390
if hasattr(sd_config.model.params, "noise_aug_config") and hasattr(sd_config.model.params.noise_aug_config.params, "clip_stats_path"):
388391
karlo_path = os.path.join(paths.models_path, 'karlo')

0 commit comments

Comments
 (0)