Nodes/ComfyUI-LASED-mask/LASED Multi-Seed
ComfyUI Node

LASED Multi-Seed

Tracing several color regions in a single pass

By MushroomFleet·Created 3 months ago·Updated 3 months ago· 0
LASED Multi-Seed
  • image
  • edge_map
  • mask
seeds64,64; 192,128
tolerance40.0
ants250
steps600
color_spacergb
handboth
beta4.0
epsilon0.05
seed0
modemasking
mask_threshold0.15
sticky_threshold0.20
freeze_after0
no_decayfalse
max_side512

LASED Swarm Edge traces one color region per click. LASED Multi-Seed is the version for when "one click" isn't going to cut it - a product shot with three objects, a crowd where every figure is a different color, a whole-image contour map you want in a single pass.

You give it a list of seed points as a string - "x,y; x,y; ..." in input-image pixels - and each point gets its own swarm and its own adopted target colour. Every swarm runs independently, then the results are merged: edge fields by element-wise max, masks by union. One node, one queue, a full-image contour map at the other end.

The inputs that matter

  • seeds - the whole point of the node. Format is strict: "64,64; 192,128", semicolons between points, and each point is x,y. It's multiline, so newlines work too. Get the format wrong and it raises a bad seed point error telling you exactly which entry it choked on. Every point must land inside the color region it's meant to trace.
  • Everything else is the standard LASED swarm set: tolerance (the big one), color_space, ants, steps, mode (classic vs masking), max_side, seed.

The outputs are the same as the flagship: edge_map (IMAGE) and mask (MASK). The merged edge map is a max over the per-region fields, so where two regions' swarms overlap you get the stronger of the two - clean in practice, and the mask is simply the union, which is what you want when several regions share one composite.

Pairing it with the Point Picker

Typing half a dozen pixel coordinates into a text box is misery, and the pack knows it. The LASED Point Picker outputs a point_str ("x,y") per click; collect a few picks, join them with a string-concat node, and feed the result straight into seeds. That's the intended loop for anything beyond two points, and it makes the node actually pleasant to use.

Gotchas

  • The merged field amplifies overlapping swarms. If your tolerance spills past a region boundary, neighbouring swarms start reinforcing the same blob and the "separate contours" idea quietly becomes "one merged edge". When contours start bleeding together, lower tolerance rather than deleting points.
  • Determinism holds per point. The same seed + params reproduces the run exactly; batch item i seeds each point with seed + i * len(points) + j. Which is great for iteration, and a trap if the control_after_generate dropdown on the seed widget is still on randomize.

Install

Identical to the rest of the pack: ComfyUI Manager search for ComfyUI-LASED-mask, or git clone https://github.com/MushroomFleet/ComfyUI-LASED-mask into custom_nodes, then restart. No model downloads; the only real dependency is numpy (scipy is an optional speed-up). The workflows/lased_multi_seed.json example shows the full chain - Multi-Seed → Overlay, plus the union mask saved via MaskToImage.

If you only ever need one region, use Swarm Edge - Multi-Seed buys you nothing but a slightly stricter text format. But the moment your image has two or more regions you care about, this is the node that turns N queue runs into one.

CategoryLASED

Inputs (16)

NameTypeDefaultDescription
imageIMAGE
seedsSTRING64,64; 192,128Spawn points as 'x,y; x,y; ...' in input-image pixels. Each point gets its own swarm and target colour.
toleranceFLOAT40.01–250Colour tolerance (tau). Lower = tighter region. Lab distances run smaller; try 10-25 there.
antsINT2501–5000
stepsINT6001–20000Simulation ticks. More steps = cleaner, more complete contours.
color_spaceCOMBOrgb3 options: rgb, weighted, lab
handCOMBObothWall-following handedness; 'both' splits the swarm into clockwise and counter-clockwise cohorts.
betaFLOAT4.00.1–12Softmax temperature. Higher = greedier edge following.
epsilonFLOAT0.050–0.5Random-move floor; prevents the swarm freezing.
seedINT00–18446744073709550000
modeCOMBOmaskingclassic: MASK = thresholded edge pheromone. masking (Stage 2): MASK = sticky-latched, gap-closed, despeckled contour.
mask_thresholdFLOAT0.150.01–0.95classic mode only: threshold on the normalised edge map for the MASK output.
sticky_thresholdFLOAT0.200.05–0.6masking mode: latch a cell when its edge pheromone crosses this fraction of the field maximum.
freeze_afterINT00–20000masking mode: freeze (and clean) the mask after this many ticks. 0 = run all steps, then freeze.
no_decayBOOLEANfalsemasking mode: stop edge-pheromone evaporation entirely.
max_sideINT5120–4096Downsample the longest side to this for simulation (0 = full resolution). Outputs are resampled back.

Outputs (2)

NameTypeDescription
edge_mapIMAGE
maskMASK