Local-first web app for generating print-and-play RPG creature assets with ComfyUI.
The current slice focuses on paper minis: the app generates a single front-facing creature image, stores the generation settings, and builds printable PDF sheets with fold/cut guides.
This is an experiment, not a packaged release. It is intended to run locally and keep generated assets, model files, ComfyUI, and runtime settings outside git.
- SvelteKit local web app for creature paper minis.
- ComfyUI image generation provider.
- SD 1.5 checkpoint + PrintableHeroes-style LoRA workflow.
- Prompt suggestions from
prompt_library/. - Universal PrintableHeroes prompt builder based on common tags from the prompt library.
- Generated asset metadata stores prompt, negative prompt, seed, dimensions, model settings, and print size.
- A4 printable PDF export with mirrored fold layout, tabs, cut guides, and optional nameplate.
- Nix with flakes enabled.
- A local GPU setup supported by ComfyUI/PyTorch.
v1-5-pruned-emaonly.safetensorsSD 1.5 checkpoint.printableheroes-paperminis-v1-3.safetensorsLoRA, or another LoRA configured in the app.
The Nix shell provides Node, pnpm, Python, uv, sqlite, and a local rpgassets-comfyui launcher.
Enter the dev shell:
nix developInstall JavaScript dependencies:
pnpm installPut model files in the ignored runtime directories:
runtime-models/checkpoints/v1-5-pruned-emaonly.safetensors
runtime-models/loras/printableheroes-paperminis-v1-3.safetensors
Model files are intentionally not committed. Download them from their original sources and follow their licenses/terms.
Start ComfyUI in one terminal:
nix develop
rpgassets-comfyuiStart the app in another terminal:
nix develop
pnpm run devOpen the local URL printed by Vite, usually http://localhost:5173.
The dev shell provides rpgassets-comfyui. On first run it:
- clones ComfyUI into
runtime-comfyui/ComfyUI - creates
runtime-comfyui/venv - installs ComfyUI Python dependencies with
uv - links local checkpoints from
runtime-models/checkpoints/ - links local LoRAs from
runtime-models/loras/ - starts ComfyUI at
http://127.0.0.1:8188
Optional VRAM mode arguments can be passed through RPGASSETS_COMFY_ARGS:
RPGASSETS_COMFY_ARGS="--lowvram" rpgassets-comfyui
RPGASSETS_COMFY_ARGS="--highvram" rpgassets-comfyui--highvram tries to keep more model data loaded, but can fail on 6 GB GPUs. --lowvram is safer but may unload more aggressively.
Use /settings in the app to configure:
- ComfyUI URL
- checkpoint name
- LoRA name
- LoRA strength
- VRAM mode note for the launcher
- whether to try keeping the model loaded
Defaults can also be overridden when starting the app:
COMFYUI_URL=http://127.0.0.1:8188 COMFYUI_CHECKPOINT=other-model.safetensors COMFYUI_LORA=other-lora.safetensors pnpm run devRuntime settings are saved under storage/, which is ignored by git.
The repository includes a script to identify common tags and words from prompt_library/:
pnpm run analyze:promptsUse this when changing the universal prompt or preparing captions for a new LoRA.
src/routes/+page.svelte: generator form and asset gallery.src/routes/+page.server.ts: generation action and asset loading.src/routes/settings/: local model/LoRA settings UI.src/lib/creatures.ts: creature types, print sizes, universal prompt builder, generation preset.src/lib/server/comfyui.ts: ComfyUI workflow integration.src/lib/server/print.ts: PDF sheet generation.src/lib/server/storage.ts: local runtime asset storage.prompt_library/: prompt examples used for suggestions and analysis.scripts/analyze-prompt-library.mjs: prompt-library frequency analysis.
The following paths are ignored and should stay local:
runtime-models/: checkpoints and LoRAs.runtime-comfyui/: cloned ComfyUI checkout and Python venv.storage/: generated images, asset metadata, and local settings..pnpm-home/andnode_modules/: package manager/dependency state.
pnpm run check
pnpm run buildRun these inside nix develop if the required tools are not available globally.
See TODO.md for planned support for props, terrain grids, transparent backgrounds, external images, multi-unit naming, saved print pages, and custom LoRA workflow notes.
Application code is licensed under the MIT License. See LICENSE.
Generated images, third-party model files, LoRAs, ComfyUI, Stable Diffusion checkpoints, and any source datasets/prompts may have separate licenses or usage terms. Review those before publishing or redistributing assets.