[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1823":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":13,"stars7d":13,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},1823,"KupkaProd-Cinema-Pipeline","Matticusnicholas\u002FKupkaProd-Cinema-Pipeline","Matticusnicholas","Autonomous AI movie studio — turn a text prompt into a fully produced video. 100% local, no cloud, no API keys.",null,"Python",168,39,2,1,0,8,6,4.81,"Other",false,"master",true,[],"2026-06-12 02:00:33","# KupkaProd Cinema Pipeline\n\n**Powered by LTX 2.3**\n\nAn autonomous AI movie studio that turns a text prompt or screenplay into a fully produced video — entirely local, no cloud, no subscriptions.\n\nGive it a script, go to sleep, wake up to a movie.\n\n### Demo: 10-Minute Nature Documentary from a Single Sentence\n\nThis entire video was generated from a prompt under 50 words. The system is fully agentic — give it as little or as much detail as you want. It writes the script, plans every scene, generates character descriptions, and produces the full video autonomously.\n\nhttps:\u002F\u002Fgithub.com\u002FMatticusnicholas\u002FKupkaProd-Cinema-Pipeline\u002Fraw\u002Fmaster\u002Fnaturedoc.mp4\n\n*\\*Light trimming done in post-production to clean up sentence cutoffs.*\n\n---\n\n## What It Does\n\nKupkaProd Cinema Pipeline is a Python application that orchestrates multiple AI models to produce videos from text. It works like a miniature production studio:\n\n1. **Script Analysis** — A local LLM (Gemma via Ollama) reads your prompt or screenplay, breaks it into scenes, writes detailed character descriptions, plans camera angles, lighting, and dialogue timing\n2. **Storyboarding** — Generates keyframe images for every scene using Z-Image Turbo, then lets you review and approve them before committing to expensive video generation\n3. **Video Production** — Generates multiple takes of each scene through ComfyUI's LTX-AV pipeline (synchronized audio + video), with different seeds for variety\n4. **Editing** — A built-in take reviewer lets you watch each take, pick your favorites scene-by-scene, and assemble the final film with one click\n\nThe entire pipeline runs on your local machine. No API keys, no cloud compute, no per-minute billing.\n\n---\n\n## Features\n\n- **Script or Prompt** — Paste a full screenplay (auto-detected) or just describe what you want (\"make a 5 minute video about...\")\n- **T2V or Keyframe Mode** — Go straight to video generation (T2V Only) or generate storyboard keyframes first for review\n- **Intelligent Scene Planning** — Calculates scene duration from actual dialogue word count at character-appropriate speaking rates\n- **Character Consistency** — Generates detailed physical descriptions during planning and injects them verbatim into every scene prompt\n- **Storyboard Review** — Approve keyframe images before video generation starts. Reject with notes and regenerate\n- **Adjustable Takes** — 1-10 video takes per scene (default 3). Set to 1 for fast iteration, crank it up for overnight runs\n- **Adjustable Resolution** — Image and video resolution sliders in the GUI with automatic snapping to valid dimensions\n- **Adjustable Scene Duration** — Set min\u002Fmax scene length from the GUI (default 2-30 seconds)\n- **Full World Reconstruction** — Every prompt rebuilds the entire scene from scratch (character, setting, lighting, camera) because the video model has no memory between scenes\n- **Resume Support** — State saved after every step. Crash overnight? Resume from where you left off\n- **Auto-Launch** — Starts ComfyUI automatically if it's not running. Auto-restarts Ollama on each production run to prevent hangs\n- **Configurable LLM** — Uses Gemma 4 E4B by default. Supports any Ollama model — swap in Qwen, Mistral, or whatever you prefer in Settings\n- **Modern Dark UI** — Windows 11-style dark theme via Sun Valley (falls back gracefully if not installed)\n- **Open Source Portable** — First-run setup wizard. No hardcoded paths\n\n---\n\n## What You Need\n\n- **GPU**: NVIDIA with 12GB+ VRAM (tested on RTX 4090 Laptop 16GB)\n- **RAM**: 32GB+ recommended\n- **Storage**: ~50GB for AI models\n- **Python**: 3.10 or newer\n- **ComfyUI**: Installed and working ([download here](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI))\n- **Ollama**: Installed ([download here](https:\u002F\u002Follama.ai\u002F))\n\n---\n\n## Setup (Step by Step)\n\n### Step 1: Download This Repo\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmatticusnicholas\u002FKupkaProd-Cinema-Pipeline.git\ncd KupkaProd-Cinema-Pipeline\n```\n\nOr just download the ZIP from GitHub and extract it somewhere.\n\n### Step 2: Install Python Dependencies\n\nDouble-click **`setup.bat`** and let it finish.\n\nOr run this yourself:\n```bash\npip install -r requirements.txt\n```\n\n### Step 3: Install Ollama and the AI Brain\n\nKupkaProd uses a local AI model to write scripts, plan scenes, and direct your movie. Here's how to set that up:\n\n1. Download and install Ollama from [ollama.ai](https:\u002F\u002Follama.ai\u002F)\n2. Open a terminal and pull the model:\n```bash\nollama pull gemma4:e4b\n```\nThis downloads Gemma 4 (~5GB). It's the brain that writes all the scene descriptions and dialogue.\n\n### Step 4: Download the Video and Image Models for ComfyUI\n\nThese are the AI models that actually generate the video and images. You need to download them and put them in the right folders inside your ComfyUI installation.\n\nYour ComfyUI models folder is at something like:\n- `C:\\ComfyUI\\ComfyUI_windows_portable\\ComfyUI\\models\\` (Windows portable)\n- `ComfyUI\u002Fmodels\u002F` (manual install)\n\n#### Video Models (LTX-AV — this makes the actual video)\n\nDownload these from the [ComfyUI-LTXVideo releases](https:\u002F\u002Fgithub.com\u002FLightricks\u002FComfyUI-LTXVideo):\n\n| File | Put it in |\n|------|-----------|\n| `ltx-2.3-22b-distilled` (the video model) | `ComfyUI\u002Fmodels\u002Fcheckpoints\u002F` |\n| `LTX23_video_vae_bf16.safetensors` (video decoder) | `ComfyUI\u002Fmodels\u002Fvae\u002F` |\n| `LTX23_audio_vae_bf16.safetensors` (audio decoder) | `ComfyUI\u002Fmodels\u002Fvae\u002F` |\n| `gemma_3_12B_it_fp4_mixed.safetensors` (text encoder) | `ComfyUI\u002Fmodels\u002Ftext_encoders\u002F` |\n\n#### Image Model (for storyboard keyframes)\n\nYou also need a fast image model for the storyboard preview step. Z-Image Turbo is recommended — download it from [Tongyi-MAI\u002FZ-Image](https:\u002F\u002Fgithub.com\u002FTongyi-MAI\u002FZ-Image) and put the checkpoint in `ComfyUI\u002Fmodels\u002Fcheckpoints\u002F`.\n\nAny fast image model works (Flux, SDXL Turbo, etc.). This step just generates quick preview images before the expensive video generation starts.\n\n### Step 5: Install ComfyUI Custom Nodes\n\nYou need two custom node packs installed in ComfyUI. The easiest way is through [ComfyUI Manager](https:\u002F\u002Fgithub.com\u002Fltdrdata\u002FComfyUI-Manager), or you can clone them directly into `ComfyUI\u002Fcustom_nodes\u002F`:\n\n- **[ComfyUI-LTXVideo](https:\u002F\u002Fgithub.com\u002FLightricks\u002FComfyUI-LTXVideo)** — The LTX-AV video generation nodes\n- **[ComfyUI-VideoHelperSuite](https:\u002F\u002Fgithub.com\u002FKosinkadink\u002FComfyUI-VideoHelperSuite)** — Video output and preview nodes\n\nAfter installing, restart ComfyUI.\n\n### Step 6: Test the Workflows (Dry Run)\n\nThis is the most important step. KupkaProd comes with two ComfyUI workflows in the **`workflows\u002F`** folder. You need to load each one in ComfyUI and make sure it actually works before KupkaProd can use it.\n\n#### Test the Video Workflow\n\n1. Open ComfyUI in your browser (`http:\u002F\u002Flocalhost:8188`)\n2. Drag and drop **`workflows\u002Fltx2.3t2v.json`** into the ComfyUI window\n3. If you see any **red nodes**, you're missing custom nodes — install them and restart ComfyUI\n4. Make sure all the model paths look right (ComfyUI should find your downloaded models automatically)\n5. Click **Queue Prompt** and let it generate a test video\n6. If it works, you're good! If not, fix any errors before continuing\n\n#### Test the Keyframe Workflow\n\n1. Drag and drop **`workflows\u002Fkeyframegenerator.json`** into ComfyUI\n2. Same deal — fix any red nodes, make sure the image model is loaded\n3. Click **Queue Prompt** and let it generate a test image\n4. If it works, you're ready\n\n#### Test the Image-to-Video Workflow (Optional but Recommended)\n\nIf you want KupkaProd to use your approved storyboard keyframes as the starting frame for each scene (instead of generating video purely from text), set up the i2v workflow too:\n\n1. Drag and drop **`workflows\u002Fltxv_i2v_transformersCUSTOMSIGMAS.json`** into ComfyUI\n2. Fix any red nodes, load a test image into the LoadImage node\n3. Click **Queue Prompt** and let it generate a test video from the image\n4. If it works, export it in the next step\n\nIf you skip this, KupkaProd will use text-to-video for all scenes. It still works, but your keyframes only serve as a storyboard preview rather than actually guiding the video generation.\n\n#### Already Included: API Templates\n\nKupkaProd ships with pre-exported API templates (`workflow_template.json` and `keyframe_template.json`) that match the included workflows. **If the dry runs above worked without changes, you're done — skip to Step 7.**\n\nIf you had to modify the workflows (different models, custom nodes, etc.), re-export them so KupkaProd picks up your changes. Run the workflow in ComfyUI, then immediately run the matching export command:\n\n**Video workflow:**\n```bash\npython -c \"import json, urllib.request; r = urllib.request.urlopen('http:\u002F\u002F127.0.0.1:8188\u002Fhistory?max_items=1'); history = json.loads(r.read()); wf = list(history.values())[0]['prompt'][2]; open('video_director_agent\u002Fworkflow_template.json','w').write(json.dumps(wf,indent=2)); print(f'Saved video workflow ({len(wf)} nodes)')\"\n```\n\n**Keyframe workflow:**\n```bash\npython -c \"import json, urllib.request; r = urllib.request.urlopen('http:\u002F\u002F127.0.0.1:8188\u002Fhistory?max_items=1'); history = json.loads(r.read()); wf = list(history.values())[0]['prompt'][2]; open('video_director_agent\u002Fkeyframe_template.json','w').write(json.dumps(wf,indent=2)); print(f'Saved keyframe workflow ({len(wf)} nodes)')\"\n```\n\n**I2V workflow** (optional — only if you set up image-to-video above):\n```bash\npython -c \"import json, urllib.request; r = urllib.request.urlopen('http:\u002F\u002F127.0.0.1:8188\u002Fhistory?max_items=1'); history = json.loads(r.read()); wf = list(history.values())[0]['prompt'][2]; open('video_director_agent\u002Fi2v_template.json','w').write(json.dumps(wf,indent=2)); print(f'Saved i2v workflow ({len(wf)} nodes)')\"\n```\n\nKupkaProd auto-detects which nodes to control in your workflows — no need to edit any code.\n\n### Step 7: Launch KupkaProd\n\nDouble-click **`start.bat`**.\n\nOr run:\n```bash\npython video_director_agent\u002Fgui.py\n```\n\nOn first launch, a setup dialog asks for:\n- **ComfyUI root folder** — where ComfyUI is installed (e.g. `C:\\ComfyUI\\ComfyUI_windows_portable`)\n- **Launch script** — the `.bat` file you normally use to start ComfyUI\n- **LLM models** — which Ollama models to use (the defaults are fine)\n\nThese settings are saved and can be changed anytime via the Settings button.\n\n### Step 8: Make a Movie\n\nType a prompt like *\"make a 2 minute nature documentary about ocean life\"* and click **Start Production**.\n\nOr paste in a full screenplay — KupkaProd auto-detects scripts with scene headings, character names, and dialogue.\n\nGo get coffee. Come back to a movie.\n\n---\n\n## How It Works\n\n### The Pipeline\n\n```\n[Your Script\u002FPrompt]\n        |\n        v\nPHASE 1: SCENE BREAKDOWN (Gemma via Ollama)\n  - Parse script or generate scenes from prompt\n  - Write character descriptions (50-80 words each)\n  - Plan settings, lighting, camera angles per scene\n  - Calculate duration from dialogue word count + action time\n  - Unload heavy model from VRAM\n        |\n        v\nPHASE 2: STORYBOARD (Z-Image Turbo) [skipped in T2V Only mode]\n  - Generate keyframe candidates per scene (stops early on first PASS)\n  - AI evaluates each against character descriptions\n  - >>> YOU REVIEW: approve\u002Freject keyframes \u003C\u003C\u003C\n        |\n        v\nPHASE 3: VIDEO PRODUCTION (LTX-AV via ComfyUI)\n  - 1-10 takes per scene (configurable), different seeds\n  - Full 2-pass pipeline with latent upsampling\n  - >>> YOU REVIEW: pick best take per scene \u003C\u003C\u003C\n        |\n        v\nFINAL ASSEMBLY (FFmpeg)\n  - Stitch selected takes into final video\n  - Lossless concat (no re-encode)\n```\n\n### Script Auto-Detection\n\nThe system automatically detects screenplays by looking for:\n- Scene headings (`INT.` \u002F `EXT.`)\n- Character names in ALL CAPS\n- Stage directions in parentheses\n- Transitions (`FADE IN`, `CUT TO`)\n\nIf detected, it preserves all dialogue word-for-word and converts stage directions to visual descriptions.\n\n### Prompt Writing Philosophy\n\nEvery video prompt is **fully self-contained** because the video model has zero memory between scenes. Each prompt includes:\n- Complete character physical description (copied verbatim from the planning phase)\n- Full setting\u002Fenvironment description\n- Lighting direction and atmosphere\n- Camera angle and movement\n- Exact dialogue in quotes\n- Sound effects and ambient audio\n- 200-400 words per prompt\n\n### Duration Calculation\n\nScene duration is calculated from actual content, not guessed:\n- Dialogue words counted and divided by character-appropriate WPM\n- Known speaking rates: Trump (170 WPM), Obama (130 WPM), default (140 WPM)\n- Action time added on top of dialogue time\n- Scenes range from 2 seconds (quick cutaway) to 30 seconds (long take)\n\n---\n\n## Project Structure\n\n```\nKupkaProd-Cinema-Pipeline\u002F\n├── README.md\n├── LICENSE\n├── trump_standup.txt              # Example script\n├── workflows\u002F\n│   ├── ltx2.3t2v.json             # Video workflow (load in ComfyUI)\n│   ├── keyframegenerator.json     # Keyframe workflow (load in ComfyUI)\n│   └── ltxv_i2v_transformersCUSTOMSIGMAS.json  # Image-to-video workflow\n├── video_director_agent\u002F\n│   ├── agent.py                   # Main orchestrator + CLI\n│   ├── director.py                # Scene planning + prompt writing (Gemma)\n│   ├── comfyui_client.py          # ComfyUI API client (WebSocket + REST)\n│   ├── keyframe_gen.py            # Keyframe image generation + evaluation\n│   ├── evaluator.py               # Video frame evaluation\n│   ├── assembler.py               # FFmpeg video assembly\n│   ├── gui.py                     # Main GUI (Tkinter)\n│   ├── storyboard.py              # Storyboard review GUI\n│   ├── reviewer.py                # Take selection GUI\n│   ├── config.py                  # Settings (loads from user_settings.json)\n│   ├── user_settings.json         # Your local paths (git-ignored)\n│   ├── workflow_template.json     # LTX-AV video workflow (API format, included)\n│   ├── keyframe_template.json     # Z-Image Turbo workflow (API format, included)\n│   ├── i2v_template.json          # Image-to-video workflow (API format, user-exported)\n│   ├── logs\u002F                      # Per-run log files\n│   └── output\u002F                    # Generated projects\n│       └── [project_name]\u002F\n│           ├── state.json         # Full project state (resumable)\n│           ├── keyframes\u002F         # Storyboard images\n│           ├── scenes\u002F            # Video takes\n│           └── final.mp4          # Assembled film\n```\n\n---\n\n## Configuration\n\nAll settings are in `video_director_agent\u002Fconfig.py` with user overrides in `user_settings.json`.\n\n### Key Settings\n\n| Setting | Default | Description |\n|---------|---------|-------------|\n| `TAKES_PER_SCENE` | 3 | Video takes generated per scene (1-10, adjustable in GUI) |\n| `KF_CANDIDATES` | 4 | Keyframe image candidates per scene (stops early on first PASS) |\n| `USE_KEYFRAMES` | True | Enable storyboard phase (or use T2V Only checkbox in GUI) |\n| `SCENE_MIN_SEC` | 2 | Minimum scene duration in seconds (adjustable in GUI) |\n| `SCENE_MAX_SEC` | 30 | Maximum scene duration in seconds (adjustable in GUI) |\n| `LTX_FPS` | 24 | Video frame rate |\n| `KF_WIDTH` | 2048 | Keyframe image width (adjustable in GUI, snaps to multiples of 64) |\n| `KF_HEIGHT` | 1024 | Keyframe image height (adjustable in GUI, snaps to multiples of 64) |\n| `VIDEO_WIDTH` | 1024 | Video resolution width (adjustable in GUI, snaps to multiples of 32) |\n| `VIDEO_HEIGHT` | 432 | Video resolution height (adjustable in GUI, snaps to multiples of 32) |\n| `OLLAMA_MODEL_CREATIVE` | gemma4:e4b | Model for planning\u002Fwriting (configurable in Settings) |\n| `OLLAMA_MODEL_FAST` | gemma4:e4b | Model for evaluation (configurable in Settings) |\n\n### Workflow Node IDs\n\nKupkaProd auto-detects which nodes to control in your ComfyUI workflows. If you're using the included example workflows, everything works out of the box.\n\nIf you're using a custom workflow and auto-detection isn't finding the right nodes, you can manually set them in `config.py`. This is an advanced option — most users won't need it.\n\n---\n\n## Tips\n\n- **Start small** — Test with a 1-minute video first before attempting a 30-minute film\n- **Fast iteration** — Set takes to 1 and enable T2V Only mode to skip keyframes. Great for testing prompts\n- **Overnight runs** — Crank takes to 5-10 for maximum variety. Long productions (10+ minutes) can take hours. The resume system handles crashes\n- **Model swapping** — If Gemma 26B is too slow, use `gemma4:e4b` for both creative and eval. Quality will be lower but it's much faster\n- **Resolution** — Image dimensions must be divisible by 64, video by 32. The GUI sliders snap automatically\n- **VRAM management** — The agent automatically unloads the heavy LLM and restarts Ollama before starting ComfyUI generation\n\n---\n\n## Troubleshooting\n\n**ComfyUI won't start:** Make sure the launcher `.bat` path is correct in Settings. Check that ComfyUI runs normally when launched manually.\n\n**\"Node not found\" errors:** Your workflow uses nodes from custom node packs that aren't installed. Install the required custom nodes in ComfyUI.\n\n**JSON parse errors:** The Gemma model sometimes outputs malformed JSON. The parser handles most cases automatically. If it persists, try using a different model or reducing the scene count.\n\n**Out of memory:** Reduce video resolution in the workflow template, or generate shorter scenes (lower `SCENE_MAX_SEC`).\n\n**Keyframes all failing:** Check that Z-Image Turbo works manually in ComfyUI at the configured resolution. Dimensions must be divisible by 32.\n\n---\n\n## License\n\nFree for non-commercial use. See [LICENSE](LICENSE) for details.\n\nCommercial use requires a separate license. Contact **matt.kupka@gmail.com** for commercial licensing.\n\n---\n\n## Acknowledgments\n\n- [ComfyUI](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI) — The backbone for all image\u002Fvideo generation\n- [LTX-Video](https:\u002F\u002Fgithub.com\u002FLightricks\u002FLTXVideo) — Text-to-video with synchronized audio\n- [Z-Image Turbo](https:\u002F\u002Fgithub.com\u002FTongyi-MAI\u002FZ-Image) — Fast image generation for storyboarding\n- [Ollama](https:\u002F\u002Follama.ai\u002F) — Local LLM inference\n- [Gemma](https:\u002F\u002Fai.google.dev\u002Fgemma) — Scene planning and evaluation\n\nKupkaProd Cinema Pipeline — Built with Claude Code.\n","KupkaProd Cinema Pipeline 是一个将文本提示或剧本转换为完整视频的自主AI电影工作室。其核心功能包括脚本分析、故事板生成、视频制作和编辑，通过本地运行的多个AI模型实现全流程自动化生产。项目采用Python语言开发，基于Gemma LLM和Z-Image Turbo等技术进行场景规划与图像生成，并通过ComfyUI的LTX-AV管线同步处理音频与视频。整个流程在本地完成，无需云服务或API密钥，适合需要从简短描述到完整视频内容创作的各种场景，尤其是对隐私有高要求或者希望避免云计算成本的用户。此外，它还支持自定义分辨率、场景时长调整以及多版本视频生成等功能，为用户提供高度灵活性。","2026-06-11 02:46:16","CREATED_QUERY"]