Nodes/comfyui_bmab/BMAB Detail Anything
ComfyUI Node

BMAB Detail Anything

The detect-crop-resample-paste loop, on any mask you give it

By portu-sim·Created 2 years ago·Updated 8 months ago· 124
BMAB Detail Anything
  • bind
  • masks
  • image
  • lora
  • BMAB bind
  • image
steps20
cfg_scale8.0
sampler_name
scheduler
denoise0.40
padding32
dilation4
width512
height512
limit1

If you've used Impact Pack's FaceDetailer, or ADetailer back on Automatic1111, you already understand the core trick this node runs - it's the same idea, generalized to any region you can mask rather than just faces.

What it is and why you'd reach for it

Small regions in a large image get mangled. A face that's 80x80 pixels of a 1024x1024 frame only gets 80x80 pixels' worth of the model's attention, and it shows - melted eyes, smudged hands, whatever detail you actually cared about. The fix that the whole detailer-node category exists for is: crop that region out, run a fresh sampling pass on it at proper resolution, then paste the result back into the full image. BMAB Detail Anything is BMAB's version of that loop.

The difference from a dedicated face detailer is right there in the name - this node doesn't do its own detection. You hand it a mask, from wherever you got it: BMAB's own BMAB Detect And Mask node, a manually painted mask, a SAM segmentation, anything. That makes it genuinely general-purpose rather than face-specific - hands, an object, a section of background, whatever your mask covers gets the detail pass. The trade-off is that you're responsible for producing a decent mask; this node just does the crop-resample-paste work once it has one.

How it works

For each masked region: pad it out (so the crop has some breathing room around the actual mask edges), optionally dilate the mask itself (grow it slightly so the resample doesn't produce a visible seam right at the mask boundary), crop to a working resolution, run a KSampler-style pass at that resolution with your specified steps/CFG/sampler/scheduler/denoise, then paste the refined result back into the original image. If there are multiple disconnected regions in your mask, limit caps how many of them get processed.

Inputs and outputs

  • bind (required) - the BMAB bind carrying model/clip/vae/conditioning to sample with.
  • masks (required, MASK) - the region(s) to detail. This node does not detect anything itself.
  • steps / cfg_scale / sampler_name / scheduler / denoise - standard sampler controls for the detail pass. sampler_name and scheduler both offer a "Use same sampler/scheduler" option to inherit your first pass's settings. Denoise defaults to 0.4, which is the same range you'd use for any hires-fix-style refinement - high enough to actually add detail, low enough not to redraw the region from scratch.
  • padding (default 32, 8–128) - extra margin cropped around the mask before resampling.
  • dilation (default 4, 4–32) - how much to grow the mask itself before applying it.
  • width / height (default 512, range 256–2048) - the working resolution for the detail pass.
  • limit (default 1, 0–20) - maximum number of separate regions to process in one run.
  • Optional image - feed a specific image directly rather than relying on the bind's.
  • Optional lora (BMAB lora) - swap in a different LoRA just for this detail pass, wired from BMAB's own LoRA-loading node.

Outputs: a BMAB bind and the resulting image.

Installing it

Through ComfyUI Manager: search comfyui_bmab, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/portu-sim/comfyui_bmab.git
cd comfyui_bmab
pip install -r requirements.txt

This node doesn't itself need comfyui_controlnet_aux or ComfyUI_IPAdapter_plus - but whatever produces your mask might. If you're feeding it a mask from BMAB Detect And Mask, check that node's own dependency needs.

Common issues

  • A face already large in frame gets a second pass that changes it without improving it. This is the standard detailer trap across every tool in this category, not specific to BMAB - if the region is already well-resolved, running a detail pass on it just introduces drift for no visible gain. Reserve this for genuinely small, mangled regions.
  • Bad or noisy input mask. Since this node has no detection of its own, its output quality is entirely downstream of whatever mask you hand it. A loose, over-inclusive mask produces a soft, blended-in refinement; a too-tight mask can leave a visible seam even with padding and dilation working in your favor.
  • limit too low for a multi-region mask. If your mask covers several disconnected areas and only some get refined, check that limit is set high enough to cover all of them.
CategoryBMAB/detailer

Inputs (14)

NameTypeDefaultDescription
bindBMAB bind
masksMASK
stepsINT200–10000
cfg_scaleFLOAT8.00–100
sampler_nameCOMBO45 options: Use same sampler, euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, +39
schedulerCOMBO10 options: Use same scheduler, simple, sgm_uniform, karras, exponential, ddim_uniform, +4
denoiseFLOAT0.400–1
paddingINT328–128
dilationINT44–32
widthINT512256–2048
heightINT512256–2048
limitINT10–20
imageoptIMAGE
loraoptBMAB lora

Outputs (2)

NameTypeDescription
BMAB bindBMAB bind
imageIMAGE