From 68eabab2af13658e2de0d748a5839a6acdc29b19 Mon Sep 17 00:00:00 2001 From: David Wager Date: Thu, 1 Sep 2022 20:46:53 +0100 Subject: [PATCH] Deprecate --laion400m and --weights arguments Removes functionality for the --laion400m and --weights arguments and notifies user to use the --model argument instead. --- scripts/dream.py | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/scripts/dream.py b/scripts/dream.py index 37ad78ec31..0c0e1e7e6e 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -19,23 +19,14 @@ def main(): """Initialize command-line parsers and the diffusion model""" arg_parser = create_argv_parser() opt = arg_parser.parse_args() - """ + if opt.laion400m: - # defaults suitable to the older latent diffusion weights - width = 256 - height = 256 - config = 'configs/latent-diffusion/txt2img-1p4B-eval.yaml' - weights = 'models/ldm/text2img-large/model.ckpt' - else: - # some defaults suitable for stable diffusion weights - width = 512 - height = 512 - config = 'configs/stable-diffusion/v1-inference.yaml' - if '.ckpt' in opt.weights: - weights = opt.weights - else: - weights = f'models/ldm/stable-diffusion-v1/{opt.weights}.ckpt' - """ + print('--laion400m flag has been deprecated. Please use --model laion400m instead.') + sys.exit(-1) + if opt.weights != 'model': + print('--weights argument has been deprecated. Please configure /configs/models.yaml, and call it using --model instead.') + sys.exit(-1) + try: models = OmegaConf.load('configs/models.yaml') width = models[opt.model].width @@ -44,6 +35,7 @@ def main(): weights = models[opt.model].weights except (FileNotFoundError, IOError, KeyError) as e: print(f'{e}. Aborting.') + sys.exit(-1) print('* Initializing, be patient...\n') sys.path.append('.') @@ -555,4 +547,4 @@ def create_cmd_parser(): if __name__ == '__main__': - main() \ No newline at end of file + main()