Pixel Perfect MegaMed
Official model weights for the paper:
Pixel Perfect MegaMed: A Megapixel-Scale Vision-Language Foundation Model for Generating High Resolution Medical Images
Usage
The Pixel Perfect MegaMed LoRA weights can be used with Stable Diffusion XL for standard generation (1024ร1024 resolution) or with DemoFusion for ultra-high-resolution (up to 2048ร2048 resolution) synthesis.
Minimal examples are provided below. For full scripts, configuration options, and the interactive demo, please refer to the project repository.
Standard SDXL Generation
Example using Diffusers:
import torch
from diffusers import StableDiffusionXLPipeline
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
variant="fp16"
).to("cuda")
pipe.load_lora_weights("tehraninasab/pixelperfect-megamed-lora")
image = pipe(
prompt="Chest X-ray showing pleural effusion",
num_inference_steps=50
).images[0]
Ultra-High-Resolution Generation
For 1024โ2048px synthesis, see the full instructions in the project repository.
Project Repository: https://github.com/tehraninasab/pixelperfect-megamed
Resources
- ๐ Paper (Springer): https://link.springer.com/chapter/10.1007/978-3-032-05472-2_27
- ๐ arXiv: https://arxiv.org/abs/2507.12698
- ๐ป Code: https://github.com/tehraninasab/pixelperfect-megamed
- ๐ Project page: https://tehraninasab.github.io/pixelperfect-megamed/
- ๐ค Demo: https://huggingface.co/spaces/tehraninasab/pixelperfect-megamed-demo
Citation
If you use Pixel Perfect MegaMed in your research, please cite:
@inproceedings{tehraninasab2025pixel,
title={Pixel Perfect MegaMed: A Megapixel-Scale Vision-Language Foundation Model for Generating High Resolution Medical Images},
author={TehraniNasab, Zahra and Ni, Hujun and Kumar, Amar and Arbel, Tal},
booktitle={MICCAI Workshop on Deep Generative Models},
pages={277--287},
year={2025},
organization={Springer}
}
โ ๏ธ Disclaimer
Pixel Perfect MegaMed is a research prototype intended for academic and research purposes only.
The generated images are synthetic and should not be used for clinical diagnosis, medical decision-making, or patient care.
This project is built upon publicly available datasets including CheXpert and MIMIC-CXR, and uses the Stable Diffusion XL architecture. Users must comply with the respective dataset and model licenses when using this work.
The authors and contributors make no guarantees regarding the medical validity, safety, or clinical applicability of the generated images, and assume no responsibility for any use outside of research contexts.
- Downloads last month
- 24
Model tree for tehraninasab/pixelperfect-megamed-lora
Base model
stabilityai/stable-diffusion-xl-base-1.0