aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hypernetworks/hypernetwork.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-27 08:25:55 +0000
committerGitHub <noreply@github.com>2023-06-27 08:25:55 +0000
commit1bf01b73f478fd98d670fc3e44ffd7c71e531b0a (patch)
tree548b90c6a385897407209bd0b0bf0d4c7d54303d /modules/hypernetworks/hypernetwork.py
parentd06af4e517865277d0521642c2c5513af9afd76f (diff)
parentba70a220e3176153ba2a559acb9e5aa692dce7ca (diff)
downloadstable-diffusion-webui-gfx803-1bf01b73f478fd98d670fc3e44ffd7c71e531b0a.tar.gz
stable-diffusion-webui-gfx803-1bf01b73f478fd98d670fc3e44ffd7c71e531b0a.tar.bz2
stable-diffusion-webui-gfx803-1bf01b73f478fd98d670fc3e44ffd7c71e531b0a.zip
Merge pull request #11046 from akx/ded-code
Remove a bunch of unused/vestigial code
Diffstat (limited to 'modules/hypernetworks/hypernetwork.py')
-rw-r--r--modules/hypernetworks/hypernetwork.py24
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()