noahyoungs commited on
Commit
618ea0e
·
verified ·
1 Parent(s): d60f037

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +156 -0
README.md ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 'Minimalist icon, alert circle'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ - text: 'Minimalist icon, mood smile'
27
+ parameters:
28
+ negative_prompt: 'blurry, cropped, ugly'
29
+ output:
30
+ url: ./assets/image_2_0.png
31
+ - text: 'Minimalist icon, brand facebook'
32
+ parameters:
33
+ negative_prompt: 'blurry, cropped, ugly'
34
+ output:
35
+ url: ./assets/image_3_0.png
36
+ - text: 'Minimalist icon, badge hd'
37
+ parameters:
38
+ negative_prompt: 'blurry, cropped, ugly'
39
+ output:
40
+ url: ./assets/image_4_0.png
41
+ - text: 'Minimalist icon, coin off'
42
+ parameters:
43
+ negative_prompt: 'blurry, cropped, ugly'
44
+ output:
45
+ url: ./assets/image_5_0.png
46
+ - text: 'Minimalist icon, arrow up'
47
+ parameters:
48
+ negative_prompt: 'blurry, cropped, ugly'
49
+ output:
50
+ url: ./assets/image_6_0.png
51
+ ---
52
+
53
+ # icon-generator
54
+
55
+ This is a standard PEFT LoRA derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
56
+
57
+
58
+ The main validation prompt used during training was:
59
+ ```
60
+ Minimalist icon, arrow up
61
+ ```
62
+
63
+
64
+ ## Validation settings
65
+ - CFG: `3.0`
66
+ - CFG Rescale: `0.0`
67
+ - Steps: `20`
68
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
69
+ - Seed: `42`
70
+ - Resolution: `1024x1024`
71
+ - Skip-layer guidance:
72
+
73
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
74
+
75
+ You can find some example images in the following gallery:
76
+
77
+
78
+ <Gallery />
79
+
80
+ The text encoder **was not** trained.
81
+ You may reuse the base model text encoder for inference.
82
+
83
+
84
+ ## Training settings
85
+
86
+ - Training epochs: 0
87
+ - Training steps: 500
88
+ - Learning rate: 8e-05
89
+ - Learning rate schedule: polynomial
90
+ - Warmup steps: 100
91
+ - Max grad norm: 1.0
92
+ - Effective batch size: 1
93
+ - Micro-batch size: 1
94
+ - Gradient accumulation steps: 1
95
+ - Number of GPUs: 1
96
+ - Gradient checkpointing: True
97
+ - 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'])
98
+ - Optimizer: adamw_bf16
99
+ - Trainable parameter precision: Pure BF16
100
+ - Caption dropout probability: 5.0%
101
+
102
+
103
+ - LoRA Rank: 16
104
+ - LoRA Alpha: None
105
+ - LoRA Dropout: 0.1
106
+ - LoRA initialisation style: default
107
+
108
+
109
+ ## Datasets
110
+
111
+ ### tabler-icons-1024
112
+ - Repeats: 10
113
+ - Total number of images: 4739
114
+ - Total number of aspect buckets: 1
115
+ - Resolution: 1.048576 megapixels
116
+ - Cropped: False
117
+ - Crop style: None
118
+ - Crop aspect: None
119
+ - Used for regularisation data: No
120
+
121
+
122
+ ## Inference
123
+
124
+
125
+ ```python
126
+ import torch
127
+ from diffusers import DiffusionPipeline
128
+
129
+ model_id = 'black-forest-labs/FLUX.1-dev'
130
+ adapter_id = 'noahyoungs/icon-generator'
131
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
132
+ pipeline.load_lora_weights(adapter_id)
133
+
134
+ prompt = "Minimalist icon, arrow up"
135
+
136
+
137
+ ## Optional: quantise the model to save on vram.
138
+ ## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
139
+ from optimum.quanto import quantize, freeze, qint8
140
+ quantize(pipeline.transformer, weights=qint8)
141
+ freeze(pipeline.transformer)
142
+
143
+ 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
144
+ image = pipeline(
145
+ prompt=prompt,
146
+ num_inference_steps=20,
147
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
148
+ width=1024,
149
+ height=1024,
150
+ guidance_scale=3.0,
151
+ ).images[0]
152
+ image.save("output.png", format="PNG")
153
+ ```
154
+
155
+
156
+