Giảm 50% mô hình Vidu Q3 & Q3 Pro · Chỉ trên WaveSpeedAI | 20/5 – 2/6

Gemini 2.5 Flash Image Preview Text to Image

google /

Google Gemini 2.5 Flash Text-to-Image delivers state-of-the-art text-to-image generation and image editing with previews. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

text-to-image
Input
If set to true, the function will wait for the result to be generated and uploaded before returning the response. It allows you to get the result directly in the response. This property is only available through the API.
If enabled, the output will be encoded into a BASE64 string instead of a URL. This property is only available through the API.

Idle

$0.038per run·~26 / $1

Next:

Related Models

README

Google Gemini 2.5 Flash Image Preview — Text-to-Image

Gemini 2.5 Flash Image Preview is Google's fast and efficient text-to-image generation model built on the Gemini architecture. Generate high-quality images from text descriptions with flexible aspect ratios and multiple output formats — all at an affordable price.

Why It Stands Out

  • Fast generation: Optimized for speed while maintaining high visual quality.
  • Prompt Enhancer: Built-in AI-powered prompt optimization for better image results.
  • Flexible aspect ratios: Choose from multiple aspect ratio presets to fit your content needs.
  • Multiple output formats: Export as PNG or other formats based on your requirements.
  • Powered by Gemini: Leverages Google's advanced multimodal AI for strong prompt understanding.

Parameters

ParameterRequiredDescription
promptYesText description of the image you want to generate.
aspect_ratioNoOutput aspect ratio (square, portrait, landscape, etc.).
output_formatNoOutput format: png, jpeg, etc. (default: png).
enable_sync_modeNoWait for result before returning response (API only).
enable_base64_outputNoReturn base64 string instead of URL (API only).

How to Use

  1. Write a prompt describing the image you want. Use the Prompt Enhancer for AI-assisted optimization.
  2. Select aspect ratio — choose the format that fits your use case.
  3. Choose output format — select PNG or other available formats.
  4. Click Run and download your image.

Best Use Cases

  • Quick Prototyping — Rapidly generate visual concepts and ideas.
  • Social Media Content — Create images sized for different platforms.
  • Marketing & Advertising — Produce eye-catching visuals for campaigns.
  • Creative Exploration — Experiment with different styles and concepts affordably.
  • Design Mockups — Generate placeholder images and visual references.

Pricing

OutputPrice
Per image$0.038

Pro Tips for Best Quality

  • Be descriptive in your prompt — include style, mood, lighting, composition, and specific details.
  • Use style keywords like "photorealistic," "illustration," "digital art," or "cinematic" to guide the aesthetic.
  • Choose the appropriate aspect ratio for your intended use (square for social media, wide for banners, etc.).
  • Use PNG format when you need higher quality or transparency support.

Notes

  • Processing time varies based on current queue load.
  • Please ensure your prompts comply with Google's Safety Guidelines.
Accessibility:This website uses AI models provided by third parties.

Gemini 2.5 Flash Image Preview Text To Image API — Quick start

Grab a WaveSpeedAI API key, then call POST https://api.wavespeed.ai/api/v3/google/gemini-2.5-flash-image-preview/text-to-image with your input as JSON. The endpoint returns a prediction id; poll the prediction endpoint until status flips to completed, then read the output URL from data.outputs[0]. Examples for Gemini 2.5 Flash Image Preview Text To Image below.

HTTP example
# Submit the prediction
curl -X POST "https://api.wavespeed.ai/api/v3/google/gemini-2.5-flash-image-preview/text-to-image" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $WAVESPEED_API_KEY" \
  -d '{
    "prompt": "A cinematic shot of a city at sunset, soft golden light",
    "aspect_ratio": "1:1",
    "output_format": "png",
    "enable_sync_mode": false,
    "enable_base64_output": false
}'

# Response includes a prediction id. Poll for the result:
curl -X GET "https://api.wavespeed.ai/api/v3/predictions/{request_id}/result" \
  -H "Authorization: Bearer $WAVESPEED_API_KEY"

# When status is "completed", read the output from data.outputs[0].
Node.js example
// npm install wavespeed
const WaveSpeed = require('wavespeed');

const client = new WaveSpeed(); // reads WAVESPEED_API_KEY from env

const result = await client.run("google/gemini-2.5-flash-image-preview/text-to-image", {
        "prompt": "A cinematic shot of a city at sunset, soft golden light",
        "aspect_ratio": "1:1",
        "output_format": "png",
        "enable_sync_mode": false,
        "enable_base64_output": false
});

console.log(result.outputs[0]); // → URL of the generated output
Python example
# pip install wavespeed
import wavespeed

output = wavespeed.run(
    "google/gemini-2.5-flash-image-preview/text-to-image",
    {
    "prompt": "A cinematic shot of a city at sunset, soft golden light",
    "aspect_ratio": "1:1",
    "output_format": "png",
    "enable_sync_mode": false,
    "enable_base64_output": false
}
)

print(output["outputs"][0])  # → URL of the generated output

Gemini 2.5 Flash Image Preview Text To Image API — Frequently asked questions

What is the Gemini 2.5 Flash Image Preview Text To Image API?

Gemini 2.5 Flash Image Preview Text To Image is a Google model for image generation, exposed as a REST API on WaveSpeedAI. Google Gemini 2.5 Flash Text-to-Image delivers state-of-the-art text-to-image generation and image editing with previews. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing. You can call it programmatically or try it from the playground above.

How do I call the Gemini 2.5 Flash Image Preview Text To Image API?

POST your input parameters to the model's REST endpoint (shown in the API tab of this playground) with your WaveSpeedAI API key in the Authorization header. Submission returns a prediction ID; poll the prediction endpoint until status flips to "completed", then read the output URL from the result. The playground generates a ready-to-paste code sample in Python, JavaScript, or cURL for whatever inputs you've set. Full request/response shape is documented at https://wavespeed.ai/docs/docs-api/google/google-gemini-2.5-flash-image-preview-text-to-image.

How much does Gemini 2.5 Flash Image Preview Text To Image cost per run?

Gemini 2.5 Flash Image Preview Text To Image starts at $0.038 per run. That figure is the base price — the final charge scales with the parameters you set in the form (output size, length, count, references, or whatever knobs this model exposes), so a higher-quality or larger output costs more than a minimal one. The exact cost for your current input is shown live next to the Generate button before you submit, and the actual per-call charge is recorded on the prediction afterwards.

What inputs does Gemini 2.5 Flash Image Preview Text To Image accept?

Key inputs: `prompt`, `aspect_ratio`, `enable_base64_output`, `enable_sync_mode`, `output_format`. The full JSON schema (types, defaults, allowed values) is rendered above the Generate button and mirrored in the API reference at https://wavespeed.ai/docs/docs-api/google/google-gemini-2.5-flash-image-preview-text-to-image.

How long does Gemini 2.5 Flash Image Preview Text To Image take to generate?

Average end-to-end generation time on WaveSpeedAI is around 40 seconds per request — measured across recent runs. Queue time scales with global demand; live status is visible in the prediction record.

Can I use Gemini 2.5 Flash Image Preview Text To Image outputs commercially?

Commercial usage rights depend on the model's license, set by its provider (Google). The license summary appears on the model card above; see WaveSpeedAI's Terms of Service for platform-level conditions.