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
94680732
Commit
94680732
authored
Jun 01, 2023
by
comfyanonymous
Browse files
Empty cache on mps.
parent
d200fa13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
comfy/model_management.py
comfy/model_management.py
+4
-1
No files found.
comfy/model_management.py
View file @
94680732
...
@@ -389,7 +389,10 @@ def should_use_fp16():
...
@@ -389,7 +389,10 @@ def should_use_fp16():
def
soft_empty_cache
():
def
soft_empty_cache
():
global
xpu_available
global
xpu_available
if
xpu_available
:
global
vram_state
if
vram_state
==
VRAMState
.
MPS
:
torch
.
mps
.
empty_cache
()
elif
xpu_available
:
torch
.
xpu
.
empty_cache
()
torch
.
xpu
.
empty_cache
()
elif
torch
.
cuda
.
is_available
():
elif
torch
.
cuda
.
is_available
():
if
torch
.
version
.
cuda
:
#This seems to make things worse on ROCm so I only do it for cuda
if
torch
.
version
.
cuda
:
#This seems to make things worse on ROCm so I only do it for cuda
...
...
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