Nodes/ComfyUI-WeightFerry/[prototype] CFG Negative Cache (not adopted)
ComfyUI Node

[prototype] CFG Negative Cache (not adopted)

It ships, it works, and the author decided not to use it

By nyanmi-1828·Created 10 days ago·Updated 6 days ago· 1
[prototype] CFG Negative Cache (not adopted)
  • model
  • MODEL
◄modeoff►
◄first_full2►
◄interval2►
◄thresh0.000►

A negative branch you don't want to skip

Here's a node whose own author tells you not to use it. CFG Negative Cache attacks the same cost CFG Early-Stop does - the second model call for the negative prompt - but instead of skipping it, it tries to compute it cheaply. Two strategies, both of which sound clever and neither of which paid off.

The measurements, straight from the pack's prototype notes: the base image breaks, and the upscale path gains only about 5%. That's it. Five percent for a visible quality cost on the pass that matters most. So it's filed under "measured and not adopted", kept in the tree for reference and re-testing, and shipped with mode defaulted to off so it returns the model unchanged until you deliberately change that.

I think this is a genuinely good habit and more node packs should do it. Negative results are results. Knowing that idea X was tried and cost 5% is information you keep - and it saved you from spending an evening on it.

How it works

Both modes only touch steps where both branches would run; CFG 1 steps are left alone, so this does nothing on a Turbo/CFG-1 workflow.

reuse computes the negative normally for the first first_full calls of each sampling run, then only every interval-th call. In between, it reconstructs the negative as the positive plus the last computed (negative − positive) difference. If thresh is above zero it goes adaptive instead of fixed-interval: it recomputes when the input has drifted by more than that relative L1 amount since the last real computation, accumulating the drift rather than resetting it.

lowres runs the negative branch on the input pooled 2×2, upsamples the result, and takes the high frequencies from the positive branch: neg = up(neg_low) + (pos − up(pool(pos))). The reasoning is that the negative's job is composition and gross structure, not fine detail - so compute it at half resolution and borrow the detail from somewhere already computed.

Both are plausible. Both lose. The failure the author reports for reuse is on the base image, and that makes sense: the negative branch is what CFG is for, and a stale difference vector compounds over steps.

Inputs and outputs

  • model - the model to patch.
  • mode - off (default), reuse, lowres. Off returns the model untouched, no clone, no wrapper.
  • first_full (2) - model calls with both branches computed at the start of each sampling.
  • interval (2) - reuse mode: compute the negative every n-th call.
  • thresh (0) - reuse mode: above zero, the recompute becomes adaptive on input change instead of fixed-interval.

One output, MODEL.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/nyanmi-1828/ComfyUI-WeightFerry

or Manager → WeightFerry → install → restart. It's in the pack's WeightFerry/prototype (not adopted) category, so it appears in the node menu with a [prototype] prefix - hard to add by accident, which is the point. No dependencies. NVIDIA, ComfyUI 0.38.0+.

Where it goes wrong

Expecting it to do nothing because it's "not adopted". It's not a stub. Set mode to reuse or lowres and it patches the model and changes your image. "Not adopted" is a verdict, not a disabled flag.

Comparing it against CFG Early-Stop and concluding it's broken. They're not the same trick. Early-Stop drops the negative entirely for the tail (27% faster in the author's measurement, slight image change). This one tries to keep a negative while paying less for it (5% faster on the upscale path, and the base image visibly moves). If you want speed, reach for CFG Early-Stop. If you want the interesting research, read this node's docstring.

Turning it on with thresh set but mode at reuse and no baseline. Adaptive recompute with an arbitrary threshold is a tuning problem, and you have no reference for what the differences are supposed to look like. Keep interval first; only try adaptive once you know what fixed-interval does to your image.

Assuming prototypes are unsafe. They're off by default, they return the model unchanged when off, and they're plain Python patching the same hooks the other nodes use. You can't break ComfyUI by loading the pack. The reason not to use this node is that it doesn't help, not that it's dangerous.

CategoryWeightFerry/prototype (not adopted)

Inputs (5)

NameTypeDefaultDescription
modelMODEL—
modeCOMBOoff3 options: off, reuse, lowres
first_fullINT20–100model calls with both branches computed at the start of each sampling
intervalINT21–100reuse: compute the negative every n-th call
threshFLOAT0.0000–10reuse: > 0 = adaptive (input change since the last computed negative)

Outputs (1)

NameTypeDescription
MODELMODEL—