AI
Pass

AI Pixel Art Generator — Agent Skill

AI Pixel Art Generator — Agent Skill

Generate retro-style pixel art from text descriptions using AI Pass image generation.

Setup

Get your API key: https://aipass.one/panel/developer.html → API Keys

export AIPASS_API_KEY="your-key-here"

Generate Pixel Art

import requests
import os

AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]

def generate_pixel_art(description, style="8-bit"):
    """Generate pixel art from text description.
    
    Args:
        description: What to generate (e.g., "cute cat with big eyes")
        style: Pixel art style (8-bit, 16-bit, modern)
    
    Returns:
        Image URL
    """
    
    style_prompts = {
        "8-bit": "8-bit retro, NES style, simple shapes, 4 colors",
        "16-bit": "16-bit game, SNES style, detailed sprites, limited palette",
        "modern": "modern pixel art, high detail, vibrant colors, crisp pixels"
    }
    
    enhanced_prompt = f"{description}, {style_prompts.get(style, style_prompts['8-bit'])}, pixel art, retro video game style, pixelated, no anti-aliasing"
    
    response = requests.post(
        "https://aipass.one/apikey/v1/images/generations",
        headers={
            "Authorization": f"Bearer {AIPASS_API_KEY}",
            "Content-Type": "application/json"
        },
        json={
            "model": "flux-pro/v1.1",
            "prompt": enhanced_prompt,
            "size": "1024x1024",
            "n": 1
        }
    )
    
    if response.status_code != 200:
        raise Exception(f"Error: {response.text}")
    
    return response.json()["data"][0]["url"]

# Example usage
if __name__ == "__main__":
    url = generate_pixel_art("dragon flying over mountains", "16-bit")
    print(f"Generated: {url}")
    
    # Download
    img_response = requests.get(url)
    with open("pixel-art.png", "wb") as f:
        f.write(img_response.content)

Batch Generation

def generate_batch(descriptions, style="8-bit"):
    """Generate multiple pixel arts."""
    results = {}
    for desc in descriptions:
        print(f"Generating: {desc}...")
        url = generate_pixel_art(desc, style)
        results[desc] = url
    return results

# Usage
items = ["wizard staff", "magic potion", "ancient scroll"]
batch_results = generate_batch(items, "8-bit")

Notes

  • Model: flux-pro/v1.1 (best balance of quality and cost)
  • Size: 1024x1024 (can scale down for true pixel look)
  • Styles: 8-bit, 16-bit, modern
  • Prompt engineering matters — be specific about style