Cosmos¶
Cosmos World Foundation Models are specialized to generate videos and world states that accurately adhere to the laws of physics. Using diffusion-based technology, these models create dynamic, high-quality videos from various inputs like text, images, or videos. RBLN NPUs can accelerate Cosmos pipelines using RBLN Optimum.
Supported NPU
Diffusers pipelines run on ATOM™ only. Rebel100™ does not support them yet.
Supported Pipelines¶
RBLN Optimum supports the following Cosmos pipelines:
| Pipeline | Class | Description |
|---|---|---|
| Cosmos-Predict1 Text2World | RBLNCosmosTextToWorldPipeline | Generate videos from text prompts. |
| Cosmos-Predict1 Video2World | RBLNCosmosVideoToWorldPipeline | Generate videos from an input video and a text prompt. |
| Cosmos-Predict2 Text2Image | RBLNCosmos2TextToImagePipeline | Generate images from text prompts. |
| Cosmos-Predict2 Video2World | RBLNCosmos2VideoToWorldPipeline | Generate videos from an input video and a text prompt. |
| Cosmos-Predict2.5 | RBLNCosmos2_5_PredictBasePipeline | Generate videos from text, image, or video inputs through one compiled pipeline. |
| Cosmos-Transfer2.5 | RBLNCosmos2_5_TransferPipeline | Generate videos that follow a spatial control input such as edge, on top of Cosmos-Predict2.5. |
Important: Cosmos Safety Guardrails¶
Every Cosmos pipeline loads a guardrail model as its safety_checker submodule to check the safety of the pipeline's inputs and outputs, and you configure it alongside the other submodules as the examples below show.
The guardrail comes from the cosmos-guardrail package, which RBLN Optimum does not install for you. Install it before you load a Cosmos pipeline.
Keep nltk at 3.9.4. With nltk 3.10 the guardrail fails to load from a freshly downloaded Hugging Face cache: recent huggingface_hub releases store the guardrail's data files in the hub-wide blobs/ directory, and nltk 3.10 refuses data files whose real location is outside its allowed paths (Resource 'wordnet' not found, or PermissionError from 3.10.3 on).
NVIDIA Open Model License
In accordance with the NVIDIA Open Model License, the safety_checker submodule runs the guardrail over the input prompt and the generated video automatically inside the pipeline. Do not remove or disable it. Under the license, bypassing the guardrail or reducing its efficacy terminates your rights automatically, unless you substitute a substantially similar guardrail appropriate for your use case.
Usage Examples¶
Text-to-Video¶
Video-to-Video¶
API Reference¶
RBLNCosmosTextToWorldPipeline ¶
Bases: RBLNDiffusionMixin, CosmosTextToWorldPipeline
RBLN-accelerated implementation of Cosmos Text to World pipeline for text-to-video generation.
This pipeline compiles Cosmos Text to World models to run efficiently on RBLN NPUs, enabling high-performance inference for generating videos that follow physical laws with enhanced visual quality.
from_pretrained(model_id, *, export=False, safety_checker=None, rbln_config=None, **kwargs) classmethod ¶
Load a pretrained diffusion pipeline from a model checkpoint, with optional compilation for RBLN NPUs.
It supports various diffusion pipelines including Stable Diffusion, Kandinsky, ControlNet, and other diffusers-based models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id | `str` | The model ID or path to the pretrained model to load. Can be either:
| required |
export | bool | If True, takes a PyTorch model from | False |
safety_checker | RBLNCosmosSafetyChecker | None | Optional custom safety checker to use instead of the default one. Only used when | None |
rbln_config | dict[str, Any] | None | Configuration options for RBLN compilation. Can include settings for specific submodules such as | None |
kwargs | Any | Additional arguments to pass to the underlying diffusion pipeline constructor or the RBLN compilation process. These may include parameters specific to individual submodules or the particular diffusion pipeline being used. | {} |
RBLNCosmosVideoToWorldPipeline ¶
Bases: RBLNDiffusionMixin, CosmosVideoToWorldPipeline
RBLN-accelerated implementation of Cosmos Video to World pipeline for video-to-video generation.
This pipeline compiles Cosmos Video to World models to run efficiently on RBLN NPUs, enabling high-performance inference for generating videos that follow physical laws with enhanced visual quality.
from_pretrained(model_id, *, export=False, safety_checker=None, rbln_config=None, **kwargs) classmethod ¶
Load a pretrained diffusion pipeline from a model checkpoint, with optional compilation for RBLN NPUs.
It supports various diffusion pipelines including Stable Diffusion, Kandinsky, ControlNet, and other diffusers-based models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id | `str` | The model ID or path to the pretrained model to load. Can be either:
| required |
export | bool | If True, takes a PyTorch model from | False |
safety_checker | RBLNCosmosSafetyChecker | None | Optional custom safety checker to use instead of the default one. Only used when | None |
rbln_config | dict[str, Any] | None | Configuration options for RBLN compilation. Can include settings for specific submodules such as | None |
kwargs | Any | Additional arguments to pass to the underlying diffusion pipeline constructor or the RBLN compilation process. These may include parameters specific to individual submodules or the particular diffusion pipeline being used. | {} |
RBLNCosmos2TextToImagePipeline ¶
Bases: RBLNDiffusionMixin, Cosmos2TextToImagePipeline
RBLN-accelerated implementation of Cosmos Predict2 Text to Image pipeline for text-to-image generation.
This pipeline compiles Cosmos Predict2 Text to Image models to run efficiently on RBLN NPUs, enabling high-performance inference for generating images that follow physical laws with enhanced visual quality.
RBLNCosmos2VideoToWorldPipeline ¶
Bases: RBLNDiffusionMixin, Cosmos2VideoToWorldPipeline
RBLN-accelerated implementation of Cosmos Predict2 Video to World pipeline for video-to-video generation.
This pipeline compiles Cosmos Predict2 Video to World models to run efficiently on RBLN NPUs, enabling high-performance inference for generating videos that follow physical laws with enhanced visual quality.
RBLNCosmos2_5_PredictBasePipeline ¶
Bases: RBLNDiffusionMixin, Cosmos2_5_PredictBasePipeline
RBLN-accelerated implementation of Cosmos-Predict2.5 pipeline.
This pipeline compiles Cosmos-Predict2.5 models to run efficiently on RBLN NPUs, enabling high-performance inference for generating videos that follow physical laws with enhanced visual quality.
One pipeline serves the three conditioning modes: Text2World (no visual input), Image2World (image=...) and Video2World (video=...).
RBLNCosmos2_5_TransferPipeline ¶
Bases: RBLNDiffusionMixin, Cosmos2_5_TransferPipeline
RBLN-accelerated implementation of the Cosmos-Transfer2.5 pipeline.
Transfer2.5 generates videos that follow a control signal (edge/depth/seg/blur maps): a 4-block ControlNet computes per-step residuals that are injected into the Predict2.5 base transformer. Long videos are generated auto-regressively in num_frames_per_chunk windows, so the compiled shapes are per chunk and the chunk loop runs on the host.
The official Hub layout keeps the ControlNet on its own revision, so a typical export is:
RBLNCosmosPipelineBaseConfig ¶
Bases: RBLNModelConfig
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | RBLNT5EncoderModelConfig | None | Configuration for the text encoder component. Initialized as RBLNT5EncoderModelConfig if not provided. | None |
transformer | RBLNCosmosTransformer3DModelConfig | None | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | RBLNAutoencoderKLCosmosConfig | None | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLCosmosConfig if not provided. | None |
safety_checker | RBLNCosmosSafetyCheckerConfig | None | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | int | None | Batch size for inference, applied to all submodules. | None |
height | int | None | Height of the generated videos. | None |
width | int | None | Width of the generated videos. | None |
num_frames | int | None | The number of frames in the generated video. | None |
max_seq_len | int | None | Maximum sequence length supported by the model. | None |
kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
RBLNCosmosTextToWorldPipelineConfig ¶
Bases: RBLNCosmosPipelineBaseConfig
Config for Cosmos-Predict1 Text2World Pipeline
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | RBLNT5EncoderModelConfig | None | Configuration for the text encoder component. Initialized as RBLNT5EncoderModelConfig if not provided. | None |
transformer | RBLNCosmosTransformer3DModelConfig | None | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | RBLNAutoencoderKLCosmosConfig | None | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLCosmosConfig if not provided. | None |
safety_checker | RBLNCosmosSafetyCheckerConfig | None | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | int | None | Batch size for inference, applied to all submodules. | None |
height | int | None | Height of the generated videos. | None |
width | int | None | Width of the generated videos. | None |
num_frames | int | None | The number of frames in the generated video. | None |
max_seq_len | int | None | Maximum sequence length supported by the model. | None |
kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
RBLNCosmosVideoToWorldPipelineConfig ¶
Bases: RBLNCosmosPipelineBaseConfig
Config for Cosmos-Predict1 Video2World Pipeline
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | RBLNT5EncoderModelConfig | None | Configuration for the text encoder component. Initialized as RBLNT5EncoderModelConfig if not provided. | None |
transformer | RBLNCosmosTransformer3DModelConfig | None | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | RBLNAutoencoderKLCosmosConfig | None | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLCosmosConfig if not provided. | None |
safety_checker | RBLNCosmosSafetyCheckerConfig | None | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | int | None | Batch size for inference, applied to all submodules. | None |
height | int | None | Height of the generated videos. | None |
width | int | None | Width of the generated videos. | None |
num_frames | int | None | The number of frames in the generated video. | None |
max_seq_len | int | None | Maximum sequence length supported by the model. | None |
kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
RBLNCosmos2PipelineBaseConfig ¶
Bases: RBLNModelConfig
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | Optional[RBLNT5EncoderModelConfig] | Configuration for the text encoder component. Initialized as RBLNT5EncoderModelConfig if not provided. | None |
transformer | Optional[RBLNCosmosTransformer3DModelConfig] | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | Optional[RBLNAutoencoderKLWanConfig] | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLWanConfig if not provided. | None |
safety_checker | Optional[RBLNCosmosSafetyCheckerConfig] | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | Optional[int] | Batch size for inference, applied to all submodules. | None |
height | Optional[int] | Height of the generated videos. | None |
width | Optional[int] | Width of the generated videos. | None |
num_frames | Optional[int] | The number of frames in the generated video. | None |
max_seq_len | Optional[int] | Maximum sequence length supported by the model. | None |
**kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
RBLNCosmos2TextToImagePipelineConfig ¶
Bases: RBLNCosmos2PipelineBaseConfig
Config for Cosmos-Predict2 Text2Image Pipeline
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | Optional[RBLNT5EncoderModelConfig] | Configuration for the text encoder component. Initialized as RBLNT5EncoderModelConfig if not provided. | None |
transformer | Optional[RBLNCosmosTransformer3DModelConfig] | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | Optional[RBLNAutoencoderKLWanConfig] | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLWanConfig if not provided. | None |
safety_checker | Optional[RBLNCosmosSafetyCheckerConfig] | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | Optional[int] | Batch size for inference, applied to all submodules. | None |
height | Optional[int] | Height of the generated videos. | None |
width | Optional[int] | Width of the generated videos. | None |
num_frames | Optional[int] | The number of frames in the generated video. | None |
max_seq_len | Optional[int] | Maximum sequence length supported by the model. | None |
**kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
RBLNCosmos2VideoToWorldPipelineConfig ¶
Bases: RBLNCosmos2PipelineBaseConfig
Config for Cosmos-Predict2 Video2World Pipeline
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | Optional[RBLNT5EncoderModelConfig] | Configuration for the text encoder component. Initialized as RBLNT5EncoderModelConfig if not provided. | None |
transformer | Optional[RBLNCosmosTransformer3DModelConfig] | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | Optional[RBLNAutoencoderKLWanConfig] | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLWanConfig if not provided. | None |
safety_checker | Optional[RBLNCosmosSafetyCheckerConfig] | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | Optional[int] | Batch size for inference, applied to all submodules. | None |
height | Optional[int] | Height of the generated videos. | None |
width | Optional[int] | Width of the generated videos. | None |
num_frames | Optional[int] | The number of frames in the generated video. | None |
max_seq_len | Optional[int] | Maximum sequence length supported by the model. | None |
**kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
RBLNCosmos2_5_PredictBasePipelineConfig ¶
Bases: RBLNModelConfig
Config for Cosmos-Predict2.5 Pipeline
__init__(text_encoder=None, transformer=None, vae=None, safety_checker=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_encoder | Optional[RBLNQwen2_5_VLForConditionalGenerationConfig] | Configuration for the text encoder component. Initialized as RBLNQwen2_5_VLForConditionalGenerationConfig if not provided. | None |
transformer | Optional[RBLNCosmosTransformer3DModelConfig] | Configuration for the Transformer model component. Initialized as RBLNCosmosTransformer3DModelConfig if not provided. | None |
vae | Optional[RBLNAutoencoderKLWanConfig] | Configuration for the VAE model component. Initialized as RBLNAutoencoderKLWanConfig if not provided. | None |
safety_checker | Optional[RBLNCosmosSafetyCheckerConfig] | Configuration for the safety checker component. Initialized as RBLNCosmosSafetyCheckerConfig if not provided. | None |
batch_size | Optional[int] | Batch size for inference, applied to all submodules. | None |
height | Optional[int] | Height of the generated videos. | None |
width | Optional[int] | Width of the generated videos. | None |
num_frames | Optional[int] | The number of frames in the generated video. | None |
max_seq_len | Optional[int] | Maximum sequence length supported by the model. | None |
**kwargs | Any | Additional arguments passed to the parent RBLNModelConfig. | {} |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples:
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
RBLNCosmos2_5_TransferPipelineConfig ¶
Bases: RBLNCosmos2_5_PredictBasePipelineConfig
Config for Cosmos-Transfer2.5 Pipeline (Predict2.5 base + ControlNet).
__init__(controlnet=None, *, batch_size=None, height=None, width=None, num_frames=None, max_seq_len=None, **kwargs) ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
controlnet | Optional[RBLNCosmosControlNetModelConfig] | Configuration for the ControlNet component. Initialized as RBLNCosmosControlNetModelConfig if not provided; its latent geometry is copied from the transformer submodule at compile time. | None |
batch_size | Optional[int] | Batch size for inference, applied to all submodules. | None |
height | Optional[int] | Height of the generated videos. | None |
width | Optional[int] | Width of the generated videos. | None |
num_frames | Optional[int] | The number of frames per generated chunk. | None |
max_seq_len | Optional[int] | Maximum sequence length supported by the model. | None |
**kwargs | Any | Additional arguments passed to the parent config (text_encoder/transformer/vae/safety_checker). | {} |
initialize_submodule_config(submodule_config=None, force_kwargs=False, **kwargs) ¶
Build the config of a submodule from the parent's runtime options and kwargs.
Returns the submodule config instance when its class is known (an instance was passed, or cls_name was given), otherwise the merged kwargs dict for the model class to resolve later.
get_load_overrides() ¶
Extract the options that must cross the load boundary, for passing to from_pretrained.
Returns the explicitly-set runtime options (device, device_map, create_runtimes, activate_profiler, timeout) and the subclass-specific non-save attributes (load-behavior flags such as _load_visual_runtime, which are never serialized so they can only travel with the caller), recursively including submodules. Compile-time attributes are not included: when loading a compiled model they come from the artifact's rbln_config.json, and this dict is merged on top of it.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary of load overrides, keyed like the |
from_pretrained(path, rbln_config=None, return_unused_kwargs=False, **kwargs) classmethod ¶
Load a RBLNModelConfig from a path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to the RBLNModelConfig file or directory containing the config file. | required |
rbln_config | dict[str, Any] | None | Additional configuration to override. | None |
return_unused_kwargs | bool | Whether to return unused kwargs. | False |
kwargs | Any | Additional keyword arguments to override configuration values. Keys starting with 'rbln_' will have the prefix removed and be used to update the configuration. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
RBLNModelConfig | Self | tuple[Self, dict[str, Any]] | The loaded configuration instance. |
Note
This method loads the configuration from the specified path and applies any provided overrides. If the loaded configuration class doesn't match the expected class, a warning will be logged.
Examples: