multimodalart HF Staff commited on
Commit
39bb5f0
·
verified ·
1 Parent(s): 9c086fb

Properly return the seed to the same original component

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -405,7 +405,7 @@ def generate(
405
  gallery_images = []
406
  gallery_images.append(image)
407
 
408
- return gallery_images, str(new_seed)
409
 
410
 
411
  init_app()
@@ -451,7 +451,7 @@ with gr.Blocks(title="Z-Image Demo") as demo:
451
  resolution = gr.Dropdown(value=initial_res_choices[0], choices=initial_res_choices, label="Resolution")
452
 
453
  with gr.Row():
454
- seed = gr.Number(label="Seed", value=-1, precision=0)
455
  random_seed = gr.Checkbox(label="Random Seed", value=True)
456
 
457
  with gr.Row():
@@ -492,7 +492,7 @@ with gr.Blocks(title="Z-Image Demo") as demo:
492
  generate_btn.click(
493
  generate,
494
  inputs=[prompt_input, resolution, seed, steps, shift, enable_enhance, random_seed, output_gallery],
495
- outputs=[output_gallery, used_seed],
496
  )
497
 
498
  css='''
 
405
  gallery_images = []
406
  gallery_images.append(image)
407
 
408
+ return gallery_images, str(new_seed), str(new_seed)
409
 
410
 
411
  init_app()
 
451
  resolution = gr.Dropdown(value=initial_res_choices[0], choices=initial_res_choices, label="Resolution")
452
 
453
  with gr.Row():
454
+ seed = gr.Number(label="Seed", value=42, precision=0)
455
  random_seed = gr.Checkbox(label="Random Seed", value=True)
456
 
457
  with gr.Row():
 
492
  generate_btn.click(
493
  generate,
494
  inputs=[prompt_input, resolution, seed, steps, shift, enable_enhance, random_seed, output_gallery],
495
+ outputs=[output_gallery, used_seed, seed],
496
  )
497
 
498
  css='''