Model card auto-generated by SimpleTuner
Browse files
README.md
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
base_model: "black-forest-labs/FLUX.1-dev"
|
4 |
+
tags:
|
5 |
+
- flux
|
6 |
+
- flux-diffusers
|
7 |
+
- text-to-image
|
8 |
+
- diffusers
|
9 |
+
- simpletuner
|
10 |
+
- safe-for-work
|
11 |
+
- lora
|
12 |
+
- template:sd-lora
|
13 |
+
- standard
|
14 |
+
inference: true
|
15 |
+
widget:
|
16 |
+
- text: 'unconditional (blank prompt)'
|
17 |
+
parameters:
|
18 |
+
negative_prompt: 'blurry, cropped, ugly'
|
19 |
+
output:
|
20 |
+
url: ./assets/image_0_0.png
|
21 |
+
- text: 'A girl in light blue sits at the bar counter, holding an ice-cold wine glass and drinking alone on top of the Eiffel Tower, with a night view outside the window.. It features a close-up shot of her sitting by herself. She has long hair, wears glasses, faces away from the camera, and is wearing white shoes, black pants, a gray jacket, and a green scarf. with bright colors and a Paris night background featuring the Eiffel Tower. The composition is elegant, with the woman sitting on a high stool'
|
22 |
+
parameters:
|
23 |
+
negative_prompt: 'blurry, cropped, ugly'
|
24 |
+
output:
|
25 |
+
url: ./assets/image_1_0.png
|
26 |
+
---
|
27 |
+
|
28 |
+
# jazzy-st-2211
|
29 |
+
|
30 |
+
This is a standard PEFT LoRA derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
|
31 |
+
|
32 |
+
|
33 |
+
The main validation prompt used during training was:
|
34 |
+
```
|
35 |
+
A girl in light blue sits at the bar counter, holding an ice-cold wine glass and drinking alone on top of the Eiffel Tower, with a night view outside the window.. It features a close-up shot of her sitting by herself. She has long hair, wears glasses, faces away from the camera, and is wearing white shoes, black pants, a gray jacket, and a green scarf. with bright colors and a Paris night background featuring the Eiffel Tower. The composition is elegant, with the woman sitting on a high stool
|
36 |
+
```
|
37 |
+
|
38 |
+
|
39 |
+
## Validation settings
|
40 |
+
- CFG: `3.0`
|
41 |
+
- CFG Rescale: `0.0`
|
42 |
+
- Steps: `20`
|
43 |
+
- Sampler: `FlowMatchEulerDiscreteScheduler`
|
44 |
+
- Seed: `42`
|
45 |
+
- Resolution: `1080x1920`
|
46 |
+
- Skip-layer guidance:
|
47 |
+
|
48 |
+
Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
|
49 |
+
|
50 |
+
You can find some example images in the following gallery:
|
51 |
+
|
52 |
+
|
53 |
+
<Gallery />
|
54 |
+
|
55 |
+
The text encoder **was not** trained.
|
56 |
+
You may reuse the base model text encoder for inference.
|
57 |
+
|
58 |
+
|
59 |
+
## Training settings
|
60 |
+
|
61 |
+
- Training epochs: 0
|
62 |
+
- Training steps: 500
|
63 |
+
- Learning rate: 0.0004
|
64 |
+
- Learning rate schedule: polynomial
|
65 |
+
- Warmup steps: 100
|
66 |
+
- Max grad norm: 2.0
|
67 |
+
- Effective batch size: 1
|
68 |
+
- Micro-batch size: 1
|
69 |
+
- Gradient accumulation steps: 1
|
70 |
+
- Number of GPUs: 1
|
71 |
+
- Gradient checkpointing: True
|
72 |
+
- Prediction type: flow-matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all'])
|
73 |
+
- Optimizer: adamw_bf16
|
74 |
+
- Trainable parameter precision: Pure BF16
|
75 |
+
- Caption dropout probability: 10.0%
|
76 |
+
|
77 |
+
- LoRA Rank: 32
|
78 |
+
- LoRA Alpha: 32.0
|
79 |
+
- LoRA Dropout: 0.1
|
80 |
+
- LoRA initialisation style: default
|
81 |
+
|
82 |
+
|
83 |
+
## Datasets
|
84 |
+
|
85 |
+
### jazzy-512
|
86 |
+
- Repeats: 10
|
87 |
+
- Total number of images: 23
|
88 |
+
- Total number of aspect buckets: 2
|
89 |
+
- Resolution: 0.262144 megapixels
|
90 |
+
- Cropped: False
|
91 |
+
- Crop style: None
|
92 |
+
- Crop aspect: None
|
93 |
+
- Used for regularisation data: No
|
94 |
+
### jazzy-768
|
95 |
+
- Repeats: 10
|
96 |
+
- Total number of images: 23
|
97 |
+
- Total number of aspect buckets: 1
|
98 |
+
- Resolution: 0.589824 megapixels
|
99 |
+
- Cropped: False
|
100 |
+
- Crop style: None
|
101 |
+
- Crop aspect: None
|
102 |
+
- Used for regularisation data: No
|
103 |
+
### jazzy-1024
|
104 |
+
- Repeats: 10
|
105 |
+
- Total number of images: 23
|
106 |
+
- Total number of aspect buckets: 1
|
107 |
+
- Resolution: 1.048576 megapixels
|
108 |
+
- Cropped: False
|
109 |
+
- Crop style: None
|
110 |
+
- Crop aspect: None
|
111 |
+
- Used for regularisation data: No
|
112 |
+
|
113 |
+
|
114 |
+
## Inference
|
115 |
+
|
116 |
+
|
117 |
+
```python
|
118 |
+
import torch
|
119 |
+
from diffusers import DiffusionPipeline
|
120 |
+
|
121 |
+
model_id = 'black-forest-labs/FLUX.1-dev'
|
122 |
+
adapter_id = 'linhqyy/jazzy-st-2211'
|
123 |
+
pipeline = DiffusionPipeline.from_pretrained(model_id), torch_dtype=torch.bfloat16) # loading directly in bf16
|
124 |
+
pipeline.load_lora_weights(adapter_id)
|
125 |
+
|
126 |
+
prompt = "A girl in light blue sits at the bar counter, holding an ice-cold wine glass and drinking alone on top of the Eiffel Tower, with a night view outside the window.. It features a close-up shot of her sitting by herself. She has long hair, wears glasses, faces away from the camera, and is wearing white shoes, black pants, a gray jacket, and a green scarf. with bright colors and a Paris night background featuring the Eiffel Tower. The composition is elegant, with the woman sitting on a high stool"
|
127 |
+
|
128 |
+
|
129 |
+
## Optional: quantise the model to save on vram.
|
130 |
+
## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
|
131 |
+
#from optimum.quanto import quantize, freeze, qint8
|
132 |
+
#quantize(pipeline.transformer, weights=qint8)
|
133 |
+
#freeze(pipeline.transformer)
|
134 |
+
|
135 |
+
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
|
136 |
+
image = pipeline(
|
137 |
+
prompt=prompt,
|
138 |
+
num_inference_steps=20,
|
139 |
+
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
|
140 |
+
width=1080,
|
141 |
+
height=1920,
|
142 |
+
guidance_scale=3.0,
|
143 |
+
).images[0]
|
144 |
+
image.save("output.png", format="PNG")
|
145 |
+
```
|
146 |
+
|