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
a5056cfb
Commit
a5056cfb
authored
Dec 15, 2023
by
comfyanonymous
Browse files
Remove useless code.
parent
b12b48e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
comfy/ldm/modules/attention.py
comfy/ldm/modules/attention.py
+1
-3
comfy_extras/nodes_sag.py
comfy_extras/nodes_sag.py
+1
-3
No files found.
comfy/ldm/modules/attention.py
View file @
a5056cfb
...
@@ -104,9 +104,7 @@ def attention_basic(q, k, v, heads, mask=None):
...
@@ -104,9 +104,7 @@ def attention_basic(q, k, v, heads, mask=None):
# force cast to fp32 to avoid overflowing
# force cast to fp32 to avoid overflowing
if
_ATTN_PRECISION
==
"fp32"
:
if
_ATTN_PRECISION
==
"fp32"
:
with
torch
.
autocast
(
enabled
=
False
,
device_type
=
'cuda'
):
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
.
float
(),
k
.
float
())
*
scale
q
,
k
=
q
.
float
(),
k
.
float
()
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
,
k
)
*
scale
else
:
else
:
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
,
k
)
*
scale
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
,
k
)
*
scale
...
...
comfy_extras/nodes_sag.py
View file @
a5056cfb
...
@@ -27,9 +27,7 @@ def attention_basic_with_sim(q, k, v, heads, mask=None):
...
@@ -27,9 +27,7 @@ def attention_basic_with_sim(q, k, v, heads, mask=None):
# force cast to fp32 to avoid overflowing
# force cast to fp32 to avoid overflowing
if
_ATTN_PRECISION
==
"fp32"
:
if
_ATTN_PRECISION
==
"fp32"
:
with
torch
.
autocast
(
enabled
=
False
,
device_type
=
'cuda'
):
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
.
float
(),
k
.
float
())
*
scale
q
,
k
=
q
.
float
(),
k
.
float
()
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
,
k
)
*
scale
else
:
else
:
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
,
k
)
*
scale
sim
=
einsum
(
'b i d, b j d -> b i j'
,
q
,
k
)
*
scale
...
...
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