Pixellab library expansion

This commit is contained in:
=
2026-10-02 07:01:10 -05:00
parent 0e905a2824
commit b9d634882c
7990 changed files with 116140 additions and 856 deletions

4
.gitignore vendored
View File

@@ -23,8 +23,8 @@ preview/
# Early PixelLab experiment outputs (the library build itself lives in pixellab_src/, parts_pl*/)
pixellab_out/
# Cross-process API job lock (pixellab_api.py)
pixellab_src/.api.lock
# Cross-process API job slots (pixellab_api.py)
pixellab_src/.api_slots/
# Scratch reports
size_changes.txt

View File

@@ -15,7 +15,7 @@ There are two part libraries:
pip install -r requirements.txt
```
You only need an [OpenRouter](https://openrouter.ai) API key if you want the type picked automatically. Skip the key by passing `--type`.
You only need an [OpenRouter](https://openrouter.ai) API key if you want the type picked automatically. Set `OPENROUTER_API_KEY` in the environment or in `.env`, or skip the key by passing `--type`.
## Generate a sprite
@@ -83,7 +83,11 @@ python pixellab_library.py cost # spend so far (pixella
python validate_parts.py --library pixellab --sample 3000
```
To change a part, edit its spec (new `seed` or wording), then run `generate <body> --parts <part> --force` and `extract <body>`. Regenerating a base deletes that body's old edits.
To change a part, edit its spec (new `seed` or wording), then run `generate <body> --parts <part> --force` and `extract <body>`. Regenerating a base deletes that body's old edits and variants.
A new body needs no parts of its own: for each slot without a part, `generate` makes a probe edit (a standard horn pair, wing pair or tail) that is used only to find where that slot attaches. A body's `variants` are edits of its base ("make it chubbier with crimson stripes"): the same creature idea with a different look. They share the parent's attach points and tags. `generate` runs up to 10 PixelLab jobs at once, shared between all processes. `preview <body>` writes one review sheet per family (base, attach points, a test fit with library parts, every variant), and `preview --sheet out.png <bodies...>` shows many raw bases on one image.
`generate` stops before starting new work once the month's included PixelLab generations drop to 800 (`PIXELLAB_RESERVE` changes the floor), so a big run can't use up the whole monthly allowance.
## Classic library

View File

@@ -1,11 +1,24 @@
import os
import sys
import json
from pathlib import Path
import requests
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY")
def _key_from_env_file(name):
env = Path(__file__).with_name(".env")
if env.exists():
for line in env.read_text().splitlines():
key, sep, value = line.strip().partition("=")
if sep and key.strip() == name:
return value.strip().strip("'\"")
return None
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY") or _key_from_env_file("OPENROUTER_API_KEY")
if not OPENROUTER_API_KEY:
sys.exit("Set OPENROUTER_API_KEY first: export OPENROUTER_API_KEY='sk-or-v1-...'")
sys.exit("Set OPENROUTER_API_KEY first: export it, or put OPENROUTER_API_KEY=sk-or-v1-... in .env")
# All 15 Gen 1 types, tuned for home service businesses. Each trade is listed under
# exactly one type, and Rock is limited to stone/roofing work so "construction-y"

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
parts_pl/back/pl_bindle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

BIN
parts_pl/back/pl_gears.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

BIN
parts_pl/body/pl_alien.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

BIN
parts_pl/body/pl_alpaca.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

BIN
parts_pl/body/pl_amber.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

BIN
parts_pl/body/pl_ankylo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
parts_pl/body/pl_ant.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

BIN
parts_pl/body/pl_ant_b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

BIN
parts_pl/body/pl_ant_c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

BIN
parts_pl/body/pl_ant_d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
parts_pl/body/pl_ape.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

BIN
parts_pl/body/pl_ape_b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

BIN
parts_pl/body/pl_ape_c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

BIN
parts_pl/body/pl_ape_d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
parts_pl/body/pl_aphid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

BIN
parts_pl/body/pl_armor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
parts_pl/body/pl_auger.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

BIN
parts_pl/body/pl_bamboo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Some files were not shown because too many files have changed in this diff Show More