---
title: "Inpaint image"
method: POST
path: "/inpaint"
tags: ["Inpaint"]
---

# Inpaint image

`POST /inpaint`

Creates a pixel art image based on the provided parameters. Called "Inpaint" in the plugin.

Supported image size: 
- Maximum area 200x200

Supported features:
- Inpainting
- Init image
- Forced palette
- Transparent background

Using the Python client:
```python
import pixellab

client = pixellab.Client(secret="YOUR_API_TOKEN")

response = client.inpaint(
    description="boy with wings",
    image_size=dict(width=16, height=16),
    inpainting_image=image_of_boy_without_wings,
    mask_image=mask_image,
)
response.image.pil_image()
```

## Request body

- InpaintRequest — Request model for image generation endpoint
  - `description` string, required — Text description of the image to generate
  - `negative_description` string — Text description of what to avoid in the generated image
  - `image_size` AppEndpointsExternalV1GenerateInpaintingImageSize, required
    - `width` integer, required — Image width in pixels
    - `height` integer, required — Image height in pixels
  - `text_guidance_scale` number — How closely to follow the text description
  - `extra_guidance_scale` number — (Deprecated)
  - `outline` 'single color black outline' | 'single color outline' | 'selective outline' | 'lineless'
  - `shading` 'flat shading' | 'basic shading' | 'medium shading' | 'detailed shading' | 'highly detailed shading'
  - `detail` 'low detail' | 'medium detail' | 'highly detailed'
  - `view` 'side' | 'low top-down' | 'high top-down'
  - `direction` 'north' | 'north-east' | 'east' | 'south-east' | 'south' | 'south-west' | 'west' | 'north-west'
  - `isometric` boolean — Generate in isometric view
  - `oblique_projection` boolean — Generate in oblique projection
  - `no_background` boolean — Generate with transparent background
  - `init_image` Base64Image — A base64 encoded image. Attributes: type (Literal["base64"]): Always "base64" to indicate the image encoding type base64 (str): The base64 encoded image data
    - `type` 'base64' — Image data type
    - `base64` string, required — Base64 encoded image data
  - `init_image_strength` integer — Strength of the initial image influence
  - `inpainting_image` Base64Image, required — A base64 encoded image. Attributes: type (Literal["base64"]): Always "base64" to indicate the image encoding type base64 (str): The base64 encoded image data
    - `type` 'base64' — Image data type
    - `base64` string, required — Base64 encoded image data
  - `mask_image` Base64Image, required — A base64 encoded image. Attributes: type (Literal["base64"]): Always "base64" to indicate the image encoding type base64 (str): The base64 encoded image data
    - `type` 'base64' — Image data type
    - `base64` string, required — Base64 encoded image data
  - `color_image` Base64Image — A base64 encoded image. Attributes: type (Literal["base64"]): Always "base64" to indicate the image encoding type base64 (str): The base64 encoded image data
    - `type` 'base64' — Image data type
    - `base64` string, required — Base64 encoded image data
  - `seed` integer, nullable — Seed decides the starting noise

## Response `200`

Successfully generated image

- InpaintResponse
  - `usage` Usage, required
    - `type` 'usd' | 'generations'
    - `usd` number, nullable
    - `generations` number, nullable
  - `image` Base64Image, required — A base64 encoded image. Attributes: type (Literal["base64"]): Always "base64" to indicate the image encoding type base64 (str): The base64 encoded image data
    - `type` 'base64' — Image data type
    - `base64` string, required — Base64 encoded image data

## Other responses

- `401` — Invalid API token
- `402` — Insufficient credits
- `422` — Validation error
- `429` — Too many requests
- `529` — Rate limit exceeded

---

[API](https://skmtc.dev/pixellab/apis/pixel-lab-api.md) · [All operations](https://skmtc.dev/pixellab/apis/pixel-lab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pixellab/pixel-lab-api/revisions/eb7a18b195ba/schema)
