diff --git a/library/train_util.py b/library/train_util.py index 5433357ac..51610e700 100644 --- a/library/train_util.py +++ b/library/train_util.py @@ -96,6 +96,7 @@ except: pass +# JPEG-XL on Linux try: from jxlpy import JXLImagePlugin @@ -103,6 +104,14 @@ except: pass +# JPEG-XL on Windows +try: + import pillow_jxl + + IMAGE_EXTENSIONS.extend([".jxl", ".JXL"]) +except: + pass + IMAGE_TRANSFORMS = transforms.Compose( [ transforms.ToTensor(), diff --git a/train_network.py b/train_network.py index 99179814c..2232a384a 100644 --- a/train_network.py +++ b/train_network.py @@ -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,