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
c9daec4c
"docs/references/multi_node_deployment/deploy_on_k8s.md" did not exist on "e8e18dcdcca0e6d4eacccd074bea9da2ad6a3e18"
Commit
c9daec4c
authored
Feb 21, 2023
by
comfyanonymous
Browse files
Remove prints that are useless when xformers is enabled.
parent
a7328e49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
comfy/ldm/modules/attention.py
comfy/ldm/modules/attention.py
+8
-9
No files found.
comfy/ldm/modules/attention.py
View file @
c9daec4c
...
...
@@ -343,7 +343,7 @@ class CrossAttentionDoggettx(nn.Module):
return
self
.
to_out
(
r2
)
class
Original
CrossAttention
(
nn
.
Module
):
class
CrossAttention
(
nn
.
Module
):
def
__init__
(
self
,
query_dim
,
context_dim
=
None
,
heads
=
8
,
dim_head
=
64
,
dropout
=
0.
):
super
().
__init__
()
inner_dim
=
dim_head
*
heads
...
...
@@ -395,14 +395,13 @@ class OriginalCrossAttention(nn.Module):
return
self
.
to_out
(
out
)
import
sys
if
"--use-split-cross-attention"
in
sys
.
argv
:
if
XFORMERS_IS_AVAILBLE
==
False
:
if
"--use-split-cross-attention"
in
sys
.
argv
:
print
(
"Using split optimization for cross attention"
)
class
CrossAttention
(
CrossAttentionDoggettx
):
pass
else
:
CrossAttention
=
CrossAttentionDoggettx
else
:
print
(
"Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention"
)
class
CrossAttention
(
CrossAttentionBirchSan
):
pass
CrossAttention
=
CrossAttentionBirchSan
class
MemoryEfficientCrossAttention
(
nn
.
Module
):
# https://github.com/MatthieuTPHR/diffusers/blob/d80b531ff8060ec1ea982b65a1b8df70f73aa67c/src/diffusers/models/attention.py#L223
...
...
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