optionally scale initial image to fit box defined by width x height

* This functionality is triggered by the --fit option in the CLI (default
false), and by the "fit" checkbox in the WebGUI (default True)

* In addition, this commit contains a number of whitespace changes to
make the code more readable, as well as an attempt to unify the visual
appearance of info and warning messages.
This commit is contained in:
Lincoln Stein
2022-09-01 00:50:28 -04:00
parent 4b560b50c2
commit 28fe84177e
8 changed files with 232 additions and 182 deletions

View File

@ -88,7 +88,7 @@ def main():
tic = time.time()
t2i.load_model()
print(
f'model loaded in', '%4.2fs' % (time.time() - tic)
f'>> model loaded in', '%4.2fs' % (time.time() - tic)
)
if not infile:
@ -483,6 +483,13 @@ def create_cmd_parser():
type=str,
help='Path to input image for img2img mode (supersedes width and height)',
)
parser.add_argument(
'-T',
'-fit',
'--fit',
action='store_true',
help='If specified, will resize the input image to fit within the dimensions of width x height (512x512 default)',
)
parser.add_argument(
'-f',
'--strength',