Generate images using Google's Nano Banana Pro (Gemini 3 Pro Image) model. Use when: (1) the user asks to generate, create, or make an image/picture/photo/visual, (2) the user needs a blog post cover image, hero image, or illustration, (3) the user asks for AI image generation, (4) the user mentions nano banana or Gemini image generation. Do NOT use for diagrams or flowcharts (use excalidraw skill instead).
Generate images with Google's Nano Banana Pro via a single uv run script.
Before running the script, verify a key is set:
echo "${GEMINI_API_KEY:-${GOOGLE_API_KEY:-NOT SET}}"
If NOT SET, stop and tell the user:
You need a Google API key. Get one at https://aistudio.google.com/apikey then set it:
export GEMINI_API_KEY='your-key-here'
uv run SKILL_DIR/scripts/generate.py "your prompt here" -o output.png --aspect-ratio 16:9 --size 2K
With reference images:
uv run SKILL_DIR/scripts/generate.py "Compose these logos into a hero image on a dark background" \
-r /tmp/selfhst-icons/png/claude.png -r /tmp/selfhst-icons/png/excalidraw.png -r /tmp/selfhst-icons/png/outline.png \
-o output.png --aspect-ratio 16:9 --size 2K
Arguments:
generated_image.png)1:1 (default), 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1512, 1K (default), 2K, 4KSKILL_DIR resolves to this skill's directory at runtime. Use it as the prefix for the script path.
CRITICAL: When the user's prompt involves brand logos (e.g. "Claude logo", "Docker logo", "Outline logo"), NEVER ask the model to imagine/generate logos from memory. Logos generated from memory will be wrong. Instead, use the real logos from the local icon cache and pass them as reference images.
The selfhst/icons repo has thousands of vendor/service icons. A local shallow clone is kept at /tmp/selfhst-icons/.
Before looking up any logos, sync the cache:
if [ -d /tmp/selfhst-icons/.git ]; then
git -C /tmp/selfhst-icons pull --ff-only
else
git clone --depth 1 https://github.com/selfhst/icons.git /tmp/selfhst-icons
fi
Run this once per session. After that, all icons are available locally:
/tmp/selfhst-icons/png/{name}.png/tmp/selfhst-icons/svg/{name}.svg/tmp/selfhst-icons/webp/{name}.webpNaming conventions — filenames are lowercase, hyphenated:
docker.png, github.png, claude.png, outline.pngvisual-studio-code.png, google-chrome.png{name}-light.png (light theme), {name}-dark.png (dark theme)Workflow when logos are needed:
visual-studio-code)ls /tmp/selfhst-icons/png/{name}.pngls /tmp/selfhst-icons/png/ | grep -i '<keyword>'-r reference images to the generate scriptRead references/prompting-guide.md for the full prompting reference. Key points:
Formula: [Subject] + [Action] + [Location/context] + [Composition] + [Style]
Text rendering: Wrap text in quotes, specify font style, keep to 3-5 words max.
When generating images for blog posts:
--aspect-ratio 16:9 or 3:2, --size 2K. Keep compositions clean with space for text overlay.--aspect-ratio 1:1, --size 1K.--aspect-ratio 16:9, --size 1K.For diagrams and flowcharts, use the excalidraw skill instead.
See references/prompting-guide.md for detailed blog image patterns and style tips.