oahzxl commited on
Commit
6ca2579
1 Parent(s): 7b637b3

fix memory

Browse files
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
 
3
  os.environ["GRADIO_TEMP_DIR"] = os.path.join(os.getcwd(), ".tmp_outputs")
 
4
 
5
  import logging
6
  import uuid
 
1
  import os
2
 
3
  os.environ["GRADIO_TEMP_DIR"] = os.path.join(os.getcwd(), ".tmp_outputs")
4
+ os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
5
 
6
  import logging
7
  import uuid
videosys/pipelines/cogvideox/pipeline_cogvideox.py CHANGED
@@ -100,8 +100,7 @@ class CogVideoXPipeline(VideoSysPipeline):
100
  if vae is None:
101
  vae = AutoencoderKLCogVideoX.from_pretrained(config.model_path, subfolder="vae", torch_dtype=self._dtype)
102
  if config.vae_tiling:
103
- vae.enable_tiling()
104
- vae.enable_slicing()
105
  if tokenizer is None:
106
  tokenizer = T5Tokenizer.from_pretrained(config.model_path, subfolder="tokenizer")
107
  if text_encoder is None:
 
100
  if vae is None:
101
  vae = AutoencoderKLCogVideoX.from_pretrained(config.model_path, subfolder="vae", torch_dtype=self._dtype)
102
  if config.vae_tiling:
103
+ vae.enable_tiling(tile_sample_min_height=vae.tile_sample_min_height // 2)
 
104
  if tokenizer is None:
105
  tokenizer = T5Tokenizer.from_pretrained(config.model_path, subfolder="tokenizer")
106
  if text_encoder is None: