diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-30 05:47:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-30 05:47:18 +0000 |
commit | 470f184176440525fadd18ec056cb04f60cd30cb (patch) | |
tree | 46b02a22a3c209019a641b0d8c87422d21352797 /modules/hypernetworks | |
parent | 5a6e0cfba675c0f11ade7124cbeec1356c77beb2 (diff) | |
parent | 66d038f6a41507af2243ff1f6618a745a092c290 (diff) | |
download | stable-diffusion-webui-gfx803-470f184176440525fadd18ec056cb04f60cd30cb.tar.gz stable-diffusion-webui-gfx803-470f184176440525fadd18ec056cb04f60cd30cb.tar.bz2 stable-diffusion-webui-gfx803-470f184176440525fadd18ec056cb04f60cd30cb.zip |
Merge pull request #3831 from timntorres/3825-save-hypernet-strength-to-info
Save Hypernetwork strength to infotext.
Diffstat (limited to 'modules/hypernetworks')
-rw-r--r-- | modules/hypernetworks/hypernetwork.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/hypernetworks/hypernetwork.py b/modules/hypernetworks/hypernetwork.py index 2e84583b..5f71b6aa 100644 --- a/modules/hypernetworks/hypernetwork.py +++ b/modules/hypernetworks/hypernetwork.py @@ -209,13 +209,16 @@ def list_hypernetworks(path): res = {}
for filename in glob.iglob(os.path.join(path, '**/*.pt'), recursive=True):
name = os.path.splitext(os.path.basename(filename))[0]
- res[name] = filename
+ # Prevent a hypothetical "None.pt" from being listed.
+ if name != "None":
+ res[name] = filename
return res
def load_hypernetwork(filename):
path = shared.hypernetworks.get(filename, None)
- if path is not None:
+ # Prevent any file named "None.pt" from being loaded.
+ if path is not None and filename != "None":
print(f"Loading hypernetwork {filename}")
try:
shared.loaded_hypernetwork = Hypernetwork()
|