Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import torch
|
|
5 |
# from diffusers import LTXLatentUpsamplePipeline
|
6 |
from diffusers import LTXConditionPipeline, LTXLatentUpsamplePipeline
|
7 |
from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXVideoCondition
|
8 |
-
from diffusers.utils import export_to_video, load_video
|
9 |
import numpy as np
|
10 |
|
11 |
|
@@ -53,10 +53,11 @@ def generate(prompt,
|
|
53 |
downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
|
54 |
|
55 |
print(mode)
|
56 |
-
if mode == "
|
57 |
video = load_video(video)[:frames_to_use]
|
58 |
condition = True
|
59 |
-
elif mode == "image-to-video" and (image is not None):
|
|
|
60 |
#video = [image]
|
61 |
video = [load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png")]
|
62 |
condition = True
|
|
|
5 |
# from diffusers import LTXLatentUpsamplePipeline
|
6 |
from diffusers import LTXConditionPipeline, LTXLatentUpsamplePipeline
|
7 |
from diffusers.pipelines.ltx.pipeline_ltx_condition import LTXVideoCondition
|
8 |
+
from diffusers.utils import export_to_video, load_video, load_image
|
9 |
import numpy as np
|
10 |
|
11 |
|
|
|
53 |
downscaled_height, downscaled_width = round_to_nearest_resolution_acceptable_by_vae(downscaled_height, downscaled_width)
|
54 |
|
55 |
print(mode)
|
56 |
+
if mode == "video-to-video" and (video is not None):
|
57 |
video = load_video(video)[:frames_to_use]
|
58 |
condition = True
|
59 |
+
# elif mode == "image-to-video" and (image is not None):
|
60 |
+
elif mode == "image-to-video":
|
61 |
#video = [image]
|
62 |
video = [load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png")]
|
63 |
condition = True
|