Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ from fake_useragent import UserAgent
|
|
17 |
import random
|
18 |
|
19 |
|
20 |
-
def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
|
21 |
-
result = {"prompt": prompt,"negative_prompt": negative_prompt,"task": task,"steps": steps,"sampler": sampler,"cfg_scale": cfg_scale,"seed": seed}
|
22 |
print(result)
|
23 |
try:
|
24 |
language = detect(prompt)
|
@@ -176,6 +176,8 @@ def mirror(image_output, scale_by, method, gfpgan, codeformer):
|
|
176 |
return img
|
177 |
|
178 |
css = """
|
|
|
|
|
179 |
#generate {
|
180 |
width: 100%;
|
181 |
background: #e253dd !important;
|
@@ -216,6 +218,10 @@ with gr.Blocks(css=css) as demo:
|
|
216 |
cfg_scale = gr.Slider(show_label=True, label="CFG Scale:", minimum=1, maximum=20, value=7, step=1)
|
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():
|
@@ -233,10 +239,10 @@ with gr.Blocks(css=css) as demo:
|
|
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()
|
|
|
17 |
import random
|
18 |
|
19 |
|
20 |
+
def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed, width, height):
|
21 |
+
result = {"prompt": prompt,"negative_prompt": negative_prompt,"task": task,"steps": steps,"sampler": sampler,"cfg_scale": cfg_scale,"seed": seed, "width":width, "height":height}
|
22 |
print(result)
|
23 |
try:
|
24 |
language = detect(prompt)
|
|
|
176 |
return img
|
177 |
|
178 |
css = """
|
179 |
+
.gradio-container {background-color: MediumAquaMarine}
|
180 |
+
footer{display:none !important}
|
181 |
#generate {
|
182 |
width: 100%;
|
183 |
background: #e253dd !important;
|
|
|
218 |
cfg_scale = gr.Slider(show_label=True, label="CFG Scale:", minimum=1, maximum=20, value=7, step=1)
|
219 |
with gr.Row():
|
220 |
seed = gr.Number(show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1)
|
221 |
+
with gr.Row():
|
222 |
+
width = gr.Slider(label="Width", minimum=512, maximum=2048, step=8, value=896,)
|
223 |
+
with gr.Row():
|
224 |
+
height = gr.Slider(label="Height", minimum=512, maximum=2048, step=8, value=1152,)
|
225 |
|
226 |
with gr.Tab("Upscaling Settings"):
|
227 |
with gr.Column():
|
|
|
239 |
text_button = gr.Button("Generate image", variant='primary', interactive=True, elem_id="generate")
|
240 |
with gr.Column():
|
241 |
image_output = gr.Image(show_download_button=True, interactive=False, label='Результат:', elem_id='image_output', type='filepath')
|
242 |
+
text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed, width, height], outputs=image_output, concurrency_limit=48)
|
243 |
|
244 |
img2img_b = gr.Button("Increase the image", variant='secondary')
|
245 |
image_i2i = gr.Image(show_label=True, label='Increased image:')
|
246 |
img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=48)
|
247 |
|
248 |
+
demo.launch()
|