Skip to content

[new-model] Open-H3-Regenerate-2K: 768P H3 draft to 2560x1440, served on the OpenAI video routes - #2035

Open
aryan5v wants to merge 14 commits into
mainfrom
aryan/open-h3-regenerate-2k
Open

aryan5v wants to merge 14 commits into
mainfrom
aryan/open-h3-regenerate-2k

Conversation

@aryan5v

@aryan5v aryan5v commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Adds NVlabs' Open-H3-Regenerate-2K as a video-to-video pipeline. It takes a 768P MiniMax-H3 draft and regenerates it at 2560x1440 in three refine steps. It is served through the OpenAI video routes (POST /v1/videos/sync and POST /v1/videos).

The reference's dense BF16 forward (standard_fwd) is the parity target. Its Sol-Engine path (Sol-Attn, MXFP8, CUDA graphs) and its fast 24-layer VAE decoder are not ported.

Draft while we follow up on speed (NVFP4 decoder, FastH3 refine base) in stacked PRs.

Changes

  • Pipeline: new OpenH3Regenerate2KPipeline in fastvideo/pipelines/basic/open_h3_regenerate_2k/. It reuses the MiniMax-H3 DiT, VAEs and community-LoRA path. The merged rank-576 refiner LoRA loads as a constructor-time adapter.
  • Ported pieces:
    • the 3D-conv latent upscaler (fastvideo/models/upsamplers/minimax_h3_latent_upscaler.py);
    • the LMS Sharp curve AdaLN branches with their adaln_t_table;
    • the fixed-sigma refine stage, which starts from (1 - s0) * upscaled + s0 * noise;
    • the draft-video loader.
  • Shared code touched:
    • LoRA merge precision: an FP32 adapter on a BF16 base is now merged in FP32 and rounded once. Parity needs this. BF16 adapters are unchanged.
    • Checkpoint layout: pinned-class lookups no longer read a root manifest, because the release keeps it under base_model/. The component loader also accepts base_model/<name> module paths.
  • Registry and preset: open_h3_regenerate_2k, with no workload type (none exists for video-to-video, same as Kandinsky6 SR).
  • OpenAI routes:
    • exactly one video_reference (the draft);
    • output fixed at 2560x1440, 124 frames, 24 fps;
    • data: video URLs stay refused, and local paths need server.media_roots.
  • Audio: as in the reference, the transformer gets an encoded-silence stream, so the output MP4 is silent.
  • Docs and examples: the example, serving YAML, docs/inference/open_h3_regenerate_2k.md, and a support-matrix row.
curl -sS -X POST http://localhost:8000/v1/videos/sync -H 'Content-Type: application/json' \
  -d '{"prompt": "A red fox trots through fresh snow", "video_reference": {"video_url": "https://example.com/draft.mp4"}}' \
  -o out.mp4

Test Plan

  • CPU: pytest fastvideo/tests/pipelines/test_open_h3_regenerate_2k.py fastvideo/tests/entrypoints/test_openai_open_h3_regenerate_2k.py fastvideo/tests/layers
  • GPU parity against the reference standard_fwd on one GB200, using the same draft, seed, prompt and noise.
  • An opt-in GPU test for the upscaler: tests/local_tests/open_h3_regenerate_2k/test_upscaler_parity.py.
  • pre-commit run --files <changed>.

Test Results

CPU tests and pre-commit pass.

Fox draft (FastVideo H3 t2v, 768P) Dance draft (576P)
Draft latent, upscaled latent, transformer input bit-identical bit-identical
One transformer forward, relative L2 1.1e-2 2.6e-2
Refined latent, relative L2 1.3e-2 3.7e-2
Decoded video, PSNR / SSIM 45.2 dB / 0.993 42.1 dB / 0.992

The transformer outputs are close but not bit-exact. The likely cause is the two different H3 implementations (diffusers' and FastVideo's), not the ported pieces.

Warm timings on one GB200:

  • Reference: upscale 0.87 s, refine 71.6 s, decode 15.0 s, so 87.5 s total.
  • FastVideo: refine 69.5 s, 107.5 s end to end, including the draft encode and the host copy.
  • Attention: the refine forces cuDNN SDPA. PyTorch's default dispatch chose flash attention and took 192 s.

Licences

  • MiniMax H3 Community License: base_model/, the refiner LoRA and the fast VAE.
  • Their own licences:
    • the latent upscaler (MIT per the reference code, Apache-2.0 per the weights);
    • the LightX2V Turbo and LMS Sharp LoRAs.
  • Not redistributed: adaln_t_table.bin, which must be fetched from Comfy-Org/MiniMax-H3.

Known gaps

  • No Sol-Engine speed-ups and no fast VAE decoder.
  • Not run: 1080p/4K drafts, and parity for the 2-step variant.
  • No CI GPU or SSIM test.
  • The committed upscaler parity test has not been run.

Checklist

  • I ran pre-commit on the changed files and fixed all issues
  • I added or updated tests for my changes
  • I updated documentation if needed
  • I verified SSIM regression tests pass (no SSIM reference added yet)

@mergify

mergify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI

Protection Waiting on
🔴 PR merge requirements 👀 reviews and 🤖 CI

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=full-suite-passed
  • check-success=fastcheck-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

@mergify mergify Bot added type: new-model New model support scope: inference Inference pipeline, serving, CLI scope: infra CI, tests, Docker, build scope: docs Documentation scope: model Model architecture (DiTs, encoders, VAEs) labels Oct 29, 2026
@aryan5v

aryan5v commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with one non-blocking cookbook filtering issue.

Findings

  1. P2 Model gets the wrong task ▶
Fix with agent prompt
### Issue 1
docs-site/lib/cookbook-pages.ts:136
The new `backendModels` mapping makes the directory use the page's first tag, `"Video to video"`, instead of the recipe's super-resolution task. `taskLabel()` does not recognize that tag and falls back to `"Text to video"`. Users filtering for `"Video upscale"` therefore cannot find this model. Add a matching task label or use a first tag that maps to `"Video upscale"`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds Open-H3-Regenerate-2K to regenerate draft videos at 2560x1440 through the OpenAI video routes.

  • One H3 draft becomes a silent 2K video.
  • The OpenAI video routes accept one draft for 2K regeneration.
  • The release loads from its nested checkpoint, and wider LoRAs merge with one final rounding.

All supplied previous threads are unnumbered and were rechecked without reposting them. The current code addresses the Sharp reload, merge precision, attention defaults, narration comments, cookbook entry, cache bypass, offload cleanup, and missing-page findings.

Reviews (3) · Last reviewed commit: "[docs]: give Open-H3-Regenerate-2K a rea..." · Reviewed by Greptile

Comment thread fastvideo/layers/lora/linear.py Resolved
Comment thread fastvideo/registry.py Resolved
…mer instance

attach() remembered the lazy proxy's id, so after the transformer was released and loaded again the new instance
never got its 50 curve hooks and later requests ran without them. The branches now attach to the materialized
module and mark that module, so each loaded instance gets its own hooks.
…P too

The FSDP (DTensor) merge path still cast the adapter to the BF16 base before multiplying, so an FP32 adapter merged
differently with FSDP on. Both paths now share one helper, which also moves the factors to the weight's device.
…ting comments

FLASH_ATTN bypassed the cuDNN attention the refine stage selects; TORCH_SDPA keeps it.
@aryan5v
aryan5v marked this pull request as ready for review October 30, 2026 19:24
Comment thread docs-site/lib/cookbook-pages.ts Resolved
FASTVIDEO_H3_ADALN_CACHE and FASTVIDEO_H3_ADALN_TABLE compute the AdaLN modulation with F.linear instead of the
projection modules, so the Sharp curve hooks never ran and refinement silently lost all 50 branches. The pipeline now
refuses both before loading the transformer.
…e Regenerate-2K refine

With dit_cpu_offload and no layerwise offload, the refine stage never staged the transformer like the stock H3 stage
does, so it could stay resident through the 2K VAE decode. It now moves it to the device for the refine and back to the
CPU in finally, and releases layerwise-offload buffers there too.
The configurable recipe had no page, no backend-model mapping and no sidebar entry, so the directory treated it as
example-only and the deployment link redirected to a missing path. The recipe task now groups under video upscale.
"FastVideo/FastVideo-Minimax-FastH3-Preview-v0.2": "fasth3-preview",
"FastVideo/FastVideo-FastH3-4-step-Preview-v1-VSA-DataFree": "fasth3-4step",
"FastVideo/FastH3-OmniRef-NVFP4-QAD": "fasth3-omniref",
"Efficient-Large-Model/Open-H3-Regenerate-2K": "open-h3-regenerate-2k",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Model gets the wrong task

The new backendModels mapping makes the directory use the page's first tag, "Video to video", instead of the recipe's super-resolution task. taskLabel() does not recognize that tag and falls back to "Text to video". Users filtering for "Video upscale" therefore cannot find this model. Add a matching task label or use a first tag that maps to "Video upscale".

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs-site/lib/cookbook-pages.ts
Line: 136

Comment:
**Model gets the wrong task**

The new `backendModels` mapping makes the directory use the page's first tag, `"Video to video"`, instead of the recipe's super-resolution task. `taskLabel()` does not recognize that tag and falls back to `"Text to video"`. Users filtering for `"Video upscale"` therefore cannot find this model. Add a matching task label or use a first tag that maps to `"Video upscale"`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs Documentation scope: inference Inference pipeline, serving, CLI scope: infra CI, tests, Docker, build scope: model Model architecture (DiTs, encoders, VAEs) type: new-model New model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant