fix outcropping crash when png has no InvokeAI metadata

- Closes #1461
This commit is contained in:
Lincoln Stein 2022-11-21 07:15:56 +00:00
parent c5cbe8f87d
commit 8e81425e89
2 changed files with 2 additions and 2 deletions

View File

@ -1092,7 +1092,7 @@ def metadata_from_png(png_file_path) -> Args:
returns a single Args object, not multiple.
'''
args_list = args_from_png(png_file_path)
return args_list[0]
return args_list[0] if len(args_list)>0 else Args() # empty args
def dream_cmd_from_png(png_file_path):
opt = metadata_from_png(png_file_path)

View File

@ -28,7 +28,7 @@ class Outcrop(object):
self.generate._set_sampler()
def wrapped_callback(img,seed,**kwargs):
preferred_seed = orig_opt.seed if orig_opt.seed >= 0 else seed
preferred_seed = orig_opt.seed if orig_opt.seed is not None and orig_opt.seed >= 0 else seed
image_callback(img,preferred_seed,use_prefix=prefix,**kwargs)
result= self.generate.prompt2image(