Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ mmodels = {
|
|
32 |
timeout = 100
|
33 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
34 |
|
35 |
-
def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, gpt=False):
|
36 |
if prompt == "" or prompt == None:
|
37 |
return None
|
38 |
|
@@ -110,11 +110,11 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
110 |
"cfg_scale": cfg_scale,
|
111 |
"seed": seed if seed != -1 else random.randint(1, 1000000000),
|
112 |
"strength": strength,
|
113 |
-
"width":
|
114 |
-
"height":
|
115 |
"guidance_scale": cfg_scale,
|
116 |
"num_inference_steps": steps,
|
117 |
-
"resolution": "
|
118 |
"negative_prompt": is_negative
|
119 |
}
|
120 |
|
@@ -171,7 +171,8 @@ with gr.Blocks(css=css) as dalle:
|
|
171 |
|
172 |
with gr.Tab("Информация"):
|
173 |
with gr.Row():
|
174 |
-
gr.
|
|
|
175 |
|
176 |
with gr.Tab("Информация"):
|
177 |
with gr.Row():
|
@@ -187,6 +188,6 @@ with gr.Blocks(css=css) as dalle:
|
|
187 |
with gr.Row():
|
188 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
189 |
|
190 |
-
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt], outputs=image_output)
|
191 |
|
192 |
dalle.launch(show_api=False, share=False)
|
|
|
32 |
timeout = 100
|
33 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
34 |
|
35 |
+
def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, gpt=False, width=1024, height=1024):
|
36 |
if prompt == "" or prompt == None:
|
37 |
return None
|
38 |
|
|
|
110 |
"cfg_scale": cfg_scale,
|
111 |
"seed": seed if seed != -1 else random.randint(1, 1000000000),
|
112 |
"strength": strength,
|
113 |
+
"width": width,
|
114 |
+
"height": height,
|
115 |
"guidance_scale": cfg_scale,
|
116 |
"num_inference_steps": steps,
|
117 |
+
"resolution": f"{width} x {height}",
|
118 |
"negative_prompt": is_negative
|
119 |
}
|
120 |
|
|
|
171 |
|
172 |
with gr.Tab("Информация"):
|
173 |
with gr.Row():
|
174 |
+
width = gr.Slider(label="Ширина", minimum=15, maximum=2000, value=1024, step=1)
|
175 |
+
height = gr.Slider(label="Высота", minimum=15, maximum=2000, value=1024, step=1)
|
176 |
|
177 |
with gr.Tab("Информация"):
|
178 |
with gr.Row():
|
|
|
188 |
with gr.Row():
|
189 |
image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
|
190 |
|
191 |
+
text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt, width, height], outputs=image_output)
|
192 |
|
193 |
dalle.launch(show_api=False, share=False)
|