Update app.py
Browse files
app.py
CHANGED
@@ -34,8 +34,8 @@ def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
|
|
34 |
steps = int(steps)
|
35 |
seed = int(seed)
|
36 |
|
37 |
-
width =
|
38 |
-
height =
|
39 |
|
40 |
if task == "Playground v2":
|
41 |
ua = UserAgent()
|
@@ -196,15 +196,15 @@ height: 100% !important;
|
|
196 |
|
197 |
with gr.Blocks(css=css) as demo:
|
198 |
|
199 |
-
with gr.Tab("
|
200 |
with gr.Row():
|
201 |
-
prompt = gr.Textbox(placeholder="
|
202 |
with gr.Row():
|
203 |
-
task = gr.Radio(interactive=True, value="Stable Diffusion XL 1.0", show_label=True, label="
|
204 |
'Juggernaut XL', 'DreamShaper XL',
|
205 |
'SDXL Niji', 'Cinemax SDXL', 'NightVision XL',
|
206 |
'Playground v2', 'Artigen v3'])
|
207 |
-
with gr.Tab("
|
208 |
with gr.Row():
|
209 |
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")
|
210 |
with gr.Row():
|
@@ -217,26 +217,26 @@ with gr.Blocks(css=css) as demo:
|
|
217 |
with gr.Row():
|
218 |
seed = gr.Number(show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1)
|
219 |
|
220 |
-
with gr.Tab("
|
221 |
with gr.Column():
|
222 |
with gr.Row():
|
223 |
-
scale_by = gr.Number(show_label=True, label="
|
224 |
with gr.Row():
|
225 |
-
method = gr.Dropdown(show_label=True, value="ESRGAN_4x", label="
|
226 |
with gr.Column():
|
227 |
with gr.Row():
|
228 |
-
gfpgan = gr.Slider(show_label=True, label="
|
229 |
with gr.Row():
|
230 |
-
codeformer = gr.Slider(show_label=True, label="
|
231 |
|
232 |
with gr.Column():
|
233 |
-
text_button = gr.Button("
|
234 |
with gr.Column():
|
235 |
image_output = gr.Image(show_download_button=True, interactive=False, label='Результат:', elem_id='image_output', type='filepath')
|
236 |
text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed], outputs=image_output, concurrency_limit=48)
|
237 |
|
238 |
-
img2img_b = gr.Button("
|
239 |
-
image_i2i = gr.Image(show_label=True, label='
|
240 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
|
241 |
|
242 |
demo.launch()
|
|
|
34 |
steps = int(steps)
|
35 |
seed = int(seed)
|
36 |
|
37 |
+
width = 2048
|
38 |
+
height = 2048
|
39 |
|
40 |
if task == "Playground v2":
|
41 |
ua = UserAgent()
|
|
|
196 |
|
197 |
with gr.Blocks(css=css) as demo:
|
198 |
|
199 |
+
with gr.Tab("Basic Settings"):
|
200 |
with gr.Row():
|
201 |
+
prompt = gr.Textbox(placeholder="Enter the image description...", show_label=True, label='Description of the image:', lines=3)
|
202 |
with gr.Row():
|
203 |
+
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',
|
204 |
'Juggernaut XL', 'DreamShaper XL',
|
205 |
'SDXL Niji', 'Cinemax SDXL', 'NightVision XL',
|
206 |
'Playground v2', 'Artigen v3'])
|
207 |
+
with gr.Tab("Extended settings"):
|
208 |
with gr.Row():
|
209 |
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")
|
210 |
with gr.Row():
|
|
|
217 |
with gr.Row():
|
218 |
seed = gr.Number(show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1)
|
219 |
|
220 |
+
with gr.Tab("Upscaling Settings"):
|
221 |
with gr.Column():
|
222 |
with gr.Row():
|
223 |
+
scale_by = gr.Number(show_label=True, label="How many times to increase:", minimum=1, maximum=2, value=2, step=1)
|
224 |
with gr.Row():
|
225 |
+
method = gr.Dropdown(show_label=True, value="ESRGAN_4x", label="Increasing algorithm", choices=["ScuNET GAN", "SwinIR 4x", "ESRGAN_4x", "R-ESRGAN 4x+", "R-ESRGAN 4x+ Anime6B"])
|
226 |
with gr.Column():
|
227 |
with gr.Row():
|
228 |
+
gfpgan = gr.Slider(show_label=True, label="Effect GFPGAN (for facial improvement)", minimum=0, maximum=1, value=0, step=0.1)
|
229 |
with gr.Row():
|
230 |
+
codeformer = gr.Slider(show_label=True, label="Effect CodeFormer (для улучшения лица)", minimum=0, maximum=1, value=0, step=0.1)
|
231 |
|
232 |
with gr.Column():
|
233 |
+
text_button = gr.Button("Generate image", variant='primary', interactive=True, elem_id="generate")
|
234 |
with gr.Column():
|
235 |
image_output = gr.Image(show_download_button=True, interactive=False, label='Результат:', elem_id='image_output', type='filepath')
|
236 |
text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed], outputs=image_output, concurrency_limit=48)
|
237 |
|
238 |
+
img2img_b = gr.Button("Increase the image", variant='secondary')
|
239 |
+
image_i2i = gr.Image(show_label=True, label='Increased image:')
|
240 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
|
241 |
|
242 |
demo.launch()
|