salomonsky commited on
Commit
7782748
1 Parent(s): 35f506c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -101,7 +101,7 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
101
 
102
  async def improve_prompt(prompt, language):
103
  try:
104
- instruction_en = "With this idea, describe in English a detailed txt2img prompt in 500 characters at most, add illumination, atmosphere, cinematic elements, and characters if need it..."
105
  instruction_es = "Con esta idea, describe en español un prompt detallado de txt2img en un máximo de 500 caracteres, con iluminación, atmósfera, elementos cinematográficos y en su caso personajes..."
106
  instruction = instruction_en if language == "en" else instruction_es
107
  formatted_prompt = f"{prompt}: {instruction}"
@@ -142,7 +142,7 @@ def delete_image(image_path):
142
 
143
  def swap_faces(image_path):
144
  try:
145
- swapped_image_path = image_path
146
  return swapped_image_path
147
  except Exception as e:
148
  st.error(f"Error en el face swap: {e}")
@@ -201,7 +201,7 @@ def main():
201
 
202
  st.image(image, caption=f"Imagen {idx+1}")
203
  st.write(f"Prompt: {prompt_text}")
204
-
205
  if st.button(f"Borrar Imagen {idx+1}", key=f"delete_{idx+1}"):
206
  delete_image(file)
207
 
@@ -211,4 +211,4 @@ def main():
211
  st.image(swapped_image_path, caption=f"Imagen {idx+1} con Face Swap")
212
 
213
  if __name__ == "__main__":
214
- main()
 
101
 
102
  async def improve_prompt(prompt, language):
103
  try:
104
+ instruction_en = "With this idea, describe in English a detailed txt2img prompt in 500 characters at most, add illumination, atmosphere, cinematic elements, and characters if needed..."
105
  instruction_es = "Con esta idea, describe en español un prompt detallado de txt2img en un máximo de 500 caracteres, con iluminación, atmósfera, elementos cinematográficos y en su caso personajes..."
106
  instruction = instruction_en if language == "en" else instruction_es
107
  formatted_prompt = f"{prompt}: {instruction}"
 
142
 
143
  def swap_faces(image_path):
144
  try:
145
+ swapped_image_path = image_path # Simulación del swap; aquí debes implementar la lógica real.
146
  return swapped_image_path
147
  except Exception as e:
148
  st.error(f"Error en el face swap: {e}")
 
201
 
202
  st.image(image, caption=f"Imagen {idx+1}")
203
  st.write(f"Prompt: {prompt_text}")
204
+
205
  if st.button(f"Borrar Imagen {idx+1}", key=f"delete_{idx+1}"):
206
  delete_image(file)
207
 
 
211
  st.image(swapped_image_path, caption=f"Imagen {idx+1} con Face Swap")
212
 
213
  if __name__ == "__main__":
214
+ main()