Skip to content

Commit 1080bd4

Browse files
Disable dynamic vram on wsl. (Comfy-Org#12706)
1 parent 17106cb commit 1080bd4

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

comfy/model_management.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ def is_ixuca():
180180
return True
181181
return False
182182

183+
def is_wsl():
184+
version = platform.uname().release
185+
if version.endswith("-Microsoft"):
186+
return True
187+
elif version.endswith("microsoft-standard-WSL2"):
188+
return True
189+
return False
190+
183191
def get_torch_device():
184192
global directml_enabled
185193
global cpu_state

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def execute_script(script_path):
192192
import comfy.memory_management
193193
import comfy.model_patcher
194194

195-
if enables_dynamic_vram() and comfy.model_management.is_nvidia():
195+
if enables_dynamic_vram() and comfy.model_management.is_nvidia() and not comfy.model_management.is_wsl():
196196
if comfy.model_management.torch_version_numeric < (2, 8):
197197
logging.warning("Unsupported Pytorch detected. DynamicVRAM support requires Pytorch version 2.8 or later. Falling back to legacy ModelPatcher. VRAM estimates may be unreliable especially on Windows")
198198
elif comfy_aimdo.control.init_device(comfy.model_management.get_torch_device().index):

0 commit comments

Comments
 (0)