Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,11 +13,10 @@ def fusionar_cosplay_bridge(imagen_real, imagen_ref):
|
|
| 13 |
try:
|
| 14 |
print("[+] Petici贸n recibida desde Android. Inicializando cliente nativo del cl煤ster...")
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
hf_client = Client("joyfox/Qwen-Image-Edit-Cosplay", hf_token=hf_token)
|
| 19 |
|
| 20 |
-
# Aseguramos
|
| 21 |
data_uri_real = imagen_real if imagen_real.startswith("data:") else f"data:image/jpeg;base64,{imagen_real}"
|
| 22 |
data_uri_ref = imagen_ref if imagen_ref.startswith("data:") else f"data:image/jpeg;base64,{imagen_ref}"
|
| 23 |
|
|
@@ -34,7 +33,6 @@ def fusionar_cosplay_bridge(imagen_real, imagen_ref):
|
|
| 34 |
)
|
| 35 |
|
| 36 |
print("[+] Fusi贸n completada con 茅xito.")
|
| 37 |
-
# El cliente nativo devuelve la estructura limpia o la URL local del archivo procesado
|
| 38 |
return {"data": resultado}
|
| 39 |
|
| 40 |
except Exception as e:
|
|
@@ -51,6 +49,6 @@ demo = gr.Interface(
|
|
| 51 |
api_name="predict"
|
| 52 |
)
|
| 53 |
|
| 54 |
-
# Apagamos el SSR para
|
| 55 |
if __name__ == "__main__":
|
| 56 |
demo.launch(ssr_mode=False)
|
|
|
|
| 13 |
try:
|
| 14 |
print("[+] Petici贸n recibida desde Android. Inicializando cliente nativo del cl煤ster...")
|
| 15 |
|
| 16 |
+
# 馃専 CORRECCI脫N AQU脥: Se cambi贸 'hf_token' por 'token' para cumplir con la API de gradio_client
|
| 17 |
+
hf_client = Client("joyfox/Qwen-Image-Edit-Cosplay", token=hf_token)
|
|
|
|
| 18 |
|
| 19 |
+
# Aseguramos los prefijos Data URI limpios
|
| 20 |
data_uri_real = imagen_real if imagen_real.startswith("data:") else f"data:image/jpeg;base64,{imagen_real}"
|
| 21 |
data_uri_ref = imagen_ref if imagen_ref.startswith("data:") else f"data:image/jpeg;base64,{imagen_ref}"
|
| 22 |
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
print("[+] Fusi贸n completada con 茅xito.")
|
|
|
|
| 36 |
return {"data": resultado}
|
| 37 |
|
| 38 |
except Exception as e:
|
|
|
|
| 49 |
api_name="predict"
|
| 50 |
)
|
| 51 |
|
| 52 |
+
# Apagamos el SSR para mantener compatibilidad directa con peticiones HTTP crudas
|
| 53 |
if __name__ == "__main__":
|
| 54 |
demo.launch(ssr_mode=False)
|