CFG Govern: Angle Band
A leash on how far guidance can turn your image
- model
- MODEL
Every other node in this pack changes how the two predictions get combined. This one sits afterwards and asks a different question: how far is the result allowed to lean away from the conditional prediction? CFG Govern: Angle Band holds that angle inside a band - a ceiling for the leash, a floor for too-timid guidance - and it does it by rotating, never by rescaling.
It's the pack's in-house stage, borrowed from AbstractPhil's AlephLLM work, where a projection after each optimizer step keeps a codebook's anchors a minimum angle apart. The behaviour carries over: a projection, not a reweighting. Nothing moves until a bound actually binds.
What it actually does
For each governed unit, the node measures the angle between the guided prediction and its home - the conditional prediction by default. Above max_angle_degrees, the unit is turned toward home, in the plane the two vectors span, exactly onto the edge of the band, its length untouched. Below min_angle_degrees, it's turned away along its own direction - a floor for guidance that's landing almost nothing.
Units inside the band come back bit-identical. Units with no plane to turn in - the vector exactly along home, exactly opposite it, or zero - are left alone, because with no guidance there's no direction to turn along. And min 0 with max 180 is a complete no-op, which is how the pack can claim neutral settings reproduce plain sampling exactly.
As a middleman it's a different tool from a CFG rule: sit it after any combine node and it acts as a safety net on whatever that node produced.
The inputs that matter
max_angle_degrees- the leash, default30,180turns it off. Here's the calibration from the pack's own measurements on SDXL at 1024×1024, 50 steps, cfg 7: the guided prediction sits 25–33° from the conditional across the first 10 steps, drops under 20° by step 14 and under 10° by step 23. So a 20° leash acts on the composition steps and leaves the detail steps alone. That's the shape you want - a cap that binds early, when layout is still in play, and fades out of relevance on its own.min_angle_degrees- the floor, default0(off). Raise it when a high-cfg chain is coming out barely different from cfg 1.unit- what counts as one governed vector:whole image (one vector per image),each pixel (its channel vector)for a local colour and tone direction, oreach channel (its spatial map). Whole image is the behaviour closest to the angle-cap idea from ADG.home- what the angle is measured from.conditionallimits how far guidance turns the prediction.unconditionallimits how far the prediction sits from the negative - or from the weak branch when one replaces the unconditional - which is the same maths for a completely different purpose.start_percent/end_percent- the run window the governor is active in (0to1). Useful with a floor: govern the middle of the run and leave the ends alone.space-automeasures the angle on the denoised image, which is what ADG does. Not cosmetic: angles measured on the noise estimate are a different quantity, so switching it changes the image.
Output is a single MODEL. Chain it last in the run of patches, right before the sampler.
Installing it
ComfyUI Manager → search CFG Megapack → install → restart. Or comfy node install comfy-cfg-megapack, or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/AbstractEyes/comfy-cfg-megapack
Restart. No requirements.txt, no extra dependencies, no downloaded models - torch, the standard library, and ComfyUI's newer node API. (comfy_api.latest is why you won't find a NODE_CLASS_MAPPINGS dictionary in the source; that's "written for current ComfyUI", not "broken".) Tested on ComfyUI 0.38.0 with torch 2.11, GPU and CPU-only.
Traps
- It takes no
scale. That throws people who are used to every node in the pack having one. The governor doesn't combine predictions, so there's nothing for a scale to mean; it inherits whatever the mix stage produced. - Two arguments are validated.
min_angle_degreesmust be at mostmax_angle_degrees, andend_percentmust be at or afterstart_percent- invert either and the node raises instead of guessing for you. - "Nothing happens" at the defaults is correct, up to the ceiling. If your guided prediction never exceeds 30°, the cheapest way to prove the node is alive is to drop the leash to 10° and watch the image get flatter and closer to the prompt's most likely interpretation.
- Other packs' CFG-function nodes still share one slot. If a RescaleCFG, Mahiro or RenormCFG sits after this chain, it takes the slot and your governor's output is what gets modified afterwards.
To see it working rather than infer it, chain CFG Measure: Per-Step Probe in front - it records the angles it saw and how often each edge of the band fired, which is the only honest way to pick a leash length for a model you haven't measured.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| max_angle_degrees | FLOAT | 30.00–180 | The leash: the largest angle allowed between the guided prediction and its home (180 = off). |
| min_angle_degrees | FLOAT | 0.00–180 | The floor: the smallest angle allowed (0 = off). A unit with no guidance at all has no direction to turn along and is left alone. |
| unit | COMBO | whole image (one vector per image) | What one governed vector is: the whole latent of an image (like the angle_limit rule), each pixel's channel vector (local colour and tone direction), or each channel's map. |
| home | COMBO | conditional (how far guidance turns the prediction) | The reference the angle is measured from. conditional: the band limits how far guidance turns the prediction. unconditional: the band limits how far the prediction sits from the negative (or from the weak branch when it replaces the unconditional). |
| start_percent | FLOAT | 0.000–1 | The governor acts from this point of the run (inside the When window, if any). |
| end_percent | FLOAT | 1.000–1 | The governor stops at this point of the run. |
| space | COMBO | auto (the method's own) | Where the angle is measured. auto = the denoised image (x0), as ADG does. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |