Files
craft-ai-integrations/docs/sam3-scripts
JeremyandClaude 197a7175ed ai-comfyui: SAM 3 mask batches, grounding instances and point candidates
sg1: return every instance mask from text grounding, bounded (100 masks,
32 MiB encoded, 64 Mpx decoded, identical dimensions, output type checked
before download), with an explicit pixelwise-max union. A bad later mask
fails the whole batch. Repeat requests use a unique SaveImage prefix
because ComfyUI omits a fully cached output node from /history.

sg2a: Sam3Session::ground_instances returns each instance with mask,
detector box, score and mask-measured bounds, plus pick-under-pixel.
Boxes and scores travel as PreviewAny text stamped per request through
StringConcatenate, which keeps grounding cached and rejects text that
is not from this request.

sg2b: Sam3Session::candidates returns the alternative masks SAM 3 offers
for a point prompt (up to three, server order, scores, measured bounds).
Boxes and refinement passes are not wired yet.

Verified: 90 crate tests, clippy, fmt and wasm check clean, 33 deliberate
bugs caught, and live runs on the installed headless ComfyUI. Evidence,
probe and verification scripts are under docs/research/sam3-headless.
The roadmap, README and handoff notes are updated to match.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 18:59:50 +01:00
..