mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-12 22:37:06 +08:00
fix:image upload
This commit is contained in:
parent
c3b0c4445a
commit
7f256fa283
@ -184,7 +184,7 @@ class PromptServer():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def image_upload(post, image_save_function=None):
|
def image_upload(post, image_save_function=None):
|
||||||
print("Starting image upload process")
|
print("Starting image upload process")
|
||||||
|
|
||||||
image = post.get("image")
|
image = post.get("image")
|
||||||
@ -202,7 +202,7 @@ class PromptServer():
|
|||||||
if image:
|
if image:
|
||||||
if isinstance(image, web.FileField):
|
if isinstance(image, web.FileField):
|
||||||
filename = image.filename
|
filename = image.filename
|
||||||
file_content = await image.read()
|
file_content = image.file.read()
|
||||||
else:
|
else:
|
||||||
filename = image.get("filename")
|
filename = image.get("filename")
|
||||||
file_content = image.get("file")
|
file_content = image.get("file")
|
||||||
@ -301,7 +301,7 @@ class PromptServer():
|
|||||||
print("Unsupported Content-Type")
|
print("Unsupported Content-Type")
|
||||||
return web.Response(status=400, text="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")
|
@routes.post("/upload/mask")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user