Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: creativeml-openrail-m
|
| 3 |
+
base_model: "black-forest-labs/FLUX.1-dev"
|
| 4 |
+
tags:
|
| 5 |
+
- stable-diffusion
|
| 6 |
+
- stable-diffusion-diffusers
|
| 7 |
+
- text-to-image
|
| 8 |
+
- diffusers
|
| 9 |
+
- simpletuner
|
| 10 |
+
- lora
|
| 11 |
+
- template:sd-lora
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# FLUX.1 dev SimpleTuner Test
|
| 15 |
+
|
| 16 |
+
This is a LoRA derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
The main validation prompt used during training was:
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
a photo of man
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## Validation settings
|
| 27 |
+
- CFG: `3.5`
|
| 28 |
+
- CFG Rescale: `0.0`
|
| 29 |
+
- Steps: `30`
|
| 30 |
+
- Sampler: `None`
|
| 31 |
+
- Seed: `42`
|
| 32 |
+
- Resolution: `1024`
|
| 33 |
+
|
| 34 |
+
Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
|
| 35 |
+
|
| 36 |
+
You can find some example images in the following gallery:
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
The text encoder **was not** trained.
|
| 40 |
+
You may reuse the base model text encoder for inference.
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
## Training settings
|
| 44 |
+
|
| 45 |
+
- Training epochs: 30
|
| 46 |
+
- Training steps: 150
|
| 47 |
+
- Learning rate: 8e-07
|
| 48 |
+
- Effective batch size: 64
|
| 49 |
+
- Micro-batch size: 16
|
| 50 |
+
- Gradient accumulation steps: 4
|
| 51 |
+
- Number of GPUs: 1
|
| 52 |
+
- Prediction type: epsilon
|
| 53 |
+
- Rescaled betas zero SNR: False
|
| 54 |
+
- Optimizer: AdamW, stochastic bf16
|
| 55 |
+
- Precision: Pure BF16
|
| 56 |
+
- Xformers: Not used
|
| 57 |
+
- LoRA Rank: 16
|
| 58 |
+
- LoRA Alpha: 16
|
| 59 |
+
- LoRA Dropout: 0.1
|
| 60 |
+
- LoRA initialisation style: default
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
## Datasets
|
| 64 |
+
|
| 65 |
+
### AndroFlow
|
| 66 |
+
- Repeats: 0
|
| 67 |
+
- Total number of images: 320
|
| 68 |
+
- Total number of aspect buckets: 1
|
| 69 |
+
- Resolution: 1 megapixels
|
| 70 |
+
- Cropped: True
|
| 71 |
+
- Crop style: random
|
| 72 |
+
- Crop aspect: square
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Inference
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
import torch
|
| 80 |
+
from diffusers import DiffusionPipeline
|
| 81 |
+
|
| 82 |
+
model_id = 'black-forest-labs/FLUX.1-dev'
|
| 83 |
+
adapter_id = 'AndroFlow-FLUX-SimpleTuner-1'
|
| 84 |
+
pipeline = DiffusionPipeline.from_pretrained(model_id)\pipeline.load_adapter(adapter_id)
|
| 85 |
+
|
| 86 |
+
prompt = "a photo of man"
|
| 87 |
+
negative_prompt = ""
|
| 88 |
+
|
| 89 |
+
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
|
| 90 |
+
image = pipeline(
|
| 91 |
+
prompt=prompt,
|
| 92 |
+
negative_prompt='',
|
| 93 |
+
num_inference_steps=30,
|
| 94 |
+
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
|
| 95 |
+
width=1152,
|
| 96 |
+
height=768,
|
| 97 |
+
guidance_scale=3.5,
|
| 98 |
+
guidance_rescale=0.0,
|
| 99 |
+
).images[0]
|
| 100 |
+
image.save("output.png", format="PNG")
|
| 101 |
+
```
|