nv-generate / README.md
zephyrie's picture
Initial commit: NV-Generate Gradio showcase
ab1db83

A newer version of the Gradio SDK is available: 6.16.0

Upgrade
metadata
title: NV-Generate Synthetic Medical Imaging
emoji: 🧠
colorFrom: green
colorTo: indigo
sdk: gradio
sdk_version: 6.14.0
app_file: app.py
python_version: '3.11'
pinned: true
license: other
license_name: nvidia-open-model-license
license_link: >-
  https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
short_description: Synthetic 3D CT and MR generation with NVIDIA NV-Generate.

NV-Generate · Synthetic Medical Imaging

A unified Hugging Face Spaces demo for NVIDIA Medtech's three open-weight 3D medical image generators, all built on the MAISI-v2 rectified-flow architecture (~30 inference steps each).

Model Modality Output Weights
NV-Generate · CT Computed Tomography Image + paired 132-class anatomy mask nvidia/NV-Generate-CT
NV-Generate · MR MR (multi-contrast, multi-anatomy) Image only nvidia/NV-Generate-MR
NV-Generate · MR Brain Brain MR (T1 / T2 / FLAIR / SWI) Image only nvidia/NV-Generate-MR-Brain

Features

  • Hero card landing → per-model workspace.
  • niivue WebGL multiplanar viewer (axial / coronal / sagittal + 3D render).
  • Paired 132-class anatomy mask overlay for CT (with deterministic per-label colormap + named legend).
  • Window/Level presets (Soft Tissue / Lung / Bone / Brain) on the CT viewer.
  • Direct NIfTI download of every generated volume + mask.
  • ZeroGPU support for HF Spaces (@spaces.GPU decorator).

Local development

pip install -r requirements.txt
pip install -r repos/NV-Generate-CTMR/requirements.txt
python app.py                           # http://localhost:7860

app.py auto-clones the upstream NV-Generate-CTMR inference repo into ./repos/ on first run (no separate pre-build.sh needed). Weights are downloaded lazily from the Hugging Face Hub the first time each model is exercised, then cached.

Hugging Face Spaces deployment

Recommended hardware: ZeroGPU (A10G or H100), since each model needs ~16–80 GB VRAM depending on volume size.

  1. Create a new Space on huggingface.co with sdk: gradio (already set in this README's frontmatter).
  2. Push this repository:
    git remote add space https://huggingface.co/spaces/<your-username>/nv-generate
    git push space main
    
  3. In the Space's Settings → Hardware, select ZeroGPU.
  4. First build will install dependencies + clone the upstream repo. First generation on each model downloads weights into a persistent cache.

License

Component License
This repo (Gradio glue) Apache 2.0
Upstream NV-Generate-CTMR source Apache 2.0
NV-Generate-CT weights NVIDIA Open Model License
NV-Generate-MR weights NVIDIA OneWay Non-Commercial License — academic / research use only
NV-Generate-MR-Brain weights NVIDIA Open Model License

Not for clinical diagnostics. This is a research demo for synthetic data generation only.

Credits

Built on the MAISI framework:

NVIDIA Medtech, University of Zurich, Istanbul Medipol, Forithmus.