Model reference · open weights

MedVAE

Image stanfordmimi Image edit 1 build Open weights 4k dl/mo

MedVAE is an open-weight image model from stanfordmimi. MedVAE (BF16) weighs 3.0 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • MedVAE is a family of six large-scale 2D and 3D variational autoencoders developed by stanfordmimi for medical imaging.
  • The model encodes high-resolution medical images into downsized latent representations to improve computational efficiency for downstream tasks while preserving clinically relevant features.
  • It supports X-ray, MRI, and CT modalities and is available under the MIT license.

Summary of the stanfordmimi/MedVAE model card, 2026-10-01

What it is

Released bystanfordmimi
Released2025-01-29
VRAM3.0 GB for the weights

What it runs on

Memory and cards for MedVAE (BF16)

3.0 GBweights, file size
5.0 GBworking memory, one 1024² image
537 MBruntime overhead
CardOne imageMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What stanfordmimi says about MedVAE

Read the model card

The model was presented in the paper MedVAE: Efficient Automated Interpretation of Medical Images with Large-Scale Generalizable Autoencoders.

Abstract: Medical images are acquired at high resolutions with large fields of view in order to capture fine-grained features necessary for clinical decision-making. Consequently, training deep learning models on medical images can incur large computational costs. In this work, we address the challenge of downsizing medical images in order to improve downstream computational efficiency while preserving clinically-relevant features. We introduce MedVAE, a family of six large-scale 2D and 3D autoencoders capable of encoding medical images as downsized latent representations and decoding latent representations back to high-resolution images. We train MedVAE autoencoders using a novel two-stage training approach with 1,052,730 medical images. Across diverse tasks obtained from 20 medical image datasets, we demonstrate that (1) utilizing MedVAE latent representations in place of high-resolution images when training downstream models can lead to efficiency benefits (up to 70x improvement in throughput) while simultaneously preserving clinically-relevant features and (2) MedVAE can decode latent representations back to high-resolution images with high fidelity. Our work demonstrates that large-scale, generalizable autoencoders can help address critical efficiency challenges in the medical domain.

Model Description

MedVAE is a family of six large-scale, generalizable 2D and 3D variational autoencoders (VAEs) designed for medical imaging. It is trained on over one million medical images across multiple anatomical regions and modalities. MedVAE autoencoders encode medical images as downsized latent representations and decode latent representations back to high-resolution images. Across diverse tasks obtained from 20 medical image datasets, we demonstrate that utilizing MedVAE latent representations in place of high-resolution images when training downstream models can lead to efficiency benefits (up to 70x improvement in throughput) while simultaneously preserving clinically-relevant features.

Total Compression FactorChannelsDimensionsModalitiesAnatomiesConfig FileModel File
1612DX-rayChest, Breast (FFDM)medvae_4x1.yamlvae_4x_1c_2D.ckpt
1632DX-rayChest, Breast (FFDM)medvae_4x3.yamlvae_4x_3c_2D.ckpt
6412DX-rayChest, Breast (FFDM)medvae_8x1.yamlvae_8x_1c_2D.ckpt
6432DX-rayChest, Breast (FFDM)medvae_8x4.yamlvae_8x_4c_2D.ckpt
6413DMRI, CTWhole-Bodymedvae_4x1.yamlvae_4x_1c_3D.ckpt
51213DMRI, CTWhole-Bodymedvae_8x1.yamlvae_8x_1c_3D.ckpt

Note: Model weights and checkpoints are located in the model_weights folder.

Installation

To install MedVAE, you can simply run:

pip install medvae

For an editable installation, use the following commands to clone and install this repository:

git clone https://github.com/StanfordMIMI/MedVAE.git
cd MedVAE
pip install -e .[dev]

Usage

A simple example using the medvae library for inference:

import torch
from medvae import MVAE

fpath = "documentation/data/mmg_data/isJV8hQ2hhJsvEP5rdQNiy.png"  # Replace with your image path
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = MVAE(model_name="medvae_4_3_2d", modality="xray").to(device)
img = model.apply_transform(fpath).to(device)

model.requires_grad_(False)
model.eval()

with torch.no_grad():
    latent = model(img)

We also provide an easy-to-use CLI inference tool:

medvae_inference -i INPUT_FOLDER -o OUTPUT_FOLDER -model_name MED_VAE_MODEL -modality MODALITY

For more detailed instructions, refer to the Github repository.

Citation

If you use MedVAE, please cite the original paper:

@misc{varma2025medvaeefficientautomatedinterpretation,
      title={MedVAE: Efficient Automated Interpretation of Medical Images with Large-Scale Generalizable Autoencoders},
      author={Maya Varma and Ashwin Kumar and Rogier van der Sluijs and Sophie Ostmeier and Louis Blankemeier and Pierre Chambon and Christian Bluethgen and Jip Prince and Curtis Langlotz and Akshay Chaudhari},
      year={2025},
      eprint={2502.14753},
      archivePrefix={arXiv},
      primaryClass={eess.IV},
      url={https://arxiv.org/abs/2502.14753},
}

For questions, please open an issue on the Github repository.

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

How it works

How image models work

Text promptwhat to makeText encoderunderstands itDiffusion stepsdenoise to pixelsImagePNG / JPEGA diffusion model starts from noise and denoises it, guided by your prompt, into a finished image.

Running it yourself

Run it on a rented GPU

Rent a machine by the hour. How to run this model is on its model card.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms