🍒Seamless_Icon_Generator / 无缝图标生成
Two icon sets, a grid, and a seed
- 背景图片
- 图标组1
- 图标组2
- 图像
- 图标位置数据
If you've ever needed a sheet of icons arranged on a background for a game UI, a texture tile, or a sticker template, you know the alternative: doing it by hand in an image editor, pixel by pixel. Seamless_Icon_Generator is the KimNodes shortcut - it takes a background, two sets of icons, and a handful of layout numbers, and produces a full gridded arrangement with rotation and randomized ordering, ready to be cropped back apart.
This is one of the pack's headline features (there's a whole "icon processing" section built around it), and it sits at the front of a two-node pipeline: this node lays the sheet out, and Icon_Position_Cropper (or JSON_Image_Compositor) takes it apart again using the position data.
How it works
You give it a 背景图片 (background) plus two groups of icons, 图标组1 and 图标组2. It scales each group to its own target size (keeping aspect ratio, LANCZOS), arranges them in columns, and repeats those columns across the width of the scene. The two groups alternate column-to-column - that's the "seamless" part: staggered, alternating icons tile without obvious repetition. Within each column section it distributes the icons vertically, offsets alternate rows left/right, applies the 旋转角度, and, if 随机排序 is on, shuffles the icon order using your 随机种子 (use -1 for a fresh layout each run).
Two details worth knowing: it draws a thin red outline around each icon before compositing (that's part of the visual style - you can see it in the README example), and it writes the position of every icon into the 图标位置数据 (DATA) output, which is exactly what the companion cropper needs.
The inputs that matter
图标1尺寸/图标2尺寸- target pixel size for each icon group.随机种子- reproducibility. Same seed, same layout; -1 for random each time.列向下重复次数- how many rows of icons each column gets.每组数量- icons per group.列首尾icon中心点总高度- the vertical span the column fills (default 2000), which together with the row count sets the spacing.旋转角度,列间距,列偏移,行偏移- the layout fine-tuners.
Outputs: 图像 (the composited IMAGE) and 图标位置数据 (the DATA list of positions). The DATA output is the important one - feed it into Icon_Position_Cropper.
Installation
Standard KimNodes pack install (Manager → search "ComfyUI_KimNodes", or git clone https://github.com/wjl0313/ComfyUI_KimNodes into custom_nodes), then restart. No extra dependencies for this node - it's pure PIL and torch.
Common issues
- Inputs act weird when you feed a batch - this node sets
INPUT_IS_LIST, so icon inputs are treated as lists. Feed it batches and it'll handle each, but a single image works too. - Icons look tiny or the layout collapses - 每组数量 defaults to 1, so you get one icon per group until you raise it. If 列首尾icon中心点总高度 is far from the scene height, spacing gets uneven; that's the first dial to check.
- No red boxes / no rotation - 旋转角度 defaults to 40 and the outline is drawn in code, but if 随机排序 is off the whole thing is deterministic, which trips people up when they expect variety.
It's a niche tool, but if you make icon sheets or sticker packs for a living, it'll pay for the pack on its own.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| 背景图片 | IMAGE | — | |
| 图标组1 | IMAGE | — | |
| 图标组2 | IMAGE | — | |
| 随机种子 | INT | — | |
| 图标1尺寸 | INT | 1281–512 | — |
| 图标2尺寸 | INT | 961–512 | — |
| 每组数量 | INT | 11–20 | — |
| 列向下重复次数 | INT | 101–50 | — |
| 列首尾icon中心点总高度 | INT | 2000100–4096 | — |
| 列间距 | INT | 250–512 | — |
| 列偏移 | INT | 135-512–512 | — |
| 行偏移 | INT | 50-512–512 | — |
| 旋转角度 | FLOAT | 40-180–180 | — |
| 随机排序 | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 图像 | IMAGE | — |
| 图标位置数据 | DATA | — |