Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ model_list = ["AbsoluteReality 1.8.1", "Elldreth's Vivid Mix", "Anything V5", "O
|
|
12 |
|
13 |
|
14 |
# Функция для отправки запроса
|
15 |
-
def render(
|
16 |
data = {
|
17 |
"key": api_key,
|
18 |
"model_id": model,
|
@@ -41,18 +41,19 @@ def render(model, prompt, negative_prompt, width, height, guidance, seed, upscal
|
|
41 |
else:
|
42 |
return None
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
# UI
|
45 |
gr.Interface(
|
46 |
render,
|
47 |
-
|
48 |
-
gr.Radio(interactive=True, value="Anything V5", show_label=True, label="Модель:", choices=model_list),
|
49 |
-
gr.Textbox(label="Описание изображения:", placeholder="Введите описание изображения", lines=3),
|
50 |
-
gr.Textbox(label="Negative Prompt:", placeholder="Введите Negative Prompt", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry", lines=3),
|
51 |
-
gr.Slider(show_label=True, minimum=256, maximum=2048, label="Ширина:", value="512", step=1),
|
52 |
-
gr.Slider(show_label=True, minimum=256, maximum=2048, label="Высота:", value="512", step=1),
|
53 |
-
gr.Slider(show_label=True, minimum=1, maximum=20, label="CFG Scale:", value="7.5", step=0.5),
|
54 |
-
gr.Slider(show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1),
|
55 |
-
gr.Dropdown(["yes", "no"], label="Upscale", value="no"),
|
56 |
-
],
|
57 |
-
outputs=gr.Image()
|
58 |
).launch()
|
|
|
12 |
|
13 |
|
14 |
# Функция для отправки запроса
|
15 |
+
def render(prompt, model, negative_prompt, width, height, guidance, seed, upscale):
|
16 |
data = {
|
17 |
"key": api_key,
|
18 |
"model_id": model,
|
|
|
41 |
else:
|
42 |
return None
|
43 |
|
44 |
+
tab_1=[gr.Textbox(render, label="Описание изображения:", placeholder="Введите описание изображения", lines=3),
|
45 |
+
gr.Radio(render, interactive=True, value="Anything V5", show_label=True, label="Модель:", choices=model_list),]
|
46 |
+
tab_2=[gr.Textbox(render, label="Negative Prompt:", placeholder="Введите Negative Prompt", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry", lines=3),
|
47 |
+
gr.Slider(render, show_label=True, minimum=256, maximum=2048, label="Ширина:", value="512", step=1),
|
48 |
+
gr.Slider(render, show_label=True, minimum=256, maximum=2048, label="Высота:", value="512", step=1),
|
49 |
+
gr.Slider(render, show_label=True, minimum=1, maximum=20, label="CFG Scale:", value="7.5", step=0.5),
|
50 |
+
gr.Slider(render, show_label=True, label="Seed:", minimum=-1, maximum=1000000, value=-1, step=1),
|
51 |
+
gr.Dropdown(render, ["yes", "no"], label="Upscale", value="no"),]
|
52 |
+
|
53 |
+
tabs=gr.Tab([tab_1, tab_2], title=["Базовые настройки", "Расширенные настройки"])
|
54 |
+
|
55 |
# UI
|
56 |
gr.Interface(
|
57 |
render,
|
58 |
+
outputs=gr.Image(), tabs=tabs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
).launch()
|