Files
ComfyUI/comfy
Anton Bukov b941913f1d fix: run text encoders on MPS GPU instead of CPU for Apple Silicon (#12809)
On Apple Silicon, `vram_state` is set to `VRAMState.SHARED` because
CPU and GPU share unified memory. However, `text_encoder_device()`
only checked for `HIGH_VRAM` and `NORMAL_VRAM`, causing all text
encoders to fall back to CPU on MPS devices.

Adding `VRAMState.SHARED` to the condition allows non-quantized text
encoders (e.g. bf16 Gemma 3 12B) to run on the MPS GPU, providing
significant speedup for text encoding and prompt generation.

Note: quantized models (fp4/fp8) that use float8_e4m3fn internally
will still fall back to CPU via the `supports_cast()` check in
`CLIP.__init__()`, since MPS does not support fp8 dtypes.
2026-03-17 21:21:32 -04:00
..
2024-06-27 18:43:11 -04:00
2026-02-26 01:30:31 -05:00
2025-01-24 06:15:54 -05:00
2026-03-14 18:36:29 -04:00
2025-07-06 07:07:39 -04:00
2026-01-01 22:06:14 -05:00
2026-03-14 18:36:29 -04:00
2026-03-16 21:38:40 -04:00