Skip to content

Commit

Permalink
Merge pull request #339 from yak1ex/fix_jpeg_support
Browse files Browse the repository at this point in the history
Fix JPEG support
  • Loading branch information
mrhan1993 committed May 25, 2024
2 parents d483316 + f48b92a commit d59fdc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fooocusapi/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def save_output_file(

if extension not in ['png', 'jpg', 'webp']:
extension = 'png'
image_format = Image.registered_extensions()['.'+extension]

if image_meta is None:
image_meta = {}
Expand All @@ -64,7 +65,7 @@ def save_output_file(
os.makedirs(os.path.dirname(file_path), exist_ok=True)
Image.fromarray(img).save(
file_path,
format=extension,
format=image_format,
pnginfo=meta,
optimize=True)
return Path(filename).as_posix()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ transformers==4.30.2
safetensors==0.3.1
accelerate==0.21.0
pyyaml==6.0
Pillow==9.2.0
Pillow==9.4.0
scipy==1.9.3
tqdm==4.64.1
psutil==5.9.5
Expand Down

0 comments on commit d59fdc4

Please sign in to comment.