The flat cut-outs were the cheapest content on the board and the only tier with a shipping consumer, but wardrobegod couldn't show one: scan() filtered PNGs out of garments/ (fixed in Phase 0) and there was no compositor, no slots, no preview. Now there is a working dress-up. · library/doll/ seeded with 90sDJsim's 441 shipped sprites (165 top, 110 bottom, 60 shoes, 57 hat, base body) — an instant starter wardrobe rather than a cold start. · tools/doll.py wraps djsim's compositor. It deliberately does NOT import doll_composite: that module pulls numpy at import time for a keyer and an HSV recolour we never use (the farm's RMBG-2.0 does our keying), and numpy isn't installable here under PEP 668. Instead the measured anchors are parsed out of its source with ast, so there is still exactly one source of truth and they cannot drift; place() is a pure-PIL port. · slugify() reproduces djsim's item_art() _art_slug character for character, verified against it. That equality IS the drop-in contract — a near-miss silently falls back to generic slot art instead of erroring, so it's the kind of bug you'd ship without noticing. · /api/doll/gen runs the proven pipeline: flux_local on SOLID GREEN -> farm RMBG-2.0 -> staged to 704x1408. Green is not a preference: grey and checkerboard backgrounds eat garments in the key, and flux can't spell, so no text ever goes in the prompt. · /api/doll/compose composes server-side with PIL, so the browser preview and the exported PNG are the same bytes rather than two renderers that drift. · /api/doll/export writes into a LIVE game directory, so it defaults to a dry run and refuses any stem without _i_ — overwriting a generic slot fallback would restyle every unarted item in a shipping game. · UI: a doll 2D tab with per-slot pickers, randomise, strip, and export. Verified: composed a dressed doll from real sprites (correct base->bottom->shoes->top->hat order), catalogue reports 392 layers, export dry-run and the generic-art guard both behave. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
1.6 KiB
Python
33 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Turn the year-writer workflow output (JSON {years: {'1991': [{name,slot,desc},...]}}) into
|
|
per-year TSV manifests (art_wardrobe91.tsv ... art_wardrobe99.tsv). Template + slugify are
|
|
IDENTICAL to build_wardrobe_manifest.py / server.py _art_slug — that contract is load-bearing.
|
|
usage: python3 tools/build_wardrobe_decade.py descriptions.json"""
|
|
import json, os, re, sys
|
|
|
|
ROOT = os.path.join(os.path.dirname(__file__), '..')
|
|
slug = lambda s: re.sub(r'[^a-z0-9]+', '_', s.lower()).strip('_')
|
|
VIEW = {'hat': 'front view', 'top': 'front view laid flat with the sleeves down',
|
|
'bottom': 'front view laid perfectly flat on the ground',
|
|
'shoes': 'the pair side by side, front view'}
|
|
TAIL = ('floating centered on a plain pure white background, painterly stylized 3d game '
|
|
'illustration, full item visible, no body, no person, no mannequin, no hanger, '
|
|
'no coat hanger, no text, no logos')
|
|
|
|
data = json.load(open(sys.argv[1]))['years']
|
|
total = 0
|
|
for year, items in sorted(data.items()):
|
|
out = os.path.join(ROOT, 'tools', f'art_wardrobe{year[2:]}.tsv')
|
|
with open(out, 'w') as fh:
|
|
fh.write(f'# {len(items)} wardrobe items — {year} ranges, 704x704 doll garment layers.\n')
|
|
for it in items:
|
|
s = it['slot']
|
|
if s not in VIEW: print('SKIP bad slot', it); continue
|
|
stem = f"{s}_i_{slug(it['name'])}"
|
|
fh.write(f"{stem}\t"
|
|
f"paper doll clothing item for a dress-up game, {it['desc']}, "
|
|
f"{year} australia, {VIEW[s]}, {TAIL}\n")
|
|
total += 1
|
|
print('wrote', out, len(items))
|
|
print('total prompts:', total)
|