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
cd85f876
Commit
cd85f876
authored
Feb 28, 2023
by
comfyanonymous
Browse files
Try to clear more memory at the end of each prompt execution.
parent
f3103d7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
execution.py
execution.py
+4
-0
No files found.
execution.py
View file @
cd85f876
...
@@ -5,6 +5,7 @@ import json
...
@@ -5,6 +5,7 @@ import json
import
threading
import
threading
import
heapq
import
heapq
import
traceback
import
traceback
import
gc
import
torch
import
torch
import
nodes
import
nodes
...
@@ -187,7 +188,10 @@ class PromptExecutor:
...
@@ -187,7 +188,10 @@ class PromptExecutor:
if
self
.
server
.
client_id
is
not
None
:
if
self
.
server
.
client_id
is
not
None
:
self
.
server
.
send_sync
(
"executing"
,
{
"node"
:
None
},
self
.
server
.
client_id
)
self
.
server
.
send_sync
(
"executing"
,
{
"node"
:
None
},
self
.
server
.
client_id
)
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
torch
.
cuda
.
empty_cache
()
torch
.
cuda
.
ipc_collect
()
def
validate_inputs
(
prompt
,
item
):
def
validate_inputs
(
prompt
,
item
):
unique_id
=
item
unique_id
=
item
...
...
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