← back to Wallco Ai
dig-1984: 100-colorway batch (50 tone-on-tone + 50 contrasting) via Gemini 2.5 image-edit, source pinned to Shopify CDN copy
bb126fc64b9c0a7d1d75ed83f8040140ff4bac03 · 2026-05-13 12:13:30 -0700 · SteveStudio2
Files touched
A scripts/imperial_garden_colorways_batch.js
Diff
commit bb126fc64b9c0a7d1d75ed83f8040140ff4bac03
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Wed May 13 12:13:30 2026 -0700
dig-1984: 100-colorway batch (50 tone-on-tone + 50 contrasting) via Gemini 2.5 image-edit, source pinned to Shopify CDN copy
---
scripts/imperial_garden_colorways_batch.js | 295 +++++++++++++++++++++++++++++
1 file changed, 295 insertions(+)
diff --git a/scripts/imperial_garden_colorways_batch.js b/scripts/imperial_garden_colorways_batch.js
new file mode 100644
index 0000000..2399bda
--- /dev/null
+++ b/scripts/imperial_garden_colorways_batch.js
@@ -0,0 +1,295 @@
+#!/usr/bin/env node
+/**
+ * Generate 100 new colorways of DIG-1984 "The Original Imperial Garden by
+ * Charles Barone" via Gemini 2.5 Flash Image Edit. Source pulled from the
+ * Shopify CDN copy and cached at /tmp/wallco-sources/DIG-1984.jpg.
+ *
+ * - 50 TONE-ON-TONE: pattern + background sit in the same hue family,
+ * low contrast, "ghosted" wallcovering feel. 5 hue families × 10 each.
+ * - 50 CONTRASTING: pattern motif color contrasts sharply with the
+ * ground. 5 thematic palettes × 10 each.
+ *
+ * Outputs:
+ * - ~/Projects/wallco-ai/data/generated/dig1984_<ts>_<seed>.png
+ * - row in spoon_all_designs (category='colorways-imperial-garden-barone',
+ * is_published=true → live on /designs)
+ *
+ * Run: cd ~/Projects/wallco-ai && node scripts/imperial_garden_colorways_batch.js
+ * Cost: ~100 × $0.001 (gemini-2.5-flash-image) ≈ $0.10, logged via cost-tracker.
+ *
+ * DOES NOT push to Shopify — review on /designs?cat=colorways-imperial-garden-barone first.
+ */
+'use strict';
+require('dotenv').config({ path: require('path').join(__dirname, '..', '.env') });
+const fs = require('fs');
+const path = require('path');
+const crypto = require('crypto');
+const { execSync, spawnSync } = require('child_process');
+
+const KEY = process.env.GEMINI_API_KEY;
+if (!KEY) { console.error('GEMINI_API_KEY missing'); process.exit(1); }
+const SRC = '/tmp/wallco-sources/DIG-1984.jpg';
+if (!fs.existsSync(SRC)) {
+ console.error(`source missing: ${SRC} — run: curl -sf -o ${SRC} https://cdn.shopify.com/s/files/1/0015/4117/7456/files/8ca62dc624b6c234a8cf2e420439f04e.jpg`);
+ process.exit(1);
+}
+const SRC_B64 = fs.readFileSync(SRC).toString('base64');
+const OUT_DIR = path.join(__dirname, '..', 'data', 'generated');
+fs.mkdirSync(OUT_DIR, { recursive: true });
+
+const DB = process.env.WALLCO_DB || 'dw_unified';
+const PSQL = (process.platform === 'linux')
+ ? `sudo -n -u postgres psql ${DB} -At -q`
+ : `psql ${DB} -At -q`;
+function psql(sql) { return execSync(PSQL, { input: sql, encoding: 'utf8' }).trim(); }
+function esc(v) { if (v == null) return 'NULL'; return "'" + String(v).replace(/'/g, "''") + "'"; }
+
+// ─────────────────────────────────────────────────────────────────────────────
+// TONE-ON-TONE — 50 colorways across 5 hue families. Pattern motif + ground
+// share the same hue, separated only by value (light vs. dark) and a hint of
+// chroma. Reads as a ghosted, sophisticated wallcovering — pattern visible but
+// quiet.
+// ─────────────────────────────────────────────────────────────────────────────
+const TONE_ON_TONE = [
+ // 10 × GREENS
+ { name: 'Whisper Sage', family: 'green', prompt: 'Recolor everything into the SAGE GREEN family ONLY. The ground becomes pale sage; the pattern motif becomes a slightly darker, more saturated sage with subtle gray-green undertones. No other hues anywhere. Tone-on-tone wallpaper feel.' },
+ { name: 'Celadon Mist', family: 'green', prompt: 'Recolor into the CELADON family ONLY. Background is pale celadon (#dbe6d7); pattern motif is one shade deeper celadon with soft jade highlights. Strictly mono-hue.' },
+ { name: 'Pistachio Tonal', family: 'green', prompt: 'Recolor into the PISTACHIO family ONLY. Light pistachio ground; medium pistachio motif. Tone-on-tone, no contrasting hue.' },
+ { name: 'Emerald Ghosted', family: 'green', prompt: 'Recolor into the EMERALD family ONLY. Deep emerald ground; near-black emerald motif with subtle jewel sheen. Mono-hue tonal contrast only.' },
+ { name: 'Forest Shadow', family: 'green', prompt: 'Recolor into the FOREST GREEN family ONLY. Dark forest ground; deeper near-black-forest motif. Strictly mono-hue, moody tonal.' },
+ { name: 'Moss Vellum', family: 'green', prompt: 'Recolor into the MOSS family ONLY. Soft moss ground; deeper moss motif with hint of olive. Tone-on-tone.' },
+ { name: 'Olive Reverie', family: 'green', prompt: 'Recolor into the OLIVE family ONLY. Warm olive ground; deeper olive motif. Mono-hue, no other colors.' },
+ { name: 'Hunter Lacquer', family: 'green', prompt: 'Recolor into the HUNTER GREEN family ONLY. Hunter green ground with subtle lacquer sheen; near-black hunter motif. Tone-on-tone.' },
+ { name: 'Mint Murmur', family: 'green', prompt: 'Recolor into the MINT family ONLY. Pale mint ground; medium mint motif. Strictly mono-hue.' },
+ { name: 'Jade Ash', family: 'green', prompt: 'Recolor into the JADE family ONLY. Smoky jade ground; deeper jade motif. Tone-on-tone, ashy mineral feel.' },
+
+ // 10 × BLUES
+ { name: 'Powder Hush', family: 'blue', prompt: 'Recolor into the POWDER BLUE family ONLY. Pale powder ground; medium powder-blue motif. Tone-on-tone, no other hues.' },
+ { name: 'Sky Vellum', family: 'blue', prompt: 'Recolor into the SKY BLUE family ONLY. Soft sky ground; deeper sky motif. Strictly mono-hue.' },
+ { name: 'Periwinkle Drift', family: 'blue', prompt: 'Recolor into the PERIWINKLE family ONLY. Pale periwinkle ground; deeper periwinkle motif. Tone-on-tone.' },
+ { name: 'Cornflower Echo', family: 'blue', prompt: 'Recolor into the CORNFLOWER family ONLY. Cornflower ground; deeper cornflower motif. Mono-hue.' },
+ { name: 'Slate Tonal', family: 'blue', prompt: 'Recolor into the SLATE BLUE family ONLY. Slate ground; deeper slate motif. Tone-on-tone, no contrasting color.' },
+ { name: 'Navy Ghosted', family: 'blue', prompt: 'Recolor into the NAVY family ONLY. Deep navy ground; near-black navy motif with subtle indigo. Mono-hue tonal.' },
+ { name: 'Indigo Ash', family: 'blue', prompt: 'Recolor into the INDIGO family ONLY. Indigo ground; deeper near-black indigo motif. Tone-on-tone.' },
+ { name: 'Denim Whisper', family: 'blue', prompt: 'Recolor into the DENIM BLUE family ONLY. Soft denim ground; deeper denim motif. Mono-hue.' },
+ { name: 'Teal Lacquer', family: 'blue', prompt: 'Recolor into the TEAL family ONLY. Teal ground; near-black teal motif with subtle lacquer. Tone-on-tone.' },
+ { name: "Robin's Egg Murmur", family: 'blue', prompt: "Recolor into the ROBIN'S EGG BLUE family ONLY. Pale robin's-egg ground; medium robin's-egg motif. Strictly mono-hue." },
+
+ // 10 × PINKS / REDS
+ { name: 'Blush Vellum', family: 'pink', prompt: 'Recolor into the BLUSH PINK family ONLY. Pale blush ground; deeper dusty-blush motif. Tone-on-tone, no other hues.' },
+ { name: 'Dusty Rose Tonal', family: 'pink', prompt: 'Recolor into the DUSTY ROSE family ONLY. Dusty rose ground; deeper dusty rose motif. Strictly mono-hue.' },
+ { name: 'Coral Murmur', family: 'pink', prompt: 'Recolor into the CORAL family ONLY. Soft coral ground; deeper coral motif. Tone-on-tone.' },
+ { name: 'Salmon Reverie', family: 'pink', prompt: 'Recolor into the SALMON family ONLY. Pale salmon ground; deeper salmon motif. Mono-hue.' },
+ { name: 'Terracotta Ash', family: 'red', prompt: 'Recolor into the TERRACOTTA family ONLY. Terracotta ground; deeper terracotta motif. Tone-on-tone, no contrasting color.' },
+ { name: 'Oxblood Ghosted', family: 'red', prompt: 'Recolor into the OXBLOOD family ONLY. Deep oxblood ground; near-black oxblood motif. Mono-hue tonal, moody.' },
+ { name: 'Claret Shadow', family: 'red', prompt: 'Recolor into the CLARET family ONLY. Claret ground; near-black claret motif. Tone-on-tone.' },
+ { name: 'Brick Hush', family: 'red', prompt: 'Recolor into the BRICK RED family ONLY. Soft brick ground; deeper brick motif. Mono-hue.' },
+ { name: 'Ruby Lacquer', family: 'red', prompt: 'Recolor into the RUBY family ONLY. Ruby ground with subtle lacquer; deeper near-black ruby motif. Tone-on-tone.' },
+ { name: 'Crimson Murmur', family: 'red', prompt: 'Recolor into the CRIMSON family ONLY. Crimson ground; deeper crimson motif. Strictly mono-hue.' },
+
+ // 10 × YELLOWS / GOLDS
+ { name: 'Butter Vellum', family: 'yellow', prompt: 'Recolor into the BUTTER YELLOW family ONLY. Pale butter ground; deeper butter motif. Tone-on-tone, no other hues.' },
+ { name: 'Champagne Whisper', family: 'gold', prompt: 'Recolor into the CHAMPAGNE family ONLY. Pale champagne ground; deeper champagne motif with subtle metallic shimmer. Mono-hue.' },
+ { name: 'Mustard Echo', family: 'yellow', prompt: 'Recolor into the MUSTARD YELLOW family ONLY. Mustard ground; deeper mustard motif. Tone-on-tone.' },
+ { name: 'Ochre Reverie', family: 'gold', prompt: 'Recolor into the OCHRE family ONLY. Ochre ground; deeper ochre motif. Mono-hue, earthy.' },
+ { name: 'Goldenrod Murmur', family: 'gold', prompt: 'Recolor into the GOLDENROD family ONLY. Pale goldenrod ground; deeper goldenrod motif. Strictly mono-hue.' },
+ { name: 'Honey Ash', family: 'gold', prompt: 'Recolor into the HONEY family ONLY. Honey ground; deeper near-amber honey motif. Tone-on-tone.' },
+ { name: 'Amber Tonal', family: 'gold', prompt: 'Recolor into the AMBER family ONLY. Amber ground; deeper amber motif. Mono-hue.' },
+ { name: 'Gilt Shadow', family: 'gold', prompt: 'Recolor into the GILT GOLD family ONLY. Pale gilt ground with subtle metallic shimmer; deeper antique gilt motif. Tone-on-tone.' },
+ { name: 'Bronze Lacquer', family: 'gold', prompt: 'Recolor into the BRONZE family ONLY. Bronze ground with lacquer sheen; deeper near-black bronze motif. Mono-hue.' },
+ { name: 'Brass Murmur', family: 'gold', prompt: 'Recolor into the BRASS family ONLY. Soft brass ground; deeper brass motif. Strictly mono-hue.' },
+
+ // 10 × NEUTRALS
+ { name: 'Bone Ivory Vellum', family: 'neutral', prompt: 'Recolor into the BONE/IVORY family ONLY. Bone-ivory ground; deeper warm ivory motif. Tone-on-tone, no other hues.' },
+ { name: 'Parchment Whisper', family: 'neutral', prompt: 'Recolor into the PARCHMENT family ONLY. Aged parchment ground; deeper parchment motif. Mono-hue, archival.' },
+ { name: 'Oat Echo', family: 'neutral', prompt: 'Recolor into the OAT family ONLY. Oat ground; deeper oat motif. Tone-on-tone.' },
+ { name: 'Taupe Reverie', family: 'neutral', prompt: 'Recolor into the TAUPE family ONLY. Warm taupe ground; deeper taupe motif. Mono-hue.' },
+ { name: 'Mushroom Murmur', family: 'neutral', prompt: 'Recolor into the MUSHROOM family ONLY. Mushroom ground; deeper mushroom motif. Tone-on-tone.' },
+ { name: 'Dove Gray Ash', family: 'neutral', prompt: 'Recolor into the DOVE GRAY family ONLY. Dove gray ground; deeper dove gray motif. Mono-hue.' },
+ { name: 'Charcoal Shadow', family: 'neutral', prompt: 'Recolor into the CHARCOAL family ONLY. Charcoal ground; near-black charcoal motif. Tone-on-tone, moody.' },
+ { name: 'Slate Gray Tonal', family: 'neutral', prompt: 'Recolor into the SLATE GRAY family ONLY. Slate gray ground; deeper slate gray motif. Mono-hue.' },
+ { name: 'Putty Lacquer', family: 'neutral', prompt: 'Recolor into the PUTTY family ONLY. Putty ground; deeper warm putty motif. Tone-on-tone.' },
+ { name: 'Sand Vellum', family: 'neutral', prompt: 'Recolor into the SAND family ONLY. Pale sand ground; deeper sand motif. Mono-hue.' },
+];
+
+// ─────────────────────────────────────────────────────────────────────────────
+// CONTRASTING — 50 colorways across 5 thematic directions, 10 each.
+// Heritage botanical, jewel-tone, monochrome ink, watercolor pastel, gilded.
+// ─────────────────────────────────────────────────────────────────────────────
+const CONTRASTING = [
+ // 10 × HERITAGE BOTANICAL (cream / bone ground with single saturated motif color)
+ { name: 'Heritage Emerald on Bone', theme: 'heritage', prompt: 'Bone-ivory ground; recolor the entire pattern motif to deep emerald green. Archival watercolor feel.' },
+ { name: 'Heritage Navy on Cream', theme: 'heritage', prompt: 'Warm cream ground; recolor the entire motif to deep navy ink. Heritage botanical print.' },
+ { name: 'Heritage Oxblood on Ivory', theme: 'heritage', prompt: 'Bone ivory ground; recolor the entire motif to deep oxblood red. Refined heritage print.' },
+ { name: 'Heritage Indigo on Parchment', theme: 'heritage', prompt: 'Parchment ground; recolor the entire motif to deep indigo. Antique botanical plate feel.' },
+ { name: 'Heritage Forest on Bone', theme: 'heritage', prompt: 'Bone ground; recolor the entire motif to forest green with subtle olive accents. Archival.' },
+ { name: 'Heritage Plum on Cream', theme: 'heritage', prompt: 'Warm cream ground; recolor the entire motif to deep plum. Heritage feel.' },
+ { name: 'Heritage Sepia on Ivory', theme: 'heritage', prompt: 'Ivory ground; recolor the entire motif to warm sepia brown. Antique print.' },
+ { name: 'Heritage Burgundy on Bone', theme: 'heritage', prompt: 'Bone ivory ground; recolor the entire motif to rich burgundy. Refined.' },
+ { name: 'Heritage Teal on Cream', theme: 'heritage', prompt: 'Soft cream ground; recolor the entire motif to deep teal. Heritage botanical.' },
+ { name: 'Heritage Cocoa on Ivory', theme: 'heritage', prompt: 'Ivory ground; recolor the entire motif to deep cocoa brown. Archival watercolor.' },
+
+ // 10 × JEWEL TONE (rich saturated multi-color motif on dark or jewel ground)
+ { name: 'Jewel · Sapphire & Emerald', theme: 'jewel', prompt: 'Deep midnight ground; recolor motif in sapphire blue + emerald green + amethyst purple jewel tones with subtle metallic shimmer.' },
+ { name: 'Jewel · Ruby & Gold', theme: 'jewel', prompt: 'Deep black ground; recolor motif in ruby red + antique gold + warm amber. Jewel-box feel.' },
+ { name: 'Jewel · Amethyst & Citrine', theme: 'jewel', prompt: 'Aubergine ground; recolor motif in amethyst purple + citrine yellow + topaz orange. Iridescent.' },
+ { name: 'Jewel · Peacock', theme: 'jewel', prompt: 'Deep navy ground; recolor motif in peacock blue, teal, gold, emerald — peacock-feather palette with shimmer.' },
+ { name: 'Jewel · Aurora', theme: 'jewel', prompt: 'Deep indigo ground; recolor motif in pale jade, mint, lilac, soft gold — northern-lights aurora palette.' },
+ { name: 'Jewel · Tourmaline', theme: 'jewel', prompt: 'Charcoal ground; recolor motif in tourmaline pink, deep green, smoky quartz — gemstone palette.' },
+ { name: 'Jewel · Lapis & Gold', theme: 'jewel', prompt: 'Black ground; recolor motif in lapis lazuli blue + antique gold leaf accents. Byzantine feel.' },
+ { name: 'Jewel · Garnet & Bronze', theme: 'jewel', prompt: 'Deep wine ground; recolor motif in garnet red + bronze + antique copper. Rich, gilded.' },
+ { name: 'Jewel · Malachite & Pearl', theme: 'jewel', prompt: 'Deep forest ground; recolor motif in malachite green + pearl white + soft gold. Jewel-box.' },
+ { name: 'Jewel · Onyx & Opal', theme: 'jewel', prompt: 'Black ground; recolor motif in pale opal pastels + onyx black accents. Iridescent contrast.' },
+
+ // 10 × MONOCHROME INK (pure 2-color, drawing-like)
+ { name: 'Ink · Black on White', theme: 'ink', prompt: 'Pure white ground; recolor the entire motif to pure black ink linework, no other colors. Pen-and-ink feel.' },
+ { name: 'Ink · Navy on Bone', theme: 'ink', prompt: 'Bone white ground; recolor the entire motif to deep navy ink only. Two-color.' },
+ { name: 'Ink · Sepia on Cream', theme: 'ink', prompt: 'Warm cream ground; recolor the entire motif to warm sepia brown ink. Antique etching.' },
+ { name: 'Ink · Forest on Ivory', theme: 'ink', prompt: 'Ivory ground; recolor the entire motif to deep forest green ink only. Two-color.' },
+ { name: 'Ink · Oxblood on Parchment', theme: 'ink', prompt: 'Parchment ground; recolor the entire motif to deep oxblood red ink only. Antique print.' },
+ { name: 'Ink · Indigo on Rice', theme: 'ink', prompt: 'Rice paper ground; recolor the entire motif to deep indigo ink only. Japanese sumi-e feel.' },
+ { name: 'Ink · Charcoal on Linen', theme: 'ink', prompt: 'Linen-textured ground; recolor the entire motif to charcoal black only. Two-color.' },
+ { name: 'Ink · Cobalt on Snow', theme: 'ink', prompt: 'Snow white ground; recolor the entire motif to cobalt blue only. Delft pottery feel.' },
+ { name: 'Ink · Ochre on Bone', theme: 'ink', prompt: 'Bone ground; recolor the entire motif to deep ochre only. Two-color, archival.' },
+ { name: 'Ink · Mulberry on Cream', theme: 'ink', prompt: 'Cream ground; recolor the entire motif to mulberry purple ink only. Two-color.' },
+
+ // 10 × WATERCOLOR PASTEL (soft multi-color on cream)
+ { name: 'Pastel · Peach Lavender Mint', theme: 'pastel', prompt: 'Warm cream ground; recolor motif in soft watercolor pastels — peach, lavender, mint, sky blue. Luminous wash.' },
+ { name: 'Pastel · Blush Powder Sage', theme: 'pastel', prompt: 'Pale ivory ground; recolor motif in blush, powder blue, soft sage, butter yellow. Watercolor.' },
+ { name: 'Pastel · Sorbet', theme: 'pastel', prompt: 'Cream ground; recolor motif in sorbet pastels — strawberry, pistachio, lemon, raspberry. Soft.' },
+ { name: 'Pastel · Macaron', theme: 'pastel', prompt: 'Bone ground; recolor motif in macaron pastels — pistachio green, rose pink, lavender, vanilla. Soft watercolor.' },
+ { name: 'Pastel · Sea Glass', theme: 'pastel', prompt: 'Pale aqua ground; recolor motif in sea-glass pastels — pale jade, soft coral, butter, periwinkle.' },
+ { name: 'Pastel · Spring Garden', theme: 'pastel', prompt: 'Cream ground; recolor motif in spring pastels — daffodil yellow, hyacinth blue, tulip pink, leaf green. Soft.' },
+ { name: 'Pastel · Confetti', theme: 'pastel', prompt: 'Ivory ground; recolor motif in playful pastels — mint, blush, lavender, lemon, sky — confetti scatter.' },
+ { name: 'Pastel · Sunrise', theme: 'pastel', prompt: 'Pale peach ground; recolor motif in sunrise pastels — coral, rose, peach, soft gold, lavender.' },
+ { name: 'Pastel · Tide Pool', theme: 'pastel', prompt: 'Pale aqua ground; recolor motif in tide-pool pastels — coral pink, sea-green, sand, periwinkle.' },
+ { name: 'Pastel · Petit Four', theme: 'pastel', prompt: 'Cream ground; recolor motif in patisserie pastels — pistachio, rose, vanilla, lavender, soft caramel.' },
+
+ // 10 × GILDED (metallic accents on jewel or dark ground)
+ { name: 'Gilded · Gold on Emerald', theme: 'gilded', prompt: 'Deep emerald ground; recolor the entire motif to antique gold leaf with subtle metallic shimmer. Gilded chinoiserie.' },
+ { name: 'Gilded · Gold on Navy', theme: 'gilded', prompt: 'Deep navy ground; recolor the entire motif to antique gold leaf. Refined, evening palette.' },
+ { name: 'Gilded · Silver on Charcoal', theme: 'gilded', prompt: 'Charcoal ground; recolor the entire motif to brushed silver leaf. Cool gilded.' },
+ { name: 'Gilded · Copper on Aubergine', theme: 'gilded', prompt: 'Aubergine ground; recolor the entire motif to antique copper. Warm gilded.' },
+ { name: 'Gilded · Rose Gold on Plum', theme: 'gilded', prompt: 'Deep plum ground; recolor the entire motif to rose gold with subtle shimmer. Romantic gilded.' },
+ { name: 'Gilded · Champagne on Black', theme: 'gilded', prompt: 'Black ground; recolor the entire motif to pale champagne gold. Subtle, sophisticated.' },
+ { name: 'Gilded · Brass on Forest', theme: 'gilded', prompt: 'Forest green ground; recolor the entire motif to antique brass. Library-feel.' },
+ { name: 'Gilded · Platinum on Oxblood', theme: 'gilded', prompt: 'Oxblood ground; recolor the entire motif to brushed platinum. Cool-on-warm gilded.' },
+ { name: 'Gilded · Gold on Lacquer Red', theme: 'gilded', prompt: 'Chinese lacquer red ground; recolor the entire motif to antique gold leaf. Chinoiserie hero.' },
+ { name: 'Gilded · Bronze on Slate', theme: 'gilded', prompt: 'Slate gray ground; recolor the entire motif to antique bronze. Quiet gilded.' },
+];
+
+if (TONE_ON_TONE.length !== 50) throw new Error(`tone-on-tone count ${TONE_ON_TONE.length} != 50`);
+if (CONTRASTING.length !== 50) throw new Error(`contrasting count ${CONTRASTING.length} != 50`);
+
+const SHARED_TAIL = [
+ 'Preserve the pattern shapes, scale, and composition exactly — recolor only.',
+ 'Seamless tile, no edge artifacts, no signature, no watermark, no text.',
+ 'High detail, archival quality, fabric-pattern aesthetic, no cartoon style.',
+].join(' ');
+
+async function generateOne(v, idx, group) {
+ const fullPrompt = v.prompt + ' ' + SHARED_TAIL;
+ const body = {
+ contents: [{
+ parts: [
+ { inline_data: { mime_type: 'image/jpeg', data: SRC_B64 } },
+ { text: fullPrompt }
+ ]
+ }],
+ generationConfig: { responseModalities: ['IMAGE'] }
+ };
+ const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent?key=${KEY}`;
+ const t0 = Date.now();
+ const r = await fetch(url, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(body),
+ });
+ if (!r.ok) throw new Error(`HTTP ${r.status}: ${(await r.text()).slice(0, 300)}`);
+ const j = await r.json();
+ try {
+ const { logGemini } = require(require('os').homedir() + '/.claude/skills/cost-tracker/scripts/log-gemini.js');
+ logGemini(j, { app: 'wallco-ai', note: 'dig-1984-colorways', model: 'gemini-2.5-flash-image' });
+ } catch {}
+ const part = j.candidates?.[0]?.content?.parts?.find(p => p.inline_data || p.inlineData);
+ const data = part?.inline_data?.data || part?.inlineData?.data;
+ if (!data) {
+ const text = j.candidates?.[0]?.content?.parts?.find(p => p.text)?.text;
+ throw new Error(`no image returned (${j.candidates?.[0]?.finishReason || 'unknown'}): ${(text || '').slice(0, 200)}`);
+ }
+ const seed = crypto.randomInt(1, 2 ** 31 - 1);
+ const filename = `dig1984_${Date.now()}_${seed}.png`;
+ const outPath = path.join(OUT_DIR, filename);
+ fs.writeFileSync(outPath, Buffer.from(data, 'base64'));
+ const elapsed = ((Date.now() - t0) / 1000).toFixed(1);
+
+ // Palette extraction
+ const py = spawnSync('python3', ['-c', `
+from PIL import Image
+from collections import Counter
+import json, sys
+img = Image.open(sys.argv[1]).convert('RGB')
+img.thumbnail((300, 300))
+pal = img.quantize(colors=5, method=Image.Quantize.MEDIANCUT).convert('RGB')
+pixels = list(pal.getdata())
+cnt = Counter(pixels)
+total = sum(cnt.values())
+palette = [{'hex':'#{:02x}{:02x}{:02x}'.format(*rgb), 'pct':round(n/total*100,2)} for rgb,n in cnt.most_common(5)]
+print(json.dumps(palette))
+`, outPath], { encoding: 'utf8' });
+ let palette = []; let dominant = null;
+ try { palette = JSON.parse(py.stdout.trim()); dominant = palette[0]?.hex; } catch {}
+
+ const tagBase = ['imperial-garden', 'barone', 'dig-1984', 'colorway', group];
+ if (v.family) tagBase.push('tone-on-tone', v.family);
+ if (v.theme) tagBase.push(v.theme);
+ const tagArrSql = 'ARRAY[' + tagBase.map(t => esc(t)).join(',') + ']::text[]';
+
+ const labelTitle = `Imperial Garden Barone · ${v.name}`;
+ const promptDesc = (labelTitle + ' — ' + v.prompt).slice(0, 1800);
+ const palJson = JSON.stringify(palette).replace(/'/g, "''");
+ const insertSql = `INSERT INTO spoon_all_designs
+ (kind, width_in, height_in, generator, prompt, seed, dominant_hex, palette,
+ local_path, image_url, category, motifs, tags, is_published, request_text)
+ VALUES ('seamless_tile', 24, 24, 'gemini-2.5-flash-image-edit',
+ ${esc(promptDesc)}, ${seed},
+ ${dominant ? "'" + dominant + "'" : 'NULL'},
+ '${palJson}'::jsonb,
+ ${esc(outPath)}, ${esc('/designs/img/' + filename)},
+ 'colorways-imperial-garden-barone',
+ ARRAY['floral', 'garden', 'chinoiserie', 'traditional']::text[],
+ ${tagArrSql},
+ TRUE, ${esc('dig-1984 colorway #' + (idx + 1) + ': ' + v.name)})
+ RETURNING id;`;
+ const id = parseInt(psql(insertSql), 10);
+ console.log(` [${group} ${idx + 1}] ${v.name.padEnd(30)} → id=${id} ${elapsed}s ${filename}`);
+ return { id, name: v.name, group };
+}
+
+(async () => {
+ console.log(`\nGenerating 100 colorways of DIG-1984 (Imperial Garden by Charles Barone)…\n`);
+ console.log(` 50 tone-on-tone (mono-hue families)`);
+ console.log(` 50 contrasting (heritage / jewel / ink / pastel / gilded)\n`);
+ const all = [];
+ for (let i = 0; i < TONE_ON_TONE.length; i++) {
+ try { all.push(await generateOne(TONE_ON_TONE[i], i, 'TONE')); }
+ catch (e) { console.error(` [TONE ${i + 1}] FAIL — ${e.message.slice(0, 200)}`); }
+ }
+ for (let i = 0; i < CONTRASTING.length; i++) {
+ try { all.push(await generateOne(CONTRASTING[i], i, 'CONTRAST')); }
+ catch (e) { console.error(` [CONTRAST ${i + 1}] FAIL — ${e.message.slice(0, 200)}`); }
+ }
+ console.log(`\nDone. ${all.length}/100 succeeded.`);
+ if (all.length) {
+ console.log(`\nNew design ids: ${all.map(r => r.id).join(', ')}`);
+ console.log(`Review at: http://localhost:9792/designs?cat=colorways-imperial-garden-barone`);
+ }
+
+ // Refresh + reload
+ spawnSync('python3', [path.join(__dirname, 'refresh_designs_snapshot.py')],
+ { stdio: 'inherit', cwd: path.join(__dirname, '..'), timeout: 180_000 });
+ spawnSync('curl', ['-sf', '-m', '5', '-X', 'POST', 'http://127.0.0.1:9792/admin/reload-designs'],
+ { stdio: 'inherit', timeout: 10_000 });
+
+ process.exit(all.length === 100 ? 0 : 1);
+})();
← 7620d5d cherry-blossom-animals: batch runner (default N=10) — fans p
·
back to Wallco Ai
·
snapshot: backup uncommitted work (6 files) 5c53e57 →