# AI Story

> Self-hosted pipeline that turns a story topic into a finished video: script rewrite, storyboard, images, camera moves and image-to-video

- Category: Multimodal Generation / Video Generation
- Language: Python
- Licence: CC BY-NC-SA 4.0 (non-commercial; commercial use needs a licence from the author)
- Repository: https://github.com/xhongc/ai_story
- Canonical page: https://ai-tldr.dev/tools/ai-story/

## In short

AI Story is a self-hosted web platform that automates story videos, the kind of short drama, animated story or explainer clip posted to Douyin or Kuaishou. It sits in the Video Generation category of the Multimodal Generation tools and is open-source, written in Python and licensed CC BY-NC-SA 4.0 (non-commercial; commercial use needs a licence from the author).

## Overview

AI Story is a self-hosted web platform that automates story videos, the kind of short drama, animated story or explainer clip posted to Douyin or Kuaishou. You enter a story topic or outline, and it runs the whole chain: it rewrites the text into a video script, splits it into storyboard shots with picture descriptions and narration, generates an image for each shot, plans a camera move for each scene, and turns the still images into video clips.

Each project is laid out as a canvas. Every shot has a row of nodes for its storyboard text, generated image, camera-move parameters and image-to-video result, so one shot can be edited and regenerated without rerunning the rest. The pipeline runs as Celery background jobs and shows progress in real time, and any stage can be paused, resumed, retried or rolled back. A separate director mode, still in development according to the README, gives a free node canvas for finer control over shots and video.

The models are yours to choose. A model settings page manages several AI providers per stage, with load balancing (round robin, random, weighted, least load), connection tests, rate limits and usage and cost statistics, and prompts are kept as editable, versioned prompt sets with template variables. The stack is a Django backend, a Celery worker on Redis and a Vue frontend, published as Docker images for amd64 and arm64. The code is under CC BY-NC-SA 4.0, so commercial use needs a separate licence from the author.

## What it does

- End-to-end flow from a topic: script rewrite, storyboard split, image generation, camera-move planning and image-to-video
- Per-shot node canvas, so a single shot's prompt, image or clip can be edited and regenerated on its own
- Pause, resume, retry and roll back any stage, with real-time progress from Celery background jobs
- Several model providers per stage, with load balancing, connection tests, rate limits and cost statistics
- Versioned prompt sets with template variables for topic, style and length
- Project export with video assembly and subtitles

## Getting started

The README's install path is Docker Compose: Redis, the Django backend, a Celery worker and the Vue frontend, all from published images. You then add your own text, image and video model providers in the model settings.

1. Write the compose file

   Create a docker-compose.yml with the four services from the README. The Celery worker must start in /app/backend, or it fails with 'The module config was not found'.

```yaml
services:
  redis:
    image: redis:7-alpine
    restart: unless-stopped

  backend:
    image: xhongc/ai_story-backend
    restart: unless-stopped
    volumes:
      - ./data/backend:/app/backend/data
      - ./storage:/app/storage
    environment:
      - DJANGO_SETTINGS_MODULE=config.settings.production
      - REDIS_HOST=redis
    depends_on:
      - redis

  celery:
    image: xhongc/ai_story-backend
    working_dir: /app/backend
    command: celery -A config worker -l info -P gevent
    restart: unless-stopped
    volumes:
      - ./data/backend:/app/backend/data
      - ./storage:/app/storage
    environment:
      - DJANGO_SETTINGS_MODULE=config.settings.production
      - REDIS_HOST=redis
    depends_on:
      - redis

  frontend:
    image: xhongc/ai_story-frontend
    restart: unless-stopped
    ports:
      - "3000:3000"
    depends_on:
      - backend
```

2. Start it and create an admin

   Bring the stack up, create the administrator account, then open the frontend on port 3000.

```bash
docker compose up -d

docker compose exec backend python backend/manage.py createsuperuser

# open http://localhost:3000
```

3. Add your model providers

   In the model settings, add the text model used for script rewriting and storyboards, the image generation service and the video generation service. Each stage can take several models, with a load-balancing strategy, a connection test and rate limits.

4. Generate a video

   Create a project, enter the story topic and start the pipeline. It runs script rewrite, storyboard, images, camera moves and image-to-video in order. Adjust any shot on the canvas and regenerate just that node, then export the assembled video with subtitles.

## When to use it

- Producing short story videos and micro-dramas for vertical-video platforms from a one-line topic
- Turning a children's story or a written explainer into an illustrated, narrated video
- Previewing a script as storyboards and rough clips before a real shoot
- Running the same pipeline over your own mix of text, image and video model APIs
