Nodes/PG Nodes/Set Clip Hooks
ComfyUI Node

Set Clip Hooks

Non-destructive LoRA on your text encoder

By GizmoR13·Created 11 months ago·Updated 11 months ago· 16
Set Clip Hooks
  • clip
  • hooks
  • CLIP
appendtrue

Text-encoder LoRAs are where the "bake vs hook" decision actually hurts. Bake a LoRA into your CLIP and you've committed - change your mind about the strength and you're re-running the merge. PgSetClipHooks is the non-destructive alternative: it takes a HOOKS bundle and attaches it to your CLIP object so the LoRA's clip-side strength is applied live, at conditioning time, without ever modifying the underlying weights.

This is the CLIP-path counterpart to PgSetModelHooks. Where that node hooks the conditioning to reach the UNet, this one hooks the CLIP itself. For most LoRAs - which is to say, most LoRAs people actually care about - the clip-side effect is where the semantic pull lives, so getting this path right is usually what makes or breaks a character or style LoRA.

How it works

It's a thin wrapper over ComfyUI core's set_hooks_for_clip() - the same function behind ComfyUI's own built-in CLIP Hooks node. Your clip goes in, the hook group gets merged in with append_hooks=True, and a new CLIP object comes out carrying the hook. When you encode a prompt through that CLIP, the LoRA hook applies its clip strength on the fly. No weights are touched, nothing is cached into the model, and if you change the upstream hook's strength_clip the next run just uses it. Chain it with Set Hook Keyframes and you can even vary the clip strength across the denoise - the hook doesn't care whether its timeline is a flat value or a curve.

Inputs

  • clip - your CLIP from the checkpoint loader or Unified Loader. Note it's the raw CLIP, not the conditioning; this node has to see the encoder to hook it.
  • hooks - the HOOKS bundle from PgCreateHookLoraClipOnly, PgCreateHookLoraBoth, or a keyframed group.
  • append - boolean, default true. Same semantics as its model-side sibling: false is a passthrough/kill switch; true appends only when the hook is actually effective.

Output is CLIP, which feeds your CLIPTextEncode as usual.

Install

It ships in PG Nodes - ComfyUI Manager → "PG Nodes" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/GizmoR13/PG-Nodes

Nothing extra to download; the pack has no third-party pip dependencies.

Common issues

The recurring complaint on this exact family of nodes is version-related: set_hooks_for_clip comes from ComfyUI core's hooks API, so an outdated ComfyUI throws RuntimeError: set_hooks_for_clip unavailable. Update ComfyUI first. Second, remember this node only affects the CLIP path. If your LoRA's effect looks half-applied - prompt understanding changes but the image barely moves - the model-side strength is the missing half, so wire a Set Model Hooks with the matching create-hook node. And don't stack a baked merge and a hook for the same LoRA on one path; that's the LoRA twice. For the "set it and forget it" crowd, PgMergeLoraClipOnly is the simpler, faster-at-runtime choice - reach for this one when you want the strength to stay adjustable.

CategoryPG/Lora

Inputs (3)

NameTypeDefaultDescription
clipCLIP
hooksHOOKS
appendBOOLEANtrue

Outputs (1)

NameTypeDescription
CLIPCLIP