# LlamaGen Comic API

## Basic model info

Model name: llamagen/comic-api
Model description: Production API and MCP workflow for generating structured comic pages, consistent characters, scene-aware panels, and downloadable comic assets.
Provider: LlamaGen.AI
Canonical page: https://llamagen.ai/comic-api
Documentation: https://llamagen.ai/comic-api/docs
Markdown reference: https://llamagen.ai/comic-api/llms.txt
Status: Warm
Official: Yes
Commercial use: Outputs can be used in paid products and commercial workflows.
Data privacy: Inputs and outputs are not used for training.
Pricing signal: 150 credits per output comic


## API endpoint

Base URL: https://api.llamagen.ai

Create a comic generation:

```text
POST /v1/comics/generations
```

Authenticate every request with an HTTP Bearer token:

```text
Authorization: Bearer $LLAMAGEN_API_KEY
```


## Model inputs

- prompt (required unless promptUrl is provided): Story, scene, script, or panel-by-panel direction for comic generation (string)
- promptUrl (required unless prompt is provided): Uploaded prompt document, storyboard image, or signed file URL (string, format: uri)
- model (optional): Generation model override. Use "auto" for the default production route (string)
- preset (optional): Style preset id for manga, western comic, cartoon, illustration, or brand-specific looks (string)
- size (optional): Output canvas size. Supported values include 512x512, 768x768, 1024x1024, 1024x1536, 1536x1024, 1024x1792, and 1792x1024 (string)
- fixPanelNum (optional): Single-page panel count from 1 to 20. Do not combine with pagination (integer)
- pagination (optional): Multi-page generation settings with totalPages and panelsPerPage (object)
- comicRoles (optional): Character references for identity, outfit, age, relationship, and visual continuity (array)
- comicLocations (optional): Scene and environment references for stable locations across pages (array)
- characters (optional): Lightweight reusable character references, image URLs, or asset ids (array)
- attachments (optional): Product photos, sketches, brand assets, rough layouts, or visual references (array)
- callbackUrl (optional): Webhook URL for status and asset updates (string, format: uri)
- webhookSecret (optional): Shared secret for verifying webhook signatures (string)
- language (optional): Preferred caption, dialogue, and lettering language (string)
- upscale (optional): Whether to upscale final generated assets when supported (boolean)


## Model output schema

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Generation id used for polling, logs, and support."
    },
    "status": {
      "type": "string",
      "enum": ["QUEUED", "PROCESSING", "PROCESSED", "FAILED", "CANCELLED"]
    },
    "prompt": {
      "type": "string"
    },
    "page": {
      "type": "integer"
    },
    "panel": {
      "type": "integer"
    },
    "pagePrompt": {
      "type": "string"
    },
    "layout": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "assetUrl": {
          "type": "string",
          "format": "uri"
        },
        "panel": {
          "type": "integer"
        },
        "caption": {
          "type": "string"
        },
        "image": {
          "type": "array"
        }
      }
    },
    "error": {
      "type": ["object", "null"],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object"
        }
      }
    }
  }
}
```

If the input or output schema includes a format of URI, it is referring to a file.


## Example inputs and outputs

Use these examples to understand the types of inputs the Comic API accepts and the types of outputs it returns.

### Example: 4-panel story comic

#### Input

```json
{
  "prompt": "A 4-panel comic about Leo, a brave 12-year-old apprentice in an orange wizard robe, finding a glowing key in a quiet library.",
  "size": "1024x1024",
  "fixPanelNum": 4,
  "comicRoles": [
    {
      "name": "Leo",
      "age": 12,
      "personality": "optimistic and brave",
      "catchphrase": "I can do it!",
      "dress": "orange wizard robe"
    }
  ],
  "callbackUrl": "https://example.com/webhooks/comic"
}
```

#### Output

```json
{
  "id": "gen_123456789",
  "status": "PROCESSED",
  "prompt": "A 4-panel comic about Leo finding a glowing key in a quiet library.",
  "page": 0,
  "panel": 2,
  "pagePrompt": "Leo opens the glowing bookcase door with hopeful eyes.",
  "layout": "Layout0",
  "data": {
    "assetUrl": "https://cdn.llamagen.ai/comics/panel-2.webp",
    "panel": 2,
    "caption": "",
    "image": []
  }
}
```


### Example: multi-page production comic

#### Input

```json
{
  "prompt": "Create a product onboarding comic where a small business owner turns customer photos into personalized manga posters.",
  "preset": "clean-commercial-comic",
  "size": "1024x1536",
  "pagination": {
    "totalPages": 2,
    "panelsPerPage": 4
  },
  "comicRoles": [
    {
      "name": "Maya",
      "role": "store owner",
      "dress": "navy apron, white shirt"
    }
  ],
  "comicLocations": [
    {
      "name": "Print studio",
      "description": "warm lights, wall art samples, shipping table"
    }
  ],
  "language": "en"
}
```

#### Output

```json
{
  "id": "gen_multi_page_456",
  "status": "PROCESSED",
  "prompt": "Create a product onboarding comic where a small business owner turns customer photos into personalized manga posters.",
  "page": 1,
  "panel": 3,
  "pagePrompt": "Maya packs the final poster while a happy customer preview appears on screen.",
  "layout": "Layout4",
  "data": {
    "assetUrl": "https://cdn.llamagen.ai/comics/page-1-panel-3.webp",
    "panel": 3,
    "caption": "Ready to ship.",
    "image": []
  }
}
```


### Example: promptUrl and attachments

#### Input

```json
{
  "promptUrl": "https://s.llamagen.ai/workspace/storyboard-brief.pdf",
  "size": "1536x1024",
  "attachments": [
    {
      "type": "product",
      "url": "https://cdn.example.com/products/canvas-print.png"
    },
    {
      "type": "sketch",
      "url": "https://cdn.example.com/sketches/layout-board.png"
    }
  ],
  "upscale": true
}
```

#### Output

```json
{
  "id": "gen_upload_789",
  "status": "PROCESSING",
  "prompt": "Read prompt from https://s.llamagen.ai/workspace/storyboard-brief.pdf",
  "page": 0,
  "panel": 0,
  "pagePrompt": "Opening panel based on uploaded storyboard brief.",
  "layout": "Layout2",
  "data": {
    "assetUrl": "https://cdn.llamagen.ai/comics/preview-page-0.webp",
    "panel": 0,
    "caption": "",
    "image": []
  }
}
```


## Webhook example

```json
{
  "event": "comic.generation.completed",
  "generationId": "gen_123456789",
  "status": "PROCESSED",
  "assetUrl": "https://cdn.llamagen.ai/comics/page-0.webp",
  "createdAt": "2026-06-03T10:30:00.000Z"
}
```


## Error example

```json
{
  "error": {
    "code": "invalid_request",
    "message": "Provide either prompt or promptUrl.",
    "details": {
      "field": "prompt"
    }
  }
}
```


## Model readme

### Overview

LlamaGen Comic API is designed for teams building comic generation directly into products, agents, publishing workflows, ecommerce personalization, education tools, and creative production systems. It turns prompts, uploaded briefs, character references, scene direction, and storyboards into structured comic pages with generated panel assets.

### What makes it useful

- Character consistency: Use comicRoles and characters to preserve identity, outfit, personality, and relationship details across panels.
- Scene structure: Use comicLocations, attachments, and promptUrl to anchor visual settings and production references.
- Storyboard bridge: Convert story briefs into panel-level prompts, layouts, and generated image assets.
- Production workflow: Use callbackUrl and webhooks to send generated assets into approval, print, fulfillment, or publishing systems.
- MCP-ready: Use the full docs to connect agent clients and automate generation workflows.

### Best fit

- Product and engineering teams adding comic generation to an app
- Ecommerce personalization and custom print workflows
- Publishing, education, marketing, and agent applications
- Teams that need repeatable comic output rather than one-off demos

### Implementation tips

- Keep character details stable and explicit.
- Use panel-by-panel direction when layout or story continuity matters.
- Use promptUrl for longer briefs, scripts, reference documents, or visual storyboards.
- Use callbackUrl for production jobs instead of relying only on polling.
- Store the generation id for support, logs, retries, and review workflows.

### Related resources

- Comic API overview: https://llamagen.ai/comic-api
- Comic API docs: https://llamagen.ai/comic-api/docs
- Comic API examples: https://llamagen.ai/comic-api/examples
- Comic API templates: https://llamagen.ai/comic-api/templates
- Comic API skills: https://llamagen.ai/comic-api/skills
- Comic API libraries: https://llamagen.ai/comic-api/resources/libraries
- Comic API pricing: https://llamagen.ai/comic-api/pricing
