minimax-h3-latent-core
Partial rewriting of MiniMax H3 latents. Pure PyTorch - nothing here imports ComfyUI.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minimax_h3_latent_core-0.1.0.tar.gz.
File metadata
- Download URL: minimax_h3_latent_core-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d464f6fc1f53fdbef7b23699ae848a0afe522ed0c982165a11703cead527fb4d
|
|
| MD5 |
fbb7faf84732eac2d58476d122748884
|
|
| BLAKE2b-256 |
c8bf09ab813e4ab0ce41d1f07dd4ac85c1eccc56d8166189e6a1027fbadb7fbd
|
Provenance
The following attestation bundles were made for minimax_h3_latent_core-0.1.0.tar.gz:
Publisher:
publish.yml on panghea/minimax-h3-latent-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minimax_h3_latent_core-0.1.0.tar.gz -
Subject digest:
d464f6fc1f53fdbef7b23699ae848a0afe522ed0c982165a11703cead527fb4d - Sigstore transparency entry: 2684121313
- Sigstore integration time:
-
Permalink:
panghea/minimax-h3-latent-core@037a9899a9d015c2448bbb8498b062593dcc89a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/panghea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@037a9899a9d015c2448bbb8498b062593dcc89a8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file minimax_h3_latent_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: minimax_h3_latent_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b90195026e0595e9f1ad523db1cbd3abaa0dcce518feec531f826b532eabb0ef
|
|
| MD5 |
1e80801f461a9249f19e672215bfd3ce
|
|
| BLAKE2b-256 |
135a227bb4d55fe091983834b34a63d672fe8ff96b8268faa891830d8f7befab
|
Provenance
The following attestation bundles were made for minimax_h3_latent_core-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on panghea/minimax-h3-latent-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minimax_h3_latent_core-0.1.0-py3-none-any.whl -
Subject digest:
b90195026e0595e9f1ad523db1cbd3abaa0dcce518feec531f826b532eabb0ef - Sigstore transparency entry: 2684121344
- Sigstore integration time:
-
Permalink:
panghea/minimax-h3-latent-core@037a9899a9d015c2448bbb8498b062593dcc89a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/panghea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@037a9899a9d015c2448bbb8498b062593dcc89a8 -
Trigger Event:
release
-
Statement type: