Skip to content

Commit

Permalink
Fixed bug: in-painted image overwritten with original
Browse files Browse the repository at this point in the history
  • Loading branch information
kraussian committed Jul 27, 2024
1 parent 06f60c7 commit e4a5a9d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ def main() -> None:
org_filename = json_data['_canvas_objects'][0]['imageName']
org_filepath = os.path.join(invokeai_cfg['invokeai_output_folder'], org_filename)
if os.path.exists(org_filepath):
im_invoke = Image.open(org_filepath)
im_invoke.load()
json_data = json.loads(im_invoke.info['invokeai_metadata'])
im_original = Image.open(org_filepath)
im_original.load()
json_data = json.loads(im_original.info['invokeai_metadata'])
del im_original
else:
print(f" ERROR: Original image {org_filename} not found! Skipping file...")
continue
Expand Down

0 comments on commit e4a5a9d

Please sign in to comment.