Fix: AttributeError when switching between models with "Baked VAE" and LoRAs (#323)

This commit is contained in:
Dominik Boller
2025-05-30 05:16:17 +02:00
committed by GitHub
parent 36ddf0e694
commit ef2e3d782c

View File

@@ -155,11 +155,17 @@ class TSC_EfficientLoader:
if lora_stack:
lora_params.extend(lora_stack)
# Load LoRa(s)
model, clip = load_lora(lora_params, ckpt_name, my_unique_id, cache=lora_cache, ckpt_cache=ckpt_cache, cache_overwrite=True)
# Load LoRA(s)
model, clip = load_lora(lora_params, ckpt_name, my_unique_id, cache=lora_cache, ckpt_cache=ckpt_cache,
cache_overwrite=True)
if vae_name == "Baked VAE":
vae = get_bvae_by_ckpt_name(ckpt_name)
if vae is None:
print(
f"{warning('Efficiency Nodes:')} Baked VAE not found in cache, loading checkpoint to extract VAE...")
_, _, vae = load_checkpoint(ckpt_name, my_unique_id, output_vae=True, cache=ckpt_cache,
cache_overwrite=True)
else:
model, clip, vae = load_checkpoint(ckpt_name, my_unique_id, cache=ckpt_cache, cache_overwrite=True)
lora_params = None