1inkusFace commited on
Commit
ee8dc32
·
verified ·
1 Parent(s): c657f20

Update skyreelsinfer/pipelines/pipeline_skyreels_video.py

Browse files
skyreelsinfer/pipelines/pipeline_skyreels_video.py CHANGED
@@ -14,7 +14,7 @@ from diffusers.pipelines.hunyuan_video.pipeline_hunyuan_video import MultiPipeli
14
  from diffusers.pipelines.hunyuan_video.pipeline_hunyuan_video import PipelineCallback
15
  from diffusers.pipelines.hunyuan_video.pipeline_hunyuan_video import retrieve_timesteps
16
  from PIL import Image
17
- import gc
18
 
19
  def resizecrop(image, th, tw):
20
  w, h = image.size
@@ -311,6 +311,11 @@ class SkyreelsVideoPipeline(HunyuanVideoPipeline):
311
  generator,
312
  latents,
313
  )
 
 
 
 
 
314
  # add image latents
315
  if image is not None:
316
  image_latents = self.image_latents(
@@ -339,9 +344,6 @@ class SkyreelsVideoPipeline(HunyuanVideoPipeline):
339
 
340
  if hasattr(self, "text_encoder_to_cpu"):
341
  self.text_encoder_to_cpu()
342
- #self.text_encoder.to("cpu")
343
- del self.text_encoder
344
- gc.collect()
345
  self.vae.to("cpu")
346
  torch.cuda.empty_cache()
347
  torch.cuda.reset_peak_memory_stats()
 
14
  from diffusers.pipelines.hunyuan_video.pipeline_hunyuan_video import PipelineCallback
15
  from diffusers.pipelines.hunyuan_video.pipeline_hunyuan_video import retrieve_timesteps
16
  from PIL import Image
17
+ #import gc
18
 
19
  def resizecrop(image, th, tw):
20
  w, h = image.size
 
311
  generator,
312
  latents,
313
  )
314
+
315
+ self.text_encoder.to("cpu")
316
+ torch.cuda.empty_cache()
317
+ torch.cuda.reset_peak_memory_stats()
318
+
319
  # add image latents
320
  if image is not None:
321
  image_latents = self.image_latents(
 
344
 
345
  if hasattr(self, "text_encoder_to_cpu"):
346
  self.text_encoder_to_cpu()
 
 
 
347
  self.vae.to("cpu")
348
  torch.cuda.empty_cache()
349
  torch.cuda.reset_peak_memory_stats()