greendra commited on
Commit
8cf6f97
·
verified ·
1 Parent(s): f869ea1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -39,7 +39,7 @@ absolute_image_dir = os.path.abspath(IMAGE_DIR)
39
  print(f"Absolute path for allowed_paths: {absolute_image_dir}")
40
 
41
  # Function to query the API and return the generated image and download link
42
- def query(prompt, negative_prompt="", steps=30, cfg_scale=7, seed=-1, width=1024, height=1024):
43
  # Removed sampler and strength as they are not explicitly used in the payload below
44
  # Note: If the API endpoint *does* support sampler/strength, add them back to the payload
45
  if not prompt or not prompt.strip():
@@ -215,8 +215,8 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
215
  with gr.Row():
216
  width = gr.Slider(label="Width", value=1024, minimum=64, maximum=1216, step=32)
217
  height = gr.Slider(label="Height", value=1024, minimum=64, maximum=1216, step=32)
218
- steps = gr.Slider(label="Sampling steps", value=30, minimum=1, maximum=100, step=1) # Default updated based on query function default
219
- cfg = gr.Slider(label="CFG Scale (guidance_scale)", value=7, minimum=1, maximum=20, step=1) # Label updated
220
  # Removed strength and sampler sliders as they are not passed to query
221
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1, info="Set to -1 for random seed")
222
 
 
39
  print(f"Absolute path for allowed_paths: {absolute_image_dir}")
40
 
41
  # Function to query the API and return the generated image and download link
42
+ def query(prompt, negative_prompt="", steps=4, cfg_scale=0, seed=-1, width=1024, height=1024):
43
  # Removed sampler and strength as they are not explicitly used in the payload below
44
  # Note: If the API endpoint *does* support sampler/strength, add them back to the payload
45
  if not prompt or not prompt.strip():
 
215
  with gr.Row():
216
  width = gr.Slider(label="Width", value=1024, minimum=64, maximum=1216, step=32)
217
  height = gr.Slider(label="Height", value=1024, minimum=64, maximum=1216, step=32)
218
+ steps = gr.Slider(label="Sampling steps", value=4, minimum=1, maximum=30, step=1) # Default updated based on query function default
219
+ cfg = gr.Slider(label="CFG Scale (guidance_scale)", value=0, minimum=0, maximum=10, step=1) # Label updated
220
  # Removed strength and sampler sliders as they are not passed to query
221
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1, info="Set to -1 for random seed")
222