Update app.py
Browse files
app.py
CHANGED
@@ -2,18 +2,18 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
|
4 |
# Базовые настройки
|
5 |
-
prompt = gr.
|
6 |
-
models = gr.
|
7 |
|
8 |
# Расширенные настройки
|
9 |
-
negative_prompt = gr.
|
10 |
-
sampling_method = gr.
|
11 |
-
sampling_steps = gr.
|
12 |
-
cfg_scale = gr.
|
13 |
-
seed = gr.
|
14 |
|
15 |
# Улучшение качества
|
16 |
-
algorithm = gr.
|
17 |
|
18 |
# Функция генерации изображения
|
19 |
def generate_image(prompt, model, negative_prompt, sampling_method, sampling_steps, cfg_scale, seed):
|
|
|
2 |
import requests
|
3 |
|
4 |
# Базовые настройки
|
5 |
+
prompt = gr.widgets.Textbox(label="Prompt")
|
6 |
+
models = gr.widgets.RadioButtons(options=["Bard", "DALL-E 2", "VQGAN+CLIP", "VQGAN", "CLIP", "InceptionV3"])
|
7 |
|
8 |
# Расширенные настройки
|
9 |
+
negative_prompt = gr.widgets.Textbox(label="Negative Prompt")
|
10 |
+
sampling_method = gr.widgets.RadioButtons(options=["random", "greedy", "nucleus", "top_k", "top_p"])
|
11 |
+
sampling_steps = gr.widgets.Number(label="Sampling Steps", min=1, max=1000, default=100)
|
12 |
+
cfg_scale = gr.widgets.Number(label="CFG Scale", min=0.1, max=10.0, default=1.0)
|
13 |
+
seed = gr.widgets.Number(label="Seed", min=0, max=2**31, default=0)
|
14 |
|
15 |
# Улучшение качества
|
16 |
+
algorithm = gr.widgets.RadioButtons(options=["nearest", "bilinear", "bicubic", "lanczos", "cubic", "mitchell"])
|
17 |
|
18 |
# Функция генерации изображения
|
19 |
def generate_image(prompt, model, negative_prompt, sampling_method, sampling_steps, cfg_scale, seed):
|