Fix LTX2 channels-last review scope
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
81e5e8e3bb
commit
dc072a12bd
11 files changed
+35
-60
No files matched your search
@@ -57,6 +57,17 @@ _LTX_COMPONENT_SUBFOLDERS = (
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_LTX2_CHANNELS_LAST_3D_EXTRA = "ltx2_use_channels_last_3d"
|
||||
|
||||
|
||||
def _ltx2_use_channels_last_3d(od_config: Any) -> bool:
|
||||
"""Read the LTX2-only channels-last opt-in from model extras."""
|
||||
extras = getattr(od_config, "extras", {}) or {}
|
||||
enabled = extras.get(_LTX2_CHANNELS_LAST_3D_EXTRA, False)
|
||||
if not isinstance(enabled, bool):
|
||||
raise TypeError(f"{_LTX2_CHANNELS_LAST_3D_EXTRA} must be a bool, got {type(enabled)!r}")
|
||||
return enabled
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class LTXComponentProfile:
|
||||
@@ -365,7 +376,7 @@ def initialize_pipeline_components(pipeline: Any, od_config: Any) -> None:
|
||||
local_files_only=local_files_only,
|
||||
dtype=dtype,
|
||||
)
|
||||
if getattr(od_config, "vae_use_channels_last_3d", False):
|
||||
if _ltx2_use_channels_last_3d(od_config):
|
||||
pipeline.vae.enable_channels_last_3d()
|
||||
pipeline.audio_vae = _load_component(
|
||||
AutoencoderKLLTX2Audio,
|
||||
|
||||
Reference in new issue
Block a user