Blog

Character Generator AI: Consistent Characters via API (2026)

Unicorn API Team · · 12 min read

Character generator AI workflow from a character sheet to a reference portrait to the same character in three scenes

A character generator AI turns a short idea into a usable character: a name, a personality, a backstory and, most of the time, a picture of what they look like. Typing a prompt into a free web tool gets you a nice portrait. The hard part comes next. You need the same character, with the same face, hair and outfit, in the second, tenth and hundredth image. This guide covers both halves. First, how to write a description an image model can actually follow. Second, how to generate a reference portrait and reuse it across scenes, with working code and real per-image costs.

What does a character generator AI do?

Most tools sold as a character generator AI do one or both of two jobs:

  • Writing the character. A language model expands a one-line idea (“grumpy dwarf blacksmith who secretly writes poetry”) into a profile: appearance, personality traits, motivations, flaws and a backstory. Perchance’s AI character description generator and similar writing tools focus on this.
  • Drawing the character. A text-to-image model (a model that takes a natural-language prompt and produces a matching image) renders the character as art: anime, painterly, 3D, pixel art or photorealistic.

The better tools add a third job: keeping the character consistent. That depends on two kinds of models. An image-to-image or edit model takes an existing picture plus a prompt and produces a changed version. A model with reference images takes one or more pictures as a guide for what the subject should look like. Without one of these, every new prompt rolls the dice again, and your hero’s face changes between panels.

Free browser tools handle the first two jobs well for one-off use. You outgrow them when you need volume, control over resolution and aspect ratio, a character that stays the same across a whole comic or game, or generation inside your own product. At that point you want an API. Unicorn API gives you one key and one bill for several image models from Google, OpenAI, Black Forest Labs and ByteDance, so you can pick the right model for each step instead of committing to one.

Common uses

  • Original characters (OCs) for fiction, webcomics and fan work
  • NPCs (non-player characters), villains and party members for D&D and other tabletop RPGs
  • Game sprites, portraits and concept art
  • Brand mascots and storybook characters that must look identical on every page
  • Avatars and personas for chat apps and companion products

How to write a character description an image model can use

A good character description for a story is not the same as a good character description for an image model. Prose like “her eyes carried the weight of a hundred lost battles” reads well, but an image model cannot draw it reliably. What it can draw is “tired grey eyes, faint crow’s feet, a thin scar through the left eyebrow”.

The fix is to split the character into two parts:

  • Fixed traits never change: face shape, skin tone, eye colour, hair colour and style, distinguishing marks, body type, signature outfit and colour palette, and art style.
  • Variable traits change per image: pose, expression, scene, lighting, camera angle and props.

Write the fixed traits once, as short concrete phrases, and paste them into every prompt word for word. This one habit does more for consistency than any model setting.

Diagram separating fixed character traits from variable scene details in an image prompt
Keep the fixed traits word-for-word in every prompt and change only the variable ones.

A character sheet template

Here is a character sheet in a format that works for both a human writer and an image prompt:

{
  "name": "Mara Venn",
  "role": "smuggler captain, reluctant hero",
  "personality": ["dry humour", "fiercely loyal", "distrusts nobles"],
  "backstory": "Grew up on the harbour docks; lost her ship to a debt she still owes.",
  "fixed_look": "woman in her mid-thirties, olive skin, short black hair shaved on one side, grey eyes, thin scar through left eyebrow, long dark-green wool coat with brass buttons, fingerless leather gloves",
  "style": "painterly fantasy illustration, muted colours, soft rim light"
}

Only fixed_look and style go into image prompts. Personality and backstory stay in the text sheet, though they can guide expression and pose (“smirking, arms crossed” suits dry humour). If you use a Perchance-style description generator for the writing step, copy its output into this structure and rewrite any vague phrases into visible facts.

Turning the sheet into a prompt

For the first reference image, ask for a neutral, well-lit portrait with nothing hiding the face:

Character reference portrait, front view, shoulders up, neutral expression,
plain light-grey background. Woman in her mid-thirties, olive skin, short
black hair shaved on one side, grey eyes, thin scar through left eyebrow,
long dark-green wool coat with brass buttons. Painterly fantasy
illustration, muted colours, soft rim light.

A plain background and a neutral pose give the edit models a clean subject to work from later. Dramatic lighting and action poses belong in the scene images, not the reference.

Which models work best for a character generator AI?

No single model is best at every step. A practical character generator AI uses a cheap, fast model for drafts and an edit or reference-capable model for consistent scenes. Here are the image models on Unicorn API that fit this workflow, with prices in credits per image:

ModelRole in the pipelineCharacter inputCredits per image
Flux 3 Klein Text to ImageCheap reference drafts; seed for repeatable resultsText only1.6 (1K), 2.5 (2K), 6.5 (4K)
Flux 3 Klein Edit ImagePlacing the reference in new scenesimage_urls1.6 (1K), 2.5 (2K), 6.5 (4K)
Nano Banana 2 LiteFast 1K images and edits from several angles of the same characterUp to 10 ref_images4
Nano Banana 2.1Final art at higher resolutionimage_input4 (1K), 6 (2K), 9 (4K)
GPT Image 1.5Mascots with legible text, sprites with transparent backgroundsUp to 4 ref_images3 (low), 4 (medium), 22 (high)
Seedream 5.0 Flash Text To ImageAlternative look for drafts, flat price up to 2KText only3.24
Seedream 5.0 Flash Image to ImageRestyling a sketch or photo into a characterimage_urls3.24

Credits are charged per output and rounded up to whole credits per request. A single 1K Flux 3 Klein image therefore bills 2 credits, while four in one request (6.4) bill 7. Monthly plans price credits at $0.01 each, so a 1K Flux draft costs about two cents.

How to choose

  • Tight budget, lots of iterations: Flux 3 Klein for both drafts and scenes. The text-to-image and edit versions cost the same, which keeps the maths simple.
  • Several reference angles: Nano Banana 2 Lite takes up to 10 reference images. You can pass a front view, a side view and a full-body shot together, which helps when scenes show the character from unusual angles. The Nano Banana API guide covers the model family in more detail.
  • Mascots, logos and sprites: GPT Image 1.5 handles legible text well and can output a transparent background, so a mascot holding a sign or a game sprite drops straight into a layout.
  • Print-size final art: Nano Banana 2.1 or Flux 3 Klein at 4K, after the design is locked.

You can try any of these in the browser at the image studio before writing code, or browse the full model catalog.

Building a character generator AI with Unicorn API

The pipeline has four steps: write the sheet, generate candidate portraits, pick one as the reference, then generate scenes from that reference. Create a key at the API keys page and export it as UNICORN_API_KEY.

One request with curl

Every media model uses the same two endpoints. You create a job, then poll it until it finishes:

curl https://api.unicornapi.net/v1/jobs \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"flux-3-klein-text-to-image","input":{"prompt":"Character reference portrait, front view, shoulders up, neutral expression, plain light-grey background. Woman in her mid-thirties, olive skin, short black hair shaved on one side, grey eyes, thin scar through left eyebrow, long dark-green wool coat with brass buttons. Painterly fantasy illustration.","resolution":"1K","seed":1234}}'

# Then poll with the id from the response until status is "succeeded"
curl https://api.unicornapi.net/v1/jobs/JOB_ID \
  -H "Authorization: Bearer $UNICORN_API_KEY"

When the status is "succeeded", the image is at outputs[0].url.

The full pipeline in Python

This script generates four candidate references, uses the first one (in practice you would pick the best by eye), and then renders three scenes from it:

import os
import time
import requests

API = "https://api.unicornapi.net"
HEADERS = {"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}"}

FIXED_LOOK = (
    "woman in her mid-thirties, olive skin, short black hair shaved on one side, "
    "grey eyes, thin scar through left eyebrow, long dark-green wool coat with "
    "brass buttons, fingerless leather gloves"
)
STYLE = "painterly fantasy illustration, muted colours, soft rim light"


def run(model, input, timeout=300):
    """Create a job, poll until it finishes, return the output URLs."""
    r = requests.post(f"{API}/v1/jobs", headers=HEADERS,
                      json={"model": model, "input": input})
    r.raise_for_status()
    job = r.json()
    deadline = time.time() + timeout
    while job["status"] != "succeeded":
        if job["status"] in ("failed", "canceled", "cancelled"):
            raise RuntimeError(f"Job {job['id']} ended with status {job['status']}")
        if time.time() > deadline:
            raise TimeoutError(f"Job {job['id']} still {job['status']}")
        time.sleep(2)
        r = requests.get(f"{API}/v1/jobs/{job['id']}", headers=HEADERS)
        r.raise_for_status()
        job = r.json()
    return [o["url"] for o in job["outputs"]]


# Step 1: four candidate reference portraits (4 x 1.6 = 6.4, billed 7 credits)
candidates = run("flux-3-klein-text-to-image", {
    "prompt": (
        "Character reference portrait, front view, shoulders up, neutral "
        f"expression, plain light-grey background. {FIXED_LOOK}. {STYLE}."
    ),
    "num_images": 4,
    "resolution": "1K",
    "seed": 1234,
})
print("Candidates:", candidates)

# Step 2: choose the reference (here simply the first one)
reference = candidates[0]

# Step 3: scenes, each generated from the ORIGINAL reference
scenes = [
    "standing on a rainy harbour dock at night, holding a lantern, determined expression",
    "sitting at a crowded tavern table, smirking, arms crossed",
    "at the wheel of a small sailing ship in a storm, shouting orders",
]
for scene in scenes:
    url = run("flux-3-klein-edit-image", {
        "prompt": (
            f"The same woman from the reference image: {FIXED_LOOK}. "
            f"She is {scene}. Keep her face, hair, scar and coat unchanged. {STYLE}."
        ),
        "image_urls": [reference],
        "resolution": "2K",
    })[0]
    print(scene, "->", url)

Save the chosen reference somewhere you control, such as your own storage bucket, so it stays available for every future scene. Before a large batch, you can get the exact price of any request with POST /v1/models/price. The API documentation lists the request body and all input fields.

Adding the writing step

If you want the API to write the character sheet too, call the OpenAI-compatible chat endpoint with any chat model from the catalog. Ask for JSON in the template above so your code can lift out fixed_look directly:

def describe(idea):
    r = requests.post(f"{API}/v1/chat/completions", headers=HEADERS, json={
        "model": os.environ["CHAT_MODEL"],  # any chat model id from /models
        "messages": [
            {"role": "system", "content": (
                "Write a character sheet as JSON with keys name, role, personality, "
                "backstory, fixed_look, style. fixed_look must list only visible, "
                "concrete physical traits and clothing as short comma-separated phrases."
            )},
            {"role": "user", "content": idea},
        ],
    })
    r.raise_for_status()
    return r.json()["choices"][0]["message"]["content"]

That gives you your own Perchance-style AI character description generator feeding straight into the image step. If you work in Cursor or Claude Code, the MCP setup lets the agent call these models directly.

Four-step pipeline from character sheet to candidate portraits to chosen reference to scene images
Every scene is generated from the original reference, never from the previous scene.

How to keep an AI character consistent across images

Consistency is where most character work fails, and it is the main reason to build your own character generator AI instead of relying on one-shot tools. These techniques stack, so use as many as your project allows.

  1. Always edit from the original reference. If scene 2 is made from scene 1, and scene 3 from scene 2, small changes add up and the face drifts within a few steps. Every scene should take the original reference as input.
  2. Repeat the fixed traits verbatim. The edit model sees the reference, but restating “thin scar through left eyebrow” in the prompt stops it from dropping details the scene would otherwise hide.
  3. Change one thing at a time. A prompt that changes the pose, outfit, lighting and art style all at once gives the model permission to change the face too. Keep the outfit and style fixed unless the story needs a costume change.
  4. Build a turnaround sheet. Generate a front view, three-quarter view, side view and full-body shot from the first reference. Then pass several of them to a multi-reference model like Nano Banana 2 Lite. More angles give the model more to match.
  5. Fix the seed for drafts. A seed is the number that sets the model’s starting noise. The same seed with the same prompt and settings gives a close or identical result, so you can adjust one phrase and see exactly what it changed.
  6. Keep style words identical. “Painterly fantasy illustration” and “fantasy painting” can produce visibly different faces. Pick one style phrase and paste it.

Starting from a photo or sketch

To build a character from an existing picture, such as your own sketch, a 3D blockout or a photo you have rights to, start with an image-to-image model. Seedream 5.0 Flash Image to Image takes image_urls plus a prompt like “redraw this as a painterly fantasy smuggler captain, keep the pose”. The result becomes your reference, and the rest of the pipeline is unchanged. When working from photos of real people, get their consent, and do not create likenesses of people who have not agreed to it.

What does it cost to generate a character?

Because every model prices per image in credits, you can cost a whole character before you start. Here is a worked example for one character with ten scene images:

StepModel and settingCredits
4 reference candidatesFlux 3 Klein Text to Image, 1K, one request7 (6.4 rounded up)
3 turnaround anglesFlux 3 Klein Edit Image, 1K, separate requests6 (2 each)
10 scenesFlux 3 Klein Edit Image, 2K, separate requests30 (3 each)
Total43 credits

On a monthly plan that is $0.43. With top-up credits at $0.015 each it is about $0.65. If the ten scenes instead use GPT Image 1.5 at high quality (22 credits each), the scenes alone come to 220 credits, or $2.20 on a plan. That can be worth it for a mascot whose signage must be legible, but not for rough storyboards. With Nano Banana 2 Lite for the scenes at 4 credits each, they come to 40 credits.

The plans are Starter at $25, Creator at $50, Studio at $100 and Pro at $200 per month, at $0.01 per credit. Top-ups cost $0.015 per credit and never expire, which suits occasional character work. Details are on the pricing page.

Free tools versus an API

A free character generator AI in the browser is the right choice for a handful of portraits or for exploring ideas. An API starts to pay off when you need any of these:

  • The same character in dozens of images
  • Generation inside your own app, game or bot
  • A choice of models for different steps
  • Predictable costs you can check before running a batch

Common mistakes with AI character generators

  • Abstract descriptions. “Mysterious and wise” is not drawable. Translate personality into visible cues: posture, expression, clothing wear, props.
  • Overloaded reference prompts. Busy backgrounds, dramatic shadows and props covering the face make a poor reference. Keep the reference plain and add the drama in scenes.
  • Chained edits. Editing the last output instead of the original reference is the single biggest cause of drift.
  • Too many fixed traits. Twenty distinguishing features compete with each other, and the model drops some at random. Five to eight strong, specific traits hold better than twenty weak ones.
  • Final resolution during exploration. Draft at 1K, where Flux 3 Klein bills 2 credits per single image. Move to 2K or 4K only once the design is locked.
  • Mixing models mid-project. Each model has its own rendering habits. Switching the scene model halfway through a comic changes the look even with the same reference, so pick one per project and stick with it.
  • Ignoring rights. Check the terms for each model you use commercially. Do not build characters from photos of people who have not agreed to it.

Start small. Write one character sheet, generate four Flux 3 Klein candidates for 7 credits, pick a reference and render three scenes. If the face holds across all three, you have a working character generator AI pipeline that scales to a full cast. For more on prompting for lifelike results, see the realistic AI image generator guide.

Frequently asked questions

Is there a free AI character generator?

Yes. Several browser tools let you type a description and get a character portrait or a written profile at no cost, usually with limits on resolution, volume or commercial use. They work well for trying out an idea. If you need hundreds of images, the same character across many scenes, or generation inside your own app, an API is the better fit. On Unicorn API you pay per image in credits, starting at about 2 credits for a 1K image.

How do I keep the same AI character across different images?

Generate one strong reference portrait first. Then make every later image with an edit or reference-capable model that takes that portrait as input. Repeat the same fixed physical descriptors in every prompt, and change only the scene, pose or expression. Always start from the original reference, not the previous edit, because chained edits drift. Models that accept several reference images help even more. Nano Banana 2 Lite accepts up to ten.

Can I make an AI character from a photo?

Yes. Image-to-image and edit models take an existing picture as input and redraw it from your prompt. For example, you can turn a sketch or photo into an anime, painted or 3D version of the character. On Unicorn API, Seedream 5.0 Flash Image to Image and Flux 3 Klein Edit Image accept image URLs this way. Only use photos you have the right to use, and get consent before stylising real people.

What is an AI character description generator?

It is a tool that writes the text side of a character: name, appearance, personality, motivations and backstory, often from a one-line idea. Perchance's AI character description generator is a popular free example. The output is useful on its own for fiction and tabletop games. It works even better as structured input for an image model. Split appearance into fixed visual traits so the image prompt stays consistent from scene to scene.

How much does it cost to generate an AI character with an API?

On Unicorn API it depends on the model and resolution. Flux 3 Klein costs 1.6 credits per 1K image. Seedream 5.0 Flash costs 3.24 credits per image. Nano Banana 2 Lite costs 4 credits, and GPT Image 1.5 costs 3 to 22 credits depending on quality. Totals round up to whole credits. Plan credits cost $0.01 each, so a full character pack with a reference and ten scenes can cost well under a dollar.