Commit 4254eddc authored by Stefy Lanza (nextime / spora )'s avatar Stefy Lanza (nextime / spora )

Merge branch 'experimental'

parents e6901870 e668b610
......@@ -8554,13 +8554,6 @@ def main(args):
m_info = MODELS[model_key]
# Fix LoRA model info - the stored values may be incorrect
# Always determine supports_i2v and base model from the LoRA name
if m_info.get("is_lora"):
lora_id = m_info.get("id", "").lower()
if "i2v" in lora_id:
m_info["supports_i2v"] = True
# Determine task type based on arguments
model_id = m_info["id"]
is_i2v_mode = args.image_to_video or args.image
......@@ -8661,20 +8654,22 @@ def main(args):
if is_lora:
lora_id = m_info["id"]
base_model_id = m_info.get("base_model")
# Allow manual override via --base-model
if args.base_model:
base_model_id = args.base_model
print(f" Using override base model: {base_model_id}")
else:
# Always re-infer base model from LoRA name - the stored value may be incorrect
# This is especially important for Wan models where I2V vs T2V matters
if not base_model_id:
# 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 - use lora_id_lower to determine I2V vs T2V
# This is more reliable than m_info.get("supports_i2v")
if "i2v" in lora_id_lower:
base_model_id = "Wan-AI/Wan2.2-I2V-A14B-Diffusers"
else:
......@@ -8687,6 +8682,7 @@ def main(args):
base_model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
else:
# Generic Wan - check the lora_id for i2v instead of m_info
# This is more reliable as m_info.supports_i2v may not be set correctly
if "i2v" in lora_id_lower:
base_model_id = "Wan-AI/Wan2.2-I2V-A14B-Diffusers"
else:
......@@ -8698,9 +8694,6 @@ def main(args):
elif "flux" in lora_id_lower:
base_model_id = "black-forest-labs/FLUX.1-dev"
else:
# Fallback to stored value if we can't infer
base_model_id = m_info.get("base_model")
if not base_model_id:
print(f"❌ Cannot determine base model for LoRA: {lora_id}")
print(f" Please specify --base-model when using this LoRA")
sys.exit(1)
......@@ -9418,7 +9411,11 @@ def main(args):
# before loading the video model. This ensures only one model is in memory at a time.
if args.image_to_video or args.image:
if not m_info.get("supports_i2v"):
# Check I2V support - also detect from model ID if not in config
model_id = m_info.get("id", "").lower()
tags = m_info.get("tags", [])
supports_i2v = m_info.get("supports_i2v") or "i2v" in model_id or "image-to-video" in tags
if not supports_i2v:
print(f"Error: {args.model} does not support image-to-video.")
sys.exit(1)
......
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