- Python 81.9%
- Shell 18.1%
| img | ||
| prompts | ||
| .gitignore | ||
| .python-version | ||
| download_comfyui_models.sh | ||
| gen-tile-batch.py | ||
| LICENSE-apache.txt | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| resize-640.py | ||
| run-batch.sh | ||
| tile-image.py | ||
| tile-to-size.py | ||
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
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.
