Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
13 |
|
14 |
models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL", "Vector Art XL", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "PixArt XL 2.0", "Disney Cartoon", "CleanLinearMix", "Waifu 1.4"]
|
15 |
|
16 |
-
def query(prompt, model, is_negative=False, steps=30, cfg_scale=7,
|
17 |
if prompt == None:
|
18 |
return None
|
19 |
|
@@ -95,12 +95,14 @@ with gr.Blocks(css=css) as dalle:
|
|
95 |
|
96 |
with gr.Tab("Расширенные настройки"):
|
97 |
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="Чего не должно быть на изображении", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry, text, fuzziness", lines=3, elem_id="negative-prompt-text-input")
|
|
|
|
|
98 |
|
99 |
with gr.Row():
|
100 |
text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")
|
101 |
with gr.Row():
|
102 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
103 |
|
104 |
-
text_button.click(query, inputs=[text_prompt, model, negative_prompt], outputs=image_output)
|
105 |
|
106 |
dalle.launch(show_api=False)
|
|
|
13 |
|
14 |
models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL", "Vector Art XL", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "PixArt XL 2.0", "Disney Cartoon", "CleanLinearMix", "Waifu 1.4"]
|
15 |
|
16 |
+
def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=None):
|
17 |
if prompt == None:
|
18 |
return None
|
19 |
|
|
|
95 |
|
96 |
with gr.Tab("Расширенные настройки"):
|
97 |
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="Чего не должно быть на изображении", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry, text, fuzziness", lines=3, elem_id="negative-prompt-text-input")
|
98 |
+
steps = gr.Slider(label="Sampling steps", value=30, minimum=1, maximum=100, step=1)
|
99 |
+
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
100 |
|
101 |
with gr.Row():
|
102 |
text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")
|
103 |
with gr.Row():
|
104 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
105 |
|
106 |
+
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg], outputs=image_output)
|
107 |
|
108 |
dalle.launch(show_api=False)
|