The Problem
A startup launches a generative media service. They price it at $0.05/image. After three months, they're losing money — each image costs $0.08 in API calls because they're using FLUX Pro instead of Schnell, they generate 8 candidates per request (generate-N-pick-best), and they upscale every output. They didn't model the cost per generation before pricing.
Cost is not an afterthought in generative media — it's a first-class engineering concern that drives every decision: which model, which deployment strategy, how many candidates to generate, what quality threshold to set.
What you'll build
A cost calculator that takes a usage profile (N images/day, M videos/day, P songs/day) and computes daily/monthly costs across deployment strategies. Includes break-even analysis for self-hosting vs API.
The Concept
Per-generation costs
The fundamental unit of generative media economics is the cost per generation.
Image Generation
| Model | Provider | Cost/Image | Speed | Quality |
|---|
| FLUX.1 Schnell | fal.ai | $0.003 | ~2s | Good (4 steps) |
| FLUX.1 Dev | fal.ai | $0.025 | ~8s | High (20 steps) |
| FLUX.1 Pro | fal.ai | $0.05 | ~12s | Highest |
| SDXL (self-hosted) | RunPod H100 | ~$0.01* | ~5s | High (with LoRAs) |
| Midjourney V8 | Midjourney API | $0.10 | ~15s | Best aesthetics |
| DALL-E 3 | OpenAI API | $0.04 | ~10s | Good |
*Self-hosted cost = GPU-hour cost ÷ images per hour. H100 at $2.00/hr generating ~200 images/hr = $0.01/image.
Video Generation
| Model | Provider | Cost/Video | Duration | Resolution |
|---|
| Sora 2 | OpenAI API | $0.30-0.50 | 20s | 1080p |
| Veo 3.1 | Google API | $0.20-0.50 | 10s | 4K |
| Kling v2.6 | fal.ai | $0.25-0.40 | 10s | 4K 60fps |
| Runway Gen-4 | Runway API | $0.30-0.50 | 10s | 1080p |
| Pika 2.0 | Pika API | $0.08 | 5s | 1080p |
Audio/Music Generation
| Model | Provider | Cost/Song | Duration | Notes |
|---|
| Suno v5.5 | Suno API | $0.10 | 3min | Full songs with vocals |
| Stable Audio 3 | Stability API | $0.05 | 3min | Open weights option |
| MusicGen Large | Self-hosted | ~$0.02* | 30s | Open source |
| ElevenLabs Music | ElevenLabs | $0.15 | 2min | Commercial licensing |
3D Generation
| Model | Provider | Cost/Model | Format | Notes |
|---|
| Tripo AI | Tripo API | $0.15 | GLB | Game-ready topology |
| Rodin AI | Hyper3D API | $0.25 | GLB/FBX | Photorealistic |
| TRELLIS 2 | Self-hosted | ~$0.05* | OBJ/GLB | Open source, best quality |
GPU-hour costs
When self-hosting, you pay for GPU time, not per generation. The key metric is images (or videos) per GPU-hour.
| GPU | Cost/Hour | VRAM | Best For | Images/Hr | Videos/Hr |
|---|
| H100 80GB | $2.00 | 80GB | Image gen (FLUX, SDXL) | ~200 | ~12 |
| H200 141GB | $2.60 | 141GB | Video gen (4K/30s) | ~250 | ~20 |
| A100 80GB | $1.50 | 80GB | Budget image gen | ~150 | ~8 |
| B200 192GB | $5.00 | 192GB | Multi-model parallel | ~400 | ~30 |
| L40S 48GB | $1.20 | 48GB | Inference (smaller models) | ~100 | ~5 |
# Self-hosting cost per image
gpu_cost_per_hour = 2.00 # H100
images_per_hour = 200 # FLUX Schnell, 4 steps
cost_per_image = gpu_cost_per_hour / images_per_hour # $0.01
# API cost per image
api_cost_per_image = 0.003 # FLUX Schnell via fal.ai
# Break-even: when is self-hosting cheaper?
# Self-hosting: $2.00/hr (fixed, regardless of usage)
# API: $0.003/image (variable, only when generating)
# Break-even = $2.00 / $0.003 = 667 images per hour
You self-host FLUX on an H100 ($2.00/hr, 200 images/hr). You use the fal.ai API at $0.003/image. At what daily volume does self-hosting become cheaper?
Break-even = GPU cost ÷ API cost per image = $2.00 ÷ $0.003 = 667 images per GPU-hour. At 200 images/hr generation rate, that's 667/200 ≈ 3.3 hours of GPU time. If you generate 667+ images/day, self-hosting is cheaper. Below that, the API wins because you only pay per generation, not for idle GPU time.
The speed-quality-cost triangle
Every generative media decision involves a trade-off among three axes:
QUALITY
/\
/ \
/ \
/ \
/ \
/__________\
FAST CHEAP
- Fast + Cheap = lower quality (FLUX Schnell, 4 steps, $0.003)
- High Quality + Fast = expensive (FLUX Pro, dedicated GPU, $0.05+)
- High Quality + Cheap = slow (SDXL with 50 steps on budget GPU, $0.01 but 30s/image)
You can optimize any two axes, but the third will suffer. The engineering decision is which trade-off fits your use case.
| Use Case | Priority | Strategy |
|---|
| Real-time avatar | Speed + Cost | FLUX Schnell, 4 steps |
| Print advertising | Quality | FLUX Pro + Real-ESRGAN + manual review |
| Bulk product images | Cost | Self-hosted SDXL with LoRA |
| Social media content | Speed | Pika for video, FLUX Schnell for images |
Pipeline cost stacking
A pipeline's total cost is the sum of all steps:
# Product image pipeline
steps = [
("Generate (FLUX Schnell)", 0.003),
("Upscale (Real-ESRGAN)", 0.002),
("Background removal (rembg)", 0.001),
("Quality check (CLIPScore)", 0.0005),
]
total = sum(cost for _, cost in steps) # $0.0065 per output
# With generate-N-pick-best (N=8)
total_with_qa = total * 8 # $0.052 per delivered output
# Monthly cost at 10,000 outputs/day
monthly = total_with_qa * 10000 * 30 # $15,600/month
Generate-N-pick-best multiplies cost
If you generate 8 candidates and pick the best, your cost per delivered output is 8× the single-generation cost. Always factor this into pricing. The quality improvement is significant, but the cost impact is linear.
Monthly cost projections
| Scale | Images/Day | Strategy | Daily Cost | Monthly Cost |
|---|
| Small | 100 | API (FLUX Schnell) | $0.30 | $9 |
| Medium | 1,000 | API (FLUX Schnell) | $3.00 | $90 |
| Large | 10,000 | Self-hosted (H100) | $50 (25hr GPU) | $1,500 |
| Enterprise | 100,000 | Self-hosted (4× H100) | $200 (100hr GPU) | $6,000 |
At 10,000 images/day, self-hosting ($1,500/month) is dramatically cheaper than API ($3,000/month for FLUX Schnell alone, before post-processing).