[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107554":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":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},107554,"Henge","alisson-anjos\u002FHenge","alisson-anjos","Open studio for motion transfer and video swaps with MiniMax H3 guide latents.",null,"Python",138,23,3,1,0,17,75,6,62.14,"MIT License",false,"main",true,[],"2026-11-06 23:31:10","2026-11-22 03:20:58","# Henge\n\n**Swap · Motion · Transform.** An open-source video studio on ComfyUI and MiniMax H3: give it one guide video and a\nfew pictures, and it swaps characters, transfers motion, swaps heads or sharpens the video — locally, on a RunPod pod\nor on RunPod Serverless.\n\n[Changelog by date](CHANGELOG.md) — changes, tests and publish\u002Fdeploy status.\n\n[![Watch the Henge 2-minute demo — studio interface](docs\u002Fimages\u002Fdemo\u002Fstudio.jpg)](https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FHenge\u002Freleases\u002Fdownload\u002Fdemo-v1\u002Fhenge-demo-under-2min.mp4)\n\n[Watch the demo — 1:58](https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FHenge\u002Freleases\u002Fdownload\u002Fdemo-v1\u002Fhenge-demo-under-2min.mp4)\n· [Download the complete demo — 4:04](https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FHenge\u002Freleases\u002Fdownload\u002Fdemo-v1\u002Fhenge-demo.mp4)\n· [50-second feature reel](https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FHenge\u002Freleases\u002Fdownload\u002Fdemo-v1\u002Fhenge-teaser.mp4)\n\n| Character Swap | Motion Transfer |\n|---|---|\n| ![A hiker becomes a goblin](docs\u002Fimages\u002Fdemo\u002Fswap.webp) | ![A character performs the guide's motion on a rooftop](docs\u002Fimages\u002Fdemo\u002Fmotion.webp) |\n| **Head Swap** | **Sharpness** (Swap result, 480p → 1080p) |\n| ![Only the head changes](docs\u002Fimages\u002Fdemo\u002Fheadswap.webp) | ![Detail restored and upscaled](docs\u002Fimages\u002Fdemo\u002Fsharpness.webp) |\n\nLeft: guide · right: Henge. All four ran on RunPod Serverless at 480p (Sharpness to 1080p), started from the\n[MCP server](docs\u002FMCP.md).\n\n**Multi-character swap.** Both fighters swapped at once across camera cuts, 30 s rendered as three shots at 480p: the\nstudio assistant found the fighters, marked each one with its color (SAM 3.1 tracking) and generated.\n\n| Result (guide inset) | The assistant marking the fighters |\n|---|---|\n| ![Two fighters swapped at once](docs\u002Fimages\u002Fdemo\u002Fmulti_character.webp) | ![The assistant marks each fighter by color](docs\u002Fimages\u002Fdemo\u002Fassistant_marks.jpg) |\n\nFight footage: TEKKEN DADDY (YouTube), Tekken 8 © Bandai Namco — used here as a test clip.\n\n### Not just an interface\n\n- **Task-specific trained LoRAs**: Character Swap v1.1, Motion Transfer v1.0, Motion Transfer TARA v1.0 and Motion\n  Transfer Motion Transfer FFP v1.0,\n  Head Swap v1.0 and Little More Sharpness v1.0 (+ an H3 latent upscaler). They come from the BFS LoRA collection,\n  all trained by Alisson Anjos ([alissonerdx](https:\u002F\u002Fhuggingface.co\u002FAlissonerdx\u002FMinimax-H3-ComfyUI)).\n- **Guide-latent training**, a method inherited from LTX's guide-latent IC-LoRAs and brought to MiniMax H3: the\n  guide's VAE latents share the output's frame grid, so frame N is built on frame N of the guide. Pose, camera and\n  timing are guided directly by the source ([how the guide reaches H3](docs\u002Fconditioning.md)).\n- **TARA-H3 (Temporally Aligned Reference Attention)**, our method: keeps the guide as a native video reference, puts it\n  on the generated video's temporal clock and biases each output moment to attend to the matching guide moment, with no\n  extra trained layers ([technical report](https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002Fai-toolkit\u002Ftree\u002Ftara-h3-v0.1.2\u002Fresearch\u002Ftara-h3)).\n- **Longer clips, shot by shot**: long clips are split at camera cuts or at a fixed length, with context frames carried\n  between segments within a scene. Camera cuts start clean shots; outputs are joined without crossfade or automatic\n  color matching. Each shot can be previewed, redone alone and downloaded.\n- **Subject guidance**: mark people (SAM 3.1 tracking) and bind each to its pictures, as 2D color marks, a 3D body or a\n  latent mask for region-restricted edits. Original is the default; masks require subject marks and are opt-in.\n- **A studio assistant** using the built-in planner VLM, Claude or an OpenAI-compatible model (including LM Studio),\n  or **your own AI client through MCP**; a **first-run wizard** for the backend; [export a shot with its ComfyUI workflow and inputs](docs\u002Fworkflow-export.md)\n  to re-run it in ComfyUI.\n\n| Studio | Setup wizard | Assistant |\n|---|---|---|\n| ![Studio with source and result](docs\u002Fimages\u002Fdemo\u002Fstudio.jpg) | ![First-run wizard, RunPod Serverless](docs\u002Fimages\u002Fdemo\u002Fwizard.png) | ![The assistant marks people and generates](docs\u002Fimages\u002Fdemo\u002Fassistant.jpg) |\n\nDemo footage: [Pexels](https:\u002F\u002Fwww.pexels.com\u002Flicense\u002F) videos and original AI-generated characters.\nProject references and community acknowledgements, including crinklypaper's moving-plate contribution, are collected\nin [docs\u002FREFERENCES.md](docs\u002FREFERENCES.md).\n\n## Modes\n\n| Mode | What it does | Recipe |\n|---|---|---|\n| Character Swap | Replace the person in a video with a character picture | Character Swap v1.1 LoRA + turbo; v1.1 one-line `body_swap:` prompt; reference background removed (BiRefNet, #808080, 0.5 MP) |\n| Motion Transfer | Drive people, objects or vehicles with the guide's performance | Three LoRAs: Motion Transfer v1.0, Motion Transfer TARA v1.0 and Motion Transfer FFP v1.0 (the first-frame model: the first-frame edit LoRA merged with SolarRenderer control), loaded after the turbo (no training adapter at inference); use the matching method. The picker tags say what each one was trained for — FFP (First Frame Propagate) is trained for in Motion Transfer and in the Motion Transfer FFP merge, while TARA only handles it. Attaching a **First Frame** selects Motion Transfer FFP v1.0 |\n| Head Swap | Replace only the head with a face picture | Head Swap v1.0 r32 + turbo; published `head_swap:` template |\n| Sharpness \u002F Upscale | Enhance an upload or an existing Henge result | Little More Sharpness first, then **Open-H3 Refiner + LMS** by default at 1080p\u002F2K; H3 latent upscale, NVIDIA VSR and no upscale are alternatives. 4K requires an alternative method |\n\n**Defaults.** The studio opens in **Motion Transfer TARA** (TARA model and method). New generations use **DMAD** (Kijai) at **8 steps**, CFG 1, sampler Auto (Sharpness keeps its\nOpen-H3 first pass, DMAD at 4 steps); DMD 8-step\nis used while the DMAD file is not installed. **New** returns every setting to these defaults. Other turbos, including Pika H3 Flex, stay selectable in Advanced.\n\n**Choosing a replacement mode.** For multiple people, objects or vehicles, we recommend **Motion Transfer TARA**:\nits LoRA was trained for these edits. Select both the **Motion Transfer TARA LoRA** and the **TARA method**.\nCharacter Swap may work as an alternative when all subjects being replaced are people; clear prompts and reference\nassignments are especially important. References can have different roles: they do not have to be a person plus a\nbackground. See [Motion Transfer examples and setup](docs\u002Fmotion-transfer.md).\n\n**Guide representation.** Original is the default, including for vehicles and objects. For marked subjects, 2D paints\neach one with its color, 3D uses a colored body (people only), and Mask restricts replacement to the marked region.\nMask is not selected automatically and needs subject marks bound to references. With Original, unchanged background\npixels are not guaranteed. SAM tracks marks through the frames; assignments still need checking after camera cuts.\n\n**Generation controls.** Model, method, turbo LoRA, steps, CFG, seed, reference preparation and Comfy Kitchen attention\nare configurable. [Pika H3 Flex](docs\u002Fpika-h3-flex.md) is included in default downloads as an optional turbo: selecting\nit presets six steps, CFG 1 and LCM with the Comfy workflow's manual sigmas. The H3 sampler is adjustable in Advanced;\ncustom step counts use the normal scheduler and remain experimental. **The Pika LoRA is not MIT-licensed**;\nsee [License](#license). Use a fixed seed to compare changes; the used seed is saved with each generation. Guide Latents can\nsend **Latents + CLIP** (UI default), **Latents only**, or use each model's **Auto** setting. Latents only can help when\nsource appearance leaks into a replacement. Optional [pure temporal windows](docs\u002Ftemporal-windows.md) combine\npredictions at each denoising step; they are distinct from shots and carried context frames, and are off by default.\nIn Sharpness, **Segments → full-video refiner windows** keeps normal first-pass segments and refines the assembled\nresult with windows; long outputs still use bounded refinement chunks for host RAM. Both window strategies require\nupdated Henge worker nodes. Comfy Kitchen with TARA needs the [modified kernel](docs\u002Fmotion-transfer.md), not just the stock package.\n\n**Sharpness defaults.** Entering Sharpness selects 1080p when coming from 480p\u002F720p. Open-H3 Refiner + LMS presets the\nfirst pass to **DMAD, 4 steps and CFG 1**; the second pass defaults to **2 refiner steps**. These are separate passes,\nand the first-pass settings remain editable. This path uses the existing Ref2VA base, not FL2VA, and supports 1080p\nand 2K, not 4K. It requires the `regenerate` weights and native ComfyUI upscaler nodes. See\n[setup and limits](docs\u002Fopen-h3-regenerate.md).\n\n**Audio and scene controls.** Keep the source audio, generate audio with H3, or enable guide-audio conditioning.\nAn optional **New background** picture follows the guide camera (moving plate). Frames and pictures are edited by\n**FIBO 2.0 edit turbo**; **Qwen-Image 2.1** and **FLUX Klein** are optional editors you pick in the First Frame modal.\n\n## How to run Henge\n\n> **Quickest way:** give [docs\u002FAI_GUIDED_INSTALL.md](docs\u002FAI_GUIDED_INSTALL.md) to a coding agent (Claude Code, Codex, Cursor); it checks your machine, asks which option you want and installs it.\n\nHenge has three parts: the **web UI** (port 8188), the **bridge** (port 8766, plans jobs, cuts and joins\nvideo with ffmpeg) and **ComfyUI** (runs the MiniMax H3 graphs on a GPU). Pick where each one runs:\n\n| | A. Local, your ComfyUI | B. RunPod, all in one pod | C. Local UI + RunPod Serverless |\n|---|---|---|---|\n| UI and bridge | your PC | the pod | your PC (no GPU needed) |\n| ComfyUI \u002F GPU | your PC (NVIDIA; memory depends on resolution and method) | the pod | RunPod workers, started per job |\n| You pay | nothing extra | while the pod is on | per second while a job runs (+15 s idle) and the volume's storage |\n| Startup | existing ComfyUI and models | first boot downloads the selected profiles | worker cold start after idle; timing depends on availability and model loading |\n| Live sampling preview | yes | yes | progress only |\n| Best for | you have an RTX 5090 or similar | long sessions | occasional use, no local GPU |\n\nThe GPU backend needs the selected model profiles (H3 base, text encoder, VAE, planner VLM and task LoRAs).\nStorage depends on the profiles; the pod examples allocate a 180 GB volume. The UI\u002Fbridge-only host does not need\nthese weights or a GPU. [Models and download links](docs\u002Fmodels-and-downloads.md). The Motion Transfer LoRAs — v1.0, TARA v1.0 and\nthe Motion Transfer FFP v1.0 first-frame model, a merge with SolarRenderer control — are public in [Alissonerdx\u002FMinimax-H3-ComfyUI](https:\u002F\u002Fhuggingface.co\u002FAlissonerdx\u002FMinimax-H3-ComfyUI) (BFS Motion Transfer license).\n**Downloading the default model profiles needs no Hugging Face token.** RunPod Serverless still requires your\nRunPod API key and endpoint ID in the bridge configuration. The default editor `fibo` (FIBO 2.0 edit turbo, Bria) and\nthe optional `qwen21` (Qwen-Image 2.1 Turbo) are public. The gated exception is the optional `klein3` profile\n(FLUX.3 [image klein]): accept its license on\n[Hugging Face](https:\u002F\u002Fhuggingface.co\u002Fblack-forest-labs\u002Fflux-3-image-klein-comfy) and set `HF_TOKEN`. FLUX.3 is the\nlast editor in Henge's order: it resizes the frame to about a megapixel and samples an empty latent, so it re-draws the\nshot instead of editing it, and a First Frame model then repeats that difference through the whole clip.\n\n### A. Local, with your own ComfyUI\n\nYou need a working ComfyUI (PyTorch with CUDA 13, NVIDIA driver 580+), Node.js 22.6+, Python 3.10+ and\n`ffmpeg`\u002F`ffprobe` on the PATH.\n\n1. Get Henge and the nodes:\n\n   ```sh\n   git clone https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FHenge.git && cd Henge\n   npm ci && npm run build\n   ln -s \"$PWD\u002Fbackend\u002Fcomfy_nodes\u002Fhenge\" \u002Fpath\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002Fhenge\n   git clone https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FComfyUI-BFSNodes.git \u002Fpath\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002Fbfsnodes\n   \u002Fpath\u002Fto\u002Fcomfy\u002Fpython -m pip install -r \u002Fpath\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002Fbfsnodes\u002Frequirements.txt -r backend\u002Frequirements.txt\n   ```\n\n   On Windows, copy the `backend\u002Fcomfy_nodes\u002Fhenge` folder into `custom_nodes` instead of the link.\n2. Download the models into ComfyUI (choose profiles; see the table in [SERVERLESS.md](docs\u002FSERVERLESS.md#what-goes-on-it)):\n\n   ```sh\n   \u002Fpath\u002Fto\u002Fcomfy\u002Fpython scripts\u002Fdownload_models.py \\\n     --manifest config\u002Fmodel-repos.example.json --models-dir \u002Fpath\u002Fto\u002FComfyUI\u002Fmodels \\\n     --profiles character,motion,headswap,sharpness,regenerate,fibo,sam2d,audio\n   ```\n\n   No token needed. Models you already have in ComfyUI are reused, even under another name or subfolder.\n\n3. Start ComfyUI on port 8189 (keep it on localhost):\n\n   ```sh\n   python main.py --listen 127.0.0.1 --port 8189 --preview-method taesd --fast-disk\n   ```\n\n4. Create `.env.local` in the Henge folder:\n\n   ```dotenv\n   COMFY_BASE_URL=http:\u002F\u002F127.0.0.1:8189\n   COMFY_ROOT=\u002Fpath\u002Fto\u002FComfyUI          # optional: enables the model checklist\n   HENGE_DATA_DIR=\u002Fpath\u002Fto\u002Fhenge-data   # jobs, uploads and results\n   ```\n\n   Machine-specific values (other hosts, keys, a login for remote access) go only in `.env.local`, which Git\n   ignores; `.env.example` lists every option and [what to change](docs\u002FRUN_LOCAL.md#what-to-change-for-your-machine).\n\n5. Start the bridge and the UI, then open http:\u002F\u002F127.0.0.1:8188:\n\n   ```sh\n   PYTHON=\u002Fpath\u002Fto\u002Fcomfy\u002Fpython scripts\u002Flocal_stack.sh start   # also: status, stop\n   ```\n\n   On Windows, run the two commands from [RUN_LOCAL.md](docs\u002FRUN_LOCAL.md#4-start-the-job-bridge) in two\n   terminals. The backend (ComfyUI address, Comfy SDK or RunPod Serverless) can also be set in the UI: gear in the top bar → **Connection**.\n\nDetails and troubleshooting: [docs\u002FRUN_LOCAL.md](docs\u002FRUN_LOCAL.md).\n\n### B. RunPod, everything in one pod\n\n**Video tutorial (4 min), both RunPod options step by step:** network volume, the pod template, the first boot,\nthe Serverless endpoint and the UI on your computer.\n\n[![Henge on RunPod, step by step](docs\u002Fimages\u002Fdemo\u002Frunpod-tutorial.jpg)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=sthVq1_jPtM)\n\n[Watch on YouTube](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=sthVq1_jPtM) · [download the video](https:\u002F\u002Fgithub.com\u002Falisson-anjos\u002FHenge\u002Freleases\u002Fdownload\u002Fdemo-v1\u002Fhenge-runpod-tutorial.mp4)\n\nOne container runs the UI, the bridge and ComfyUI; models download on the first boot into the pod volume.\n\n1. **[Deploy the Henge template on RunPod](https:\u002F\u002Fconsole.runpod.io\u002Fdeploy?template=mnxax277c8)** — image, disks, ports and environment are already set\n   (new to RunPod? [create your account with our link](https:\u002F\u002Fget.runpod.io\u002Fz4bz8o1va7a7)).\n2. Optional: a network volume keeps the models when the pod is deleted and can also feed a Serverless endpoint\n   (option C). Create it first (*Storage → New volume*, 180 GB, in the datacenter of the GPU you want) and pick it\n   under *Region → Network volume*. Without one, the models stay on the pod's own volume.\n3. Pick a GPU with more than 32 GB (CUDA 13 driver) → *Deploy Pod*. No variable needs changing; optional:\n   `HENGE_MODEL_PROFILES` to download fewer models, `HENGE_PASSWORD` to require a login (or turn it on later from the\n   🔓 button in the UI, see [Login](#login-optional)).\n4. Open **Connect → HTTP 8188**: the setup screen shows each model's download (about 10 minutes) and opens the\n   studio when they are ready.\n\nStop the pod when you are done: the volume keeps the models and your job history for the next one.\nDetails: [docs\u002FRUNPOD.md](docs\u002FRUNPOD.md).\n\n### C. UI on your PC, GPU on RunPod Serverless\n\nThe UI and bridge run on your computer; each job stage (plan, reference editing, every shot) is one request to a\nserverless endpoint, whose workers start on demand and stop 15 s after the last request.\n\nEvery step can also be done in the RunPod console, without scripts: see\n[docs\u002FSERVERLESS.md](docs\u002FSERVERLESS.md) (volume filled by the pod template, then *Serverless → New endpoint →\nDocker image*).\n\n1. [Create a RunPod account](https:\u002F\u002Fget.runpod.io\u002Fz4bz8o1va7a7) if you have none and install\n   [`runpodctl`](https:\u002F\u002Fgithub.com\u002Frunpod\u002Frunpodctl) with your API key.\n2. Put the models on a network volume (once; a temporary pod downloads them and is deleted):\n\n   ```sh\n   VOLUME_GB=180 scripts\u002Frunpod_volume.sh            # prints the volume id\n   ```\n\n3. Create the endpoint; the script makes the worker template in your account from the public Henge image (RunPod\n   does not allow public serverless templates). The script defaults to RTX 5090; select a larger GPU if your workload\n   needs it, and choose one available in the volume's datacenter:\n\n   ```sh\n   VOLUME_ID=\u003Cvolume id> scripts\u002Frunpod_serverless.sh   # prints the endpoint id\n   ```\n\n4. Run the UI on your computer and open http:\u002F\u002Flocalhost:8188:\n\n   ```sh\n   docker run -p 8188:8188 -v henge-state:\u002Fstate -e HENGE_BACKEND=runpod \\\n     -e RUNPOD_ENDPOINT_ID=\u003Cendpoint id> -e RUNPOD_API_KEY=\u003Capi key> \\\n     ghcr.io\u002Falisson-anjos\u002Fhenge-ui:latest\n   ```\n\n   Without Docker: clone Henge, `npm ci && npm run build`, install `backend\u002Frequirements.txt`, put\n   `HENGE_BACKEND=runpod`, `RUNPOD_ENDPOINT_ID`, `RUNPOD_API_KEY` and `HENGE_DATA_DIR` in `.env.local`, then\n   `scripts\u002Flocal_stack.sh start`.\n\nMedia of any size go through the endpoint's volume; nothing uses S3 or another storage service.\nDetails, costs and troubleshooting: [docs\u002FSERVERLESS.md](docs\u002FSERVERLESS.md).\n\n### Updating\n\nWait until active jobs finish before restarting the UI\u002Fbridge or recycling workers. A bridge restart interrupts\njob orchestration. Publishing code, building an image and deploying it are separate steps.\n\n- **A**: `git pull && npm ci && npm run build`, then `scripts\u002Flocal_stack.sh start` and restart ComfyUI (the\n  henge nodes changed).\n- **B**: deploy a new pod from the template (the volume keeps the models).\n- **C**: pull the new `henge-ui` image; for the workers, `ENDPOINT_ID=\u003Cid> TEMPLATE_ID=\u003Cid>\n  IMAGE=ghcr.io\u002Falisson-anjos\u002Fhenge:sha-\u003Ccommit> scripts\u002Frunpod_serverless.sh` switches the image and recycles\n  the old workers. Run it only once no jobs are active. New weights must be added to the shared volume first;\n  Startup\u002Frendering does not run the downloader. Alternatively, use **Settings → Models** with an updated worker\n  to explicitly install catalogued weights through the existing endpoint, without a fill pod.\n- **UI hosted elsewhere** (optional): see [Hosting only the UI](docs\u002FHOSTING-UI.md) (Render, a VPS, Fly.io,\n  Railway). For Render, see [redeploying the image](docs\u002FRENDER.md): changing `latest` in the registry alone\n  does not update an image-based service. Update UI\u002Fbridge for interface and assistant changes; update the worker\n  when graphs, nodes or GPU dependencies change.\n\nImages are built by GitHub Actions for each release (a pushed `v*` tag, e.g. `v2026.10.30`, or a manual run of the\n**Docker image** workflow) and published to GitHub Container Registry: `ghcr.io\u002Falisson-anjos\u002Fhenge` (everything; the\nserverless worker uses it with `HENGE_ROLE=worker`) and `ghcr.io\u002Falisson-anjos\u002Fhenge-ui` (UI and bridge only), tagged\n`latest`, the release tag and `sha-\u003Ccommit>`. Commits on `main` alone do not publish an image. Pin a built SHA tag for reproducible worker versions;\n`latest` follows newly published images but does not update already running workers.\n\n### More guides\n\n- **[AI-guided installation](docs\u002FAI_GUIDED_INSTALL.md)**: paste one prompt into Claude Code, Codex or Cursor and it installs Henge for you\n- [Use Henge from your own AI client through MCP](docs\u002FMCP.md) (instead of the built-in assistant)\n- [References and acknowledgements](docs\u002FREFERENCES.md)\n- [Instructions for an AI agent to deploy everything on RunPod](docs\u002FAGENT_DEPLOY.md)\n- [Run locally: ports, connection settings, Windows](docs\u002FRUN_LOCAL.md)\n- [Docker Compose on your own GPU machine](docker\u002FREADME.md)\n- [RunPod pod template](docs\u002FRUNPOD.md) · [RunPod Serverless](docs\u002FSERVERLESS.md)\n- [Models and download links](docs\u002Fmodels-and-downloads.md) · [Guide conditioning](docs\u002Fconditioning.md)\n- [Motion Transfer workflows](workflows\u002FREADME.md) · [Flexible references and modified Kitchen kernel](docs\u002Fmotion-transfer.md)\n- [Open-H3 Refiner + LMS](docs\u002Fopen-h3-regenerate.md) · [Temporal processing](docs\u002Ftemporal-windows.md)\n- [Pika H3 Flex turbo, sampling and downloads](docs\u002Fpika-h3-flex.md)\n- [Portable ComfyUI workflow exports](docs\u002Fworkflow-export.md)\n\n## Login (optional)\n\nThe UI is open by default: anyone who reaches its address can start jobs on your GPU or your RunPod account. Before\nyou share it (a tunnel such as `cloudflared tunnel --url http:\u002F\u002Flocalhost:8188`, a Tailscale address, or a pod's\npublic port), turn on a login. You can do it in either of two ways:\n\n- **From the UI:** click **🔓 Open** in the top bar, choose a user and a password (8+ characters) and press\n  **Require login**. The browser asks for it right away. The login is saved as a scrypt hash in `access.json` in the\n  bridge data folder (`HENGE_DATA_DIR`), so it survives restarts; the same button changes it or turns it off.\n- **From the environment** (for pod templates and scripts), it overrides the UI setting:\n\n  ```dotenv\n  HENGE_PASSWORD=choose-one\n  HENGE_USER=henge   # optional, default \"henge\"\n  ```\n\nThe login covers every page and every `\u002Fapi` route, including the assistant and its key settings. What stays behind\nit:\n\n| Service | Port | Protection |\n|---|---|---|\n| Henge UI | 8188 | the login above |\n| Bridge (FastAPI) | 8766 | listens on `127.0.0.1` only; reached through the UI |\n| ComfyUI | 8189 | listens on `127.0.0.1` only. `HENGE_EXPOSE_COMFY=1` opens it **without any login**: debugging only |\n| RunPod Serverless worker | — | only callers with your RunPod API key; the key stays in the bridge's environment |\n\n## Real people (optional filter)\n\nSet `HENGE_LIKENESS_FILTER=warn` to have the planner warn when a reference picture looks like a real public figure,\nor `block` to stop such jobs before they generate. It is `off` by default. Only generate real people with their\nconsent.\n\n## Assistant and automatic prompts\n\nThe built-in assistant can use the same **Qwen planner VLM** as generation, on the configured ComfyUI\u002FServerless\nbackend, without an external API key. Settings also supports Claude or an OpenAI-compatible provider such as LM\nStudio. When a replacement request does not specify a mode, the assistant offers an in-chat choice: **Motion Transfer\nTARA** is recommended for multiple subjects; Character Swap is an alternative only when all targets are people.\nChoosing TARA applies its LoRA profile and method together.\n\nThe assistant reads current generation settings and worker capabilities before rendering. Optional Molmo tools are\nshown only when configured; without Molmo it inspects guide frames. Molmo is not required for ordinary edits and is\nseparate from the planner VLM. See [optional video analysis](docs\u002Fmolmo-pointing.md).\n\nThe [MCP server](docs\u002FMCP.md) lets an external AI client create jobs with generation options and read\u002Fchange backend\nconnection, assistant and Molmo settings. Stored credentials remain redacted. MCP does not edit another browser's\nlocal draft; the built-in assistant operates the current studio controls.\n\nPrompt generation and enhancement use the backend planner by default. The assistant can also be selected as the\nplanner in Settings. For an external vision endpoint (also used by the standalone `\u002Fapi\u002Fprompt` route), configure\nthese server-only variables in `.env.local` and restart the relevant services:\n\n```dotenv\nVLM_CHAT_URL=https:\u002F\u002Fyour-provider.example\u002Fv1\u002Fchat\u002Fcompletions\nVLM_MODEL=your-vision-model\nVLM_API_KEY=your-key-if-required\n```\n\nThe endpoint must support vision chat messages with `image_url` data URLs and return `choices[0].message.content`. References are inspected independently; sampled guide frames are analyzed separately before the final prompt is composed. This is sampled-frame analysis, not full-video understanding or audio analysis. The browser tells you which media will be sent. Credentials stay on the server. An external VLM connection is optional; the built-in planner remains available without one.\n\nAutomatic prompting in the editor and the backend planner share `lib\u002Fh3-prompt-policy.json`. The general enhanced format has six H3 reference sections, with `motion_transfer:` for motion mode and `body_swap:` for swap mode; Character Swap also has its v1.1 training-caption paths for single or marked subjects. References retain their exact indices and separate identity, outfit, object, style and environment roles. Requested scene replacements cover the entire environment while retaining the source performance and specified interaction props. Raw-prompt mode remains verbatim. See [prompt format and examples](docs\u002Fprompt-format.md).\n\n## Reference contract\n\n- Guide Latents is the standard method for the guide-trained LoRA. Selecting the Motion Transfer TARA profile automatically selects TARA, which uses the native video-reference channel with temporal alignment. Both motion LoRAs can select either method, but the matching TARA LoRA + TARA method is recommended. How each path feeds the guide to H3: [docs\u002Fconditioning.md](docs\u002Fconditioning.md).\n- Up to eleven image slots correspond to native `\u003CPicture N>` tokens.\n- The editor uses `@PictureN`; export converts to `\u003CPicture N>` without renumbering.\n- Removing a reference leaves other slots intact. Reusing an empty slot intentionally replaces that slot's identity.\n- `@Video1` converts to `\u003CVideo 1>`. Native video-reference latents are attached only when TARA is explicitly selected.\n\n## Architecture and references\n\nUI (Next.js) → bridge (FastAPI: plans, shots, ffmpeg) → ComfyUI graphs (local, Comfy SDK or RunPod Serverless). How the\nguide reaches H3: [docs\u002Fconditioning.md](docs\u002Fconditioning.md). Prompt format: [docs\u002Fprompt-format.md](docs\u002Fprompt-format.md).\nWhat comes next: [docs\u002Froadmap.md](docs\u002Froadmap.md).\n\n## License\n\nMIT for this application code. Model weights, LoRAs, datasets and third-party services have their own licenses and are not included or relicensed by this repository. This project is independent of Higgsfield and Comfy Org.\n\n**Pika Turbo is not MIT-licensed.** If you select the Pika H3 Flex turbo LoRA, its use is subject to the\n[MiniMax H3 Community License Agreement](https:\u002F\u002Fhuggingface.co\u002FPika-Labs\u002FPika-H3-Flex\u002Fblob\u002Fmain\u002FLICENSE),\nincluding its terms for use and distribution. The MIT license applies to Henge's application code and does not\nrelicense the Pika model adapter. See [Pika's notices](https:\u002F\u002Fhuggingface.co\u002FPika-Labs\u002FPika-H3-Flex\u002Fblob\u002Fmain\u002FNOTICE).\n\n## Audio\n\nChoose one in **Output**:\n\n- **Keep original audio** (default): the guide's sound is copied onto the result, unchanged.\n- **Generated audio (H3)**: H3 samples video and audio together; Henge keeps each shot's soundtrack and joins them at the\n  cuts (footsteps, impacts, ambience). Write lines in the prompt as `\u003Cd>[Portuguese] text\u003C\u002Fd>` after the speaking\n  subject. Needs the H3 audio VAE (profile `audio`).\n- **Audio conditioning** (independent): the guide's sound drives the generation, e.g. mouths and rhythm.\n\n## New background (moving plate)\n\nIn Character Swap and Motion Transfer, add a picture in **New background** to replace what is behind the people before\ngeneration. BiRefNet separates the people in every frame; the picture moves with the original camera (tracked on the\nbackground, per camera shot, with a little parallax and push-in) and is sized so it never runs out. The plated video\nbecomes the guide and the original audio is kept. Optional: without a picture nothing changes. Idea and scripts by\ncrinklypaper (Banodoco), see [docs\u002FREFERENCES.md](docs\u002FREFERENCES.md).\n\n## Long videos and shots\n\nLonger clips are processed in shots — at camera cuts, at every cut or at a fixed length (default 4.5 s, on H3's\n17n+5 frame grid). Context frames can carry continuity within a scene; camera cuts start fresh. Results are joined\nin order without crossfade or automatic color matching. Length and resolution remain subject to RAM\u002FVRAM limits.\nThe approval screen shows every shot before rendering; a finished shot can be redone alone with a new seed. A guide\nupload can be up to 500 MB.\n\n## Guide interval\n\nUploading a guide opens an editor with thumbnails, draggable start\u002Fend handles and preview playback; confirm a range or\nuse the whole video. The scissors button reopens it. Only the selected interval is analyzed, rendered and joined.\n\n## Models and application updates\n\n**Settings → Models** lists the GitHub-backed model catalog and installed files. Explicit installs run on the local\nComfyUI host (`COMFY_ROOT`) or on the existing RunPod Serverless worker\u002Fvolume, with progress and cancellation.\nServerless download time is billed; the UI does not relay weights and no temporary pod is needed. Older workers\nneed one update to enable this operation. Rendering never starts an automatic model download.\n\nThe footer shows your running version, the latest changelog and **New version available** when the installed code\nis behind GitHub main. Catalog and release notes refresh every five minutes. Updating code, deploying images and\ninstalling weights remain separate actions. See [model installation and update status](docs\u002Fmodels-and-updates.md).\n\n## History and sharing\n\n**History** lists every generation on this Henge (result, plan, settings, run again). **Export** saves the request and\nsettings as JSON (no media) and **Import settings** restores them; reattach your own video and pictures.\n\nResult and history downloads include the result, guide\u002Fresult comparison, comparison with references and the full\nbundle. On-demand comparison downloads show preparation and transfer status, with retry on failure.\n**ComfyUI workflow** exports a ZIP with a visual workflow, API graphs, exact inputs and instructions; each finished\nshot has its own package. See [portable workflow exports](docs\u002Fworkflow-export.md).\n\n## Community (work in progress)\n\nThe **Community** tab is a preview: it ships a fixed set of examples (guide video, reference pictures and prompt) that\nopen in Character Swap or Motion Transfer so you can swap in your own pictures. Sharing your own generations there is\nnot available yet: it needs a unified system (accounts, uploads and moderation) that is still being connected.\n\n## Development checks\n\nUse an isolated test data folder so checks do not touch your live job history:\n\n```sh\nHENGE_DATA_DIR=\u002Ftmp\u002Fhenge-tests CUDA_VISIBLE_DEVICES='' python -m unittest discover -s backend\u002Ftests -q\nnpm run build\n```\n\nThe optional MCP contract checks need the MCP SDK; without it they are skipped. Builds and CPU contract tests do\nnot constitute a GPU generation or a quality\u002Fperformance benchmark.\n\n## Credits\n\nAll task LoRAs (Character Swap, Motion Transfer, TARA, Head Swap, Little More Sharpness) and TARA-H3 are by Alisson Anjos\n([alissonerdx](https:\u002F\u002Fhuggingface.co\u002FAlissonerdx\u002FMinimax-H3-ComfyUI)). The moving plate and per-shot generated audio\ncome from scripts shared by **crinklypaper** on the Banodoco Discord. Every model, library, idea and media source:\n[docs\u002FREFERENCES.md](docs\u002FREFERENCES.md); license texts: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n","Henge 是一个基于 ComfyUI 和 MiniMax H3 模型的开源视频处理工具，专注于本地或云端（如 RunPod）运行的视频角色交换、动作迁移、头部替换与画质增强。其核心技术包括引导潜变量（guide latents）对齐、TARA-H3 时序对齐参考注意力机制，以及针对不同任务微调的 LoRA 模型（如 Character Swap、Motion Transfer、Head Swap 等）。支持单\u002F多角色同步处理、SAM 3.1 实时目标追踪与帧级条件控制，输出可从 480p 锐化至 1080p。适用于影视后期原型验证、AIGC 视频创意实验、AI 动作复用及小规模视频内容再创作等轻量级专业场景。",2,"2026-11-24 04:32:13","CREATED_QUERY"]