fix: out of memory error
Browse files
app.py
CHANGED
@@ -54,6 +54,7 @@ def generate(prompt: str, progress=gr.Progress()):
|
|
54 |
progress=progress,
|
55 |
),
|
56 |
).images[0]
|
|
|
57 |
image = refiner(
|
58 |
prompt=prompt,
|
59 |
num_inference_steps=n_sdxl_steps,
|
@@ -75,7 +76,7 @@ def generate(prompt: str, progress=gr.Progress()):
|
|
75 |
negative_prompt=negative_prompt,
|
76 |
guidance_scale=9.0,
|
77 |
generator=generator,
|
78 |
-
decode_chunk_size=
|
79 |
num_frames=64,
|
80 |
).frames[0]
|
81 |
progress((total_steps - 1, total_steps), desc="Finalizing...")
|
|
|
54 |
progress=progress,
|
55 |
),
|
56 |
).images[0]
|
57 |
+
progress((n_sdxl_steps * high_noise_frac, total_steps), desc="Refining first frame...")
|
58 |
image = refiner(
|
59 |
prompt=prompt,
|
60 |
num_inference_steps=n_sdxl_steps,
|
|
|
76 |
negative_prompt=negative_prompt,
|
77 |
guidance_scale=9.0,
|
78 |
generator=generator,
|
79 |
+
decode_chunk_size=4,
|
80 |
num_frames=64,
|
81 |
).frames[0]
|
82 |
progress((total_steps - 1, total_steps), desc="Finalizing...")
|
utils.py
CHANGED
@@ -2,6 +2,7 @@ from gradio import Progress
|
|
2 |
|
3 |
def create_progress_updater(start: int, total: int, desc: str, progress: Progress):
|
4 |
def updater(pipe, step, timestep, callback_kwargs):
|
5 |
-
progress
|
|
|
6 |
return callback_kwargs
|
7 |
return updater
|
|
|
2 |
|
3 |
def create_progress_updater(start: int, total: int, desc: str, progress: Progress):
|
4 |
def updater(pipe, step, timestep, callback_kwargs):
|
5 |
+
if progress:
|
6 |
+
progress((step + start + 1, total), desc=desc)
|
7 |
return callback_kwargs
|
8 |
return updater
|