You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`2024/12/12`**: Load multiple LoRAs for inference.
22
23
-**`2024/10/22`**: LoRA support for Hyper SDXL.
23
24
-**`2024/8/1`**: Orbax is the new default checkpointer. You can still use `pipeline.save_pretrained` after training to save in diffusers format.
@@ -47,7 +48,8 @@ MaxDiffusion supports
47
48
*[Training](#training)
48
49
*[Dreambooth](#dreambooth)
49
50
*[Inference](#inference)
50
-
*[Flux](#flux)
51
+
*[Flux](#flux)
52
+
*[Flux LoRA](#flux-lora)
51
53
*[Hyper-SD XL LoRA](#hyper-sdxl-lora)
52
54
*[Load Multiple LoRA](#load-multiple-lora)
53
55
*[SDXL Lightning](#sdxl-lightning)
@@ -169,6 +171,24 @@ To generate images, run the following command:
169
171
python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_schnell.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt="photograph of an electronics chip in the shape of a race car with trillium written on its side" per_device_batch_size=1 ici_data_parallelism=1 ici_fsdp_parallelism=-1 offload_encoders=False
170
172
```
171
173
174
+
## Flux LoRA
175
+
176
+
Disclaimer: not all LoRA formats have been tested. If there is a specific LoRA that doesn't load, please let us know.
177
+
178
+
Tested with [Amateur Photography](https://civitai.com/models/652699/amateur-photography-flux-dev) and [XLabs-AI](https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main) LoRA collection.
179
+
180
+
First download the LoRA file to a local directory, for example, `/home/jfacevedo/anime_lora.safetensors`. Then run as follows:
181
+
182
+
```bash
183
+
python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{"lora_model_name_or_path": ["/home/jfacevedo/anime_lora.safetensors"], "weight_name": ["anime_lora.safetensors"], "adapter_name": ["anime"], "scale": [0.8], "from_pt": ["true"]}'
184
+
```
185
+
186
+
Loading multiple LoRAs is supported as follows:
187
+
188
+
```bash
189
+
python src/maxdiffusion/generate_flux.py src/maxdiffusion/configs/base_flux_dev.yml jax_cache_dir=/tmp/cache_dir run_name=flux_test output_dir=/tmp/ prompt='A cute corgi lives in a house made out of sushi, anime' num_inference_steps=28 ici_data_parallelism=1 ici_fsdp_parallelism=-1 split_head_dim=True lora_config='{"lora_model_name_or_path": ["/home/jfacevedo/anime_lora.safetensors", "/home/jfacevedo/amateurphoto-v6-forcu.safetensors"], "weight_name": ["anime_lora.safetensors","amateurphoto-v6-forcu.safetensors"], "adapter_name": ["anime","realistic"], "scale": [0.6, 0.6], "from_pt": ["true","true"]}'
190
+
```
191
+
172
192
## Hyper SDXL LoRA
173
193
174
194
Supports Hyper-SDXL models from [ByteDance](https://huggingface.co/ByteDance/Hyper-SD)
0 commit comments