brianling16 commited on
Commit
397547b
·
verified ·
1 Parent(s): 1ad9d92

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +131 -3
README.md CHANGED
@@ -1,3 +1,131 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - not-for-all-audiences
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: 'Generate a logo for a car racing game app'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ ---
27
+
28
+ # logo-lora
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
+ Generate a logo for a car racing game app
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: `512`
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: 2600
63
+ - Learning rate: 8e-05
64
+ - Learning rate schedule: polynomial
65
+ - Warmup steps: 10
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: 5.0%
76
+
77
+
78
+ - LoRA Rank: 64
79
+ - LoRA Alpha: None
80
+ - LoRA Dropout: 0.1
81
+ - LoRA initialisation style: default
82
+
83
+
84
+ ## Datasets
85
+
86
+ ### app_data
87
+ - Repeats: 4
88
+ - Total number of images: 10001
89
+ - Total number of aspect buckets: 1
90
+ - Resolution: 0.262144 megapixels
91
+ - Cropped: False
92
+ - Crop style: None
93
+ - Crop aspect: None
94
+ - Used for regularisation data: No
95
+
96
+
97
+ ## Inference
98
+
99
+
100
+ ```python
101
+ import torch
102
+ from diffusers import DiffusionPipeline
103
+
104
+ model_id = 'black-forest-labs/FLUX.1-dev'
105
+ adapter_id = 'brianling16/logo-lora'
106
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
107
+ pipeline.load_lora_weights(adapter_id)
108
+
109
+ prompt = "Generate a logo for a car racing game app"
110
+
111
+
112
+ ## Optional: quantise the model to save on vram.
113
+ ## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
114
+ from optimum.quanto import quantize, freeze, qint8
115
+ quantize(pipeline.transformer, weights=qint8)
116
+ freeze(pipeline.transformer)
117
+
118
+ 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
119
+ image = pipeline(
120
+ prompt=prompt,
121
+ num_inference_steps=20,
122
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
123
+ width=512,
124
+ height=512,
125
+ guidance_scale=3.0,
126
+ ).images[0]
127
+ image.save("output.png", format="PNG")
128
+ ```
129
+
130
+
131
+