[Frontend][Model] Add Cosmos3 control uploads to video API (#7027)
Signed-off-by: Fred Huang <frhuang@nvidia.com>
This commit is contained in:
1 parent
677265b64b
commit
85b0bad2d3
6 files changed
+434
-9
No files matched your search
@@ -182,6 +182,35 @@ class OmniOpenAIServingVideo:
|
||||
)
|
||||
return capability is True or metadata_capability
|
||||
|
||||
@property
|
||||
def supported_control_upload_types(self) -> frozenset[str]:
|
||||
"""Return multipart control types accepted by the active pipeline.
|
||||
|
||||
Unknown pipelines deliberately return an empty set. This keeps the
|
||||
generic video API isolated from model-specific controls unless a model
|
||||
explicitly opts into the ``control_path`` contract in metadata.
|
||||
"""
|
||||
od_config = self._resolve_diffusion_od_config()
|
||||
model_archs = [None if od_config is None else getattr(od_config, "model_class_name", None)]
|
||||
for stage_config in self.stage_configs or ():
|
||||
stage_get = (
|
||||
stage_config.get if isinstance(stage_config, Mapping) else lambda key: getattr(stage_config, key, None)
|
||||
)
|
||||
engine_args = stage_get("engine_args") or {}
|
||||
model_archs.extend(
|
||||
(
|
||||
stage_get("model_arch"),
|
||||
engine_args.get("model_class_name")
|
||||
if isinstance(engine_args, Mapping)
|
||||
else getattr(engine_args, "model_class_name", None),
|
||||
)
|
||||
)
|
||||
|
||||
supported: set[str] = set()
|
||||
for model_arch in model_archs:
|
||||
supported.update(get_diffusion_model_metadata(model_arch).supported_control_upload_types)
|
||||
return frozenset(supported)
|
||||
|
||||
@classmethod
|
||||
def for_diffusion(
|
||||
cls,
|
||||
|
||||
Reference in new issue
Block a user