Ir para o conteúdo
Node packVerificadoExterno
Fonte aberta

ComfyUI-LASED-mask

Mantenedor@MushroomFleetC · adoptionnota

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)

NodeInputsOutputsPurpose
LASED Swarm EdgeIMAGE, seed point, paramsIMAGE edge map, MASKOne-shot run: spawn at a point, simulate, return the edge-pheromone field.
LASED Multi-SeedIMAGE, seeds ("x,y; x,y; ..."), paramsIMAGE, MASKOne swarm per colour region; edge fields merged (max), masks unioned.
LASED Food MapIMAGE, food MASK, seed point, paramsIMAGE, MASKThe mask is standing food/reward: the swarm is biased toward (and reinforces) your chosen contours — the offline analogue of interactive "success clicks".
LASED OverlayIMAGE, edge IMAGE, colour, alphaIMAGEGlowing-contour composite for previews.
LASED AnimateIMAGE, seed point, params, framesIMAGE batchThe simulation as frames — feed to video-combine / preview-animation nodes.
LASED Point PickerIMAGE, pointseed_x INT, seed_y INT, point_str STRINGVisual 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:

  1. Connect the same IMAGE that feeds your swarm node to the picker's image input.
  2. 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.
  3. Click (or drag) on the preview to place the crosshair — the live pixel readout is shown bottom-left. The choice is stored in the point widget 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.
  4. On the swarm node, convert the seed_x/seed_y widgets to inputs and connect the picker's INT outputs. The point_str output ("x,y") can feed Multi-Seed's seeds field 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. The MASK output is the normalised edge-pheromone field thresholded at mask_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
  • LasedAnimate
  • LasedFoodMap
  • LasedMultiSeed
  • LasedOverlay
  • LasedPointPicker
  • LasedSwarmEdge

Fontes

3 fontes
GitHubFonte
github.com/MushroomFleet/ComfyUI-LASED-mask

Verificado 3 de nov.

GitHubFonteVersão 4ba2bdecacbcc0508dd6633515399d7e4caa3476
github.com/MushroomFleet/ComfyUI-LASED-mask

Verificado 14 de out.

Trechos de fonte

1 trecho

Source context: Repo MushroomFleet/ComfyUI-LASED-mask