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