Skip to content

Commit f4c689e

Browse files
Merge branch 'ipex' of https://github.com/kwaa/ComfyUI-IPEX
2 parents 7f23353 + d63705d commit f4c689e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

execution.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import torch
1111
import nodes
1212

13+
from model_management import xpu_available
14+
1315
def get_input_data(inputs, class_def, unique_id, outputs={}, prompt={}, extra_data={}):
1416
valid_inputs = class_def.INPUT_TYPES()
1517
input_data_all = {}
@@ -206,6 +208,8 @@ def execute(self, prompt, extra_data={}):
206208
if torch.version.cuda: #This seems to make things worse on ROCm so I only do it for cuda
207209
torch.cuda.empty_cache()
208210
torch.cuda.ipc_collect()
211+
elif xpu_available:
212+
torch.xpu.empty_cache()
209213

210214

211215
def validate_inputs(prompt, item):

0 commit comments

Comments
 (0)