[diffusion] model: support Anima Base v1.0 (#41011)

Co-authored-by: Mick Qian <mickqian@users.noreply.github.com>
This commit is contained in:
Mick
2026-09-26 09:53:51 +08:00
committed by GitHub
co-authored by Mick Qian
parent 0967a013c2
commit 2ee82fe158
26 changed files with 1589 additions and 46 deletions
+7 -9
View File
@@ -43,15 +43,13 @@ def _is_diffusion_model_from_registry(model_path: str) -> bool:
def _is_diffusers_model_dir(model_dir: str) -> bool:
"""Check if a local directory contains a valid diffusers model_index.json."""
config_path = os.path.join(model_dir, "model_index.json")
if not os.path.exists(config_path):
return False
with open(config_path) as f:
config = json.load(f)
return "_diffusers_version" in config
"""Check for a standard or modular Diffusers pipeline index."""
for filename in ("model_index.json", "modular_model_index.json"):
config_path = os.path.join(model_dir, filename)
if os.path.isfile(config_path):
with open(config_path) as f:
return "_diffusers_version" in json.load(f)
return False
def _is_gated_diffusion_repo(repo_id: str) -> bool: