Skip to main content

DataFlorent

Storybook AI

An end-to-end pipeline that turns a written children's story into a fully illustrated picture book. Upload a manuscript, review the AI's scene plan, and get consistent artwork for every page.

30

pages planned and illustrated from a single .docx upload

2

AI models working in sequence: GPT-4.1 mini for planning, Gemini for images

5

REST endpoints covering upload, generation, status, retry and editing

1

click to download the whole illustrated book

Illustrating a book is slow. Keeping it consistent is harder.

PROBLEM

Every page of a picture book needs its own illustration. The same characters have to look identical across 30 or more scenes, in one art style and the brand colours.

APPROACH

Split the job into two steps. A language model first plans each scene as structured data. An image model then draws it under strict identity rules. A person can review and edit the plan in between.

OUTCOME

A working web app that goes from manuscript to downloadable illustrations. The characters stay recognisable from page to page, and editors keep full control over every scene.

1. Ingest

The .docx is parsed with python-docx. The title and each "Page N" block are pulled out and saved per book. /v1/upload-docx

2. Plan Scenes

GPT-4.1 mini turns each page into structured JSON. Continuity notes are passed on to the next page, so the story stays connected.

3. Review & edit

The full scenes.json is shown inthe UI. It can be edited, saved and downloaded. Saving clears stale images.

4. Illustrate

Each scene becomes a detailed Gemini prompt with an identity lock. Images are saved per page, and missing pages can be retried.

ENGINEERING DETAILS

  • A schema in the prompt. The model is given the exact output shape and told to return JSON only. If it adds extra text, a fallback extracts the JSON block anyway.
  • Memory between pages. Each page’s continuity notes are passed into the next request, so props and moods carry through the story.
  • No plot invention. The model may only infer what the page text supports, which keeps the illustrations faithful to the author.
  • Safe file handling. Uploads get timestamped temp names, each book gets its own folder, and slugs are capped in length for Windows paths.
  • Resumable generation. Existing pages are skipped, a page range can be set, and status and skipped endpoints report exactly which pages are missing.

Keeping characters identical on every page

Image models tend to drift: hair changes, outfits swap and faces age between pages. Storybook AI handles this with an identity lock built into every prompt. Bailey’s two buns, her single left-side ringlet, the purple panda sweatshirt #764F84 and the yellow leggings #F0C75E are written as non-negotiable rules, with explicit anti-symmetry checks. On top of that, a fixed style lock keeps every page in the same soft watercolour look.

See it running

The 3-minute narrated demo walks through the full flow, from upload to illustrated pages.