[Model] Add LTX-2.5 support (#6070)
Signed-off-by: lishunyang12 <lishunyang12@163.com>
This commit is contained in:
1 parent
f39b8684eb
commit
ce6ab0ca46
47 files changed
+4558
-218
No files matched your search
@@ -538,7 +538,11 @@ class DiffusionCacheConfig:
|
||||
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{item}'")
|
||||
|
||||
|
||||
def resolve_model_class_name(model: str | None, diffusion_load_format: str = "default") -> str | None:
|
||||
def resolve_model_class_name(
|
||||
model: str | None,
|
||||
diffusion_load_format: str = "default",
|
||||
revision: str | None = None,
|
||||
) -> str | None:
|
||||
"""Resolve the diffusion pipeline class name from the model config.
|
||||
|
||||
Read-only counterpart of ``OmniDiffusionConfig.enrich_config``, safe to call
|
||||
@@ -550,11 +554,10 @@ def resolve_model_class_name(model: str | None, diffusion_load_format: str = "de
|
||||
|
||||
if not model:
|
||||
return None
|
||||
|
||||
is_lance_subfolder = os.path.basename(str(model).rstrip("/")) in {"Lance_3B", "Lance_3B_Video"}
|
||||
|
||||
# Diffusers models: read _class_name from the pipeline index.
|
||||
model_index = get_diffusion_model_index(model)
|
||||
model_index = get_diffusion_model_index(model, revision=revision)
|
||||
if model_index is not None:
|
||||
return model_index.get("_class_name")
|
||||
if diffusion_load_format == "diffusers":
|
||||
@@ -562,7 +565,7 @@ def resolve_model_class_name(model: str | None, diffusion_load_format: str = "de
|
||||
|
||||
# Other models: map model_type / architecture from config.json.
|
||||
try:
|
||||
cfg = get_hf_file_to_dict("config.json", model) or {}
|
||||
cfg = get_hf_file_to_dict("config.json", model, revision=revision) or {}
|
||||
except Exception:
|
||||
cfg = {}
|
||||
model_type = cfg.get("model_type")
|
||||
@@ -1210,9 +1213,20 @@ class OmniDiffusionConfig:
|
||||
exc,
|
||||
)
|
||||
else:
|
||||
tf_config_dict = get_hf_file_to_dict("transformer/config.json", self.model)
|
||||
from vllm_omni.model_extras import get_transformer_config_subfolder
|
||||
|
||||
transformer_subfolder = get_transformer_config_subfolder(
|
||||
self.model_class_name,
|
||||
model=self.model,
|
||||
revision=self.revision,
|
||||
)
|
||||
tf_config_dict = get_hf_file_to_dict(
|
||||
f"{transformer_subfolder}/config.json",
|
||||
self.model,
|
||||
revision=self.revision,
|
||||
)
|
||||
if tf_config_dict is None:
|
||||
tf_config_dict = get_hf_file_to_dict("unet/config.json", self.model)
|
||||
tf_config_dict = get_hf_file_to_dict("unet/config.json", self.model, revision=self.revision)
|
||||
if tf_config_dict is not None:
|
||||
self.set_tf_model_config(TransformerConfig.from_dict(tf_config_dict))
|
||||
else:
|
||||
@@ -1232,7 +1246,7 @@ class OmniDiffusionConfig:
|
||||
"that require additional inputs."
|
||||
)
|
||||
else:
|
||||
cfg = get_hf_file_to_dict("config.json", self.model)
|
||||
cfg = get_hf_file_to_dict("config.json", self.model, revision=self.revision)
|
||||
if cfg is None:
|
||||
# Lance ships its top-level config.json one directory above
|
||||
# the per-checkpoint subfolders (``Lance_3B/`` or
|
||||
|
||||
Reference in new issue
Block a user