binarydaddy commited on
Commit
f4ef7f9
·
verified ·
1 Parent(s): 3fde726

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +135 -0
README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - image-to-image
9
+ - diffusers
10
+ - simpletuner
11
+ - not-for-all-audiences
12
+ - lora
13
+ - template:sd-lora
14
+ - standard
15
+ pipeline_tag: text-to-image
16
+ inference: true
17
+ widget:
18
+ - text: 'unconditional (blank prompt)'
19
+ parameters:
20
+ negative_prompt: 'blurry, cropped, ugly'
21
+ output:
22
+ url: ./assets/image_0_0.png
23
+ - text: 'A 2D vfx of flame effect in red and yellow, glazing against black background'
24
+ parameters:
25
+ negative_prompt: 'blurry, cropped, ugly'
26
+ output:
27
+ url: ./assets/image_1_0.png
28
+ ---
29
+
30
+ # simpletuner-lora
31
+
32
+ This is a standard PEFT LoRA derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
33
+
34
+ The main validation prompt used during training was:
35
+ ```
36
+ A 2D vfx of flame effect in red and yellow, glazing against black background
37
+ ```
38
+
39
+
40
+ ## Validation settings
41
+ - CFG: `3.0`
42
+ - CFG Rescale: `0.0`
43
+ - Steps: `20`
44
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
45
+ - Seed: `42`
46
+ - Resolution: `1024x1024`
47
+ - Skip-layer guidance:
48
+
49
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
50
+
51
+ You can find some example images in the following gallery:
52
+
53
+
54
+ <Gallery />
55
+
56
+ The text encoder **was not** trained.
57
+ You may reuse the base model text encoder for inference.
58
+
59
+
60
+ ## Training settings
61
+
62
+ - Training epochs: 0
63
+ - Training steps: 1000
64
+ - Learning rate: 0.0001
65
+ - Learning rate schedule: polynomial
66
+ - Warmup steps: 100
67
+ - Max grad value: 2.0
68
+ - Effective batch size: 8
69
+ - Micro-batch size: 1
70
+ - Gradient accumulation steps: 1
71
+ - Number of GPUs: 8
72
+ - Gradient checkpointing: True
73
+ - Prediction type: flow_matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flux_lora_target=all'])
74
+ - Optimizer: adamw_bf16
75
+ - Trainable parameter precision: Pure BF16
76
+ - Base model precision: `no_change`
77
+ - Caption dropout probability: 0.1%
78
+
79
+
80
+ - LoRA Rank: 512
81
+ - LoRA Alpha: None
82
+ - LoRA Dropout: 0.1
83
+ - LoRA initialisation style: default
84
+
85
+
86
+ ## Datasets
87
+
88
+ ### mapledata
89
+ - Repeats: 5
90
+ - Total number of images: ~2872
91
+ - Total number of aspect buckets: 1
92
+ - Resolution: 1.0 megapixels
93
+ - Cropped: False
94
+ - Crop style: None
95
+ - Crop aspect: None
96
+ - Used for regularisation data: No
97
+
98
+
99
+ ## Inference
100
+
101
+
102
+ ```python
103
+ import torch
104
+ from diffusers import DiffusionPipeline
105
+
106
+ model_id = 'black-forest-labs/FLUX.1-dev'
107
+ adapter_id = 'binarydaddy/simpletuner-lora'
108
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
109
+ pipeline.load_lora_weights(adapter_id)
110
+
111
+ prompt = "A 2D vfx of flame effect in red and yellow, glazing against black background"
112
+
113
+
114
+ ## Optional: quantise the model to save on vram.
115
+ ## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
116
+ #from optimum.quanto import quantize, freeze, qint8
117
+ #quantize(pipeline.transformer, weights=qint8)
118
+ #freeze(pipeline.transformer)
119
+
120
+ 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
121
+ model_output = pipeline(
122
+ prompt=prompt,
123
+ num_inference_steps=20,
124
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
125
+ width=1024,
126
+ height=1024,
127
+ guidance_scale=3.0,
128
+ ).images[0]
129
+
130
+ model_output.save("output.png", format="PNG")
131
+
132
+ ```
133
+
134
+
135
+