Fabrice-TIERCELIN commited on
Commit
8ba7c3f
1 Parent(s): 2535133

For an unknown reason, the space becomes extremely slow -> rollback

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -69,7 +69,6 @@ max_64_bit_int = 2**63 - 1
69
  def generate_video(
70
  image: Image,
71
  seed: int,
72
- randomize_seed: bool = True,
73
  motion_bucket_id: int = 127,
74
  fps_id: int = 6,
75
  version: str = "svd_xt",
@@ -88,9 +87,6 @@ def generate_video(
88
 
89
  if image.mode == "RGBA":
90
  image = image.convert("RGB")
91
-
92
- if randomize_seed:
93
- seed = random.randint(0, 2147483647)
94
 
95
  generator = torch.manual_seed(seed)
96
 
@@ -154,7 +150,6 @@ img, video {
154
  max-height: 400px;
155
  object-fit: contain;
156
  }
157
-
158
  video {
159
  margin: 0 auto
160
  }
@@ -166,7 +161,6 @@ with gr.Blocks(css=css) as SVD_XT_1_1:
166
  image = gr.Image(label="Upload your image", type="pil")
167
  generate_btn = gr.Button("Generate")
168
  # base64_out = gr.Textbox(label="Base64 Video")
169
- randomize_seed = gr.Checkbox(label="\U0001F3B2 Randomize seed", value=True, info="If checked, result is always different")
170
  seed = gr.Slider(label="Seed", value=42, randomize=False, minimum=0, maximum=max_64_bit_int, step=1)
171
  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)
172
  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)
@@ -181,7 +175,7 @@ with gr.Blocks(css=css) as SVD_XT_1_1:
181
 
182
  generate_btn.click(
183
  fn=generate_video,
184
- inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id],
185
  outputs=video_out,
186
  api_name="run"
187
  )
 
69
  def generate_video(
70
  image: Image,
71
  seed: int,
 
72
  motion_bucket_id: int = 127,
73
  fps_id: int = 6,
74
  version: str = "svd_xt",
 
87
 
88
  if image.mode == "RGBA":
89
  image = image.convert("RGB")
 
 
 
90
 
91
  generator = torch.manual_seed(seed)
92
 
 
150
  max-height: 400px;
151
  object-fit: contain;
152
  }
 
153
  video {
154
  margin: 0 auto
155
  }
 
161
  image = gr.Image(label="Upload your image", type="pil")
162
  generate_btn = gr.Button("Generate")
163
  # base64_out = gr.Textbox(label="Base64 Video")
 
164
  seed = gr.Slider(label="Seed", value=42, randomize=False, minimum=0, maximum=max_64_bit_int, step=1)
165
  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)
166
  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)
 
175
 
176
  generate_btn.click(
177
  fn=generate_video,
178
+ inputs=[image, seed, motion_bucket_id, fps_id],
179
  outputs=video_out,
180
  api_name="run"
181
  )