Skip to main content

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.md says 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_only touches 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 == 5 when 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

minimax_h3_latent_core-0.1.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minimax_h3_latent_core-0.1.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file minimax_h3_latent_core-0.1.1.tar.gz.

File metadata

  • Download URL: minimax_h3_latent_core-0.1.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for minimax_h3_latent_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 52c18471c1a47760a5c8e55cea7b65e8e12c0d2d08cc5a8bedb2b81bcdf1a516
MD5 c32b9d16a23405c46cfc5222c23d6e84
BLAKE2b-256 6b65a13cda3cb3c033e02f68b978d71d3d80009568e2a1b6be1ae45f07b3d96f

See more details on using hashes here.

Provenance

The following attestation bundles were made for minimax_h3_latent_core-0.1.1.tar.gz:

Publisher: publish.yml on panghea/minimax-h3-latent-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minimax_h3_latent_core-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for minimax_h3_latent_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc3b1c9a08a3ac44b2b66af47a3971ec8c44f587a39ab7c130b3f3b3d974772d
MD5 86b21061d264212696a86a675b2f3b95
BLAKE2b-256 83b195e91d9f987f7ad13c98955116b0cffe687b89d5869a42cc584fdacc9824

See more details on using hashes here.

Provenance

The following attestation bundles were made for minimax_h3_latent_core-0.1.1-py3-none-any.whl:

Publisher: publish.yml on panghea/minimax-h3-latent-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page