Instructions to use IrohXu/stable-diffusion-mimic-cxr-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use IrohXu/stable-diffusion-mimic-cxr-v0.1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("IrohXu/stable-diffusion-mimic-cxr-v0.1", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Stable Diffusion MIMIC-CXR Model Card
Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input. We finetune Stable-Diffusion-v1-4 checkpoint on MIMIC-CXR dataset.
This weights here are intended to be used with the 🧨 Diffusers library. Note: this weight can be only used with x-ray image editing, the performance is not good for generate a new x-ray image.
Our code related to this weight: https://github.com/IrohXu/PIE. Please star it if you like this work.
Cite as:
@article{liang2023pie,
title={PIE: Simulating Disease Progression via Progressive Image Editing},
author={Liang, Kaizhao and Cao, Xu and Liao, Kuei-Da and Gao, Tianren and Ye, Wenqian and Chen, Zhengyu and Cao, Jianguo and Nama, Tejas and Sun, Jimeng},
year={2023}
}
PyTorch
pip install --upgrade diffusers transformers scipy
Running the pipeline with the default PNDM scheduler:
import torch
from diffusers import StableDiffusionPipeline
model_id = "IrohXu/stable-diffusion-mimic-cxr-v0.1"
device = "cuda"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, safety_checker=None)
pipe = pipe.to(device)
prompt = "Severe edema in the left and right lower lobes, severity. Severe right and left pleural effusion is larger."
image = pipe(prompt).images[0]
image.save("result.png")
- Downloads last month
- 5