Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gemini-hero

License: MIT Python 3.10+ Gemini

Generate cinema-grade hero images for websites at ~4 cents per image using Google's Gemini 2.5 Flash Image API. Documentary realism style baked in. No Stable Diffusion, no Midjourney subscription, no Photoshop.

Built for the 48+ hero images on netzhandwerker.de and its sub-brands.

Why this exists

Every B2B website needs hero images, and most of them look like the same stock-photo mannequins in front of laptops. AI image generation solves that — but:

  • Stable Diffusion is slow on consumer hardware and gives you anime faces if you blink
  • Midjourney is great but locked behind Discord and a subscription
  • DALL-E 3 is OK but expensive at ~$0.08/image
  • Gemini 2.5 Flash Image is fast (5-8s), cheap (~$0.04/image), and gives surprisingly grounded results when you prompt it right

This package wraps the Gemini API with a hero-image-focused prompt template, multi-format output (PNG + WebP + thumbnail variant), and batch processing.

Quickstart

pip install -e .
export GEMINI_API_KEY=...
gemini-hero generate "Mechanic in safety glasses inspects a server motherboard, North German workshop ambiance, documentary photo"

Output: output/mechanic-server-motherboard.png + .webp + -400.webp

Three output variants per image

File Size Use case
name.png 1568×880 Lossless source, archive
name.webp 1568×880, q85 Production hero, ~120 KB
name-400.webp 400×225, q80 Mobile srcset, ~25 KB

Drop into HTML:

<picture>
  <source media="(max-width: 600px)" srcset="/img/hero-400.webp">
  <source srcset="/img/hero.webp">
  <img src="/img/hero.png" alt="Mechanic inspects motherboard" width="1568" height="880">
</picture>

Style: documentary realism

The default system prompt nudges Gemini toward:

  • German B2B environments (workshops, offices, warehouses, not Silicon Valley garages)
  • No studio lighting — natural light, overcast skies, fluorescent shop lighting
  • No cinematic blue/orange grade — neutral white balance
  • No sci-fi elements — no holograms, no glowing interfaces, no neon

Override with --style cinematic, --style studio, or --style raw for different looks.

Batch mode

prompts.txt:

electrician-cable-routing | Electrician routes power cables through a cable tray in a workshop ceiling, photo
solar-installer-roof      | Solar installer mounts a panel on a residential roof, golden hour, photo
network-rack              | IT technician patches fiber cables in a rack-mounted patch panel, server room
gemini-hero batch prompts.txt --out img/

Generates 3 hero images × 3 variants = 9 files in img/.

Pricing

At Gemini 2.5 Flash Image rates (May 2026): ~$0.04 / image. A whole website (10-15 hero images) costs less than a coffee.

What this is not

  • Not a free service — you pay Google for API calls
  • Not a face generator — Gemini refuses to generate identifiable real people, and that's a feature
  • Not deterministic — same prompt gives different results each call
  • Not for advertising real products — generated images of products you don't own are a legal grey zone

Example outputs

See examples/ for prompt+output pairs that demonstrate the documentary-realism style.

License

MIT. Commercial use allowed without attribution.

Author

Built by Daniel Wesseling at Die Netzhandwerker — refined across 200+ hero images for sub-brands like spuerwerk, formwerk, diffus, naturwerk.

About

Cinema-grade hero image generator using Google Gemini 2.5 Flash Image. Documentary realism, 3 output variants (PNG + WebP + thumb), ~4 cents per image.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages