| name | puzzle-image-generator |
| description | Create puzzle-ready background image prompts and generate images via the Gemini image preview API. Use when you need a clean puzzle base image (no text, no puzzle lines) and want a Node.js script to call `generateContent` and save the image to disk. |
Puzzle Image Generator
Overview
Generate a puzzle-ready prompt and render a square (1:1) image using the bundled Node.js script.
Workflow
1. Write the prompt
Use this template and replace the bracketed parts. Keep it concise and literal.
Beautiful [scene subject] in [style], rich detail, balanced composition, high-contrast edges,
clean background, no text, no logos, no watermarks, no borders, no UI, no puzzle lines,
no grid, no segmentation, no labels, no typography. --AR 1:1
Prompt tips
- Prefer clear shapes and distinct regions (helps puzzle piece separation).
- Avoid tiny repeated patterns, heavy blur, or flat gradients.
- Keep the image self-contained (no frames or letterboxing).
- AI can freely choose any one scene subject and any one style from the 50-option lists below, then combine them in the prompt template.
Scene subject options (50)
- Snowy mountain cabin
- Sunset beach boardwalk
- Quiet forest waterfall
- Desert cactus valley
- Lavender flower field
- Tropical coral reef
- Cozy bookstore interior
- Vintage train station
- Bustling night market
- Medieval castle courtyard
- Japanese temple garden
- Colorful hot air balloons
- Autumn maple park
- Arctic iceberg bay
- Rainy city street
- Seaside lighthouse cliff
- Wheat farm at dawn
- Busy fishing harbor
- Rooftop greenhouse garden
- Old stone bridge
- Hidden jungle ruins
- Canyon river bend
- Tulip windmill village
- Glacier lake reflection
- Safari elephant herd
- Panda bamboo grove
- Penguin ice colony
- Butterfly meadow path
- Owl in moonlight
- Farm red barn
- Snow-covered pine forest
- Cliffside coastal road
- Starry desert campsite
- Cherry blossom avenue
- Ancient library hall
- Space station window view
- Underwater shipwreck scene
- Carnival ferris wheel
- City skyline sunrise
- Rustic kitchen table
- Pottery studio shelves
- Mountain goat ridge
- Camel caravan dunes
- Vineyard hillside rows
- Ice cream parlor
- Pirate ship deck
- Suburban street in spring
- Riverside picnic spot
- Foggy marsh boardwalk
- Volcano crater rim
Style options (50)
- Photorealistic cinematic lighting
- Vintage film grain
- Noir high-contrast monochrome
- Pastel watercolor wash
- Bold pop art
- Retro 80s synthwave
- Minimalist flat illustration
- Ukiyo-e woodblock print
- Art nouveau ornamental
- Art deco geometric elegance
- Surreal dreamscape
- Dark fantasy matte painting
- Bright kawaii anime
- Gritty cyberpunk neon
- Steampunk brass and gears
- Low-poly 3D render
- Isometric voxel style
- Claymation stop-motion look
- Pencil sketch crosshatching
- Charcoal drawing texture
- Ink line art
- Gouache poster style
- Oil painting impasto
- Fresco mural aesthetic
- Pixel art 16-bit
- Glitchcore digital distortion
- Holographic iridescent finish
- Paper cut collage
- Stained glass mosaic
- Hand-drawn doodle style
- Children's book illustration
- Botanical scientific illustration
- Blueprint technical drawing
- Architectural visualization clean
- Product studio photography
- Fashion editorial look
- Documentary photojournalism
- Golden hour landscape
- Moonlit night ambience
- Misty atmospheric fog
- Desert dust tones
- Tropical vibrant palette
- Scandinavian soft tones
- Brutalist graphic design
- Bauhaus primary shapes
- Japanese zen minimalism
- Medieval illuminated manuscript
- Rococo ornate detail
- Futuristic concept art
- Hyperreal macro photography
2. Generate the image
Run the script with your prompt and optional output folder. If no output folder is provided, the image is saved under images.
node scripts/generate_puzzle_image.js --prompt "YOUR_PROMPT_HERE" --out "optional/output/folder" --name "my-image.png"
Use this default numbering logic for --name argument:
- Scan
images/generated-*.png.
- Extract numeric suffixes from matching filenames.
- Compute the next
N as max + 1 (default to 1 if no matches exist).
- Generate with filename
images/generated-{N}.png.
3. Post-image-generation rule
After generating images, derive N from current generated files before updating code:
-
Scan images/generated-*.png.
-
Extract numeric suffixes and set N to the maximum suffix (example: latest is generated-14.png => N = 14).
-
Replace hard-coded magic numbers with N in the index.html file, for example:
const GENERATED_NUMBERS = 15;
Script Notes
- Requires
GEMINI_API_KEY in the environment.
- Expects the Gemini response to include
inlineData.data (base64 image).
- Saves a
.png by default and derives the extension from inlineData.mimeType when available.