Spaces:
SHOOL45
/
Runtime error

Rooni commited on
Commit
a21f8c7
1 Parent(s): 891d366

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -33,7 +33,7 @@ mmodels = {
33
  timeout = 100
34
  # 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)
35
 
36
- 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):
37
  if prompt == "" or prompt == None:
38
  return None
39
 
@@ -158,6 +158,7 @@ with gr.Blocks(css=css, theme="YTheme/KidsShool") as dalle:
158
  with gr.Tab("Расширенные настройки"):
159
  with gr.Row():
160
  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")
 
161
  with gr.Row():
162
  steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
163
  with gr.Row():
@@ -168,13 +169,9 @@ with gr.Blocks(css=css, theme="YTheme/KidsShool") as dalle:
168
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
169
  with gr.Row():
170
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
 
171
  with gr.Row():
172
- gpt = gr.Checkbox(label="ChatGPT")
173
-
174
- with gr.Tab("Beta"):
175
- with gr.Row():
176
- width = gr.Slider(label="Ширина", minimum=15, maximum=2000, value=1024, step=1)
177
- height = gr.Slider(label="Высота", minimum=15, maximum=2000, value=1024, step=1)
178
 
179
  with gr.Tab("Информация"):
180
  with gr.Row():
@@ -190,6 +187,6 @@ with gr.Blocks(css=css, theme="YTheme/KidsShool") as dalle:
190
  with gr.Row():
191
  image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
192
 
193
- text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength, gpt, width, height], outputs=image_output)
194
 
195
  dalle.launch(show_api=False, share=False)
 
33
  timeout = 100
34
  # 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)
35
 
36
+ def query(gpt=True, prompt, model="DALL-E 3 XL", is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, strength=0.7, width=1024, height=1024):
37
  if prompt == "" or prompt == None:
38
  return None
39
 
 
158
  with gr.Tab("Расширенные настройки"):
159
  with gr.Row():
160
  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")
161
+ """
162
  with gr.Row():
163
  steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
164
  with gr.Row():
 
169
  strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
170
  with gr.Row():
171
  seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
172
+ """
173
  with gr.Row():
174
+ gpt = gr.Checkbox(label="GPT (Улучшение описания)", value=True)
 
 
 
 
 
175
 
176
  with gr.Tab("Информация"):
177
  with gr.Row():
 
187
  with gr.Row():
188
  image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")
189
 
190
+ text_button.click(gpt, query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, strength], outputs=image_output)
191
 
192
  dalle.launch(show_api=False, share=False)