-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Modular branch specific defaults #14234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
234b3be
f3fda64
c3b1c58
13c9023
8af5c64
1f32ed7
7efee11
1c913ac
c7cc16b
240ec86
2c4a221
324f660
3483a8a
f8e3a35
3a2888f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,9 @@ class Cosmos3AutoTextEncoderStep(AutoPipelineBlocks): | |
| Components: | ||
| video_processor (`VideoProcessor`) text_tokenizer (`AutoTokenizer`) | ||
|
|
||
| Configs: | ||
| default_use_system_prompt (default: True) enable_safety_checker (default: True) | ||
|
|
||
| Inputs: | ||
| control_videos (`dict`, *optional*): | ||
| Mapping of hint name (edge/blur/depth/seg/wsm) to the control video for that modality. | ||
|
|
@@ -140,9 +143,8 @@ class Cosmos3AutoTextEncoderStep(AutoPipelineBlocks): | |
| The text prompt that guides Cosmos3 generation. | ||
| negative_prompt (`str`, *optional*): | ||
| The negative text prompt used for classifier-free guidance. | ||
| use_system_prompt (`bool`, *optional*): | ||
| Whether to prepend the system prompt. Defaults to the pipeline configuration for standard and action | ||
| workflows and to True for transfer. | ||
| use_system_prompt (`bool`, *optional*, defaults to True or None, depending on the workflow): | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only this change is related to this PR |
||
| Whether to prepend the Cosmos3 transfer system prompt. | ||
| action (`CosmosActionCondition`, *optional*): | ||
| Action-conditioning metadata and its reference visual input. | ||
| fps (`float`, *optional*, defaults to 24.0): | ||
|
|
@@ -368,6 +370,9 @@ class Cosmos3VisionCoreDenoiseStep(SequentialPipelineBlocks): | |
| Components: | ||
| transformer (`Cosmos3OmniTransformer`) scheduler (`UniPCMultistepScheduler`) | ||
|
|
||
| Configs: | ||
| use_native_flow_schedule (default: False) | ||
|
|
||
| Inputs: | ||
| cond_input_ids (`None`): | ||
| Token IDs for the conditional prompt. | ||
|
|
@@ -436,6 +441,9 @@ class Cosmos3VisionSoundCoreDenoiseStep(SequentialPipelineBlocks): | |
| Components: | ||
| transformer (`Cosmos3OmniTransformer`) scheduler (`UniPCMultistepScheduler`) | ||
|
|
||
| Configs: | ||
| use_native_flow_schedule (default: False) | ||
|
|
||
| Inputs: | ||
| cond_input_ids (`None`): | ||
| Token IDs for the conditional prompt. | ||
|
|
@@ -517,6 +525,9 @@ class Cosmos3VisionActionCoreDenoiseStep(SequentialPipelineBlocks): | |
| Components: | ||
| transformer (`Cosmos3OmniTransformer`) scheduler (`UniPCMultistepScheduler`) | ||
|
|
||
| Configs: | ||
| use_native_flow_schedule (default: False) | ||
|
|
||
| Inputs: | ||
| cond_input_ids (`None`): | ||
| Token IDs for the conditional prompt. | ||
|
|
@@ -602,6 +613,9 @@ class Cosmos3VisionSoundActionCoreDenoiseStep(SequentialPipelineBlocks): | |
| Components: | ||
| transformer (`Cosmos3OmniTransformer`) scheduler (`UniPCMultistepScheduler`) | ||
|
|
||
| Configs: | ||
| use_native_flow_schedule (default: False) | ||
|
|
||
| Inputs: | ||
| cond_input_ids (`None`): | ||
| Token IDs for the conditional prompt. | ||
|
|
@@ -962,6 +976,9 @@ class Cosmos3AutoCoreDenoiseStep(ConditionalPipelineBlocks): | |
| transformer (`Cosmos3OmniTransformer`) vae (`AutoencoderKLWan`) video_processor (`VideoProcessor`) scheduler | ||
| (`UniPCMultistepScheduler`) | ||
|
|
||
| Configs: | ||
| use_native_flow_schedule (default: False) | ||
|
|
||
| Inputs: | ||
| cond_input_ids (`None`): | ||
| Token IDs for the conditional prompt. | ||
|
|
@@ -1149,6 +1166,10 @@ class Cosmos3OmniBlocks(SequentialPipelineBlocks): | |
| (`Cosmos3OmniTransformer`) scheduler (`UniPCMultistepScheduler`) sound_tokenizer | ||
| (`Cosmos3AVAEAudioTokenizer`) | ||
|
|
||
| Configs: | ||
| default_use_system_prompt (default: True) enable_safety_checker (default: True) use_native_flow_schedule | ||
| (default: False) | ||
|
|
||
| Inputs: | ||
| control_videos (`dict`, *optional*): | ||
| Mapping of hint name (edge/blur/depth/seg/wsm) to the control video for that modality. | ||
|
|
@@ -1166,9 +1187,8 @@ class Cosmos3OmniBlocks(SequentialPipelineBlocks): | |
| The text prompt that guides Cosmos3 generation. | ||
| negative_prompt (`str`, *optional*): | ||
| The negative text prompt used for classifier-free guidance. | ||
| use_system_prompt (`bool`, *optional*): | ||
| Whether to prepend the system prompt. Defaults to the pipeline configuration for standard and action | ||
| workflows and to True for transfer. | ||
| use_system_prompt (`bool`, *optional*, defaults to True or None, depending on the workflow): | ||
| Whether to prepend the Cosmos3 transfer system prompt. | ||
| action (`CosmosActionCondition`, *optional*): | ||
| Action-conditioning metadata and its reference visual input. | ||
| fps (`float`, *optional*, defaults to 24.0): | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -502,6 +502,13 @@ def get_block_state(self, state: PipelineState) -> dict: | |||||||||||||||||
| for input_param in state_inputs: | ||||||||||||||||||
| if input_param.name: | ||||||||||||||||||
| value = state.get(input_param.name) | ||||||||||||||||||
| if value is None: | ||||||||||||||||||
| # if the value is None (not passed, or passed as None), the first block that reads it sets the | ||||||||||||||||||
| # default at call time. For sequential blocks the default is already resolved at compile time | ||||||||||||||||||
| # (first declaring block wins, see _get_inputs), but for conditional blocks the selected branch | ||||||||||||||||||
| # is only known at runtime: disagreeing branch defaults merge to None (see combine_inputs) and | ||||||||||||||||||
| # the block that actually runs applies its own declared default here | ||||||||||||||||||
| value = input_param.default | ||||||||||||||||||
|
Comment on lines
+505
to
+511
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems easier?
Suggested change
|
||||||||||||||||||
| if input_param.required and value is None: | ||||||||||||||||||
| raise ValueError(f"Required input '{input_param.name}' is missing") | ||||||||||||||||||
| elif value is not None or (value is None and input_param.name not in data): | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would imagine them to appear like this?
I see that it's not the case above as well:
But no strong opinions. Can be dealt in a different PR.