From f0df8bb58373643b9e98d243a3a134f9523717e9 Mon Sep 17 00:00:00 2001 From: Aryaman Gupta Date: Tue, 27 Jan 2026 08:27:03 -0800 Subject: [PATCH] correct validation for autoregressive mv --- cosmos_transfer2/multiview_config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cosmos_transfer2/multiview_config.py b/cosmos_transfer2/multiview_config.py index 54e9a809..8d565058 100644 --- a/cosmos_transfer2/multiview_config.py +++ b/cosmos_transfer2/multiview_config.py @@ -122,7 +122,7 @@ def validate_input_paths(self): if not active_views: raise ValueError("At least one view configuration with a control_path must be provided.") - if self.num_conditional_frames > 0 or self.enable_autoregressive: + if self.num_conditional_frames > 0 and not self.enable_autoregressive: missing_input_paths = [ view_name for view_name, view_config in active_views if view_config.input_path is None ] @@ -131,6 +131,8 @@ def validate_input_paths(self): "input_path is required for all active views when num_conditional_frames > 0. " f"Missing input_path for views: {', '.join(missing_input_paths)}" ) + + if self.enable_autoregressive: # Check per-view frame counts when autoregressive mode is enabled. num_conditional_frames_per_view = [ view_config.num_conditional_frames_per_view for _, view_config in active_views @@ -149,6 +151,16 @@ def validate_input_paths(self): "num_conditional_frames_per_view must be consistent across all active views in autoregressive mode. " "Either set it for all views or leave all at default (0)." ) + + if any(frames > 0 for frames in num_conditional_frames_per_view): + missing_input_paths = [ + view_name for view_name, view_config in active_views if view_config.input_path is None + ] + if missing_input_paths: + raise ValueError( + "input_path is required for all active views when num_conditional_frames > 0. " + f"Missing input_path for views: {', '.join(missing_input_paths)}" + ) return self @property