include width and height in png dream prompt

This commit is contained in:
Lincoln Stein 2022-09-17 01:14:00 -04:00
parent b89aadb3c9
commit 5b692f4720

7
scripts/dream.py Normal file → Executable file
View File

@ -100,6 +100,7 @@ def main_loop(gen, opt, infile):
done = False done = False
path_filter = re.compile(r'[<>:"/\\|?*]') path_filter = re.compile(r'[<>:"/\\|?*]')
last_results = list() last_results = list()
model_config = OmegaConf.load(opt.conf)[opt.model]
# os.pathconf is not available on Windows # os.pathconf is not available on Windows
if hasattr(os, 'pathconf'): if hasattr(os, 'pathconf'):
@ -138,6 +139,12 @@ def main_loop(gen, opt, infile):
print('\nTry again with a prompt!') print('\nTry again with a prompt!')
continue continue
# width and height are set by model if not specified
if not opt.width:
opt.width = model_config.width
if not opt.height:
opt.height = model_config.height
# retrieve previous value! # retrieve previous value!
if opt.init_img is not None and re.match('^-\\d+$', opt.init_img): if opt.init_img is not None and re.match('^-\\d+$', opt.init_img):
try: try: