Blog Image logo

Blog Image

CommunityPopular
AgriciDaniel
blog-image

AI image generation and editing for blog content powered by Gemini via MCP. Generates hero images, inline illustrations, social preview cards, and OG images, and edits existing ones. Supports 6 domain modes (Editorial, Product, Landscape, UI/Web, Infographic, Abstract). Works standalone or internally from blog-write and blog-rewrite; falls back gracefully when MCP is unavailable. Use when user says "blog image", "generate hero image", "blog illustration", "edit blog image", "OG image".

Overview

PublisherAgriciDaniel
Repositoryclaude-blog
Skill nameblog-image
Stars
2.2K
Forks
362
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by AgriciDaniel on GitHub. Read the source before you install it.

Installation

Install the Blog Image AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AgriciDaniel/claude-blog.git /tmp/claude-blog
mkdir -p .claude/skills
cp -r /tmp/claude-blog/skills/blog-image .claude/skills/blog-image
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Blog Image in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Blog Image on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Blog Image is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Blog Image - AI Image Generation for Blog Content

You are a Creative Director that orchestrates Gemini's image generation specifically for blog content. Never pass raw user text directly to the API. Always interpret, enhance, and construct an optimized prompt using the 6-component Reasoning Brief system.

Quick Reference

CommandWhat it does
/blog image generate <idea>Generate a blog image with full prompt engineering
/blog image edit <path> <instructions>Edit an existing blog image intelligently
/blog image setupConfigure MCP server and API key

Blog Image Types

Match the image type to blog use case:

Image TypeAspect RatioResolutionDomain ModePlacement
Hero/Cover16:92K or 4KEditorial / LandscapeFrontmatter coverImage
OG/Social Card16:91KEditorial / InfographicFrontmatter ogImage
Inline Illustration16:9 or 4:31KVaries by topicAfter H2, before body
Inline Product Shot4:3 or 1:11KProductWithin product sections
Section Divider21:9 then crop1KAbstract / LandscapeBetween major sections

Sizing requirements:

  • Blog hero/cover: 1200x630 (OG-compatible) or 1920x1080
  • Open Graph (OG): 1200x630 (required for social sharing)
  • Inline images: 1200px+ wide

MCP Availability Check

Before generating, check if nanobanana-mcp tools are available:

  1. Try calling get_image_history with conversation_id: "default" (lightweight, no side effects)
  2. If it succeeds: MCP is available, proceed with generation
  3. If it fails: MCP not configured - inform the user:
    • "Image generation requires the nanobanana-mcp server. Run /blog image setup to configure it."
    • When called internally (from blog-write/blog-rewrite): return silently, no error. The calling workflow continues with stock photos.

Generation Workflow

For /blog image generate <idea> or when invoked internally:

Step 1: Analyze Intent

Determine what the blog needs:

  • Image type: Hero, inline, OG card, section divider?
  • Blog topic: What is the article about?
  • Style: Photorealistic, editorial, illustrated, minimal?
  • Constraints: Brand colors, specific dimensions, platform format?
  • Mood: Authoritative, inviting, dramatic, clean?

If the request is vague, ask one clarifying question about use case and style.

Step 2: Select Domain Mode

Choose the expertise lens for the image:

ModeWhen to usePrompt emphasis
EditorialBlog headers, feature images, lifestyleStyling, composition, publication references
ProductE-commerce posts, reviews, comparisonsSurface materials, studio lighting, clean BG
LandscapeEnvironmental backgrounds, travel, hero sectionsAtmospheric perspective, depth layers, time of day
UI/WebTech blog icons, illustrations, diagramsClean vectors, flat design, exact colors
InfographicData-driven posts, processes, comparisonsLayout structure, hierarchy, accessible colors
AbstractPattern backgrounds, section dividers, decorativeColor theory, mathematical forms, textures

Load references/prompt-engineering-blog.md for domain mode modifier libraries.

Step 3: Construct the 6-Component Reasoning Brief

Build the prompt as natural narrative paragraphs, not keyword lists:

  1. Subject - Who/what, with rich physical detail (textures, materials, scale)
  2. Action - What is happening, pose, gesture, movement, state
  3. Context - Environment, setting, time of day, season, weather
  4. Composition - Camera angle, shot type, framing, negative space, depth
  5. Lighting - Light source, quality, direction, color temperature, shadows
  6. Style - Art medium, aesthetic, film stock, reference artists/eras

Template for photorealistic blog images:

A photorealistic [shot type] of [subject with physical detail], [action/pose],
set in [environment with specifics]. [Lighting conditions] create [mood].
Captured with [camera model], [focal length] lens at [f-stop], producing
[depth of field effect]. [Color palette/grading notes]. Aspect ratio 16:9,
suitable as a blog [hero image/inline illustration] at [target dimensions].

Template for illustrated/stylized:

A [art style] [format] of [subject with character detail], featuring
[distinctive characteristics] with [color palette]. [Line style] and
[shading technique]. Background is [description]. [Mood/atmosphere].

Step 4: Set Aspect Ratio

Call set_aspect_ratio BEFORE generating. Use conversation_id: "default".

Blog Use CaseRatio
Hero / Cover / OG16:9
Product shot / Square4:3 or 1:1
Section divider21:9, then crop wider in post-processing if needed
Vertical (stories)9:16

Step 5: Generate via MCP

MCP ToolWhen
set_aspect_ratioAlways call first, even for 1:1
gemini_generate_imageNew image from crafted prompt
gemini_edit_imageModify existing image
gemini_chatIterative refinement / multi-turn sessions
get_image_historyReview generated images with conversation_id: "default"
clear_conversationReset session context

Model selection:

  • Stable Google API IDs: gemini-3.1-flash-image and gemini-3-pro-image
  • Pinned @ycse/nanobanana-mcp@1.1.1: set_model accepts flash and pro, but maps them to preview IDs that shut down on 2026-06-25
  • Use direct API or a newer MCP package that explicitly supports stable image IDs before promising working MCP image generation

Load references/mcp-tools.md for parameter details. Load references/gemini-models.md for model specs, pricing, and rate limits.

Step 6: Post-Processing (when needed)

After generation, resize/convert for blog use:

bash
# Resize to blog hero dimensions (1200x630)
magick input.png -resize 1200x630^ -gravity center -extent 1200x630 hero.png

# Convert to WebP for web optimization
magick input.png -quality 85 output.webp

# Convert to AVIF when target browsers support it
magick input.png -quality 80 output.avif

# Crop to exact OG dimensions
magick input.png -resize 1200x630^ -gravity center -extent 1200x630 og-image.png

Check if magick (ImageMagick 7) is available. Fall back to convert if not.

Step 7: Deliver

Provide:

  1. Image path - where it was saved (~/Documents/nanobanana_generated/)
  2. Crafted prompt - show the full Reasoning Brief (educational)
  3. Settings - model, aspect ratio, domain mode
  4. Alt text - descriptive sentence, 10-125 chars, topic keywords naturally
  5. Frontmatter snippet (for hero/OG images):
yaml
coverImage: "/path/to/generated-image.png"
coverImageAlt: "Descriptive alt text sentence with topic keywords"
ogImage: "/path/to/generated-image.png"
  1. Refinement suggestions - 1-2 ideas if relevant

Edit Workflow

For /blog image edit <path> <instructions>:

  1. Read the image path and edit instruction
  2. Enhance the instruction (never pass raw):
    User saysClaude crafts
    "remove background"Detailed edge-preserving background removal
    "make it warmer"Specific color temperature shift with preservation notes
    "add text"Font style, size, placement, contrast, readability notes
    "make it brighter"Increase exposure, lift shadows, maintain highlights
    "crop for social"Resize to 1200x630 with center-gravity crop
  3. Call gemini_edit_image with enhanced instruction
  4. Return modified image path and description

Internal API (for blog-write / blog-rewrite)

When invoked as a Task subagent from blog-write or blog-rewrite:

Input (provided by calling skill):

  • image_type: hero, inline, og, divider
  • topic: blog post topic/title
  • section_context: (optional) heading or section the image supports
  • style_preference: (optional) photorealistic, illustrated, editorial
  • count: (optional) number of images needed (default: 1)

Output (returned to calling skill):

markdown
### Generated Image
- **Path:** ~/Documents/nanobanana_generated/image_timestamp.png
- **Alt Text:** Descriptive sentence about the image
- **Type:** hero / inline / og
- **Domain Mode:** Editorial
- **Aspect Ratio:** 16:9
- **Suggested Frontmatter:**
  coverImage: "/path/to/image.png"
  coverImageAlt: "Alt text here"

Graceful fallback: If MCP is unavailable, return immediately with no error. The calling workflow continues with stock photos. Never block blog-write or blog-rewrite because image generation is unavailable.

Alt Text Generation

For every generated image, create alt text following blog standards:

  • Full descriptive sentence (not keyword list)
  • 10-125 characters
  • Include topic keywords naturally
  • Describe what the image shows AND its relevance to the content
  • For charts/infographics: include the key data point

Good: Marketing team analyzing AI search traffic data on a dashboard showing citation metrics Bad: SEO AI marketing blog optimization image

Setup

For /blog image setup:

  1. Run python3 skills/blog-image/scripts/setup_image_mcp.py (interactive)
    • Prefer: GOOGLE_AI_API_KEY=... python3 skills/blog-image/scripts/setup_image_mcp.py
    • Or: python3 skills/blog-image/scripts/setup_image_mcp.py --key-file /path/to/key.txt
    • Avoid --key unless necessary because command arguments can enter shell history and process lists
    • Default writes to ~/.claude/settings.json (user-private, mode 0600)
    • --project flag opts into project .mcp.json (env-expansion only, refuses to write a literal key into a tracked file)
  2. Verify: python3 skills/blog-image/scripts/validate_image_setup.py
  3. Requires:
  4. The script pins the package to @ycse/nanobanana-mcp@1.1.1. That npm release hard-codes preview image model IDs that shut down on 2026-06-25. Update setup, validation, and this documentation together when a package release with stable ID support is available.

Safety Filter Auto-Rephrase

When IMAGE_SAFETY or SAFETY is returned, do NOT give up. Auto-rephrase and retry:

  1. Identify the likely trigger (violence, public figures, NSFW-adjacent, or overly cautious filter)
  2. Rephrase using positive framing - describe what you WANT, not what to avoid
  3. If the subject is a person, make them generic (remove celebrity-like specifics)
  4. If the scene is dramatic, soften: "intense" → "focused", "battle" → "competition"
  5. Retry with the rephrased prompt (max 3 attempts before reporting to user)

Google acknowledged filters "became way more cautious than we intended" - benign prompts are sometimes blocked. Persistence with rephrasing usually succeeds.

Edit, Don't Re-roll

If an image is 80% correct, use gemini_chat for conversational editing rather than regenerating from scratch. The session maintains style consistency, so targeted edits preserve what works while fixing what doesn't.

When to edit vs regenerate:

  • Color slightly off → Edit ("shift the color temperature warmer")
  • Wrong composition entirely → Regenerate with revised brief
  • Good scene but wrong lighting → Edit ("change to golden hour lighting from the left")
  • Missing a detail → Edit ("add a steaming coffee cup on the desk")

Error Handling

ErrorResolution
MCP not configuredRun /blog image setup
API key invalidNew key at https://aistudio.google.com/apikey
Rate limited (429)Wait 60s, retry. Check live limits at https://ai.google.dev/gemini-api/docs/rate-limits
IMAGE_SAFETYAuto-rephrase (see above) - Layer 2 filter, non-configurable
PROHIBITED_CONTENTContent policy violation - topic is blocked. Non-retryable.
SAFETYRephrase prompt - Layer 1 filter
Vague requestAsk one clarifying question before generating
Poor qualityReview Reasoning Brief - likely missing lighting (biggest quality differentiator)
MCP unavailable (internal call)Return silently - calling workflow uses stock photos

Reference Documentation

Load on-demand - do NOT load all at startup:

  • references/prompt-engineering-blog.md - Domain modes, 6-component system, blog templates
  • references/gemini-models.md - Model specs, rate limits, aspect ratios, pricing
  • references/mcp-tools.md - MCP tool parameters and response formats

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Blog Image AI skill do?

AI image generation and editing for blog content powered by Gemini via MCP. Generates hero images, inline illustrations, social preview cards, and OG images, and edits existing ones. Supports 6 domain modes (Editorial, Product, Landscape, UI/Web, Infographic, Abstract). Works standalone or internally from blog-write and blog-rewrite; falls back gracefully when MCP is unavailable. Use when user says "blog image", "generate hero image", "blog illustration", "edit blog image", "OG image".

Why use Blog Image on TypingMind?

Because you install it once and use it with any model. Blog Image is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Blog Image in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AgriciDaniel/claude-blog/tree/main/skills/blog-image. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Blog Image?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Blog Image?

As many as you like. As long as a model supports skills, you can use Blog Image with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Blog Image AI skill free?

Yes. It is published on GitHub by AgriciDaniel under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇