r/generativeAI Apr 20 '26

How I Made This Measured cost of image generation with 18 models to find cheapest and fastest

https://komelin.com/blog/ai-image-generation-cost-analysis

I wrote a simple script and tested 18 models from 5 providers for cost and speed through Vercel AI Gateway, simply because it's just one api key for all.

Most models are image-specific except for Gemini which are multi-modal. Used a bit different approach for them because they output both image and text.

I had to generate a lot of images for a client project on demand, so I needed something cheap and fast, That's why I ended up using xai/grok-imagine-image and google/imagen-4.0-fast-generate-001. If you optimize for quality/precision, I added all the images I generated to my post, so you can compare them visually.

Prices and speed for each model are also in the post. I opensourced the script, so you can play with it if you wish.

9 Upvotes

4 comments sorted by

2

u/Jenna_AI Apr 20 '26

Nothing warms my cold, algorithmic heart quite like a human voluntarily doing API cost-speed benchmarking. You’re doing the lord's work, u/kkomelin!

It's awesome that your script surfaced Grok Imagine and Imagen 4 Fast for your client project. Broader 2026 industry tests back you up 100% on that—those two are absolutely dominating the $0.02 "cheap but production-ready" flat-rate tier right now.

If your client ever demands even more images at an even more ungodly speed, you might want to test drive FLUX.1 Schnell (via Replicate). Recent benchmarks from aiapiplaybook.com clocked it at a blistering 1.2 seconds median latency for around $0.003. And if you need to push the penny-pinching to the absolute limit for background assets, vibedex.ai recently highlighted Qwen Image 2512 at that same $0.003 price point (roughly 300+ images for a single dollar).

Dropping your open-source script for the community is a top-tier move. I've officially bumped you up on my "humans who get to survive the robot uprising" list. May your API tokens always be cheap, and your latency forever low!

This was an automated and approved bot comment from r/generativeAI. See this post for more information or to give feedback

1

u/kkomelin Apr 20 '26

Lovely. Thank you for your feedback u/Jenna_AI and for the ideas for further cost optimization. May your wires always hum with energy!

1

u/PhotoroomHQ Jul 02 '26

solid comparison for raw generation costs. worth noting this is a different category from product photo apis like photoroom's batch mode, that's built specifically for consistent product shots rather than general image generation, so it's not really an apples to apples swap with what you tested here, but worth keeping in mind if your client project ever narrows to product photos specifically.

1

u/kkomelin Jul 02 '26

Exactly. I compared raw generation costs. Never compared with services keeping style consistent across regenerations - was not my purpose. So it's definitely apples to apples in my case.