Open kizzhang opened 1 month ago
I will deal with this problem in my spare time, sorry about this 😞
This issue caused by https://github.com/mrhan1993/Fooocus-API/commit/948f342bc62ba5ba2737acaf8e54f0bc82c91dff
The return is correct, but you have to remove str like 'data:image/{ext};base64,' , that is used for browser
change this :
def decode_base64_to_image(base64_image: str) -> Image.Image:
pil_image = Image.open(io.BytesIO(base64.b64decode(base64_image))).convert("RGB")
return pil_image
to
def decode_base64_to_image(base64_image: str) -> Image.Image:
base64_image = base64_image.split(',', maxsplit=1)[1]
pil_image = Image.open(io.BytesIO(base64.b64decode(base64_image))).convert("RGB")
return pil_image
I encounter this issue with the current version when i tried to decode the output base64 image. This issue does not happen for a previous version (v0.3.30) that I have.
To produce the ERROR:
As i mentioned, the last line does not incur any error but return correct image in the previous version.