minimax-h3-latent-core
Partial rewriting of MiniMax H3 latents. Pure PyTorch - nothing here imports ComfyUI.
Read this before your company adopts it. This is not an open source licence. It is PolyForm Small Business 1.0.0: free for individuals, and free for a company with fewer than 100 people (employees and contractors combined) and under USD 1,000,000 revenue in the prior tax year. Below that line commercial work is fine - the threshold is about your size, not about what you do with it. Above it, use needs a paid licence. Nothing phones home and nothing checks; you are expected to read the line and act on it.
COMMERCIAL.mdsays how to get one. What you generate is yours either way - the licence makes no claim on the output.
An H3 latent is two tensors:
video (B, 24, T, H, W) H, W = pixels / 16
audio (B, 32, 2, L) L does not depend on resolution
Because they are separate, one can be pinned while the other is resampled - which is what makes an audio-only re-roll cost a fraction of a full generation, and what lets a rectangle of the picture be rewritten without disturbing the lettering around it.
Install
pip install minimax-h3-latent-core
Distribution and import name are the same. Both carry the minimax prefix because h3 on PyPI
is Uber's geospatial indexing library, which this has nothing to do with.
Use
import torch
from minimax_h3_latent_core import build_masks, resize_video_only, save_tensors, load_tensors
video = torch.randn(1, 24, 8, 12, 20)
audio = torch.randn(1, 32, 2, 300)
# free the right half of the frame, only in the middle of the clip; pin the soundtrack
masks = build_masks([video, audio], track='video only', strength=0.9,
t_start_pct=25, t_end_pct=75, t_feather_pct=0,
x_pct=50, y_pct=0, w_pct=50, h_pct=100, feather_pct=0)
small = resize_video_only([video, audio], 6, 10) # audio is left alone
save_tensors('clip.safetensors', [video, audio])
tensors, nested, prompt, meta = load_tensors('clip.safetensors')
Traps this library exists to avoid
- The audio tensor is 4-D, like an image latent. Resizing "anything 4-D or 5-D" stretches the
soundtrack.
resize_video_onlytouches only the 5-D tensor. - A masked pass needs real noise. Disabling noise collapses the inpaint term and the region comes back as blocks.
- Time resolution is one latent frame, roughly four rendered frames. A span cannot be selected more finely, and the frames at either end of a selection move with it.
- Length must satisfy
length % 17 == 5when a latent is produced by encoding a video. An invalid length silently comes back shorter.
Licence
PolyForm Small Business 1.0.0 - free for individuals and for companies with fewer than 100
people and less than USD 1,000,000 (2019, inflation-adjusted) revenue in the prior tax year.
LICENSE has the exact
wording; the summary here is not the licence.
Above that threshold, see
COMMERCIAL.md.
This library imports nothing from ComfyUI, which is why it can be licensed separately from the
ComfyUI nodes that use it. Those live in
ComfyUI-MiniMax-H3-Inpaint-Tools
under GPL-3.0.
Contributing
Issues only, no pull requests -
CONTRIBUTING.md
explains why.
Metadata
Release files for minimax-h3-latent-core 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| minimax_h3_latent_core-0.1.1.tar.gz | 14.9 kB | With provenance | Details for minimax_h3_latent_core-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| minimax_h3_latent_core-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for minimax_h3_latent_core-0.1.1-py3-none-any.whl |
Total release size: 29.3 kB
Release files / minimax_h3_latent_core-0.1.1.tar.gz
| Download URL | minimax_h3_latent_core-0.1.1.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52c18471c1a47760a5c8e55cea7b65e8e12c0d2d08cc5a8bedb2b81bcdf1a516
|
|
BLAKE2b-256 checksum How to use checksums |
6b65a13cda3cb3c033e02f68b978d71d3d80009568e2a1b6be1ae45f07b3d96f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.
Transparency logRelease files / minimax_h3_latent_core-0.1.1-py3-none-any.whl
| Download URL | minimax_h3_latent_core-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc3b1c9a08a3ac44b2b66af47a3971ec8c44f587a39ab7c130b3f3b3d974772d
|
|
BLAKE2b-256 checksum How to use checksums |
83b195e91d9f987f7ad13c98955116b0cffe687b89d5869a42cc584fdacc9824
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.
Transparency logSecurity for minimax-h3-latent-core 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for minimax_h3_latent_core-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.