The Black Forest Labs connector lets your AI agent act in each user's Black Forest Labs account. Each user connects their own Black Forest Labs API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 23 tools.
- Tools
- 23
- What they doRead · write · destructive
- 4 · 19 · 04 read19 write0 destructive
- Users sign in with
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Black Forest Labs connection
In AgentKit > Connections, create a Black Forest Labs connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'blackforestlabs'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Black Forest Labs:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'blackforestlabs_get_credits',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "blackforestlabs"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Black Forest Labs:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="blackforestlabs_get_credits",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Black Forest Labs credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolblackforestlabs_get_creditsGet the credit balance available to your Black Forest Labs API key.Read-onlyGet Credits
Get the credit balance available to your Black Forest Labs API key. Returns credits as a number (1 credit = $0.01 USD). Use this before large or video jobs to check the balance; a generation request with too few credits fails with HTTP 402.
Inputs
This tool takes no inputs.
blackforestlabs_get_finetune_detailsGet the training parameters and metadata of one of your finetunes.Read-onlyGet Finetune Details
Get the training parameters and metadata of one of your finetunes. Returns a finetune_details object with the settings used to train it. Use this to inspect a single finetune. Use blackforestlabs_list_finetunes to see all of them.
Inputs
finetune_idstringrequired- Finetune id from blackforestlabs_list_finetunes. Example: my-finetune
blackforestlabs_get_resultGet the status and output of a Black Forest Labs generation task by its id.Read-onlyGet Result
Get the status and output of a Black Forest Labs generation task by its id. Returns id, status (Pending, Reasoning, Generating, Ready, Request Moderated, Content Moderated, Error or Task not found), progress, details, cost, and when Ready a result object whose sample (or samples, for video) is a signed download URL that expires within minutes. Use this to poll every image, video and tool task submitted with the other blackforestlabs tools; call it again while status is Pending, Reasoning or Generating. Requires the id returned by a blackforestlabs generation or editing tool.
Inputs
idstringrequired- Task id returned by a blackforestlabs generation, editing or video tool (the id field of its response; also the id query parameter of polling_url). Example: 9f1c2d3e-4b5a-6789-abcd-ef0123456789
blackforestlabs_list_finetunesList the finetunes (LoRAs) created by your Black Forest Labs account.Read-onlyList Finetunes
List the finetunes (LoRAs) created by your Black Forest Labs account. Returns a finetunes array of finetune ids. Use this to find a finetune_id for blackforestlabs_generate_image_finetuned. Use blackforestlabs_get_finetune_details for one finetune's training settings.
Inputs
This tool takes no inputs.
blackforestlabs_deblur_imageSharpen a blurry image with FLUX Deblur while keeping the scene, identity, colors and composition.WriteDeblur Image
Sharpen a blurry image with FLUX Deblur while keeping the scene, identity, colors and composition. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this to fix blur without a prompt. Use blackforestlabs_generate_image for other instruction-based edits. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
imagestringrequired- Blurry image to sharpen, as a public http(s) URL or a base64-encoded image.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png).one of
jpegpngwebp safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
blackforestlabs_edit_image_kontextEdit an image from a text instruction, or create one from text, with FLUX.1 Kontext [pro] or [max].WriteEdit Image (FLUX.1 Kontext)
Edit an image from a text instruction, or create one from text, with FLUX.1 Kontext [pro] or [max]. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this when you specifically want Kontext, for example to keep an existing Kontext workflow. BFL recommends blackforestlabs_generate_image (FLUX.2) for new editing work. Use blackforestlabs_fill_image to repaint only a masked area. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Edit instruction for the input image, or a description of a new image when no input image is given. Example: Change the car color to matte black and keep everything else the same.
additional_imagesarray- Up to 3 extra reference images (URLs or base64) sent as input_image_2 to input_image_4. BFL marks multi-reference Kontext as experimental.
aspect_ratiostring- Output aspect ratio between 21:9 and 9:21, as width:height. Omit to keep the input image's ratio (or the model default for text-to-image). Example: 16:9
input_imagestring- Image to edit, as a public http(s) URL or a base64-encoded image. Omit to create an image from the prompt alone.
modelstring- Kontext model: flux-kontext-pro (default) or flux-kontext-max (higher quality; BFL allows at most 6 concurrent max requests).one of
flux-kontext-proflux-kontext-maxdefaultflux-kontext-pro output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png).one of
jpegpngwebp prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt for more creative results. Off by default.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
blackforestlabs_edit_videoEdit an existing video clip from a text instruction with FLUX Video Edit [fast]: add, remove or replace objects, change the setting or style, or change on-screen text or dialogue.WriteEdit Video
Edit an existing video clip from a text instruction with FLUX Video Edit [fast]: add, remove or replace objects, change the setting or style, or change on-screen text or dialogue. Returns the task id and polling_url; when Ready, get_result returns signed video URLs in result.samples. Duration, resolution, aspect ratio and audio follow the source clip. Use this to change a clip you already have. Use blackforestlabs_generate_video (mode v2v) to continue a clip and blackforestlabs_upscale_video to raise resolution. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Edit instruction, 1 to 4096 characters. Say what changes and where. Example: Replace the red car with a vintage blue convertible.
videostringrequired- Video to edit, as a public http(s) URL or base64-encoded mp4.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-4 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
blackforestlabs_erase_objectRemove an object or region from an image using a mask with FLUX Erase.WriteErase Object
Remove an object or region from an image using a mask with FLUX Erase. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for prompt-free cleanup of masked objects. Use blackforestlabs_fill_image to replace the masked area with new content described in a prompt. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
imagestringrequired- Image to clean up, as a public http(s) URL or a base64-encoded image.
maskstringrequired- Black and white mask with the same dimensions as the image, as a URL or base64. White pixels mark what to remove; black pixels are kept.
dilate_pixelsinteger- Pixels to grow the mask by before removal, 0 to 25 (server default 10). Helps cover object edges.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png).one of
jpegpngwebp safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
blackforestlabs_expand_imageExtend an image by adding pixels on any side with FLUX.1 Expand [pro], optionally guided by a prompt.WriteExpand Image (FLUX.1 Expand)
Extend an image by adding pixels on any side with FLUX.1 Expand [pro], optionally guided by a prompt. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this to add a set number of pixels to chosen edges. Use blackforestlabs_outpaint_image to place the image on a target canvas size, and blackforestlabs_fill_image to change content inside the image. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
imagestringrequired- Base64-encoded image to expand.
bottominteger- Pixels to add at the bottom, 0 to 2048 (default 0).
guidancenumber- Guidance strength, 1.5 to 100 (server default 60).
leftinteger- Pixels to add on the left, 0 to 2048 (default 0).
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp promptstring- Optional description of what the new areas should contain. Example: more of the sandy beach and a calm sea.
prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt for more creative results. Off by default.
rightinteger- Pixels to add on the right, 0 to 2048 (default 0).
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
stepsinteger- Number of generation steps, 15 to 50 (server default 50).
topinteger- Pixels to add at the top, 0 to 2048 (default 0).
blackforestlabs_fill_imageRepaint the masked area of an image with FLUX.1 Fill [pro], guided by a prompt.WriteInpaint Image (FLUX.1 Fill)
Repaint the masked area of an image with FLUX.1 Fill [pro], guided by a prompt. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this to change only part of an image. Use blackforestlabs_erase_object to remove an object without a prompt, blackforestlabs_expand_image to add pixels around the edges, and blackforestlabs_generate_image for whole-image edits without a mask. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
imagestringrequired- Base64-encoded image to modify. It can carry an alpha channel instead of a separate mask: transparent areas are inpainted.
guidancenumber- Guidance strength, 1.5 to 100 (server default 60). Higher values follow the prompt more closely.
maskstring- Base64-encoded black and white mask with the same dimensions as the image. White areas are inpainted; black areas are kept. Omit when the image has an alpha mask.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp promptstring- What to paint in the masked area. Example: a wooden bench under the tree.
prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt for more creative results. Off by default.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
stepsinteger- Number of generation steps, 15 to 50 (server default 50). More steps add detail but take longer.
blackforestlabs_generate_imageGenerate or edit an image with FLUX.2 [pro], [max] or [pro] preview from a text prompt and up to 8 optional reference images.WriteGenerate Image (FLUX.2)
Generate or edit an image with FLUX.2 [pro], [max] or [pro] preview from a text prompt and up to 8 optional reference images. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this as the default for text-to-image and instruction-based edits. Use blackforestlabs_generate_image_flux3 for FLUX 3 Image, blackforestlabs_generate_image_flux2_flex for typography and step/guidance control, and blackforestlabs_generate_image_flux2_klein for the fastest, cheapest renders. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Text description of the image to generate, or the edit to apply when input_images are given. Refer to reference images by position (image 1, image 2). Hex colors such as #FF5733 are followed precisely.
disable_pupboolean- Set to true to generate from the prompt exactly as written. FLUX.2 [pro] and [max] rewrite (upsample) the prompt by default for better results.
heightinteger- Output height in pixels (minimum 64; FLUX.2 outputs up to 4 megapixels). Omit to let BFL choose: the first reference image's size when editing, otherwise the model default. Set together with width. Example: 810
input_imagesarray- Reference images for editing or multi-reference generation, in order (image 1, image 2, ...). Each entry is a public http(s) image URL or a base64-encoded image. Up to 8 images. Refer to them in the prompt by position, for example 'the sofa from image 2'. Omit for plain text-to-image.
modelstring- FLUX.2 model to run. flux-2-pro is BFL's recommended default for generation and editing; flux-2-max gives the highest quality and strongest edit consistency; flux-2-pro-preview gets BFL's newest quality and speed updates first (prefer flux-2-pro for stable production use).one of
flux-2-proflux-2-maxflux-2-pro-previewdefaultflux-2-pro output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
widthinteger- Output width in pixels (minimum 64; FLUX.2 outputs up to 4 megapixels). Omit to let BFL choose: the first reference image's size when editing, otherwise the model default. Set together with height. Example: 1440
blackforestlabs_generate_image_finetunedGenerate an image with one of your FLUX finetunes (LoRAs) on FLUX1.1 [pro] Ultra.WriteGenerate Image (Finetune, FLUX1.1 pro Ultra)
Generate an image with one of your FLUX finetunes (LoRAs) on FLUX1.1 [pro] Ultra. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this to apply a trained finetune; find its id with blackforestlabs_list_finetunes. Use blackforestlabs_generate_image_flux11_ultra for the base model without a finetune. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
finetune_idstringrequired- Name of the finetune (LoRA) to use, from blackforestlabs_list_finetunes. For a public or shared finetune from another organization use org-id/lora-name. Example: my-finetune
aspect_ratiostring- Aspect ratio between 21:9 and 9:21 as width:height (server default 16:9).
finetune_strengthnumber- How strongly the finetune applies, 0 to 2 (server default 1.2). 0 means no influence; 1 means full influence.
image_promptstring- Optional base64-encoded image to remix.
image_prompt_strengthnumber- Blend between the text prompt and the image prompt, 0 to 1 (server default 0.1).
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp promptstring- Text description of the image; include the finetune's trigger word if it has one.
prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt. Off by default.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
blackforestlabs_generate_image_flux1_devGenerate an image from a text prompt with FLUX.1 [dev], with control over steps and guidance.WriteGenerate Image (FLUX.1 dev)
Generate an image from a text prompt with FLUX.1 [dev], with control over steps and guidance. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for existing FLUX.1 [dev] workflows. Use blackforestlabs_generate_image (FLUX.2) for new work and blackforestlabs_generate_image_flux2_klein for fast, low-cost renders. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Text description of the image to generate.
guidancenumber- Guidance scale, 1.5 to 5 (server default 3). Higher values follow the prompt more closely at some cost to realism.
heightinteger- Height of the image in pixels, 256 to 1440 and a multiple of 32 (server default 768).
image_promptstring- Optional base64-encoded image used as a visual prompt.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt for more creative results. Off by default.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
stepsinteger- Generation steps, 1 to 50 (server default 28).
widthinteger- Width of the image in pixels, 256 to 1440 and a multiple of 32 (server default 1024).
blackforestlabs_generate_image_flux11_proGenerate an image from a text prompt with FLUX1.1 [pro], optionally remixing a base64 image prompt (Redux).WriteGenerate Image (FLUX1.1 pro)
Generate an image from a text prompt with FLUX1.1 [pro], optionally remixing a base64 image prompt (Redux). Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for existing FLUX1.1 [pro] workflows. BFL recommends blackforestlabs_generate_image (FLUX.2) for new text-to-image work; use blackforestlabs_generate_image_flux11_ultra for up to 4MP output. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Text description of the image to generate.
heightinteger- Height of the image in pixels, 256 to 1440 and a multiple of 32 (server default 768).
image_promptstring- Optional base64-encoded image used as a visual prompt (Flux Redux) to steer style and content.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt for more creative results. Off by default.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
widthinteger- Width of the image in pixels, 256 to 1440 and a multiple of 32 (server default 1024).
blackforestlabs_generate_image_flux11_ultraGenerate an image of up to 4 megapixels with FLUX1.1 [pro] Ultra, with an optional Raw mode and base64 image prompt.WriteGenerate Image (FLUX1.1 pro Ultra)
Generate an image of up to 4 megapixels with FLUX1.1 [pro] Ultra, with an optional Raw mode and base64 image prompt. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for high-resolution FLUX1.1 output by aspect ratio or candid, less processed photos (raw). Use blackforestlabs_generate_image_flux11_pro for pixel-sized FLUX1.1 output and blackforestlabs_generate_image for FLUX.2. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Text description of the image to generate.
aspect_ratiostring- Aspect ratio between 21:9 and 9:21 as width:height (server default 16:9). Example: 3:2
image_promptstring- Optional base64-encoded image to remix.
image_prompt_strengthnumber- Blend between the text prompt and the image prompt, 0 to 1 (server default 0.1). Higher values follow the image more.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp prompt_upsamplingboolean- Set to true to let BFL rewrite the prompt for more creative results. Off by default.
rawboolean- Set to true for less processed, more natural-looking images. Off by default.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-6 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
blackforestlabs_generate_image_flux2_flexGenerate or edit an image with FLUX.2 [flex], with control over steps and guidance and up to 8 reference images.WriteGenerate Image (FLUX.2 flex)
Generate or edit an image with FLUX.2 [flex], with control over steps and guidance and up to 8 reference images. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for typography, text rendering and preserving small details, or when you need to tune steps and guidance. Use blackforestlabs_generate_image for general FLUX.2 [pro]/[max] work. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Text description of the image, or the edit to apply to the reference images. Quote any text to render, for example: A poster that says "OPEN LATE" in bold red letters.
guidancenumber- Guidance scale, 1.5 to 10 (server default 5). Higher values follow the prompt more closely at some cost to realism.
heightinteger- Output height in pixels (minimum 64). Omit for the default size. Set together with width. Example: 1024
input_imagesarray- Reference images for editing or multi-reference generation, in order (image 1, image 2, ...). Each entry is a public http(s) image URL or a base64-encoded image. Up to 8 images. Refer to them in the prompt by position, for example 'the sofa from image 2'. Omit for plain text-to-image.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp prompt_upsamplingboolean- Whether BFL rewrites the prompt before generating (server default true). Set false to use the prompt exactly as written.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
stepsinteger- Generation steps, 1 to 50 (server default 50). More steps give more detail but take longer.
widthinteger- Output width in pixels (minimum 64). Omit for the default size. Set together with height. Example: 1024
blackforestlabs_generate_image_flux2_kleinGenerate or edit an image with FLUX.2 [klein] 4B or 9B, BFL's fastest image models, with up to 4 reference images.WriteGenerate Image (FLUX.2 klein)
Generate or edit an image with FLUX.2 [klein] 4B or 9B, BFL's fastest image models, with up to 4 reference images. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for sub-second, low-cost, high-volume generation. Use blackforestlabs_generate_image for higher quality FLUX.2 [pro]/[max] output. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Text description of the image, or the edit to apply to the reference images.
heightinteger- Output height in pixels (minimum 64). Omit for the default size. Set together with width. Example: 1024
input_imagesarray- Reference images for editing or multi-reference generation, in order (image 1, image 2, ...). Each entry is a public http(s) image URL or a base64-encoded image. Up to 4 images. Refer to them in the prompt by position, for example 'the sofa from image 2'. Omit for plain text-to-image.
modelstring- Klein model: flux-2-klein-9b (default; best quality/speed balance), flux-2-klein-4b (fastest, lightest) or flux-2-klein-9b-preview (newest updates first).one of
flux-2-klein-9bflux-2-klein-4bflux-2-klein-9b-previewdefaultflux-2-klein-9b output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
widthinteger- Output width in pixels (minimum 64). Omit for the default size. Set together with height. Example: 1024
blackforestlabs_generate_image_flux3Generate or edit an image with FLUX 3 Image from a prompt and up to 10 optional reference images.WriteGenerate Image (FLUX 3)
Generate or edit an image with FLUX 3 Image from a prompt and up to 10 optional reference images. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for BFL's newest image model, aspect-ratio and resolution-tier sizing, and prompts that benefit from web or image search grounding. Use blackforestlabs_generate_image for FLUX.2 with exact pixel sizes and blackforestlabs_generate_image_flux3_klein for a faster, cheaper FLUX 3 model. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Free-form description of the image, or the edit instruction when images are given. Refer to reference images by position (image 1, image 2).
aspect_ratiostring- Output aspect ratio. auto (server default) uses a ratio the prompt asks for, otherwise the first reference image's framing, otherwise 1:1.one of
auto21:92:116:93:27:54:35:41:14:53:45:72:39:161:29:21 groundingboolean- When true (server default) the prompt may be grounded with web search and image search. Set false to turn both off.
imagesarray- Optional reference images the prompt edits or draws from, in order. Each entry is a public http(s) image URL or a base64-encoded image; 1 to 10 images.
resolutionstring- Resolution tier (equal pixel area; exact dimensions depend on the aspect ratio): 768sq, 1k (server default), 1.5k, 2k or 4k.one of
768sq1k1.5k2k4k safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-4 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
blackforestlabs_generate_image_flux3_kleinGenerate or edit an image with FLUX 3 Image Klein, a smaller, faster FLUX 3 model, with up to 10 reference images.WriteGenerate Image (FLUX 3 Image Klein)
Generate or edit an image with FLUX 3 Image Klein, a smaller, faster FLUX 3 model, with up to 10 reference images. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for faster, cheaper FLUX 3 output or exact pixel sizes. Use blackforestlabs_generate_image_flux3 for the full FLUX 3 Image model. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
promptstringrequired- Free-form description of the image, or the edit instruction when images are given.
aspect_ratiostring- Output aspect ratio. auto (server default) keeps the first reference's aspect for edits or picks one from the prompt for text-to-image. Ignored when width and height are set.one of
auto21:92:116:93:27:54:35:41:14:53:45:72:39:161:29:21 heightinteger- Exact output height in pixels, 64 to 6256; set together with width. Overrides resolution and aspect_ratio.
imagesarray- Optional reference images, each a public http(s) URL or base64 image, 1 to 10 total. The first is the image being edited and sets the default output size.
output_formatstring- File format of the generated image: jpeg, png. Omit to use the endpoint default (jpeg).one of
jpegpng resolutionstring- Resolution tier: 768sq, 1k, 1.5k, 2k or 4k. Omit for 1k (text-to-image) or the first reference's size (edits). Ignored when width and height are set.one of
768sq1k1.5k2k4k safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-4 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Seed for reproducibility, 0 to 4294967295; random when omitted. Example: 42
stepsinteger- Denoising steps, 1 to 16 (server default 16).
widthinteger- Exact output width in pixels, 64 to 6256; set together with height. Overrides resolution and aspect_ratio. width x height may be at most 16,822,272 pixels.
blackforestlabs_generate_videoGenerate a video with synchronized audio using FLUX 3, from text (t2v), keyframe images (i2v), a video to continue (v2v), or a saved draft (draft_enhance).WriteGenerate Video (FLUX 3)
Generate a video with synchronized audio using FLUX 3, from text (t2v), keyframe images (i2v), a video to continue (v2v), or a saved draft (draft_enhance). Returns the task id and polling_url; when Ready, get_result returns signed video URLs in result.samples (and draft_caches when draft is true). Use this to create new video. Use blackforestlabs_edit_video to change an existing clip and blackforestlabs_upscale_video to raise its resolution. Then call blackforestlabs_get_result with the returned id until status is Ready; video renders take minutes.
Inputs
modestringrequired- Generation mode. t2v: text to video. i2v: your keyframes become frames of the video (needs keyframes). v2v: continue from the end of start_video (needs start_video). draft_enhance: render a previous draft at full quality (needs draft_cache; prompt and other settings are ignored except resolution).one of
t2vi2vv2vdraft_enhance aspect_ratiostring- Output aspect ratio, or auto (server default) to choose from the prompt and references. Not used by draft_enhance.one of
auto21:92:116:94:31:13:49:169:21 draftboolean- Draft mode: render a fast preview and return a draft_cache you can later pass back with mode draft_enhance for the full-quality render. Off by default. Not used by draft_enhance.
draft_cachestring- draft_enhance only. The draft bundle from a previous draft run: the base64 .bin downloaded from result.draft_caches, or its http(s) URL while that URL is still valid.
durationinteger- Video length in whole seconds: 5 to 20 for t2v and i2v, 5 to 15 for v2v. Omit to let the model fit the content (auto).
generate_audioboolean- Generate synchronized audio with the video (server default true). Not used by draft_enhance.
keyframe_timesarray- i2v only, optional. Time in seconds for each keyframe, in the same order as keyframes and in increasing order, e.g. [0, 4.5, 9]. When set, keyframes are sent as [seconds, image] pairs and duration must be an integer.
keyframesarray- i2v only. Images that become frames of the video, each a public http(s) URL or base64, 1 to 10. One image starts the video, two start and end it, more are spread evenly between first and last (3 or more need an integer duration). Images must be at least 256x256.
promptstring- Description of the video: action, camera, lighting and any dialogue or sound. Required for t2v, i2v and v2v; ignored for draft_enhance.
resolutionstring- Resolution class: hd (server default for new videos), or fhd, qhd, uhd for a higher-resolution result finished by the video upsampler. draft_enhance defaults to fhd.one of
hdfhdqhduhd safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-4 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
start_videostring- v2v only. Video to continue, as a public http(s) URL or base64 mp4; the new clip carries on from its final frames.
blackforestlabs_outpaint_imagePlace an image on a larger target canvas and generate the surrounding area with FLUX Outpainting.WriteOutpaint Image
Place an image on a larger target canvas and generate the surrounding area with FLUX Outpainting. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this to reach a target output size or aspect ratio in one call. Use blackforestlabs_expand_image to add exact pixel counts to individual edges. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
heightintegerrequired- Target canvas height in pixels (minimum 64). Example: 1080
input_imagestringrequired- Image to extend, as a public http(s) URL or a base64-encoded image.
widthintegerrequired- Target canvas width in pixels (minimum 64). Example: 1920
auto_cropboolean- Set to true to crop the input image where it extends past the canvas; otherwise that returns an error. Off by default.
disable_pupboolean- Set to true to skip BFL's image-aware prompt upsampler for lower latency, at some cost to quality.
modestring- Quality/speed trade-off: high (server default) for the best fidelity, fast for quicker results that suit landscapes, backgrounds, textures and products.one of
highfast output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png).one of
jpegpngwebp promptstring- Experimental optional guidance for the new area; the input image's content is the main signal. Example: a busy city street at dusk.
reference_offset_xinteger- Left offset in pixels of the input image's top-left corner on the canvas; negative values allowed. Omit to center horizontally.
reference_offset_yinteger- Top offset in pixels of the input image's top-left corner on the canvas; negative values allowed. Omit to center vertically.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
blackforestlabs_upscale_videoUpscale a video clip 1.5x to 3x toward 4K with FLUX Video Upscale, in a precise or a creative detail-enhancing mode.WriteUpscale Video
Upscale a video clip 1.5x to 3x toward 4K with FLUX Video Upscale, in a precise or a creative detail-enhancing mode. Returns the task id and polling_url; when Ready, get_result returns signed video URLs in result.samples. Use this to raise the resolution of an existing clip. Use blackforestlabs_edit_video to change its content. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
input_videostringrequired- Clip to upscale, as a public http(s) URL or base64 mp4 (max 50MB). Only the first 20 seconds are upscaled, and frames must be at most 2560x1440.
creativityinteger- 0 preserves the source precisely; 1 (server default) allows creative detail enhancement.one of
01 promptstring- Optional description of the clip's content to steer the added detail. Leave empty for a neutral upscale.
safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-4 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
upscale_factornumber- Scale relative to the source, 1.5 to 3 (server default 2). Output keeps the aspect ratio and is capped at 13.75 MP per frame.
blackforestlabs_virtual_try_onShow a person wearing one or more garments from a reference image with FLUX Virtual Try-On.WriteVirtual Try-On
Show a person wearing one or more garments from a reference image with FLUX Virtual Try-On. Returns the task id and polling_url (plus cost in credits when reported); the image is not in this response. Use this for fashion try-on from a person photo and a garment photo. Use blackforestlabs_generate_image for other multi-reference edits. Then call blackforestlabs_get_result with the returned id until status is Ready.
Inputs
garmentstringrequired- Photo of one or more garments (image 2), as a public http(s) URL or a base64-encoded image.
personstringrequired- Photo of the person (image 1), as a public http(s) URL or a base64-encoded image.
promptstringrequired- Try-on instruction that refers to the person as image 1 and the garment as image 2. Example: TRY-ON: The person of image 1 wearing the garments of image 2.
output_formatstring- File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg).one of
jpegpngwebp safety_toleranceinteger- Moderation tolerance for inputs and outputs, where 0 is the strictest. BFL documents 0-5 for this endpoint and defaults to 2; a value above the endpoint's maximum returns a 422 error. Example: 2
seedinteger- Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
versionstring- Try-on model version: vto-v2 (default; reference and output up to 4MP) or vto-v1.one of
vto-v2vto-v1defaultvto-v2
No tools match.