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

# Generate image (pixflux)

`POST /generate-image-pixflux`

Creates a pixel art image based on the provided parameters. Called "Create image (new)" in the plugin.

Supported image size: 
- Minimum area 32x32 and maximum area 400x400  

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

Using the Python client:
```python
import pixellab

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

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

## Request body

- GenerateImagePixfluxRequest — Request model for pixflux image generation endpoint
  - `description` string, required — Text description of the image to generate
  - `negative_description` string — (Deprecated)
  - `image_size` AppEndpointsExternalV1GenerateImagePixfluxImageSize, 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
  - `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 (weakly guiding)
  - `no_background` boolean — Generate with transparent background, (blank background over 200x200 area)
  - `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
  - `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

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