fix caption cog plugin for image json reading

This commit is contained in:
Victor Hall 2024-03-13 18:26:13 -04:00
parent 80a6672b41
commit 1cf110c6a5
1 changed files with 1 additions and 2 deletions

View File

@ -200,10 +200,9 @@ class TitleAndTagsFromFolderImageJson(PromptIdentityPlugin):
image_path_base = os.path.basename(image_path)
image_path_without_extension = os.path.splitext(image_path_base)[0]
candidate_json_path = os.path.join(current_dir, f"{image_path_without_extension}.json")
metadata_json_path = os.path.join(current_dir, "metadata.json")
if os.path.exists(candidate_json_path):
with open(metadata_json_path, "r") as f:
with open(candidate_json_path, "r") as f:
metadata = json.load(f)
title = metadata.get("title", "").strip()