Nodes/ComfyUI-TiledAttentionCouple/Tiled Attention Couple (Impact Pack Detailer)
ComfyUI Node

Tiled Attention Couple (Impact Pack Detailer)

Stop the face detailer from wrecking your regional prompts

By Deathspike·Created about a year ago·Updated 10 months ago· 8
Tiled Attention Couple (Impact Pack Detailer)
  • model
  • clip
  • config
  • detailer_hook

You got the two girls right. Nanoha on the left, Fate on the right, each with her own face, each with her own expression in the prompt. Then you run FaceDetailer to clean up the faces, and suddenly both of them are smiling the same generic smile - because the detail pass re-renders each face crop with the plain global prompt, and your per-tile prompts never reach it.

This node is the glue that fixes that. It produces a detailer_hook for the Impact Pack's detailers, and that hook re-applies your tiled attention coupling inside each crop, so the left face still gets "light smile" while the right face gets "nose blush."

How it works

Impact Pack detailers work on a detect-crop-refine loop: find a region (face, hand, whatever the detector finds), crop it, run a fresh sampling pass on the crop at proper resolution, and paste it back. The problem is that refresh pass re-encodes the conditioning - and unless you intervene, it's your base prompt doing the encoding, not your per-tile setup.

The hook intercepts two points in that loop. First, post_crop_region rounds the crop's bounds down to multiples of the latent size (32 for SD1.5-class models, 64 for SDXL), which keeps the tile masks aligned on the re-sample. Second, pre_ksample re-runs your TILED_CONFIG with the crop region as the "inner" region and the full image as the "outer" region. The tile geometry is still computed from the full canvas - so the left side of the image is still the left tile - but the masks are overlapped with the crop. The result: the face being refined gets the tile prompt that actually applies where that face sits.

That's the clever bit. It isn't re-attaching the original generation's conditioning; it's recomputing the regional masks for wherever the crop happens to be, which means the same hook works for any detected face at any position.

Wiring it up

It's three connections on top of your existing setup:

  1. Add Tiled Attention Couple (Impact Pack Detailer) and feed it model, clip, and the same config you're sending to the main node.
  2. Connect its detailer_hook output to FaceDetailer's detailer_hook input.
  3. Keep the main Tiled Attention Couple node feeding your main sampler as before.

Unlike the main node, this one takes no width/height - the crop region supplies the dimensions, so there's nothing to keep in sync. Note it takes a model and clip of its own; the hook needs them to re-encode the config when the detail pass fires.

Installing it

Two packs, because the hook plugs into ltdrdata's Impact Pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Deathspike/ComfyUI-TiledAttentionCouple

Then install ComfyUI-Impact-Pack the same way (ComfyUI Manager: search "Impact Pack" and "Tiled Attention Couple"). Restart ComfyUI. The TiledAttentionCouple pack itself has no extra Python dependencies; Impact Pack is the external requirement here, and it's the one that brings FaceDetailer and the detailer_hook input with it.

Where people get burned

  • Hook won't appear. If you don't see a detailer_hook socket on FaceDetailer, Impact Pack isn't loaded or isn't up to date. Install it, restart, and re-check.
  • It only helps when tiles matter. If your image is a single subject with no BREAK structure, the hook is a no-op - the config has one prompt and everything gets it. That's fine, but don't expect magic.
  • Detail passes change faces. That's the point of FaceDetailer, and the hook keeps your regional prompts intact rather than reverting them, but it doesn't turn a bad detail pass into a good one. The same caveats that apply to Impact Pack's detailers apply here.
Categoryconditioning

Inputs (3)

NameTypeDefaultDescription
modelMODEL
clipCLIP
configTILED_CONFIG

Outputs (1)

NameTypeDescription
detailer_hookDETAILER_HOOK