From 450630c6bda18026c6017df088a8d73f89f67a60 Mon Sep 17 00:00:00 2001 From: Kohya S Date: Tue, 29 Jul 2025 20:32:24 +0900 Subject: [PATCH] fix: create network from weights not working --- networks/lora_flux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/networks/lora_flux.py b/networks/lora_flux.py index 320bc463..e9ad5f68 100644 --- a/networks/lora_flux.py +++ b/networks/lora_flux.py @@ -841,8 +841,8 @@ class LoRANetwork(torch.nn.Module): logger.info(f"LoRA {lora_name} matched with regex {reg}, using dim: {dim}") break - # 通常、すべて対象とする - if dim is None: + # if modules_dim is None, we use default lora_dim. if modules_dim is not None, we use the specified dim (no default) + if dim is None and modules_dim is None: if is_linear or is_conv2d_1x1: dim = default_dim if default_dim is not None else self.lora_dim alpha = self.alpha