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

fix validation image filename only using resolution from first img, and, unreadable/untypeable parenthesis #863

Merged
merged 1 commit into from
Aug 24, 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
10 changes: 9 additions & 1 deletion helpers/training/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,12 +1240,20 @@ def validate_prompt(
def _save_images(self, validation_images, validation_shortname, validation_prompt):
validation_img_idx = 0
for validation_image in validation_images[validation_shortname]:
res = self.validation_resolutions[validation_img_idx]
if "x" in res:
res_label = str(res)
elif type(res) is tuple:
res_label = f"{res[0]}x{res[1]}"
else:
res_label = f"{res}x{res}"
validation_image.save(
os.path.join(
self.save_dir,
f"step_{StateTracker.get_global_step()}_{validation_shortname}_{str(self.validation_resolutions[validation_img_idx])}.png",
f"step_{StateTracker.get_global_step()}_{validation_shortname}_{res_label}.png",
)
)
validation_img_idx += 1

def _log_validations_to_webhook(
self, validation_images, validation_shortname, validation_prompt
Expand Down
Loading