flux_generate_image
Generate AI images from text prompts using Flux models by Black Forest Labs. Choose from 6 variants including flux-dev for speed or flux-pro for detail. Returns task IDs and image URLs with support for custom sizes.
Instructions
Generate AI images from a text prompt using Flux.
Flux is a family of fast, high-quality image generation models by Black Forest Labs. Different models offer different tradeoffs between speed, quality, and capabilities.
Use this when:
You want to create new images from a text description
You need high-quality AI-generated artwork or photos
You want fast image generation with good prompt following
For editing existing images, use flux_edit_image instead.
Returns: Task ID and generated image information including URLs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Description of the image to generate. Be descriptive about style, subject, lighting, and composition. Examples: 'A majestic mountain landscape at golden hour, photorealistic', 'Cyberpunk street scene with neon lights and rain, cinematic', 'Minimalist logo design of a phoenix, vector art style' | |
| model | No | Flux model to use for generation. Options: - flux-dev: Fast development model, good balance of speed and quality (default) - flux-pro: Higher quality production model - flux-pro-1.1: Improved production model with better prompt following - flux-pro-1.1-ultra: Highest quality, supports aspect ratios instead of pixel sizes - flux-kontext-pro: Context-aware model for editing and style transfer - flux-kontext-max: Maximum context model for complex editing tasks | flux-dev |
| size | No | Image size. For flux-dev/pro/pro-1.1: pixel dimensions like '1024x1024' (256-1440px, multiples of 32). For flux-pro-1.1-ultra and kontext models: aspect ratios like '1:1', '16:9', '9:16', '4:3', '3:2', '2:3', '4:5', '5:4', '3:4', '21:9', '9:21'. Default varies by model. | |
| count | No | Number of images to generate. Only supported for generate action. Default is 1. | |
| callback_url | No | Webhook callback URL for asynchronous notifications. When provided, the API will POST to this URL when the image is generated. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |