File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
invokeai/backend/stable_diffusion/extensions Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ def static_patch_model(
37
37
yield
38
38
return
39
39
40
+ x_mode = "circular" if "x" in seamless_axes else "constant"
41
+ y_mode = "circular" if "y" in seamless_axes else "constant"
42
+
40
43
# override conv_forward
41
44
# https://github.com/huggingface/diffusers/issues/556#issuecomment-1993287019
42
45
def _conv_forward_asymmetric (
@@ -51,18 +54,11 @@ def _conv_forward_asymmetric(
51
54
)
52
55
53
56
original_layers : List [Tuple [nn .Conv2d , Callable ]] = []
54
-
55
57
try :
56
- x_mode = "circular" if "x" in seamless_axes else "constant"
57
- y_mode = "circular" if "y" in seamless_axes else "constant"
58
-
59
- conv_layers : List [torch .nn .Conv2d ] = []
60
-
61
- for module in model .modules ():
62
- if isinstance (module , torch .nn .Conv2d ):
63
- conv_layers .append (module )
58
+ for layer in model .modules ():
59
+ if not isinstance (layer , torch .nn .Conv2d ):
60
+ continue
64
61
65
- for layer in conv_layers :
66
62
if isinstance (layer , LoRACompatibleConv ) and layer .lora_layer is None :
67
63
layer .lora_layer = lambda * x : 0
68
64
original_layers .append ((layer , layer ._conv_forward ))
You can’t perform that action at this time.
0 commit comments