benjiyaya/ComfyUI-ReaVideoBreakdown
ComfyUI nodes for shot analysis and video prompts with OpenCV and a native VLM
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
ReaVideoBreakdown is a Python extension that runs inside a ComfyUI graph. The first node receives a decoded IMAGE batch and its frame rate. On the CPU, OpenCV uses HSV histogram distances and pixel differences with adaptive thresholds to find shot boundaries. On consecutive frame pairs, Lucas–Kanade optical flow and a RANSAC similarity fit estimate global image motion. These measurements are kept distinct from the VLM's interpretation of the scene.
For each shot, the node samples frames and calls the CLIPLoader encoder through ComfyUI's native tokenize → generate → decode interface. It passes the sample as video when supported and otherwise falls back to images. The resulting shot records feed the report and prompt outputs. The second node uses ComfyUI's V3 io.Schema and dynamic image inputs to pass the structured breakdown, edit instruction, and reference images through the same VLM interface. The package declares NumPy and opencv-python-headless; PyTorch and model loading come from ComfyUI.
Key Capabilities & Differentiators
The breakdown node detects cuts, fades, dissolves, and flashes. Its defaults are 0.5 sensitivity, a 0.24-second minimum shot duration before merging, and eight sampled frames per shot with a 512-pixel longest-side cap. It pairs estimated pan and zoom with VLM-generated descriptions of subject, setting, lighting, style, and apparent production type. Outputs include a VIDEO.md-style report, structured JSON, timecoded prompt blocks, a summary, the first frame of each shot, and a shot count. Reports and prompts can be produced in English or Chinese.
The reference node takes breakdown_json, an edit instruction, and up to nine images. It produces one six-section MiniMax H3 Ref2VA prompt plus prompt_json and a label map. It is designed to retain shot order, cuts, and camera cues while asking the VLM to fit the timeline to target_seconds; zero uses the source duration. Soundscape and music sections are generated prompt text, not measurements of the source audio. Video generation remains the job of the downstream node.
Trade-offs & Limitations
Compared with a standalone OpenCV detector, the extension adds semantic descriptions and generation prompts without requiring a separate processing pipeline. Compared with using ComfyUI's Generate Text node alone, it adds shot boundaries, motion estimates, and structured per-shot packaging. The cost is a VLM generation pass per detected shot. More shots, larger samples, and longer responses increase inference work. Lowering max_side or frames_per_shot reduces VLM input load but can hide fine details or brief actions, and it does not shrink the upstream decoded frame batch.
The motion fit estimates global image motion, not physical camera movement; large moving subjects can influence it. Production labels such as live action or AI video are model judgments, not proof of provenance. Very slow dissolves can be missed, and users should review cut points and rewritten timestamps before relying on them. There is no source-audio or BPM analysis, OCR, or subtitle export, and the H3 prompt rewriter is not a rendering or editing tool.
Hardware & Deployment Guide
Install into ComfyUI/custom_nodes, install requirements.txt in the same Python environment, and restart ComfyUI. The package requires Python 3.10 or later. Feed decoded frames and the source frame rate into the breakdown node and load a vision-capable text encoder through CLIPLoader; plain SD1.5 or SDXL CLIP is not sufficient. The reference rewriter requires a recent ComfyUI build with comfy_api and the native H3 nodes. Match reference image slots on the rewriter and the downstream H3 node; wire any reference audio directly into H3.
The analysis and prompt rewriting require neither clip_vision nor an external API. CPU resources cover frame analysis, while GPU sizing for local inference depends on the chosen VLM and its visual inputs. The v0.1.0 release introduced the breakdown node; v0.2.0 added the V3 reference rewriter. Running python tests/test_offline.py exercises the first node with synthetic footage and a mocked VLM without a GPU or PyTorch. It does not validate real-model output or end-to-end H3 wiring, so test both in the intended ComfyUI installation.
ComfyUI teams turning reference footage into inspectable shot records, timecoded prompts, or a reference-image rewrite for MiniMax H3.
You only need cut detection, lack a compatible vision-language encoder, or need source-audio analysis, verified provenance, or a finished video from the extension itself.
Quick Start & Installation
cd ComfyUI/custom_nodes git clone https://github.com/benjiyaya/ComfyUI-ReaVideoBreakdown.git cd ComfyUI-ReaVideoBreakdown pip install -r requirements.txt # just numpy + opencv-python-headless; torch comes with ComfyUI
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/benjiyaya/ComfyUI-ReaVideoBreakdown.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about ComfyUI-ReaVideoBreakdown
How do I wire the nodes into an existing ComfyUI graph?
What should I plan for in terms of GPU memory and runtime overhead?
Can I self-host it for commercial work?
When is plain OpenCV or ComfyUI's Generate Text node a better fit?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy