Skip to content

Commit f7942dc

Browse files
committed
Fix for (#104): drop text_encoder_initial_device patch and state - these were part of an attempt to solve a CLIP compute issue that was recently solved another way (Commit edc8a4d)
- Remove current_text_encoder_initial_device and its updates - Delete text_encoder_initial_device_patched and stop overriding mm.text_encoder_initial_device - Simplify set_current_text_encoder_device and logging to track only current_text_encoder_device Bump revision to 2.4.7
1 parent 80f8a14 commit f7942dc

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

__init__.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,16 @@
2929
# Global device state management
3030
current_device = mm.get_torch_device()
3131
current_text_encoder_device = mm.text_encoder_device()
32-
current_text_encoder_initial_device = mm.text_encoder_device()
3332

3433
def set_current_device(device):
3534
global current_device
3635
current_device = device
3736
logger.info(f"[MultiGPU Initialization] current_device set to: {device}")
3837

3938
def set_current_text_encoder_device(device):
40-
global current_text_encoder_device, current_text_encoder_initial_device
39+
global current_text_encoder_device
4140
current_text_encoder_device = device
42-
current_text_encoder_initial_device = device
43-
logger.info(f"[MultiGPU Initialization] current_text_encoder_device and current_text_encoder_initial_device set to: {device}")
41+
logger.info(f"[MultiGPU Initialization] current_text_encoder_device set to: {device}")
4442

4543
def override_class(cls):
4644
class NodeOverride(cls):
@@ -137,19 +135,12 @@ def text_encoder_device_patched():
137135
logger.debug(f"[MultiGPU Core Patching] text_encoder_device_patched returning device: {device} (current_text_encoder_device={current_text_encoder_device})")
138136
return device
139137

140-
def text_encoder_initial_device_patched(*args, **kwargs):
141-
logger.debug(f"[MultiGPU Core Patching] text_encoder_initial_device_patched called with args={args}, kwargs={kwargs}")
142-
# look at this later - I am not convinced that this isn't the better choice:
143-
# return text_encoder_device_patched()
144-
return mm.text_encoder_device()
145-
146138

147139
logger.info(f"[MultiGPU Core Patching] Patching mm.get_torch_device, mm.text_encoder_device, and mm.text_encoder_initial_device")
148140
logger.debug(f"[MultiGPU DEBUG] Initial current_device: {current_device}")
149141
logger.debug(f"[MultiGPU DEBUG] Initial current_text_encoder_device: {current_text_encoder_device}")
150142
mm.get_torch_device = get_torch_device_patched
151143
mm.text_encoder_device = text_encoder_device_patched
152-
mm.text_encoder_initial_device = text_encoder_initial_device_patched
153144

154145
def check_module_exists(module_path):
155146
full_path = os.path.join(folder_paths.get_folder_paths("custom_nodes")[0], module_path)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-multigpu"
33
description = "Provides a suite of custom nodes to manage multiple GPUs for ComfyUI, including advanced model offloading for both GGUF and Safetensor formats with DisTorch, and bespoke MultiGPU support for WanVideoWrapper and other custom nodes."
4-
version = "2.4.6"
4+
version = "2.4.7"
55
license = {file = "LICENSE"}
66

77
[project.urls]

0 commit comments

Comments
 (0)