heheyas commited on
Commit
20fbe27
1 Parent(s): 0d421c9
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -40,9 +40,11 @@ def do_sample(
40
  border_ratio,
41
  ignore_alpha,
42
  output_folder,
 
43
  ):
44
  # if image.mode == "RGBA":
45
  # image = image.convert("RGB")
 
46
  image = Image.fromarray(image)
47
  w, h = image.size
48
 
@@ -213,6 +215,7 @@ with gr.Blocks(title="V3D", theme=gr.themes.Monochrome()) as demo:
213
  maximum=0.5,
214
  step=0.05,
215
  )
 
216
  decoding_t_slider = gr.Slider(
217
  value=1,
218
  label="Number of Decoding frames",
@@ -224,14 +227,14 @@ with gr.Blocks(title="V3D", theme=gr.themes.Monochrome()) as demo:
224
  value=3.5,
225
  label="Min CFG Value",
226
  minimum=0.05,
227
- maximum=0.5,
228
  step=0.05,
229
  )
230
  max_guidance_slider = gr.Slider(
231
  value=3.5,
232
  label="Max CFG Value",
233
  minimum=0.05,
234
- maximum=0.5,
235
  step=0.05,
236
  )
237
  run_button = gr.Button(value="Run V3D")
@@ -246,10 +249,11 @@ with gr.Blocks(title="V3D", theme=gr.themes.Monochrome()) as demo:
246
  min_guidance_slider,
247
  max_guidance_slider,
248
  decoding_t_slider,
 
249
  ],
250
  outputs=[output_video],
251
  )
252
- def _(image, border_ratio, min_guidance, max_guidance, decoding_t):
253
  model.sampler.guider.max_scale = max_guidance
254
  model.sampler.guider.min_scale = min_guidance
255
  return do_sample(
@@ -260,6 +264,7 @@ with gr.Blocks(title="V3D", theme=gr.themes.Monochrome()) as demo:
260
  border_ratio,
261
  False,
262
  output_folder,
 
263
  )
264
 
265
 
 
40
  border_ratio,
41
  ignore_alpha,
42
  output_folder,
43
+ seed,
44
  ):
45
  # if image.mode == "RGBA":
46
  # image = image.convert("RGB")
47
+ torch.manual_seed(seed)
48
  image = Image.fromarray(image)
49
  w, h = image.size
50
 
 
215
  maximum=0.5,
216
  step=0.05,
217
  )
218
+ seed_input = gr.Number(value=42)
219
  decoding_t_slider = gr.Slider(
220
  value=1,
221
  label="Number of Decoding frames",
 
227
  value=3.5,
228
  label="Min CFG Value",
229
  minimum=0.05,
230
+ maximum=5,
231
  step=0.05,
232
  )
233
  max_guidance_slider = gr.Slider(
234
  value=3.5,
235
  label="Max CFG Value",
236
  minimum=0.05,
237
+ maximum=5,
238
  step=0.05,
239
  )
240
  run_button = gr.Button(value="Run V3D")
 
249
  min_guidance_slider,
250
  max_guidance_slider,
251
  decoding_t_slider,
252
+ seed_input,
253
  ],
254
  outputs=[output_video],
255
  )
256
+ def _(image, border_ratio, min_guidance, max_guidance, decoding_t, seed):
257
  model.sampler.guider.max_scale = max_guidance
258
  model.sampler.guider.min_scale = min_guidance
259
  return do_sample(
 
264
  border_ratio,
265
  False,
266
  output_folder,
267
+ seed,
268
  )
269
 
270