Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
98f828fa
Commit
98f828fa
authored
May 18, 2024
by
comfyanonymous
Browse files
Remove unnecessary code.
parent
1c4af591
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
10 deletions
+2
-10
comfy/ldm/modules/attention.py
comfy/ldm/modules/attention.py
+2
-9
comfy/ldm/modules/diffusionmodules/model.py
comfy/ldm/modules/diffusionmodules/model.py
+0
-1
No files found.
comfy/ldm/modules/attention.py
View file @
98f828fa
...
@@ -318,11 +318,7 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None):
...
@@ -318,11 +318,7 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None):
return
attention_pytorch
(
q
,
k
,
v
,
heads
,
mask
)
return
attention_pytorch
(
q
,
k
,
v
,
heads
,
mask
)
q
,
k
,
v
=
map
(
q
,
k
,
v
=
map
(
lambda
t
:
t
.
unsqueeze
(
3
)
lambda
t
:
t
.
reshape
(
b
,
-
1
,
heads
,
dim_head
),
.
reshape
(
b
,
-
1
,
heads
,
dim_head
)
.
permute
(
0
,
2
,
1
,
3
)
.
reshape
(
b
*
heads
,
-
1
,
dim_head
)
.
contiguous
(),
(
q
,
k
,
v
),
(
q
,
k
,
v
),
)
)
...
@@ -335,10 +331,7 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None):
...
@@ -335,10 +331,7 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None):
out
=
xformers
.
ops
.
memory_efficient_attention
(
q
,
k
,
v
,
attn_bias
=
mask
)
out
=
xformers
.
ops
.
memory_efficient_attention
(
q
,
k
,
v
,
attn_bias
=
mask
)
out
=
(
out
=
(
out
.
unsqueeze
(
0
)
out
.
reshape
(
b
,
-
1
,
heads
*
dim_head
)
.
reshape
(
b
,
heads
,
-
1
,
dim_head
)
.
permute
(
0
,
2
,
1
,
3
)
.
reshape
(
b
,
-
1
,
heads
*
dim_head
)
)
)
return
out
return
out
...
...
comfy/ldm/modules/diffusionmodules/model.py
View file @
98f828fa
...
@@ -3,7 +3,6 @@ import math
...
@@ -3,7 +3,6 @@ import math
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
numpy
as
np
import
numpy
as
np
from
einops
import
rearrange
from
typing
import
Optional
,
Any
from
typing
import
Optional
,
Any
import
logging
import
logging
...
...
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