aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hypernetworks/hypernetwork.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-02-19 09:30:58 +0000
committerGitHub <noreply@github.com>2023-02-19 09:30:58 +0000
commitcfc9849f3f64977936769b6479d6b2231ecbfc5b (patch)
tree51b29ea3b255fe43b0fe7560f9f7fdd23a475427 /modules/hypernetworks/hypernetwork.py
parent5afd9e82c3829348c58803cd85b02c87308fffae (diff)
parentd99bd04b3f8c7753e31aa6dea6109785c4bb92c9 (diff)
downloadstable-diffusion-webui-gfx803-cfc9849f3f64977936769b6479d6b2231ecbfc5b.tar.gz
stable-diffusion-webui-gfx803-cfc9849f3f64977936769b6479d6b2231ecbfc5b.tar.bz2
stable-diffusion-webui-gfx803-cfc9849f3f64977936769b6479d6b2231ecbfc5b.zip
Merge branch 'master' into 6866-fix-hires-prompt-matrix
Diffstat (limited to 'modules/hypernetworks/hypernetwork.py')
-rw-r--r--modules/hypernetworks/hypernetwork.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/hypernetworks/hypernetwork.py b/modules/hypernetworks/hypernetwork.py
index 503534e2..a15bae18 100644
--- a/modules/hypernetworks/hypernetwork.py
+++ b/modules/hypernetworks/hypernetwork.py
@@ -307,7 +307,7 @@ class Hypernetwork:
def shorthash(self):
sha256 = hashes.sha256(self.filename, f'hypernet/{self.name}')
- return sha256[0:10]
+ return sha256[0:10] if sha256 else None
def list_hypernetworks(path):
@@ -380,8 +380,8 @@ def apply_single_hypernetwork(hypernetwork, context_k, context_v, layer=None):
layer.hyper_k = hypernetwork_layers[0]
layer.hyper_v = hypernetwork_layers[1]
- context_k = hypernetwork_layers[0](context_k)
- context_v = hypernetwork_layers[1](context_v)
+ context_k = devices.cond_cast_unet(hypernetwork_layers[0](devices.cond_cast_float(context_k)))
+ context_v = devices.cond_cast_unet(hypernetwork_layers[1](devices.cond_cast_float(context_v)))
return context_k, context_v