MedMLX — Generate. CT / LESION SYNTHESIS

LesionDiffusion

Synthesize lesions in CT with native MLX using the released LMNet, LINet and VQ components.

GitHub · Files · Docs · Paper

Input Output
CT + aligned binary organ mask Synthetic CT and lesion mask

Apple Silicon · Metal · Python 3.13

Quick start

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.

Use & license

For research and education. Not validated for clinical use.

Weights: MIT, as published by the LesionDiffusion authors. Notices.

Paper references

Citation

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}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
0.4B params
Tensor type
F32
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including MedMLX/lesiondiffusion-mlx

Paper for MedMLX/lesiondiffusion-mlx