@@ -284,8 +284,8 @@ def intermediate_outputs(self) -> list[OutputParam]:
284284 def __call__ (self , components : Cosmos3OmniModularPipeline , state : PipelineState ) -> PipelineState :
285285 block_state = self .get_block_state (state )
286286
287- block_state . device = components ._execution_device
288- block_state . dtype = components .transformer .dtype
287+ device = components ._execution_device
288+ dtype = components .transformer .dtype
289289
290290 if block_state .image is None :
291291 raise ValueError ("`Cosmos3ImageVaeEncoderStep` requires an `image` input." )
@@ -304,16 +304,16 @@ def __call__(self, components: Cosmos3OmniModularPipeline, state: PipelineState)
304304
305305 conditioning_frame_2d = components .video_processor .preprocess (
306306 block_state .image , height = block_state .height , width = block_state .width
307- ).to (device = block_state . device , dtype = block_state . dtype )
307+ ).to (device = device , dtype = dtype )
308308
309309 vision_tensor = torch .zeros (
310310 1 ,
311311 3 ,
312312 block_state .num_frames ,
313313 block_state .height ,
314314 block_state .width ,
315- dtype = block_state . dtype ,
316- device = block_state . device ,
315+ dtype = dtype ,
316+ device = device ,
317317 )
318318 vision_tensor [:, :, 0 ] = conditioning_frame_2d
319319 vision_tensor [:, :, 1 :] = conditioning_frame_2d .unsqueeze (2 ).expand (- 1 , - 1 , block_state .num_frames - 1 , - 1 , - 1 )
@@ -366,8 +366,8 @@ def intermediate_outputs(self) -> list[OutputParam]:
366366 def __call__ (self , components : Cosmos3OmniModularPipeline , state : PipelineState ) -> PipelineState :
367367 block_state = self .get_block_state (state )
368368
369- block_state . device = components ._execution_device
370- block_state . dtype = components .transformer .dtype
369+ device = components ._execution_device
370+ dtype = components .transformer .dtype
371371
372372 if block_state .video is None :
373373 raise ValueError ("`Cosmos3VideoVaeEncoderStep` requires a `video` input." )
@@ -410,7 +410,7 @@ def __call__(self, components: Cosmos3OmniModularPipeline, state: PipelineState)
410410 condition_indexes_vision = indexes
411411 conditioning_frames_3d = components .video_processor .preprocess_video (
412412 block_state .video , height = block_state .height , width = block_state .width
413- ).to (device = block_state . device , dtype = block_state . dtype )
413+ ).to (device = device , dtype = dtype )
414414 temporal_compression = int (components .vae .config .scale_factor_temporal )
415415 max_cond_frames = max (condition_indexes_vision ) * temporal_compression + 1
416416 if block_state .condition_video_keep == "first" :
@@ -424,8 +424,8 @@ def __call__(self, components: Cosmos3OmniModularPipeline, state: PipelineState)
424424 block_state .num_frames ,
425425 block_state .height ,
426426 block_state .width ,
427- dtype = block_state . dtype ,
428- device = block_state . device ,
427+ dtype = dtype ,
428+ device = device ,
429429 )
430430 t_fill = min (conditioning_frames_3d .shape [2 ], block_state .num_frames )
431431 vision_tensor [:, :, :t_fill ] = conditioning_frames_3d [:, :, :t_fill ]
@@ -482,8 +482,8 @@ def intermediate_outputs(self) -> list[OutputParam]:
482482 def __call__ (self , components : Cosmos3OmniModularPipeline , state : PipelineState ) -> PipelineState :
483483 block_state = self .get_block_state (state )
484484
485- block_state . device = components ._execution_device
486- block_state . dtype = components .vae .dtype
485+ device = components ._execution_device
486+ dtype = components .vae .dtype
487487
488488 action = block_state .action
489489 target_frames = action .chunk_size + 1
@@ -492,8 +492,8 @@ def __call__(self, components: Cosmos3OmniModularPipeline, state: PipelineState)
492492 conditioning_clip ,
493493 action .resolution_tier ,
494494 target_frames ,
495- device = block_state . device ,
496- dtype = block_state . dtype ,
495+ device = device ,
496+ dtype = dtype ,
497497 )
498498
499499 if action .mode == "forward_dynamics" :
0 commit comments