smithery.ai

generate-header-image

Generate a blog post header image via Replicate, import it into Bhart R2 media storage, and set the post hero_image_url + hero_image_alt via the Bhart Codex API.

First seen Apr 14, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents codex

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,566 B
  • docs SUMMARY.md 190 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Generate Header Image

Use this skill when the user wants to create or replace an existing post's header/hero image.

This workflow:

  1. generates an image with Replicate (default model: Nano Banana Pro)
  2. uploads the generated image directly into the bhart.org R2 media bucket (so it is served from /media/...)
  3. updates the target post's heroimageurl + heroimagealt

Requirements

  • CODEXBHARTAPI_TOKEN (for Bhart Blog Automation API)
  • REPLICATEAPITOKEN (for Replicate API)
  • Python 3

Bhart API note

This skill uses a Codex API media helper endpoint:

  • POST /api/codex/v1/media/import

- Downloads sourceurl (must be an image) into the MEDIABUCKET R2 bucket - Creates a media_assets row in D1 - Returns { media: { id, key, url, ... } } where url is a site-local /media/<key> URL

  • POST /api/codex/v1/media/upload

- Accepts a multipart form upload (image file) - Stores directly in MEDIABUCKET - Creates a mediaassets row in D1

Recommended workflow

  1. Identify the post:

- GET /posts/by-slug/:slug (preferred) or GET /posts/:id

  1. Generate alt text:

- Keep it short, descriptive, and literal (what the image shows), not marketing copy.

  1. Generate the image on Replicate (Nano Banana Pro):

- Prefer passing the logo as an input image if it helps anchor the composition.

  1. Import into R2:

- Call POST /media/upload with image, alt_text, and the post author fields.

  1. Update the post hero fields:

- PATCH /posts/:id with heroimageurl, heroimagealt, and expectedupdatedat.

Script (preferred)

Run:

bash .codex/skills/generate-header-image/scripts/generateheaderimage.sh --slug <post-slug> --prompt-file <prompt.txt> --logo-url <https://.../logo.png>;

Notes:

  • Default model is google/nano-banana-pro (Nano Banana Pro). If it fails and default is used, script falls back to black-forest-labs/flux-1.1-pro.
  • Default aspect ratio is 16:9 (header-friendly); override via --aspect-ratio.
  • Default resolution is 2K; override via --resolution.
  • Default upload mode is direct (multipart upload to /media/upload). Use --upload-mode import to import from a URL or --upload-mode skip to stop after generating the image.
  • The script prefers ~/scripts/.venv/bin/python if available; otherwise it falls back to python3.