Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -112,12 +112,8 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
112 |
"steps": steps,
|
113 |
"cfg_scale": cfg_scale,
|
114 |
"seed": seed if seed != -1 else random.randint(1, 1000000000),
|
115 |
-
"strength": strength,
|
116 |
-
"width": width,
|
117 |
-
"height": height,
|
118 |
"guidance_scale": cfg_scale,
|
119 |
"num_inference_steps": steps,
|
120 |
-
"resolution": f"{width} x {height}",
|
121 |
"negative_prompt": is_negative
|
122 |
}
|
123 |
|
@@ -167,19 +163,12 @@ with gr.Blocks(css=css) as dalle:
|
|
167 |
with gr.Row():
|
168 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
169 |
with gr.Row():
|
170 |
-
method = gr.Radio(label="Sampling method", value="
|
171 |
-
with gr.Row():
|
172 |
-
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.1)
|
173 |
with gr.Row():
|
174 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
175 |
with gr.Row():
|
176 |
gpt = gr.Checkbox(label="ChatGPT")
|
177 |
|
178 |
-
with gr.Tab("Beta"):
|
179 |
-
with gr.Row():
|
180 |
-
width = gr.Slider(label="Ширина", minimum=15, maximum=2000, value=1024, step=1)
|
181 |
-
height = gr.Slider(label="Высота", minimum=15, maximum=2000, value=1024, step=1)
|
182 |
-
|
183 |
with gr.Tab("Информация"):
|
184 |
with gr.Row():
|
185 |
gr.Textbox(label="Шаблон prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
|
@@ -194,6 +183,6 @@ with gr.Blocks(css=css) as dalle:
|
|
194 |
with gr.Row():
|
195 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
196 |
|
197 |
-
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed,
|
198 |
|
199 |
dalle.launch(show_api=False, share=False)
|
|
|
112 |
"steps": steps,
|
113 |
"cfg_scale": cfg_scale,
|
114 |
"seed": seed if seed != -1 else random.randint(1, 1000000000),
|
|
|
|
|
|
|
115 |
"guidance_scale": cfg_scale,
|
116 |
"num_inference_steps": steps,
|
|
|
117 |
"negative_prompt": is_negative
|
118 |
}
|
119 |
|
|
|
163 |
with gr.Row():
|
164 |
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
165 |
with gr.Row():
|
166 |
+
method = gr.Radio(label="Sampling method", value="Euler a", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
|
|
|
|
167 |
with gr.Row():
|
168 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
169 |
with gr.Row():
|
170 |
gpt = gr.Checkbox(label="ChatGPT")
|
171 |
|
|
|
|
|
|
|
|
|
|
|
172 |
with gr.Tab("Информация"):
|
173 |
with gr.Row():
|
174 |
gr.Textbox(label="Шаблон prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
|
|
|
183 |
with gr.Row():
|
184 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
185 |
|
186 |
+
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, gpt], outputs=image_output, concurrency_limit=24)
|
187 |
|
188 |
dalle.launch(show_api=False, share=False)
|