DigiP-AI commited on
Commit
1ec1b47
·
verified ·
1 Parent(s): c846d59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -199,11 +199,11 @@ footer{display:none !important}
199
 
200
  with gr.Blocks(css=css, theme=theme, fill_width= False) as app:
201
 
202
- with gr.Tab("Базовые настройки"):
203
  with gr.Row():
204
- prompt = gr.Textbox(placeholder="Введите описание изображения...", show_label=True, label='Описание изображения:', lines=3)
205
  with gr.Row():
206
- task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="Модель нейросети:", choices=['Stable Diffusion XL 1.0', 'Crystal Clear XL',
207
  'Juggernaut XL', 'DreamShaper XL',
208
  'SDXL Niji', 'Cinemax SDXL', 'NightVision XL'])
209
  with gr.Row():
@@ -212,12 +212,12 @@ with gr.Blocks(css=css, theme=theme, fill_width= False) as app:
212
  inputs = [prompt],
213
  )
214
 
215
- with gr.Tab("Расширенные настройки"):
216
  with gr.Row():
217
  negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=True, label='Negative Prompt:', lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
218
  with gr.Row():
219
- sampler = gr.Dropdown(value="DPM++ SDE Karras", show_label=True, label="Sampling Method:", choices=[
220
- "Euler", "Euler a", "Heun", "DPM++ 2M", "DPM++ SDE", "DPM++ 2M Karras", "DPM++ SDE Karras", "DDIM"])
221
  with gr.Row():
222
  steps = gr.Slider(show_label=True, label="Sampling Steps:", minimum=1, maximum=50, value=35, step=1)
223
  with gr.Row():
@@ -225,26 +225,26 @@ with gr.Blocks(css=css, theme=theme, fill_width= False) as app:
225
  with gr.Row():
226
  seed = gr.Number(show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1)
227
 
228
- with gr.Tab("Настройки апскейлинга"):
229
  with gr.Column():
230
  with gr.Row():
231
- scale_by = gr.Number(show_label=True, label="Во сколько раз увеличить:", minimum=1, maximum=2, value=2, step=1)
232
  with gr.Row():
233
- method = gr.Dropdown(show_label=True, value="ESRGAN_4x", label="Алгоритм увеличения", choices=["ScuNET GAN", "SwinIR 4x", "ESRGAN_4x", "R-ESRGAN 4x+", "R-ESRGAN 4x+ Anime6B"])
234
  with gr.Column():
235
  with gr.Row():
236
- gfpgan = gr.Slider(show_label=True, label="Эффект GFPGAN (для улучшения лица)", minimum=0, maximum=1, value=0, step=0.1)
237
  with gr.Row():
238
- codeformer = gr.Slider(show_label=True, label="Эффект CodeFormer (для улучшения лица)", minimum=0, maximum=1, value=0, step=0.1)
239
 
240
  with gr.Column():
241
- text_button = gr.Button("Сгенерировать изображение", variant='primary', elem_id="generate")
242
  with gr.Column():
243
  image_output = gr.Image(show_download_button=True, interactive=False, label='Результат:', elem_id='image_output', type='filepath')
244
  text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed], outputs=image_output, concurrency_limit=48)
245
 
246
- img2img_b = gr.Button("Увеличить изображение", variant='secondary')
247
- image_i2i = gr.Image(show_label=True, label='Увеличенное изображение:')
248
  img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
249
 
250
 
 
199
 
200
  with gr.Blocks(css=css, theme=theme, fill_width= False) as app:
201
 
202
+ with gr.Tab("Basic Settings"):
203
  with gr.Row():
204
+ prompt = gr.Textbox(placeholder="Enter the image description...", show_label=True, label='Description of the image:', lines=3)
205
  with gr.Row():
206
+ task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="Model of neural network:", choices=['Stable Diffusion XL 1.0', 'Crystal Clear XL',
207
  'Juggernaut XL', 'DreamShaper XL',
208
  'SDXL Niji', 'Cinemax SDXL', 'NightVision XL'])
209
  with gr.Row():
 
212
  inputs = [prompt],
213
  )
214
 
215
+ with gr.Tab("Extended settings"):
216
  with gr.Row():
217
  negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=True, label='Negative Prompt:', lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
218
  with gr.Row():
219
+ sampler = gr.Dropdown(value="DPM++ S", show_label=True, label="Sampling Method:", choices=[
220
+ "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"])
221
  with gr.Row():
222
  steps = gr.Slider(show_label=True, label="Sampling Steps:", minimum=1, maximum=50, value=35, step=1)
223
  with gr.Row():
 
225
  with gr.Row():
226
  seed = gr.Number(show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1)
227
 
228
+ with gr.Tab("Upscaling Settings"):
229
  with gr.Column():
230
  with gr.Row():
231
+ scale_by = gr.Number(show_label=True, label="How many times to increase:", minimum=1, maximum=2, value=2, step=1)
232
  with gr.Row():
233
+ method = gr.Dropdown(show_label=True, value="ESRGAN_4x", label="Algorithm of enlargement", choices=["ScuNET GAN", "SwinIR 4x", "ESRGAN_4x", "R-ESRGAN 4x+", "R-ESRGAN 4x+ Anime6B"])
234
  with gr.Column():
235
  with gr.Row():
236
+ gfpgan = gr.Slider(show_label=True, label="Effect GFPGAN (to improve the face)", minimum=0, maximum=1, value=0, step=0.1)
237
  with gr.Row():
238
+ codeformer = gr.Slider(show_label=True, label="Effect CodeFormer (to improve the face)", minimum=0, maximum=1, value=0, step=0.1)
239
 
240
  with gr.Column():
241
+ text_button = gr.Button("Generate image", variant='primary', elem_id="generate")
242
  with gr.Column():
243
  image_output = gr.Image(show_download_button=True, interactive=False, label='Результат:', elem_id='image_output', type='filepath')
244
  text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed], outputs=image_output, concurrency_limit=48)
245
 
246
+ img2img_b = gr.Button("Increase the image", variant='secondary')
247
+ image_i2i = gr.Image(show_label=True, label='Increased image:')
248
  img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
249
 
250