File size: 2,499 Bytes
1c72248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
# this is in yaml format. You can use json if you prefer
# I like both but yaml is easier to read and write
# plus it has comments which is nice for documentation
job: extract # tells the runner what to do
config:
  # the name will be used to create a folder in the output folder
  # it will also replace any [name] token in the rest of this config
  name: name_of_your_model
  # can be hugging face model, a .ckpt, or a .safetensors
  base_model: "/path/to/base/model.safetensors"
  # can be hugging face model, a .ckpt, or a .safetensors
  extract_model: "/path/to/model/to/extract/trained.safetensors"
  # we will create folder here with name above so. This will create /path/to/output/folder/name_of_your_model
  output_folder: "/path/to/output/folder"
  is_v2: false
  dtype: fp16 # saved dtype
  device: cpu # cpu, cuda:0, etc

  # processes can be chained like this to run multiple in a row
  # they must all use same models above, but great for testing different
  # sizes and typed of extractions. It is much faster as we already have the models loaded
  process:
  # process 1
  - type: locon  # locon or lora (locon is lycoris)
    filename: "[name]_64_32.safetensors" # will be put in output folder
    dtype: fp16
    mode: fixed
    linear: 64
    conv: 32

  # process 2
  - type: locon
    output_path: "/absolute/path/for/this/output.safetensors" # can be absolute
    mode: ratio
    linear: 0.2
    conv: 0.2

  # process 3
  - type: locon
    filename: "[name]_ratio_02.safetensors"
    mode: quantile
    linear: 0.5
    conv: 0.5

  # process 4
  - type: lora  # traditional lora extraction (lierla) with linear layers only
    filename: "[name]_4.safetensors"
    mode: fixed  # fixed, ratio, quantile supported for lora as well
    linear: 4 # lora dim or rank
    # no conv for lora

  # process 5
  - type: lora
    filename: "[name]_q05.safetensors"
    mode: quantile
    linear: 0.5

# you can put any information you want here, and it will be saved in the model
# the below is an example. I recommend doing trigger words at a minimum
# in the metadata. The software will include this plus some other information
meta:
  name: "[name]"  # [name] gets replaced with the name above
  description: A short description of your model
  trigger_words:
  - put
  - trigger
  - words
  - here
  version: '0.1'
  creator:
    name: Your Name
    email: [email protected]
    website: https://yourwebsite.com
  any: All meta data above is arbitrary, it can be whatever you want.