Commit Graph
5 Commits
Author SHA1 Message Date
ausboss 42655f2606 Mask by Touch: Pick, Paint and Erase, one brush with Image Compare A/B
The node's tool row is one switch, Pick | Paint | Erase (W, B, E). Paint
adds to the mask and Erase rubs it out, exactly as drawn. Ctrl, or the
right mouse button, does the opposite while held. The brush has a size
and a soft edge, set with [ and ], Shift with them, or Alt and the right
mouse button dragged, and it shows under the pointer as it will paint.

Chips are areas: brush marks carry the number of the chip they joined
(the selected chip, else the one they touch, else the paint chip), and
erasing makes no chip. A take-away that takes nothing is not kept; the
node now says per touch whether a take-away took anything ("did"). A
thing taken away keeps its own chip. Ctrl-click un-picks a pick, a click
puts a taken-away thing back. Chips wrap onto more rows.

Soft brush marks ("s" on a paint touch) make the selection soft on both
sides: apply_item and the face's joinMasks mix by strength, the edge steps
run on soft values as the server's do, and the selection picture is grey
where a soft brush painted. The node also sends each picked thing's own
area, so the face can tell which chip a mark touches.

The look at a picture can be paused and resumed from a button under the
picture, and starts on hover also behind Reroute nodes and the pack's own
loaders.

The brush is shared: js/shared/brush.mjs and nodes/_brush_helpers.py.
Image Compare A/B's Erase mode now flips with Ctrl instead of Alt, and
takes E and B as well.
2026-10-13 22:29:10 -05:00
ausboss 12e09fbf15 Mask by Touch: a click on a lit thing always takes it
While the node was still looking at a picture, a thing could light up
under the pointer and a click on it only left a dot. The click was held
back unless the node was already sure of the thing's name. Three clicks
left three dots, and when the look was done they became three picks at
once: the shirt, the person and one more.

- What lights up is what a click takes, also while the node still looks:
  a click on a lit thing takes that thing at once, whatever the node knows
  about its name.
- The picture says "Looking at the picture…" in its corner, with how far
  along it is ("40 of 104"), for as long as the look is not through.
- A click where nothing is lit yet still waits for the look, as before,
  but one click at a time: the picture says "Your click is in", and more
  such clicks are answered by that message instead of piling up. A click
  on a lit thing does not rush the one that waits, and answers it when it
  is at the same spot.

A click is never kept waiting longer than 45 seconds (was 12): a first
look that also loads SAM 3 takes about 25.
2026-10-12 03:26:10 -05:00
ausboss ed32667a52 Mask by Touch: another picture ends the look at the last one
Choose a picture and the node looks at it for a few seconds. Choose
another one in that time and the node finished the first look before it
started on the second, so the new picture sat there while the old one was
still being worked on.

A look gives way to the next job in ComfyUI's queue. The new picture's
run is now sent at once, behind the look that is on its way, which ends
that look within a moment. Its answer is dropped: it is about a picture
the node no longer has.

- Image Crop + Rotate + Pad and Load Image + Pad: the look at the new
  picture no longer waits for the old one to be over.
- A plain Load Image: the same, for a look that was on its way when
  another file was chosen.
- A second look at the same picture still waits for the first, and
  nothing goes behind a run that is no look.

Also: a plain Load Image that had no file when the workflow was opened
was not watched, so the first file chosen on it did not show on the node
until something else made it look again. It is watched now.
2026-10-11 23:43:11 -05:00
ausboss 33a576d786 Mask by Touch: the pack's own loaders show their picture by themselves
With a plain Load Image wired straight in, the picture shows on the node
as soon as a file is chosen. With Image Crop + Rotate + Pad or Load
Image + Pad it did not: the node showed Show picture and waited for a
press, because those loaders may crop, turn or pad the file, so the file
alone is not the picture.

The node now asks for that run itself. A moment after a file is chosen on
one of those loaders, a setting on it is changed or the wire is made, the
loader's picture is on the node, cropped and all.

- Changes are waited out for 0.7 seconds, so a crop being dragged sends
  one run when it rests, not one per step.
- Only in answer to something the person did: opening a workflow sends
  nothing, and picks saved with a workflow still wait for their own
  press.
- Nothing is sent without SAM 3 wired, or with looks set to "only on a
  click or the Look button".
2026-10-11 18:14:31 -05:00
ausboss 6338dbb49b Add Mask by Touch: click a thing on the picture, get its mask
A new node in the Mask group. The picture is on the node: moving over it
lights up what a click would take and names it, a click picks it, and two
arrows swap the pick for the next thing at that spot. Subject and
Background take the picture's main subject, or everything else, in one
click. Pick | Draw switches to a brush for an area painted by hand, + and -
add or take away, Undo takes a pick back, and every pick has a chip under
the picture. Fine edges follows hair and fur strand by strand, takes out
background seen between the strands, and gives a cut-out the thing's own
colour. The eye beside Undo and Clear shows the result as a cut-out or as
the mask. Outputs: the mask, the cut-out and the names of what was picked.

The search is ComfyUI's own SAM 3. Subject, Background and Fine edges use
ComfyUI's own background-removal model (ComfyUI 0.21 or newer). The pack
downloads nothing.

With it: a widget card can name its choices with a function and keeps
showing a value its list does not offer, the help page, an example
workflow with its thumbnail, the README section and the CHANGELOG entry.
2026-10-10 19:33:07 -05:00