DEV Community

Cover image for Keeping a character's face the same in every AI picture
Asim Jawahir
Asim Jawahir

Posted on

Keeping a character's face the same in every AI picture

I'm building AxiomStory, a story studio for novelists, screenwriters and worldbuilders. You write or import your book, and it builds a wiki of your characters and places. From there it can draw them, give them voices and turn scenes into short videos where they speak their lines.

The hardest part so far sounds boring. The same person has to look like the same person every time. Here's what broke and what I changed.

The first bug was a missing picture

In October a test video came back with the hero wearing different clothes in the second shot. I assumed the image model was drifting. Then I looked at what we were actually sending.

Shot images only got the character's wiki picture if the writer had ticked a box saying it matched. Almost nobody ticked it, so most shots were drawn from a text description alone. Worse, the screen showed the picture next to the shot, so it looked like it was being used.

Now every shot attaches the character's reference sheet by default, and the writer can take one off with a click.

Names are messier than you'd think

The next miss was a character called Cael. His wiki page was titled with his full name, and the shot text just said "Cael". No match, no picture.

Books are full of this. People pick up nicknames and titles, and the narrator switches between them halfway through a chapter. Matching now checks every name and alias on the wiki page, so a shot that says "Cael" finds the right sheet.

One sheet, one person

Each main character gets one reference sheet: several views of the same person in a single image. It's cheaper than separate pictures, and the views stay consistent with each other.

The catch is that a grid of figures looks like a group of people to a model. When a shot had two characters, I was sending what looked like a crowd. The fix was one plain line before the story text: "Attached character sheets, one per person: A; B." That was enough.

Character sheet views: Phill, then Mara
Views from Phill's sheet, then Mara. One sheet per person, sent with every shot they appear in.

Words fight pictures

My early prompts pasted the character's whole wiki bio into every shot. It felt thorough. In practice the text and the picture would disagree on small things like hair length or a coat, and the model would split the difference.

Now shot prompts carry the action and the lines, and the sheet carries the look. I also stopped asking for props the sheet doesn't show. In one take a sword slowly turned into a book pouch, because the sheet had no sword to copy.

I tried chaining shots and took it out

The obvious trick is to give each shot the previous shot's still. I built it and ran an A/B, and faces did hold a little better. But every shot had to wait for the one before it, and one bad frame could carry forward into the rest of the scene.

I went the other way. Every shot is drawn at once, in parallel, and each one is anchored to the same wiki sheets. If one shot comes out wrong, you redo that one shot.

Seven video takes from one scene, all marked In cut
A 31 second scene in seven shots. Each one was drawn on its own from the same sheets, and they still match.

The house style is words only

I wanted every picture in the app to share one look: flat editorial illustration with simple backgrounds. The easy way would be to send a style reference image with every request. I didn't, because I was worried it would bleed into the characters themselves.

The style lives in one file as a short description, and the same text feeds wiki pictures and video frames. A test checks that the web app and the API use identical wording, so they can't quietly drift apart.

Two wordings of the house style on the same two scenes
Two wordings of the house style on the same two scenes. I kept the left one: simpler faces, flatter colour, plainer backgrounds.

What I'd tell someone building this

Most of my consistency bugs came down to plumbing: a reference that never got sent, or a name that didn't match. Check what you're actually sending before you swap models.

If you write fiction and want to see your cast drawn the same way twice, you can try it at axiomstory.com. Start free, no card.

Top comments (0)