DigiP-AI commited on
Commit
6865c48
·
verified ·
1 Parent(s): ef3d6ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -44,6 +44,10 @@ def query(prompt, is_negative=False, steps=35, cfg_scale=7, sampler="DPM++ 2M Ka
44
  # Add some extra flair to the prompt
45
  prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
46
  print(f'\033[1mGeneration {key}:\033[0m {prompt}')
 
 
 
 
47
 
48
  # Prepare the payload for the API call, including width and height
49
  payload = {
@@ -189,7 +193,8 @@ with gr.Blocks(theme=theme, css=css) as app:
189
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
190
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1) # Setting the seed to -1 will make it random
191
  method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ 2S a Karras", "DPM2 a Karras", "DPM2 Karras", "DPM++ SDE Karras", "DEIS", "LMS", "DPM Adaptive", "DPM++ 2M", "DPM2 Ancestral", "DPM++ S", "DPM++ SDE", "DDPM", "DPM Fast", "dpmpp_2s_ancestral", "Euler", "Euler CFG PP", "Euler a", "Euler Ancestral", "Euler+beta", "Heun", "Heun PP2", "DDIM", "LMS Karras", "PLMS", "UniPC", "UniPC BH2"])
192
- with gr.Row():
 
193
  seed_output = gr.Textbox(label="Seed Used", elem_id="seed-output")
194
 
195
  # Add a button to trigger the image generation
 
44
  # Add some extra flair to the prompt
45
  prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
46
  print(f'\033[1mGeneration {key}:\033[0m {prompt}')
47
+
48
+ # If seed is -1, generate a random seed and use it
49
+ if seed == -1:
50
+ seed = random.randint(1, 1000000000)
51
 
52
  # Prepare the payload for the API call, including width and height
53
  payload = {
 
193
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
194
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1) # Setting the seed to -1 will make it random
195
  method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ 2S a Karras", "DPM2 a Karras", "DPM2 Karras", "DPM++ SDE Karras", "DEIS", "LMS", "DPM Adaptive", "DPM++ 2M", "DPM2 Ancestral", "DPM++ S", "DPM++ SDE", "DDPM", "DPM Fast", "dpmpp_2s_ancestral", "Euler", "Euler CFG PP", "Euler a", "Euler Ancestral", "Euler+beta", "Heun", "Heun PP2", "DDIM", "LMS Karras", "PLMS", "UniPC", "UniPC BH2"])
196
+ with gr.Row():
197
+ with gr.Accordion("🫘Seed", open=False):
198
  seed_output = gr.Textbox(label="Seed Used", elem_id="seed-output")
199
 
200
  # Add a button to trigger the image generation