Nodes/ComfyUI-AutoGuidance/AutoGuidance Detailer Hook (Impact Pack)
ComfyUI Node

AutoGuidance Detailer Hook (Impact Pack)

Give the face detail pass its own bad model

By xmarre·Created 7 months ago·Updated 3 months ago· 8
AutoGuidance Detailer Hook (Impact Pack)
  • bad_model
  • DETAILER_HOOK
w_autoguide2.00
swap_modeshared_safe_low_vram
ag_delta_modebad_conditional
ag_combine_modesequential_delta
ag_max_ratio0.35
ag_allow_negativetrue
ag_ramp_modeflat
ag_ramp_power2.0
ag_ramp_floor0.15
ag_post_cfg_modekeep
safe_force_clean_swaptrue
uuid_only_noopfalse
debug_swapfalse
debug_metricsfalse
debug_metrics_allfalse

If you already run AutoGuidance on your main pass (see the AutoGuidance CFG Guider article from this same pack), you'll have noticed most of its effect lives in composition and structure. The detail pass is a separate sampling run, and this node is how you give that run the same treatment - without rebuilding your detailer graph or editing Impact Pack source.

Impact Pack's FaceDetailer (and Detailer SEGS) detect a region, crop it, and re-render it at proper resolution in a fresh sampling pass. That pass runs plain CFG, and it's exactly where overcooking shows: hard, painted-on faces, that over-refined look. AutoGuidance's whole pitch is "less overcooked, same or better faithfulness," which is the detailer's problem in miniature. So the pack author shipped a DETAILER_HOOK that drops AutoGuidance into the detailer's sampling path at runtime - no file edits, just a hook.

How the hook works

This node is a hook provider, not a guider. Its output is a DETAILER_HOOK, which you wire into the hook input on FaceDetailer or Detailer (SEGS). When the detailer runs, the hook's pre_ksample builds an AutoGuidance guider on the fly - using the detailer's own model and its own cfg as the "good" side, and your bad_model as the weak reference - then patches ComfyUI's sampler long enough for that pass to use it.

That's why the inputs look different from the CFG Guider node: there's no good_model and no cfg, because the detailer already supplies both. The only model you bring is the bad one.

Inputs

  • bad_model (required) - the weak version of the same model. Same rule as the guider: same data distribution, just less trained. A weaker LoRA stack works.
  • w_autoguide - 1.0 off, default 2.0, higher is stronger.
  • swap_mode - shared_safe_low_vram / shared_fast_extra_vram / dual_models_2x_vram. Same tradeoffs as the guider: shared modes are safe but slow, and dual mode needs two truly distinct model instances (copy the checkpoint file under a new name so ComfyUI doesn't dedupe the load).

The rest are the shared tuning set: ag_delta_mode, ag_combine_mode, ag_max_ratio, ag_allow_negative, ag_ramp_mode/power/floor, ag_post_cfg_mode. ag_max_ratio is the one to reach for first - it caps how hard the good-minus-bad push can go, and a detail pass is already aggressive. Note the debug toggles default to off here (unlike the guider, where they're on), so don't expect console spam.

Install

Same pack as the guider:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-AutoGuidance

restart, and make sure Impact Pack is installed too. The hook imports impact.hooks lazily and falls back to a stub if Impact Pack is missing - so it won't crash your session, but the DETAILER_HOOK output also won't be a real hook. Effectively the pack is required.

What to watch for

The dual-instance requirement applies here just like it does to the guider: pick dual_models_2x_vram and both models have to be separate loads, or ComfyUI collapses them and the "bad" path becomes the good path. And the cost stacks - the detailer already doubles work on a small crop, and AutoGuidance adds a third model evaluation per step on top, so the shared swap modes can make face detailing painfully slow.

Honest take: this is a niche-of-a-niche. It assumes you've already bought into AutoGuidance and you care specifically about the detail pass. But if you have the VRAM for two SDXL models resident and the face pass is where you see the overcooking, this is the cleanest way to apply the idea there - one wire, no monkey-patching your own install.

Categorysampling/guiders

Inputs (16)

NameTypeDefaultDescription
bad_modelMODEL
w_autoguideFLOAT2.001–5
swap_modeCOMBOshared_safe_low_vram3 options: shared_safe_low_vram, shared_fast_extra_vram, dual_models_2x_vram
ag_delta_modeoptCOMBObad_conditional4 options: bad_conditional, raw_delta, project_cfg, reject_cfg
ag_combine_modeoptCOMBOsequential_delta2 options: sequential_delta, multi_guidance_paper
ag_max_ratiooptFLOAT0.350–5
ag_allow_negativeoptBOOLEANtrue
ag_ramp_modeoptCOMBOflat4 options: flat, detail_late, compose_early, mid_peak
ag_ramp_poweroptFLOAT2.00.5–8
ag_ramp_flooroptFLOAT0.150–1
ag_post_cfg_modeoptCOMBOkeep3 options: keep, apply_after, skip
safe_force_clean_swapoptBOOLEANtrue
uuid_only_noopoptBOOLEANfalse
debug_swapoptBOOLEANfalse
debug_metricsoptBOOLEANfalse
debug_metrics_alloptBOOLEANfalse

Outputs (1)

NameTypeDescription
DETAILER_HOOKDETAILER_HOOK