Black Forest Labs (FLUX)

App · 25 actions

Generate images and videos, edit images with FLUX tools, and inspect generation results, credits and fine-tunes.

Actions

ActionWhat it does
Deblur imageSharpen a blurry image while keeping its scene, objects, composition and lighting.
Erase objectRemove an object or area from an image, using a mask that marks what to erase.
Generate flux 2 flexGenerate or edit an image with FLUX.2 [flex], which is best at typography, text and preserving small details.
Generate flux 2 klein 4bGenerate or edit an image with FLUX.2 [klein] 4B, the fastest and lightest FLUX.2 model.
Generate flux 2 klein 9bGenerate or edit an image with FLUX.2 [klein] 9B, which balances quality and speed and generates in under a second.
Generate flux 2 klein 9b previewGenerate or edit an image with the preview version of FLUX.2 [klein] 9B, which gets the latest quality and speed improvements first.
Generate flux 2 maxGenerate or edit an image with FLUX.2 [max], the highest quality FLUX.2 model, with the strongest editing consistency and prompt following.
Generate flux 2 proGenerate or edit an image with FLUX.2 [pro], the recommended default model for both.
Generate flux 2 pro previewGenerate or edit an image with the preview version of FLUX.2 [pro], which gets the latest quality and speed improvements first.
Generate flux 3 imageGenerate an image with FLUX 3.
Generate flux 3 image kleinGenerate an image from a text prompt, or edit an image, with FLUX 3 Image Klein.
Generate flux 3 videoGenerate a video from a text prompt with FLUX 3, with optional synchronized audio.
Generate flux devGenerate an image with FLUX.1 [dev].
Generate flux kontext maxCreate an image with FLUX.1 Kontext [max].
Generate flux kontext proCreate an image with FLUX.1 Kontext [pro].
Generate flux pro 1 0 expandExpand an image by adding the number of pixels you choose to any of its sides, filling the new area to match the original.
Generate flux pro 1 0 fillFill in part of an image with FLUX.1 Fill [pro], using the image and a mask of the area to change.
Generate flux pro 1 1Generate an image with FLUX1.1 [pro].
Generate flux pro 1 1 ultraGenerate an image with FLUX1.1 [pro] in ultra mode, with an optional raw mode.
Get creditsGet your account's remaining credits.
Get finetuneGet the training settings and other details of one of your fine-tunes.
Get resultGet the status and result of a generation task.
List finetunesList the IDs of the fine-tunes you have created.
Outpaint imageExtend an image outward: it is placed on a canvas of the width and height you give, at the offset you choose, and the area around it is generated to match.
Virtual try onShow a garment on a person: give a photo of the person and one of the garment, and get an image of the person wearing it, at up to 4 megapixels.

Deblur image

Sharpen a blurry image while keeping its scene, objects, composition and lighting. No prompt is needed.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
ImageimagetextRequired
Base64-encoded input image or HTTP(S) image URL.
Seedseednumber
Optional seed for reproducibility.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: png.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Erase object

Remove an object or area from an image, using a mask that marks what to erase.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
ImageimagetextRequired
Base64-encoded input image or HTTP(S) image URL.
MaskmasktextRequired
Base64-encoded black/white mask or HTTP(S) image URL. White pixels indicate the object to remove; black pixels are preserved. Must have the same dimensions as the input image.
Dilate pixelsdilate_pixelsnumber
Number of pixels to dilate the mask by before removal. Dilation helps cover object edges. Maximum is 25 pixels.From 0.0 to 25.0. Default: 10.
Seedseednumber
Optional seed for reproducibility.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: png.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 flex

Generate or edit an image with FLUX.2 [flex], which is best at typography, text and preserving small details. Works from a text prompt or from input images.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to use prompt upsampling.Default: true.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Input image 5input_image_5text
Path to the fifth input image.
Input image 6input_image_6text
Path to the sixth input image.
Input image 7input_image_7text
Path to the seventh input image.
Input image 8input_image_8text
Path to the eighth input image.
Input image blob pathinput_image_blob_pathtext
Blob path to the input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Guidanceguidancenumber
Guidance scale for image generation. High guidance scales improve prompt adherence at the cost of reduced realism.From 1.5 to 10.0. Default: 5.0.
Stepsstepsnumber
Number of steps for image generation. Higher steps lead to more detailed and realistic images.From 1.0 to 50.0. Default: 50.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 klein 4b

Generate or edit an image with FLUX.2 [klein] 4B, the fastest and lightest FLUX.2 model.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 klein 9b

Generate or edit an image with FLUX.2 [klein] 9B, which balances quality and speed and generates in under a second.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 klein 9b preview

Generate or edit an image with the preview version of FLUX.2 [klein] 9B, which gets the latest quality and speed improvements first. For steady production use, choose FLUX.2 [klein] 9B.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 max

Generate or edit an image with FLUX.2 [max], the highest quality FLUX.2 model, with the strongest editing consistency and prompt following.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Disable pupdisable_puptrue/false
Disable automatic prompt upsampling for this request. FLUX.2 [pro] and [max] apply prompt upsampling by default; set this to true to generate from your prompt exactly as written.Default: false.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Input image 5input_image_5text
Path to the fifth input image.
Input image 6input_image_6text
Path to the sixth input image.
Input image 7input_image_7text
Path to the seventh input image.
Input image 8input_image_8text
Path to the eighth input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 pro

Generate or edit an image with FLUX.2 [pro], the recommended default model for both. Works from a text prompt or from input images.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Disable pupdisable_puptrue/false
Disable automatic prompt upsampling for this request. FLUX.2 [pro] and [max] apply prompt upsampling by default; set this to true to generate from your prompt exactly as written.Default: false.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Input image 5input_image_5text
Path to the fifth input image.
Input image 6input_image_6text
Path to the sixth input image.
Input image 7input_image_7text
Path to the seventh input image.
Input image 8input_image_8text
Path to the eighth input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 2 pro preview

Generate or edit an image with the preview version of FLUX.2 [pro], which gets the latest quality and speed improvements first. For steady production use, choose FLUX.2 [pro].

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Disable pupdisable_puptrue/false
Disable automatic prompt upsampling for this request. FLUX.2 [pro] and [max] apply prompt upsampling by default; set this to true to generate from your prompt exactly as written.Default: false.
Input imageinput_imagetext
Path to the input image.
Input image 2input_image_2text
Path to the second input image.
Input image 3input_image_3text
Path to the third input image.
Input image 4input_image_4text
Path to the fourth input image.
Input image 5input_image_5text
Path to the fifth input image.
Input image 6input_image_6text
Path to the sixth input image.
Input image 7input_image_7text
Path to the seventh input image.
Input image 8input_image_8text
Path to the eighth input image.
Seedseednumber
Optional seed for reproducibility.
Widthwidthnumber
Width of the imageAt least 64.0.
Heightheightnumber
Height of the imageAt least 64.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 3 image

Generate an image with FLUX 3.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Free-form prompt describing the image.
Imagesimagestext
Optional reference image(s) the prompt edits or draws from; each is an http(s) URL or base64, one to 10 total.
Aspect ratioaspect_ratiotext
Output aspect ratio. Under `auto` a ratio the prompt asks for wins, otherwise the output keeps the first reference image's framing; without references the prompt decides, else 1:1.One of: 21:9, 2:1, 16:9, 3:2, 7:5, 4:3, 5:4, 1:1, 4:5, 3:4, and 5 more.
Resolutionresolutiontext
Image resolution class, an equal-pixel-area tier: `768sq`, `1k` (default), `1.5k`, `2k`, or `4k`. Exact dimensions vary with the aspect ratio. `match_input` (edits only): the output keeps the first reference's own size (shrunk to 4 MP when larger), or its nearest tier when aspect_ratio is set. Ignored when width and height are set.One of: 768sq, 1k, 1.5k, 2k, 4k, match_input (Match input). Default: 1k.
Widthwidthnumber
Exact output width in pixels, [256, 6256]; set together with height. Overrides resolution and aspect_ratio.
Heightheightnumber
Exact output height in pixels, [256, 6256]; width x height at most 16822272 pixels, and at most 4194304 with reference images.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Groundinggroundingtrue/false
When true (default) the prompt may be grounded in external research: web search and image search. When false, both are off.Default: true.
Versionversiontext
Endpoint version. `latest` (default) serves the current release; dated pinnable release tags are added here as they are published.One of: latest. Default: latest.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 3 image klein

Generate an image from a text prompt, or edit an image, with FLUX 3 Image Klein.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Free-form prompt describing the image.
Imagesimagestext
Optional reference image(s), each an http(s) URL or base64, one to 10 total. The first is the image being edited and sets the default output size.
Aspect ratioaspect_ratiotext
Output aspect ratio, as in flux-3-image. `auto` (default): for edits, the first reference's exact aspect; for text-to-image, a ratio picked from the prompt (prompt rewrite, else ratio keywords, else 16:9) at the requested tier. Ignored when width and height are set.One of: 21:9, 2:1, 16:9, 3:2, 7:5, 4:3, 5:4, 1:1, 4:5, 3:4, and 5 more.
Resolutionresolutiontext
Equal-area size tier, as in flux-3-image: `768sq`, `1k`, `1.5k`, `2k` or `4k`. Omitted: `1k` for text-to-image; for edits the first reference's own size, or its nearest tier when aspect_ratio is set. Ignored when width and height are set.One of: 768sq, 1k, 1.5k, 2k, 4k.
Widthwidthnumber
Exact output width in pixels, [64, 6256]; set together with height. Overrides resolution and aspect_ratio.
Heightheightnumber
Exact output height in pixels, [64, 6256]; width x height at most 16822272 pixels (16.8 MP, the largest 4k bin).
Seedseednumber
Seed for reproducibility; random when omitted.From 0.0 to 4294967295.0.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output image format: `jpeg` (default) or `png`.One of: jpeg, png. Default: jpeg.
Stepsstepsnumber
Denoising steps (default 16).From 1.0 to 16.0.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux 3 video

Generate a video from a text prompt with FLUX 3, with optional synchronized audio. Draft mode makes a fast preview first, which can later be rendered at full quality.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Free-form prompt describing the video.
Aspect ratioaspect_ratiotext
Output aspect ratio.One of: 21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16, 9:21.
Durationdurationnumber
Video length in seconds, any whole number from 5 to 20, or auto to fit the content.From 5.0 to 20.0. Default: auto.
Resolutionresolutiontext
Video resolution: hd, or fhd, qhd or uhd for a higher-resolution result. Exact dimensions vary with the aspect ratio.One of: hd, fhd, qhd, uhd. Default: hd.
Versionversiontext
Endpoint version. `latest` (default) serves the current release; dated pinnable release tags are added here as they are published.One of: latest. Default: latest.
Generate audiogenerate_audiotrue/false
Generate synchronized audio alongside the video.Default: true.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Draftdrafttrue/false
Make a fast preview and return a link to a draft bundle in the result. Pass that bundle back later to render the full-quality version.Default: false.
Modemodetext
Mode.One of: t2v. Default: t2v.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux dev

Generate an image with FLUX.1 [dev].

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Image promptimage_prompttext
Optional base64 encoded image to use as a prompt for generation.
Widthwidthnumber
Width of the generated image in pixels. Must be a multiple of 32.From 256.0 to 1440.0. Default: 1024.
Heightheightnumber
Height of the generated image in pixels. Must be a multiple of 32.From 256.0 to 1440.0. Default: 768.
Stepsstepsnumber
Number of steps for the image generation process.From 1.0 to 50.0. Default: 28.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.Default: false.
Seedseednumber
Optional seed for reproducibility.
Guidanceguidancenumber
Guidance scale for image generation. High guidance scales improve prompt adherence at the cost of reduced realism.From 1.5 to 5.0. Default: 3.0.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux kontext max

Create an image with FLUX.1 Kontext [max]. For editing images, FLUX.2 [pro] or FLUX.2 [flex] is recommended instead.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Input imageinput_imagetext
Base64 encoded image or URL to use with Kontext.
Input image 2input_image_2text
Base64 encoded image or URL to use with Kontext. *Experimental Multiref*
Input image 3input_image_3text
Base64 encoded image or URL to use with Kontext. *Experimental Multiref*
Input image 4input_image_4text
Base64 encoded image or URL to use with Kontext. *Experimental Multiref*
Seedseednumber
Optional seed for reproducibility.
Aspect ratioaspect_ratiotext
Aspect ratio of the image between 21:9 and 9:21
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: png.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.Default: false.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux kontext pro

Create an image with FLUX.1 Kontext [pro]. For editing images, FLUX.2 [pro] or FLUX.2 [flex] is recommended instead.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Input imageinput_imagetext
Base64 encoded image or URL to use with Kontext.
Input image 2input_image_2text
Base64 encoded image or URL to use with Kontext. *Experimental Multiref*
Input image 3input_image_3text
Base64 encoded image or URL to use with Kontext. *Experimental Multiref*
Input image 4input_image_4text
Base64 encoded image or URL to use with Kontext. *Experimental Multiref*
Seedseednumber
Optional seed for reproducibility.
Aspect ratioaspect_ratiotext
Aspect ratio of the image between 21:9 and 9:21
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: png.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.Default: false.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux pro 1 0 expand

Expand an image by adding the number of pixels you choose to any of its sides, filling the new area to match the original.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
ImageimagetextRequired
A Base64-encoded string representing the image you wish to expand.
Toptopnumber
Number of pixels to expand at the top of the imageFrom 0.0 to 2048.0. Default: 0.
Bottombottomnumber
Number of pixels to expand at the bottom of the imageFrom 0.0 to 2048.0. Default: 0.
Leftleftnumber
Number of pixels to expand on the left side of the imageFrom 0.0 to 2048.0. Default: 0.
Rightrightnumber
Number of pixels to expand on the right side of the imageFrom 0.0 to 2048.0. Default: 0.
PromptprompttextRequired
The description of the changes you want to make. This text guides the expansion process, allowing you to specify features, styles, or modifications for the expanded areas.
Stepsstepsnumber
Number of steps for the image generation processFrom 15.0 to 50.0. Default: 50.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generationDefault: false.
Seedseednumber
Optional seed for reproducibility
Guidanceguidancenumber
Guidance strength for the image generation processFrom 1.5 to 100.0. Default: 60.
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: jpeg.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux pro 1 0 fill

Fill in part of an image with FLUX.1 Fill [pro], using the image and a mask of the area to change. The mask can be the image's transparency or a separate image.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
ImageimagetextRequired
A Base64-encoded string representing the image you wish to modify. Can contain alpha mask if desired.
Maskmasktext
A Base64-encoded string representing a mask for the areas you want to modify in the image. The mask should be the same dimensions as the image and in black and white. Black areas (0%) indicate no modification, while white areas (100%) specify areas for inpainting. Optional if you provide an alpha mask in the original image. Validation: The endpoint verifies that the dimensions of the mask match the original image.
PromptprompttextRequired
The description of the changes you want to make. This text guides the inpainting process, allowing you to specify features, styles, or modifications for the masked area.
Stepsstepsnumber
Number of steps for the image generation processFrom 15.0 to 50.0. Default: 50.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generationDefault: false.
Seedseednumber
Optional seed for reproducibility
Guidanceguidancenumber
Guidance strength for the image generation processFrom 1.5 to 100.0. Default: 60.
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: jpeg.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux pro 1 1

Generate an image with FLUX1.1 [pro].

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for image generation.
Image promptimage_prompttext
Optional base64 encoded image to use with Flux Redux.
Widthwidthnumber
Width of the generated image in pixels. Must be a multiple of 32.From 256.0 to 1440.0. Default: 1024.
Heightheightnumber
Height of the generated image in pixels. Must be a multiple of 32.From 256.0 to 1440.0. Default: 768.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.Default: false.
Seedseednumber
Optional seed for reproducibility.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Generate flux pro 1 1 ultra

Generate an image with FLUX1.1 [pro] in ultra mode, with an optional raw mode.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
The prompt to use for image generation.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.Default: false.
Seedseednumber
Optional seed for reproducibility. If not provided, a random seed will be used.
Aspect ratioaspect_ratiotext
Aspect ratio of the image between 21:9 and 9:21Default: 16:9.
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0.0 to 6.0. Default: 2.
Output formatoutput_formattext
Output format for the generated image. Can be 'jpeg', 'png', or 'webp'.One of: jpeg, png, webp. Default: jpeg.
Rawrawtrue/false
Generate less processed, more natural-looking imagesDefault: false.
Image promptimage_prompttext
Optional image to remix in base64 format
Image prompt strengthimage_prompt_strengthnumber
Blend between the prompt and the image promptFrom 0.0 to 1.0. Default: 0.1.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Get credits

Get your account's remaining credits.

Inputs

None.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "credits": 1.0
  }
}

Get finetune

Get the training settings and other details of one of your fine-tunes.

Inputs

Finetune idfinetune_idtextRequired
finetune_id.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "finetune_details": {}
  }
}

Get result

Get the status and result of a generation task.

Inputs

IdidtextRequired
id.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "details": {},
    "id": "example",
    "preview": {},
    "progress": 1.0,
    "result": {
      "sample": "example"
    },
    "status": "Task not found"
  }
}

List finetunes

List the IDs of the fine-tunes you have created.

Inputs

None.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "finetunes": []
  }
}

Outpaint image

Extend an image outward: it is placed on a canvas of the width and height you give, at the offset you choose, and the area around it is generated to match.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
Input imageinput_imagetextRequired
Base64-encoded input (reference) image or HTTP(S) image URL.
WidthwidthnumberRequired
Target output width.At least 64.0.
HeightheightnumberRequired
Target output height.At least 64.0.
Auto cropauto_croptrue/false
If True, crop the input image to the canvas bounds when it extends beyond the edges. If False, an error is raised instead.Default: false.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: png.
Promptprompttext
Experimental: optional text guidance for the outpainted region. The model may not strictly follow this prompt; the visual content of the input image is the primary signal. Leave unset for default behavior.
Reference offset xreference_offset_xnumber
Left offset (px) of the reference image's top-left corner on the output canvas. Negative values are allowed. None = center horizontally.
Reference offset yreference_offset_ynumber
Top offset (px) of the reference image's top-left corner on the output canvas. Negative values are allowed. None = center vertically.
Modemodetext
Quality/speed trade-off. 'high' (default): highest-fidelity results, recommended whenever fine detail, prompt adherence, or consistency with complex content in the source image matters; slower. 'fast': significantly faster and well-suited for naturally extending most scenes (landscapes, backgrounds, textures, products); may produce lower fidelity in the extended region than 'high'.One of: high, fast. Default: high.
Disable pupdisable_puptrue/false
Skip the image-aware prompt upsampler for lower latency. The prompt (or a default extension prompt) is sent directly to the generation model; quality in the extended region may be lower for scenes that benefit from semantic guidance. Applies to both modes.Default: false.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

Virtual try on

Show a garment on a person: give a photo of the person and one of the garment, and get an image of the person wearing it, at up to 4 megapixels. An editing instruction is worked out from the two images, and your prompt is used only as a fallback.

Inputs

Userusertext
Opaque identifier for the end user supplied by the calling platform.
PromptprompttextRequired
Text prompt for VTO generation.
PersonpersontextRequired
Person image (maps internally to input_image).
GarmentgarmenttextRequired
Image of one more garments (maps internally to input_image_2).
Seedseednumber
Optional seed for reproducibility.
Safety tolerancesafety_tolerancenumber
Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.From 0.0 to 7.0. Default: 2.
Output formatoutput_formattext
Output format.One of: jpeg, png, webp. Default: jpeg.

Outputs

dataobject
Response.
Example output
{
  "data": {
    "cost": 1.0,
    "id": "example",
    "input_mp": 1.0,
    "output_mp": 1.0,
    "polling_url": "example"
  }
}

On this page