Text-to-Image
Diffusers
diffusers-training
lora
template:sd-lora
stable-diffusion-3
stable-diffusion-3-diffusers
adapters
LoRA
biological structures
science
materiomics
bio-inspired
materials science
Instructions to use lamm-mit/stable-diffusion-3-medium-leaf-inspired with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lamm-mit/stable-diffusion-3-medium-leaf-inspired with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("lamm-mit/stable-diffusion-3-medium-leaf-inspired") prompt = "<leaf microstructure>" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Upload train_dreambooth_lora_sd3.py
Browse files
train_dreambooth_lora_sd3.py
CHANGED
|
@@ -791,7 +791,11 @@ class DreamBoothDataset(Dataset):
|
|
| 791 |
if class_data_root is not None:
|
| 792 |
self.class_data_root = Path(class_data_root)
|
| 793 |
self.class_data_root.mkdir(parents=True, exist_ok=True)
|
| 794 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 795 |
if class_num is not None:
|
| 796 |
self.num_class_images = min(len(self.class_images_path), class_num)
|
| 797 |
else:
|
|
|
|
| 791 |
if class_data_root is not None:
|
| 792 |
self.class_data_root = Path(class_data_root)
|
| 793 |
self.class_data_root.mkdir(parents=True, exist_ok=True)
|
| 794 |
+
|
| 795 |
+
#self.class_images_path = list(self.class_data_root.iterdir())
|
| 796 |
+
|
| 797 |
+
self.class_images_path = [p for p in self.class_data_root.iterdir() if p.suffix.lower() in {'.jpg', '.jpeg', '.png'}]
|
| 798 |
+
|
| 799 |
if class_num is not None:
|
| 800 |
self.num_class_images = min(len(self.class_images_path), class_num)
|
| 801 |
else:
|