media-gen

media-gen is a skill for Claude Code from afaraha8403/balakit. It costs 139 tokens per session (4,170 once invoked), scanned A, original, MIT.

A guide for generating and editing images and videos with Fal.ai, an online service that runs AI media models.

In plain words
What is it for?
It helps create Instagram advertising concepts, edit reference images, and produce two image variations for each brief.
Why use it?
It standardizes setup and prompting so media generation uses the required credentials, tools, and image-editing workflow.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: positional $N argument; installed under .agents/ (shared by several agents).

Good fit It helps create Instagram advertising concepts, edit reference images, and produce two image variations for each brief.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/afaraha8403/balakit/media-gen
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add afaraha8403/balakit --skill media-gen
Clone the repo
git clone --depth 1 https://github.com/afaraha8403/balakit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for media-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/afaraha8403/balakit/media-gen/github.svg)](https://agentmods.dev/skills/afaraha8403/balakit/media-gen)
Your own site
<a href="https://agentmods.dev/skills/afaraha8403/balakit/media-gen"><img src="https://agentmods.dev/badge/skills/afaraha8403/balakit/media-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for media-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/afaraha8403/balakit/media-gen"><img src="https://agentmods.dev/badge/skills/afaraha8403/balakit/media-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,170 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00139 $0.04170
Opus 5.5 $0.00056 $0.01668
Sonnet 5.5 $0.00028 $0.00834
Haiku 4.5 $0.00014 $0.00417

Measured 1mo ago against content hash 4e659beaf84c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

media-gen scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/generate.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

**⚠️ Wix / JS-heavy site fallback:** If the browser tool errors out (blank page, WinError), the site is likely a Wix SPA. Do NOT retry the browser — switch to `curl + grep` to extract `wixstatic.com` image URLs from the
.agents/skills/media-gen/SKILL.md · 291 lines

How it starts

The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Media Generation (Fal.ai) — v3.1

Leading words: pick the model, run the script, dual-model ads, one image per message, native filesystem path.

Decision model (read this first):

  1. Pick the job: still / edit / upscale / video / Instagram ad pair.
  2. Run scripts/generate.py (or the documented fal_client call). Do not paste a rotated key; use FAL_KEY="$FAL_KEY".
  3. Image-to-image when a reference exists. Dual-model for ad concepts (Nano Banana Pro Edit + Ideogram v4).
  4. One image per chat message (Telegram).
  5. Depth: references/endpoint-models.md, references/model-input-formats.md, references/high-conversion-prompting.md, references/fal-key-troubleshooting.md, references/wix-product-image-extraction.md.

Black Forest Labs FLUX Prompting Guide Reference: The official FLUX prompting guide is at https://docs.bfl.ml/guides/prompting_summary.md All photography terminology lives in references/photography-lexicon.md, sourced from BFL's official Prompt Reference (https://docs.bfl.ml/guides/prompting_unified_reference.md).

Key principle from BFL: "Prompt the model as if describing a real photograph: specify lens, lighting, framing, and texture details for maximum realism."

How FLUX reads prompts: Write in prose, not keyword lists — describe scenes like a novelist. Lighting descriptions have the highest single impact on output quality.


Setup

# Prerequisites
export FAL_KEY="your-key-here"   # On Windows: setx FAL_KEY "key" (restart terminal)
pip install fal-client

# CRITICAL: fal-client >= 1.0.0 required for CDN upload (image-to-image)
# Old v0.13.1 broke CDN auth. Upgrade: pip install --upgrade fal-client

CRITICAL: FAL_KEY must use shell expansion, not the literal string. Hardcoding the key string (FAL_KEY="07138a1e-...") returns 401 even when the shell-expanded version (FAL_KEY="$FAL_KEY") works. The env var may contain escape characters or may have been rotated since you read it. ✅ FAL_KEY="$FAL_KEY" python scripts/generate.py ... ❌ FAL_KEY="07138a1e-..." python scripts/generate.py ...

Read the full file on GitHub · 291 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -290 lines 4e659beaf84c
  2. 2mo ago First seen · 581 lines · 139 tokens per session scan A c2df675bd421

Subscribe to this mod's changes

media-gen is a skill published in the GitHub repository afaraha8403/balakit (1 stars, last pushed 1mo ago), licensed MIT. It adds 139 tokens to every session and 4,170 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.