Nodes/ComfyUI-H3-Multishot/H3 Q-Graft (attention envelope, experimental)
ComfyUI Node

H3 Q-Graft (attention envelope, experimental)

The experimental node that grafts another model's attention onto H3

By jlucasmcrell·Created 21 days ago·Updated 2 days ago· 31
H3 Q-Graft (attention envelope, experimental)
  • model
  • MODEL
gains_file
dose0.00

H3 Q-Graft is the honest-to-goodness experimental node in this pack: it scales H3's per-block attention using a "gains" curve measured by comparing H3's Q magnitude profile against a donor model's, so you can push H3's attention sharpness toward whatever that donor does well. The name tells you the mechanism - graft the donor's Q envelope onto H3 via q_norm scaling - and the "experimental" in the display name tells you the rest.

Honestly? Unless you're chasing a specific perceptual quality and have the measuring harness to produce a gains file, you can leave this one alone. It's not a node you wire in for fun. It's a tool for someone who has looked at H3's output and thought "this attention is too soft here, too sharp there" and wants a principled lever rather than a vibe-based prompt tweak.

How it works

The mechanism is surgical. A gains file is JSON shaped {"gains": {"<block>": g, ...}} where each g is a per-block multiplier for that block's Q-norm weight, measured by comparing donor-versus-H3 Q magnitude profiles. At execution the node:

  • Loads the gains file and applies dose: the effective per-block multiplier is 1 + dose*(gain-1). So dose=0 leaves the model byte-identical, dose=1 applies the full measured curve, and anything in between is a partial graft. You can even go to 1.5 and overshoot.
  • Clones the model, converts each affected weight to an additive patch, and installs the patches - ComfyUI's own patch system, so nothing destructive.
  • Prints how many blocks were patched and the effective gain range, so you can see what actually happened.

If dose is 0 or the gains file is empty, it's a straight passthrough - the model comes out untouched. The inputs are model, gains_file (a path), and dose; the output is a patched MODEL.

Where the friction is

The node itself is trivial to use; producing the gains file is not. It has to be built by comparing donor-vs-H3 Q magnitude profiles, and nothing in the pack does that measurement for you - this is the part that keeps the node honest about being experimental. If the file path is wrong or unreadable you get a clear FileNotFoundError, and if no q_norm keys match your gains blocks, it says the model is unchanged rather than pretending.

Installing it

It's in the ComfyUI-H3-Multishot pack:

cd ComfyUI/custom_nodes
git clone https://github.com/jlucasmcrell/ComfyUI-H3-Multishot

Or search H3 Multishot in ComfyUI Manager. Requires ComfyUI v0.30.0+; no extra Python dependencies, and no extra models - the donor is already captured in the gains file you point it at.

Gotchas

Two things worth knowing before you touch it. First, this patches weights at model load and changes output - it's not a quality-neutral tweak, so compare against the base model on your own content before committing a long render to it. Second, because it sits in the H3/experimental category and needs a hand-built gains file, the safest default is dose=0 (a no-op). There's no bundled example file in the repo - you're expected to generate one with your own comparison tooling.

CategoryH3/experimental

Inputs (3)

NameTypeDefaultDescription
modelMODEL
gains_fileSTRINGPath to a gains json ({"gains": {"<block>": g, ...}}) built by comparing donor-vs-H3 Q magnitude profiles. Empty = passthrough.
doseFLOAT0.000–1.50 = base model untouched. 1 = the full measured gain curve. The effective per-block multiplier is 1 + dose*(gain-1).

Outputs (1)

NameTypeDescription
MODELMODEL