Fabrice-TIERCELIN commited on
Commit
2c08a0e
·
verified ·
1 Parent(s): 5092a86

Improve seed

Browse files
Files changed (1) hide show
  1. app_v2v.py +4 -4
app_v2v.py CHANGED
@@ -367,9 +367,6 @@ def worker(input_video, prompt, n_prompt, seed, batch, resolution, total_second_
367
  total_latent_sections = int(max(round(total_latent_sections), 1))
368
 
369
  for idx in range(batch):
370
- if idx>0:
371
- seed = seed + 1
372
-
373
  if batch > 1:
374
  print(f"Beginning video {idx+1} of {batch} with seed {seed} ")
375
 
@@ -550,6 +547,9 @@ def worker(input_video, prompt, n_prompt, seed, batch, resolution, total_second_
550
  print(f'Decoded. Current latent shape {real_history_latents.shape}; pixel shape {history_pixels.shape}')
551
 
552
  stream.output_queue.push(('file', output_filename))
 
 
 
553
  except:
554
  traceback.print_exc()
555
 
@@ -664,7 +664,7 @@ with block:
664
  no_resize = gr.Checkbox(label='Force Original Video Resolution (No Resizing)', value=False, info='Might run out of VRAM (720p requires > 24GB VRAM).')
665
 
666
  randomize_seed = gr.Checkbox(label='Randomize seed', value=True, info='If checked, the seed is always different')
667
- seed = gr.Number(label="Seed", value=31337, precision=0)
668
 
669
  batch = gr.Slider(label="Batch Size (Number of Videos)", minimum=1, maximum=1000, value=1, step=1, info='Generate multiple videos each with a different seed.')
670
 
 
367
  total_latent_sections = int(max(round(total_latent_sections), 1))
368
 
369
  for idx in range(batch):
 
 
 
370
  if batch > 1:
371
  print(f"Beginning video {idx+1} of {batch} with seed {seed} ")
372
 
 
547
  print(f'Decoded. Current latent shape {real_history_latents.shape}; pixel shape {history_pixels.shape}')
548
 
549
  stream.output_queue.push(('file', output_filename))
550
+
551
+ seed = (seed + 1) % np.iinfo(np.int32).max
552
+
553
  except:
554
  traceback.print_exc()
555
 
 
664
  no_resize = gr.Checkbox(label='Force Original Video Resolution (No Resizing)', value=False, info='Might run out of VRAM (720p requires > 24GB VRAM).')
665
 
666
  randomize_seed = gr.Checkbox(label='Randomize seed', value=True, info='If checked, the seed is always different')
667
+ seed = gr.Slider(label="Seed", minimum=0, maximum=np.iinfo(np.int32).max, step=1, randomize=True)
668
 
669
  batch = gr.Slider(label="Batch Size (Number of Videos)", minimum=1, maximum=1000, value=1, step=1, info='Generate multiple videos each with a different seed.')
670