Skip to content

Commit

Permalink
Merge pull request #865 from kohya-ss/dev
Browse files Browse the repository at this point in the history
Support JPEG-XL on windows, dropout for LyCORIS
  • Loading branch information
kohya-ss authored Oct 9, 2023
2 parents 8b247a3 + 8a7509d commit 0faa350
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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
5 changes: 4 additions & 1 deletion train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ def train(self, args):
if args.dim_from_weights:
network, _ = network_module.create_network_from_weights(1, args.network_weights, vae, text_encoder, unet, **net_kwargs)
else:
# LyCORIS will work with this...
if "dropout" not in net_kwargs:
# workaround for LyCORIS (;^ω^)
net_kwargs["dropout"] = args.network_dropout

network = network_module.create_network(
1.0,
args.network_dim,
Expand Down

0 comments on commit 0faa350

Please sign in to comment.