AV ComfyUI Manual
35 / 64
Files
35
PART III · HANSEN BY TIMESTAMPS · 07:38

Masks & Detail Conservation — constraining generative freedom locally

This part of the showcase exposes mask/preprocess/detail branches. It connects two fundamental skills: a mask defines WHERE an operation may act, while detail conservation defines WHAT source information should be restored or preserved after a generative pass.

CONFIRMEDSource topology confirms the RGB mask system, PEOPLE Florence2/SAM2 masks, architectural Florence2/SAM2 detail mask and detail-transfer nodes 565/573 controlled by shared strength 720.
HANSEN ORIGINAL

The master graph creates masks in more than one way

Mask systemSourcePurpose
RGB/ID masks338 → 337Prepared regions encoded by color
PEOPLE semantic mask550 → 114 → 115 → 144 → 146Segment people for PPL processing
Architectural detail mask580 → 584 → 585Building/facade region for conservation/composite
BEGINNER FOUNDATION

A mask is not a picture for display — it is a spatial instruction

When you encounter a MASK, first determine what white/foreground means and which operation it constrains: crop, composite, inpaint, detail transfer or another local process.

SEMANTIC MASK

Detection and segmentation are different stages

DETAIL CONSERVATION

Detail conservation is a controlled return of source information

Node 565 transfers selected source detail into the SDXL result, and 573 performs a similar controlled transfer before the main FLUX encode. Both receive shared strength from node 720.

The purpose is not to “sharpen everything.” The workflow uses a mask to restore important architectural detail only where it is needed.

DATA CONTRACT

The mask must share coordinate space with the image it controls

If detection ran on a resized image but the local operation receives another canvas, the mask can shift or scale incorrectly. Treat source image, resize policy, bbox coordinates and mask dimensions as one contract.

TROUBLESHOOTING

Debug the mask pipeline separately from generation

  • Preview the source image.
  • Preview detection / bbox when available.
  • Preview the raw segmentation mask.
  • Preview the mask after grow/blur.
  • Verify polarity: what is foreground?
  • Verify dimensions / coordinate space.
  • Verify the local composite/detail result before the main sampler.
PRACTICE

Exercise: describe every mask as “WHERE + WHAT OPERATION”

Choose three masks in the Hansen workflow and state two things for each: which spatial region it describes and which downstream operation it constrains. If the answer is only “this is the building mask,” it is incomplete.

PASS CRITERIA

When the 07:38 lesson is complete

You can distinguish a prepared ID mask, a semantic segmentation mask and a detail-conservation mask; you understand that a mask does not improve anything by itself — it constrains the next operation spatially.