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
c71008c7
Commit
c71008c7
authored
Oct 17, 2022
by
C43H66N12O12S2
Committed by
AUTOMATIC1111
Oct 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sd_hijack_optimizations.py
parent
73b5dbf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
sd_hijack_optimizations.py
modules/sd_hijack_optimizations.py
+3
-0
No files found.
modules/sd_hijack_optimizations.py
View file @
c71008c7
...
@@ -301,6 +301,9 @@ def xformers_attnblock_forward(self, x):
...
@@ -301,6 +301,9 @@ def xformers_attnblock_forward(self, x):
v
=
self
.
v
(
h_
)
v
=
self
.
v
(
h_
)
b
,
c
,
h
,
w
=
q
.
shape
b
,
c
,
h
,
w
=
q
.
shape
q
,
k
,
v
=
map
(
lambda
t
:
rearrange
(
t
,
'b c h w -> b (h w) c'
),
(
q
,
k
,
v
))
q
,
k
,
v
=
map
(
lambda
t
:
rearrange
(
t
,
'b c h w -> b (h w) c'
),
(
q
,
k
,
v
))
q
=
q
.
contiguous
()
k
=
k
.
contiguous
()
v
=
v
.
contiguous
()
out
=
xformers
.
ops
.
memory_efficient_attention
(
q
,
k
,
v
)
out
=
xformers
.
ops
.
memory_efficient_attention
(
q
,
k
,
v
)
out
=
rearrange
(
out
,
'b (h w) c -> b c h w'
,
h
=
h
)
out
=
rearrange
(
out
,
'b (h w) c -> b c h w'
,
h
=
h
)
out
=
self
.
proj_out
(
out
)
out
=
self
.
proj_out
(
out
)
...
...
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