Rooni commited on
Commit
924c36b
·
verified ·
1 Parent(s): d58ffe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,7 @@ def generate_image(prompt, code, size_512):
7
  if code != os.getenv("code"):
8
  raise gr.Error("❗ Не верный ключ!")
9
  return None
10
- size = "512x512" if size_512 else "1024x1024"
11
  response = client.images.generate(
12
  model="dall-e-3",
13
  prompt=prompt,
@@ -31,7 +31,7 @@ with gr.Blocks(css=css, theme='YTheme/Sketch') as demo:
31
  with gr.Row():
32
  prompt_input = gr.Textbox(label="Описание изображения", lines=3)
33
  with gr.Row():
34
- size_512_checkbox = gr.Checkbox(label="512x512", value=False)
35
  submit_btn = gr.Button("Генерация", variant='primary')
36
  with gr.Column():
37
  image_output = gr.Image(label="Изображение")
 
7
  if code != os.getenv("code"):
8
  raise gr.Error("❗ Не верный ключ!")
9
  return None
10
+ size = "256x256" if size_512 else "1024x1024"
11
  response = client.images.generate(
12
  model="dall-e-3",
13
  prompt=prompt,
 
31
  with gr.Row():
32
  prompt_input = gr.Textbox(label="Описание изображения", lines=3)
33
  with gr.Row():
34
+ size_512_checkbox = gr.Checkbox(label="256x256", value=False)
35
  submit_btn = gr.Button("Генерация", variant='primary')
36
  with gr.Column():
37
  image_output = gr.Image(label="Изображение")