Spaces:
Runtime error
Runtime error
Commit Β·
a9235bb
1
Parent(s): ff0d0ea
Update app.py
Browse files17 unmodified lines18192021222349 unmodified lines737475767778177 unmodified lines25625725825926026126226317 unmodified linesfrom sgm.inference.helpers import embed_watermarkfrom sgm.util import default, instantiate_from_configfrom huggingface_hub import hf_hub_downloadhf_hub_download(repo_id="stabilityai/stable-video-diffusion-img2vid-xt", filename="svd_xt.safetensors", local_dir="checkpoints")49 unmodified linesdecoding_t: int = 7, # Number of frames decoded at a time! This eats most VRAM. Reduce if necessary.device: str = "cuda",output_folder: str = "outputs",):"""Simple script to generate a single sample conditioned on an image `input_path` or multiple images, one for each177 unmodified linesbatch_uc[key] = torch.clone(batch[key])return batch, batch_ucimport gradio as grimport uuiddef resize_image(image_path, output_size=(1024, 576)):image = Image.open(image_path)# Calculate aspect ratios17 unmodified lines181920212223242549 unmodified lines75767778798081177 unmodified lines25926026126226326417 unmodified linesfrom sgm.inference.helpers import embed_watermarkfrom sgm.util import default, instantiate_from_configimport gradio as grimport uuidfrom huggingface_hub import hf_hub_downloadhf_hub_download(repo_id="stabilityai/stable-video-diffusion-img2vid-xt", filename="svd_xt.safetensors", local_dir="checkpoints")49 unmodified linesdecoding_t: int = 7, # Number of frames decoded at a time! This eats most VRAM. Reduce if necessary.device: str = "cuda",output_folder: str = "outputs",progress=gr.Progress(track_tqdm=True)):"""Simple script to generate a single sample conditioned on an image `input_path` or multiple images, one for each177 unmodified linesbatch_uc[key] = torch.clone(batch[key])return batch, batch_ucdef resize_image(image_path, output_size=(1024, 576)):image = Image.open(image_path)# Calculate aspect ratios
app.py+3-2