Rooni commited on
Commit
dc39d18
1 Parent(s): 15382fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -38
app.py CHANGED
@@ -145,50 +145,53 @@ footer {visibility: hidden !important;}
145
  """
146
 
147
  with gr.Blocks(css=css) as dalle:
148
- with gr.Tab("Базовые настройки"):
149
- with gr.Row():
150
- with gr.Column(elem_id="prompt-container"):
151
- with gr.Row():
152
- text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
153
  with gr.Row():
154
- model = gr.Radio(label="Модель", value="OpenDALL-E 1.1", choices=list(mmodels.keys()))
 
 
 
 
155
 
156
 
157
 
158
- with gr.Tab("Расширенные настройки"):
159
- with gr.Row():
160
- negative_prompt = gr.Textbox(label="Negative Prompt", 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")
161
- with gr.Row():
162
- steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
163
- with gr.Row():
164
- cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
165
- with gr.Row():
166
- method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
167
- with gr.Row():
168
- strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
169
- with gr.Row():
170
- seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
171
- with gr.Row():
172
- gpt = gr.Checkbox(label="ChatGPT")
173
-
174
- with gr.Tab("Beta"):
175
- with gr.Row():
176
- width = gr.Slider(label="Ширина", minimum=15, maximum=2000, value=1024, step=1)
177
- height = gr.Slider(label="Высота", minimum=15, maximum=2000, value=1024, step=1)
178
-
179
- with gr.Tab("Информация"):
180
- with gr.Row():
181
- gr.Textbox(label="Шаблон prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
182
- with gr.Row():
183
- with gr.Column():
184
- gr.HTML("""<button class="lg secondary svelte-cmf5ev" onclick="window.open('http://ai-hub.rf.gd', '_blank');">AI-HUB</button>""")
185
- gr.HTML("""<button class="lg secondary svelte-cmf5ev" onclick="window.open('http://yufi.rf.gd', '_blank');">YUFI</button>""")
186
 
187
 
188
- with gr.Row():
189
- text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")
190
- with gr.Row():
191
- image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
 
192
 
193
  text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt, width, height], outputs=image_output, concurrency_limit=24)
194
 
 
145
  """
146
 
147
  with gr.Blocks(css=css) as dalle:
148
+ with gr.Row():
149
+ with gr.Column():
150
+ with gr.Tab("Базовые настройки"):
 
 
151
  with gr.Row():
152
+ with gr.Column(elem_id="prompt-container"):
153
+ with gr.Row():
154
+ text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
155
+ with gr.Row():
156
+ model = gr.Radio(label="Модель", value="OpenDALL-E 1.1", choices=list(mmodels.keys()))
157
 
158
 
159
 
160
+ with gr.Tab("Расширенные настройки"):
161
+ with gr.Row():
162
+ negative_prompt = gr.Textbox(label="Negative Prompt", 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")
163
+ with gr.Row():
164
+ steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
165
+ with gr.Row():
166
+ cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
167
+ with gr.Row():
168
+ method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
169
+ with gr.Row():
170
+ strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
171
+ with gr.Row():
172
+ seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
173
+ with gr.Row():
174
+ gpt = gr.Checkbox(label="ChatGPT")
175
+
176
+ with gr.Tab("Beta"):
177
+ with gr.Row():
178
+ width = gr.Slider(label="Ширина", minimum=15, maximum=2000, value=1024, step=1)
179
+ height = gr.Slider(label="Высота", minimum=15, maximum=2000, value=1024, step=1)
180
+
181
+ with gr.Tab("Информация"):
182
+ with gr.Row():
183
+ gr.Textbox(label="Шаблон prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
184
+ with gr.Row():
185
+ with gr.Column():
186
+ gr.HTML("""<button class="lg secondary svelte-cmf5ev" onclick="window.open('http://ai-hub.rf.gd', '_blank');">AI-HUB</button>""")
187
+ gr.HTML("""<button class="lg secondary svelte-cmf5ev" onclick="window.open('http://yufi.rf.gd', '_blank');">YUFI</button>""")
188
 
189
 
190
+ with gr.Row():
191
+ text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")
192
+ with gr.Column():
193
+ with gr.Row():
194
+ image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
195
 
196
  text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt, width, height], outputs=image_output, concurrency_limit=24)
197