fix: out of memory error
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ if gr.NO_RELOAD:
|
|
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="
|
45 |
image = base(
|
46 |
prompt=prompt,
|
47 |
num_inference_steps=n_sdxl_steps,
|
@@ -68,7 +68,7 @@ def generate(prompt: str, progress=gr.Progress()):
|
|
68 |
),
|
69 |
).images[0]
|
70 |
image = to_tensor(image)
|
71 |
-
progress((n_sdxl_steps
|
72 |
frames: list[Image.Image] = pipeline(
|
73 |
prompt=prompt,
|
74 |
image=image,
|
@@ -76,7 +76,7 @@ def generate(prompt: str, progress=gr.Progress()):
|
|
76 |
negative_prompt=negative_prompt,
|
77 |
guidance_scale=9.0,
|
78 |
generator=generator,
|
79 |
-
decode_chunk_size=
|
80 |
num_frames=64,
|
81 |
).frames[0]
|
82 |
progress((total_steps - 1, total_steps), desc="Finalizing...")
|
|
|
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...")
|
45 |
image = base(
|
46 |
prompt=prompt,
|
47 |
num_inference_steps=n_sdxl_steps,
|
|
|
68 |
),
|
69 |
).images[0]
|
70 |
image = to_tensor(image)
|
71 |
+
progress((n_sdxl_steps, total_steps), desc="Generating video...")
|
72 |
frames: list[Image.Image] = pipeline(
|
73 |
prompt=prompt,
|
74 |
image=image,
|
|
|
76 |
negative_prompt=negative_prompt,
|
77 |
guidance_scale=9.0,
|
78 |
generator=generator,
|
79 |
+
decode_chunk_size=2,
|
80 |
num_frames=64,
|
81 |
).frames[0]
|
82 |
progress((total_steps - 1, total_steps), desc="Finalizing...")
|