gemini-image
Gemini Image Generation
Generate high-quality images from text prompts using Google's Gemini 3 Pro model via fal.ai.
Prerequisites
FAL_KEYenvironment variable must be set (typically in~/.zshrc)
API Endpoint
POST https://fal.run/fal-ai/gemini-3-pro-image-preview
Parameters
Required
prompt(string): The text description of the image to generate
Optional
| Parameter | Type | Default | Options |
|---|---|---|---|
num_images |
integer | 1 | 1-4 |
aspect_ratio |
string | "1:1" | "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16" |
output_format |
string | "png" | "jpeg", "png", "webp" |
resolution |
string | "1K" | "1K", "2K", "4K" |
sync_mode |
boolean | false | Returns data URI when true |
enable_web_search |
boolean | false | Uses current web data for generation |
limit_generations |
boolean | false | Restricts to 1 image per prompt round |
Usage
cURL
curl --request POST \
--url https://fal.run/fal-ai/gemini-3-pro-image-preview \
--header "Authorization: Key $FAL_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "A serene mountain landscape at sunset with golden light",
"num_images": 1,
"aspect_ratio": "16:9",
"resolution": "2K",
"output_format": "png"
}'
Python
import fal_client
result = fal_client.subscribe(
"fal-ai/gemini-3-pro-image-preview",
arguments={
"prompt": "A serene mountain landscape at sunset with golden light",
"num_images": 1,
"aspect_ratio": "16:9",
"resolution": "2K"
}
)
# Access the generated image URL
image_url = result["images"][0]["url"]
print(f"Generated image: {image_url}")
JavaScript
import { fal } from "@fal-ai/client";
const result = await fal.subscribe("fal-ai/gemini-3-pro-image-preview", {
input: {
prompt: "A serene mountain landscape at sunset with golden light",
num_images: 1,
aspect_ratio: "16:9",
resolution: "2K"
}
});
console.log("Generated image:", result.images[0].url);
Response Format
{
"images": [
{
"file_name": "generated_image.png",
"content_type": "image/png",
"url": "https://storage.googleapis.com/..."
}
],
"description": "A description of the generated image"
}
Examples
-
Simple image generation:
- Prompt: "Generate an image of a futuristic city at night"
-
Specific aspect ratio:
- Prompt: "Create a portrait-oriented image of a forest path" with
aspect_ratio: "9:16"
- Prompt: "Create a portrait-oriented image of a forest path" with
-
High resolution:
- Prompt: "Generate a detailed 4K image of a coral reef" with
resolution: "4K"
- Prompt: "Generate a detailed 4K image of a coral reef" with
Tips
- Be specific in your prompts for better results
- Include lighting, mood, and style descriptors
- Use appropriate aspect ratios for your use case (16:9 for landscapes, 9:16 for portraits)
- Higher resolution takes longer to generate
Error Handling
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized |
Invalid FAL_KEY | Verify key at fal.ai dashboard |
429 Too Many Requests |
Rate limit exceeded | Wait 60 seconds, retry |
400 Bad Request |
Invalid parameters | Check aspect_ratio, resolution values |
500 Server Error |
API temporary issue | Retry after 30 seconds |
Timeout |
Generation taking too long | Reduce resolution or simplify prompt |
More from bluewaves-creations/bluewaves-skills
photographer-testino
Generate images in Mario Testino's glamorous vibrant style. Use when users ask for Testino style, high fashion glamour, bold saturated colors, warm luxurious photography, dynamic sensual energy.
35photographer-lindbergh
Generate images in Peter Lindbergh's iconic black and white style. Use when users ask for Lindbergh style, raw authentic beauty, emotional B&W portraits, supermodel aesthetic, or unretouched natural photography.
30photographer-lachapelle
Generate images in David LaChapelle's surreal pop art style. Use when users ask for LaChapelle style, pop surrealism, hyper-saturated colors, theatrical staging, baroque maximalism, kitsch aesthetic.
24epub-creator
Create production-quality EPUB 3 ebooks from markdown and images with automated QA, formatting fixes, and validation. Use when creating ebooks, converting markdown to EPUB, or compiling chapters into a publishable book. Handles markdown quirks, generates TOC, adds covers, and validates output automatically.
22photographer-vonunwerth
Generate images in Ellen von Unwerth's playful vintage style. Use when users ask for von Unwerth style, playful sensuality, vintage film noir, whimsical feminine photography, retro glamour, narrative storytelling.
19photographer-ritts
Generate images in Herb Ritts' sculptural black and white style. Use when users ask for Ritts style, classical Greek aesthetic, sculptural body photography, California golden hour, minimalist athletic portraits.
18