Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -145,50 +145,53 @@ footer {visibility: hidden !important;}
|
|
145 |
"""
|
146 |
|
147 |
with gr.Blocks(css=css) as dalle:
|
148 |
-
with gr.
|
149 |
-
with gr.
|
150 |
-
with gr.
|
151 |
-
with gr.Row():
|
152 |
-
text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
|
153 |
with gr.Row():
|
154 |
-
|
|
|
|
|
|
|
|
|
155 |
|
156 |
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
192 |
|
193 |
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt, width, height], outputs=image_output, concurrency_limit=24)
|
194 |
|
|
|
145 |
"""
|
146 |
|
147 |
with gr.Blocks(css=css) as dalle:
|
148 |
+
with gr.Row():
|
149 |
+
with gr.Column():
|
150 |
+
with gr.Tab("Базовые настройки"):
|
|
|
|
|
151 |
with gr.Row():
|
152 |
+
with gr.Column(elem_id="prompt-container"):
|
153 |
+
with gr.Row():
|
154 |
+
text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")
|
155 |
+
with gr.Row():
|
156 |
+
model = gr.Radio(label="Модель", value="OpenDALL-E 1.1", choices=list(mmodels.keys()))
|
157 |
|
158 |
|
159 |
|
160 |
+
with gr.Tab("Расширенные настройки"):
|
161 |
+
with gr.Row():
|
162 |
+
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")
|
163 |
+
with gr.Row():
|
164 |
+
steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
|
165 |
+
with gr.Row():
|
166 |
+
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
167 |
+
with gr.Row():
|
168 |
+
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
169 |
+
with gr.Row():
|
170 |
+
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
171 |
+
with gr.Row():
|
172 |
+
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
173 |
+
with gr.Row():
|
174 |
+
gpt = gr.Checkbox(label="ChatGPT")
|
175 |
+
|
176 |
+
with gr.Tab("Beta"):
|
177 |
+
with gr.Row():
|
178 |
+
width = gr.Slider(label="Ширина", minimum=15, maximum=2000, value=1024, step=1)
|
179 |
+
height = gr.Slider(label="Высота", minimum=15, maximum=2000, value=1024, step=1)
|
180 |
+
|
181 |
+
with gr.Tab("Информация"):
|
182 |
+
with gr.Row():
|
183 |
+
gr.Textbox(label="Шаблон prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
|
184 |
+
with gr.Row():
|
185 |
+
with gr.Column():
|
186 |
+
gr.HTML("""<button class="lg secondary svelte-cmf5ev" onclick="window.open('http://ai-hub.rf.gd', '_blank');">AI-HUB</button>""")
|
187 |
+
gr.HTML("""<button class="lg secondary svelte-cmf5ev" onclick="window.open('http://yufi.rf.gd', '_blank');">YUFI</button>""")
|
188 |
|
189 |
|
190 |
+
with gr.Row():
|
191 |
+
text_button = gr.Button("Генерация", variant='primary', elem_id="gen-button")
|
192 |
+
with gr.Column():
|
193 |
+
with gr.Row():
|
194 |
+
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
195 |
|
196 |
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt, width, height], outputs=image_output, concurrency_limit=24)
|
197 |
|