Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions comfy/model_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,10 +1107,7 @@ def get_free_memory(dev=None, torch_free_too=False):
stats = torch.xpu.memory_stats(dev)
mem_active = stats['active_bytes.all.current']
mem_reserved = stats['reserved_bytes.all.current']
if torch_version_numeric < (2, 6):
mem_free_xpu = torch.xpu.get_device_properties(dev).total_memory - mem_reserved
else:
mem_free_xpu, _ = torch.xpu.mem_get_info(dev)
mem_free_xpu = torch.xpu.get_device_properties(dev).total_memory - mem_reserved
mem_free_torch = mem_reserved - mem_active
mem_free_total = mem_free_xpu + mem_free_torch
elif is_ascend_npu():
Expand Down
Loading