Image-Text-to-Video
Diffusers
Safetensors
orbitquant
comfyui
w4
w4a4
native-w4a4-transformer-runtime
text-to-video
audio-video-generation
8-bit precision
Instructions to use WaveCut/MiniMax-H3-OrbitQuant-W4A4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use WaveCut/MiniMax-H3-OrbitQuant-W4A4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("WaveCut/MiniMax-H3-OrbitQuant-W4A4", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import argparse | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| SOURCE_ID = "MiniMaxAI/MiniMax-H3" | |
| SOURCE_REVISION = "73372e6cf53e414edd3ab03e357717fb0602e758" | |
| SOURCE_COMPONENTS = ("vae", "audio_vae") | |
| def sha256(path: Path) -> str: | |
| digest = hashlib.sha256() | |
| with path.open("rb") as handle: | |
| for chunk in iter(lambda: handle.read(8 * 1024 * 1024), b""): | |
| digest.update(chunk) | |
| return digest.hexdigest() | |
| def main() -> int: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--release", type=Path, required=True) | |
| parser.add_argument("--output", type=Path, required=True) | |
| args = parser.parse_args() | |
| release = args.release.resolve() | |
| info = HfApi().model_info(SOURCE_ID, revision=SOURCE_REVISION, files_metadata=True) | |
| remote_lfs = { | |
| sibling.rfilename: getattr(sibling.lfs, "sha256", None) | |
| for sibling in info.siblings or [] | |
| if getattr(sibling, "lfs", None) is not None | |
| } | |
| files = [] | |
| for component in SOURCE_COMPONENTS: | |
| weights = sorted( | |
| path | |
| for path in (release / component).iterdir() | |
| if path.is_file() and path.suffix in {".safetensors", ".bin"} | |
| ) | |
| if not weights: | |
| raise RuntimeError(f"source component has no weight files: {component}") | |
| for path in weights: | |
| relative = f"{component}/{path.name}" | |
| local_digest = sha256(path) | |
| remote_digest = remote_lfs.get(relative) | |
| if remote_digest != local_digest: | |
| raise RuntimeError(f"source-copy hash mismatch: {relative}") | |
| files.append( | |
| { | |
| "file": relative, | |
| "bytes": path.stat().st_size, | |
| "sha256": local_digest, | |
| "source_lfs_sha256": remote_digest, | |
| } | |
| ) | |
| report = { | |
| "status": "pass", | |
| "source_model_id": SOURCE_ID, | |
| "source_revision": SOURCE_REVISION, | |
| "components": list(SOURCE_COMPONENTS), | |
| "verified_weight_files": files, | |
| } | |
| args.output.parent.mkdir(parents=True, exist_ok=True) | |
| args.output.write_text(json.dumps(report, indent=2) + "\n", encoding="utf-8") | |
| print(json.dumps(report)) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |