ComfyUI Node

Transform Hijack

Use latent transforms with any sampler you already love

By kuschanow·Created 2 years ago·Updated 14 days ago· 23
Transform Hijack
  • model
  • transforms
  • MODEL

Transform Hijack is the node that decouples the pack's transforms from its samplers. The TSampler nodes are handy, but they're forks of ComfyUI's built-in samplers - which means they don't carry your custom samplers, your LoRA patches, or whatever else you've grown attached to. Transform Hijack takes the transform mechanism itself and hands you back a patched model you can wire into any ordinary KSampler.

How it works

The node has two inputs and one output: a model and a transforms (TRANSFORM) in, a patched MODEL out. That's the whole thing. Internally it clones your model and attaches the same post-CFG callback the TSamplers use (set_model_sampler_post_cfg_function), so the transforms fire on the denoised prediction after classifier-free guidance, step by step.

The reason this is useful: you build your graph the way you already build it. Load your checkpoint, chain your LoRAs, pick your favorite sampler - from the stock list or a custom pack - and slot Transform Hijack between the model and the sampler. The transforms don't care which sampler consumes them.

The input that matters

transforms accepts the TRANSFORM output from any of the pack's transform nodes - Shift transform, Mirror transform, Multiply transform, Latent add transform, Latent interpolate transform, or Combine transforms. You can chain multiple Hijack nodes if you want a couple of independent patches, or feed it one combined TRANSFORM.

A setup that works

Checkpoint → [LoRA...] → Transform Hijack → KSampler
                          ↑  (TRANSFORM from Multiply transform)

That's the whole pattern. One detail worth knowing: because the patched model is a clone, you can also drop the Hijack after a sampler's model input if you're feeling fancy - but the simple version above is what most people run. The transforms are applied to the clean prediction x0 each active step, then re-noised, so converging samplers (Euler, DPM++ 2M) hold the edit better than ancestral ones.

Install

Same story as the rest of the pack - it's all one repo:

cd ComfyUI/custom_nodes
git clone https://github.com/RomanKuschanow/ComfyUI-Advanced-Latent-Control

or ComfyUI Manager, search "Advanced Latent Control". Restart, and look for "Transform Hijack" under sampling/transforms. No models, no extra Python dependencies.

When to use it vs. the TSamplers

Honestly, most people should use the TSamplers. They're one node instead of two, and the whole point of this pack is that the transforms are pre-wired. Reach for Transform Hijack when:

  • You're already using a custom sampler and don't want to re-tune it.
  • You want the transform on a model path that feeds something other than a KSampler.
  • You'd rather see the patched model in your graph explicitly than trust an invisible hook inside a sampler node.

It's the most composable node in the pack, and the least flashy. That's a fair trade. The one thing it can't do is let the transform see the sampler's own parameters - it patches the model, not the sampler, so if you need step-range control from the sampler side, the TSamplers are the better fit.

Categorysampling/transforms

Inputs (2)

NameTypeDefaultDescription
modelMODEL
transformsTRANSFORM

Outputs (1)

NameTypeDescription
MODELMODEL