Fix: Use Wan 2.2 base models for LoRA adapters

parent 3bc73607
......@@ -8052,14 +8052,35 @@ def main(args):
print(f" Using override base model: {base_model_id}")
if not base_model_id:
# Try to infer base model from LoRA name
if "wan" in lora_id.lower():
if m_info.get("supports_i2v"):
base_model_id = "Wan-AI/Wan2.1-I2V-14B-Diffusers"
# Try to infer base model from LoRA/model name
lora_id_lower = lora_id.lower()
# Wan models - check for version 2.2 first, then 2.1
if "wan" in lora_id_lower:
if "wan2.2" in lora_id_lower or "wan2_2" in lora_id_lower:
# Wan 2.2 models
if m_info.get("supports_i2v"):
base_model_id = "Wan-AI/Wan2.2-I2V-14B-Diffusers"
else:
base_model_id = "Wan-AI/Wan2.2-T2V-14B-Diffusers"
elif "wan2.1" in lora_id_lower or "wan2_1" in lora_id_lower:
# Wan 2.1 models
if m_info.get("supports_i2v"):
base_model_id = "Wan-AI/Wan2.1-I2V-14B-Diffusers"
else:
base_model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
else:
base_model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
elif "svd" in lora_id.lower():
# Generic Wan - default to 2.2 I2V if supports_i2v
if m_info.get("supports_i2v"):
base_model_id = "Wan-AI/Wan2.2-I2V-14B-Diffusers"
else:
base_model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
elif "svd" in lora_id_lower or "stable-video" in lora_id_lower:
base_model_id = "stabilityai/stable-video-diffusion-img2vid-xt-1-1"
elif "sdxl" in lora_id_lower:
base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
elif "flux" in lora_id_lower:
base_model_id = "black-forest-labs/FLUX.1-dev"
else:
print(f"❌ Cannot determine base model for LoRA: {lora_id}")
print(f" Please specify --base-model when using this LoRA")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment