Generate Pollinations Image
pollinations_generate_imageGenerate images from text descriptions using Pollinations models. Supports optional reference images for image-to-image generation.
Instructions
Generate an image from a text prompt using Pollinations image models. This calls Pollinations' OpenAI-compatible image generation endpoint and returns either a generated image URL or base64 image data. Use this when the user wants a new image from text, optionally with reference images for image-to-image generation. Do NOT use this for editing an existing image with specific source-image transformation instructions; use pollinations_edit_image instead. Args: - prompt (string, required): Text description of the desired image. Be specific about subject, style, composition, lighting, colors, and any text that should appear. - model (string, optional): Pollinations image model slug. Known image models include kontext, nanobanana, nanobanana-2, nanobanana-2-lite, nanobanana-pro, seedream5, seedream5-pro, seedream, seedream-pro, ideogram-v4-turbo, ideogram-v4-balanced, ideogram-v4-quality, gptimage, gptimage-large, gpt-image-2, flux, zimage, wan-image, wan-image-pro, qwen-image, grok-imagine, grok-imagine-pro, klein, p-image, p-image-edit, nova-canvas. Call pollinations_list_models first for current pricing/capabilities. - n (number, optional, default 1): Number of images. Pollinations currently supports max 1. - size (string, optional): Output size as WIDTHxHEIGHT, e.g. 1024x1024, 1536x1024, 1024x1536. Do not combine with width/height unless intentionally overriding. - width and height (numbers, optional): Alternative dimension controls. If both are provided and size is omitted, Nectar sends size as WIDTHxHEIGHT. - quality (string, optional): standard, hd, low, medium, or high. Best supported by gptimage, gptimage-large, and gpt-image-2; other models may ignore it. - response_format (string, optional, default b64_json): b64_json is preferred for local saving because Nectar can decode it directly. Use url only when the caller explicitly wants a Pollinations URL instead of embedded image data. - save_output (boolean, optional, default true): Save returned image data or URL media to a local file and include the path in the result. - output_dir (string, optional): Directory for saved files. Defaults to NECTAR_OUTPUT_DIR or ./nectar-output relative to the server process. - filename_prefix (string, optional): Prefix for saved media filenames. Nectar sanitizes this value. - image (string or string[], optional): Reference image URL(s) for image-to-image generation on supported models such as kontext, gptimage, seedream, klein, and nanobanana. - seed (number, optional): Reproducibility seed. Use -1 for random. Supported by models such as flux, zimage, seedream, and klein; other models may ignore it. - enhance (boolean, optional): Ask Pollinations to enhance/expand the prompt when supported. - negative_prompt (string, optional): Things to avoid in the generated image when supported. - transparent (boolean, optional): Request a transparent background. Only supported by gptimage, gptimage-large, and gpt-image-2. - safe (string, optional): Comma-separated safety filters: privacy, secrets, sexual, violence, shield, true, nsfw. true means privacy,secrets. nsfw means sexual,violence. - user (string, optional): End-user identifier for abuse tracking. - output_format (string, optional, default markdown): markdown summary or raw json response. Returns: Markdown or JSON with the generated URL, base64 length, and revised_prompt when Pollinations returns one. Examples: Use model=flux, prompt only for a general image. Use model=gpt-image-2 with transparent=true for a transparent asset. Use image=[url] with kontext or nanobanana for image-to-image reference generation. Error handling: 401 means missing/invalid POLLINATIONS_API_KEY in the MCP env block. 402 means insufficient pollen balance. 403 means the key lacks permission for the selected model. 429 means wait and retry. 400 usually means conflicting or unsupported parameters; call pollinations_list_models and retry with model-supported options.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images to generate. Pollinations currently supports 1. | |
| safe | No | Optional comma-separated safety filters: privacy, secrets, sexual, violence, shield, true, nsfw. true enables privacy,secrets. nsfw enables sexual,violence. false or 0 disables safety filters. | |
| seed | No | Optional seed for reproducible results. Use -1 for random. Supported by flux, zimage, seedream, and klein; unsupported models may ignore it. | |
| size | No | Optional image size as WIDTHxHEIGHT, for example 1024x1024, 1536x1024, or 1024x1536. If omitted, Pollinations chooses the default. If width and height are both set and size is omitted, Nectar sends WIDTHxHEIGHT as size. | |
| user | No | Optional end-user identifier for abuse tracking. | |
| image | No | Optional reference image URL or URLs for image-to-image generation on supported models such as kontext, gptimage, seedream, klein, and nanobanana. | |
| model | No | Optional Pollinations image model slug. Examples: flux, kontext, gptimage, gptimage-large, gpt-image-2, seedream5, seedream5-pro, seedream, seedream-pro, nanobanana, nanobanana-2, nanobanana-pro, grok-imagine, wan-image, qwen-image, klein, p-image, p-image-edit, nova-canvas. Call pollinations_list_models first for current models. | |
| width | No | Optional image width in pixels. Use with height as an alternative to size. | |
| height | No | Optional image height in pixels. Use with width as an alternative to size. | |
| prompt | Yes | Required text description of the image. Include subject, composition, style, lighting, colors, mood, and any exact text that should appear. | |
| enhance | No | Optional prompt enhancement flag. When supported, Pollinations may expand/improve the prompt before generation. | |
| quality | No | Image quality: standard, hd, low, medium, high. Best supported by gptimage, gptimage-large, and gpt-image-2; other models may ignore it. | medium |
| output_dir | No | Directory where generated image files should be saved. Defaults to NECTAR_OUTPUT_DIR or ./nectar-output. | |
| save_output | No | Save returned image output to a local file. Works for both url and b64_json Pollinations responses. | |
| transparent | No | Optional transparent background request. Only supported by gptimage, gptimage-large, and gpt-image-2. | |
| output_format | No | MCP response format: markdown for readable summaries, json for raw Pollinations response plus saved_files metadata when saving is enabled. | markdown |
| filename_prefix | No | Optional prefix for saved image filenames. Example: bee-logo or product-shot. | |
| negative_prompt | No | Optional negative prompt describing what to avoid, when the selected model supports negative prompts. | |
| response_format | No | Pollinations image response format. Defaults to b64_json so Nectar can save the image locally without a second download. Use url only when the caller explicitly wants a Pollinations URL. | b64_json |