diff options
author | Aarni Koskela <akx@iki.fi> | 2023-06-05 19:20:29 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-06-05 19:43:57 +0000 |
commit | ba70a220e3176153ba2a559acb9e5aa692dce7ca (patch) | |
tree | 9db9f6cb0aaad717b01e3a8cd2a5c134ea4b30e2 /modules/hypernetworks/hypernetwork.py | |
parent | 0895c2369cdb795acd0de072acf426c4b54fedc5 (diff) | |
download | stable-diffusion-webui-gfx803-ba70a220e3176153ba2a559acb9e5aa692dce7ca.tar.gz stable-diffusion-webui-gfx803-ba70a220e3176153ba2a559acb9e5aa692dce7ca.tar.bz2 stable-diffusion-webui-gfx803-ba70a220e3176153ba2a559acb9e5aa692dce7ca.zip |
Remove a bunch of unused/vestigial code
As found by Vulture and some eyes
Diffstat (limited to 'modules/hypernetworks/hypernetwork.py')
-rw-r--r-- | modules/hypernetworks/hypernetwork.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/modules/hypernetworks/hypernetwork.py b/modules/hypernetworks/hypernetwork.py index 5d12b449..51941c11 100644 --- a/modules/hypernetworks/hypernetwork.py +++ b/modules/hypernetworks/hypernetwork.py @@ -353,17 +353,6 @@ def load_hypernetworks(names, multipliers=None): shared.loaded_hypernetworks.append(hypernetwork)
-def find_closest_hypernetwork_name(search: str):
- if not search:
- return None
- search = search.lower()
- applicable = [name for name in shared.hypernetworks if search in name.lower()]
- if not applicable:
- return None
- applicable = sorted(applicable, key=lambda name: len(name))
- return applicable[0]
-
-
def apply_single_hypernetwork(hypernetwork, context_k, context_v, layer=None):
hypernetwork_layers = (hypernetwork.layers if hypernetwork is not None else {}).get(context_k.shape[2], None)
@@ -446,18 +435,6 @@ def statistics(data): return total_information, recent_information
-def report_statistics(loss_info:dict):
- keys = sorted(loss_info.keys(), key=lambda x: sum(loss_info[x]) / len(loss_info[x]))
- for key in keys:
- try:
- print("Loss statistics for file " + key)
- info, recent = statistics(list(loss_info[key]))
- print(info)
- print(recent)
- except Exception as e:
- print(e)
-
-
def create_hypernetwork(name, enable_sizes, overwrite_old, layer_structure=None, activation_func=None, weight_init=None, add_layer_norm=False, use_dropout=False, dropout_structure=None):
# Remove illegal characters from name.
name = "".join( x for x in name if (x.isalnum() or x in "._- "))
@@ -770,7 +747,6 @@ Last saved image: {html.escape(last_saved_image)}<br/> pbar.leave = False
pbar.close()
hypernetwork.eval()
- #report_statistics(loss_dict)
sd_hijack_checkpoint.remove()
|