---
title: "Generate image (bitforge)"
method: POST
path: "/generate-image-bitforge"
tags: ["Generate Image"]
---

# Generate image (bitforge)

`POST /generate-image-bitforge`

Generates a pixel art image based on the provided parameters. Called "Generate image (style)" in the plugin.

Supported image size: 
- Maximum area 200x200  

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

Using the Python client:
```python
import pixellab

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

response = client.generate_image_bitforge(
    description="cute dragon",
    image_size=dict(width=128, height=128),
)
response.image.pil_image()
```

## Request body

- GenerateImageBitforgeRequest — 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` AppEndpointsExternalV1GenerateImageBitforgeImageSize, 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)
  - `style_strength` integer — Strength of the style transfer (0-100). 50 = balanced.
  - `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
  - `coverage_percentage` number, nullable — Percentage of the canvas to cover
  - `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
  - `style_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
  - `inpainting_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
  - `mask_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
  - `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
  - `skeleton_guidance_scale` number — How closely to follow the skeleton keypoints
  - `skeleton_keypoints` Point[], nullable — Skeleton points. Warning! Sizes that are not 16x16, 32x32 and 64x64 can cause the generations to be lower quality
    - `x` number, required
    - `y` number, required
    - `label` 'NOSE' | 'NECK' | 'RIGHT SHOULDER' | 'RIGHT ELBOW' | 'RIGHT ARM' | 'LEFT SHOULDER' | 'LEFT ELBOW' | 'LEFT ARM' | 'RIGHT HIP' | 'RIGHT KNEE' | 'RIGHT LEG' | 'LEFT HIP' | 'LEFT KNEE' | 'LEFT LEG' | 'RIGHT EYE' | 'LEFT EYE' | 'RIGHT EAR' | 'LEFT EAR', required
    - `z_index` integer
  - `seed` integer, nullable — Seed decides the starting noise

## Response `200`

Successfully generated image

- GenerateImageBitforgeResponse
  - `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)
