change source of step count

This commit is contained in:
DepFA 2022-10-09 22:17:02 +01:00 committed by GitHub
parent 96f1e6be59
commit 01fd9cf0d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -285,15 +285,9 @@ def train_embedding(embedding_name, learn_rate, data_root, log_directory, steps,
info.add_text("sd-ti-embedding", embeddingToB64(data)) info.add_text("sd-ti-embedding", embeddingToB64(data))
pre_lines = [((255, 207, 175),"<{}>".format(data.get('name','???')))] pre_lines = [((255, 207, 175),"<{}>".format(data.get('name','???')))]
checkpoint = sd_models.select_checkpoint() checkpoint = sd_models.select_checkpoint()
caption_checkpoint_hash = checkpoint.hash post_lines = [((240, 223, 175),"Trained against checkpoint [{}] for {} steps".format(checkpoint.hash,
embedding.step))]
caption_stepcount = data.get('step',0)
caption_stepcount = caption_stepcount if caption_stepcount else 0
post_lines = [((240, 223, 175),"Trained against checkpoint [{}] for {} steps".format(caption_checkpoint_hash,
caption_stepcount))]
captioned_image = captionImge(image,prelines=pre_lines,postlines=post_lines) captioned_image = captionImge(image,prelines=pre_lines,postlines=post_lines)
captioned_image.save(last_saved_image, "PNG", pnginfo=info) captioned_image.save(last_saved_image, "PNG", pnginfo=info)
else: else: