Skip to main content

Google Imagen 4 integration

Google’s latest text-to-image model family with two variants: Fast for speed-optimized generation and Ultra for maximum quality with fine-grained safety and person-generation controls.
Imagen 4 is Google’s text-to-image API for generating high-quality images from natural language prompts. It is available in two variants: Imagen 4 Fast, optimized for speed and cost-effectiveness, and Imagen 4 Ultra, tuned for maximum output quality for professional and production workflows. Both variants share the same parameter schema, multilingual prompt support, and safety controls, and are delivered asynchronously via task IDs with webhook or polling integration.

Key capabilities

  • Two quality tiers: imagen4-fast for rapid iteration and cost-effective batch generation; imagen4-ultra for highest fidelity and professional use
  • Multilingual prompts: Supports auto, en, zh, zh-CN, hi, ja, ko, pt, es for native-language inputs
  • Aspect ratios: square_1_1, social_story_9_16, widescreen_16_9, traditional_3_4, classic_4_3
  • Person generation controls: dont_allow, allow_adult, allow_all for compliance with content policies
  • Safety settings: block_low_and_above, block_medium_and_above, block_only_high, block_none
  • Output formats: image/png or image/jpeg (with configurable JPEG compression_quality 0-100)
  • LLM prompt rewriting: Enable enhance_prompt for higher-quality results that better reflect intent
  • Reproducibility: Deterministic generation with seed (1 to 4,294,967,295)
  • Async processing: Webhook notifications or polling for task completion

Use cases

  • Marketing creatives: Campaign visuals, social posts, and product imagery in standard aspect ratios
  • E-commerce: On-brand product and lifestyle imagery at professional quality with Ultra
  • Editorial and publishing: Illustrations and hero images in multiple languages
  • Rapid prototyping: Visual ideation with Fast for low-cost iteration before finalizing with Ultra
  • Localized content: Native-language prompts for Spanish, Japanese, Korean, Chinese, Portuguese, Hindi and more

Choose your variant

Imagen 4 Fast

Speed-optimized and cost-effective. Ideal for rapid iteration, prototyping, and high-volume pipelines.

Imagen 4 Ultra

Highest-quality output for professional and production use. Best for hero visuals and final deliverables.

API endpoints

Imagen 4 Fast

POST /v1/ai/text-to-image/imagen4-fast

Create a new image generation task

GET /v1/ai/text-to-image/imagen4-fast

List all Imagen 4 Fast tasks

GET /v1/ai/text-to-image/imagen4-fast/{task-id}

Get task status and results by ID

Imagen 4 Ultra

POST /v1/ai/text-to-image/imagen4-ultra

Create a new image generation task

GET /v1/ai/text-to-image/imagen4-ultra

List all Imagen 4 Ultra tasks

GET /v1/ai/text-to-image/imagen4-ultra/{task-id}

Get task status and results by ID

Parameters

Both Imagen 4 Fast and Imagen 4 Ultra share the same request schema.
ParameterTypeRequiredDefaultDescription
promptstringYes-Text description of the image to generate
aspect_ratiostringNosquare_1_1Output ratio: square_1_1, social_story_9_16, widescreen_16_9, traditional_3_4, classic_4_3
person_generationstringNoallow_adultPerson generation policy: dont_allow, allow_adult, allow_all
safety_settingsstringNoblock_medium_and_aboveSafety filter level: block_low_and_above, block_medium_and_above, block_only_high, block_none
seedintegerNo-Deterministic seed (1 - 4,294,967,295). Does not work when enhance_prompt is enabled
enhance_promptbooleanNo-LLM-based prompt rewriting for higher-quality images
languagestringNoenPrompt language: auto, en, zh, zh-CN, hi, ja, ko, pt, es
output_options.mime_typestringNoimage/pngOutput format: image/png or image/jpeg
output_options.compression_qualityintegerNo75JPEG compression (0-100). Only applies when mime_type is image/jpeg
webhook_urlstringNo-URL for async status notifications

Frequently Asked Questions

Imagen 4 is Google’s text-to-image model available in two variants through the Magnific API: Fast (speed and cost-optimized) and Ultra (highest quality). You submit a text prompt via the API, receive a task ID immediately, then poll the task endpoint or configure a webhook to receive the generated image when processing completes. The response returns the image as base64-encoded data.
Imagen 4 Fast is optimized for speed and cost-effectiveness, making it suitable for rapid iteration, prototyping, and high-volume workflows. Imagen 4 Ultra is tuned for maximum output quality, making it the right choice for hero visuals, editorial imagery, and production deliverables. Both share the exact same parameters, aspect ratios, and safety controls.
Five aspect ratios: square_1_1 (1:1), social_story_9_16 (9:16), widescreen_16_9 (16:9), traditional_3_4 (3:4), and classic_4_3 (4:3). The default is square_1_1.
Imagen 4 supports prompts in English (en), Spanish (es), Portuguese (pt), Japanese (ja), Korean (ko), Hindi (hi), Simplified Chinese (zh-CN), generic Chinese (zh), and automatic detection (auto). Use the language parameter to indicate the prompt language.
Use person_generation to control whether people appear in outputs: dont_allow disables person generation, allow_adult permits adults only, and allow_all permits all ages. Use safety_settings to configure content filtering from strict (block_low_and_above) to permissive (block_none). The defaults are allow_adult and block_medium_and_above respectively.
Yes. Provide a seed value between 1 and 4,294,967,295 to reproduce identical outputs for the same prompt and parameters. Note that seed does not work when enhance_prompt is enabled, because LLM-based rewriting introduces non-deterministic changes to the prompt.
Imagen 4 returns images as base64-encoded data in either PNG (default) or JPEG. Use output_options.mime_type to select the format and output_options.compression_quality (0-100) to control JPEG compression. The default JPEG quality is 75.
Rate limits depend on your subscription tier. See Rate Limits for current limits.
See the Pricing page for current rates and subscription options for both Fast and Ultra variants.

Best practices

  • Variant selection: Start with Imagen 4 Fast for ideation and iteration; switch to Imagen 4 Ultra for final, production-grade assets
  • Prompt writing: Be specific about subject, composition, lighting, and style. Use the matching language code when prompting in non-English languages
  • Prompt enhancement: Enable enhance_prompt when you want the model to refine and expand brief prompts. Disable it when you need deterministic output (with seed)
  • Safety configuration: Tune person_generation and safety_settings to match your content policy before going to production
  • Reproducibility: Pin a seed and keep enhance_prompt disabled when building A/B test suites or regression samples
  • Production integration: Use webhooks instead of polling for scalable applications
  • Error handling: Implement retry logic with exponential backoff for 503 errors
  • Nano Banana Pro: Google’s Gemini 3 text-to-image model with Google Search grounding and reference images
  • Nano Banana Pro Flash: Faster Gemini 3.1 Flash variant with the same feature set as Nano Banana Pro
  • Seedream 4: High-quality text-to-image generation with advanced prompt understanding
  • Mystic: Magnific’s proprietary image generation with LoRA style control