Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-AI Video Factory

A local-first short-video production studio for experimenting with multi-LLM script pipelines and local media generation.

The app can generate a short-video project from a topic, route scenario creation through different LLMs, create styled image prompts, generate images locally with AUTOMATIC1111 Stable Diffusion WebUI, generate voiceover with Edge TTS, create subtitles, and render a vertical video with FFmpeg.

This project is designed as a practical local tool: run it on your own Windows machine, keep API keys in .env, and keep generated media out of GitHub.


What it does

Topic + category + language + style
  ↓
Stage 1 LLM — first draft
  ↓
Stage 2 LLM — script doctor
  ↓
Stage 3 LLM — final JSON script
  ↓
Image prompt generator
  ↓
AUTOMATIC1111 Stable Diffusion API
  ↓
Edge TTS voiceover
  ↓
Subtitles
  ↓
FFmpeg
  ↓
Final vertical video

Key features

  • Web UI for generating and editing video packs.
  • Four genre prompt packs:
    • Horror
    • Facts
    • Kids
    • Documentary
  • Flexible LLM routing:
    • Stage 1 can use Ollama, Groq, or Mistral.
    • Stage 2 can use Ollama, Groq, or Mistral.
    • Stage 3 can use Ollama, Groq, or Mistral.
  • Ollama models are detected automatically from local Ollama.
  • Groq and Mistral model lists can be extended in .env.
  • Image style presets:
    • pixar
    • cartoon
    • anime
    • realism
    • comic
    • watercolor
    • clay
    • dark_cinematic
  • Mass input field for adding recurring character/world details to all image prompts.
  • Prompt Pack Editor in the browser.
  • Stable Diffusion settings in the browser:
    • width
    • height
    • steps
    • CFG scale
    • sampler
  • Local image generation through AUTOMATIC1111 API.
  • Local-ish voiceover through Edge TTS.
  • Subtitle rendering.
  • FFmpeg final video rendering.
  • Backup/restore per project.
  • Safe GitHub setup: .env, generated projects, music, and media files are ignored.

Recommended Windows folder layout

Use this folder structure:

C:\ai\
  multi-ai-video-factory\
  stable-diffusion-webui\

This README assumes the app will be installed here:

C:\ai\multi-ai-video-factory

Prerequisites

You need:

  • Windows 10/11
  • NVIDIA GPU recommended
  • Python 3.10.x recommended
  • Git
  • FFmpeg
  • Ollama
  • AUTOMATIC1111 Stable Diffusion WebUI
  • At least one local Ollama model, recommended: qwen2.5:14b
  • Optional cloud API keys:
    • Groq
    • Mistral

1. Install Python

Recommended: Python 3.10.x.

Download Python from:

https://www.python.org/downloads/windows/

During installation, enable:

Add Python to PATH

Verify in PowerShell:

python --version
pip --version

2. Install Git

Download Git for Windows:

https://git-scm.com/download/win

Verify:

git --version

3. Install FFmpeg

Option A — winget:

winget install -e --id Gyan.FFmpeg

Close and reopen PowerShell, then verify:

ffmpeg -version
ffprobe -version

Option B — manual:

Download a Windows build from:

https://ffmpeg.org/download.html

Then add the bin folder to your Windows PATH.


4. Install Ollama and Qwen

Install Ollama from:

https://ollama.com/download/windows

After installation, open PowerShell and pull Qwen:

ollama pull qwen2.5:14b

You can also use a lighter model:

ollama pull qwen2.5:7b

Verify:

ollama list
ollama ps

Test the API:

$body = @{
    model = "qwen2.5:14b"
    prompt = "Hello"
    stream = $false
} | ConvertTo-Json

Invoke-RestMethod `
    -Uri "http://localhost:11434/api/generate" `
    -Method Post `
    -ContentType "application/json" `
    -Body $body

You should see a response from the model.


5. Install AUTOMATIC1111 Stable Diffusion WebUI

Go to:

C:\ai

Clone the repository:

cd C:\ai
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd C:\ai\stable-diffusion-webui

Edit:

webui-user.bat

Find:

set COMMANDLINE_ARGS=

Change it to:

set COMMANDLINE_ARGS=--api

Optional for NVIDIA GPUs, if your setup supports it:

set COMMANDLINE_ARGS=--api --xformers

Now run:

.\webui-user.bat

First launch can take a long time because it downloads dependencies.

When it starts, open:

http://127.0.0.1:7860

Verify the API docs:

http://127.0.0.1:7860/docs

The app uses:

A1111_BASE_URL=http://127.0.0.1:7860

6. Install Multi-AI Video Factory

Clone or download this repository.

Recommended location:

cd C:\ai
git clone https://github.com/YOUR_USERNAME/multi-ai-video-factory.git
cd C:\ai\multi-ai-video-factory

Or if you downloaded ZIP:

Extract it to:
C:\ai\multi-ai-video-factory

Allow PowerShell scripts for this window:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Optional prerequisite check:

.\scripts\check-prereqs.ps1

Run setup:

.\scripts\setup.ps1

This will:

  • create .venv
  • install Python requirements
  • create .env from .env.example if missing

7. Configure .env

Open:

notepad .env

Minimal local-first config:

GROQ_API_KEY=
MISTRAL_API_KEY=

OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=qwen2.5:14b

A1111_BASE_URL=http://127.0.0.1:7860

GROQ_MODEL=llama-3.3-70b-versatile
MISTRAL_MODEL=mistral-small-latest

GROQ_AVAILABLE_MODELS=llama-3.3-70b-versatile
MISTRAL_AVAILABLE_MODELS=mistral-small-latest,open-mistral-nemo

SD_WIDTH=512
SD_HEIGHT=768
SD_STEPS=28
SD_CFG=7
SD_SAMPLER=Euler a

MUSIC_DIR=C:/ai/multi-ai-video-factory/music
PROJECTS_DIR=C:/ai/multi-ai-video-factory/projects

If you want Groq or Mistral in the dropdowns, add real API keys:

GROQ_API_KEY=your_groq_key_here
MISTRAL_API_KEY=your_mistral_key_here

Never commit .env.


8. Run the web app

Start the app:

cd C:\ai\multi-ai-video-factory
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\scripts\run-web.ps1

Open:

http://127.0.0.1:8001

9. First test

Start with a simple test:

Topic:
A mysterious signal from an abandoned satellite

Category:
Documentary

Language:
English

Image style:
realism

Stage 1:
OLLAMA — qwen2.5:14b

Stage 2:
OLLAMA — qwen2.5:14b

Stage 3:
OLLAMA — qwen2.5:14b

Disable image generation for the very first test if you only want to test the LLM pipeline.

Then test with images enabled once AUTOMATIC1111 is running.


LLM routing examples

Fully local

Stage 1: ollama:qwen2.5:14b
Stage 2: ollama:qwen2.5:14b
Stage 3: ollama:qwen2.5:14b

Hybrid

Stage 1: ollama:qwen2.5:14b
Stage 2: groq:llama-3.3-70b-versatile
Stage 3: mistral:mistral-small-latest

Fast cloud-heavy

Stage 1: groq:llama-3.3-70b-versatile
Stage 2: groq:llama-3.3-70b-versatile
Stage 3: mistral:mistral-small-latest

Adding more models to dropdowns

Ollama

Install another model:

ollama pull qwen2.5:7b
ollama pull llama3.1:8b
ollama pull mistral:7b

Restart the web app. They should appear automatically.

Groq / Mistral

Edit .env:

GROQ_AVAILABLE_MODELS=llama-3.3-70b-versatile,another-groq-model
MISTRAL_AVAILABLE_MODELS=mistral-small-latest,open-mistral-nemo,another-mistral-model

Restart the app.


Prompt packs

Prompt files live here:

prompts/horror/ollama.txt
prompts/facts/ollama.txt
prompts/kids/ollama.txt
prompts/documentary/ollama.txt

Each category also has:

prompts/<category>/groq.txt
prompts/<category>/mistral.txt
prompts/<category>/image_prompts.txt

You can edit these files directly or use the Prompt Pack Editor inside the web UI.


Music

Put music files into:

C:\ai\multi-ai-video-factory\music

Supported formats:

.mp3
.wav
.m4a

The app will show them in the Music dropdown.


Project outputs

Generated projects are saved to:

C:\ai\multi-ai-video-factory\projects

Each project contains:

pack.json
backup.json
script.txt
images/
audio/
clips/
final_video.mp4

The projects folder is ignored by Git.


GitHub release instructions

1. Create a new GitHub repository

On GitHub:

New repository → multi-ai-video-factory

Recommended settings:

Public or Private: your choice
Initialize with README: No
Add .gitignore: No
Add license: No

This project already contains those files.


2. Check that .env is ignored

In PowerShell:

cd C:\ai\multi-ai-video-factory
git status

Make sure .env is not listed.

If .env appears, stop and check .gitignore.


3. First commit

git init
git add .
git status
git commit -m "Initial release"
git branch -M main

4. Add remote and push

Replace YOUR_USERNAME:

git remote add origin https://github.com/YOUR_USERNAME/multi-ai-video-factory.git
git push -u origin main

PowerShell helper

You can also use:

.\scripts\git-first-upload.ps1 -RepoUrl "https://github.com/YOUR_USERNAME/multi-ai-video-factory.git"

Before doing that, still run:

git status

and verify .env is not included.


Troubleshooting

PowerShell says script is not digitally signed

Run:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Then retry.

Site opens but generation fails with Mistral 401

Your Mistral key is missing or invalid.

Check:

notepad .env

Ollama does not appear in dropdowns

Check:

ollama list

and:

Invoke-RestMethod http://localhost:11434/api/tags

AUTOMATIC1111 image generation fails

Check:

http://127.0.0.1:7860
http://127.0.0.1:7860/docs

Make sure webui-user.bat contains:

set COMMANDLINE_ARGS=--api

FFmpeg render fails

Check:

ffmpeg -version
ffprobe -version

If either command is not found, reinstall FFmpeg or fix PATH.


Safety notes

  • Do not commit .env.
  • Do not commit generated videos, images, audio, or project folders.
  • Do not commit private API keys.
  • Generated content should be reviewed before publishing.
  • Documentary/facts outputs should be fact-checked before use.

License

MIT License.

Releases

Packages

Contributors

Languages