LASED Multi-Seed
Tracing several color regions in a single pass
- image
- edge_map
- mask
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 isx,y. It's multiline, so newlines work too. Get the format wrong and it raises abad seed pointerror 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
tolerancespills 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, lowertolerancerather 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 thecontrol_after_generatedropdown 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.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| seeds | STRING | 64,64; 192,128 | Spawn points as 'x,y; x,y; ...' in input-image pixels. Each point gets its own swarm and target colour. |
| tolerance | FLOAT | 40.01–250 | Colour tolerance (tau). Lower = tighter region. Lab distances run smaller; try 10-25 there. |
| ants | INT | 2501–5000 | — |
| steps | INT | 6001–20000 | Simulation ticks. More steps = cleaner, more complete contours. |
| color_space | COMBO | rgb | 3 options: rgb, weighted, lab |
| hand | COMBO | both | Wall-following handedness; 'both' splits the swarm into clockwise and counter-clockwise cohorts. |
| beta | FLOAT | 4.00.1–12 | Softmax temperature. Higher = greedier edge following. |
| epsilon | FLOAT | 0.050–0.5 | Random-move floor; prevents the swarm freezing. |
| seed | INT | 00–18446744073709550000 | — |
| mode | COMBO | masking | classic: MASK = thresholded edge pheromone. masking (Stage 2): MASK = sticky-latched, gap-closed, despeckled contour. |
| mask_threshold | FLOAT | 0.150.01–0.95 | classic mode only: threshold on the normalised edge map for the MASK output. |
| sticky_threshold | FLOAT | 0.200.05–0.6 | masking mode: latch a cell when its edge pheromone crosses this fraction of the field maximum. |
| freeze_after | INT | 00–20000 | masking mode: freeze (and clean) the mask after this many ticks. 0 = run all steps, then freeze. |
| no_decay | BOOLEAN | false | masking mode: stop edge-pheromone evaporation entirely. |
| max_side | INT | 5120–4096 | Downsample the longest side to this for simulation (0 = full resolution). Outputs are resampled back. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| edge_map | IMAGE | — |
| mask | MASK | — |