Nodes/PG Nodes/Set Hook Keyframes
ComfyUI Node

Set Hook Keyframes

Give your LoRA a strength curve that fades in and out mid-run

By GizmoR13·Created 11 months ago·Updated 11 months ago· 16
Set Hook Keyframes
  • hooks
  • HOOKS
first_level_percent0.00
first_lev_trigger_at1.00
second_level_percent1.00
second_lev_trigger_at0.00

Set Hook Keyframes is the node that makes PG Nodes' LoRA hooks genuinely interesting instead of just convenient. A hook gives you a LoRA applied live to the CLIP or model path; keyframes give that LoRA a timeline. You define two points - strength at one progress point, strength at another - and the LoRA fades between them over the denoising run.

The canonical use: start the run with a style LoRA at full strength to set the composition, then let it fall away before the detail pass takes over. Or the reverse - ease a LoRA in for the late-stage details and keep early structure clean. That's the kind of control that normally requires re-running with different weights, and here it's just a two-point curve.

How it works

It takes a HOOKS group (from a Create LoRA Clip/Model/Both Hook node) and four numbers, then attaches a HookKeyframeGroup to the hooks:

  • first_level_percent - the denoising progress (0.0 to 1.0) where the first keyframe sits. Default 0.0.
  • first_lev_trigger_at - the LoRA strength at that first point. Default 1.0.
  • second_level_percent - the second progress point. Default 1.0.
  • second_lev_trigger_at - strength at the second point. Default 0.0.

The defaults describe a fade-out: full strength at the start, zero by the end. The node clamps levels to 0–1 and, if you accidentally set the second level lower than the first, it swaps the two points to keep the curve ascending - a small touch that prevents nonsense curves from silently wrecking a run. Output is the same HOOKS group, now keyframed, ready for Set Clip Hooks or Set Model Hooks.

Wiring in full, using the pack's own connection pattern:

LoRA Bridge Loader → Create LoRA Model Hook → Set Hook Keyframes → Set Model Hooks → sampler

The inputs that matter

  • hooks - your hook group from a Create LoRA Hook node. Required.
  • first_level_percent / second_level_percent - where on the 0–1 progress axis each keyframe fires.
  • first_lev_trigger_at / second_lev_trigger_at - the strength at each point. Fade out = 1.0 → 0.0; fade in = 0.0 → 1.0.

The trigger range actually goes to ±20, so you can overshoot - some LoRAs like a brief 1.3 pop to lock in a character, then settle. Just don't expect the clamp to protect you there; that's on the levels, not the strengths.

Install

Part of the PG Nodes pack:

ComfyUI Manager → search "PG Nodes" → Install → restart

Manual: git clone https://github.com/GizmoR13/PG-Nodes into custom_nodes (folder named PG-nodes), restart. Under PG/Lora. Requires comfy.hooks, which ships with modern ComfyUI - if the hook nodes error out on load, update ComfyUI rather than the pack.

Common issues

  • "My hook does nothing." Keyframes only mean something if the hooks actually reach the pipeline. Confirm the chain goes through Set Clip Hooks or Set Model Hooks, and check the console for bridge-load errors - an empty bridge slot passes hooks through silently.
  • Curve seems backwards. If you set the levels in descending order the node swaps them for you. If it still looks wrong, check whether you meant progress from 0 (start) to 1 (end) - it's easy to think in reverse.
  • Strength changes are invisible. On models where the LoRA mostly affects the CLIP path, keyframing a model-only hook does little. Pick the path the LoRA actually touches.

This is the node that justifies learning the hook system at all. If you're only ever baking LoRAs, you don't need it - but the moment you want a LoRA to fade out before the sampler finishes, this is the cleanest two-node solution in the pack.

CategoryPG/Lora

Inputs (5)

NameTypeDefaultDescription
hooksHOOKS
first_level_percentFLOAT0.000–1
first_lev_trigger_atFLOAT1.00-20–20
second_level_percentFLOAT1.000–1
second_lev_trigger_atFLOAT0.00-20–20

Outputs (1)

NameTypeDescription
HOOKSHOOKS