Text-to-Image
MLX
Safetensors
English
nemotron_h
apple-silicon
mac
autoregressive
mamba
Mixture of Experts
nemotron
nemotron-labs-image
q5
custom_code
Instructions to use VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit --local-dir Nemotron-Labs-Image-30B-A3B-MLX-5bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download code/scripts/gallery_parity.py from VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit: direct link, hf CLI and curl.
- Browser
- Download file 1.93 kB
-
https://huggingface.co/VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit/resolve/main/code/scripts/gallery_parity.py
- Command line
-
hf download hf://VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit/code/scripts/gallery_parity.py
-
curl -L -o gallery_parity.py https://huggingface.co/VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit/resolve/main/code/scripts/gallery_parity.py
1.93 kB
| """Row-band comparison of our seed-N renders with the official gallery images. | |
| For each token row (16 px band) we report PSNR against the official PNG. With the same | |
| noise stream and close logits, an autoregressive render matches the reference from the | |
| top until the first sampled token differs, then diverges. Unrelated images of the same | |
| prompt sit near 10-13 dB per band. | |
| python gallery_parity.py --cases cases.json --ours DIR --gallery DIR --out parity.json | |
| """ | |
| import argparse, json | |
| from pathlib import Path | |
| import numpy as np | |
| from PIL import Image | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--cases", required=True); ap.add_argument("--ours", required=True) | |
| ap.add_argument("--gallery", required=True); ap.add_argument("--out", required=True) | |
| ap.add_argument("--seed", type=int, default=42) | |
| args = ap.parse_args() | |
| res = [] | |
| for c in json.loads(Path(args.cases).read_text()): | |
| p = Path(args.ours) / f"{c['name']}_s{args.seed}.png" | |
| g = Path(args.gallery) / c["gallery"] | |
| if not p.exists() or not g.exists(): | |
| continue | |
| a = np.asarray(Image.open(p).convert("RGB")).astype(np.float64) | |
| b = np.asarray(Image.open(g).convert("RGB")).astype(np.float64) | |
| if a.shape != b.shape: | |
| res.append({"name": c["name"], "error": f"shape {a.shape} vs {b.shape}"}); continue | |
| bands = [] | |
| for r in range(0, a.shape[0], 16): | |
| mse = np.mean((a[r:r + 16] - b[r:r + 16]) ** 2) | |
| bands.append(10 * np.log10(255 ** 2 / max(mse, 1e-9))) | |
| full = 10 * np.log10(255 ** 2 / np.mean((a - b) ** 2)) | |
| match = next((i for i, v in enumerate(bands) if v < 20), len(bands)) | |
| res.append({"name": c["name"], "psnr_full": full, "rows_matching_from_top(>=20dB)": match, "n_rows": len(bands), | |
| "band_psnr_first8": [round(v, 1) for v in bands[:8]], "band_psnr_median": float(np.median(bands))}) | |
| print(json.dumps(res[-1])) | |
| Path(args.out).write_text(json.dumps(res, indent=1)) | |