Pixellab library expansion
4
.gitignore
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
BIN
parts_pl/back/pl_backpack.png
Normal file
|
After Width: | Height: | Size: 292 B |
BIN
parts_pl/back/pl_barbell.png
Normal file
|
After Width: | Height: | Size: 422 B |
BIN
parts_pl/back/pl_bedroll.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
parts_pl/back/pl_bell_collar.png
Normal file
|
After Width: | Height: | Size: 199 B |
BIN
parts_pl/back/pl_bindle.png
Normal file
|
After Width: | Height: | Size: 236 B |
BIN
parts_pl/back/pl_bow_gift.png
Normal file
|
After Width: | Height: | Size: 398 B |
BIN
parts_pl/back/pl_brambles_back.png
Normal file
|
After Width: | Height: | Size: 435 B |
BIN
parts_pl/back/pl_cactus_back.png
Normal file
|
After Width: | Height: | Size: 205 B |
BIN
parts_pl/back/pl_coffin_back.png
Normal file
|
After Width: | Height: | Size: 261 B |
BIN
parts_pl/back/pl_crescent_moon.png
Normal file
|
After Width: | Height: | Size: 493 B |
BIN
parts_pl/back/pl_drum_back.png
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
parts_pl/back/pl_fan_folding.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
parts_pl/back/pl_feather_tuft_back.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
parts_pl/back/pl_flower_lei.png
Normal file
|
After Width: | Height: | Size: 398 B |
BIN
parts_pl/back/pl_gears.png
Normal file
|
After Width: | Height: | Size: 475 B |
BIN
parts_pl/back/pl_gloves_slung.png
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
parts_pl/back/pl_honeycomb.png
Normal file
|
After Width: | Height: | Size: 294 B |
BIN
parts_pl/back/pl_lantern_pack.png
Normal file
|
After Width: | Height: | Size: 236 B |
BIN
parts_pl/back/pl_moss_mantle.png
Normal file
|
After Width: | Height: | Size: 403 B |
BIN
parts_pl/back/pl_parasol.png
Normal file
|
After Width: | Height: | Size: 380 B |
BIN
parts_pl/back/pl_pennant.png
Normal file
|
After Width: | Height: | Size: 191 B |
BIN
parts_pl/back/pl_pinwheel.png
Normal file
|
After Width: | Height: | Size: 315 B |
BIN
parts_pl/back/pl_potion_flasks.png
Normal file
|
After Width: | Height: | Size: 507 B |
BIN
parts_pl/back/pl_quills_gold.png
Normal file
|
After Width: | Height: | Size: 799 B |
BIN
parts_pl/back/pl_ruff_feather.png
Normal file
|
After Width: | Height: | Size: 924 B |
BIN
parts_pl/back/pl_saddle_riding.png
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
parts_pl/back/pl_satchel.png
Normal file
|
After Width: | Height: | Size: 296 B |
BIN
parts_pl/back/pl_scallop_shell.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
parts_pl/back/pl_scuba_tank.png
Normal file
|
After Width: | Height: | Size: 329 B |
BIN
parts_pl/back/pl_shell_hex.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
parts_pl/back/pl_shoulder_pads.png
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
parts_pl/back/pl_smokestack.png
Normal file
|
After Width: | Height: | Size: 330 B |
BIN
parts_pl/back/pl_snowflake_back.png
Normal file
|
After Width: | Height: | Size: 667 B |
BIN
parts_pl/back/pl_solar_panels.png
Normal file
|
After Width: | Height: | Size: 436 B |
BIN
parts_pl/back/pl_sprouts_back.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
parts_pl/back/pl_swords_crossed.png
Normal file
|
After Width: | Height: | Size: 509 B |
BIN
parts_pl/back/pl_tufts_shoulder.png
Normal file
|
After Width: | Height: | Size: 364 B |
BIN
parts_pl/back/pl_windup_key.png
Normal file
|
After Width: | Height: | Size: 158 B |
BIN
parts_pl/back/pl_wings_butterfly.png
Normal file
|
After Width: | Height: | Size: 543 B |
BIN
parts_pl/back/pl_wings_fairy.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
parts_pl/back/pl_wings_ice.png
Normal file
|
After Width: | Height: | Size: 427 B |
BIN
parts_pl/back/pl_wings_leaf.png
Normal file
|
After Width: | Height: | Size: 524 B |
BIN
parts_pl/back/pl_wings_origami.png
Normal file
|
After Width: | Height: | Size: 335 B |
BIN
parts_pl/back/pl_wings_tattered.png
Normal file
|
After Width: | Height: | Size: 385 B |
BIN
parts_pl/body/pl_aardvark.png
Normal file
|
After Width: | Height: | Size: 909 B |
BIN
parts_pl/body/pl_aardvark_b.png
Normal file
|
After Width: | Height: | Size: 795 B |
BIN
parts_pl/body/pl_aardvark_c.png
Normal file
|
After Width: | Height: | Size: 930 B |
BIN
parts_pl/body/pl_alien.png
Normal file
|
After Width: | Height: | Size: 685 B |
BIN
parts_pl/body/pl_alien_b.png
Normal file
|
After Width: | Height: | Size: 737 B |
BIN
parts_pl/body/pl_alien_c.png
Normal file
|
After Width: | Height: | Size: 768 B |
BIN
parts_pl/body/pl_alien_d.png
Normal file
|
After Width: | Height: | Size: 725 B |
BIN
parts_pl/body/pl_alpaca.png
Normal file
|
After Width: | Height: | Size: 600 B |
BIN
parts_pl/body/pl_alpaca_b.png
Normal file
|
After Width: | Height: | Size: 590 B |
BIN
parts_pl/body/pl_alpaca_c.png
Normal file
|
After Width: | Height: | Size: 621 B |
BIN
parts_pl/body/pl_alpaca_d.png
Normal file
|
After Width: | Height: | Size: 522 B |
BIN
parts_pl/body/pl_amber.png
Normal file
|
After Width: | Height: | Size: 632 B |
BIN
parts_pl/body/pl_amber_b.png
Normal file
|
After Width: | Height: | Size: 636 B |
BIN
parts_pl/body/pl_amber_c.png
Normal file
|
After Width: | Height: | Size: 945 B |
BIN
parts_pl/body/pl_amber_d.png
Normal file
|
After Width: | Height: | Size: 823 B |
BIN
parts_pl/body/pl_ankylo.png
Normal file
|
After Width: | Height: | Size: 814 B |
BIN
parts_pl/body/pl_ankylo_b.png
Normal file
|
After Width: | Height: | Size: 940 B |
BIN
parts_pl/body/pl_ankylo_c.png
Normal file
|
After Width: | Height: | Size: 681 B |
BIN
parts_pl/body/pl_ankylo_d.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
parts_pl/body/pl_ant.png
Normal file
|
After Width: | Height: | Size: 658 B |
BIN
parts_pl/body/pl_ant_b.png
Normal file
|
After Width: | Height: | Size: 815 B |
BIN
parts_pl/body/pl_ant_c.png
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
parts_pl/body/pl_ant_d.png
Normal file
|
After Width: | Height: | Size: 741 B |
BIN
parts_pl/body/pl_antlion.png
Normal file
|
After Width: | Height: | Size: 949 B |
BIN
parts_pl/body/pl_antlion_b.png
Normal file
|
After Width: | Height: | Size: 746 B |
BIN
parts_pl/body/pl_antlion_c.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
parts_pl/body/pl_ape.png
Normal file
|
After Width: | Height: | Size: 797 B |
BIN
parts_pl/body/pl_ape_b.png
Normal file
|
After Width: | Height: | Size: 906 B |
BIN
parts_pl/body/pl_ape_c.png
Normal file
|
After Width: | Height: | Size: 981 B |
BIN
parts_pl/body/pl_ape_d.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
parts_pl/body/pl_aphid.png
Normal file
|
After Width: | Height: | Size: 642 B |
BIN
parts_pl/body/pl_aphid_b.png
Normal file
|
After Width: | Height: | Size: 657 B |
BIN
parts_pl/body/pl_aphid_c.png
Normal file
|
After Width: | Height: | Size: 757 B |
BIN
parts_pl/body/pl_aphid_d.png
Normal file
|
After Width: | Height: | Size: 727 B |
BIN
parts_pl/body/pl_armor.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
parts_pl/body/pl_armor_b.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
parts_pl/body/pl_armor_c.png
Normal file
|
After Width: | Height: | Size: 725 B |
BIN
parts_pl/body/pl_armor_d.png
Normal file
|
After Width: | Height: | Size: 764 B |
BIN
parts_pl/body/pl_arowana.png
Normal file
|
After Width: | Height: | Size: 715 B |
BIN
parts_pl/body/pl_arowana_b.png
Normal file
|
After Width: | Height: | Size: 774 B |
BIN
parts_pl/body/pl_arowana_c.png
Normal file
|
After Width: | Height: | Size: 781 B |
BIN
parts_pl/body/pl_arowana_d.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
parts_pl/body/pl_auger.png
Normal file
|
After Width: | Height: | Size: 934 B |
BIN
parts_pl/body/pl_auger_b.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
parts_pl/body/pl_auger_c.png
Normal file
|
After Width: | Height: | Size: 1003 B |
BIN
parts_pl/body/pl_auger_d.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
parts_pl/body/pl_axolotl_b.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
parts_pl/body/pl_axolotl_c.png
Normal file
|
After Width: | Height: | Size: 685 B |
BIN
parts_pl/body/pl_axolotl_d.png
Normal file
|
After Width: | Height: | Size: 909 B |
BIN
parts_pl/body/pl_balloon.png
Normal file
|
After Width: | Height: | Size: 686 B |
BIN
parts_pl/body/pl_balloon_c.png
Normal file
|
After Width: | Height: | Size: 815 B |
BIN
parts_pl/body/pl_bamboo.png
Normal file
|
After Width: | Height: | Size: 811 B |
BIN
parts_pl/body/pl_bamboo_b.png
Normal file
|
After Width: | Height: | Size: 812 B |