Commit
·
53a5202
1
Parent(s):
171a390
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,8 +29,7 @@ max_64_bit_int = 2**63 - 1
|
|
| 29 |
|
| 30 |
def sample(
|
| 31 |
image: Image,
|
| 32 |
-
seed:
|
| 33 |
-
randomize_seed: bool = True,
|
| 34 |
motion_bucket_id: int = 127,
|
| 35 |
fps_id: int = 6,
|
| 36 |
version: str = "svd_xt",
|
|
@@ -49,8 +48,6 @@ def sample(
|
|
| 49 |
if image.mode == "RGBA":
|
| 50 |
image = image.convert("RGB")
|
| 51 |
|
| 52 |
-
if(randomize_seed):
|
| 53 |
-
seed = random.randint(0, max_64_bit_int)
|
| 54 |
generator = torch.manual_seed(seed)
|
| 55 |
|
| 56 |
os.makedirs(output_folder, exist_ok=True)
|
|
@@ -109,13 +106,11 @@ with gr.Blocks() as demo:
|
|
| 109 |
generate_btn = gr.Button("Generate")
|
| 110 |
video = gr.Video()
|
| 111 |
with gr.Accordion("Advanced options", open=False):
|
| 112 |
-
seed = gr.Slider(label="Seed", value=42, randomize=
|
| 113 |
-
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
| 114 |
motion_bucket_id = gr.Slider(label="Motion bucket id", info="Controls how much motion to add/remove from the image", value=127, minimum=1, maximum=255)
|
| 115 |
fps_id = gr.Slider(label="Frames per second", info="The length of your video in seconds will be 25/fps", value=6, minimum=5, maximum=30)
|
| 116 |
|
| 117 |
-
|
| 118 |
-
generate_btn.click(fn=sample, inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id, secret_token], outputs=[video, seed], api_name="video")
|
| 119 |
|
| 120 |
if __name__ == "__main__":
|
| 121 |
demo.queue(max_size=20)
|
|
|
|
| 29 |
|
| 30 |
def sample(
|
| 31 |
image: Image,
|
| 32 |
+
seed: int,
|
|
|
|
| 33 |
motion_bucket_id: int = 127,
|
| 34 |
fps_id: int = 6,
|
| 35 |
version: str = "svd_xt",
|
|
|
|
| 48 |
if image.mode == "RGBA":
|
| 49 |
image = image.convert("RGB")
|
| 50 |
|
|
|
|
|
|
|
| 51 |
generator = torch.manual_seed(seed)
|
| 52 |
|
| 53 |
os.makedirs(output_folder, exist_ok=True)
|
|
|
|
| 106 |
generate_btn = gr.Button("Generate")
|
| 107 |
video = gr.Video()
|
| 108 |
with gr.Accordion("Advanced options", open=False):
|
| 109 |
+
seed = gr.Slider(label="Seed", value=42, randomize=False, minimum=0, maximum=max_64_bit_int, step=1)
|
|
|
|
| 110 |
motion_bucket_id = gr.Slider(label="Motion bucket id", info="Controls how much motion to add/remove from the image", value=127, minimum=1, maximum=255)
|
| 111 |
fps_id = gr.Slider(label="Frames per second", info="The length of your video in seconds will be 25/fps", value=6, minimum=5, maximum=30)
|
| 112 |
|
| 113 |
+
generate_btn.click(fn=sample, inputs=[image, seed, motion_bucket_id, fps_id, secret_token], outputs=video, api_name="video")
|
|
|
|
| 114 |
|
| 115 |
if __name__ == "__main__":
|
| 116 |
demo.queue(max_size=20)
|