{ "model_id": "black-forest-labs/flux-2-pro-preview", "provider_id": "black-forest-labs", "name": "FLUX.2 [pro]", "description": "FLUX.2 [pro] Preview is Black Forest Labs' recommended default for production image generation and editing \u2014 tracks the latest [pro] weights with strong multi-reference support.", "task": "Text-to-Image", "tags": [ "Image Generation", "Image Editing", "Preview" ], "context_length": null, "max_output_tokens": null, "schema_version": "1.0.0", "pricing": { "First output megapixel": 0.03, "Per additional output megapixel": 0.015, "Per input megapixel": 0.015 }, "examples": [ { "name": "Simple Prompt", "description": "Standard text-to-image generation with the recommended FLUX.2 [pro] preview endpoint", "input": { "prompt": "A serene mountain landscape at golden hour, soft diffused light filtering through clouds", "height": 1024, "width": 1024 }, "output": { "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-pro-preview/simple-prompt.jpeg" }, "raw_response": { "state": "Completed", "result": { "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-pro-preview/simple-prompt.jpeg" }, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'black-forest-labs/flux-2-pro-preview',\n {\n prompt:\n 'A serene mountain landscape at golden hour, soft diffused light filtering through clouds',\n height: 1024,\n width: 1024,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"black-forest-labs/flux-2-pro-preview\",\n \"input\": {\n \"prompt\": \"A serene mountain landscape at golden hour, soft diffused light filtering through clouds\",\n \"height\": 1024,\n \"width\": 1024\n }\n}'" } ] }, { "name": "Multi-Reference Editing", "description": "Multi-reference editing \u2014 combine two reference images in a single composition", "input": { "prompt": "Combine the subjects of these images into a single editorial fashion scene", "input_images": [ "https://replicate.delivery/xezq/jCypj4MeXYUiRyq7nfgm8z1OvFZF81wh4FznutDsZOuJz0YWA/tmp1iukn307.jpg", "https://replicate.delivery/xezq/0lxxNQSg3NabCZrDiQVAPGVmjP1Q2dd7TgYCOTfI9LpyZaMLA/tmp89gopylq.jpg" ] }, "output": { "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-pro-preview/multi-reference-editing.jpeg" }, "raw_response": { "state": "Completed", "result": { "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-pro-preview/multi-reference-editing.jpeg" }, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'black-forest-labs/flux-2-pro-preview',\n {\n prompt: 'Combine the subjects of these images into a single editorial fashion scene',\n input_images: [\n 'https://replicate.delivery/xezq/jCypj4MeXYUiRyq7nfgm8z1OvFZF81wh4FznutDsZOuJz0YWA/tmp1iukn307.jpg',\n 'https://replicate.delivery/xezq/0lxxNQSg3NabCZrDiQVAPGVmjP1Q2dd7TgYCOTfI9LpyZaMLA/tmp89gopylq.jpg',\n ],\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"black-forest-labs/flux-2-pro-preview\",\n \"input\": {\n \"prompt\": \"Combine the subjects of these images into a single editorial fashion scene\",\n \"input_images\": [\n \"https://replicate.delivery/xezq/jCypj4MeXYUiRyq7nfgm8z1OvFZF81wh4FznutDsZOuJz0YWA/tmp1iukn307.jpg\",\n \"https://replicate.delivery/xezq/0lxxNQSg3NabCZrDiQVAPGVmjP1Q2dd7TgYCOTfI9LpyZaMLA/tmp89gopylq.jpg\"\n ]\n }\n}'" } ] }, { "name": "Reproducible PNG Output", "description": "Seeded generation with PNG output for downstream editing pipelines", "input": { "prompt": "A pastel watercolor of a koi pond at sunrise", "output_format": "png", "seed": 1337 }, "output": { "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-pro-preview/reproducible-png-output.png" }, "raw_response": { "state": "Completed", "result": { "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-pro-preview/reproducible-png-output.png" }, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'black-forest-labs/flux-2-pro-preview',\n { prompt: 'A pastel watercolor of a koi pond at sunrise', output_format: 'png', seed: 1337 },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"black-forest-labs/flux-2-pro-preview\",\n \"input\": {\n \"prompt\": \"A pastel watercolor of a koi pond at sunrise\",\n \"output_format\": \"png\",\n \"seed\": 1337\n }\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": false, "zdr_comment": null, "external_info": "https://blackforestlabs.ai/", "terms": "https://blackforestlabs.ai/terms-of-service/", "cover_image_url": null, "metadata": { "Architecture": "Flow matching transformer", "Max Reference Images": "8", "Max Resolution": "4MP" }, "request_formats": null, "providers": null, "provider_details": [ { "id": "black-forest-labs", "pricing": { "first_output_megapixel": 0.03, "subsequent_output_megapixel": 0.015, "input_megapixel": 0.015 } } ], "banner": null, "created_at": "2026-05-27 23:12:41", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "Text prompt for image generation or editing." }, "seed": { "description": "Optional seed for reproducible generation.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "width": { "description": "Width of the generated image in pixels (minimum 64). Omit to let BFL pick.", "type": "integer", "minimum": 64, "maximum": 9007199254740991 }, "height": { "description": "Height of the generated image in pixels (minimum 64). Omit to let BFL pick.", "type": "integer", "minimum": 64, "maximum": 9007199254740991 }, "safety_tolerance": { "description": "Tolerance for input/output moderation. 0 is the strictest, 5 the most permissive. Defaults to 2.", "type": "integer", "minimum": 0, "maximum": 5 }, "output_format": { "description": "Output image format. Defaults to jpeg.", "type": "string", "enum": [ "jpeg", "png", "webp" ] }, "input_images": { "description": "Up to 8 reference images for editing or multi-image composition. Each entry is an HTTPS URL or a data:image/...;base64,... URI.", "maxItems": 8, "type": "array", "items": { "type": "string" } } }, "required": [ "prompt" ], "additionalProperties": false }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "image": { "type": "string", "format": "uri", "description": "URL to the generated image" } }, "required": [ "image" ], "additionalProperties": false } } }