gigaslop/tools/mb_add.py
type-two 32a2d3a248 M2: platform-decay treadmill, infra tier, Cash Furnace
Platforms adapt to your slop (ALGO HEAT): each publish raises spam-filter
wariness which throttles all view rates up to 85%; training a new model
tier slips past the filters. Verified loop: publish -> squeeze -> train ->
relief. New hardware: 20A sub-panel (+1500W), fiber uplink (1Gbps, 8
ports), Cash Furnace (burns $1.50/s for +40% views, breaker-immune).
Fix: New Game wipe no longer clobbered by the beforeunload autosave.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 10:05:30 +10:00

35 lines
1.3 KiB
Python

#!/usr/bin/env python3
"""One-off: generate additional sprites without re-running the whole batch.
Usage: python3 tools/mb_add.py (edit NEW below per run)"""
import json, pathlib, sys
sys.path.insert(0, str(pathlib.Path(__file__).parent))
from mb_gen import ROOT, STYLE, flux_spec, run_batch, upload, beat
NEW = [
("cash_furnace", "a cast iron pot-belly furnace with door open, burning dollar bills visible in the flames, loose stacks of cash on the floor beside it, warm orange fire glow"),
]
gen = ROOT / "public/assets/gen"
raw = run_batch([flux_spec(n, STYLE + d, 768, 768) for n, d in NEW], gen)
beat("bg removal for new sprites")
cuts = run_batch(
[(f"{n}_cut", "bg_remove_local", upload(gen / f"{n}.png"),
{"resolution": 1024, "background": "transparent"}) for n, _ in NEW], gen)
# autocrop like the main pipeline
from PIL import Image
for n, _ in NEW:
p = gen / f"{n}_cut.png"
im = Image.open(p).convert("RGBA")
bbox = im.split()[-1].getbbox()
if bbox:
l, t, r, b = bbox
im.crop((max(0, l - 8), max(0, t - 8), min(im.width, r + 8), min(im.height, b + 8))).save(p)
mpath = ROOT / "tools/mb_manifest.json"
m = json.loads(mpath.read_text())
m.update(raw); m.update(cuts)
mpath.write_text(json.dumps(m, indent=2))
beat(f"added {list(raw)} + cuts")