Blog

AI Character Generator from a Photo: Models and Code (2026)

Unicorn API Team · · 11 min read

AI character generator from photo: one portrait turned into anime, 3D cartoon and fantasy characters

An AI character generator from photo input takes a real picture, such as a selfie, a portrait or a snapshot of your dog, and redraws the subject as a stylised character: anime, 3D cartoon, comic book hero, fantasy knight, pixel art or whatever else you describe. The style is the easy part, since almost any modern image model can paint anime. The hard part is keeping the person recognisable while changing nearly everything else about the picture.

This guide covers how these tools work, which image-to-image models handle likeness well, how to prompt them, and how to build your own generator in a few dozen lines of code. It also covers two things most “free AI character generator” pages skip: keeping one character consistent across a whole set of images, and what each image costs.

How does an AI character generator from photo input work?

Most image models today are diffusion models. They start from random noise and remove it step by step until an image matching the instructions appears. A text-to-image model is steered by words alone. An image-to-image model (often called an edit model) also receives one or more pictures, called reference images, and uses them as a guide for identity, pose, colours or layout.

An AI character generator from photo uploads is an image-to-image model paired with a style-heavy prompt. Every tool you have seen, whether it is a mobile app or a web page with an upload button, sends three things:

  • The reference photo. This carries identity: face shape, eye spacing, hairline, skin tone, and distinctive details like freckles, a beard or glasses.
  • The prompt. This carries everything that should change: art style, clothing, setting, mood, framing.
  • The settings. Aspect ratio, resolution, output format and sometimes a seed (a number that makes a result repeatable).

The model then decides, region by region, what to keep from the photo and what to repaint. Good results keep the stable identity cues and replace texture, lighting and rendering. Bad results fail in one of two directions. Either the model copies the photo too faithfully and the “character” looks like a filtered selfie, or it drifts so far that the character no longer resembles anyone in particular.

Text-only versus photo-based character generators

Many pages that rank for “ai character generator” are text-only: you type a description and get an invented character. That suits original characters (OCs) for games, stories and tabletop campaigns, where there is no real person to match. Photo-based generation is what you want for avatars, profile pictures, personalised gifts, or turning a group of friends into a comic cast.

The two approaches combine well. You can invent a character from text, pick the best result, and then use that image as the reference for every picture that follows. From that point on, your own generated image is the “photo”.

Which models work best for turning a photo into a character?

On Unicorn API, six image models accept a reference picture and are a good fit for photo-to-character work. They differ mainly in how many references they take, which resolutions they offer and what they cost. Prices are in credits. On a monthly plan a credit costs $0.01, and every price is rounded up to whole credits per output.

ModelPhoto input fieldPrice per imageUse it when
Flux 3 Klein Edit Imageimage_urls1.6 credits at 1K (billed 2), 2.5 at 2K (billed 3), 6.5 at 4K (billed 7)You want the cheapest drafts, a fixed seed for repeatable results, or batches via num_images
Nano Banana 2 Literef_images (up to 10)4 creditsYou have several photos of the same person, or need fast 1K edits
Nano Banana 2.1image_input4 credits at 1K, 6 at 2K, 9 at 4KYou are rendering a final, high-resolution version
Seedream 5.0 Flash Image to Imageimage_urls3.24 credits at 1K, 1.5K or 2K (billed 4)You want 2K output for the same price as 1K
GPT Image 1.5ref_images (up to 4)3 credits low, 4 medium, 22 high qualityThe image needs legible text, such as a name banner, or a transparent background for stickers
GPT Image 2.6 (Economy) Image to Imageinput_urls5 creditsYou want OpenAI’s newest edit model at a flat price

A practical split: draft on Flux 3 Klein at 1K or Nano Banana 2 Lite until the likeness and style are right, then render the keeper on Nano Banana 2.1 at 2K or 4K. If the character needs a caption, a nameplate or a transparent background for a sticker, GPT Image 1.5 is the safer choice. Its strengths are prompt adherence and readable text, and it offers a transparent background option. If you are weighing Google’s image models against each other, our Imagen 4 vs Nano Banana comparison goes deeper.

Likeness is partly a matter of taste, so the fastest way to choose is to run the same photo and prompt through two or three models in the browser playground and compare them side by side.

Diagram of a photo, a prompt and settings going into an image-to-image model to produce a character
Every photo-to-character tool is the same three inputs feeding an image-to-image model.

How to write a prompt that keeps the likeness

The photo already carries the identity, so the prompt has one main job: describe the transformation clearly without contradicting the photo. A structure that works across models:

  1. Anchor the identity. “The person in the reference photo, same face, same hairstyle, same glasses.”
  2. Name the style precisely. “Anime character, cel shading, clean line art” beats “make it cool”.
  3. Change the wardrobe and setting. “Wearing a silver space suit, standing on a moon base.”
  4. Set the framing. “Head and shoulders portrait, centred, plain background.”
  5. Say what must not change. “Keep the freckles and the scar on the left eyebrow.”

Some starting points you can adapt:

  • Anime: “Turn the person in the reference photo into an anime character. Same face shape, eye colour and hairstyle. Cel shading, clean line art, soft pastel background, head and shoulders portrait.”
  • 3D cartoon: “Redraw the person in the reference photo as a 3D animated film character. Large expressive eyes, soft subsurface skin, studio lighting, keep their glasses and short beard.”
  • Fantasy: “Portray the person in the reference photo as an elven ranger in a misty forest. Painterly fantasy illustration, green cloak, longbow, same face and hair colour.”
  • Pixel art: “Convert the person in the reference photo into a 64x64-style pixel art game sprite, front-facing, limited colour palette, same hairstyle and jacket colour.”

Use a character description as a fixed block

People searching for an “ai character description generator” usually want a written profile of a character they can reuse. That habit pays off here. Look at the photo and write the stable features in short, concrete phrases: “oval face, dark brown shoulder-length wavy hair, brown eyes, light olive skin, round black glasses, small mole above lip, slim build”. Paste that block into every prompt for the same character, word for word. Change only the style, pose and scene around it. The fixed block plus the reference photo gives the model two consistent signals instead of one.

Avoid describing the face in ways that fight the photo. If the reference shows brown eyes and the prompt says “piercing blue eyes”, you have asked the model to choose between them, and the face usually suffers. If you want a deliberate change, say so directly: “same face, but change the eye colour to blue”.

How to build an AI character generator from photo with the API

If you want this inside your own app, Discord bot or batch script, the API does the same work as the consumer tools with no watermark and no upload limits beyond your credit balance. Building an AI character generator from photo uploads takes four steps:

  1. Create an API key on the keys page and store it as the environment variable UNICORN_API_KEY.
  2. Put the user’s photo at a publicly reachable URL (your own storage bucket or CDN works).
  3. Send a job to POST /v1/jobs with the model, the prompt and the photo URL. Optionally check the exact price first with POST /v1/models/price.
  4. Poll GET /v1/jobs/{id} until status is "succeeded", then read the image URL from outputs[0].url.

Here is a complete Python example using Flux 3 Klein Edit Image, the cheapest option for drafts:

import os
import time
import requests

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


def make_character(photo_url, prompt, resolution="1K"):
    body = {
        "model": "flux-3-klein-edit-image",
        "input": {
            "prompt": prompt,
            "image_urls": [photo_url],
            "resolution": resolution,
            "aspect_ratio": "1:1",
        },
    }

    # 1. Check the exact price before spending credits
    price = requests.post(f"{API}/v1/models/price", json=body, headers=HEADERS)
    price.raise_for_status()
    print("Price:", price.json())

    # 2. Submit the job
    r = requests.post(f"{API}/v1/jobs", json=body, headers=HEADERS)
    r.raise_for_status()
    job = r.json()

    # 3. Poll until the job succeeds
    while job["status"] != "succeeded":
        if job["status"] in ("failed", "canceled", "error"):
            raise RuntimeError(f"Job did not succeed: {job}")
        time.sleep(2)
        r = requests.get(f"{API}/v1/jobs/{job['id']}", headers=HEADERS)
        r.raise_for_status()
        job = r.json()

    # 4. The finished character image
    return job["outputs"][0]["url"]


if __name__ == "__main__":
    url = make_character(
        "https://example.com/my-selfie.jpg",
        "Turn the person in the reference photo into an anime character. "
        "Same face shape, eye colour and hairstyle. Cel shading, clean line art, "
        "soft pastel background, head and shoulders portrait.",
    )
    print("Character:", url)

To try a different model, change only the body. This curl request sends the same photo to Seedream 5.0 Flash Image to Image at 2K, which costs the same as its 1K output:

curl -X POST https://api.unicornapi.net/v1/jobs \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5-flash-image-to-image",
    "input": {
      "prompt": "Redraw the person in the reference photo as a 3D animated film character, large expressive eyes, studio lighting, keep their glasses",
      "image_urls": ["https://example.com/my-selfie.jpg"],
      "aspect_ratio": "1:1",
      "size": "2K"
    }
  }'

The other models use different field names for the photo: ref_images on Nano Banana 2 Lite and GPT Image 1.5, image_input on Nano Banana 2.1, and input_urls on GPT Image 2.6 (Economy) Image to Image. The exact format for each is in the API documentation. If you write code in Cursor or Claude Code, you can also call these models straight from your editor through the MCP integration.

Pipeline showing photo upload, price check, running job and finished character image
The API flow: send the photo URL, check the price, submit the job, then poll until it succeeds.

How to keep the same character consistent across many images

One good portrait is easy. Twenty images of the same character in different poses, outfits and scenes is where most people get stuck, and it is the real test of any AI character generator from photo references. These techniques help, roughly in order of impact:

  • Lock a canonical image. Once you have a character you like, treat that generated image, not the original photo, as the master reference. It already has the style baked in, so the model only has to change the pose and scene.
  • Send several references. Nano Banana 2 Lite accepts up to 10 reference images and GPT Image 1.5 up to 4. A front view, a three-quarter view and an outfit close-up give the model far more to hold on to than a single shot.
  • Reuse the identity block. Paste the same written description into every prompt, unchanged. Edit only the scene sentence.
  • Fix the seed when iterating. Flux 3 Klein Edit Image takes a seed. Keep it constant while you tweak the prompt, so you can see what your wording changed rather than what random noise changed.
  • Make a character sheet first. Ask for “a character turnaround sheet: front, side and back views of the same character, plain white background, 16:9”. Then crop the views and use them as references for every later scene.

Worked example: a four-person comic cast

Say you want to turn four friends into characters for a short web comic. Run each friend’s photo through Flux 3 Klein at 1K with the same style prompt (“flat comic book style, bold outlines, muted colours”) and five attempts each: 20 images. Pick one winner per friend. Next, generate a turnaround sheet for each winner. Then, for every panel, send the relevant sheets as references along with each character’s identity block and one sentence describing the scene. Because the style sentence and identity blocks never change, the cast looks like it belongs in the same comic from panel to panel.

How much does an AI character generator from photo cost, and is there a free one?

Unicorn API bills in credits. Monthly plans give credits at $0.01 each: Starter is $25, Creator $50, Studio $100 and Pro $200 per month. If you run out, top-ups cost $0.015 per credit and never expire. Every request has a known price before you run it, through POST /v1/models/price, so there are no surprises at the end of the month. Full details are on the pricing page.

For the comic example above, the numbers work out like this:

StepModel and settingImagesCredits
DraftsFlux 3 Klein Edit Image, 1K (2 credits each)2040
Final portraitsNano Banana 2.1, 4K (9 credits each)436
Total2476

That is 76 credits, or $0.76 on a monthly plan and $1.14 as a top-up. The cheapest path to a single finished character is one Flux 3 Klein image at 1K for 2 credits. The most expensive common mistake is leaving GPT Image 1.5 on high quality while drafting: at 22 credits an image, twenty drafts cost 440 credits, against 60 on low quality.

As for a free AI character generator from photo uploads: many consumer sites offer free tiers, typically with daily limits, small output sizes or watermarks, and you hand your photos to whoever runs the site. If you need a handful of images once, that may be fine. If you are generating for a product, a client or a series, a pay-per-image API is usually cheaper than a subscription app and gives you full-resolution files with no watermark.

Common mistakes and how to fix them

Most disappointing results from an AI character generator from photo uploads come from a short list of avoidable problems.

  • A poor reference photo. Sunglasses, hats, heavy shadows, extreme angles and group shots all weaken likeness. Use a sharp, evenly lit, front-facing photo with the face filling a good part of the frame. If you must start from a group shot, crop to one person first.
  • Prompts that contradict the photo. Describing hair, eyes or age differently from the reference makes the model compromise, and the face usually loses. Describe changes explicitly or leave the face to the photo.
  • Too many changes at once. New style, new outfit, new pose, new age and new setting in one request is a lot to ask. Change style and outfit first, then use that result as the reference for a new pose or scene.
  • The wrong aspect ratio. A full-body character in a 1:1 frame gets cropped at the knees. Use 2:3 or 9:16 for full-body shots, 1:1 for avatars and 16:9 for scenes or turnaround sheets.
  • Drafting at final resolution. Judge likeness at 1K. Spend credits on 2K or 4K only for the version you will publish.
  • Upscaling instead of re-rendering. Stretching a 1K draft to poster size softens detail. Re-run the approved prompt and references at 4K on a model that supports it, such as Nano Banana 2.1 or Flux 3 Klein.
  • Ignoring consent. Only use photos of yourself or of people who have agreed. Be especially careful with photos of children, never pass off a character image as a real photo of someone, and get written permission before using a recognisable person commercially.

Start in the playground to find a model and prompt that suit your style, then move the winning settings into code. The full list of image, video, audio and chat models is in the model catalog, all under the same API key and the same credit balance.

Frequently asked questions

Can I turn a photo of myself into an anime character?

Yes. Send your photo to an image-to-image model as a reference and write a prompt that names the style, for example "anime character, cel shading, same face and hairstyle as the person in the reference photo". Use a clear, front-facing, well-lit photo. Keep the prompt focused on style, clothing and setting, and let the photo carry the identity. Generate several drafts at low resolution, then render your favourite at higher resolution.

Is there a free AI character generator from photo?

Many consumer sites offer free tiers, usually with daily limits, lower resolution or watermarks. On Unicorn API nothing is free, but the cheapest photo-to-character option, Flux 3 Klein Edit Image at 1K, costs 2 credits per image. That is about 2 cents on a monthly plan. Drafting a character with twenty attempts therefore costs well under a dollar, with no watermark. The output is yours to download.

How do I keep the same AI character consistent across multiple images?

Pick one approved image as the canonical version of the character and send it as a reference in every later request. Copy the same identity block into every prompt word for word, and change only the pose, setting or action. Models that accept several references, such as Nano Banana 2 Lite with up to 10, help further: add a front view, a side view and an outfit close-up. Fixing the seed on Flux also makes reruns repeatable.

How do I generate a character description from an image?

Write down the stable features a model needs to preserve: face shape, eye colour, hair length and colour, skin tone, distinctive marks, glasses or accessories, and build. Add clothing and personality separately. Keep it in short, concrete phrases rather than adjectives like "beautiful". Reuse this description as a fixed block in every prompt so the character stays consistent across images, and store it alongside the reference photo.

Is it legal to make an AI character from someone else's photo?

It depends on where you live and what you do with the result, so this is not legal advice. As a working rule, only use photos of yourself or of people who have agreed, do not use photos of children without a parent's consent, and never present the character as a real photo of the person. Commercial use of a recognisable person usually needs their written permission.

What resolution should I use for an AI character?

Draft at 1K, because it is the cheapest and fastest setting and is plenty for judging likeness and style. Move to 2K for profile pictures, social posts and web use. Use 4K only for print, posters or images you plan to crop heavily. On Nano Banana 2.1 that means 4 credits for 1K, 6 for 2K and 9 for 4K, so drafting cheap and finishing high saves most of the cost.