Skip to main content

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_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.0.tar.gz (14.3 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.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

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

Hashes for minimax_h3_latent_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d464f6fc1f53fdbef7b23699ae848a0afe522ed0c982165a11703cead527fb4d
MD5 fbb7faf84732eac2d58476d122748884
BLAKE2b-256 c8bf09ab813e4ab0ce41d1f07dd4ac85c1eccc56d8166189e6a1027fbadb7fbd

See more details on using hashes here.

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

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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minimax_h3_latent_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b90195026e0595e9f1ad523db1cbd3abaa0dcce518feec531f826b532eabb0ef
MD5 1e80801f461a9249f19e672215bfd3ce
BLAKE2b-256 135a227bb4d55fe091983834b34a63d672fe8ff96b8268faa891830d8f7befab

See more details on using hashes here.

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

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

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

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