Skip to main content

mlx-generate

Generate synthetic 3D CT and MRI on Apple Silicon with NVIDIA NV-Generate and native MLX.

Docs · MedMLX

mlx-generate example output

A synthetic T1 brain MR from the MR-Brain configuration; no patient data.

Input Output
Noise, or a CT anatomy mask Synthetic 3D CT or MRI

Apple Silicon · Metal · Python 3.13 / 3.14 · uv

Quick start

uv venv --python 3.13
source .venv/bin/activate
uv pip install \
  "mlx-generate[conversion]" \
  huggingface-hub

Download and convert the checkpoint once, then run:

from pathlib import Path

from huggingface_hub import hf_hub_download
from mlx_generate.convert import convert_from_files
from mlx_generate.medmlx import run

convert_from_files(
    vae_path=Path(hf_hub_download(
        "nvidia/NV-Generate-CT", "models/autoencoder_v1.pt",
        revision="48a68e95c77a095870e3374f5b2cca1dd211f317",
    )),
    unet_path=Path(hf_hub_download(
        "nvidia/NV-Generate-MR-Brain", "models/diff_unet_3d_rflow-mr-brain_v1.pt",
        revision="ef9759bf221265b2704569cdeeac20bbf03b62ee",
    )),
    output_dir=Path("mr-brain-weights"),
    configuration="mr-brain",
)

result = run(
    configuration="mr-brain",
    modality="mri_t1",
    weights_path="mr-brain-weights",
    output_dir="out",
    seed=0,
)
print(result["outputs"])

MR needs no patient image. Synthetic output is not ground truth. See Docs for CT and additional MR configurations.

License

Apache-2.0. See third-party notices. Model weights retain their publisher terms. General-MR weights have noncommercial terms; CT component terms require publisher clarification.

For research and education. Outputs require human review.

Metadata

Release files for mlx-generate 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlx-generate 0.4.1
File Size Uploaded Provenance Actions
mlx_generate-0.4.1.tar.gz 1.2 MB Without provenance Details for mlx_generate-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlx-generate 0.4.1
File Interpreter ABI Platform Actions
mlx_generate-0.4.1-py3-none-any.whl Python 3 none any Details for mlx_generate-0.4.1-py3-none-any.whl

Total release size: 2.3 MB

Release files / mlx_generate-0.4.1.tar.gz

Download URL mlx_generate-0.4.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
67e20a9d925ffa34ee2abfb09dd0f47230dd48c021cbb26dcd691047809b25c9
BLAKE2b-256 checksum
How to use checksums
9031878f58359b0fd6d26bd4425e88d3f5a8d96571cb408cf35ce4f815775ea1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mlx_generate-0.4.1-py3-none-any.whl

Download URL mlx_generate-0.4.1-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
56f293f1a77324a68a4c76ff2613888874d68fb0a9c90e5d2446a05aac5a96c2
BLAKE2b-256 checksum
How to use checksums
b88fef9155e3741972f25ccb723ce049ddd79c4aea1a6da44d31f8e0b87221f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mlx-generate 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files No provenance

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