@@ -463,7 +463,10 @@ def create_network(
463463 conv_alpha = kwargs .get ("conv_alpha" , None )
464464 if conv_dim is not None :
465465 conv_dim = int (conv_dim )
466- if conv_alpha is None :
466+ if conv_dim == 0 :
467+ conv_dim = None
468+ conv_alpha = None
469+ elif conv_alpha is None :
467470 conv_alpha = 1.0
468471 else :
469472 conv_alpha = float (conv_alpha )
@@ -834,7 +837,7 @@ def __init__(
834837 else :
835838 logger .info (f"create LoRA network. base dim (rank): { lora_dim } , alpha: { alpha } " )
836839 logger .info (f"neuron dropout: p={ self .dropout } , rank dropout: p={ self .rank_dropout } , module dropout: p={ self .module_dropout } " )
837- if self .conv_lora_dim is not None :
840+ if self .conv_lora_dim is not None and self . conv_lora_dim != 0 :
838841 logger .info (f"apply LoRA to Conv2d with kernel size (3,3). dim (rank): { self .conv_lora_dim } , alpha: { self .conv_alpha } " )
839842
840843 # create module instances
@@ -934,7 +937,7 @@ def create_modules(
934937
935938 # extend U-Net target modules if conv2d 3x3 is enabled, or load from weights
936939 target_modules = LoRANetwork .UNET_TARGET_REPLACE_MODULE
937- if modules_dim is not None or self .conv_lora_dim is not None or conv_block_dims is not None :
940+ if modules_dim is not None or ( self .conv_lora_dim is not None and self . conv_lora_dim != 0 ) or conv_block_dims is not None :
938941 target_modules += LoRANetwork .UNET_TARGET_REPLACE_MODULE_CONV2D_3X3
939942
940943 self .unet_loras , skipped_un = create_modules (True , None , unet , target_modules )
0 commit comments