fix: out of memory error
Browse files
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...")
|