Instructions to use BiomedSyn/ours with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiomedSyn/ours with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BiomedSyn/ours", 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
| accelerate launch train_new_version.py \ | |
| --pretrained_model_name_or_path="CompVis/stable-diffusion-v1-4" \ | |
| --lora_path '/sd/AURA/layout2image_multi_lora/bs64_lr1e-4_rank16_10000/checkpoint-10000/'\ | |
| --fuse_lora --lora_scale 1.0 \ | |
| --mask_channels=3 \ | |
| --dataset_name=layout2img \ | |
| --resolution=512 \ | |
| --learning_rate=1e-5 \ | |
| --train_batch_size=2 \ | |
| --gradient_accumulation_steps=2 \ | |
| --report_to=wandb \ | |
| --train_data_dir="/sd/AURA/dataset/" \ | |
| --train_data_prompt="/sd/AURA/dataset/json-layout2image/train_prompt_layout2image_multi.json" \ | |
| --validation_steps=150 \ | |
| --max_train_steps=10000 \ | |
| --validation_image '/sd/AURA/dataset/test/36199/mask_36199.png' \ | |
| '/sd/AURA/dataset/test/36302/mask_36302.png' \ | |
| '/sd/AURA/dataset/test/57906/mask_57906.png' \ | |
| '/sd/AURA/dataset/test/69598/mask_69598.png' \ | |
| --validation_prompt "Normal." \ | |
| "mild Effusion on left lower lung." \ | |
| "mild Atelectasis on right lower lung, mild Effusion on left lower lung, mild Fibrosis on left lower lung, mild Fracture on right lung, mild Pleural Thickening on right lower lung." \ | |
| "severe Atelectasis on right lung, severe Consolidation on biliteral lung, mild Effusion on biliteral lung, severe Fibrosis on left lung." |