Update README.md
Browse files
README.md
CHANGED
@@ -21,6 +21,12 @@ widget: []
|
|
21 |
|
22 |
FLUX.1 [dev] is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions.
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
## Model description
|
25 |
|
26 |
These are LoRA adaption weights for the FLUX.1 [dev] model (```black-forest-labs/FLUX.1-dev```). This is a gated model, you must first get access to it before loading this LoRA adapter.
|
@@ -90,12 +96,14 @@ repo_id = 'lamm-mit/leaf-FLUX.1-dev'
|
|
90 |
pipeline = FluxPipeline.from_pretrained(
|
91 |
"black-forest-labs/FLUX.1-dev",
|
92 |
torch_dtype=torch.bfloat16,
|
|
|
93 |
)
|
94 |
|
|
|
|
|
95 |
pipeline.load_lora_weights(repo_id, )
|
96 |
pipeline=pipeline.to('cuda')
|
97 |
```
|
98 |
-
|
99 |
Image generation:
|
100 |
|
101 |
```python
|
@@ -115,7 +123,9 @@ for _ in range(num_rows):
|
|
115 |
|
116 |
all_images.extend(image)
|
117 |
|
118 |
-
grid = image_grid(all_images, num_rows, num_samples,
|
|
|
119 |
grid
|
120 |
```
|
121 |
|
|
|
|
21 |
|
22 |
FLUX.1 [dev] is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions.
|
23 |
|
24 |
+
Install ```diffusers```
|
25 |
+
|
26 |
+
```raw
|
27 |
+
pip install -U diffusers
|
28 |
+
```
|
29 |
+
|
30 |
## Model description
|
31 |
|
32 |
These are LoRA adaption weights for the FLUX.1 [dev] model (```black-forest-labs/FLUX.1-dev```). This is a gated model, you must first get access to it before loading this LoRA adapter.
|
|
|
96 |
pipeline = FluxPipeline.from_pretrained(
|
97 |
"black-forest-labs/FLUX.1-dev",
|
98 |
torch_dtype=torch.bfloat16,
|
99 |
+
max_sequence_length=512,
|
100 |
)
|
101 |
|
102 |
+
#pipeline.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Comment out if you have enough GPU VRAM
|
103 |
+
|
104 |
pipeline.load_lora_weights(repo_id, )
|
105 |
pipeline=pipeline.to('cuda')
|
106 |
```
|
|
|
107 |
Image generation:
|
108 |
|
109 |
```python
|
|
|
123 |
|
124 |
all_images.extend(image)
|
125 |
|
126 |
+
grid = image_grid(all_images, num_rows, num_samples,
|
127 |
+
save_individual_files=True, )
|
128 |
grid
|
129 |
```
|
130 |
|
131 |
+
![Uploading image_grid_20240902_063338.png…]()
|