hashgraph-online/awesome-codex-plugins / plugins/BestLemoon/codex-seo/skills/seo-image-gen
seo-image-gen
VerifiedAI image generation for SEO assets: OG/social preview images, blog hero images, schema images, product photography, infographics. Powered by Gemini via nanobanana-mcp. Requires banana extension installed. Use when user says "generate image", "OG image", "social preview", "hero image", "blog image", "product photo", "infographic", "seo image", "create visual", "image-gen", "favicon", "schema image", "pinterest pin", "generate visual", "banner", or "thumbnail".
| File | Kind | Size |
|---|---|---|
| LICENSE.txt | markdown | 142 B |
| SKILL.md | skill md | 8.1 KB |
| references/cost-tracking.md | markdown | 1.4 KB |
| references/gemini-models.md | markdown | 7.5 KB |
| references/mcp-tools.md | markdown | 3.7 KB |
| references/post-processing.md | markdown | 5.1 KB |
| references/presets.md | markdown | 2.2 KB |
| references/prompt-engineering.md | markdown | 20.2 KB |
| references/seo-image-presets.md | markdown | 3.9 KB |
| scripts/batch.pyexecutable | script | 3.1 KB |
| scripts/cost_tracker.pyexecutable | script | 6.2 KB |
| scripts/edit.pyexecutable | script | 4.5 KB |
| scripts/generate.pyexecutable | script | 5.4 KB |
| scripts/presets.pyexecutable | script | 4.9 KB |
| scripts/setup_mcp.py | script | 1.5 KB |
| scripts/validate_setup.py | script | 686 B |
scripts/cost_tracker.py
View on GitHub#!/usr/bin/env python3
"""Banana Codex - Cost Tracker
Track image generation costs, view summaries, and estimate batch costs.
Usage:
cost_tracker.py log --model MODEL --resolution RES --prompt "summary"
cost_tracker.py summary
cost_tracker.py today
cost_tracker.py estimate --model MODEL --resolution RES --count N
cost_tracker.py reset --confirm
"""
import argparse
import json
import sys
from datetime import datetime, timezone
from pathlib import Path
LEDGER_PATH = Path.home() / ".banana" / "costs.json"
# Cost per image in USD (approximate, based on ~1,290 output tokens)
PRICING = {
"gemini-3.1-flash-image-preview": {
"512": 0.020,
"1K": 0.039,
"2K": 0.078,
"4K": 0.156,
},
"gemini-2.5-flash-image": {
"512": 0.020,
"1K": 0.039,
},
}
# Batch API gets 50% discount
BATCH_DISCOUNT = 0.5
def _load_ledger():
"""Load the cost ledger from disk."""
if not LEDGER_PATH.exists():
return {"total_cost": 0.0, "total_images": 0, "entries": [], "daily": {}}
with open(LEDGER_PATH, "r") as f:
return json.load(f)
def _save_ledger(ledger):
"""Save the cost ledger to disk."""
LEDGER_PATH.parent.mkdir(parents=True, exist_ok=True)
with open(LEDGER_PATH, "w") as f:
json.dump(ledger, f, indent=2)
def _lookup_cost(model, resolution, batch=False):
"""Look up cost for a model+resolution combination."""
model_pricing = PRICING.get(model)
if not model_pricing:
# Try partial match
for key in PRICING:
if key in model or model in key:
model_pricing = PRICING[key]
break
if not model_pricing:
print(f"Warning: Unknown model '{model}', using 3.1 Flash pricing", file=sys.stderr)
model_pricing = PRICING["gemini-3.1-flash-image-preview"]
valid_resolutions = {"512", "1K", "2K", "4K"}
if resolution not in valid_resolutions:
print(f"Warning: Unknown resolution '{resolution}', using 1K pricing", file=sys.stderr)
cost = model_pricing.get(resolution, model_pricing.get("1K", 0.039))
if batch:
cost *= BATCH_DISCOUNT
return cost
def cmd_log(args):
"""Log a generation to the ledger."""
ledger = _load_ledger()
cost = _lookup_cost(args.model, args.resolution, getattr(args, "batch", False))
today = datetime.now(timezone.utc).strftime("%Y-%m-%d")
now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
entry = {
"ts": now,
"model": args.model,
"res": args.resolution,
"cost": cost,
"prompt": args.prompt[:100],
}
ledger["entries"].append(entry)
ledger["total_cost"] = round(ledger["total_cost"] + cost, 4)
ledger["total_images"] += 1
if today not in ledger["daily"]:
ledger["daily"][today] = {"count": 0, "cost": 0.0}
ledger["daily"][today]["count"] += 1
ledger["daily"][today]["cost"] = round(ledger["daily"][today]["cost"] + cost, 4)
_save_ledger(ledger)
print(json.dumps({"logged": True, "cost": cost, "total_cost": ledger["total_cost"],
"total_images": ledger["total_images"]}))
def cmd_summary(args):
"""Show cost summary."""
ledger = _load_ledger()
print(f"Total images: {ledger['total_images']}")
print(f"Total cost: ${ledger['total_cost']:.3f}")
print()
daily = ledger.get("daily", {})
if daily:
# Show last 7 days
sorted_days = sorted(daily.keys(), reverse=True)[:7]
print("Last 7 days:")
for day in sorted_days:
d = daily[day]
print(f" {day}: {d['count']} images, ${d['cost']:.3f}")
else:
print("No usage recorded yet.")
def cmd_today(args):
"""Show today's usage."""
ledger = _load_ledger()
today = datetime.now(timezone.utc).strftime("%Y-%m-%d")
daily = ledger.get("daily", {}).get(today, {"count": 0, "cost": 0.0})
print(f"Today ({today}): {daily['count']} images, ${daily['cost']:.3f}")
def cmd_estimate(args):
"""Estimate cost for a batch."""
cost_per = _lookup_cost(args.model, args.resolution, getattr(args, "batch", False))
total = round(cost_per * args.count, 3)
print(f"Model: {args.model}")
print(f"Resolution: {args.resolution}")
print(f"Count: {args.count}")
print(f"Cost/image: ${cost_per:.3f}")
print(f"Total est: ${total:.3f}")
if not getattr(args, "batch", False):
batch_total = round(cost_per * BATCH_DISCOUNT * args.count, 3)
print(f"Batch est: ${batch_total:.3f} (50% discount)")
def cmd_reset(args):
"""Reset the ledger."""
if not args.confirm:
print("Error: Pass --confirm to reset the cost ledger.", file=sys.stderr)
sys.exit(1)
_save_ledger({"total_cost": 0.0, "total_images": 0, "entries": [], "daily": {}})
print("Cost ledger reset.")
def main():
parser = argparse.ArgumentParser(description="Banana Codex Cost Tracker")
sub = parser.add_subparsers(dest="command", required=True)
# log
p_log = sub.add_parser("log", help="Log a generation")
p_log.add_argument("--model", required=True, help="Model ID")
p_log.add_argument("--resolution", required=True, help="Resolution (512, 1K, 2K, 4K)")
p_log.add_argument("--prompt", required=True, help="Brief prompt description")
p_log.add_argument("--batch", action="store_true", help="Batch API (50%% discount)")
# summary
sub.add_parser("summary", help="Show cost summary")
# today
sub.add_parser("today", help="Show today's usage")
# estimate
p_est = sub.add_parser("estimate", help="Estimate batch cost")
p_est.add_argument("--model", required=True, help="Model ID")
p_est.add_argument("--resolution", required=True, help="Resolution (512, 1K, 2K, 4K)")
p_est.add_argument("--count", required=True, type=int, help="Number of images")
p_est.add_argument("--batch", action="store_true", help="Use batch pricing (50%% discount)")
# reset
p_reset = sub.add_parser("reset", help="Reset cost ledger")
p_reset.add_argument("--confirm", action="store_true", help="Confirm reset")
args = parser.parse_args()
cmds = {"log": cmd_log, "summary": cmd_summary, "today": cmd_today,
"estimate": cmd_estimate, "reset": cmd_reset}
cmds[args.command](args)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |