XiangpengYang commited on
Commit
98ff26b
·
1 Parent(s): fa53f32

device gpu

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -199,6 +199,12 @@ class VideoCoF_Controller(Wan_Controller):
199
  # If pipeline is not on cuda, move it (if possible, but usually accelerate handles this or it's handled by parts)
200
  # However, Wan_Controller logic might rely on `self.device`.
201
  # We explicitly set `self.device` to cuda here.
 
 
 
 
 
 
202
 
203
  if self.diffusion_transformer_dropdown != diffusion_transformer_dropdown:
204
  self.update_diffusion_transformer(diffusion_transformer_dropdown)
 
199
  # If pipeline is not on cuda, move it (if possible, but usually accelerate handles this or it's handled by parts)
200
  # However, Wan_Controller logic might rely on `self.device`.
201
  # We explicitly set `self.device` to cuda here.
202
+ # Ensure pipeline modules are on the chosen device (avoid CPU ops)
203
+ try:
204
+ if hasattr(self, "pipeline") and self.pipeline is not None:
205
+ self.pipeline.to(self.device)
206
+ except Exception as move_e:
207
+ print(f"Warning: failed to move pipeline to {self.device}: {move_e}")
208
 
209
  if self.diffusion_transformer_dropdown != diffusion_transformer_dropdown:
210
  self.update_diffusion_transformer(diffusion_transformer_dropdown)