Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Always put text encoder on GPU when dynamic vram on. (#16374)

comfyanonymousd39cdfdb0393
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 63a1d1549..9aa0a9de0 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -1219,7 +1219,9 @@ def text_encoder_offload_device():
def text_encoder_device():
if args.gpu_only:
return get_torch_device()
- elif vram_state in (VRAMState.HIGH_VRAM, VRAMState.NORMAL_VRAM) or comfy.memory_management.aimdo_enabled:
+ if comfy.memory_management.aimdo_enabled:
+ return get_torch_device()
+ elif vram_state in (VRAMState.HIGH_VRAM, VRAMState.NORMAL_VRAM):
if should_use_fp16(prioritize_performance=False):
return get_torch_device()
else: