Instructions to use chimbiwide/cxr-pneumonia-dreambooth with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use chimbiwide/cxr-pneumonia-dreambooth with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("chimbiwide/cxr-pneumonia-dreambooth", 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
|
Download README.md from chimbiwide/cxr-pneumonia-dreambooth: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/chimbiwide/cxr-pneumonia-dreambooth/resolve/main/README.md
- Command line
-
hf download hf://chimbiwide/cxr-pneumonia-dreambooth/README.md
-
curl -L -o README.md https://huggingface.co/chimbiwide/cxr-pneumonia-dreambooth/resolve/main/README.md
1.74 kB
metadata
license: openrail++
datasets:
- hf-vision/chest-xray-pneumonia
language:
- en
base_model:
- Manojb/stable-diffusion-2-1-base
library_name: diffusers
cxr-pneumonia-dreambooth
Diffuser model finetuned using DreamBooth from stable-diffusion-2-1-base to generate synthetic pneumonia chest x-ray images.
The bones still look a little weird...
Generation Prompt
Due to the model being trained using DreamBooth, it is crucial that the correct prompt is used during generation:
A chest xray showing pneumonia infection, lung opacity
Training Config
training_config = {
"method": "full_dreambooth",
"resolution": 512,
"train_batch_size": 8,
"gradient_accumulation_steps": 2, # Effective batch size: 16
"learning_rate": 5e-6, # Lower for full finetuning
"max_train_steps": 800,
"train_text_encoder": True, # Thanks to 80GB A100 in Colab this is possible
"with_prior_preservation": True,
"prior_loss_weight": 1.0,
"num_class_images": 200,
"mixed_precision": "fp16",
"gradient_checkpointing": False,
}
Validation Images
Train Steps 200
Train Steps 400
Train Steps 600
Train Steps 800



