ComfyUI-LASED-mask
Perfil do pacote
- Status
- Verificado
- Publicador
- @MushroomFleet
- Fonte
- GitHub
README
ComfyUI-LASED-mask
LASED — Learning Ant Swarm Edge Detection as ComfyUI custom nodes: a colour-region-aware,
learnable edge/contour extractor (an alternative to Canny/HED), with a masking mode that
latches the swarm's answer into a clean, exportable MASK.
You pick a point on the image; a seeded swarm of Snake-style ants spawns there, adopts that pixel's colour as a target, and — confined to that colour region — naturally drifts to and walks along the region's boundary, depositing pheromone. The accumulated edge-pheromone field is the output edge map. Because LASED finds the border of a colour blob rather than intensity gradients, it often gives exactly the contour a user means when they "click a region".
Algorithm contract: LASED-grounding.md
(the upstream LASED repository); the masking mode implements the Stage 2
sticky-latch / freeze / cleanup design proven in the LASED desktop app (v0.6.0).
Install
Clone into your ComfyUI custom_nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/ComfyUI-LASED-mask
Dependencies: numpy (always present in ComfyUI). scipy is used when available for faster
diffusion and component labelling; everything falls back to pure numpy without it.
Nodes (category: LASED)
| Node | Inputs | Outputs | Purpose |
|---|---|---|---|
| LASED Swarm Edge | IMAGE, seed point, params | IMAGE edge map, MASK | One-shot run: spawn at a point, simulate, return the edge-pheromone field. |
| LASED Multi-Seed | IMAGE, seeds ("x,y; x,y; ..."), params | IMAGE, MASK | One swarm per colour region; edge fields merged (max), masks unioned. |
| LASED Food Map | IMAGE, food MASK, seed point, params | IMAGE, MASK | The mask is standing food/reward: the swarm is biased toward (and reinforces) your chosen contours — the offline analogue of interactive "success clicks". |
| LASED Overlay | IMAGE, edge IMAGE, colour, alpha | IMAGE | Glowing-contour composite for previews. |
| LASED Animate | IMAGE, seed point, params, frames | IMAGE batch | The simulation as frames — feed to video-combine / preview-animation nodes. |
| LASED Point Picker | IMAGE, point | seed_x INT, seed_y INT, point_str STRING | Visual point-and-click seed picker: the image shows inside the node, click to place the crosshair, wire the outputs into the swarm nodes. |
LASED Point Picker
Picking seed_x/seed_y by hand is fiddly, so the LASED Point Picker node shows the
input image inside the node and turns a click into coordinates:
- Connect the same
IMAGEthat feeds your swarm node to the picker'simageinput. - Press ↻ refresh preview. If the image traces back to a
LoadImage/LoadImageMask, the file is shown instantly with no execution; otherwise the picker queues a partial execution of just its upstream subgraph (needs ComfyUI ≥ 0.3.41). Running the full workflow once also (re)loads the preview. - Click (or drag) on the preview to place the crosshair — the live pixel readout is shown
bottom-left. The choice is stored in the
pointwidget as image fractions (0.5,0.5), so it stays valid if the image is swapped for a different resolution; you can also type absolute pixels (values > 1) by hand. - On the swarm node, convert the
seed_x/seed_ywidgets to inputs and connect the picker's INT outputs. Thepoint_stroutput ("x,y") can feed Multi-Seed'sseedsfield via a string-concat node when collecting several picks.
Classic vs masking mode
Every swarm-running node has a mode switch:
classic— the reference LASED behaviour. TheMASKoutput is the normalised edge-pheromone field thresholded atmask_threshold. The live field evaporates by design, so the mask reflects the field exactly as the run ended.masking(default) — the Stage 2 sticky-latch pipeli
Nós neste pacote
Nós 6
Nós neste pacote
Nós 6- LasedAnimate
- LasedFoodMap
- LasedMultiSeed
- LasedOverlay
- LasedPointPicker
- LasedSwarmEdge
Fontes
3 fontes
Fontes
3 fontesVerificado 14 de out.
Verificado 14 de out.
Trechos de fonte
1 trecho
Trechos de fonte
1 trechoSource context: Repo MushroomFleet/ComfyUI-LASED-mask
