Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,24 +71,28 @@ def generate_video(prompt, image_url):
|
|
| 71 |
torch.cuda.empty_cache()
|
| 72 |
gc.collect()
|
| 73 |
|
| 74 |
-
# Step 3: Decode upscaled latents to frames
|
| 75 |
-
#
|
| 76 |
-
frames = pipe
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
torch.cuda.empty_cache()
|
| 87 |
gc.collect()
|
| 88 |
|
| 89 |
# Step 4: Export video
|
| 90 |
video_path = "output.mp4"
|
| 91 |
-
export_to_video(
|
| 92 |
|
| 93 |
# Step 5: TTS
|
| 94 |
tts = gTTS(text=prompt, lang='en')
|
|
|
|
| 71 |
torch.cuda.empty_cache()
|
| 72 |
gc.collect()
|
| 73 |
|
| 74 |
+
# Step 3: Decode upscaled latents to frames using the pipeline
|
| 75 |
+
# Create a new pipeline call specifically for decoding
|
| 76 |
+
frames = pipe(
|
| 77 |
+
prompt="", # Empty prompt for decode-only
|
| 78 |
+
latents=upscaled_latents,
|
| 79 |
+
width=base_width,
|
| 80 |
+
height=base_height,
|
| 81 |
+
num_frames=60,
|
| 82 |
+
num_inference_steps=1, # Minimal steps since we're just decoding
|
| 83 |
+
output_type="pil",
|
| 84 |
+
guidance_scale=1.0,
|
| 85 |
+
decode_timestep=0.0, # Use 0 for pure decoding
|
| 86 |
+
decode_noise_scale=0.0, # No noise for decoding
|
| 87 |
+
generator=generator
|
| 88 |
+
).frames[0]
|
| 89 |
|
| 90 |
torch.cuda.empty_cache()
|
| 91 |
gc.collect()
|
| 92 |
|
| 93 |
# Step 4: Export video
|
| 94 |
video_path = "output.mp4"
|
| 95 |
+
export_to_video(frames, video_path, fps=24)
|
| 96 |
|
| 97 |
# Step 5: TTS
|
| 98 |
tts = gTTS(text=prompt, lang='en')
|