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

# Outpainting

> This endpoint helps to outpaint by expanding the giving image.

### Outpaint

<img src="https://mintcdn.com/mod/i8dYICFkuz1vpdrI/images/image-editing/assets/images/Outpainting-f3a573d3b82f42a8177ad36204082feb.jpg?fit=max&auto=format&n=i8dYICFkuz1vpdrI&q=85&s=54128f4ac2511c321d311dc75f62ecda" alt="Outpainting endpoint result" width="691" height="518" data-path="images/image-editing/assets/images/Outpainting-f3a573d3b82f42a8177ad36204082feb.jpg" />

## Request

Make a `POST` request to below endpoint and pass the required parameters as a request body to the endpoint.

```curl curl theme={null}
--request POST 'https://modelslab.com/api/v6/image_editing/outpaint' \
```

## Body

```json json theme={null}
{    
       "key": "your_api_key",    
       "seed": 12345,    
       "width": 512,    
       "height": 512,    
       "prompt": "a majestic cat house, lush greenery, filled with plants, high quality, cartoonish, realistic, 4k",    
       "image": "https://i.ibb.co/wp0w7nt/1-d212fe65-f95c-4bbe-b275-99f0dedd901a.png",    
       "negative_prompt": "dull background, text, characters, symbols, unrealistic, repetitive background, boring background, bad, low quality, black background",    
       "overlap_width": 32,    
       "num_inference_steps": 15,    
       "guidance_scale": 8.0,    
       "temp": true,    
       "base64": false,    
       "webhook": null,    
       "track_id": null
}
```


## OpenAPI

````yaml POST /image_editing/outpaint
openapi: 3.1.0
info:
  title: ModelsLab Image Editing API
  description: >-
    Image editing endpoints for ModelsLab API including background removal,
    super resolution, face generation, fashion try-on, and various image
    manipulation tools
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api/v6
    description: Image Editing API v6 server
security: []
paths:
  /image_editing/outpaint:
    post:
      summary: Image outpainting
      description: This endpoint helps to outpaint by expanding the given image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OutpaintRequest'
      responses:
        '200':
          description: Outpainting response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ImageEditingSuccessResponse'
                  - $ref: '#/components/schemas/ImageEditingProcessingResponse'
                  - $ref: '#/components/schemas/ImageEditingErrorResponse'
components:
  schemas:
    OutpaintRequest:
      type: object
      required:
        - key
        - image
      properties:
        key:
          type: string
          description: Your API Key used for request authorization
        prompt:
          type: string
          default: high quality
          description: The text prompt to guide image generation
        negative_prompt:
          type: string
          default: low quality
          description: Aspects to avoid in the generated image
        image:
          type: string
          format: uri
          description: URL of the initial image to outpaint
        width:
          type: integer
          maximum: 1440
          default: 1280
          description: Width of the output image
        height:
          type: integer
          maximum: 1440
          default: 720
          description: Height of the output image
        overlap_width:
          type: integer
          maximum: 42
          default: 10
          description: Width of the mask overlap area
        num_inference_steps:
          type: integer
          maximum: 30
          default: 10
          description: Number of denoising steps
        guidance_scale:
          type: number
          default: 8
          description: How closely to follow the prompt
        seed:
          type: integer
          description: Seed for reproducible results
        temp:
          type: boolean
          default: true
          description: Whether to save output temporarily
        base64:
          type: boolean
          default: false
          description: Whether the image is base64 encoded
        webhook:
          type: string
          format: uri
          description: URL to receive POST API call when complete
        track_id:
          type: integer
          description: ID for webhook identification
    ImageEditingSuccessResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        generationTime:
          type: number
          description: Time taken to generate the image in seconds
        id:
          type: integer
          description: Unique identifier for the generation request
        output:
          type: array
          items:
            type: string
            format: uri
          description: Array of generated image URLs
        proxy_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of proxy image URLs
        meta:
          type: object
          description: Metadata about the generation process
          additionalProperties: true
    ImageEditingProcessingResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - processing
        tip:
          type: string
          description: Information about the processing status
        eta:
          type: integer
          description: Estimated time remaining in seconds
        message:
          type: string
          description: Processing status message
        fetch_result:
          type: string
          format: uri
          description: URL to fetch the result when ready
        id:
          type: integer
          description: Unique identifier for the generation request
        output:
          type: array
          items:
            type: string
          description: Empty array during processing
        future_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of future image URLs
        proxy_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of proxy image URLs
        meta:
          type: object
          description: Metadata about the generation process
          additionalProperties: true
    ImageEditingErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Error message describing what went wrong

````