Consistent Character Image Generation API: Keep the Face
A consistent character image generation API guide: which reference pictures to send, a character sheet first, models that hold a face, steady batches.
Updated 6 min read
A consistent character image generation API keeps one person, mascot or product looking the same across many images by showing the model pictures of them in every request, not by describing them again. On Frameport that means reference_images on a model that reads pictures: Frameport Image 1 takes up to 10, Nano Banana Pro up to 6 and Frameport Image 3 up to 4, all drawn from a small character sheet you make once.
This guide explains why faces drift, which pictures make good references, how to build the sheet, which models hold a face, and a batch script that keeps a character on model across scenes.
How a consistent character image generation API holds a face
Every image is generated on its own. "A woman with a short silver bob and a mustard raincoat" fits countless faces, and the model picks a new one each time: the jaw, the eyes and the hairline move from image to image, even when the words do not. Writing a longer description narrows the range but never closes it.
Seeds are no answer either. The image endpoint takes no seed (an unknown field is refused with 400 invalid_request), and where other tools offer one, it only repeats the same random start: change the scene in the prompt and the face changes with it.
Pictures carry what words cannot: the shape of a face, a scar, the exact shade of a jacket. So the method is simple to state. Make a few good pictures of the character once, then send the same ones with every request, and let the prompt describe only the scene.
Reference pictures: how many and which
How many depends first on the model, from 4 on Frameport Image 3 to 10 on Frameport Image 1. In practice a few clear pictures do more than many mixed ones, because every picture you add is something the model tries to match. A good pack:
- A front portrait in soft, even light, eyes visible, nothing covering the hair or face.
- A three-quarter view of the same face, so the model knows the profile too.
- A full-body shot in the outfit you want kept, on a plain background.
- Optional extras on models with room for them: a prop, a product, a place.
Keep one subject per picture, the same hair and age in every view, and no heavy filters. In the prompt, name each picture by its place in the list ("the woman from the first picture", "the jacket from the third picture"), so the model knows which picture holds what.
A reference can be an https URL, a base64 data URI, an upload (upl_…, valid for 24 hours) or one of your own image outputs by its file id (file_…). The last form is what makes a pipeline easy: an image you generated can become a reference without downloading or hosting it. Outputs are not stored forever, though, so copy the pictures of a long-lived character to your own storage and send them by URL in later sessions.
Real people only with their consent: your own face, or someone who agreed. The acceptable use policy never allows minors or real identifiable people without consent, and an invented character is the simplest path.
A character sheet first
Before any scene, settle the character. Start with a hero portrait: four takes from one request on Frameport Image 3, then keep the best.
curl https://frameport.ai/v1/images/generations \
-H "Authorization: Bearer $FRAMEPORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "fp-image-3",
"prompt": "Portrait of Juno, a woman in her thirties with a short silver bob, light freckles and a mustard raincoat over a grey hoodie; soft window light, plain background, 85mm",
"n": 4,
"aspect_ratio": "3:4"
}'Then turn the keeper into the other views. A model that edits by instruction, such as Nano Banana Pro or Frameport Image 1, takes the portrait as a reference and a plain sentence for the change:
{
"model": "nano-banana-pro",
"prompt": "The same woman as in the picture, now full body in a three-quarter view from her left, standing, same raincoat and hoodie, same light, plain light grey background",
"reference_images": ["file_8Hc2RkQw5ZpT1mVb7nXe3L"],
"aspect_ratio": "3:4"
}Keep each view as its own picture rather than one turnaround image with every pose side by side, so you can choose which ones ride with each request. Three or four views are a complete sheet. Store their file ids, and their copies, with the character's name.
Models that hold a face
These image models read reference pictures here:
| Model | Reference pictures | Edits by instruction | Price per image |
|---|---|---|---|
| Frameport Image 1 | 10 | Yes | $0.025, plus a little per extra picture |
| Nano Banana Pro | 6 | Yes | $0.16 |
| Frameport Image 3 | 4 | No | $0.025 |
| Frameport Image 2 | 4 | No | $0.025 |
Frameport Image 1 carries the most pictures per request, so a face, an outfit, a product and a place can all be pinned at once. Nano Banana Pro is the high-fidelity option, with sharp detail and accurate lettering, which suits a mascot on packaging or a character on a poster. Frameport Image 3 is built for clean photoreal people and quick iterations, which makes it a good hero-portrait model.
GPT Image 2.5 Sunburst, GPT Image 2.5 Flare, Nano Banana 2.1, Seedream 5.0 Pro, Flux 3 Image and Grok Imagine 2.0 read no pictures: they generate from the prompt only, so they can match a description but not a face.
On Frameport Image 1, each picture after the first adds a small fee, which the quote's breakdown spells out. Send any body to POST /v1/generations/quote to see the exact price before you run it (quotes). Third-party models such as Nano Banana Pro apply their maker's policy and may refuse a request; a refusal costs nothing.
Batches that stay on model
With the sheet done, a batch is three fixed parts and one moving one: the same reference pack, the same character line, the same aspect ratio, and a new scene each time. Change one thing per image and the face has nothing to drift towards.
import mimetypes
import os
import time
import uuid
import requests
API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
# The reference pack: the same three pictures ride with every request
PACK = [
"https://example.com/juno-front.png",
"https://example.com/juno-three-quarter.png",
"https://example.com/juno-full-body.png",
]
CHARACTER = ("Juno, the woman from the three pictures: the same face, the same short silver bob, "
"the same mustard raincoat over a grey hoodie")
SCENES = [
"buying tulips at a street market in light rain, medium shot, overcast light",
"laughing at the counter of a busy noodle bar at night, warm tungsten light",
"cycling across an iron bridge at sunrise, wide shot",
]
def submit(scene):
# The key comes from the scene: running the script again replays the same images
key = f"juno-{uuid.uuid5(uuid.NAMESPACE_URL, scene)}"
gen = requests.post(f"{API}/images/generations", headers={**HEADERS, "Idempotency-Key": key}, timeout=60, json={
"model": "fp-image-1",
"prompt": f"{CHARACTER}, {scene}. Photoreal, 35mm",
"reference_images": PACK,
"n": 2,
"aspect_ratio": "3:4",
}).json()
if gen.get("error"):
raise RuntimeError(f"{gen['error']['code']}: {gen['error']['message']}")
return gen
def wait(gen):
while gen["status"] in ("queued", "running"):
time.sleep(2)
gen = requests.get(f"{API}/generations/{gen['id']}", headers=HEADERS, timeout=30).json()
return gen
jobs = [submit(scene) for scene in SCENES] # every scene is queued before the first wait
for number, gen in enumerate(map(wait, jobs), start=1):
for take, output in enumerate(gen["outputs"], start=1):
if output["status"] != "succeeded":
continue # a failed image is not charged
extension = mimetypes.guess_extension(output["content_type"]) or ".png"
with open(f"scene-{number}-take-{take}{extension}", "wb") as out:
out.write(requests.get(output["url"], timeout=60).content)
print(f"scene {number}: {gen['status']}, charged {gen['cost_usd']}")Two takes per scene leave room to discard the odd one that drifts. Each image in a batch settles on its own, so if one of the two fails, only the other is charged. Resist feeding new images back into the pack: a small error in one becomes the reference for the next, and the character slowly turns into someone else. Keep the pack fixed and regenerate instead.
The same pack carries into video. A finished scene image can become the first frame of a clip, or two of them the first and last frames, and the consistent character video guide shows the whole pipeline from sheet to clips. For the basics of the image endpoint in Python, see the image generation API guide; every field is in the images reference. To choose the engine for the face, the photorealistic image generation API guide compares ours, and AI influencer content turns one character into a run of posts. The same method makes headshots from your own photos and game assets that hold one style.
FAQ
What is the best consistent character AI for images?
The one that reads enough pictures for your character. Here, Frameport Image 1 takes the most references and edits by instruction, Nano Banana Pro brings sharp detail and accurate lettering, and Frameport Image 3 makes clean photoreal portraits quickly. Run the same pack and scene on each and compare; a quote shows each price first.
Is there a free consistent character AI image generator?
The account, the API key and price quotes are free, and an image that fails costs nothing. Images themselves are paid from a prepaid balance, from $0.025 on Frameport Image 3, with no subscription.
Can I keep a cartoon or anime character consistent?
Yes, the same way: references in every request plus a fixed style line ("flat cel shading, thick ink outlines"). Make the sheet in the style you want to keep, since a model matches the look of its references as well as the character.
How many reference images should I use for one character?
Up to the model's limit, but a few clear views usually beat a large mixed set: a front portrait, a three-quarter view and a full-body shot cover most scenes. Add a picture for a prop or a place only when the scene needs it.
Can I use a photo of a real person as a reference?
Only with their consent: your own face, or someone who agreed. Real identifiable people without consent, and minors in any form, are never allowed, whatever the model or the settings. Third-party models also apply their makers' policies, and a refused request costs nothing.