fix img2img incorrectly loading previous prompt

This commit is contained in:
Lincoln Stein 2022-09-21 15:18:59 -04:00
parent 9b4d328be0
commit 0ab5f2159d
2 changed files with 4 additions and 4 deletions

View File

@ -829,7 +829,6 @@ class Generate:
return model
def _load_img(self, path, width, height, fit=False):
print(f'DEBUG: path = {path}')
assert os.path.exists(path), f'>> {path}: File not found'
# with Image.open(path) as img:

View File

@ -170,9 +170,10 @@ def main_loop(gen, opt, infile):
if opt.init_img:
try:
oldargs = metadata_from_png(opt.init_img)
opt.prompt = oldargs.prompt
print(f'>> Retrieved old prompt "{opt.prompt}" from {opt.init_img}')
if not opt.prompt:
oldargs = metadata_from_png(opt.init_img)
opt.prompt = oldargs.prompt
print(f'>> Retrieved old prompt "{opt.prompt}" from {opt.init_img}')
except AttributeError:
pass
except KeyError: