Flux · Capability

Flux Image Editing API

REST API for editing and transforming existing images using Black Forest Labs' FLUX.1 Kontext models. The Kontext models accept an input image and a text prompt describing desired edits, returning a modified image. They support context-aware in-painting, object replacement, style transfer, background changes, and image-to-image transformations while preserving important visual context. Authentication requires an API key in the X-Key header. Requests are asynchronous and require polling for results.

Run with Naftiko FluxAPI

What You Can Do

POST
Editimagekontextpro — Edit image with FLUX.1 Kontext [pro]
/flux-kontext-pro
POST
Editimagekontextmax — Edit image with FLUX.1 Kontext [max]
/flux-kontext-max
GET
Geteditresult — Flux Poll for editing result
/get_result

MCP Tools

editimagekontextpro

Edit image with FLUX.1 Kontext [pro]

editimagekontextmax

Edit image with FLUX.1 Kontext [max]

geteditresult

Flux Poll for editing result

read-only idempotent

Capability Spec

flux-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Flux Image Editing API
  description: REST API for editing and transforming existing images using Black Forest Labs' FLUX.1 Kontext models. The Kontext
    models accept an input image and a text prompt describing desired edits, returning a modified image. They support context-aware
    in-painting, object replacement, style transfer, background changes, and image-to-image transformations while preserving
    important visual context. Authentication requires an API key in the X-Key header. Requests are asynchronous and require
    polling for results.
  tags:
  - Flux
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: flux
    baseUri: https://api.bfl.ai/v1
    description: Flux Image Editing API HTTP API.
    authentication:
      type: apikey
      in: header
      name: X-Key
      value: '{{FLUX_TOKEN}}'
    resources:
    - name: flux-kontext-pro
      path: /flux-kontext-pro
      operations:
      - name: editimagekontextpro
        method: POST
        description: Edit image with FLUX.1 Kontext [pro]
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: flux-kontext-max
      path: /flux-kontext-max
      operations:
      - name: editimagekontextmax
        method: POST
        description: Edit image with FLUX.1 Kontext [max]
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: get-result
      path: /get_result
      operations:
      - name: geteditresult
        method: GET
        description: Flux Poll for editing result
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: flux-rest
    description: REST adapter for Flux Image Editing API.
    resources:
    - path: /flux-kontext-pro
      name: editimagekontextpro
      operations:
      - method: POST
        name: editimagekontextpro
        description: Edit image with FLUX.1 Kontext [pro]
        call: flux.editimagekontextpro
        outputParameters:
        - type: object
          mapping: $.
    - path: /flux-kontext-max
      name: editimagekontextmax
      operations:
      - method: POST
        name: editimagekontextmax
        description: Edit image with FLUX.1 Kontext [max]
        call: flux.editimagekontextmax
        outputParameters:
        - type: object
          mapping: $.
    - path: /get_result
      name: geteditresult
      operations:
      - method: GET
        name: geteditresult
        description: Flux Poll for editing result
        call: flux.geteditresult
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: flux-mcp
    transport: http
    description: MCP adapter for Flux Image Editing API for AI agent use.
    tools:
    - name: editimagekontextpro
      description: Edit image with FLUX.1 Kontext [pro]
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: flux.editimagekontextpro
      outputParameters:
      - type: object
        mapping: $.
    - name: editimagekontextmax
      description: Edit image with FLUX.1 Kontext [max]
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: flux.editimagekontextmax
      outputParameters:
      - type: object
        mapping: $.
    - name: geteditresult
      description: Flux Poll for editing result
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: flux.geteditresult
      outputParameters:
      - type: object
        mapping: $.
binds:
- namespace: env
  keys:
    FLUX_TOKEN: FLUX_TOKEN