Nodes/Frog Node Pack/🐸 Florence2+SAM Masker
ComfyUI Node

🐸 Florence2+SAM Masker

Tell it what to mask in plain English β€” Florence2 finds it, SAM outlines it

By RabbitThatIsPinkΒ·Created 3 months agoΒ·Updated 24 days agoΒ· 1
🐸 Florence2+SAM Masker
  • image
  • florence2_model
  • sam_model
  • face_mask
  • hands_mask
  • body_mask
  • debug
β—„face_promptfaceβ–Ί
β—„face_mask_modeunionβ–Ί
β—„hands_prompthandsβ–Ί
β—„hands_mask_modeunionβ–Ί
β—„body_promptbreasts, torso, midriffβ–Ί
β—„body_mask_modeunionβ–Ί
β—„confidence0.30β–Ί
β—„expand_bbox12β–Ί
β—„max_detections6β–Ί

Frog Florence2+SAM Masker is the detector half of the pack's detailing pipeline, and it replaces the fixed YOLO detector you're used to with open-vocabulary prompting. Type "face", "hands", or whatever you actually want masked - "breasts, torso, midriff" is literally the default body prompt - and Florence2 finds those regions by language, then SAM outlines them precisely. It's a two-stage machine: Florence2 does the open-vocabulary detection (bounding boxes for whatever your text describes), then the Segment Anything Model refines each box into a pixel-accurate mask that hugs the subject instead of leaving a rectangular seam. Both models load once and are shared across all three region passes, so there's no redundant GPU work.

The mask-first approach matters because this is the pack's answer to "how do I get the masks for the Detailer?" Instead of hoping a YOLO model has a class for what you want, you just describe it. Want a mask of the hat instead of the face? Change the prompt. That flexibility is the whole selling point, and it's why the README's masking-detailing docs make the point that the detector is a swappable input to the detailing loop rather than a fixed part of it.

The inputs that matter

  • florence2_model - the FL2MODEL, loaded with Florence2ModelLoader from the separate comfyui-florence2 pack. This is a required install; the masker doesn't bundle Florence2.
  • face_prompt / hands_prompt / body_prompt - what to detect for each region, defaulting to "face", "hands", and "breasts, torso, midriff". Leave one blank to skip that mask entirely.
  • face_mask_mode - union (merge all detected faces into one mask), largest (keep only the biggest), or separate (one mask per face as an [N,H,W] batch - wire that into 🐸 Mask Batch Split for per-character processing).
  • confidence - minimum detection confidence, default 0.3. Lower it and you get more boxes (and more false positives); raise it for only the obvious detections.
  • sam_model (optional) - connect the pack's 🐸 SAM Loader or Impact Pack's SAMLoader. The docstring is reassuring here: if you leave it disconnected, the masker tries Florence2's native referring-expression segmentation first, then falls back to rectangular boxes, so you still get masks without SAM installed.
  • expand_bbox / max_detections - padding around each Florence2 box before SAM, and the cap on boxes processed per region (default 6).

What comes out

face_mask, hands_mask, body_mask - wire them straight into 🐸 Detailer or 🐸 Detailer Pro - plus a debug string.

Installing it

The pack itself is the easy part:

cd ComfyUI/custom_nodes
git clone https://github.com/RabbitThatIsPink/FrogNodePack

The other requirement is real: you need the comfyui-florence2 pack installed to get Florence2ModelLoader and an actual Florence2 model file. SAM is optional (the node works without it, just with blunter masks). Install via ComfyUI Manager; the Frog pack itself declares no extra Python dependencies.

Where people trip

The classic failure is the FL2MODEL red wire on the florence2_model input - that's the missing comfyui-florence2 pack, not a broken node. Second: Florence2 is fast and small but not clairvoyant - if your prompt is too vague ("stuff") you'll get garbage boxes; the defaults are carefully chosen, so change one region at a time. Third, separate face mode emits a batch, and most detailer inputs expect a single mask - route it through 🐸 Mask Batch Split first, which is exactly what that node exists for. And it's WIP, so if a pack update breaks detection, that's the documented unstable zone.

Category🐸 Node Pack

Inputs (12)

NameTypeDefaultDescription
imageIMAGEβ€”
florence2_modelFL2MODELLoad with Florence2ModelLoader from comfyui-florence2.
face_promptSTRINGfaceWhat to detect for the face mask. Leave blank to skip.
face_mask_modeCOMBOunionunion β€” merge all detected faces into one mask. largest β€” keep only the biggest face. separate β€” one mask per detected face as [N,H,W] batch. Wire into 🐸 Mask Batch Split for multi-character eye-colour isolation.
hands_promptSTRINGhandsWhat to detect for the hands mask. Leave blank to skip.
hands_mask_modeCOMBOunionunion β€” merge all detected regions into one mask. largest β€” keep only the biggest region.
body_promptSTRINGbreasts, torso, midriffWhat to detect for the body mask. Leave blank to skip.
body_mask_modeCOMBOunionunion β€” merge all detected regions into one mask. largest β€” keep only the biggest region.
confidenceFLOAT0.300–1Minimum detection confidence. Lower = more boxes.
sam_modeloptSAM_MODELOptional. Connect 🐸 SAM Loader or Impact Pack SAMLoader. Leave disconnected to use Florence2 native segmentation.
expand_bboxoptINT120–256Expand each Florence2 bounding box by N pixels before SAM.
max_detectionsoptINT61–32Cap how many bounding boxes are processed per region.

Outputs (4)

NameTypeDescription
face_maskMASKβ€”
hands_maskMASKβ€”
body_maskMASKβ€”
debugSTRINGβ€”