Flux Dev Text to Image API

blackforestlabs/flux/dev
6 sizes · png/jpeg

Flux Dev Text to Image transforms descriptive natural language prompts into photorealistic images with strong prompt adherence, natural lighting, and native text rendering across flexible canvas proportions. It handles human anatomical details and spatial depth while rendering readable quoted lettering and cohesive graphic elements.

Input
OutputIdle

Generated images will appear here

Estimated Cost: 1 MP × 1 × 4 = 4 credits · $0.020

Billed at 4 credits per billable MP multiplied by image count; 1 credit = $0.005.

Examples

Inside the Blue Glacier

A vertical environmental photograph from deep inside a vast natural blue glacier cave. One small adult explorer wearing a burnt-orange parka, dark trousers and a climbing helmet stands in the lower third on solid textured ice, seen from behind in a stable natural stance. A modest warm-white headlamp illuminates a nearby translucent ridge. Towering curved walls of aquamarine ice sweep upward around the explorer, with intricate trapped bubbles and layered striations visible in the foreground; pale daylight enters through a narrow opening far above. Strong sense of human scale, physically plausible ice translucency, controlled blue and amber color contrast, deep spatial perspective, crisp near textures and gentle distant haze, documentary adventure photography, no text, no logos, no watermark.

Cloud Ray over the Dunes

A wide surreal fine-art landscape with a single enormous manta-ray-shaped cloud floating slowly above ochre desert dunes. The ray is made entirely of soft white cloud vapor, with broad gracefully curved wings and a long delicate cloud tail, recognizable as a manta silhouette rather than a solid animal. Late afternoon sunlight gives the vapor luminous edges, while its broad soft shadow falls naturally across the wind-sculpted sand. One tiny solitary traveler in a dark cloak stands on a distant dune ridge at the lower right, emphasizing the vast scale. A pale clear sky, long elegant dune curves, quiet wonder, cinematic depth and carefully balanced negative space, detailed sand ripples in the foreground, no buildings, no vehicles, no typography, no logo, no watermark.

Flux Dev Text to Image

Flux Dev Text to Image is a 12-billion-parameter (12B) flow-matching diffusion transformer model developed by Black Forest Labs, designed to produce high-fidelity realistic imagery from natural language prompts. Utilizing guidance distillation, it offers balanced performance across anatomical details, lighting textures, prompt adherence, and native English typography. It supports 6 standard canvas presets as well as custom WIDTHxHEIGHT dimensions with positive integers, outputs in PNG or JPEG format, and features transparent pricing at 4 credits ($0.020) per megapixel with automatic refunds on task failures.

Why Choose Flux Dev

  • Native Typography RenderingAccurately renders embedded English text, signs, and posters by simply enclosing target words in quotation marks within the prompt.

  • 12B Flow-Matching BackboneCombines a 12-billion-parameter rectified flow transformer architecture with guidance distillation for detailed imagery and efficient inference.

  • Nuanced Prompt AdherenceInterprets multi-subject spatial layouts, tactile surface materials, and distinct visual aesthetics to match your prompt vision.

  • Flexible Presets & Custom DimensionsProvides 6 built-in presets (1:1, 1:1 HD, 4:3, 3:4, 16:9, 9:16) along with support for custom WIDTHxHEIGHT pixel specifications.

  • Megapixel Pricing & Refund ProtectionCharges transparently at 4 credits ($0.020) per billable MP, rounded up per image, with full automatic credit refunds if a task fails.

Parameters

ParameterRequirementDescription
promptRequired

Image generation prompt containing at least one non-whitespace character.

sizeOptional

Canvas size preset or custom WIDTHxHEIGHT with positive integers.

Default1:11:1 HD4:33:416:99:16WIDTHxHEIGHT
nOptional

Number of images to generate as a positive integer, defaults to 1.

Default1
output_formatOptional

Output image format, supports png or jpeg, defaults to png.

Defaultpngjpeg

How to Use

  1. Craft Prompt and TypographyDetail subject attributes, lighting, and perspective; enclose any lettering in double quotation marks to guide in-image typography.

  2. Select Aspect Ratio and SizeChoose from presets such as 1:1, 16:9, or 9:16, or define custom dimensions using WIDTHxHEIGHT positive integer pixel counts.

  3. Set Image Count and Output FormatSpecify the number of images to generate via parameter n, and select either lossless PNG or compact JPEG format.

  4. Submit Task and Poll StatusInitiate a POST request with your API key, obtain the task_id, and query task status until it reaches finished.

  5. Download Generated ImageryRetrieve the high-quality generated image URLs directly from data.files[].file_url in the completed response.

Pricing

Billed per submitted parameters at 4 credits ($0.020) per billable MP. Canvas pixel count is rounded up to the nearest integer MP (minimum 1 MP) and multiplied by n; failed tasks are automatically refunded.

UsageRateDetails
Unit Price4 credits/MP · $0.020/MP1 MP = 1,000,000 pixels, calculated per image.
1:1 · 4:3 · 3:4 · 16:9 · 9:164 credits/image · $0.020/imageEach of these presets corresponds to 1 billable MP.
1:1 HD · 1024x15368 credits/image · $0.040/imageEach of these dimensions corresponds to 2 billable MP.
Custom Dimensionsmax(1, ceil(W × H / 1,000,000)) × n × 4 creditsCalculated dynamically using the submitted size and n parameters.

Best Use Cases

  • Commercial Posters and Promotional BannersCreate marketing materials featuring clean typography, readable brand slogans, and structured studio lighting.

  • Concept Art and WorldbuildingRapidly ideate architectural environments, character concepts, and visual atmospheres for game and film development.

  • E-Commerce Product ScenesProduce realistic tabletop staging, lifestyle backgrounds, and catalog settings without costly physical studio setups.

  • Creative Visual ExplorationEnable design teams to iterate through diverse art styles, lighting moods, and compositions during client ideation phases.

Pro Tips

  • Wrap target text in double quotation marks and specify its medium, such as a neon sign, printed banner, or packaging label.
  • Structure your prompt progressively: describe the primary subject, environment context, lighting direction, and overall style.
  • Decide on your aspect ratio before finalizing the prompt so the model can optimize the composition for the canvas layout.
  • Use positive natural language to describe preferred details, materials, and colors rather than relying on broad abstract adjectives.
  • Keep custom canvas dimensions near 1 to 2 megapixels to maintain optimal structural coherence and cost efficiency.

Notes

  • Prompt requirement: The prompt parameter is required and must contain at least one non-whitespace character after trimming.
  • Canvas calculation: Image pixel dimensions (Width × Height) are rounded up to the nearest whole megapixel, with a 1 MP minimum per image.
  • Output format support: The output_format parameter accepts png or jpeg, defaulting to png when omitted.
  • Automatic refund: Tasks that fail or terminate abnormally automatically refund all deducted credits to your account balance.

Related Models

Flux Dev Text to Image API frequently asked questions

What is the Flux Dev Text to Image API?

Flux Dev Text to Image is a 12-billion-parameter text-to-image foundation model created by Black Forest Labs. It transforms detailed natural language prompts into photorealistic images with strong prompt adherence, balanced anatomical rendering, and native typography capabilities across preset or custom aspect ratios. Built on an advanced rectified flow transformer with guidance distillation, it interprets complex scene descriptions with natural lighting textures while rendering crisp quoted English lettering. You can call it programmatically or try it from the playground above.

What aspect ratios and canvas sizes does Flux Dev Text to Image support?

Flux Dev Text to Image supports six built-in canvas presets: 1:1 (512×512), 1:1 HD (1024×1024), 4:3 (1024×768), 3:4 (768×1024), 16:9 (1024×576), and 9:16 (576×1024). You can also provide custom WIDTHxHEIGHT dimensions such as 1024x1536 using positive integers, allowing flexible alignment with any display or print format.

How do I render specific text with Flux Dev Text to Image?

To render legible English lettering in your image, enclose the exact text in double quotation marks within the prompt and describe its context or physical medium, such as a street sign, neon signboard, or product label.

What is the generation cost for Flux Dev Text to Image?

Pricing is 4 credits ($0.020) per billable megapixel (MP). Canvas dimensions are rounded up to the nearest integer megapixel with a minimum of 1 MP per image. Standard presets including 1:1, 4:3, 3:4, 16:9, and 9:16 cost 4 credits ($0.020) each, while 1:1 HD costs 8 credits ($0.040). If a task fails, all deducted credits are automatically refunded.

Which image output formats are supported by Flux Dev Text to Image?

Flux Dev Text to Image supports both png and jpeg encoding via the output_format parameter. If omitted from your API request, the system defaults to high-fidelity, lossless png output.

Can I generate multiple images in a single request with Flux Dev Text to Image?

Yes. Set the n parameter to a positive integer to generate multiple images in one call. Total credits equal the single-image cost multiplied by n, and all completed image URLs are returned together in the data.files array.

How does Flux Dev compare with other models in the Flux family?

Flux Dev utilizes a 12B flow-matching transformer backbone with guidance distillation, delivering a well-balanced profile of detailed aesthetics, prompt fidelity, and typography suitable for frequent production iteration; for higher fidelity and complex multi-reference editing, creators can select the flagship Flux 2 Pro series.

Which endpoint should I use when generating from an existing reference photo?

When you have an existing source image and want to perform restyling, re-lighting, or visual modifications, use the dedicated Flux Dev Image to Image endpoint. The Text to Image endpoint is designed specifically for direct creation from text prompts.