diff options
author | Bernard Maltais <bmaltais@gmail.com> | 2022-09-28 02:16:25 +0000 |
---|---|---|
committer | Bernard Maltais <bmaltais@gmail.com> | 2022-09-28 02:16:25 +0000 |
commit | 4c9c2a67028097dd41a46d6b6fa52d7831e359bf (patch) | |
tree | 6d17db374740cac93ec6c167480578e176ddbc92 /modules/extras.py | |
parent | 8c48ede135586a3473e4252d166931cefe64aafb (diff) | |
download | stable-diffusion-webui-gfx803-4c9c2a67028097dd41a46d6b6fa52d7831e359bf.tar.gz stable-diffusion-webui-gfx803-4c9c2a67028097dd41a46d6b6fa52d7831e359bf.tar.bz2 stable-diffusion-webui-gfx803-4c9c2a67028097dd41a46d6b6fa52d7831e359bf.zip |
-Fix interp_amount rounding in filename
-Sort list of checkpoints in list
Diffstat (limited to 'modules/extras.py')
-rw-r--r-- | modules/extras.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/extras.py b/modules/extras.py index f6704382..b8ebc619 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -186,9 +186,9 @@ def run_modelmerger(primary_model_name, secondary_model_name, interp_method, int if 'model' in key and key not in theta_0:
theta_0[key] = theta_1[key]
- output_modelname = 'models/' + primary_model_name + '_' + str(interp_amount) + '-' + secondary_model_name + '_' + str(float(1.0) - interp_amount) + '-' + interp_method.replace(" ", "_") + '-merged.ckpt'
+ output_modelname = 'models/' + primary_model_name + '_' + str(round(interp_amount,2)) + '-' + secondary_model_name + '_' + str(round((float(1.0) - interp_amount),2)) + '-' + interp_method.replace(" ", "_") + '-merged.ckpt'
print(f"Saving to {output_modelname}...")
torch.save(primary_model, output_modelname)
print(f"Checkpoint saved.")
- return "Checkpoint saved to " + output_modelname
+ return "Checkpoint saved to " + output_modelname
\ No newline at end of file |