Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
72 |
"is_negative": is_negative,
|
73 |
"steps": steps,
|
74 |
"cfg_scale": cfg_scale,
|
75 |
-
"seed": seed if seed is not
|
76 |
}
|
77 |
|
78 |
image_bytes = requests.post(API_URL, headers=headers, json=payload).content
|
@@ -98,6 +98,7 @@ with gr.Blocks(css=css) as dalle:
|
|
98 |
steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
|
99 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
100 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
|
|
101 |
|
102 |
|
103 |
with gr.Row():
|
@@ -105,6 +106,6 @@ with gr.Blocks(css=css) as dalle:
|
|
105 |
with gr.Row():
|
106 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
107 |
|
108 |
-
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method], outputs=image_output)
|
109 |
|
110 |
dalle.launch(show_api=False)
|
|
|
72 |
"is_negative": is_negative,
|
73 |
"steps": steps,
|
74 |
"cfg_scale": cfg_scale,
|
75 |
+
"seed": seed if seed is not -1 else random.randint(1, 1000000)
|
76 |
}
|
77 |
|
78 |
image_bytes = requests.post(API_URL, headers=headers, json=payload).content
|
|
|
98 |
steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
|
99 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
100 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
101 |
+
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000, step=1)
|
102 |
|
103 |
|
104 |
with gr.Row():
|
|
|
106 |
with gr.Row():
|
107 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
108 |
|
109 |
+
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed], outputs=image_output)
|
110 |
|
111 |
dalle.launch(show_api=False)
|