> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bfl.ml/llms.txt
> Use this file to discover all available pages before exploring further.

# Outpaint or extend an image

> Submits an outpainting task. The input image is placed on a (width, height) canvas at the given offset, and the surrounding region is generated by a FLUX outpainting model.



## OpenAPI

````yaml https://api.bfl.ai/openapi.json post /v1/flux-tools/outpainting-v1
openapi: 3.1.0
info:
  title: BFL API
  description: Authorize with an API key from your user profile.
  version: 0.0.1
servers:
  - url: https://api.bfl.ai
    description: BFL API
security: []
tags:
  - name: Models
    description: >-
      Generation task endpoints. These endpoints allow you to submit generation
      tasks.
  - name: Utility
    description: >-
      These utility endpoints allow you to check the results of submitted tasks
      and to manage your finetunes.
paths:
  /v1/flux-tools/outpainting-v1:
    post:
      tags:
        - Models
      summary: Outpaint or extend an image
      description: >-
        Submits an outpainting task. The input image is placed on a (width,
        height) canvas at the given offset, and the surrounding region is
        generated by a FLUX outpainting model.
      operationId: generate_flux_tools_outpainting_v1_v1_flux_tools_outpainting_v1_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FluxOutpaintingInputs'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AsyncResponse'
                  - $ref: '#/components/schemas/AsyncWebhookResponse'
                title: >-
                  Response Generate Flux Tools Outpainting V1 V1 Flux Tools
                  Outpainting V1 Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    FluxOutpaintingInputs:
      properties:
        input_image:
          type: string
          title: Input Image
          description: Base64-encoded input (reference) image or HTTP(S) image URL.
        width:
          type: integer
          minimum: 64
          title: Width
          description: Target output width.
        height:
          type: integer
          minimum: 64
          title: Height
          description: Target output height.
        auto_crop:
          type: boolean
          title: Auto Crop
          description: >-
            If True, crop the input image to the canvas bounds when it extends
            beyond the edges. If False, an error is raised instead.
          default: false
        safety_tolerance:
          type: integer
          maximum: 5
          minimum: 0
          title: Safety Tolerance
          description: >-
            Tolerance level for input and output moderation. Between 0 and 5, 0
            being most strict, 5 being least strict. If you wish to increase the
            safety_tolerance beyond these levels please reach out to the team.
          default: 2
        output_format:
          anyOf:
            - $ref: '#/components/schemas/OutputFormat'
            - type: 'null'
          default: png
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: >-
            Experimental: optional text guidance for the outpainted region. The
            model may not strictly follow this prompt; the visual content of the
            input image is the primary signal. Leave unset for default behavior.
        reference_offset_x:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reference Offset X
          description: >-
            Left offset (px) of the reference image's top-left corner on the
            output canvas. Negative values are allowed. None = center
            horizontally.
        reference_offset_y:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reference Offset Y
          description: >-
            Top offset (px) of the reference image's top-left corner on the
            output canvas. Negative values are allowed. None = center
            vertically.
        mode:
          type: string
          enum:
            - high
            - fast
          title: Mode
          description: >-
            Quality/speed trade-off. 'high' (default): highest-fidelity results,
            recommended whenever fine detail, prompt adherence, or consistency
            with complex content in the source image matters; slower. 'fast':
            significantly faster and well-suited for naturally extending most
            scenes (landscapes, backgrounds, textures, products); may produce
            lower fidelity in the extended region than 'high'.
          default: high
      additionalProperties: false
      type: object
      required:
        - input_image
        - width
        - height
      title: FluxOutpaintingInputs
      description: Public contract for ``/v1/flux-tools/outpainting-v1``.
    AsyncResponse:
      properties:
        id:
          type: string
          title: Id
        polling_url:
          type: string
          title: Polling Url
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
          description: Cost in credits for this request
        input_mp:
          anyOf:
            - type: number
            - type: 'null'
          title: Input Mp
          description: Input megapixels (2 decimal places)
        output_mp:
          anyOf:
            - type: number
            - type: 'null'
          title: Output Mp
          description: Output megapixels (2 decimal places)
      type: object
      required:
        - id
        - polling_url
      title: AsyncResponse
    AsyncWebhookResponse:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
        webhook_url:
          type: string
          title: Webhook Url
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
          description: Cost in credits for this request
        input_mp:
          anyOf:
            - type: number
            - type: 'null'
          title: Input Mp
          description: Input megapixels (2 decimal places)
        output_mp:
          anyOf:
            - type: number
            - type: 'null'
          title: Output Mp
          description: Output megapixels (2 decimal places)
      type: object
      required:
        - id
        - status
        - webhook_url
      title: AsyncWebhookResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OutputFormat:
      type: string
      enum:
        - jpeg
        - png
        - webp
      title: OutputFormat
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-key

````