diff options
author | DepFA <35278260+dfaker@users.noreply.github.com> | 2022-10-09 21:02:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 21:02:28 +0000 |
commit | 969bd8256e5b4f1007d3cc653723d4ad50a92528 (patch) | |
tree | b5b89380fa1d74aa4427a113e6fa03e20bbc78ea /modules/textual_inversion/textual_inversion.py | |
parent | 03694e1f9915e34cf7d9a31073f1a1a9def2909f (diff) | |
download | stable-diffusion-webui-gfx803-969bd8256e5b4f1007d3cc653723d4ad50a92528.tar.gz stable-diffusion-webui-gfx803-969bd8256e5b4f1007d3cc653723d4ad50a92528.tar.bz2 stable-diffusion-webui-gfx803-969bd8256e5b4f1007d3cc653723d4ad50a92528.zip |
add alternate checkpoint hash source
Diffstat (limited to 'modules/textual_inversion/textual_inversion.py')
-rw-r--r-- | modules/textual_inversion/textual_inversion.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/textual_inversion/textual_inversion.py b/modules/textual_inversion/textual_inversion.py index 1b7f8906..d7813084 100644 --- a/modules/textual_inversion/textual_inversion.py +++ b/modules/textual_inversion/textual_inversion.py @@ -265,8 +265,11 @@ def train_embedding(embedding_name, learn_rate, data_root, log_directory, steps, pre_lines = [((255, 207, 175),"<{}>".format(data.get('name','???')))]
- caption_checkpoint_hash = data.get('sd_checkpoint','UNK')
- caption_checkpoint_hash = caption_checkpoint_hash.upper() if caption_checkpoint_hash else 'UNK'
+ caption_checkpoint_hash = data.get('sd_checkpoint')
+ if caption_checkpoint_hash is None:
+ caption_checkpoint_hash = data.get('hash')
+ caption_checkpoint_hash = caption_checkpoint_hash.upper() if caption_checkpoint_hash else 'UNKNOWN'
+
caption_stepcount = data.get('step',0)
caption_stepcount = caption_stepcount if caption_stepcount else 0
|