Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
konieshadow committed Dec 22, 2023
2 parents 1431422 + 49639d6 commit 5efa725
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fooocusapi/img_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def read_input_image(input_image: UploadFile) -> np.ndarray:
return image

def base64_to_stream(image: str) -> UploadFile:
if image.startswith('data:image'):
image = image.split(sep=',', maxsplit=1)[1]
image_bytes = base64.b64decode(image)
byte_stream = BytesIO()
byte_stream.write(image_bytes)
Expand Down

0 comments on commit 5efa725

Please sign in to comment.