MedMLX
Collection
Medical imaging models in native MLX on Apple Silicon. Paper: doi.org/10.64898/2026.10.28.26366762 • 23 items • Updated
How to use MedMLX/lesiondiffusion-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download MedMLX/lesiondiffusion-mlx --local-dir lesiondiffusion-mlx
Synthesize lesions in CT with native MLX using the released LMNet, LINet and VQ components.
| Input | Output |
|---|---|
| CT + aligned binary organ mask | Synthetic CT and lesion mask |
Apple Silicon · Metal · Python 3.13
uv venv --python 3.13
source .venv/bin/activate
uv pip install "lesiondiffusion-mlx>=0.2.6"
uv tool install huggingface-hub
hf download MedMLX/lesiondiffusion-mlx model.safetensors tokenizer.json conversion.json --revision d00bbb8ad1c7170062f60b4386a38c3a4178f7ce --local-dir models
Replace the example input paths with your own files.
from lesiondiffusion_mlx.medmlx import run
result = run(
image_path="ct_1mm_ras.nii.gz",
organ_mask_path="liver_mask.nii.gz",
weights_path="models",
output_dir="out",
organ="liver",
lesion_type="tumor",
bbox_size_mm=[30, 30, 20],
placement="inside_parenchyma",
inference_mode="conditioned",
diffusion_steps=200,
seed=23,
)
print(result["outputs"]["synthetic_image"])
Use an aligned CT and binary organ mask on a RAS 1 mm grid. Synthetic output is not ground truth.
For research and education. Not validated for clinical use.
Weights: MIT, as published by the LesionDiffusion authors. Notices.
If you use MedMLX, please cite the MedMLX paper:
@article{sandoval2026medmlx,
title = {MedMLX: On-Device Medical Imaging AI for Apple Silicon},
author = {Sandoval, A. and Sandoval, J. and Saleem, A.},
journal = {medRxiv},
year = {2026},
doi = {10.64898/2026.10.28.26366762}
}
Quantized