Image

Generate Image

Generate an image from a text prompt. Returns JPEG, PNG, or SVG depending on the selected model.

Available models: krea/krea-2-medium, krea/krea-2-medium:replicate, lykon/dreamshaper-8-lcm, black-forest-labs/flux.1-kontext-pro, black-forest-labs/flux.1-kontext-pro:replicate, black-forest-labs/flux.1.1-pro, black-forest-labs/flux.1.1-pro:azure:sweden, black-forest-labs/flux.2-pro, black-forest-labs/flux.2-pro:replicate, black-forest-labs/flux-3-image, black-forest-labs/flux.2-flex, black-forest-labs/flux.2-max, black-forest-labs/flux.2-max:openrouter, microsoft/mai-image-2.6-flash, microsoft/mai-image-2.6, google/gemini-2.5-flash-image, google/gemini-2.5-flash-image:openrouter:vertex-global, google/gemini-3.1-flash-image, google/gemini-3.1-flash-image:openrouter:vertex-global, google/gemini-3.1-flash-lite-image, google/gemini-3.1-flash-lite-image:openrouter:vertex-global, google/gemini-nano-banana-2.1, google/gemini-3-pro-image, google/gemini-3-pro-image:openrouter:ai-studio-global, bytedance/seedream-5.0-lite, bytedance/seedream-5.0-lite:fal, bytedance/seedream-5.0-flash, bytedance/seedream-5.0-pro, bytedance/seedream-4.0, bytedance/seedream-4.5, ideogram-ai/ideogram-v4-turbo, ideogram-ai/ideogram-v4-balanced, ideogram-ai/ideogram-v4-quality, openai/gpt-image-1-mini, openai/gpt-image-1-mini:openai, openai/gpt-image-1.5, openai/gpt-image-1.5:openai, openai/gpt-image-2, openai/gpt-image-2:openai, openai/gpt-image-2.5-flare, openai/gpt-image-2.5-flare:openai, openai/gpt-image-2.5-sunburst, openai/gpt-image-2.5-sunburst:openai, black-forest-labs/flux.1-schnell, black-forest-labs/flux.1-schnell:deepinfra, tongyi-mai/z-image-turbo, tongyi-mai/z-image-turbo:fal, alibaba/wan-2.7-image, alibaba/wan-2.7-image:replicate, alibaba/wan-2.7-image-pro, qwen/qwen-image, qwen/qwen-image-2.1, qwen/qwen-image-3, qwen/qwen-image-3:fal, qwen/qwen-image-3:replicate, x-ai/grok-imagine-image, x-ai/grok-imagine-image-quality, x-ai/grok-imagine-image-2.0, recraft/recraft-v4.1-vector, recraft/recraft-v4.1-flash, black-forest-labs/flux.2-klein-4b, prunaai/p-image, prunaai/p-image-edit, prunaai/p-image-edit:replicate, inferenceport-ai/lightning-image-turbo. tongyi-mai/z-image-turbo is the default.

Browse all available models and their capabilities at /image/models.

get/image/{prompt}

Request

  • Base URL: https://gen.pollinations.ai
  • URL: https://gen.pollinations.ai/image/{prompt}
  • Auth: HTTP bearer

Path parameters

promptstring required
Example:a beautiful sunset over mountains

Text description of the image to generate

Query parameters

modelstring

Model to use. See /image/models for the current canonical IDs and aliases.

widthinteger

Width in pixels. For images, exact pixels; flux-2-pro, flux-2-flex, and microsoft/mai-image-2.6-flash require multiples of 16 (MAI also needs at least 768 px per side and at most 2,359,296 total pixels). black-forest-labs/flux.1.1-pro requires 256–1440 px per side in multiples of 32 and at most 1.6 megapixels. For video models, used for aspect ratio; use resolution to select a resolution tier.

heightinteger

Height in pixels. For images, exact pixels; flux-2-pro, flux-2-flex, and microsoft/mai-image-2.6-flash require multiples of 16 (MAI also needs at least 768 px per side and at most 2,359,296 total pixels). black-forest-labs/flux.1.1-pro requires 256–1440 px per side in multiples of 32 and at most 1.6 megapixels. For video models, used for aspect ratio; use resolution to select a resolution tier.

seedinteger

Seed for reproducible results. Use -1 for random. Supported by: black-forest-labs/flux.1-schnell, black-forest-labs/flux.1.1-pro, tongyi-mai/z-image-turbo, bytedance/seedream-4.0, black-forest-labs/flux.2-klein-4b, bytedance/seedance-2.0. Other models ignore this parameter.

string
OR
boolean

Safety features: comma-separated list of privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets; nsfw enables sexual,violence. Also accepted in the Pollinations-Safe header. Defaults to off; false and 0 are accepted as off.

quality'low' | 'medium' | 'high' | 'hd'

Image quality level. Supported by gptimage, gptimage-large, gpt-image-2, and grok-imagine-image-2.0.

imagestring

Reference image URL(s) for image editing or video generation. Separate multiple URLs with | or ,. Image models: Used for editing or style reference. Video models: image[0] is the starting frame; image[1] is the optional ending frame. See video_capabilities and max_reference_images on /image/models or /models for per-model support.

reference_imagesstring

Video models only: public HTTP(S) image URLs for visual guidance, separate from first/last-frame controls. Separate multiple URLs with |; commas inside URLs are preserved. See video_capabilities on /image/models or /models for per-model support.

reference_videosstring

Video models only: public HTTP(S) video URLs for motion or style guidance. Separate multiple URLs with |; commas inside URLs are preserved. See video_capabilities on /image/models or /models for per-model support.

reference_audiosstring

Video models only: public HTTP(S) audio URLs for audio-driven generation. Separate multiple URLs with |; commas inside URLs are preserved. See video_capabilities on /image/models or /models for per-model support.

transparentboolean

Generate image with transparent background. Only supported by gptimage and gptimage-large.

resolution'1k' | '2k' | '360p' | '480p' | '720p' | '768p' | '1080p' | '4k'

Output resolution for image and video models that advertise resolutions in /models. The first advertised resolution is the default; requested tiers bill at their listed rate.

durationinteger

Video duration in seconds. Only applies to video models. Community models may omit this if the provider reports generated seconds; billing prefers reported duration and otherwise uses this value. google/gemini-omni-1.1-flash: 3-10s. veo: 4, 6, or 8s. seedance-pro: 2-10s. seedance-2.0: 4-15s; Mini: 4-10s; Fast: 4-5s. seedance-2.5: exactly 4s. minimax-h3: exactly 5s. minimax/minimax-h3-max and minimax/minimax-h3-max-turbo: 5, 10, or 15s. wan: 2-15s. wan-3.0: exactly 5s.

aspectRatiostring

Aspect ratio. For bytedance/seedream-5.0-flash, overrides width/height; adaptive lets the provider choose. For video models, if not set, determined by explicit width/height; veo, google/gemini-omni-1.1-flash, seedance-2.5, minimax/minimax-h3-max, and minimax/minimax-h3-max-turbo otherwise default to 16:9. Most video models support 16:9 or 9:16; minimax-h3 supports only 16:9, while minimax/minimax-h3-max and minimax/minimax-h3-max-turbo also support 21:9, 4:3, 1:1, and 3:4.

audioboolean

Generate audio for the video. Only applies to video models. veo generates and bills audio only when set to true. seedance-2.0, seedance-2.0-mini, seedance-2.0-fast, seedance-2.5, and wan-3.0 generate audio unless set to false. wan2.6, wan-2.7, grok-imagine-video-1.5, google/gemini-omni-1.1-flash, minimax-h3, minimax/minimax-h3-max, and minimax/minimax-h3-max-turbo always generate audio regardless of this flag.

Response

Success - Returns the generated image

Changes