ihsanvp commited on
Commit
5ff8f5d
1 Parent(s): 310e3d0

fix: out of memory error

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -34,11 +34,13 @@ if gr.NO_RELOAD:
34
 
35
  base.to("cuda")
36
  # refiner.to("cuda")
37
- pipeline.to("cuda")
38
 
39
  base.unet = torch.compile(base.unet, mode="reduce-overhead", fullgraph=True)
40
  # refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
41
- pipeline.unet = torch.compile(pipeline.unet, mode="reduce-overhead", fullgraph=True)
 
 
42
 
43
  def generate(prompt: str, progress=gr.Progress()):
44
  progress((0, 100), desc="Generating first frame...")
 
34
 
35
  base.to("cuda")
36
  # refiner.to("cuda")
37
+ # pipeline.to("cuda")
38
 
39
  base.unet = torch.compile(base.unet, mode="reduce-overhead", fullgraph=True)
40
  # refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
41
+ # pipeline.unet = torch.compile(pipeline.unet, mode="reduce-overhead", fullgraph=True)
42
+ pipeline.enable_model_cpu_offload()
43
+ pipeline.unet.enable_forward_chunking()
44
 
45
  def generate(prompt: str, progress=gr.Progress()):
46
  progress((0, 100), desc="Generating first frame...")