Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiling parameter #911

Merged
merged 2 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/relauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# Creates a public xxxxx.gradio.app share link to allow others to use your interface (requires properly forwarded ports to work correctly)
share = False

# Generate tiling images
tiling = False

# Enter other `--arguments` you wish to use - Must be entered as a `--argument ` syntax
additional_arguments = ""
Expand All @@ -37,6 +39,8 @@
common_arguments += "--optimized-turbo "
if optimized == True:
common_arguments += "--optimized "
if tiling == True:
common_arguments += "--tiling "
if share == True:
common_arguments += "--share "

Expand Down
13 changes: 13 additions & 0 deletions scripts/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
parser.add_argument("--skip-save", action='store_true', help="do not save indiviual samples. For speed measurements.", default=False)
parser.add_argument('--no-job-manager', action='store_true', help="Don't use the experimental job manager on top of gradio", default=False)
parser.add_argument("--max-jobs", type=int, help="Maximum number of concurrent 'generate' commands", default=1)
parser.add_argument("--tiling", action='store_true', help="Generate tiling images", default=False)
opt = parser.parse_args()

#Should not be needed anymore
Expand Down Expand Up @@ -86,6 +87,18 @@
from ldm.models.diffusion.plms import PLMSSampler
from ldm.util import instantiate_from_config

# add global options to models
def patch_conv(**patch):
cls = torch.nn.Conv2d
init = cls.__init__
def __init__(self, *args, **kwargs):
return init(self, *args, **kwargs, **patch)
cls.__init__ = __init__

if opt.tiling:
patch_conv(padding_mode='circular')
print("patched for tiling")

try:
# this silences the annoying "Some weights of the model checkpoint were not used when initializing..." message at start.

Expand Down