ihsanvp commited on
Commit
b8a7508
1 Parent(s): eda9a9f

fix: out of memory error

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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="Starting..")
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 + 1, total_steps), desc="Generating video...")
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=4,
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...")