ComfyUI workflows and API scripts for generating tiles. https://spacecruft.org/livery/gen-tile
  • Python 81.9%
  • Shell 18.1%
Find a file
2026-03-16 14:15:45 -06:00
img Example tile image 2026-03-16 13:05:25 -06:00
prompts Example prompts 2026-03-16 11:07:49 -06:00
.gitignore git ignores 2026-03-16 10:56:12 -06:00
.python-version Use python 3.13 2026-03-16 10:58:41 -06:00
download_comfyui_models.sh Script to download models 2026-03-16 11:18:57 -06:00
gen-tile-batch.py Script for generating batches of tiles 2026-03-16 11:01:10 -06:00
LICENSE-apache.txt Apache 2.0 2026-03-16 10:53:00 -06:00
README.md Example tile noted 2026-03-16 13:05:32 -06:00
requirements-dev.txt Dev deps 2026-03-16 11:01:45 -06:00
requirements.txt aggdraw dep isn't needed 2026-03-16 11:53:19 -06:00
resize-640.py quick & dirty resize script for previews 2026-03-16 14:15:45 -06:00
run-batch.sh Fix prompt path 2026-03-16 11:07:57 -06:00
tile-image.py Scripts to make larger images from tiles 2026-03-16 11:16:40 -06:00
tile-to-size.py Scripts to make larger images from tiles 2026-03-16 11:16:40 -06:00

gen-tile

ComfyUI workflows and API scripts for generating image tiles.

Run the gen-tile-batch.py script to generate image tiles based on prompts without using ComfyUI browser (headless).

Slop coded.

Example

Example Tile

Example Tile

Install

Thusly, with Python 3.13:

git clone https://spacecruft.org/livery/gen-tile
cd gen-tile/
python -m venv venv
source venv/bin/activate
pip install -U setuptools pip wheel
pip install -r requirements.txt
# optional developer deps
pip install -r requirements-dev.txt

Help

$ ./gen-tile-batch.py --help
usage: gen-tile-batch.py [-h] [--prompt PROMPT] [--prompt-file PROMPT_FILE] [--negative NEGATIVE] [--width WIDTH] [--height HEIGHT] [--steps STEPS] [--cfg CFG] [--count COUNT] [--prefix PREFIX] [--seed SEED]
                         [--ports PORTS] [--host HOST] [--output OUTPUT]

ComfyUI Batch Image Generator

options:
  -h, --help            show this help message and exit
  --prompt PROMPT       Positive prompt text
  --prompt-file PROMPT_FILE
                        File with prompts (one per line, # comments and blank lines ignored). Overrides --prompt and --count.
  --negative NEGATIVE   Negative prompt text
  --width WIDTH         Image width (default: 2560)
  --height HEIGHT       Image height (default: 2560)
  --steps STEPS         Sampling steps (default: 50)
  --cfg CFG             CFG scale (default: 2.5)
  --count COUNT         Number of images to generate (default: 8)
  --prefix PREFIX       Filename prefix (default: batch)
  --seed SEED           Base seed (default: random). Each image gets seed+N
  --ports PORTS         Comma-separated list of ComfyUI ports (default: 8188)
  --host HOST           ComfyUI host (default: 127.0.0.1)
  --output OUTPUT       Local directory to download images to (default: ./output)

Usage

Such as:

./gen-tile-batch.py --port 9180 --width 2560 --height 2560 \
    --count 1 --output output \
    --prompt "seamless tileable wallpaper pattern in the style of William Morris, Arts and Crafts movement, dense intertwining acanthus leaves and curling vines, symmetrical botanical ornament, flat decorative illustration, hand-block-printed aesthetic, indigo blue and sage green on cream background, medieval floral motifs, highly detailed intricate linework, repeating pattern design, textile print"

There's also an example script run-batch.sh that can be referenced.

Prompts

Exampe prompts are in the prompts/ directory.

Tiling

The gen-tile-batch.py script generates a single tile. To make a grid of the tiles, there are a couple scripts that can be used, depending on the use case:

  • tile-image.py
  • tile-to-size.py

Tile Image

$ ./tile-image.py --help
usage: tile-image.py [-h] [-o OUTPUT] [--scale SCALE] image cols rows

Tile an image into a grid

positional arguments:
  image                Input image file
  cols                 Number of columns
  rows                 Number of rows

options:
  -h, --help           show this help message and exit
  -o, --output OUTPUT  Output filename (default: <input>_<cols>x<rows>.png)
  --scale SCALE        Scale factor for each tile before tiling (default: 1.0)

Tile to Size

$ ./tile-to-size.py --help
usage: tile-to-size.py [-h] [-o OUTPUT] [-W WIDTH] [-H HEIGHT] tile_image

Tile an image to fill a target size.

positional arguments:
  tile_image           Path to the source tile image (e.g. tile.png)

options:
  -h, --help           show this help message and exit
  -o, --output OUTPUT  Output filename (default: <input>-tile.png)
  -W, --width WIDTH    Target width in pixels (default: 8818)
  -H, --height HEIGHT  Target height in pixels (default: 15826)

Default target: 8818x15826 (43"x79" shower curtain at 200 DPI)

Download Models

ComfyUI, AFAICT, doesn't use standard Huggingface paths, so you can't just use Qwen/Qwen-Image.

This scriptlet downloads models for ComfyUI to make it happy. It downloads a lot more models than are needed, so you may want to comment some out:

./download_comfyui_models.sh

License

Apache 2.0.

Copyright © 2026 Jeff Moe.