Text-to-Image
Diffusers
diffusers-training
lora
FLUX.1-dev
science
materiomics
bio-inspired
materials science
generative AI for science
Instructions to use lamm-mit/leaf-L-FLUX.1-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lamm-mit/leaf-L-FLUX.1-dev with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("lamm-mit/leaf-L-FLUX.1-dev") prompt = "<leaf microstructure>" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Update README.md
Browse files
README.md
CHANGED
|
@@ -175,7 +175,7 @@ grid
|
|
| 175 |

|
| 176 |
|
| 177 |
|
| 178 |
-
Image generation - Example #3:
|
| 179 |
|
| 180 |
```python
|
| 181 |
prompt=prompt="""A sign with letters inspired by the patterns in <leaf microstructure>, it says "MATERIOMICS".
|
|
@@ -199,3 +199,34 @@ grid
|
|
| 199 |
|
| 200 |
|
| 201 |

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |

|
| 176 |
|
| 177 |
|
| 178 |
+
Image generation - Example #3 (different aspect ratio, e.g. 1024x1920):
|
| 179 |
|
| 180 |
```python
|
| 181 |
prompt=prompt="""A sign with letters inspired by the patterns in <leaf microstructure>, it says "MATERIOMICS".
|
|
|
|
| 199 |
|
| 200 |
|
| 201 |

|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
Image generation - Example #4:
|
| 206 |
+
|
| 207 |
+
```python
|
| 208 |
+
prompt="""A cube that looks like a leaf microstructure, placed in a stunning mountain landscape with snow.
|
| 209 |
+
|
| 210 |
+
The photo is taken with a Sony A1 camera, bokeh, during the golden hour.
|
| 211 |
+
"""
|
| 212 |
+
|
| 213 |
+
num_samples =2
|
| 214 |
+
num_rows = 2
|
| 215 |
+
n_steps=25
|
| 216 |
+
guidance_scale=15.
|
| 217 |
+
all_images = []
|
| 218 |
+
for _ in range(num_rows):
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
image = pipeline(prompt,num_inference_steps=n_steps,num_images_per_prompt=num_samples,
|
| 222 |
+
guidance_scale=guidance_scale,
|
| 223 |
+
height=1024, width=1024,).images
|
| 224 |
+
|
| 225 |
+
all_images.extend(image)
|
| 226 |
+
|
| 227 |
+
grid = image_grid(all_images, num_rows, num_samples, save_individual_files=True, )
|
| 228 |
+
grid
|
| 229 |
+
```
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+

|