Add parameter test
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
from io import BytesIO
|
2 |
from fastapi import FastAPI, Form
|
3 |
from fastapi import FastAPI, File, UploadFile
|
4 |
from fastapi.responses import StreamingResponse, FileResponse
|
@@ -13,12 +12,12 @@ app = FastAPI()
|
|
13 |
description="Descripci贸n",
|
14 |
summary="Summary"
|
15 |
)
|
16 |
-
async def echo_image(
|
|
|
|
|
17 |
|
18 |
if not image.content_type.startswith("image/"):
|
19 |
return {"error": "El archivo no es una imagen"}
|
20 |
|
21 |
resultado = await funciones.crea_superheroine_gpu(image)
|
22 |
-
return FileResponse(resultado, media_type="image/png", filename="imagen.png")
|
23 |
-
|
24 |
-
|
|
|
|
|
1 |
from fastapi import FastAPI, Form
|
2 |
from fastapi import FastAPI, File, UploadFile
|
3 |
from fastapi.responses import StreamingResponse, FileResponse
|
|
|
12 |
description="Descripci贸n",
|
13 |
summary="Summary"
|
14 |
)
|
15 |
+
async def echo_image(
|
16 |
+
image: UploadFile = File(...),
|
17 |
+
estilo: str = Form(...)):
|
18 |
|
19 |
if not image.content_type.startswith("image/"):
|
20 |
return {"error": "El archivo no es una imagen"}
|
21 |
|
22 |
resultado = await funciones.crea_superheroine_gpu(image)
|
23 |
+
return FileResponse(resultado, media_type="image/png", filename="imagen.png")
|
|
|
|