### Install Python Client Source: https://api.pixellab.ai/v1/docs Installs the official Python client library for the Pixel Lab API. This library simplifies the process of integrating with the API's functionalities. ```bash pip install pixellab ``` -------------------------------- ### GET /balance Source: https://api.pixellab.ai/v1/docs Returns the current balance for your account in USD. ```APIDOC ## GET /balance ### Description Returns the current balance for your account. ### Method GET ### Endpoint https://api.pixellab.ai/v1/balance ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl https://api.pixellab.ai/v1/balance \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **usd** (integer) - The current balance in USD. #### Response Example ```json { "usd": 100 } ``` #### Error Responses - **401** - Invalid API token ``` -------------------------------- ### Estimate Skeleton using cURL Source: https://api.pixellab.ai/v1/docs Provides a cURL command to interact with the Pixellab AI v1 'estimate-skeleton' endpoint. This example shows how to send a POST request with a JSON body containing the image data in base64 format and includes the necessary authorization header. ```shell curl https://api.pixellab.ai/v1/estimate-skeleton \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "image": { "type": "base64", "base64": "" } }' ``` -------------------------------- ### Get Account Balance using cURL Source: https://api.pixellab.ai/v1/docs Fetches the current account balance by sending a GET request to the Pixellab API using cURL. Requires an 'Authorization' header with a Bearer token. ```shell curl https://api.pixellab.ai/v1/balance \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Get Account Balance with Python Client Source: https://api.pixellab.ai/v1/docs Retrieves the current account balance using the Pixellab Python client. Requires an API token for authentication. The balance is returned in USD. ```python import pixellab client = pixellab.Client(secret="YOUR_API_TOKEN") balance = client.get_balance() print(f"Current balance: {balance.usd} USD") ``` -------------------------------- ### Generate Animation with Skeleton using cURL Source: https://api.pixellab.ai/v1/docs This cURL command shows how to make a POST request to the PixelLab AI API's animate-with-skeleton endpoint. It requires a JSON payload with image size and an Authorization header containing the API token. This example demonstrates a basic request, and other parameters can be added to the JSON body for more control. ```bash curl https://api.pixellab.ai/v1/animate-with-skeleton \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "image_size": { "height": 64, "width": 64 } }' ``` -------------------------------- ### Generate Image using cURL Source: https://api.pixellab.ai/v1/docs Provides a cURL command to generate a pixel art image via the Pixellab AI v1 API. This example shows how to set the endpoint, request method, headers, and the JSON payload including the image description, size, and background transparency. ```shell curl https://api.pixellab.ai/v1/generate-image-pixflux \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true }' ``` -------------------------------- ### Estimate Skeleton using Python Client Source: https://api.pixellab.ai/v1/docs Demonstrates how to use the Pixellab Python client to estimate a character's skeleton. This involves initializing the client with an API token and calling the 'estimate_skeleton' method with the character image. The output contains the detected keypoints. ```python import pixellab client = pixellab.Client(secret="YOUR_API_TOKEN") response = client.estimate_skeleton( image=image_of_the_character_on_a_transparent_background, ) response.keypoints ``` -------------------------------- ### POST /websites/api_pixellab_ai_v1 Source: https://api.pixellab.ai/v1/docs Generates an image based on a text description and specified image properties. ```APIDOC ## POST /websites/api_pixellab_ai_v1 ### Description Generates an image based on a text description and specified image properties such as size and background. ### Method POST ### Endpoint /websites/api_pixellab_ai_v1 ### Parameters #### Headers - **Content-Type** (string) - Required - `application/json` - **Accept** (string) - Required - `application/json` - **Key** (string) - Required - API Key for authentication - **Value** (string) - Required - API Key value #### Query Parameters - **Key** (string) - Optional - Query parameter key - **Value** (string) - Optional - Query parameter value #### Request Body - **description** (string) - Required - A text description of the image to generate. - **image_size** (object) - Required - Specifies the dimensions of the image. - **height** (integer) - Required - The desired height of the image in pixels. - **width** (integer) - Required - The desired width of the image in pixels. - **no_background** (boolean) - Optional - If true, the generated image will have a transparent background. ### Request Example ```json { "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true } ``` ### Response #### Success Response (200) - **image_url** (string) - URL of the generated image. - **prompt_tokens** (integer) - Number of tokens used for the prompt. - **image_tokens** (integer) - Number of tokens used for the image generation. #### Response Example ```json { "image_url": "https://example.com/generated_image.png", "prompt_tokens": 10, "image_tokens": 50 } ``` ``` -------------------------------- ### Generate Image with Pixellab Python Client Source: https://api.pixellab.ai/v1/docs Demonstrates how to use the Pixellab Python client to generate a pixel art image. It requires an API token for authentication and takes a text description and image dimensions as input. The generated image can be accessed via the response object. ```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() ``` -------------------------------- ### POST /v1/animate-with-text Source: https://api.pixellab.ai/v1/docs Creates a pixel art animation based on a text description and various parameters. Supports features like inpainting, init image, and forced palette. ```APIDOC ## POST /v1/animate-with-text ### Description Creates a pixel art animation based on text description and parameters. Supported image sizes are 64x64. Features include text-guided animation generation, inpainting, init image, forced palette, and multiple frames. ### Method POST ### Endpoint /v1/animate-with-text ### Parameters #### Query Parameters None #### Request Body - **action** (string) - Required - Action description - **description** (string) - Required - Character description - **image_size** (object) - Required - Example: `{"height":64,"width":64}` - **height** (integer) - Required - **width** (integer) - Required - **reference_image** (object) - Required - Base64 encoded reference image - **type** (string) - Required - Must be "base64" - **base64** (string) - Required - The base64 encoded image data - **color_image** (object) - Optional - A base64 encoded image. - **type** (string) - Required - Must be "base64" - **base64** (string) - Required - The base64 encoded image data - **direction** (string) - Optional - Subject direction. Enum: `north`, `north-east`, `east`, `south-east`, `south`, `south-west`, `west`, `north-west`. Default: `east` - **image_guidance_scale** (number) - Optional - How closely to follow the reference image. Min: 1, Max: 20. Default: 1.4 - **init_image_strength** (integer) - Optional - Strength of the initial image influence. Min: 1, Max: 999. Default: 300 - **init_images** (array) - Optional - Initial images to start the generation from. Each element is a Base64Image object. - **inpainting_images** (array) - Optional - Existing animation frames to guide the generation. - **mask_images** (array) - Optional - Inpainting / mask image (black and white image, where the white is where the model should inpaint). - **n_frames** (integer) - Optional - Length of full animation. Min: 2, Max: 20. Default: 4 ### Request Example ```json { "action": "walk", "description": "human mage", "direction": "south", "image_size": { "height": 64, "width": 64 }, "view": "side", "reference_image": { "type": "base64", "base64": "data:image/png;base64,YOUR_BASE64_ENCODED_IMAGE" } } ``` ### Response #### Success Response (200) - **images** (array) - Array of generated animation frames. - **type** (string) - Type of image encoding, e.g., "base64". - **base64** (string) - Base64 encoded image data. - **usage** (object) - Usage details. - **type** (string) - Type of usage, e.g., "credits". - **credits** (integer) - Number of credits used. #### Response Example ```json { "images": [ { "type": "base64", "base64": "data:image/png;base64,..." }, { "type": "base64", "base64": "data:image/png;base64,..." }, { "type": "base64", "base64": "data:image/png;base64,..." }, { "type": "base64", "base64": "data:image/png;base64,..." } ], "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses - **401**: Invalid API token - **402**: Insufficient credits - **422**: Validation error - **429**: Too many requests - **529**: Rate limit exceeded ``` -------------------------------- ### Authenticate API Requests (cURL) Source: https://api.pixellab.ai/v1/docs Demonstrates how to authenticate API requests using a Bearer token. This is required for all API interactions to verify the user's identity and permissions. ```shell curl -X POST https://api.pixellab.ai/v1/generate-image-pixflux \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "description": "cute dragon", "image_size": {"width": 128, "height": 128} }' ``` -------------------------------- ### Generate Animation with Skeleton using Python Client Source: https://api.pixellab.ai/v1/docs This Python code snippet demonstrates how to use the pixellab client to generate a pixel art animation with skeletons. It requires the pixellab library and an API token. The function takes parameters like view, direction, image size, reference image, inpainting images, mask images, and skeleton keypoints, returning a list of PIL images. ```python import pixellab client = pixellab.Client(secret="YOUR_API_TOKEN") response = client.animate_with_skeleton( view="side", direction="south", image_size=dict(width=64, height=64), reference_image=reference_image, inpainting_images=existing_animation_frames, mask_images=mask_images, skeleton_keypoints=skeleton_keypoints, ) images = [image.pil_image() for image in response.images] ``` -------------------------------- ### Generate Image Bitforge Source: https://api.pixellab.ai/v1/docs Applies custom art styles to generated pixel art using reference images. ```APIDOC ## POST /generate-image-bitforge ### Description Generates pixel art by applying custom art styles using reference images. ### Method POST ### Endpoint https://api.pixellab.ai/v1/generate-image-bitforge ### Parameters #### Query Parameters None #### Request Body - **description** (string) - Required - A text description of the pixel art to generate. - **style_reference** (string) - Required - The URL or identifier of the reference image for the art style. - **image_size** (object) - Optional - An object specifying the dimensions of the image. - **width** (integer) - Required - The desired width of the image. - **height** (integer) - Required - The desired height of the image. ### Request Example ```json { "description": "cyberpunk city", "style_reference": "https://api.pixellab.ai/v1/styles/cyberpunk.png", "image_size": {"width": 256, "height": 256} } ``` ### Response #### Success Response (200) - **image_url** (string) - The URL of the generated pixel art image with the applied style. #### Response Example ```json { "image_url": "https://api.pixellab.ai/v1/images/generated/cyberpunk_city_256x256.png" } ``` ``` -------------------------------- ### Rotate Image using Pixellab Python Client Source: https://api.pixellab.ai/v1/docs Demonstrates how to rotate a pixel art image using the Pixellab Python client. Requires the pixellab library and an API token. Takes image data and rotation parameters as input, returning a rotated image. ```python import pixellab client = pixellab.Client(secret="YOUR_API_TOKEN") response = client.rotate( from_view="side", to_view="side", from_direction="south", to_direction="east", image_size=dict(width=16, height=16), from_image=image_of_subject_facing_south, ) response.image.pil_image() ``` -------------------------------- ### POST /inpaint Source: https://api.pixellab.ai/v1/docs Creates a pixel art image based on the provided parameters. Supports inpainting, init image, forced palette, and transparent background. Maximum image area is 200x200. ```APIDOC ## POST /inpaint ### Description 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. ### Method POST ### Endpoint https://api.pixellab.ai/v1/inpaint ### Parameters #### Query Parameters None #### Request Body - **description** (string) - Required - Text description of the image to generate - **image_size** (object) - Required - Image size configuration. Example: `{"height":128,"width":128}` - **height** (integer) - Required - **width** (integer) - Required - **inpainting_image** (object) - Required - Reference image which is inpainted. Must be a Base64Image object. - **mask_image** (object) - Required - Inpainting / mask image. (black and white image, where the white is where the model should inpaint). Must be a Base64Image object. - **color_image** (object) - Optional - A base64 encoded image. - **detail** (string) - Optional - Detail style reference. Enum: `low detail`, `medium detail`, `highly detailed` - **direction** (string) - Optional - Subject direction. Enum: `north`, `north-east`, `east`, `south-east`, `south`, `south-west`, `west`, `north-west` - **extra_guidance_scale** (number) - Optional - Extra guidance scale. Min: 0, Max: 20, Default: 3 (Deprecated) - **init_image** (object) - Optional - A base64 encoded image. - **init_image_strength** (integer) - Optional - Strength of the initial image influence. Min: 1, Max: 999, Default: 300 - **isometric** (boolean) - Optional - Generate in isometric view. Default: false - **negative_description** (string) - Optional - Text description of what to avoid in the generated image ### Request Example ```json { "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true } ``` ### Response #### Success Response (200) - **image** (object) - The generated image in base64 format. - **type** (string) - Always "base64" - **base64** (string) - The base64 encoded image data - **usage** (object) - Information about the usage credits. - **type** (string) - Type of usage, e.g., "credits" - **credits** (integer) - Number of credits used #### Response Example ```json { "image": { "type": "base64", "base64": "data:image/png;base64,..." }, "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses - **401** - Invalid API token - **402** - Insufficient credits - **422** - Validation error - **429** - Too many requests - **529** - Rate limit exceeded ``` -------------------------------- ### Generate Animation with Text (Python) Source: https://api.pixellab.ai/v1/docs Uses the Pixellab Python client to create a pixel art animation based on a text description, action, and other parameters. Requires a Pixellab client initialized with an API token. ```python import pixellab client = pixellab.Client(secret="YOUR_API_TOKEN") response = client.animate_with_text( description="human mage", action="walk", view="side", direction="south", image_size=dict(width=64, height=64), reference_image=reference_image, n_frames=4 ) images = [image.pil_image() for image in response.images] ``` -------------------------------- ### Generate Image with Pixflux (Python Client) Source: https://api.pixellab.ai/v1/docs Uses the Python client library to generate a pixel art image from a text description. Requires an API token for authentication and specifies the desired image dimensions. ```python import pixellab client = pixellab.Client(secret="YOUR_API_TOKEN") client.generate_image_pixflux( description="cute dragon", image_size=dict(width=128, height=128), ) ``` -------------------------------- ### POST /generate-image-bitforge Source: https://api.pixellab.ai/v1/docs Generates a pixel art image based on the provided parameters. Supports style image, inpainting, init image, forced palette, and transparent background. Maximum image area is 200x200. ```APIDOC ## POST /generate-image-bitforge ### Description Generates a pixel art image based on the provided parameters. Supports style image, inpainting, init image, forced palette, and transparent background. Maximum image area is 200x200. ### Method POST ### Endpoint /v1/generate-image-bitforge ### Parameters #### Query Parameters None #### Request Body - **description** (string) - Required - Text description of the image to generate. - **image_size** (object) - Required - Specifies the dimensions of the image. Example: `{"height":128,"width":128}`. - **height** (integer) - Required - The height of the image. - **width** (integer) - Required - The width of the image. - **color_image** (object) - Optional - A base64 encoded image to use as a color reference. - **type** (Literal["base64"]) - Required - Always "base64" to indicate the image encoding type. - **base64** (string) - Required - The base64 encoded image data. - **coverage_percentage** (number) - Optional - Percentage of the canvas to cover (0-100). - **detail** (string) - Optional - Detail style reference. Enum: `low detail`, `medium detail`, `highly detailed`. - **direction** (string) - Optional - Subject direction. Enum: `north`, `north-east`, `east`, `south-east`, `south`, `south-west`, `west`, `north-west`. - **extra_guidance_scale** (number) - Optional - (Deprecated) Guidance scale for extra details (0-20). - **init_image** (object) - Optional - A base64 encoded image to use as an initial image. - **type** (Literal["base64"]) - Required - Always "base64" to indicate the image encoding type. - **base64** (string) - Required - The base64 encoded image data. - **init_image_strength** (integer) - Optional - Strength of the initial image influence (1-999). - **inpainting_image** (object) - Optional - A base64 encoded image for inpainting. - **type** (Literal["base64"]) - Required - Always "base64" to indicate the image encoding type. - **base64** (string) - Required - The base64 encoded image data. - **isometric** (boolean) - Optional - Generate in isometric view (default: false). - **mask_image** (object) - Optional - A base64 encoded image to use as a mask. - **type** (Literal["base64"]) - Required - Always "base64" to indicate the image encoding type. - **base64** (string) - Required - The base64 encoded image data. ### Request Example ```json { "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true, "style_guidance_scale": 3, "style_strength": 20, "text_guidance_scale": 3 } ``` ### Response #### Success Response (200) - **image** (object) - Contains the generated image. - **type** (string) - Type of the image encoding (e.g., "base64"). - **base64** (string) - The base64 encoded image data. - **usage** (object) - Information about the usage of the API. - **type** (string) - Type of usage (e.g., "credits"). - **credits** (integer) - Number of credits consumed. #### Response Example ```json { "image": { "type": "base64", "base64": "data:image/png;base64,..." }, "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses - **401**: Invalid API token. - **402**: Insufficient credits. - **422**: Validation error. - **429**: Too many requests. - **529**: Rate limit exceeded. ``` -------------------------------- ### Generate Animation with Text (cURL) Source: https://api.pixellab.ai/v1/docs Demonstrates how to generate a pixel art animation using the Pixellab AI API via a cURL request. This method requires specifying the API endpoint, HTTP method, content type, authorization token, and a JSON payload with animation parameters. ```bash curl https://api.pixellab.ai/v1/animate-with-text \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "action": "walk", "description": "human mage", "direction": "south", "image_size": { "height": 64, "width": 64 }, "view": "side" }' ``` -------------------------------- ### Animate (skeleton) Source: https://api.pixellab.ai/v1/docs Generates 4 frames of animation from provided skeleton poses. ```APIDOC ## POST /animate-skeleton ### Description Generates a 4-frame animation based on provided skeleton poses. ### Method POST ### Endpoint https://api.pixellab.ai/v1/animate-skeleton ### Parameters #### Query Parameters None #### Request Body - **skeleton_poses** (array) - Required - An array of objects, where each object represents a skeleton pose. - **frame** (integer) - Required - The frame number (e.g., 0, 1, 2, 3). - **joints** (array) - Required - An array of joint positions for the pose. - **name** (string) - Required - The name of the joint (e.g., 'head', 'left_arm'). - **x** (integer) - Required - The x-coordinate of the joint. - **y** (integer) - Required - The y-coordinate of the joint. ### Request Example ```json { "skeleton_poses": [ { "frame": 0, "joints": [{"name": "head", "x": 50, "y": 20}, ...] }, { "frame": 1, "joints": [{"name": "head", "x": 55, "y": 25}, ...] } // ... up to 4 frames ] } ``` ### Response #### Success Response (200) - **animation_url** (string) - The URL of the generated animation. #### Response Example ```json { "animation_url": "https://api.pixellab.ai/v1/animations/skeleton_anim.gif" } ``` ``` -------------------------------- ### Send Request using cURL Source: https://api.pixellab.ai/v1/docs This snippet demonstrates how to send a request to the Pixellab AI v1 API using cURL. It includes setting the necessary headers and the JSON request body for image generation. Ensure you replace placeholder values with your actual API key and desired image parameters. ```Shell curl -X POST "https://api.pixellab.ai/v1/generate" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_KEY" -d '{ "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true }' ``` -------------------------------- ### Rotate Image using cURL Source: https://api.pixellab.ai/v1/docs Shows how to rotate a pixel art image using a cURL command. This method requires specifying the API endpoint, request method, headers, and a JSON payload with rotation parameters. It's useful for direct API interaction. ```bash curl https://api.pixellab.ai/v1/rotate \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "description": "cute dragon", "from_direction": "south", "from_view": "side", "image_guidance_scale": 7.5, "image_size": { "height": 128, "width": 128 }, "to_direction": "east", "to_view": "side" }' ``` -------------------------------- ### POST /v1/animate-with-skeleton Source: https://api.pixellab.ai/v1/docs Creates a pixel art animation based on the provided skeleton keypoints and other parameters. This endpoint is useful for generating character animations or sequences. ```APIDOC ## POST /v1/animate-with-skeleton ### Description Creates a pixel art animation based on the provided skeleton keypoints and other parameters. This endpoint is useful for generating character animations or sequences. ### Method POST ### Endpoint /v1/animate-with-skeleton ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **image_size** (object) - Required - Specifies the dimensions of the generated image. Example: `{"height":128,"width":128}` - **height** (integer) - Required - **width** (integer) - Required - **reference_image** (object) - Required - A reference image to guide the animation. - **color_image** (object) - Optional - A base64 encoded image to influence the color palette. - **type** (Literal["base64"]) - Always "base64" to indicate the image encoding type. - **base64** (str) - The base64 encoded image data. - **direction** (string) - Optional - The direction of the subject in the animation. Enum: `north`, `north-east`, `east`, `south-east`, `south`, `south-west`, `west`, `north-west`. Default: `east`. - **guidance_scale** (number) - Optional - How closely to follow the reference image and skeleton keypoints. Min: 1, Max: 20. Default: 4. - **init_image_strength** (integer) - Optional - Strength of the initial image influence. Min: 1, Max: 999. Default: 300. - **init_images** (array) - Optional - Initial images to start the generation from. Each element should be a Base64Image object. - **inpainting_images** (array) - Optional - Images used for showing the model with connected skeleton. - **isometric** (boolean) - Optional - Generate in isometric view. Default: `false`. - **mask_images** (array) - Optional - Inpainting / mask image (black and white image, where the white is where the model should inpaint). - **oblique_projection** (boolean) - Optional - Generate in oblique projection. Default: `false`. - **seed** (integer) - Optional - Seed decides the starting noise. ### Request Example ```json { "image_size": { "height": 64, "width": 64 }, "reference_image": { "type": "base64", "base64": "..." }, "inpainting_images": [ { "type": "base64", "base64": "..." } ], "mask_images": [ { "type": "base64", "base64": "..." } ], "skeleton_keypoints": [ { "x": 10, "y": 20, "name": "left_shoulder" } ] } ``` ### Response #### Success Response (200) - **images** (array) - An array of generated images in base64 format. - **type** (string) - Always "base64". - **base64** (string) - The base64 encoded image data. - **usage** (object) - Information about the usage of the API. - **type** (string) - The type of usage, e.g., "credits". - **credits** (integer) - The number of credits consumed. #### Response Example ```json { "images": [ { "type": "base64", "base64": "data:image/png;base64,..." } ], "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses - **401** - Invalid API token - **402** - Insufficient credits - **422** - Validation error - **429** - Too many requests - **529** - Rate limit exceeded ``` -------------------------------- ### Inpaint Image using cURL Source: https://api.pixellab.ai/v1/docs Creates an inpainted image via a POST request to the Pixellab API using cURL. Requires a JSON payload with description, image size, and optionally other parameters like 'no_background'. ```shell curl https://api.pixellab.ai/v1/inpaint \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true }' ``` -------------------------------- ### Animate (text) Source: https://api.pixellab.ai/v1/docs Generates an animation from text descriptions. ```APIDOC ## POST /animate-text ### Description Generates an animation based on a text description. ### Method POST ### Endpoint https://api.pixellab.ai/v1/animate-text ### Parameters #### Query Parameters None #### Request Body - **description** (string) - Required - A text description of the animation to generate. - **duration_seconds** (integer) - Optional - The desired duration of the animation in seconds. ### Request Example ```json { "description": "a ball bouncing", "duration_seconds": 5 } ``` ### Response #### Success Response (200) - **animation_url** (string) - The URL of the generated animation. #### Response Example ```json { "animation_url": "https://api.pixellab.ai/v1/animations/bouncing_ball.gif" } ``` ``` -------------------------------- ### Generate Image Pixflux Source: https://api.pixellab.ai/v1/docs Generates pixel art images from text descriptions. Supports specifying image dimensions. ```APIDOC ## POST /generate-image-pixflux ### Description Generates pixel art from text descriptions. You can specify the desired image size. ### Method POST ### Endpoint https://api.pixellab.ai/v1/generate-image-pixflux ### Parameters #### Query Parameters None #### Request Body - **description** (string) - Required - A text description of the pixel art to generate. - **image_size** (object) - Required - An object specifying the dimensions of the image. - **width** (integer) - Required - The desired width of the image. - **height** (integer) - Required - The desired height of the image. ### Request Example ```json { "description": "cute dragon", "image_size": {"width": 128, "height": 128} } ``` ### Response #### Success Response (200) - **image_url** (string) - The URL of the generated pixel art image. #### Response Example ```json { "image_url": "https://api.pixellab.ai/v1/images/generated/dragon_128x128.png" } ``` ``` -------------------------------- ### POST /v1/generate-image-pixflux Source: https://api.pixellab.ai/v1/docs Creates a pixel art image based on the provided parameters. Supported image sizes range from 32x32 to 400x400. ```APIDOC ## POST /v1/generate-image-pixflux ### Description Creates a pixel art image based on the provided parameters. Supported image sizes range from 32x32 to 400x400. This endpoint supports features like init image, forced palette, and transparent background. ### Method POST ### Endpoint /v1/generate-image-pixflux ### Parameters #### Query Parameters None #### Request Body - **description** (string) - Required - Text description of the image to generate. - **image_size** (object) - Required - Specifies the dimensions of the image. - **height** (integer) - Required - The height of the image. - **width** (integer) - Required - The width of the image. - **color_image** (object) - Optional - A base64 encoded image to influence the generation. - **type** (Literal["base64"]) - Required - Always "base64" to indicate the image encoding type. - **base64** (string) - Required - The base64 encoded image data. - **detail** (string) - Optional - Detail style reference (weakly guiding). Enum: low detail, medium detail, highly detailed. - **direction** (string) - Optional - Subject direction (weakly guiding). Enum: north, north-east, east, south-east, south, south-west, west, north-west. - **init_image** (object) - Optional - A base64 encoded image to use as an initial image. - **type** (Literal["base64"]) - Required - Always "base64" to indicate the image encoding type. - **base64** (string) - Required - The base64 encoded image data. - **init_image_strength** (integer) - Optional - Strength of the initial image influence. Min: 1, Max: 999, Default: 300. - **isometric** (boolean) - Optional - Generate in isometric view (weakly guiding). Default: false. - **negative_description** (string) - Optional - Deprecated. Use for negative prompts. - **no_background** (boolean) - Optional - Generate with transparent background. Default: false. - **outline** (string) - Optional - Outline style reference (weakly guiding). Enum: single color black outline, single color outline, selective outline, lineless. - **seed** (integer) - Optional - Seed decides the starting noise. ### Request Example ```json { "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true } ``` ### Response #### Success Response (200) - **image** (object) - The generated image. - **type** (string) - Type of the image encoding, e.g., "base64". - **base64** (string) - The base64 encoded image data. - **usage** (object) - Information about credit usage. - **type** (string) - Type of usage, e.g., "credits". - **credits** (integer) - The number of credits consumed. #### Response Example ```json { "image": { "type": "base64", "base64": "data:image/png;base64,..." }, "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses - **401**: Invalid API token. - **402**: Insufficient credits. - **422**: Validation error. - **429**: Too many requests. - **529**: Rate limit exceeded. ``` -------------------------------- ### Inpaint Image with Python Client Source: https://api.pixellab.ai/v1/docs Generates an inpainted image using the Pixellab Python client. Requires a description, image size, inpainting image, and mask image. Supports features like init image, forced palette, and transparent background. Maximum image area is 200x200. ```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() ``` -------------------------------- ### Inpaint Source: https://api.pixellab.ai/v1/docs Edits and modifies existing pixel art images. ```APIDOC ## POST /inpaint ### Description Edits and modifies existing pixel art images by filling in masked areas. ### Method POST ### Endpoint https://api.pixellab.ai/v1/inpaint ### Parameters #### Query Parameters None #### Request Body - **image_url** (string) - Required - The URL of the pixel art image to edit. - **mask_url** (string) - Required - The URL of a mask image. White areas indicate where to inpaint. - **prompt** (string) - Optional - A text prompt to guide the inpainting process. ### Request Example ```json { "image_url": "https://api.pixellab.ai/v1/images/original/my_art.png", "mask_url": "https://api.pixellab.ai/v1/masks/edit_area.png", "prompt": "add a hat" } ``` ### Response #### Success Response (200) - **edited_image_url** (string) - The URL of the edited pixel art image. #### Response Example ```json { "edited_image_url": "https://api.pixellab.ai/v1/images/edited/my_art_inpainted.png" } ``` ``` -------------------------------- ### Estimate Skeleton Source: https://api.pixellab.ai/v1/docs Estimates the skeleton of a character from an image, returning keypoints for animation. Supports various image sizes. ```APIDOC ## POST /estimate-skeleton ### Description Estimates the skeleton of a character from an image, returning a list of keypoints to use with the skeleton animation tool. Supported image sizes include 16x16, 32x32, 64x64, 128x128, and 256x256. ### Method POST ### Endpoint /v1/estimate-skeleton ### Parameters #### Request Body - **image** (object) - Required - Image for which to estimate the skeleton. Must be a Base64 encoded image. - **type** (string) - Required - Specifies the image type, should be "base64". - **base64** (string) - Required - The Base64 encoded image data. ### Request Example ```json { "image": { "type": "base64", "base64": "data:image/png;base64,..." } } ``` ### Response #### Success Response (200) - **image** (object) - The processed image object. - **type** (string) - The type of the image, e.g., "base64". - **base64** (string) - The Base64 encoded image data. - **usage** (object) - Information about the usage of the API. - **type** (string) - The type of usage, e.g., "credits". - **credits** (integer) - The number of credits consumed. #### Response Example ```json { "image": { "type": "base64", "base64": "data:image/png;base64,..." }, "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses - **401**: Invalid API token. - **402**: Insufficient credits. - **422**: Validation error. - **429**: Too many requests. - **529**: Rate limit exceeded. ``` -------------------------------- ### Generate Pixel Art Image with Python Client Source: https://api.pixellab.ai/v1/docs Generates a pixel art image using the Pixellab Python client. Requires a secret API token for authentication. The function accepts a text description and image dimensions, returning a PIL image object. ```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() ``` -------------------------------- ### Generate Pixel Art Image with cURL Source: https://api.pixellab.ai/v1/docs Generates a pixel art image using a cURL command. This method requires the API endpoint, POST method, content type, authorization token, and a JSON payload containing the image description and size. It supports various optional parameters for style and guidance. ```shell curl https://api.pixellab.ai/v1/generate-image-bitforge \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --data '{ "description": "cute dragon", "image_size": { "height": 128, "width": 128 }, "no_background": true, "style_guidance_scale": 3, "style_strength": 20, "text_guidance_scale": 3 }' ``` -------------------------------- ### Inpaint Operations Source: https://api.pixellab.ai/v1/docs Handles inpainting operations on pixel art images. ```APIDOC ## POST /v1/inpaint ### Description Performs inpainting operations on a pixel art image. This endpoint allows for targeted modifications or additions to existing images based on provided masks and prompts. ### Method POST ### Endpoint /v1/inpaint ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body *Details for the inpaint request body are not fully specified in the provided text but would typically include parameters such as:* - **image** (Base64Image) - Required - The base image to perform inpainting on. - **mask_image** (Base64Image) - Required - A mask defining the area to be inpainted. - **prompt** (string) - Optional - A text prompt to guide the inpainting process. - **image_size** (ImageSize) - Optional - The desired output image size. ### Request Example *Example request body structure (specific fields may vary):* ```json { "image": { "type": "base64", "base64": "..." }, "mask_image": { "type": "base64", "base64": "..." }, "prompt": "Add a small tree here" } ``` ### Response #### Success Response (200) - **image** (object) - Contains the inpainted image data. - **type** (string) - Type of image encoding, e.g., `base64`. - **base64** (string) - The base64 encoded image data. - **usage** (object) - Information about credit usage. - **type** (string) - Type of usage, e.g., `credits`. - **credits** (integer) - Number of credits consumed. #### Response Example ```json { "image": { "type": "base64", "base64": "data:image/png;base64,new_inpainted_image_data..." }, "usage": { "type": "credits", "credits": 1 } } ``` #### Error Responses *Error responses for inpaint are expected to be similar to the rotate endpoint, including:* - **401**: Invalid API token. - **402**: Insufficient credits. - **422**: Validation error. - **429**: Too many requests. - **529**: Rate limit exceeded. ``` -------------------------------- ### Animation Operations Source: https://api.pixellab.ai/v1/docs Provides endpoints for various animation operations, including animating with a skeleton, animating with text, and estimating skeleton data. ```APIDOC ## Animation Operations ### Description Provides endpoints for various animation operations, including animating with a skeleton, animating with text, and estimating skeleton data. ### Endpoints - **POST /animate-with-skeleton**: Animates a sequence using a provided skeleton. - **POST /animate-with-text**: Animates a sequence based on a text description. - **POST /estimate-skeleton**: Estimates skeleton data from an input. ```