shweaung commited on
Commit
9d14420
1 Parent(s): 4e5fe78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,6 +13,8 @@ API_TOKEN = os.getenv("HF_READ_TOKEN")
13
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
14
  timeout = 100
15
 
 
 
16
  def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=512, height=512):
17
  if not prompt:
18
  return None
@@ -80,8 +82,8 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
80
  method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
81
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
82
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
83
- width = gr.Slider(label="Width", value=512, minimum=256, maximum=1024, step=16)
84
- height = gr.Slider(label="Height", value=512, minimum=256, maximum=1024, step=16)
85
 
86
  with gr.Row():
87
  text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
 
13
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
14
  timeout = 100
15
 
16
+ MAX_IMAGE_SIZE = 1024 # Define the maximum image size
17
+
18
  def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=512, height=512):
19
  if not prompt:
20
  return None
 
82
  method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
83
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
84
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
85
+ width = gr.Slider(label="Width", value=512, minimum=256, maximum=MAX_IMAGE_SIZE, step=32)
86
+ height = gr.Slider(label="Height", value=512, minimum=256, maximum=MAX_IMAGE_SIZE, step=32)
87
 
88
  with gr.Row():
89
  text_button = gr.Button("Run", variant='primary', elem_id="gen-button")