Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_action_fd_agibotworld.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"infer_steps": 30,
"sample_guide_scale": 1.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 640,
"target_video_length": 17,
"target_fps": 10.0,
"enable_cfg": true,
"action_mode": "forward_dynamics",
"domain_name": "agibotworld",
"view_point": "concat_view",
"action_chunk_size": 16,
"action_chunk_index": 0,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"use_system_prompt": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"infer_steps": 30,
"sample_guide_scale": 1.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 640,
"target_video_length": 17,
"target_fps": 10.0,
"enable_cfg": true,
"action_mode": "forward_dynamics",
"domain_name": "agibotworld",
"view_point": "concat_view",
"action_chunk_size": 16,
"action_chunk_index": 0,
"action_multichunk": true,
"action_num_chunks": 4,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"use_system_prompt": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
27 changes: 27 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_action_id_av.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"infer_steps": 30,
"sample_guide_scale": 1.0,
"sample_shift": 10.0,
"target_height": 480,
"target_width": 832,
"target_video_length": 61,
"target_fps": 10.0,
"enable_cfg": true,
"action_mode": "inverse_dynamics",
"domain_name": "av",
"view_point": "ego_view",
"action_chunk_size": 60,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"use_system_prompt": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
23 changes: 23 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_i2av.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"infer_steps": 35,
"sample_guide_scale": 6.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 1280,
"target_video_length": 189,
"target_fps": 24.0,
"enable_cfg": true,
"enable_sound": true,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
22 changes: 22 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_i2v.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"infer_steps": 35,
"sample_guide_scale": 6.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 1280,
"target_video_length": 189,
"target_fps": 24.0,
"enable_cfg": true,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
23 changes: 23 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_t2av.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"infer_steps": 35,
"sample_guide_scale": 6.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 1280,
"target_video_length": 189,
"target_fps": 24.0,
"enable_cfg": true,
"enable_sound": true,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
22 changes: 22 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_t2v.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"infer_steps": 35,
"sample_guide_scale": 6.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 1280,
"target_video_length": 189,
"target_fps": 24.0,
"enable_cfg": true,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn3",
"causal_self_attn_type": "flash_attn3",
"add_resolution_template": false,
"add_duration_template": false,
"cosmos3_meta_init": true,
"vae_cpu_offload": false,
"cpu_offload": false,
"offload_granularity": "block"
}
28 changes: 28 additions & 0 deletions configs/cosmos3/cosmos3_nano_omni_t2v_cfg_ulysses_8gpu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"infer_steps": 35,
"sample_guide_scale": 6.0,
"sample_shift": 10.0,
"target_height": 720,
"target_width": 1280,
"target_video_length": 189,
"target_fps": 24.0,
"enable_cfg": true,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn2",
"causal_self_attn_type": "flash_attn2",
"add_resolution_template": false,
"add_duration_template": false,
"cosmos3_meta_init": true,
"unload_modules": false,
"vae_cpu_offload": true,
"cpu_offload": true,
"offload_granularity": "block",
"parallel": {
"seq_p_size": 4,
"seq_p_attn_type": "ulysses",
"cfg_p_size": 2
}
}
38 changes: 38 additions & 0 deletions configs/cosmos3/cosmos3_nano_policy_droid_cfg_ulysses_8gpu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"infer_steps": 4,
"sample_guide_scale": 3.0,
"sample_shift": 5.0,
"target_height": 544,
"target_width": 736,
"target_video_length": 33,
"target_fps": 15.0,
"enable_cfg": true,
"action_mode": "policy",
"domain_name": "droid_lerobot",
"view_point": "concat_view",
"action_chunk_size": 32,
"raw_action_dim": 8,
"policy_use_state": true,
"policy_history_length": 1,
"policy_flip_gripper": true,
"decode_video": false,
"feature_caching": "NoCaching",
"rms_norm_type": "one-pass",
"attn_rms_norm_type": "one-pass",
"rope_type": "triton",
"self_attn_type": "flash_attn2",
"causal_self_attn_type": "flash_attn2",
"add_resolution_template": false,
"add_duration_template": false,
"use_system_prompt": false,
"cosmos3_meta_init": true,
"unload_modules": false,
"vae_cpu_offload": true,
"cpu_offload": true,
"offload_granularity": "block",
"parallel": {
"seq_p_size": 4,
"seq_p_attn_type": "ulysses",
"cfg_p_size": 2
}
}
4 changes: 2 additions & 2 deletions configs/fastwam/libero_i2va.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"adapter_model_path": "/data/nvme1/yongyang/nb/FastWAM/checkpoints/fastwam_release/libero_uncond_2cam224.pt",
"dataset_stats_path": "/data/nvme1/yongyang/nb/FastWAM/checkpoints/fastwam_release/libero_uncond_2cam224_dataset_stats.json",
"adapter_model_path": "/data/nvme7/yongyang/fastwam_release/libero_uncond_2cam224.pt",
"dataset_stats_path": "/data/nvme7/yongyang/fastwam_release/libero_uncond_2cam224_dataset_stats.json",
Comment on lines +2 to +3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding absolute paths pointing to a specific user's directory (e.g., /data/nvme7/yongyang/...) in shared configuration files. This makes the configuration non-portable and will cause failures on other machines or in production environments. Consider using relative paths or environment variables to resolve these paths dynamically.

"camera_size": 224,
"action_chunk_size": 32,
"actions_per_plan": 10,
Expand Down
1 change: 0 additions & 1 deletion configs/fastwam/robotwin_i2va.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"robot_state_dim": 14,
"policy_profile": "robotwin",
"normalize_mode": "z-score",
"target_video_length": 9,
"binarize_gripper": false,
"gripper_postprocess": false,
"default_prompt": "A video recorded from a robot's point of view executing the following instruction: {task_prompt}"
Expand Down
24 changes: 21 additions & 3 deletions lightx2v/models/networks/cosmos3/infer/pre_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,16 @@ def _prepare_sound_segment(self, sound_latents, text_segment, vision_segment, de
"sound_len": sound_len,
}

def _prepare_action_segment(self, action_latents, text_segment, vision_segment, sound_segment, device, condition_frame_indexes=None):
def _prepare_action_segment(
self,
action_latents,
text_segment,
vision_segment,
sound_segment,
device,
condition_frame_indexes=None,
start_frame_offset=1,
):
action_len = int(action_latents.shape[0])
condition_frame_indexes = [] if condition_frame_indexes is None else condition_frame_indexes
cond_set = {int(idx) for idx in condition_frame_indexes if 0 <= int(idx) < action_len}
Expand All @@ -162,7 +171,7 @@ def _prepare_action_segment(self, action_latents, text_segment, vision_segment,
base_fps=self.base_fps,
temporal_compression_factor=1,
base_temporal_compression_factor=self.config.get("vae_scale_factor_temporal", 4),
start_frame_offset=1,
start_frame_offset=int(start_frame_offset),
)
sequence_indexes = torch.arange(curr, curr + action_len, dtype=torch.long, device=device)
return {
Expand All @@ -186,6 +195,7 @@ def infer(
action_latents=None,
action_domain_id=None,
action_condition_frame_indexes=None,
action_start_frame_offset=1,
raw_action_dim=None,
):
device = latents.device
Expand All @@ -196,7 +206,15 @@ def infer(
if sound_latents is not None:
sound_segment = self._prepare_sound_segment(sound_latents, text_segment, vision_segment, device)
if action_latents is not None:
action_segment = self._prepare_action_segment(action_latents, text_segment, vision_segment, sound_segment, device, condition_frame_indexes=action_condition_frame_indexes)
action_segment = self._prepare_action_segment(
action_latents,
text_segment,
vision_segment,
sound_segment,
device,
condition_frame_indexes=action_condition_frame_indexes,
start_frame_offset=action_start_frame_offset,
)
sequence_length = text_segment["und_len"] + vision_segment["num_vision_tokens"] + sound_segment.get("sound_len", 0) + action_segment.get("action_len", 0)

packed_text_embedding = weights.embed_tokens.apply(text_segment["input_ids"])
Expand Down
1 change: 1 addition & 0 deletions lightx2v/models/networks/cosmos3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def _infer_cond_uncond(self, input_ids):
action_latents=getattr(self.scheduler, "action_latents", None),
action_domain_id=getattr(self.scheduler, "action_domain_id", None),
action_condition_frame_indexes=getattr(self.scheduler, "action_condition_frame_indexes", None),
action_start_frame_offset=getattr(self.scheduler, "action_start_frame_offset", 1),
raw_action_dim=getattr(self.scheduler, "raw_action_dim", None),
)
if self.config["seq_parallel"]:
Expand Down
Loading
Loading