aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_hijack.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-05 02:16:36 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-05 02:16:36 +0300
commitf91d0c3d19ac2b849cd15a519f711f9281e782cd (patch)
treec9aa258638e795f1f7ecdc78079ed2b3c58c98c8 /modules/sd_hijack.py
parenta039878c0f583aab3cd75b32635ef00cd7a5c2b5 (diff)
add an option to enable tiling image generation
Diffstat (limited to 'modules/sd_hijack.py')
-rw-r--r--modules/sd_hijack.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index 1dbdc9ce..9779c30c 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -243,8 +243,13 @@ class EmbeddingsWithFixes(torch.nn.Module):
return inputs_embeds
+def add_circular_option_to_conv_2d():
+ conv2d_constructor = torch.nn.Conv2d.__init__
+ def conv2d_constructor_circular(self, *args, **kwargs):
+ return conv2d_constructor(self, *args, padding_mode='circular', **kwargs)
+ torch.nn.Conv2d.__init__ = conv2d_constructor_circular
model_hijack = StableDiffusionModelHijack()