← back to Wallco Ai

scripts/drunk_monkeys_v2_prompts.js

202 lines

#!/usr/bin/env node
/**
 * v2 prompt builder — Steve flagged v1 output as "horrible" because the model
 * was averaging out the long structured prompt toward generic
 * birds-on-a-botanical-ground. v2 fixes:
 *
 *   1. LEAD with the subject — "Drunk capuchin monkey clutching a wine glass"
 *      goes FIRST. SDXL/ComfyUI weights early tokens heaviest.
 *   2. SHORT prompts — drop the 1.3KB TONE_ON_TONE_SUFFIX. Use only the
 *      palette voice + 1 composition cue.
 *   3. Explicit cocktail props in BOTH the subject + a repeat at mid-prompt
 *      so the diffusion model doesn't ignore it.
 *   4. Stronger negative prompt — bans no-animals, generic-wallpaper-pattern,
 *      monstera/banana/palm (settlement-safe), and the failure modes from v1.
 *
 * Settlement-gate compatibility — birds (Part B) only block when combined
 * with full Part A. v2 prompts have no directional foliage and no
 * edge-to-edge banana/palm; safe.
 */

const MONKEYS = [
  'wide-eyed capuchin monkey',
  'long-tailed spider monkey',
  'sleepy golden lion tamarin',
  'tipsy squirrel monkey',
  'wobbly red howler monkey',
  'sloshed mandrill',
  'jolly white-faced saki monkey',
  'drunken proboscis monkey',
  'inebriated japanese macaque',
  'crooked-grin marmoset',
  'glassy-eyed gibbon',
  'long-armed orangutan',
  'cross-eyed pygmy marmoset',
  'plastered black-and-white colobus monkey',
];

const BIRDS = [
  'tipsy scarlet macaw',
  'sloshed great horned owl',
  'drunken kingfisher',
  'plastered toucan',
  'woozy hummingbird',
  'inebriated peacock',
  'wobbly pelican',
  'drunk barn owl',
  'sloshed flamingo',
  'tipsy cockatoo',
  'plastered house finch',
  'wobbly long-eared owl',
];

// Lead-line action — what the animal IS doing in the moment (drink-in-hand).
// Each one mentions the glass/bottle TYPE explicitly so the diffusion model
// has a concrete object to render alongside the animal.
const ACTIONS = [
  'clutching a deep-burgundy wine glass, head tilted back, eyelids drooping',
  'cradling an amber whiskey tumbler in two paws, two ice cubes melting',
  'mid-toast with a coupe of pale rosé, foam spilling over the rim',
  'pouring a clear vodka bottle into a tiny shot glass, eyes crossed',
  'collapsed onto a pillow, empty wine glass tipped on its side beside it',
  'mid-spit-take, dark stout spraying from a pint glass',
  'asleep curled around a frosted decanter, mouth hanging open',
  'gripping a champagne flute, golden bubbles overflowing, surprised look',
  'mid-sip from a martini glass with two olives skewered',
  'hugging a tall pilsner glass the size of its head, eyes glazed',
  'two-pawed grip on a cognac snifter, swirling sloppily',
  'one paw on a cocktail with a paper umbrella, the other paw raised in cheers',
];

// SUBDUED botanical *backgrounds* — kept minimal and explicitly behind-the-animal
// so the model doesn't promote the flowers to the foreground.
const BACKDROPS = [
  'soft cream peonies in the background, blurred and recessive',
  'antique cream roses behind, painted small and faint',
  'lacecap hydrangeas in dusted sage behind the figure',
  'dried lavender on parchment behind, suggested not dominant',
  'misty wildflower meadow in the background, watercolor wash',
  'soft pencil-sketched ranunculus on a parchment ground behind',
  'magnolia branches in chalky white behind, faint',
  'plain parchment ground with a few scattered cream blooms behind',
  'softly muted camellias on a putty ground behind',
  'sage-on-cream tone-on-tone botanical wash behind the figure',
];

// Lit-joint clauses — Steve 2026-05-25: every drunk-animal must show a lit
// handrolled cannabis joint with smoke trail (small prop, not foliage).
const JOINTS = [
  'a lit handrolled cannabis joint pinched in its other paw, a thin curl of smoke rising',
  'a smoldering joint dangling from its lips, smoke trail rising in a backwards-S curl',
  'a fat joint held aloft like a cigar, ember bright, single curl of smoke',
  'a half-smoked joint balanced on the rim of the glass, ribbon of smoke drifting up',
  'a freshly lit joint tucked behind one ear, thin smoke trail off the tip',
  'a glowing joint cradled between its claws, ember bright, smoke curling',
  'a long elegant joint pinched between two fingers, ash about to fall, smoke vertical',
];

// Swinging-action clauses — Steve 2026-05-25: every drunk-animal must be
// swinging from something (vine / chandelier / rope / branch / trapeze).
const SWINGS = [
  'mid-swing from a hanging garden vine, one paw gripping the vine, body arcing',
  'swinging from a crystal chandelier, chain creaking, other paw waving',
  'gripping a knotted rope swing, mid-arc, fur blown back by motion',
  'hanging upside-down from a curving tree branch, tail looped for balance, mid-pendulum',
  'mid-swing on a circus trapeze bar, legs kicked out',
  'hooked around a hanging brass chandelier arm, body swinging in a wide pendulum',
  'swinging from a flowering wisteria vine that bows under its weight',
  'swinging from a wooden porch seat-swing with rope sides, kicking its feet out',
];

const COMPOSITIONS = [
  'half-drop repeat pattern',
  'block repeat pattern',
  'scattered placement with generous open ground',
  'centered symmetric repeat',
  'damask medallion repeat',
];

const PALETTES = [
  { name: 'sage-on-cream',       voice: 'soft sage and cream palette, warm cocoa accent' },
  { name: 'dusty-rose-bone',     voice: 'antique dusty rose on bone ground, cocoa accent' },
  { name: 'charcoal-parchment',  voice: 'deep charcoal on parchment, heritage tan accent' },
  { name: 'oyster-slate',        voice: 'oyster gray on slate, cream ground' },
  { name: 'ochre-oat',           voice: 'aged ochre on oat field, walnut umber accent' },
  { name: 'cocoa-ivory',         voice: 'dark cocoa on ivory, fawn middle tone' },
  { name: 'mineral-teal-cream',  voice: 'aged mineral teal on cream, charcoal accent' },
  { name: 'putty-blush',         voice: 'warm putty with antique blush accent' },
];

function pick(arr) { return arr[Math.floor(Math.random() * arr.length)]; }

// Shared motif library — Steve 2026-05-25 — every drunk-animal must show
// alcohol+joint+swing+wild-bottle backdrop on a natural-fiber texture.
// Uses tone-on-tone deep palettes (browns/greens/reds/golds, Gucci+Hermès).
const SHARED = require('./drunk_motif_shared');

function buildOne(i) {
  // 60% monkey-led, 30% bird-led, 10% pair (monkey + bird)
  let subject;
  const r = Math.random();
  if (r < 0.60) subject = pick(MONKEYS);
  else if (r < 0.90) subject = pick(BIRDS);
  else subject = `${pick(MONKEYS)} and a ${pick(BIRDS)} together`;

  // Mix local short-form ACTIONS with SHARED's rich tiki/cognac/champagne
  // TABLEAUX — 60% chance to use SHARED for variety.
  const action = Math.random() < 0.6 ? pick(SHARED.TABLEAUX) : pick(ACTIONS);
  const joint = pick(SHARED.SMOKES);  // joint/cigar/pipe/bong (Steve 2026-05-26)
  const swing = pick(SHARED.SWINGS);
  const bottleBackdrop = pick(SHARED.BOTTLE_BACKDROPS);
  const texture = pick(SHARED.TEXTURE_GROUNDS);
  const backdrop = pick(BACKDROPS);
  const composition = pick(COMPOSITIONS);
  // Default palette = deep tone-on-tone (Steve 2026-05-25); local short-name
  // palettes kept as a 25% backup for backwards-compat.
  const useDeep = Math.random() < 0.75;
  const palette = useDeep
    ? { name: 'deep-tone-on-tone', voice: pick(SHARED.DEFAULT_PALETTES) }
    : pick(PALETTES);

  const refClause = SHARED.pickReferenceClause('drunk-monkeys-v2');

  // SUBJECT FIRST — that's the key v2 fix. Steve 2026-05-25 — mandatory
  // joint + swinging + bottle-backdrop + natural-fiber texture + Met-PD
  // reference clause in every prompt.
  const positive =
    `${subject}, ${action}, also ${joint}, ${swing}. ` +
    `${bottleBackdrop}. ` +
    `${texture.voice}. ` +
    (refClause ? `Reference anchor: ${refClause}. ` : '') +
    `${backdrop}. ` +
    `Hand-painted gouache wallpaper illustration, ${composition}, ${palette.voice}, ` +
    `restrained tone-on-tone, museum-archival print quality. ` +
    `${SHARED.DRUNK_NEGATIVE_SUFFIX} ` +
    `Make sure the animal, its drinking glass/bottle, its lit cannabis joint with smoke, the swinging element, the wild-bottle backdrop, and the natural-fiber texture ground are ALL clearly visible and prominent.`;

  return {
    prompt: positive,
    palette: palette.name,
    palette_hex: null,
    animal_summary: subject.slice(0, 60),
  };
}

function buildN(n) {
  const out = [];
  for (let i = 0; i < n; i++) out.push(buildOne(i));
  return out;
}

const NEGATIVE = 'no animal, animal missing, only flowers, only botanical, only birds in a field, generic wallpaper pattern, generic floral, abstract, no drink, no glass, no bottle, no joint, no smoke, animal not swinging, animal standing still on ground, monstera, palm leaves, banana leaves, jungle, butterflies, grapes, bananas, neon, fluorescent, vivid saturated, rainbow, electric pink, photoreal photograph, low quality, blurry, smudgy face, deformed limbs';

module.exports = { buildN, buildOne, MONKEYS, BIRDS, ACTIONS, JOINTS, SWINGS, PALETTES, NEGATIVE };

if (require.main === module) {
  const n = parseInt(process.argv[2] || '5', 10);
  buildN(n).forEach((p, i) => {
    console.log(`\n#${i+1}  palette=${p.palette}  animal=${p.animal_summary}`);
    console.log('  ' + p.prompt);
  });
}