ariG23498 HF staff commited on
Commit
9495b6c
·
1 Parent(s): a8626d0

remove randomized seed

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -24,7 +24,7 @@ def get_seed(randomize_seed: bool, seed: int) -> int:
24
  """
25
  Get the random seed.
26
  """
27
- return int(np.random.randint(0, MAX_SEED) if randomize_seed else seed)
28
 
29
  #####################################
30
  # The function for our Gradio app #
@@ -35,7 +35,6 @@ def generate(prompt, input_image, seed):
35
  Runs the Flux Control pipeline for editing the given `input_image`
36
  with the specified `prompt`. The pipeline is on GPU by default.
37
  """
38
- seed = int(seed) # Ensure seed is an integer
39
  generator = torch.Generator(device="cuda").manual_seed(seed) # Maintain reproducibility
40
 
41
  output_image = pipeline(
@@ -75,17 +74,12 @@ def launch_app():
75
  placeholder="e.g. 'Turn the color of the mushroom to blue'"
76
  )
77
  seed = gr.Slider(0, MAX_SEED, label="Seed", value=0, step=1)
78
- randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
79
  generate_button = gr.Button("Generate")
80
 
81
  output_image = gr.Image(label="Edited Image")
82
 
83
  # Connect button to function
84
  generate_button.click(
85
- get_seed,
86
- inputs=[randomize_seed, seed],
87
- outputs=[seed],
88
- ).then(
89
  fn=generate,
90
  inputs=[prompt, input_image, seed],
91
  outputs=[output_image],
 
24
  """
25
  Get the random seed.
26
  """
27
+ return
28
 
29
  #####################################
30
  # The function for our Gradio app #
 
35
  Runs the Flux Control pipeline for editing the given `input_image`
36
  with the specified `prompt`. The pipeline is on GPU by default.
37
  """
 
38
  generator = torch.Generator(device="cuda").manual_seed(seed) # Maintain reproducibility
39
 
40
  output_image = pipeline(
 
74
  placeholder="e.g. 'Turn the color of the mushroom to blue'"
75
  )
76
  seed = gr.Slider(0, MAX_SEED, label="Seed", value=0, step=1)
 
77
  generate_button = gr.Button("Generate")
78
 
79
  output_image = gr.Image(label="Edited Image")
80
 
81
  # Connect button to function
82
  generate_button.click(
 
 
 
 
83
  fn=generate,
84
  inputs=[prompt, input_image, seed],
85
  outputs=[output_image],