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
6a32c06f
Commit
6a32c06f
authored
Mar 23, 2024
by
comfyanonymous
Browse files
Move cleanup_models to improve performance.
parent
a28a9dc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
1 deletion
+1
-1
execution.py
execution.py
+0
-1
main.py
main.py
+1
-0
No files found.
execution.py
View file @
6a32c06f
...
...
@@ -368,7 +368,6 @@ class PromptExecutor:
d
=
self
.
outputs_ui
.
pop
(
x
)
del
d
comfy
.
model_management
.
cleanup_models
()
self
.
add_message
(
"execution_cached"
,
{
"nodes"
:
list
(
current_outputs
)
,
"prompt_id"
:
prompt_id
},
broadcast
=
False
)
...
...
main.py
View file @
6a32c06f
...
...
@@ -139,6 +139,7 @@ def prompt_worker(q, server):
if
need_gc
:
current_time
=
time
.
perf_counter
()
if
(
current_time
-
last_gc_collect
)
>
gc_collect_interval
:
comfy
.
model_management
.
cleanup_models
()
gc
.
collect
()
comfy
.
model_management
.
soft_empty_cache
()
last_gc_collect
=
current_time
...
...
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