dansugc / reverse-engineer-higgsfield
git clone https://github.com/dansugc/reverse-engineer-higgsfield.git
Upload an AI video (Higgsfield & co), get the fal.ai flow that makes it. Rust CLI + web app + MCP. Built by DansUGC.
—
stars, 24h
+25
stars, 7 days · #1,503
+25
stars, 30 days · #9,925
25
★ total · +25% this week
6
forks · 0 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageRust
LicenseMIT
Created2026-10-18 (2d ago)
Last push2d ago
Watchers0
OwnerOrganization
GitHub topics
Links
- GitHub: github.com/dansugc/reverse-engineer-higgsfield
- Homepage: https://dansugc.com/?utm_source=github&utm_medium=oss&utm_campaign=reverse-engineer-higgsfield
- Releases · Issues · Hacker News mentions
README excerpt
# REH: Reverse Engineer Higgsfield
### Upload an AI video. Get the fal.ai flow that makes it. Scale the format.
**A single Rust binary: CLI, local web app and MCP server. Every claim is either measured from the file or labeled as inferred.**
`reh analyze video.mp4` → `reh build flow.json` → `reh verify` → `reh batch`
**New here? Follow the step-by-step guide**: fal key → drop a video → fal Workflow with every prompt filled in.
Built by **DansUGC**: real human UGC creators for your ads, from $5 a clip.
---
Everyone is making AI videos on Higgsfield. The formats that go viral (before/after transformations, AI UGC talking heads, camera-preset shots, product orbits) are repeatable recipes: a first frame, an identity-preserving edit, a few image-to-video shots, captions, a hard cut. REH takes any one of those videos apart and writes the recipe as a **fal.ai flow** you can run, edit, publish as a fal Workflow, and batch across new characters, products and captions.
Inspired by REA (Reverse Engineer Anything) (its evidence-first approach and the investigate → spec → build → verify loop), applied to AI video.
## What it does
[code]
For example, a Higgsfield before/after "watch me lock in for 3 months" video comes out as (full report, flow.json):
| Step | fal model | Why |
|---|---|---|
| `base_image_before` text-to-image | `fal-ai/nano-banana-pro` | the "before" first frame, 9:16, body described concretely |
| `base_image_after` image edit | `fal-ai/nano-banana-pro/edit` | same person, written as a list of changes so the "after" really changes |
| `shot1` image-to-video | `fal-ai/kling-video/v3/pro/image-to-video` | slow side-profile turn, 7.07s |
| `shot2` image-to-video | `fal-ai/kling-video/v3/pro/image-to-video` | thumbs up + arms out, 5.96s |
| edit | local ffmpeg | hard cut at 7.07s, caption "{{caption_text}}" 0–7.07s, your music |
About $2.26 per run at fal's live prices. The two stills from that flow (AI-generated):
## Quick start
Requirements: Rust 1.87+, `ffmpeg`, and a fal.ai key.
[code]
No key? `reh analyze video.mp4 --no-ai` still measures shots, cut timing, keyframes, audio and provenance, and writes a skeleton flow.
### Web app
[code]
1. **Paste your fal key** in the app. It's checked with fal, optionally saved to a local `.env` with owner-only permissions, and never sent back to the page.
2. **Drop a video.** You see the measured shots with keyframes, what the video model read in each shot, the editable variables and prompts, and a live cost estimate.
3. **Create fal Workflow.** One click creates it in your fal account with your edited prompts in every node, then gives you an **Open in fal** link and each prompt with a Copy button. Or press **Rebuild on fal** to render it here with captions and the original cut timing, side by side with the original.
The server listens on localhost only. Full walkthrough: docs/GUIDE.md.
### Scale a format
[code]
[code]
### Use it from your agent (MCP)
[code]
| Tool | |
|---|---|
| `analyze_vid