AI Image Generation: When Hype Meets Reality
I've been putting off implementing AI image generation for ages, but I finally decided to give it a proper go. I pay for Google Gemini Pro, so I thought I'd be able to use those benefits to create custom images for my blog posts.
As a frontend-focused developer, I wanted to test out client-side image generation solutions that would fit well with my blog's architecture. The documentation suggests implementing backend solutions, and perhaps you might have more luck with that approach, but I was specifically looking for frontend client-side options.
Turns out, it's not quite that straightforward - what I discovered was a proper minefield of regional restrictions, billing surprises, and technical headaches.
Gemini: The not so perfect solution?
Google's Gemini API seemed like the obvious choice. It's integrated with their ecosystem, the documentation looks decent, and the image generation capabilities sounded promising. I got my API key sorted for AI studio and started having a play around with it.
The First Roadblock: Regional Restrictions
// This should work, right? const response = await ai.models.generateContent({ model: "gemini-1.5-flash", contents: prompt, config: { responseModalities: [Modality.TEXT, Modality.IMAGE], }, });
Error: "Image generation is not available in your country."
Hang on, what? I'm in the UK, which is definitely listed as supported in the official documentation. Even when a service claims to be available in your region, specific features like image generation might not be.
After loads of testing, I discovered something pretty crucial: the model that "worked" was actually a text-only model. While it gave me a successful response, it didn't actually generate any images.
Gemini suggests calling the ListModels API to see what models are actually available to your account. When I did this, I found that the dedicated image generation models weren't even listed in my available models.
The real kicker came when I found this in the Gemini documentation:
Preview: gemini-2.0-flash-preview-image-generation
gemini-2.0-flash-preview-image-generation
is not currently supported in a number of countries in Europe, Middle East & Africa
So the dedicated image generation model that Google recommends for image generation is explicitly not supported in Europe, Middle East & Africa - including the UK! Brilliant.
Trying Alternative Models
I tried multiple Gemini models with real error messages:
// Model 1: gemini-1.5-flash Error: "Image generation is not available in your country." (400) // Model 2: gemini-1.5-pro Error: "You exceeded your current quota, please check your plan and billing details." (429) // Model 3: gemini-2.0-flash Error: "Model does not support the requested response modalities: text,image" (400)
Each attempt revealed a different limitation:
- Regional restrictions - Even in supported countries, image generation isn't available
- Rate limits - Free tier quotas are easily exceeded during development
- Model limitations - Not all models support image generation, even when they should
Each attempt revealed a different limitation, none of which were obvious from the documentation.
The Paid Tier Reality
Even if I had been able to access Gemini's image generation features, the paid tier pricing would have been another hurdle. According to the official Gemini API pricing, the Imagen 3 model (which powers Gemini's image generation) costs:
- $0.20 per image for standard quality
- $0.40 per image for high quality
This is actually more expensive than DALL-E's pricing, making it even less suitable for personal projects. For a blog post requiring 10 images, that's $2-4 just for image generation - a significant cost for a personal developer project.
DALL-E & the billing surprise
Frustrated with Gemini's limitations, I switched to OpenAI's DALL-E. The implementation was pretty straightforward:
const response = await openai.images.generate({ model: "dall-e-3", prompt: prompt, n: 1, size: "1024x1024", response_format: "b64_json", });
Except it didn't work at all - DALL-E wouldn't even let me generate anything because it required billing to be set up first. No free tier, no trial, just straight to the payment details.
Even if I had got it working, the pricing would have been:
- $0.040 per image (1024x1024)
- $0.080 per image (larger sizes)
- $0.120 per image (HD quality)
For a personal blog, this adds up pretty quickly. At 4-12 cents per image, generating 10 images per blog post would cost $0.40-$1.20. Not massive, but not free either.
This highlights a broader trend: AI is not free and it's getting more and more expensive. What started as "free tiers" and "affordable" pricing is rapidly becoming a significant cost for developers and content creators.
As my use case is just a developer working on a personal blog post, it's frustrating that so many AI services don't offer proper free tiers for personal projects. Lots of other developer tools and services offer generous free tiers for personal use - why don't AI services do the same?
The "Free" Alternative: Stable Diffusion
Determined to find a cost-effective solution, I discovered Stable Diffusion through Replicate. This open-source model offers:
- "Free tier available" (with a catch...)
- High quality images
- No regional restrictions
- Open source (can run locally if needed)
The Business Email Requirement
Just when I thought I'd found the perfect free solution:
"Welcome to Runware. To qualify for ~1000 free images, you'll need to sign up with a business email address."
Ah, the classic "free" service that's only free for businesses! Many AI services prioritise business users over individual developers and content creators.
I could have used my business email, but I prefer to keep my personal projects separate from my professional accounts. This is another hidden cost of "free" AI services - they often require you to mix personal and business identities.
const output = await replicate.run( "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b", { input: { prompt: prompt, width: 1024, height: 1024, num_outputs: 1, } } );
The Reality Check
So what did I actually achieve? After all that testing, debugging, and API calls, I ended up with:
- Gemini: Regional restrictions prevent image generation entirely
- DALL-E: Requires billing setup before you can even test it
- Stable Diffusion: "Free" but only for business users
- My own implementation: Abandoned due to the barriers above
The irony isn't lost on me that I pay for Gemini Pro but can't use it for image generation, while other developer tools offer generous free tiers for personal projects. (Like Netlify and Vercel!)
I know Gemini offers image generation in their app, but I find it painfully slow, and it never generates the same image twice even with identical prompts. Plus, my prompts are far from perfect, so the inconsistency makes it frustrating to use for any serious work.
The Bigger Picture
This experience highlights two major issues with AI services today:
Cost is becoming a real barrier. What started as "affordable" AI is rapidly becoming expensive, especially for individual developers and content creators. The days of generous free tiers seem to be disappearing, replaced by enterprise-focused pricing that excludes personal projects.
Documentation is often terrible. The big AI companies produce long, confusing documentation that's never suited to personal project developers. You have to dig through pages of corporate-speak to find basic information, and even then it's often outdated or misleading about regional availability and feature support.
The current state of AI image generation APIs seems designed for enterprise users, not individual developers working on personal projects. For now, I'll carry on using existing image generation tools when needed, but the dream of having a seamless, integrated AI image generation system for my blog remains on hold.
Note: This information is correct as of July 2025. AI services and their regional availability change frequently, so this may be out of date by the time you read it.
Resources
- Replicate - Free Stable Diffusion API
- OpenAI Pricing - DALL-E costs
- Gemini API Models Documentation - Official documentation showing regional restrictions for image generation
- Gemini API Regional Availability - General regional availability info