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
694e0b48
"ppocr/vscode:/vscode.git/clone" did not exist on "42d2f7afff4f4657a59bfb7b9a71e250b16f1ed6"
Commit
694e0b48
authored
Jun 12, 2024
by
comfyanonymous
Browse files
SD3 better memory usage estimation.
parent
69c8d6d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
comfy/model_base.py
comfy/model_base.py
+12
-0
No files found.
comfy/model_base.py
View file @
694e0b48
...
...
@@ -578,3 +578,15 @@ class SD3(BaseModel):
if
cross_attn
is
not
None
:
out
[
'c_crossattn'
]
=
comfy
.
conds
.
CONDRegular
(
cross_attn
)
return
out
def
memory_required
(
self
,
input_shape
):
if
comfy
.
model_management
.
xformers_enabled
()
or
comfy
.
model_management
.
pytorch_attention_flash_attention
():
dtype
=
self
.
get_dtype
()
if
self
.
manual_cast_dtype
is
not
None
:
dtype
=
self
.
manual_cast_dtype
#TODO: this probably needs to be tweaked
area
=
input_shape
[
0
]
*
input_shape
[
2
]
*
input_shape
[
3
]
return
(
area
*
comfy
.
model_management
.
dtype_size
(
dtype
)
*
0.012
)
*
(
1024
*
1024
)
else
:
area
=
input_shape
[
0
]
*
input_shape
[
2
]
*
input_shape
[
3
]
return
(
area
*
0.3
)
*
(
1024
*
1024
)
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