Skip to content

Commit 68eabab

Browse files
authored
Deprecate --laion400m and --weights arguments
Removes functionality for the --laion400m and --weights arguments and notifies user to use the --model argument instead.
1 parent a4f69e6 commit 68eabab

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

scripts/dream.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,14 @@ def main():
1919
"""Initialize command-line parsers and the diffusion model"""
2020
arg_parser = create_argv_parser()
2121
opt = arg_parser.parse_args()
22-
"""
22+
2323
if opt.laion400m:
24-
# defaults suitable to the older latent diffusion weights
25-
width = 256
26-
height = 256
27-
config = 'configs/latent-diffusion/txt2img-1p4B-eval.yaml'
28-
weights = 'models/ldm/text2img-large/model.ckpt'
29-
else:
30-
# some defaults suitable for stable diffusion weights
31-
width = 512
32-
height = 512
33-
config = 'configs/stable-diffusion/v1-inference.yaml'
34-
if '.ckpt' in opt.weights:
35-
weights = opt.weights
36-
else:
37-
weights = f'models/ldm/stable-diffusion-v1/{opt.weights}.ckpt'
38-
"""
24+
print('--laion400m flag has been deprecated. Please use --model laion400m instead.')
25+
sys.exit(-1)
26+
if opt.weights != 'model':
27+
print('--weights argument has been deprecated. Please configure /configs/models.yaml, and call it using --model instead.')
28+
sys.exit(-1)
29+
3930
try:
4031
models = OmegaConf.load('configs/models.yaml')
4132
width = models[opt.model].width
@@ -44,6 +35,7 @@ def main():
4435
weights = models[opt.model].weights
4536
except (FileNotFoundError, IOError, KeyError) as e:
4637
print(f'{e}. Aborting.')
38+
sys.exit(-1)
4739

4840
print('* Initializing, be patient...\n')
4941
sys.path.append('.')
@@ -555,4 +547,4 @@ def create_cmd_parser():
555547

556548

557549
if __name__ == '__main__':
558-
main()
550+
main()

0 commit comments

Comments
 (0)