salomonsky commited on
Commit
7d0d952
·
verified ·
1 Parent(s): 520d65e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -184,9 +184,9 @@ def main():
184
  num_variants = st.sidebar.slider("Número de imágenes", 1, 8, 8)
185
  width, height = (720, 1280) if format_option == "9:16" else (1280, 720) if format_option == "16:9" else (1280, 1280)
186
 
187
- if prompt:
188
- prompts = generate_variations(prompt, num_variants=num_variants, use_enhanced=prompt_enhance)
189
- if st.sidebar.button("Generar Imágenes"):
190
  generated_images = gen(prompts, width, height, model_option, num_variants)
191
 
192
  st.header("Imágenes Generadas")
@@ -195,9 +195,11 @@ def main():
195
  with cols[i % 4]:
196
  st.image(image_path, use_column_width=True)
197
  st.caption(image_prompt)
198
-
 
 
199
  upload_image_to_gallery()
200
  display_gallery()
201
 
202
- if __name__ == "__main__":
203
  main()
 
184
  num_variants = st.sidebar.slider("Número de imágenes", 1, 8, 8)
185
  width, height = (720, 1280) if format_option == "9:16" else (1280, 720) if format_option == "16:9" else (1280, 1280)
186
 
187
+ if st.sidebar.button("Generar Imágenes"):
188
+ if prompt:
189
+ prompts = generate_variations(prompt, num_variants=num_variants, use_enhanced=prompt_enhance)
190
  generated_images = gen(prompts, width, height, model_option, num_variants)
191
 
192
  st.header("Imágenes Generadas")
 
195
  with cols[i % 4]:
196
  st.image(image_path, use_column_width=True)
197
  st.caption(image_prompt)
198
+ else:
199
+ st.warning("Por favor, ingrese una descripción de imagen")
200
+
201
  upload_image_to_gallery()
202
  display_gallery()
203
 
204
+ if __name__ == "__main__":
205
  main()