> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Black Forest Labs

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.

**Authentication:** API Key
**Categories:** AI, Design, Media
**Tools:** 23: 4 read, 19 write, 0 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=BLACKFORESTLABS)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Black Forest Labs connection

   In **AgentKit > Connections**, create a Black Forest Labs connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   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.actions

   const connector = 'blackforestlabs'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { 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 call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'blackforestlabs_get_credits',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_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.actions

   connection_name = "blackforestlabs"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_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 call
   result = actions.execute_tool(
       tool_input={},
       tool_name="blackforestlabs_get_credits",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Black Forest Labs credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'blackforestlabs_get_credits',
  toolInput: {},
  connector: 'blackforestlabs',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="blackforestlabs_get_credits",
    tool_input={},
    connection_name="blackforestlabs",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `blackforestlabs_get_credits`

Get Credits · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `blackforestlabs_get_finetune_details`

Get Finetune Details · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `finetune_id` (`string`, required): Finetune id from blackforestlabs_list_finetunes. Example: my-finetune

Example input: `{"finetune_id":"<finetune_id>"}`

### `blackforestlabs_get_result`

Get Result · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): 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

Example input: `{"id":"<id>"}`

### `blackforestlabs_list_finetunes`

List Finetunes · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `blackforestlabs_deblur_image`

Deblur Image · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `image` (`string`, required): Blurry image to sharpen, as a public http(s) URL or a base64-encoded image.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png). One of: `jpeg`, `png`, `webp`.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42

Example input: `{"image":"<image>"}`

### `blackforestlabs_edit_image_kontext`

Edit Image (FLUX.1 Kontext) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): 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_images` (`array`, optional): 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_ratio` (`string`, optional): 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_image` (`string`, optional): Image to edit, as a public http(s) URL or a base64-encoded image. Omit to create an image from the prompt alone.
- `model` (`string`, optional): Kontext model: flux-kontext-pro (default) or flux-kontext-max (higher quality; BFL allows at most 6 concurrent max requests). One of: `flux-kontext-pro`, `flux-kontext-max`. Default: `flux-kontext-pro`.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png). One of: `jpeg`, `png`, `webp`.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt for more creative results. Off by default.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_edit_video`

Edit Video · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Edit instruction, 1 to 4096 characters. Say what changes and where. Example: Replace the red car with a vintage blue convertible.
- `video` (`string`, required): Video to edit, as a public http(s) URL or base64-encoded mp4.
- `safety_tolerance` (`integer`, optional): 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

Example input: `{"prompt":"<prompt>","video":"<video>"}`

### `blackforestlabs_erase_object`

Erase Object · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `image` (`string`, required): Image to clean up, as a public http(s) URL or a base64-encoded image.
- `mask` (`string`, required): 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_pixels` (`integer`, optional): Pixels to grow the mask by before removal, 0 to 25 (server default 10). Helps cover object edges.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png). One of: `jpeg`, `png`, `webp`.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42

Example input: `{"image":"<image>","mask":"<mask>"}`

### `blackforestlabs_expand_image`

Expand Image (FLUX.1 Expand) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `image` (`string`, required): Base64-encoded image to expand.
- `bottom` (`integer`, optional): Pixels to add at the bottom, 0 to 2048 (default 0).
- `guidance` (`number`, optional): Guidance strength, 1.5 to 100 (server default 60).
- `left` (`integer`, optional): Pixels to add on the left, 0 to 2048 (default 0).
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt` (`string`, optional): Optional description of what the new areas should contain. Example: more of the sandy beach and a calm sea.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt for more creative results. Off by default.
- `right` (`integer`, optional): Pixels to add on the right, 0 to 2048 (default 0).
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `steps` (`integer`, optional): Number of generation steps, 15 to 50 (server default 50).
- `top` (`integer`, optional): Pixels to add at the top, 0 to 2048 (default 0).

Example input: `{"image":"<image>"}`

### `blackforestlabs_fill_image`

Inpaint Image (FLUX.1 Fill) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `image` (`string`, required): Base64-encoded image to modify. It can carry an alpha channel instead of a separate mask: transparent areas are inpainted.
- `guidance` (`number`, optional): Guidance strength, 1.5 to 100 (server default 60). Higher values follow the prompt more closely.
- `mask` (`string`, optional): 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_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt` (`string`, optional): What to paint in the masked area. Example: a wooden bench under the tree.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt for more creative results. Off by default.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `steps` (`integer`, optional): Number of generation steps, 15 to 50 (server default 50). More steps add detail but take longer.

Example input: `{"image":"<image>"}`

### `blackforestlabs_generate_image`

Generate Image (FLUX.2) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): 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_pup` (`boolean`, optional): 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.
- `height` (`integer`, optional): 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_images` (`array`, optional): 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.
- `model` (`string`, optional): 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-pro`, `flux-2-max`, `flux-2-pro-preview`. Default: `flux-2-pro`.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `width` (`integer`, optional): 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

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_finetuned`

Generate Image (Finetune, FLUX1.1 pro Ultra) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `finetune_id` (`string`, required): 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_ratio` (`string`, optional): Aspect ratio between 21:9 and 9:21 as width:height (server default 16:9).
- `finetune_strength` (`number`, optional): How strongly the finetune applies, 0 to 2 (server default 1.2). 0 means no influence; 1 means full influence.
- `image_prompt` (`string`, optional): Optional base64-encoded image to remix.
- `image_prompt_strength` (`number`, optional): Blend between the text prompt and the image prompt, 0 to 1 (server default 0.1).
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt` (`string`, optional): Text description of the image; include the finetune's trigger word if it has one.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt. Off by default.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42

Example input: `{"finetune_id":"<finetune_id>"}`

### `blackforestlabs_generate_image_flux1_dev`

Generate Image (FLUX.1 dev) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Text description of the image to generate.
- `guidance` (`number`, optional): Guidance scale, 1.5 to 5 (server default 3). Higher values follow the prompt more closely at some cost to realism.
- `height` (`integer`, optional): Height of the image in pixels, 256 to 1440 and a multiple of 32 (server default 768).
- `image_prompt` (`string`, optional): Optional base64-encoded image used as a visual prompt.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt for more creative results. Off by default.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `steps` (`integer`, optional): Generation steps, 1 to 50 (server default 28).
- `width` (`integer`, optional): Width of the image in pixels, 256 to 1440 and a multiple of 32 (server default 1024).

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_flux11_pro`

Generate Image (FLUX1.1 pro) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Text description of the image to generate.
- `height` (`integer`, optional): Height of the image in pixels, 256 to 1440 and a multiple of 32 (server default 768).
- `image_prompt` (`string`, optional): Optional base64-encoded image used as a visual prompt (Flux Redux) to steer style and content.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt for more creative results. Off by default.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `width` (`integer`, optional): Width of the image in pixels, 256 to 1440 and a multiple of 32 (server default 1024).

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_flux11_ultra`

Generate Image (FLUX1.1 pro Ultra) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Text description of the image to generate.
- `aspect_ratio` (`string`, optional): Aspect ratio between 21:9 and 9:21 as width:height (server default 16:9). Example: 3:2
- `image_prompt` (`string`, optional): Optional base64-encoded image to remix.
- `image_prompt_strength` (`number`, optional): Blend between the text prompt and the image prompt, 0 to 1 (server default 0.1). Higher values follow the image more.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt_upsampling` (`boolean`, optional): Set to true to let BFL rewrite the prompt for more creative results. Off by default.
- `raw` (`boolean`, optional): Set to true for less processed, more natural-looking images. Off by default.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_flux2_flex`

Generate Image (FLUX.2 flex) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): 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.
- `guidance` (`number`, optional): Guidance scale, 1.5 to 10 (server default 5). Higher values follow the prompt more closely at some cost to realism.
- `height` (`integer`, optional): Output height in pixels (minimum 64). Omit for the default size. Set together with width. Example: 1024
- `input_images` (`array`, optional): 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_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `prompt_upsampling` (`boolean`, optional): Whether BFL rewrites the prompt before generating (server default true). Set false to use the prompt exactly as written.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `steps` (`integer`, optional): Generation steps, 1 to 50 (server default 50). More steps give more detail but take longer.
- `width` (`integer`, optional): Output width in pixels (minimum 64). Omit for the default size. Set together with height. Example: 1024

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_flux2_klein`

Generate Image (FLUX.2 klein) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Text description of the image, or the edit to apply to the reference images.
- `height` (`integer`, optional): Output height in pixels (minimum 64). Omit for the default size. Set together with width. Example: 1024
- `input_images` (`array`, optional): 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.
- `model` (`string`, optional): 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-9b`, `flux-2-klein-4b`, `flux-2-klein-9b-preview`. Default: `flux-2-klein-9b`.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `width` (`integer`, optional): Output width in pixels (minimum 64). Omit for the default size. Set together with height. Example: 1024

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_flux3`

Generate Image (FLUX 3) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): 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_ratio` (`string`, optional): 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: `auto`, `21:9`, `2:1`, `16:9`, `3:2`, `7:5`, `4:3`, `5:4`, `1:1`, `4:5`, `3:4`, `5:7`, `2:3`, `9:16`, `1:2`, `9:21`.
- `grounding` (`boolean`, optional): When true (server default) the prompt may be grounded with web search and image search. Set false to turn both off.
- `images` (`array`, optional): 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.
- `resolution` (`string`, optional): Resolution tier (equal pixel area; exact dimensions depend on the aspect ratio): 768sq, 1k (server default), 1.5k, 2k or 4k. One of: `768sq`, `1k`, `1.5k`, `2k`, `4k`.
- `safety_tolerance` (`integer`, optional): 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

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_image_flux3_klein`

Generate Image (FLUX 3 Image Klein) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Free-form description of the image, or the edit instruction when images are given.
- `aspect_ratio` (`string`, optional): 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: `auto`, `21:9`, `2:1`, `16:9`, `3:2`, `7:5`, `4:3`, `5:4`, `1:1`, `4:5`, `3:4`, `5:7`, `2:3`, `9:16`, `1:2`, `9:21`.
- `height` (`integer`, optional): Exact output height in pixels, 64 to 6256; set together with width. Overrides resolution and aspect_ratio.
- `images` (`array`, optional): 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_format` (`string`, optional): File format of the generated image: jpeg, png. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`.
- `resolution` (`string`, optional): 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: `768sq`, `1k`, `1.5k`, `2k`, `4k`.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Seed for reproducibility, 0 to 4294967295; random when omitted. Example: 42
- `steps` (`integer`, optional): Denoising steps, 1 to 16 (server default 16).
- `width` (`integer`, optional): 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.

Example input: `{"prompt":"<prompt>"}`

### `blackforestlabs_generate_video`

Generate Video (FLUX 3) · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `mode` (`string`, required): 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: `t2v`, `i2v`, `v2v`, `draft_enhance`.
- `aspect_ratio` (`string`, optional): Output aspect ratio, or auto (server default) to choose from the prompt and references. Not used by draft_enhance. One of: `auto`, `21:9`, `2:1`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `9:21`.
- `draft` (`boolean`, optional): 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_cache` (`string`, optional): 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.
- `duration` (`integer`, optional): 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_audio` (`boolean`, optional): Generate synchronized audio with the video (server default true). Not used by draft_enhance.
- `keyframe_times` (`array`, optional): 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.
- `keyframes` (`array`, optional): 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.
- `prompt` (`string`, optional): Description of the video: action, camera, lighting and any dialogue or sound. Required for t2v, i2v and v2v; ignored for draft_enhance.
- `resolution` (`string`, optional): 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: `hd`, `fhd`, `qhd`, `uhd`.
- `safety_tolerance` (`integer`, optional): 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_video` (`string`, optional): v2v only. Video to continue, as a public http(s) URL or base64 mp4; the new clip carries on from its final frames.

Example input: `{"mode":"t2v"}`

### `blackforestlabs_outpaint_image`

Outpaint Image · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `height` (`integer`, required): Target canvas height in pixels (minimum 64). Example: 1080
- `input_image` (`string`, required): Image to extend, as a public http(s) URL or a base64-encoded image.
- `width` (`integer`, required): Target canvas width in pixels (minimum 64). Example: 1920
- `auto_crop` (`boolean`, optional): Set to true to crop the input image where it extends past the canvas; otherwise that returns an error. Off by default.
- `disable_pup` (`boolean`, optional): Set to true to skip BFL's image-aware prompt upsampler for lower latency, at some cost to quality.
- `mode` (`string`, optional): Quality/speed trade-off: high (server default) for the best fidelity, fast for quicker results that suit landscapes, backgrounds, textures and products. One of: `high`, `fast`.
- `output_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (png). One of: `jpeg`, `png`, `webp`.
- `prompt` (`string`, optional): 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_x` (`integer`, optional): Left offset in pixels of the input image's top-left corner on the canvas; negative values allowed. Omit to center horizontally.
- `reference_offset_y` (`integer`, optional): Top offset in pixels of the input image's top-left corner on the canvas; negative values allowed. Omit to center vertically.
- `safety_tolerance` (`integer`, optional): 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

Example input: `{"height":1080,"input_image":"<input_image>","width":1920}`

### `blackforestlabs_upscale_video`

Upscale Video · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input_video` (`string`, required): 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.
- `creativity` (`integer`, optional): 0 preserves the source precisely; 1 (server default) allows creative detail enhancement. One of: `0`, `1`.
- `prompt` (`string`, optional): Optional description of the clip's content to steer the added detail. Leave empty for a neutral upscale.
- `safety_tolerance` (`integer`, optional): 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_factor` (`number`, optional): 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.

Example input: `{"input_video":"<input_video>"}`

### `blackforestlabs_virtual_try_on`

Virtual Try-On · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `garment` (`string`, required): Photo of one or more garments (image 2), as a public http(s) URL or a base64-encoded image.
- `person` (`string`, required): Photo of the person (image 1), as a public http(s) URL or a base64-encoded image.
- `prompt` (`string`, required): 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_format` (`string`, optional): File format of the generated image: jpeg, png, webp. Omit to use the endpoint default (jpeg). One of: `jpeg`, `png`, `webp`.
- `safety_tolerance` (`integer`, optional): 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
- `seed` (`integer`, optional): Optional seed for reproducible results. The same seed, prompt and settings give a similar image; omit for a random seed. Example: 42
- `version` (`string`, optional): Try-on model version: vto-v2 (default; reference and output up to 4MP) or vto-v1. One of: `vto-v2`, `vto-v1`. Default: `vto-v2`.

Example input: `{"garment":"<garment>","person":"<person>","prompt":"<prompt>"}`

## Related

Other AI connectors ([all 148](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
