From 7f256fa283064b396663f8b3faf88f2393d28202 Mon Sep 17 00:00:00 2001 From: Zelin Pu Date: Wed, 7 Aug 2024 11:12:20 +0800 Subject: [PATCH] fix:image upload --- server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index b234fa96e..bf4b15a07 100644 --- a/server.py +++ b/server.py @@ -184,7 +184,7 @@ class PromptServer(): except Exception as e: return False - async def image_upload(post, image_save_function=None): + def image_upload(post, image_save_function=None): print("Starting image upload process") image = post.get("image") @@ -202,7 +202,7 @@ class PromptServer(): if image: if isinstance(image, web.FileField): filename = image.filename - file_content = await image.read() + file_content = image.file.read() else: filename = image.get("filename") file_content = image.get("file") @@ -301,7 +301,7 @@ class PromptServer(): print("Unsupported Content-Type") return web.Response(status=400, text="Unsupported Content-Type") - return await image_upload(post) + return image_upload(post) @routes.post("/upload/mask")