Nodes/ComfyUI/Set Hook Keyframes
ComfyUI Node Runs on cloud

Set Hook Keyframes

Make your LoRA fade in, peak, and fall off mid-generation

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,865
Set Hook Keyframes
  • hooks
  • hook_kf
  • HOOKS

A LoRA loader gives you one number for the whole run. SetHookKeyframes is what you use when one number isn't enough - when you want the LoRA to barely exist for the first 20% of sampling, slam in at full strength to shape the subject, then fall away so it stops fighting the lighting. It takes a HOOKS group and a HOOK_KEYFRAMES group, marries them, and hands back the same HOOKS group now carrying a strength schedule. If you've ever wanted a "strength over time" curve for your weights, this is the node that draws it.

How it works

Hooks in ComfyUI (core since December 2024, still experimental) are weight patches that ride on conditioning. A keyframe is a (strength, start_percent) pair - "at 40% of sampling, be at strength 1.5." Sampling runs from 0% to 100%, so you're scheduling against the whole denoise timeline, not steps. The hooks system picks the right keyframe for the current timestep and multiplies its strength multiplier into the hook's base strength. In other words, the keyframe scale factor layers on top of the LoRA's own strength_model - you're animating a multiplier, not replacing the number.

SetHookKeyframes is the node that applies a pre-built HOOK_KEYFRAMES group onto an existing HOOKS group. On its own it does nothing to the generation; think of it as the coupling between the two.

The two inputs

  • hooks (required) - the HOOKS group to schedule. Usually a CreateHookLora or CreateHookModelAsLora output.
  • hook_kf (optional) - the HOOK_KEYFRAMES group. Leave it disconnected and the node passes the hooks through unchanged.

Output is a single HOOKS group, ready to feed into ConditioningSetProperties or the "Set Props" nodes' hooks input.

Building the keyframes

You've got three creators, and which one you use depends on how opinionated you are:

  • CreateHookKeyframesInterpolated - the one you'll reach for first. Give it a start strength, an end strength, an easing curve (linear, ease_in, ease_out, ease_in_out), a start/end percent, and a count; it generates a smooth ramp. Good for "style takes over at the end" fades.
  • CreateHookKeyframesFromFloats - feed it an actual list of floats and it places them evenly across the range. For when your curve comes from another node or a batch.
  • CreateHookKeyframe - one keyframe at a time, chained through prev_hook_kf. For hand-built multi-stop schedules.

The interpolation node prints its generated keyframes to the console when you tick print_keyframes - genuinely handy for debugging why a fade is doing something weird.

What people use it for

The flagship use case, straight from the December 2024 announcement, is scheduling a character or style LoRA so it "takes over the scene" only at the right moment - high strength mid-run to define the subject, then backed off so the base model's lighting and composition come back for the final details. It pairs naturally with masks: SetHookKeyframes handles when, the mask handles where, and together they give you the regional-plus-temporal control that regional-prompting tools on A1111 could never quite manage.

Watch out

Keyframes only matter if the hooks eventually reach the sampler through conditioning - the schedule is worthless if the HOOKS output isn't wired into a Set Props node. And remember every keyframe adds a hook to a run where each hooked conditioning already costs a separate model pass; a heavily scheduled workflow is slower, not faster. Start with three keyframes, not twenty.

Categoryadvanced/hooks/scheduling

Inputs (2)

NameTypeDefaultDescription
hooksHOOKS
hook_kfoptHOOK_KEYFRAMES

Outputs (1)

NameTypeDescription
HOOKSHOOKS