Flux Dev Image to Image API

blackforestlabs/flux/dev/image-to-image
1 image · png/jpeg

Flux Dev Image to Image transforms a single reference image using descriptive natural language prompts, combining consistent visual guidance with flexible canvas proportions. It maintains primary subject contours, spatial perspective, and lighting mood while applying text-directed material changes, background scene adjustments, and artistic restyling.

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

Coastal Painted Study

A bold Fauvist oil painting on rough linen canvas of a golden dog running on a beach. PAINTING, not a photograph. Broad angular strokes of ochre, terracotta and cream construct the complete dog in SIDE PROFILE facing RIGHT, tail to the LEFT; keep the overall dog silhouette and beach subject from the reference. Four natural legs in a running stride. The entire animal fits comfortably in the lower half of the portrait canvas. Build the sea and sky from large flat patches of muted teal, pale blue and warm grey. Scraped palette-knife impasto, thick raised paint ridges, broken color and visible bristle marks across every part of the composition, simplified shapes, expressive brushwork, deliberately painterly edges. An unframed full-bleed fine-art painting with no decorative border, no lettering, no signature, no watermark.

Autumn Rain in the Courtyard

Use the supplied photograph as the fixed composition for a seasonal weather variation. Show the SAME entire dark-green step-through bicycle from the SAME SIDE VIEW: front wheel and wicker front basket on the LEFT, rear wheel and saddle on the RIGHT, two wheels side by side and both fully visible. Keep the pale plaster wall directly behind the bicycle, the wooden gate on the far LEFT and the leafy tree above the wall on the RIGHT. Preserve the original wide camera position, lens perspective, bicycle position and scale. Change only the weather, ground moisture and foliage: soft overcast autumn daylight, fine rain, wet stone paving with small puddles, scattered russet leaves, and amber foliage on the existing tree. Realistic gentle reflections, naturally aged materials and subtle rain streaks. A quiet residential courtyard, not an alley. Do not rotate the bicycle or move the camera. No rear view, no people, no extra bicycles, no text, no logos, no watermark.

Flux Dev Image to Image

Flux Dev Image to Image is a 12-billion-parameter (12B) flow-matching image transformation model developed by Black Forest Labs. By pairing a single public reference image with natural language prompts, the model restyles artistic elements, swaps surface materials, and transforms backgrounds while preserving subject contours, spatial perspective, and lighting mood. It supports 6 preset aspect ratios as well as custom pixel dimensions, defaulting to source guidance and 1:1 billing when size is omitted, outputs in PNG or JPEG format at 4 credits ($0.020) per megapixel, with automatic refunds on task failures.

Why Choose Flux Dev

  • Subject Contour & Layout RetentionGuides restyling through reference imagery while retaining primary spatial positioning, subject silhouettes, and lighting mood.

  • Lightweight Single-Image GuidanceRequires only one publicly accessible HTTP(S) image link to establish a reliable visual foundation for prompt transformations.

  • Text-Directed Style RestylingAdjusts surface textures, lighting atmosphere, and background environments through expressive natural language directions.

  • Flexible Sizing & Format SupportInherits source dimensions by default or accepts explicit preset and custom pixel sizes, outputting in high-grade PNG or JPEG.

  • Transparent Pricing & Automatic RefundsBilled per megapixel at 4 credits ($0.020) per MP with full automatic refunds if a generation task terminates abnormally.

Parameters

ParameterRequirementDescription
promptRequired

Image transformation instruction containing at least one non-whitespace character.

image_urlsRequired

Array containing exactly one valid HTTP(S) reference image URL.

sizeOptional

Output canvas size preset or custom WIDTHxHEIGHT with positive integers. Omitted to follow source image aspect ratio.

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. Supply 1 Reference Image URLProvide a single accessible HTTP or HTTPS image URL inside the image_urls array as the transformation base.

  2. Write Transformation InstructionsClearly describe target aesthetic modifications, material textures, or environmental changes in the prompt.

  3. Configure Dimensions and Output FormatOmit size to follow the reference image or specify custom dimensions, and select PNG or JPEG format.

  4. Submit Task and Poll StatusSend your API request to retrieve a task_id and poll the task endpoint until status transitions to finished.

  5. Retrieve Generated ImageryExtract the finished image URLs directly from data.files[].file_url in the completed response payload.

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.
Image to Image Default4 × n creditsWhen size is omitted in requests, pricing defaults to 1:1. Explicitly specifying size changes the charge; generation is guided by the reference image.

Best Use Cases

  • Product Photography Scene StagingTransport clean studio product photos into lifestyle or outdoor settings to reduce physical staging costs.

  • Character & Portrait Style ReimaginingUpdate wardrobe, makeup aesthetics, or atmospheric lighting on portrait photos while preserving identity contours.

  • Design Sketch MaterializationTransform conceptual line art, layout sketches, or simple 3D models into rendered artwork with realistic lighting.

  • Cross-Genre Artistic Style TransferReinterpret photography into expressive oil painting, watercolor, illustration, or other distinct visual movements.

Pro Tips

  • Focus your prompt primarily on the elements and styles you wish to modify; unchanged subjects do not need repeated descriptions.
  • Provide reference images with well-defined subjects and clear lighting to ensure the model captures the core composition effectively.
  • If the transformed scene requires lettering, enclose the words in quotation marks to activate legible text rendering.
  • Match your output aspect ratio closely to the reference image proportion to prevent unexpected cropping or perspective distortion.
  • Use JPEG format for quick turnaround previews and reserve PNG for production deliverables and print media.

Notes

  • Single image requirement: The image_urls array must contain exactly one accessible HTTP(S) image URL.
  • Prompt requirement: The prompt parameter is required and must contain at least one non-whitespace character after trimming.
  • Pricing defaults: Omitting size follows reference guidance with a default 1:1 (4 credits) charge; explicit sizes are billed by canvas pixels.
  • Automatic refund: Tasks that fail or terminate abnormally automatically refund all deducted credits to your account balance.

Related Models

Flux Dev Image to Image API frequently asked questions

What is the Flux Dev Image to Image API?

Flux Dev Image to Image is Black Forest Labs' 12-billion-parameter rectified flow transformer model designed for reference-guided visual transformations and style restyling. By pairing a single public source image with descriptive natural language prompts, it transforms surface textures, scene backgrounds, and stylistic genres while preserving original subject silhouettes, spatial layout, and lighting mood. Built on an advanced flow-matching architecture with guidance distillation, it ensures visual coherence across transformation workflows. You can call it programmatically or try it from the playground above.

What are the requirements for input images in Flux Dev Image to Image?

Supply the reference image as an array containing exactly one publicly accessible HTTP or HTTPS URL within the image_urls field. The URL should point to a standard static image format such as PNG or JPEG.

How is output image size determined in Flux Dev Image to Image?

When the size parameter is omitted, the API generates imagery guided by the reference image with pricing defaulting to 1:1 (4 credits per image). You can also explicitly specify presets such as 16:9 or custom WIDTHxHEIGHT pixel dimensions when a fixed aspect ratio is desired.

How can I maintain subject contours when using Flux Dev Image to Image?

Focus your prompt specifically on the changes you want to introduce—such as new background scenery, attire, or color palette—rather than over-describing static attributes. Using a reference image with distinct subject boundaries and balanced lighting further ensures reliable contour retention.

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

Pricing matches text-to-image at 4 credits ($0.020) per billable megapixel (MP). Omitting size or selecting presets such as 1:1, 4:3, 16:9, or 9:16 costs 4 credits ($0.020) per image, while 1:1 HD costs 8 credits ($0.040). If a task fails to generate an output, all deducted credits are fully and automatically refunded.

Which model should I use if I need to provide multiple reference images?

Flux Dev Image to Image is designed specifically for single-image guidance. For advanced tasks requiring composition from multiple visual inputs (up to 8 reference images), select the Flux 2 Pro Edit model.

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

Flux Dev Image to Image supports png and jpeg formats via the output_format parameter. If omitted from your request, the API defaults to delivering lossless png images.

Which endpoint should I use when I do not have a reference image?

When generating new artwork entirely from text descriptions without an existing photo, use the dedicated Flux Dev Text to Image endpoint.