From: Christian Heller Date: Mon, 19 Aug 2024 22:08:40 +0000 (+0200) Subject: Postpone overhead-y import until after validating/parsing parameters. X-Git-Url: https://plomlompom.com/repos/te"st.html?a=commitdiff_plain;h=a51b66b72894a00ea31321bc5330719d5fbef103;p=stable_plom Postpone overhead-y import until after validating/parsing parameters. --- diff --git a/stable.py b/stable.py index cdd6667..634add3 100755 --- a/stable.py +++ b/stable.py @@ -3,7 +3,6 @@ from sys import argv, exit as sys_exit from os.path import dirname, basename, splitext, join as path_join, exists from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from random import randint -from stable.core import ImageMaker DEFAULT_SCHEDULER = 'EulerAncestralDiscreteScheduler' @@ -15,7 +14,8 @@ def save_path(count: int) -> str: def parse_args(): - parser = ArgumentParser(add_help=False, formatter_class=ArgumentDefaultsHelpFormatter) + parser = ArgumentParser(add_help=False, + formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('-m', '--model', help='model filename (-P will pre prefixed, but may ' 'also be full path on its own)') @@ -88,6 +88,8 @@ def parse_args(): args = parse_args() +# pylint: disable=wrong-import-position +from stable.core import ImageMaker # noqa: E402 model_path = f'{args.model_path_prefix}{args.model}' if args.list_schedulers: maker = ImageMaker(model_path)