Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,28 +39,38 @@ def render(prompt, model, negative_prompt, width, height, guidance, seed, upscal
|
|
39 |
return response.content
|
40 |
else:
|
41 |
return None
|
42 |
-
def render_closure(prompt, model, negative_prompt, width, height, guidance, seed, upscale):
|
43 |
-
return render(prompt, model, negative_prompt, width, height, guidance, seed, upscale)
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
]
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
gr.Dropdown(render, choices=["yes", "no"], label="Upscale", value="no"),
|
57 |
-
]
|
58 |
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
-
#
|
62 |
-
gr.Interface(
|
63 |
fn=render,
|
64 |
-
inputs=[tabs],
|
65 |
outputs=gr.Image(),
|
66 |
-
)
|
|
|
|
|
|
|
|
39 |
return response.content
|
40 |
else:
|
41 |
return None
|
|
|
|
|
42 |
|
43 |
+
# Создаем компоненты для ввода данных
|
44 |
+
prompt_textbox = gr.Textbox(lines=3, placeholder="Введите описание изображения", label="Описание изображения:")
|
45 |
+
model_radio = gr.Radio(choices=model_list, label="Модель:", default="Anything V5", type="value")
|
|
|
46 |
|
47 |
+
negative_prompt_textbox = gr.Textbox(lines=3, placeholder="Введите Negative Prompt", label="Negative Prompt:")
|
48 |
+
width_slider = gr.Slider(minimum=256, maximum=2048, default=512, label="Ширина:")
|
49 |
+
height_slider = gr.Slider(minimum=256, maximum=2048, default=512, label="Высота:")
|
50 |
+
guidance_slider = gr.Slider(minimum=1, maximum=20, default=7.5, label="CFG Scale:")
|
51 |
+
seed_slider = gr.Slider(minimum=-1, maximum=1000000, default=-1, label="Seed:")
|
52 |
+
upscale_dropdown = gr.Dropdown(choices=["yes", "no"], label="Upscale", default="no")
|
|
|
|
|
53 |
|
54 |
+
input_component_1=[
|
55 |
+
prompt_textbox,
|
56 |
+
model_radio,
|
57 |
+
]
|
58 |
+
input_component_2=[
|
59 |
+
negative_prompt_textbox,
|
60 |
+
width_slider,
|
61 |
+
height_slider,
|
62 |
+
guidance_slider,
|
63 |
+
seed_slider,
|
64 |
+
upscale_dropdown,
|
65 |
+
]
|
66 |
+
tabs = gr.Tab([input_component_1, input_component_2], title=["Базовые настройки", "Расширенные настройки"])
|
67 |
|
68 |
+
# Создаем интерфейс
|
69 |
+
iface = gr.Interface(
|
70 |
fn=render,
|
71 |
+
inputs=[tabs],
|
72 |
outputs=gr.Image(),
|
73 |
+
)
|
74 |
+
|
75 |
+
# Запускаем интерфейс
|
76 |
+
iface.launch()
|