> ## 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.

# Inpainting

> Inapint some part in a given image.

<img src="https://mintcdn.com/mod/i8dYICFkuz1vpdrI/images/image-generation/community-models/assets/images/inpainting-8bb5f9bb4dc5d5307f0fd83248dfc296.jpg?fit=max&auto=format&n=i8dYICFkuz1vpdrI&q=85&s=59c688dbd56bb8b7c868c77beca5202c" alt="Inpainting endpoint result" width="691" height="518" data-path="images/image-generation/community-models/assets/images/inpainting-8bb5f9bb4dc5d5307f0fd83248dfc296.jpg" />

<Check>
  You can find a list of the public models available and their IDs [here](https://modelslab.com/models?base_model%5B0%5D=sdxl-10\&base_model%5B1%5D=sd-15\&base_model%5B2%5D=flux-1-d\&base_model%5B3%5D=pony\&feature=imagen\&model_type%5B0%5D=checkpoint\&sort=recommended)
</Check>

## Request

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

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

## Body

```json json theme={null}
{  
    "key": "your_api_key",  
    "model_id": "lazymixv4-inpaint",  
    "prompt": "a cat sitting on a bench",  
    "negative_prompt": null,  
    "init_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",  
    "mask_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png",  
    "width": "512",  
    "height": "512",  
    "samples": "1",  
    "steps": "21",  
    "safety_checker": "no",  
    "guidance_scale": 7.5,  
    "strength": 0.7,  
    "scheduler": "UniPCMultistepScheduler",  
    "lora_model": null,  
    "use_karras_sigmas": "yes",  
    "vae": null,  
    "lora_strength": null,  
    "seed": null,  
    "webhook": null,  
    "track_id": null
} 
```


## OpenAPI

````yaml POST /inpaint
openapi: 3.1.0
info:
  title: ModelsLab Dreambooth Image Generation API
  description: >-
    A focused API for AI-driven image generation using Dreambooth models,
    including text-to-image, image-to-image, inpainting, and model management
    capabilities.
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api/v6/images
    description: Dreambooth Image Generation API v6 server
security: []
paths:
  /inpaint:
    post:
      summary: Inpaint parts of an image
      description: >-
        Changes (inpaints) a specific part of an image based on provided image,
        mask, and text prompts using Dreambooth models.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InpaintingRequest'
      responses:
        '200':
          description: Inpainting generation response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ImageGenerationSuccessResponse'
                  - $ref: '#/components/schemas/ImageGenerationProcessingResponse'
                  - $ref: '#/components/schemas/ImageGenerationErrorResponse'
        '400':
          $ref: '#/components/responses/StandardErrorResponse'
        '401':
          $ref: '#/components/responses/StandardErrorResponse'
        '500':
          $ref: '#/components/responses/StandardErrorResponse'
components:
  schemas:
    InpaintingRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/CommonImageGenerationParams'
      required:
        - key
        - model_id
        - init_image
        - mask_image
      properties:
        model_id:
          type: string
          description: >-
            The ID of the model to be used. It can be a public model or one you
            have trained.
        init_image:
          type: string
          format: uri
          description: URL of the initial image.
        mask_image:
          type: string
          format: uri
          description: URL of the mask image for inpainting.
        strength:
          type: number
          minimum: 0
          maximum: 1
          description: Prompt strength when using the initial image. Range from 0 to 1.
    ImageGenerationSuccessResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
          description: Status of the image generation.
        generationTime:
          type: number
          description: Time taken to generate the image in seconds.
        id:
          type: integer
          description: Unique identifier for the image 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 image generation including all parameters used.
          additionalProperties: true
        nsfw_content_detected:
          type: boolean
          description: Indicates if NSFW content was detected in the generated image.
        webhook_status:
          type: string
          description: Status of the webhook notification.
        tip:
          type: string
          description: Additional information or tips for the user.
    ImageGenerationProcessingResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - processing
          description: Status of the image generation.
        tip:
          type: string
          description: Information about faster processing options.
        tip_1:
          type: string
          description: Additional tip, usually pointing to the fetch API.
        eta:
          type: number
          description: Estimated time for completion in seconds.
        message:
          type: string
          description: Processing status message.
        webhook_status:
          type: string
          description: Status of the webhook notification.
        fetch_result:
          type: string
          format: uri
          description: URL to fetch the result when processing.
        id:
          type: integer
          description: Unique identifier for the image generation request.
        output:
          type: array
          items:
            type: string
          description: Empty array during processing.
        meta:
          type: object
          description: Metadata about the image generation including all parameters used.
          additionalProperties: true
        future_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of future image URLs for queued requests.
    ImageGenerationErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Error message description.
    CommonImageGenerationParams:
      type: object
      properties:
        key:
          type: string
          description: Your API Key used for request authorization.
        prompt:
          type: string
          description: A text description of what you want in the generated image.
        negative_prompt:
          type: string
          description: Items you don't want in the image.
        enhance_prompt:
          type: boolean
          default: 'yes'
          description: >-
            If true, the prompt will be enhanced for better results. Default is
            (true).
        width:
          type: integer
          default: 512
          maximum: 1024
          description: The width of the image in pixels.
        height:
          type: integer
          default: 512
          maximum: 1024
          description: The height of the image in pixels.
        samples:
          type: integer
          default: 1
          maximum: 4
          description: The number of images to be returned in response. Maximum is 4.
        num_inference_steps:
          type: integer
          default: 31
          minimum: 1
          maximum: 20
          description: >-
            The number of denoising steps. Values range from 1 to 20, and any
            value above 20 will be capped at 20.
        safety_checker:
          type: boolean
          default: false
          description: >-
            A checker for NSFW images. If detected, such images will be replaced
            by a blank image.
        safety_checker_type:
          $ref: '#/components/schemas/SafetyCheckerTypeEnum'
        seed:
          oneOf:
            - type: integer
            - type: 'null'
          description: >-
            Seed for reproducible results. The same seed generates the same
            image. Pass null for a random number.
        guidance_scale:
          type: number
          default: 7.5
          minimum: 1
          maximum: 20
          description: Scale for classifier-free guidance.
        use_karras_sigmas:
          type: boolean
          default: true
          description: Use Karras sigmas to generate images. Produces nice results.
        algorithm_type:
          type: string
          enum:
            - none
            - dpmsolver+++
          default: none
          description: Used in DPMSolverMultistepScheduler scheduler.
        vae:
          type: string
          nullable: true
          description: Use a custom VAE for generating images. Default is null.
        lora_strength:
          type: integer
          description: >-
            Strength of the LoRa model(s). If multiple LoRa models, provide
            comma-separated values (0.1 to 1).
        lora_model:
          type: string
          description: >-
            LoRa model ID(s). Multiple LoRa models are supported; pass
            comma-separated values (e.g., 'contrast-fix,yae-miko-genshin').
        clip_skip:
          type: integer
          default: 2
          minimum: 1
          maximum: 8
          description: Number of CLIP layers to skip.
        base64:
          type: boolean
          default: false
          description: >-
            If true, response output is base64 string. Input images can also be
            base64.
        temp:
          type: boolean
          default: false
          description: If true, stores image in temporary storage (cleaned every 24 hours).
        webhook:
          type: string
          format: uri
          description: URL to receive a POST API call once image generation is complete.
        track_id:
          type: string
          description: Unique ID used in webhook response to identify the request.
        ip_adapter_id:
          $ref: '#/components/schemas/IPAdapterIDEnum'
        ip_adapter_scale:
          type: number
          minimum: 0
          maximum: 1
          description: Scale for the IP adapter (0 to 1).
        ip_adapter_image:
          type: string
          format: uri
          description: Valid image URL for IP adapter.
        scheduler:
          $ref: '#/components/schemas/SchedulerEnum'
    SafetyCheckerTypeEnum:
      type: string
      enum:
        - blur
        - sensitive_content_text
        - pixelate
        - black
      default: sensitive_content_text
      description: How to modify the image if NSFW content is found.
    IPAdapterIDEnum:
      type: string
      enum:
        - ip-adapter_sdxl
        - ip-adapter_sd15
        - ip-adapter-plus-face_sd15
        - ip-adapter-plus_sdxl_vit-h
        - ip-adapter-plus-face_sdxl_vit-h
      description: IP adapter ID.
    SchedulerEnum:
      type: string
      enum:
        - DDPMScheduler
        - DDIMScheduler
        - PNDMScheduler
        - LMSDiscreteScheduler
        - EulerDiscreteScheduler
        - EulerAncestralDiscreteScheduler
        - DPMSolverMultistepScheduler
        - HeunDiscreteScheduler
        - KDPM2DiscreteScheduler
        - DPMSolverSinglestepScheduler
        - KDPM2AncestralDiscreteScheduler
        - UniPCMultistepScheduler
        - DDIMInverseScheduler
        - DEISMultistepScheduler
        - IPNDMScheduler
        - KarrasVeScheduler
        - ScoreSdeVeScheduler
        - LCMScheduler
      description: Available schedulers for image generation.
  responses:
    StandardErrorResponse:
      description: >-
        Bad request (invalid parameters), unauthorized (invalid API key), or
        internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ImageGenerationErrorResponse'

````