Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
a9235bb
1
Parent(s):
ff0d0ea
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,8 @@ from scripts.util.detection.nsfw_and_watermark_dectection import \
|
|
18 |
from sgm.inference.helpers import embed_watermark
|
19 |
from sgm.util import default, instantiate_from_config
|
20 |
|
|
|
|
|
21 |
from huggingface_hub import hf_hub_download
|
22 |
|
23 |
hf_hub_download(repo_id="stabilityai/stable-video-diffusion-img2vid-xt", filename="svd_xt.safetensors", local_dir="checkpoints")
|
@@ -73,6 +75,7 @@ def sample(
|
|
73 |
decoding_t: int = 7, # Number of frames decoded at a time! This eats most VRAM. Reduce if necessary.
|
74 |
device: str = "cuda",
|
75 |
output_folder: str = "outputs",
|
|
|
76 |
):
|
77 |
"""
|
78 |
Simple script to generate a single sample conditioned on an image `input_path` or multiple images, one for each
|
@@ -256,8 +259,6 @@ def get_batch(keys, value_dict, N, T, device):
|
|
256 |
batch_uc[key] = torch.clone(batch[key])
|
257 |
return batch, batch_uc
|
258 |
|
259 |
-
import gradio as gr
|
260 |
-
import uuid
|
261 |
def resize_image(image_path, output_size=(1024, 576)):
|
262 |
image = Image.open(image_path)
|
263 |
# Calculate aspect ratios
|
|
|
18 |
from sgm.inference.helpers import embed_watermark
|
19 |
from sgm.util import default, instantiate_from_config
|
20 |
|
21 |
+
import gradio as gr
|
22 |
+
import uuid
|
23 |
from huggingface_hub import hf_hub_download
|
24 |
|
25 |
hf_hub_download(repo_id="stabilityai/stable-video-diffusion-img2vid-xt", filename="svd_xt.safetensors", local_dir="checkpoints")
|
|
|
75 |
decoding_t: int = 7, # Number of frames decoded at a time! This eats most VRAM. Reduce if necessary.
|
76 |
device: str = "cuda",
|
77 |
output_folder: str = "outputs",
|
78 |
+
progress=gr.Progress(track_tqdm=True)
|
79 |
):
|
80 |
"""
|
81 |
Simple script to generate a single sample conditioned on an image `input_path` or multiple images, one for each
|
|
|
259 |
batch_uc[key] = torch.clone(batch[key])
|
260 |
return batch, batch_uc
|
261 |
|
|
|
|
|
262 |
def resize_image(image_path, output_size=(1024, 576)):
|
263 |
image = Image.open(image_path)
|
264 |
# Calculate aspect ratios
|