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

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
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for tehraninasab/pixelperfect-megamed-lora

Finetuned
(1166)
this model

Space using tehraninasab/pixelperfect-megamed-lora 1

Paper for tehraninasab/pixelperfect-megamed-lora