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

Merge branch 'experimental'

parents 186980e3 9f29b0c1
...@@ -1254,6 +1254,9 @@ def validate_hf_model(model_id, hf_token=None, debug=False): ...@@ -1254,6 +1254,9 @@ def validate_hf_model(model_id, hf_token=None, debug=False):
for tag in tags: for tag in tags:
if tag.startswith("base_model:"): if tag.startswith("base_model:"):
base_model_from_tags = tag.replace("base_model:", "") base_model_from_tags = tag.replace("base_model:", "")
# Add -Diffusers suffix if not present (required for HuggingFace model IDs)
if base_model_from_tags and not base_model_from_tags.endswith("-Diffusers"):
base_model_from_tags = f"{base_model_from_tags}-Diffusers"
if debug: if debug:
print(f" [DEBUG] Found base model in tags: {base_model_from_tags}") print(f" [DEBUG] Found base model in tags: {base_model_from_tags}")
break break
...@@ -2006,8 +2009,8 @@ def search_hf_models(query, limit=20, hf_token=None): ...@@ -2006,8 +2009,8 @@ def search_hf_models(query, limit=20, hf_token=None):
model_id = m.get("id", "") model_id = m.get("id", "")
tags = m.get("tags", []) tags = m.get("tags", [])
# Determine type model_name_lower = model_id.lower()
is_i2v = any(t in tags for t in ["image-to-video", "i2v"]) is_i2v = any(t in tags for t in ["image-to-video", "i2v"]) or "i2v" in model_name_lower
is_video = "video" in tags or "text-to-video" in tags is_video = "video" in tags or "text-to-video" in tags
is_image = "text-to-image" in tags is_image = "text-to-image" in tags
...@@ -8654,14 +8657,21 @@ def main(args): ...@@ -8654,14 +8657,21 @@ def main(args):
if is_lora: if is_lora:
lora_id = m_info["id"] lora_id = m_info["id"]
# For Wan LoRA adapters, don't use stored base_model as it may be incorrect
# Instead, always infer from LoRA ID (check for i2v vs t2v) # First, try to use stored base_model from config
lora_id_lower = lora_id.lower() base_model_id = m_info.get("base_model")
if "wan" in lora_id_lower:
# Skip reading from config - infer from LoRA ID instead # For Wan LoRA adapters, validate stored base_model against tags
base_model_id = None # The stored config may have incorrect base_model (T2V instead of I2V)
else: if "wan" in lora_id.lower() and base_model_id:
base_model_id = m_info.get("base_model") # Check tags for correct base model
tags = m_info.get("tags", [])
tags_str = " ".join(tags).lower() if tags else ""
# If stored base_model is T2V but tags show I2V, we need to fix
if "t2v" in base_model_id.lower() and "i2v" in tags_str:
print(f" ⚠️ Stored base_model appears incorrect (T2V), checking tags...")
base_model_id = None # Force fallback to inference
# Allow manual override via --base-model # Allow manual override via --base-model
if args.base_model: if args.base_model:
......
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