Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing ckpt_name includes subfolder path, issue #36 #38

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions save_image_extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,19 @@ def find_keys_recursively(self, prompt={}, keys_to_find=[], found_values={}):
for key, value in prompt.items():
if key in keys_to_find:
# print(f"debug find_keys_recursively: found key={key}")
if key == 'ckpt_name' and 'ckpt_path' in keys_to_find:
if key == 'ckpt_name':
value_path = Path(value)
found_values['ckpt_path'] = self.cleanup_fileName(str(value_path.parent))
if 'ckpt_path' in keys_to_find:
found_values['ckpt_path'] = self.cleanup_fileName(str(value_path.parent))
else:
found_values['ckpt_name'] = self.cleanup_fileName(str(value_path.name))
# print(f"debug find_keys_recursively: ckpt_name={value_path.name} ckpt_path={str(value_path.parent)}")
elif key == 'control_net_name' and 'control_net_path' in keys_to_find:
elif key == 'control_net_name':
value_path = Path(value)
found_values['control_net_path'] = self.cleanup_fileName(str(value_path.parent))
if 'control_net_path' in keys_to_find:
found_values['control_net_path'] = self.cleanup_fileName(str(value_path.parent))
else:
found_values['control_net_name'] = self.cleanup_fileName(str(value_path.name))
else:
found_values[key] = self.cleanup_fileName(value)
elif isinstance(value, dict):
Expand Down