ComfyUI Node
kubakub mosaic illusion
Cuts a texture photo into mosaic tiles and picks or shades each tile so a target picture appears when seen from a distance. The tiles stay real material; strength sets how readable the hidden picture is.
kubakub mosaic illusion
- texture
- target
- image
- tile_values
- grid
◄tile_px48►
◄strength0.55►
◄modeselect►
◄quantise_texturetrue►
◄target_fitcover►
◄target_autocroptrue►
◄target_autolevelstrue►
◄target_blur6►
◄target_invertfalse►
◄contrast1.20►
◄adaptivefalse►
◄min_tile_px8►
◄detail0.060►
◄max_depth3►
◄edge_noise0.00►
◄edge_scale12►
◄mortar0.00►
◄mortar_value0.00►
◄jitter0.00►
◄palette_size12►
◄dither0.90►
◄level_radius6►
◄seed0►
Categorykubakub/lab/mosaic
Inputs (25)
| Name | Type | Default | Description |
|---|---|---|---|
| texture | IMAGE | The material photo (stone, tiles, bricks) the mosaic is cut from. Sets the output size; a batch gives one mosaic per image. | |
| target | IMAGE | The picture hidden in the mosaic. Only its brightness is used (first image of a batch). | |
| tile_px | INT | 482–2048 | Tile size in pixels. With adaptive on this is the largest tile. |
| strength | FLOAT | 0.550–1 | 0 = material only, 1 = target fully readable. Animate to move the resolving distance. |
| mode | COMBO | select | select picks the tile from the material's own palette whose value the picture needs, the way a mosaicist picks from a tray. Nothing is tinted. multiply darkens / brightens the tiles, mix blends them toward the target grey, lift only brightens where the target is light. |
| quantise_texture | BOOLEAN | true | Flatten each tile to one colour. Turn off when the texture is already tiled. |
| target_fitopt | COMBO | cover | How the target fits the texture size. cover fills and crops, contain fits it whole on mid grey, stretch distorts it to fit. |
| target_autocropopt | BOOLEAN | true | Trim a dark border so a cutout fills the frame. |
| target_autolevelsopt | BOOLEAN | true | Stretch the target's levels to full black to white, so a flat photo still reads. |
| target_bluropt | INT | 60–200 | Soften the target so it emerges instead of stamping a silhouette. |
| target_invertopt | BOOLEAN | false | Swap light and dark in the target. |
| contrastopt | FLOAT | 1.200–4 | Contrast of the target around mid grey. 1 = unchanged, higher makes the hidden picture punchier. |
| adaptiveopt | BOOLEAN | false | Split tiles where the motif has detail, keep them large where it is flat. |
| min_tile_pxopt | INT | 82–512 | adaptive only. Smallest tile in pixels; a tile is not split below this. |
| detailopt | FLOAT | 0.0600.005–0.5 | adaptive only. How much the motif must change inside a tile before it is split. Lower splits more. |
| max_depthopt | INT | 30–6 | adaptive only. How many times a tile may be halved (3 = down to 1/8 of tile_px). |
| edge_noiseopt | FLOAT | 0.000–0.6 | Roughness of the tile outlines, as a fraction of tile size. 0.10 to 0.20 looks hand cut. |
| edge_scaleopt | FLOAT | 122–200 | Noise wavelength in pixels. Small is jagged and chipped, large is wobbly. |
| mortaropt | FLOAT | 0.000–0.45 | Width of the joints between tiles, as a fraction of tile size. 0 = no joints. |
| mortar_valueopt | FLOAT | 0.000–1 | Grey level of the joints: 0 = black, 1 = white. |
| jitteropt | FLOAT | 0.000–0.5 | Random change of each tile's target value, so the hidden picture looks less mechanical. 0 = off. |
| palette_sizeopt | INT | 122–64 | select mode. How many tile colours are in the tray. Taken from the texture itself. |
| ditheropt | FLOAT | 0.900–3 | select mode. Breaks banding at the edges of the hidden shape. |
| level_radiusopt | FLOAT | 61–80 | select mode. Neighbourhood, in tiles, whose level gets shifted. Larger keeps more of the pattern. |
| seedopt | INT | 00–4294967295 | Random seed for jitter, edge noise and dither. Same seed = same mosaic. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The mosaic. |
| tile_values | IMAGE | The grey value each tile was asked for (the target as the tiles see it). |
| grid | IMAGE | The tile outlines: white tiles, black borders. |