Skip to content

Commit

Permalink
Merge pull request #856 from Isotr0py/jxl
Browse files Browse the repository at this point in the history
Fix JPEG-XL support
  • Loading branch information
kohya-ss authored Oct 9, 2023
2 parents 8b247a3 + 5920149 commit 5fe52ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,22 @@
except:
pass

# JPEG-XL on Linux
try:
from jxlpy import JXLImagePlugin

IMAGE_EXTENSIONS.extend([".jxl", ".JXL"])
except:
pass

# JPEG-XL on Windows
try:
import pillow_jxl

IMAGE_EXTENSIONS.extend([".jxl", ".JXL"])
except:
pass

IMAGE_TRANSFORMS = transforms.Compose(
[
transforms.ToTensor(),
Expand Down

0 comments on commit 5fe52ed

Please sign in to comment.