media-gen

media-gen is a skill for Claude Code from afaraha8403/balakit. It costs 139 tokens per session (7,967 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 7,967 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.07967
Opus 5 $0.00069 $0.03984
Sonnet 5 $0.00028 $0.01593
Haiku 4.5 $0.00014 $0.00797

Measured 9d ago against content hash c2df675bd421, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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 · 581 lines

How it starts

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

Media Generation (Fal.ai) — v3.0

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 below is 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 ...

(Run in foreground, not background, to avoid env-var drop issues)

Direct Python API (fal_client v1.0.0)

You can bypass generate.py and call FAL directly with synchronous API — useful for quick scripts or when you need precise control over parameters:

import fal_client

# Upload a reference image to FAL CDN (SYNCHRONOUS in v1.0.0, do NOT await)
image_url = fal_client.upload_file('C:/Users/ali/product_primary.png')

# Image-to-image with Nano Banana Pro Edit
result = fal_client.run('fal-ai/nano-banana-pro/edit', arguments={
    'image_urls': [image_url],        # REQUIRED: ARRAY, not a single string
    'prompt': 'Your photography-grade prompt...',
    'strength': 0.85                   # 0.70-0.90 range; higher = more original image preserved
})

# Result shape: {'images': [{'url': '...', ...}], 'description': 'model reasoning'}
output_url = result['images'][0]['url']

Read the full file on GitHub · 581 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. 9d 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 12d ago), licensed MIT. It adds 139 tokens to every session and 7,967 once invoked, about $0.0007 per session on Opus 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.