Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
861db783
Commit
861db783
authored
Oct 11, 2022
by
brkirch
Committed by
AUTOMATIC1111
Oct 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use apply_hypernetwork function
parent
574c8e55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
sd_hijack_optimizations.py
modules/sd_hijack_optimizations.py
+4
-10
No files found.
modules/sd_hijack_optimizations.py
View file @
861db783
...
...
@@ -202,16 +202,10 @@ def split_cross_attention_forward_invokeAI(self, x, context=None, mask=None):
q
=
self
.
to_q
(
x
)
context
=
default
(
context
,
x
)
hypernetwork
=
shared
.
loaded_hypernetwork
hypernetwork_layers
=
(
hypernetwork
.
layers
if
hypernetwork
is
not
None
else
{})
.
get
(
context
.
shape
[
2
],
None
)
if
hypernetwork_layers
is
not
None
:
k
=
self
.
to_k
(
hypernetwork_layers
[
0
](
context
))
*
self
.
scale
v
=
self
.
to_v
(
hypernetwork_layers
[
1
](
context
))
else
:
k
=
self
.
to_k
(
context
)
*
self
.
scale
v
=
self
.
to_v
(
context
)
del
context
,
x
context_k
,
context_v
=
hypernetwork
.
apply_hypernetwork
(
shared
.
loaded_hypernetwork
,
context
)
k
=
self
.
to_k
(
context_k
)
*
self
.
scale
v
=
self
.
to_v
(
context_v
)
del
context
,
context_k
,
context_v
,
x
q
,
k
,
v
=
map
(
lambda
t
:
rearrange
(
t
,
'b n (h d) -> (b h) n d'
,
h
=
h
),
(
q
,
k
,
v
))
r
=
einsum_op
(
q
,
k
,
v
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment