[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116623":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":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":27,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},116623,"ComfyUI-Open-H3-Regenerate","rdh9616\u002FComfyUI-Open-H3-Regenerate","rdh9616","ComfyUI nodes + workflows for NVIDIA Open-H3-Regenerate-2K: regenerate MiniMax H3 drafts at 768P-4K in 3 steps, fast H3 VAE decoder, video-to-H3-prompt node",null,"Python",53,6,52,3,0,1,43.14,"Apache License 2.0",false,"main",true,[23,24,25,26],"comfyui","comfyui-nodes","minimax-h3","video-upscaling","2026-11-09 17:55:19","2026-11-19 20:02:51","# ComfyUI-Open-H3-Regenerate\n\nComfyUI nodes and workflows for NVIDIA's **[Open-H3-Regenerate-2K](https:\u002F\u002Fnvlabs.github.io\u002FSana\u002FOpen-H3-Regenerate-2K\u002F)**,\nthe open replacement for the closed MiniMax H3-Regenerate-2K API. It takes a low-resolution draft (an H3 768P render, or\na 384P–576P clip from LTX, Wan, SANA-Video…) and regenerates it **natively at 768P, 1080P, 2K or 4K in three diffusion\nsteps**, on ComfyUI's native MiniMax H3 model.\n\n```\ndraft ─► H3 VAE encode ─► H3-Latent-Upscaler (LBH 3D) onto the target grid\n      ─► re-noise to σ 0.8 ─► 3 Euler steps (0.8 → 0.686 → 0.48 → 0), CFG 1\n         FL2VA + merged LoRA (refiner + LightX2V FL2VA Turbo + LMS Sharp) + 50 Sharp curve branches,\n         audio held as encoded silence\n      ─► fast H3 VAE decoder (StreamRender-H3)\n```\n\nThe pipeline follows NVIDIA's reference code\n([NVlabs\u002FSana, `models\u002FOpen-H3-Regenerate-2K`](https:\u002F\u002Fgithub.com\u002FNVlabs\u002FSana\u002Ftree\u002Fsol-engine\u002Fmodels\u002FOpen-H3-Regenerate-2K)).\nIt also adds **Video to H3 Prompt**, which writes an H3 prompt for any clip with a vision model on your own\nOpenAI-compatible server.\n\n## Install\n\n```bash\ncd ComfyUI\u002Fcustom_nodes\ngit clone https:\u002F\u002Fgithub.com\u002Frdh9616\u002FComfyUI-Open-H3-Regenerate\n```\n\nAlso install [Comfyui_Minimax_h3_latent_Upscaler](https:\u002F\u002Fgithub.com\u002FLBH-123-AI\u002FComfyui_Minimax_h3_latent_Upscaler)\n(the latent upscaler node). Restart ComfyUI. Needs ComfyUI with native MiniMax H3 support (tested on 0.42.0).\n\n### Models\n\n| File | Put it in | Download |\n|---|---|---|\n| `open_h3_regenerate_2k_lora.safetensors` (12.4 GB) | `models\u002Floras\u002F` | [Efficient-Large-Model\u002FOpen-H3-Regenerate-2K](https:\u002F\u002Fhuggingface.co\u002FEfficient-Large-Model\u002FOpen-H3-Regenerate-2K\u002Ftree\u002Fmain\u002Flora) `lora\u002F` |\n| `sharp_curve_branches.safetensors` (1.2 GB) | `models\u002Floras\u002F` | same, `lora\u002F` |\n| `fast_h3_vae_noncausal_24l.safetensors` (6.5 GB) | `models\u002Fvae\u002F` | same, `vae_fast\u002F` |\n| `minimax_h3_latent_upscaler_3d_conv_v1_*` | `models\u002Flatent_upscale_models\u002F` | same, `latent_upsampler\u002F` (or LBH-123-AI's release) |\n| MiniMax H3 **FL2VA** model (any variant; the reference base is FL2VA) | `models\u002Fdiffusion_models\u002F` | [Comfy-Org\u002FMiniMax-H3](https:\u002F\u002Fhuggingface.co\u002FComfy-Org\u002FMiniMax-H3) |\n| a **pruned ref2va** checkpoint (only its 32 KB `adaln_t_table` is read) | `models\u002Fdiffusion_models\u002F` | Comfy-Org\u002FMiniMax-H3, e.g. `minimax_h3_ref2va_pruned_int8_convrot` |\n| H3 video + audio VAE, Qwen3-VL text encoder | as usual | Comfy-Org\u002FMiniMax-H3 |\n\nNo weights are re-hosted here. The nodes read NVIDIA's files as published and convert them at load time, and every\nfile keeps its own license. NVIDIA's adaln table is base-derived and they chose not to redistribute it, so the LoRA\nnode reads it from a checkpoint you already have.\n\n## Nodes (category *MiniMax H3\u002FOpen-H3 Regenerate*)\n\n| Node | What it does |\n|---|---|\n| **LoRA (refiner + Turbo + Sharp)** | Loads NVIDIA's merged Diffusers LoRA (rank 576, FP32) onto ComfyUI's H3. `to_q\u002Fk\u002Fv` become row slices of `qkv_proj`, `to_out.0` becomes `out_proj`, `ff.net.2` becomes `fc2`, and `ff.net.0.proj` becomes `fc1` with its halves swapped (Diffusers `[value; gate]` → ComfyUI `[gate; value]`). This mapping was verified bit-exactly against the Diffusers base and Comfy-Org's bf16 checkpoint. The node also installs LMS Sharp's 50 AdaLN curve branches, `B·A·curve(t)`, which read the reference `adaln_t_table`. |\n| **Sigmas** | The 3-step release grid, the 2-step grid (0.7, 0.494, 0), or the refiner's shift-6 grid from any `start_sigma`. |\n| **Prepare Draft** | Resamples the draft to 24 fps, cover-scales and centre-crops it to 1344×768 or 1024×576 (portrait drafts get portrait sizes), cuts it to `max_frames`, and holds the last frame up to H3's 17k+5 frame grid. |\n| **Latent Upscale (LBH 3D)** | Runs the H3 latent upscaler straight onto the target grid. 1080P computes 1920×1088. 4K runs two passes, via 2K. Audio in an AV latent passes through. |\n| **Refine Latent** | The AV latent for the refine. The video is re-noised by the sampler; the audio is masked, so ComfyUI keeps it clean at model time 1 (the reference's \"audio σ = 0\"). The audio is encoded silence by default, or the draft's own soundtrack. |\n| **Fast VAE Decode (StreamRender-H3)** | NVIDIA's fast H3 VAE decoder: the released 36-layer decoder pruned to 24 layers and distilled. It runs NVIDIA's plain-PyTorch path (`fast_vae_decoder.py`, vendored unchanged) through a memory-lean forward (`fast_vae_lean.py`, tested equal to the reference). VRAM ≈ 6.5 GB + 26 KB per latent token. The optional `vae` input is a fallback for clips that don't fit. |\n| **Finish Frames** | Trims the padding frames, crops 1088 → 1080 and 2176 → 2160 rows, and cuts the soundtrack to match. |\n| **Save Refined Latent** | Sits between the sampler and the decoder. It saves the refined latent, the frame count and the soundtrack to `output\u002Fopen_h3_latents\u002F` *before* decoding starts, then passes the latent on. A failed decode never costs the refine. |\n| **Load Refined Latent** | Loads a saved file (`(newest)` by default) and outputs the latent, frame count and soundtrack for the *Decode Saved Latent* workflow. |\n| **Video to H3 Prompt (inference server)** | Sends a clip to a vision model on an OpenAI-compatible server (vLLM, SGLang, llama.cpp, LM Studio) as a small 4 fps H.264 video, or as 8 stills. Returns an H3 text-to-video prompt: `integrated_multimodal_description` (`[Shot N]` per take) + `overall_soundscape` + `non_diegetic_music`. |\n\n### How the Sharp curve branches are applied\nLMS Sharp adds a delta to each block's AdaLN projection that depends on the model time *t* through an 8-D curve\n(`adaln_t_table` of Comfy-Org's ref2va pruned checkpoint, sha256 `c02a6c11…`). The node gets *t* in one of three ways:\n* **Pruned model with that same table** (e.g. ref2va pruned): the AdaLN input already *is* the curve, so the delta is added directly.\n* **Pruned model with its own table** (e.g. `minimax_h3_fl2va_pruned_*`): *t* is read back from the model's own curve, exact to about 1e-8.\n* **Full model with a time embedder:** *t* is recorded from the time embedder.\n\nOnly `forward` is replaced. The modules keep their weights, so ComfyUI's casting, offloading and other LoRAs work unchanged.\n\n### Video to H3 Prompt: keys and TLS\n* The API key is read at run time from an **environment variable** named in `api_key_env` (default `H3_LLM_API_KEY`).\n  It never goes into the workflow or into saved PNG\u002FMP4 metadata. On Windows, if the ComfyUI process didn't inherit\n  the variable (for example, it was started by a launcher that was already open), the node reads it from the saved\n  user or system environment.\n* HTTPS certificates are always verified, against the system trust store or a `ca_file` you give.\n* Text in `manual_prompt` is passed through and the server is not called. Change `seed` for another variant.\n\n## Workflows (`example_workflows\u002F`)\n\n| Workflow | Use it for |\n|---|---|\n| **Open-H3 Regenerate 2K - Draft Video** | A finished draft regenerated at 2560×1440. The prompt is written by *Video to H3 Prompt*. Set `server_url`, or paste your own prompt into `manual_prompt`. |\n| **Open-H3 Regenerate 2K - Decode Saved Latent** | The regenerate workflows save the refined result to `output\u002Fopen_h3_latents\u002F` before decoding (about 150 MB for a 15 s 2K clip). If decoding fails, run this: it turns the newest saved file into the final MP4 in about a minute, without redoing the refine. |\n| **Open-H3 Regenerate 2K - Prompt to 2K** | A prompt turned into an H3 768P draft (FL2VA + LightX2V Turbo 4-step, 6 steps er_sde), then into 2K, in one run. Optional first \u002F last frames shape the draft only. The 2K pass gets the same prompt encoded as text only, like NVIDIA's refine, and follows the draft. The `start_sigma` 0.8 default redraws less; at 0.909 the 2K pass can reshape objects of a frame-pinned draft. |\n| **Open-H3 Regenerate 2K - Ref2VA to 2K** | A reference-conditioned 768P draft on a separate Ref2VA model, then FL2VA regeneration. Start with one image and edit both prompts; see the [Ref2VA guide](docs\u002Fref2va-workflow.md) for model settings, soundtrack routing and comparison results. |\n\nAll three generation examples default to **`start_sigma=0.8`**, to stay closer to the draft:\nσ 0.8 → 0.686 → 0.48 → 0. Set `start_sigma=0` to restore NVIDIA's release grid\n(0.909375 → 0.857 → 0.667 → 0). They retain the merged LoRA at 1.0 + curve branches,\nLBH upscaler in bf16, Euler, CFG 1 and refine seed 1766580932. Draft Video keeps 121 frames;\nthe prompt and Ref2VA drafts generate 124. Use `768p` input size (`576p` for drafts from other models).\nComfyUI's *Model Sparse Attention* (Sol-Attn) is **on**: at 0.8 the last evaluation runs dense\nunder the existing cutoff; the release grid keeps eligible attention sparse in all three steps.\n\n## Speed (RTX PRO 5000 Blackwell 72 GB, Windows, ComfyUI 0.42)\n\nMeasurements below use the **release sigma grid**, not the new 0.8 default:\n5 s clip (121 frames), 768P → 2560×1440, int8 FL2VA pruned base.\nSee the [Ref2VA comparison](docs\u002Fref2va-workflow.md#validation-and-comparison) for measured 0.8 runs.\n\n| Configuration | Refine (3 steps) | VAE decode | Whole run |\n|---|---|---|---|\n| Release grid: Sol-Attn + fast VAE decoder | **122 s** | **24 s** | **≈ 3 min** warm (206 s cold) |\n| Sol-Attn + ComfyUI's own VAE decode | 122 s | 50 s | ≈ 3.5 min |\n| Dense attention + ComfyUI's own VAE decode | 474 s | 50 s | ≈ 9.5 min |\n| Prompt → 768P draft (6 × 16 s) → 2K, release grid | 122 s | 24 s | ≈ 5 min |\n\n* Sol-Attn and dense output look the same (34.6 dB PSNR between them).\n* The fast decoder's output is 37.8 dB from ComfyUI's decoder, with no visible difference. Alone it takes 12 s at\n  1080P, and at 2K 22 s for 5 s (21 GB peak) and 69 s for 15 s (45 GB peak). Its output is identical to NVIDIA's\n  reference forward on the GPU. Frames stream straight to system RAM. Connect the H3 video VAE to its optional `vae`\n  input and clips too big for the card fall back to ComfyUI's tiled decoder instead of failing.\n* NVIDIA's reference forward of the fast decoder peaks at about 71 GB at 2K. On a 72 GB card it spills into system\n  RAM and takes 113 s, which is why the lean forward exists.\n* An NVFP4 base saved only 9% of the refine time and visibly lost skin and moss detail.\n* SoL-Engine's MXFP8, CUDA graphs and FlashAttention-4 decoder engine need NVIDIA's Linux runtime and are not used.\n\n## Results and a caveat\n\nOn NVIDIA's own demo draft (the glass mushroom from the project page), the 2K output with the release grid closely matches\ntheir published result: the same new skin texture and the same reflections in the glass.\n\nAt σ 0.909 the refine redraws a lot. In one test a small fox face drifted toward a wolf (darker coat, lost ear tips)\nwhile layout and motion held. This was not caused by the Sharp curve branches: it also happened with them off. It\nalso happened with decode → re-encode in place of the latent hand-off. **`start_sigma` 0.8** stays closer to the draft.\n\n![Fox: 768P draft (left) and 1080P regenerate (right)](docs\u002Ffox_draft_vs_regen.png)\n![Fox: draft, full recipe, curve branches off, start_sigma 0.8](docs\u002Ffox_start_sigma_ab.png)\n\n## Kijai's refiner LoRA\n\n[Kijai\u002FMiniMax-H3-experimental](https:\u002F\u002Fhuggingface.co\u002FKijai\u002FMiniMax-H3-experimental\u002Ftree\u002Fmain\u002Floras) publishes\n`minimax_h3_open_regenerate_2k_refiner_rank_384_bf16.safetensors`: ranks 0–383 of NVIDIA's merge (the refiner only),\nin ComfyUI keys for the standard LoRA loader. To match the reference with it you also need LightX2V Turbo v1.2 and\nLMS Sharp, including its curve branches. This pack's LoRA node loads NVIDIA's full merge and the curve branches in one\nstep. Kijai's conversion (q|k|v fused, SwiGLU halves swapped) matches this pack's.\n\n## Tests\n\n```bash\npython -I tests\u002Ftest_core.py [lora_header.json] [pruned_checkpoint.safetensors]\npython -I tests\u002Ftest_workflows.py\n\u003CComfyUI python> tests\u002Ftest_comfy_nodes.py \u003CComfyUI dir> \u003Cscratch dir>\n```\nThe tests cover:\n* the sigma grids, the frame math and the 312-module key map;\n* curve-time inversion on real tables;\n* on tiny native H3 models (full and curve-form): patched weights equal W + B·A, AdaLN output equals the reference\n  formula, and unpatching restores all weights;\n* the lean fast-VAE forward against NVIDIA's forward on 5 shapes;\n* the prompt node's response cleanup, key handling and media encoding;\n* the refined-latent save \u002F load round trip;\n* workflow graph consistency, separate draft\u002Frefine models and conditioning, and generated-soundtrack routing.\n\n## Credits\n\n* [Open-H3-Regenerate-2K](https:\u002F\u002Fnvlabs.github.io\u002FSana\u002FOpen-H3-Regenerate-2K\u002F), SoL-Engine and StreamRender-H3: Sensen Gao, Haozhe Liu et al., NVIDIA. `fast_vae_decoder.py` is NVIDIA's code (Apache-2.0).\n* [MiniMax H3](https:\u002F\u002Fhuggingface.co\u002FMiniMaxAI\u002FMiniMax-H3) (MiniMax H3 Community License) and Comfy-Org's ComfyUI integration.\n* [H3 latent upscaler](https:\u002F\u002Fgithub.com\u002FLBH-123-AI\u002FComfyui_Minimax_h3_latent_Upscaler) (LBH-123-AI), [LightX2V](https:\u002F\u002Fgithub.com\u002FModelTC\u002FLightX2V) FL2VA Turbo, [LMS Sharp](https:\u002F\u002Fhuggingface.co\u002FAlissonerdx\u002FMinimax-H3-ComfyUI) (Alissonerdx).\n\nCode in this repository: Apache-2.0 (see `LICENSE` and `NOTICE`). Model weights: their own licenses.\n","这是一个为ComfyUI平台开发的插件，用于本地运行NVIDIA开源的Open-H3-Regenerate-2K视频超分与重生成模型。核心功能包括：将低分辨率H3格式草稿（如768P或更低）通过三步扩散流程原生提升至768P\u002F1080P\u002F2K\u002F4K分辨率；集成优化的H3 VAE编码器与高速流式解码器（StreamRender-H3）；支持从任意视频自动生成H3适配提示词（Video-to-H3-Prompt）。技术上基于MiniMax H3原生模型，采用LBH 3D潜空间上采样、FL2VA+LoRA融合精调及50路锐化曲线分支等方案。适用于AI视频后处理、低成本高保真视频重生成及本地化H3工作流搭建。",2,"2026-11-24 04:54:03","CREATED_QUERY"]