Rooni commited on
Commit
6bee013
1 Parent(s): 711879b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -33,7 +33,7 @@ mmodels = {
33
  }
34
  timeout = 250
35
 
36
- def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, gpt=False):
37
  if prompt == "" or prompt == None:
38
  return None
39
 
@@ -169,6 +169,9 @@ with gr.Blocks(css=css) as dalle:
169
  with gr.Tab("Расширенные настройки"):
170
  with gr.Row():
171
  negative_prompt = gr.Textbox(label="Исключения", placeholder="Чего не должно быть на изображении", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry, text, fuzziness", lines=3, elem_id="negative-prompt-text-input")
 
 
 
172
  with gr.Row():
173
  steps = gr.Slider(label="Количество шагов обработки", value=25, minimum=1, maximum=70, step=1)
174
  with gr.Row():
@@ -195,6 +198,7 @@ with gr.Blocks(css=css) as dalle:
195
  with gr.Row():
196
  image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery", show_share_button=False)
197
 
198
- text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, gpt], outputs=image_output, concurrency_limit=24)
 
199
 
200
  dalle.launch(show_api=False, share=False)
 
33
  }
34
  timeout = 250
35
 
36
+ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, gpt=False, height=512, width=512):
37
  if prompt == "" or prompt == None:
38
  return None
39
 
 
169
  with gr.Tab("Расширенные настройки"):
170
  with gr.Row():
171
  negative_prompt = gr.Textbox(label="Исключения", placeholder="Чего не должно быть на изображении", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry, text, fuzziness", lines=3, elem_id="negative-prompt-text-input")
172
+ with gr.Row():
173
+ width = gr.Slider(label="Ширина", value=512, minimum=96, maximum=2000, step=16)
174
+ height = gr.Slider(label="Высота", value=512, minimum=96, maximum=2000, step=16)
175
  with gr.Row():
176
  steps = gr.Slider(label="Количество шагов обработки", value=25, minimum=1, maximum=70, step=1)
177
  with gr.Row():
 
198
  with gr.Row():
199
  image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery", show_share_button=False)
200
 
201
+ text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, gpt, height, width], outputs=image_output, concurrency_limit=250)
202
+ text_prompt.submit(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, gpt, height, width], outputs=image_output, concurrency_limit=250)
203
 
204
  dalle.launch(show_api=False, share=False)