Turn resolution into megapixels and a budget
Compute cost for AI image generation scales with resolution, not just the number of images — a 2048×2048 render takes roughly four times the GPU work of a 1024×1024 one. Before you kick off a batch of hundreds or thousands of images, this estimator converts your dimensions into megapixels and maps that onto an approximate credit or USD cost for Stability AI, Replicate, RunPod or OpenAI Images.
How the estimate is calculated
Megapixels are simply the total pixel count divided by a million:
megapixels_per_image = (width × height) / 1,000,000
total_megapixels = megapixels_per_image × image_count
estimated_cost = total_megapixels × platform_rate_per_MP
Each platform carries its own per-megapixel rate. Credit-based services like Stability AI charge in abstract credits; GPU-second services like Replicate and RunPod translate compute time into dollars; and per-image APIs like OpenAI Images are mapped to an approximate per-megapixel equivalent so they sit on the same scale.
Tips for keeping batch costs down
- Generate small, upscale later. A common money-saver is to generate at a modest resolution and run a cheaper dedicated upscaler afterwards rather than generating at full size.
- Mind the squared scaling. Doubling both dimensions quadruples megapixels and roughly quadruples cost — resolution choices matter far more than they look.
- Account for retries. Real projects rarely keep the first generation, so budget for 2–4× the nominal image count when planning a large run.
- Confirm minimums. Some platforms have minimum per-call charges or round up to size tiers, so very small images may not be as cheap as the raw per-megapixel math suggests.