Preload CLIP To GPU
Encode faster by preloading the text encoder
- clip
- CLIP
Preload CLIP To GPU forces a tracked CLIP fully onto the GPU right now - load_models_gpu(..., force_full_load=True) - then marks it sticky with a priority, and hands you the same CLIP back. It's the text-encoder version of Preload Model To GPU, and it exists because prompt encoding has a bad habit of being the sneaky slow part of a run.
Here's the thing about text encoders: they're often loaded lazily by ComfyUI, so your first CLIP Text Encode step can silently stall while the encoder gets pulled onto the card. On a T5-class encoder that's not nothing. Preload the CLIP as an earlier node in the graph and the encode step starts warm. It also means the encoder is resident - sticky and protected from eviction (under the sticky_gpu policy) at whatever priority you set - so if your workflow encodes prompts multiple times, each later encode reuses what's already there instead of re-loading.
The inputs, same shape as the model preload:
clip- theCLIPto force onto the GPU.sticky-truemarks it sticky after preloading. Defaulttrue.priority--100to100, default0. Higher priority is protected first under VRAM pressure.
Output is the same CLIP, passed through unchanged - wire it in line between your loader and CLIP Text Encode and you don't reroute anything.
Mechanically this wraps the CLIP's patcher and runs it through the same full-load path as the model variant. One useful detail: under the pack's sticky_gpu policy, freshly loaded CLIPs are auto-pinned anyway, so the preload node is most valuable when you want the timing benefit (warm encoder before the run) plus explicit control over priority, or when you want to preload something the policy wouldn't have kept.
Caveats that apply across the pack: preloading is a process-lifetime thing - restart ComfyUI and the residency is gone. And on a tight card, force-loading the CLIP early reserves memory that could've been lazy; preload the encoders you actually reuse, not everything you touch. If you've never noticed a text-encoder stall, you may not need this node at all - it's for graphs where prompt encoding repeatedly sits at the front of the timeline.
Install with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-GPU-Resident-Loader
cd ComfyUI-GPU-Resident-Loader
pip install -r requirements.txt
Restart ComfyUI, or search "comfyui-gpu-resident-loader" in ComfyUI Manager.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| sticky | BOOLEAN | true | — |
| priority | INT | 0-100–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CLIP | CLIP | — |