cof-cli 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cof_cli/__init__.py +5 -0
- cof_cli/cli.py +305 -0
- cof_cli/completeness.py +131 -0
- cof_cli/container.py +230 -0
- cof_cli/convert.py +362 -0
- cof_cli/migrate.py +297 -0
- cof_cli/model.py +465 -0
- cof_cli/ops.py +381 -0
- cof_cli/schemas/attitude.schema.json +248 -0
- cof_cli/schemas/body.schema.json +98 -0
- cof_cli/schemas/card.schema.json +107 -0
- cof_cli/schemas/consent.schema.json +134 -0
- cof_cli/schemas/garments-1.0.json +41 -0
- cof_cli/schemas/hair.schema.json +104 -0
- cof_cli/schemas/manifest.schema.json +1757 -0
- cof_cli/schemas/pose.schema.json +206 -0
- cof_cli/schemas/psyche.schema.json +252 -0
- cof_cli/schemas/skeleton.schema.json +88 -0
- cof_cli/schemas/visemes.schema.json +28 -0
- cof_cli/schemas/voice-profile.schema.json +254 -0
- cof_cli/schemas/weights.schema.json +188 -0
- cof_cli/tokens.py +30 -0
- cof_cli/validate.py +985 -0
- cof_cli-1.0.0.dist-info/METADATA +39 -0
- cof_cli-1.0.0.dist-info/RECORD +28 -0
- cof_cli-1.0.0.dist-info/WHEEL +5 -0
- cof_cli-1.0.0.dist-info/entry_points.txt +2 -0
- cof_cli-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://yannsouetre.github.io/cof/schemas/1.0/voice-profile.schema.json",
|
|
4
|
+
"title": "elements/voice/<v>/profile.json — canonical voice profile, samples, engine artifacts",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"canonical": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"gender_presentation": {
|
|
12
|
+
"enum": [
|
|
13
|
+
"",
|
|
14
|
+
"feminine",
|
|
15
|
+
"masculine",
|
|
16
|
+
"androgynous",
|
|
17
|
+
"neutral",
|
|
18
|
+
"nonhuman"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"age_perceived": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "'30s', 'child', 'elderly'… — perception, not identity"
|
|
24
|
+
},
|
|
25
|
+
"accent": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"pitch": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"range": {
|
|
32
|
+
"enum": [
|
|
33
|
+
"",
|
|
34
|
+
"very-low",
|
|
35
|
+
"low",
|
|
36
|
+
"medium",
|
|
37
|
+
"high",
|
|
38
|
+
"very-high"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"f0_median_hz": {
|
|
42
|
+
"type": "number",
|
|
43
|
+
"minimum": 40,
|
|
44
|
+
"maximum": 1200
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"rate": {
|
|
49
|
+
"enum": [
|
|
50
|
+
"",
|
|
51
|
+
"slow",
|
|
52
|
+
"slow-medium",
|
|
53
|
+
"medium",
|
|
54
|
+
"medium-fast",
|
|
55
|
+
"fast"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"loudness": {
|
|
59
|
+
"enum": [
|
|
60
|
+
"",
|
|
61
|
+
"soft",
|
|
62
|
+
"medium",
|
|
63
|
+
"loud"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"timbre": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"expressivity": {
|
|
73
|
+
"enum": [
|
|
74
|
+
"",
|
|
75
|
+
"flat",
|
|
76
|
+
"moderate",
|
|
77
|
+
"expressive",
|
|
78
|
+
"theatrical"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"vpa": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"description": "Vocal Profile Analysis (Laver) — ordinal values 0–6 per parameter",
|
|
84
|
+
"additionalProperties": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0,
|
|
87
|
+
"maximum": 6
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"speech_style": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"register": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"fillers": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"items": {
|
|
101
|
+
"type": "string"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"laugh": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"pauses": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"emotion_range": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "string"
|
|
116
|
+
},
|
|
117
|
+
"description": "EmotionML categories covered by the samples"
|
|
118
|
+
},
|
|
119
|
+
"samples": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"required": [
|
|
124
|
+
"id",
|
|
125
|
+
"path"
|
|
126
|
+
],
|
|
127
|
+
"properties": {
|
|
128
|
+
"id": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"pattern": "^[a-z0-9][a-z0-9.-]{0,63}$"
|
|
131
|
+
},
|
|
132
|
+
"path": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"pattern": "^(?!/)(?!.*\\.\\.)[A-Za-z0-9._/-]+$"
|
|
135
|
+
},
|
|
136
|
+
"duration_s": {
|
|
137
|
+
"type": "number",
|
|
138
|
+
"minimum": 0
|
|
139
|
+
},
|
|
140
|
+
"transcript": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"pattern": "^(?!/)(?!.*\\.\\.)[A-Za-z0-9._/-]+$"
|
|
143
|
+
},
|
|
144
|
+
"emotion": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"language": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
|
|
150
|
+
},
|
|
151
|
+
"canonical_slot": {
|
|
152
|
+
"enum": [
|
|
153
|
+
"8s",
|
|
154
|
+
"30s",
|
|
155
|
+
"2min",
|
|
156
|
+
"other"
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"engines": {
|
|
163
|
+
"type": "array",
|
|
164
|
+
"description": "engine artifacts: speaker embeddings, fine-tuned voice weights, indexes or cloud voice ids, each tied to the exact engine and model that can read it",
|
|
165
|
+
"items": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"required": [
|
|
168
|
+
"engine",
|
|
169
|
+
"version"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"engine": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "engine family: xtts, openvoice, cosyvoice, f5-tts, fish-speech, chatterbox, kokoro, gpt-sovits, rvc, so-vits-svc, piper, elevenlabs, typecast, other…"
|
|
175
|
+
},
|
|
176
|
+
"version": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"description": "engine / model version that produced the artifact (e.g. 2.0.3, v2)"
|
|
179
|
+
},
|
|
180
|
+
"artifact": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"pattern": "^[a-z0-9][a-z0-9.-]{0,63}$"
|
|
183
|
+
},
|
|
184
|
+
"voice_id": {
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
"expires": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"format": "date"
|
|
190
|
+
},
|
|
191
|
+
"model": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"description": "exact model or checkpoint: Hugging Face repo id, file name or vendor model id (e.g. coqui/XTTS-v2, eleven_v3)"
|
|
194
|
+
},
|
|
195
|
+
"model_sha256": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
198
|
+
},
|
|
199
|
+
"kind": {
|
|
200
|
+
"enum": [
|
|
201
|
+
"speaker-embedding",
|
|
202
|
+
"fine-tuned-weights",
|
|
203
|
+
"index",
|
|
204
|
+
"cloud-voice-id",
|
|
205
|
+
"other"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"files": {
|
|
209
|
+
"type": "array",
|
|
210
|
+
"items": {
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"description": "asset ids (role engine-artifact): .safetensors, .npz/.npy (numeric), .json, .onnx, .index — never pickles (.pt/.pth/.ckpt/.pkl)"
|
|
214
|
+
},
|
|
215
|
+
"sample_rate": {
|
|
216
|
+
"type": "integer"
|
|
217
|
+
},
|
|
218
|
+
"notes": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"prompt_renderings": {
|
|
225
|
+
"type": "object",
|
|
226
|
+
"additionalProperties": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
},
|
|
229
|
+
"description": "per-engine text renderings: parler-tts, elevenlabs-description, generic"
|
|
230
|
+
},
|
|
231
|
+
"ssml_template": {
|
|
232
|
+
"type": "string"
|
|
233
|
+
},
|
|
234
|
+
"fingerprint": {
|
|
235
|
+
"type": "object",
|
|
236
|
+
"properties": {
|
|
237
|
+
"model": {
|
|
238
|
+
"type": "string"
|
|
239
|
+
},
|
|
240
|
+
"path": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"pattern": "^(?!/)(?!.*\\.\\.)[A-Za-z0-9._/-]+$"
|
|
243
|
+
},
|
|
244
|
+
"usage": {
|
|
245
|
+
"const": "verification-only"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"consent_asset": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"pattern": "^[a-z0-9][a-z0-9.-]{0,63}$"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://yannsouetre.github.io/cof/schemas/1.0/weights.schema.json",
|
|
4
|
+
"title": "elements/identity_weights/<v>/weights.json — record of an identity LoRA / embedding",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"kind": {
|
|
9
|
+
"enum": [
|
|
10
|
+
"lora",
|
|
11
|
+
"lycoris",
|
|
12
|
+
"dora",
|
|
13
|
+
"textual-inversion",
|
|
14
|
+
"ip-adapter-embedding",
|
|
15
|
+
"reference-latent",
|
|
16
|
+
"dreambooth",
|
|
17
|
+
"other"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"encoding": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"description": "reference-latent only: how the references were pre-encoded (e.g. MiniMax H3 RefMods). Tool-specific keys are allowed.",
|
|
23
|
+
"additionalProperties": true,
|
|
24
|
+
"properties": {
|
|
25
|
+
"method": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "encoder / tool, e.g. minimax-h3-refmod"
|
|
28
|
+
},
|
|
29
|
+
"mode": {
|
|
30
|
+
"enum": [
|
|
31
|
+
"full",
|
|
32
|
+
"pooled"
|
|
33
|
+
],
|
|
34
|
+
"description": "full = identity (one latent per frame), pooled = concept (spatially averaged)"
|
|
35
|
+
},
|
|
36
|
+
"pool": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "integer",
|
|
40
|
+
"minimum": 1
|
|
41
|
+
},
|
|
42
|
+
"minItems": 2,
|
|
43
|
+
"maxItems": 2,
|
|
44
|
+
"description": "[h, w] grid when mode is pooled"
|
|
45
|
+
},
|
|
46
|
+
"frames": {
|
|
47
|
+
"type": "integer",
|
|
48
|
+
"minimum": 1
|
|
49
|
+
},
|
|
50
|
+
"resolution": {
|
|
51
|
+
"type": "integer",
|
|
52
|
+
"minimum": 1
|
|
53
|
+
},
|
|
54
|
+
"sources": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"description": "asset ids of the images / videos that were encoded — keeps the latent re-encodable for another model"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"base_model": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": [
|
|
66
|
+
"name"
|
|
67
|
+
],
|
|
68
|
+
"properties": {
|
|
69
|
+
"name": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"minLength": 1
|
|
72
|
+
},
|
|
73
|
+
"family": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "flux, sdxl, sd15, wan, hunyuan, ltx…"
|
|
76
|
+
},
|
|
77
|
+
"version": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"hash": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[a-f0-9]{10,64}$"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"file": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"pattern": "^[a-z0-9][a-z0-9.-]{0,63}$"
|
|
89
|
+
},
|
|
90
|
+
"format": {
|
|
91
|
+
"const": "safetensors",
|
|
92
|
+
"default": "safetensors",
|
|
93
|
+
"description": "safetensors only (pickle is forbidden by the container)"
|
|
94
|
+
},
|
|
95
|
+
"rank": {
|
|
96
|
+
"type": "integer",
|
|
97
|
+
"minimum": 1
|
|
98
|
+
},
|
|
99
|
+
"alpha": {
|
|
100
|
+
"type": "number"
|
|
101
|
+
},
|
|
102
|
+
"trigger_words": {
|
|
103
|
+
"type": "array",
|
|
104
|
+
"items": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"recommended_weight": {
|
|
109
|
+
"type": "number",
|
|
110
|
+
"minimum": 0,
|
|
111
|
+
"maximum": 2
|
|
112
|
+
},
|
|
113
|
+
"weight_range": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "number"
|
|
117
|
+
},
|
|
118
|
+
"minItems": 2,
|
|
119
|
+
"maxItems": 2
|
|
120
|
+
},
|
|
121
|
+
"covers": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": {
|
|
124
|
+
"enum": [
|
|
125
|
+
"face",
|
|
126
|
+
"hair",
|
|
127
|
+
"body",
|
|
128
|
+
"clothing",
|
|
129
|
+
"style",
|
|
130
|
+
"voice",
|
|
131
|
+
"full"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"description": "what the weights lock in — two variants in a preset must not cover the same thing"
|
|
135
|
+
},
|
|
136
|
+
"pages": {
|
|
137
|
+
"type": "array",
|
|
138
|
+
"items": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"required": [
|
|
141
|
+
"url"
|
|
142
|
+
],
|
|
143
|
+
"properties": {
|
|
144
|
+
"label": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"url": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"format": "uri"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"notes": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
"training": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"images": {
|
|
161
|
+
"type": "integer"
|
|
162
|
+
},
|
|
163
|
+
"steps": {
|
|
164
|
+
"type": "integer"
|
|
165
|
+
},
|
|
166
|
+
"resolution": {
|
|
167
|
+
"type": "integer"
|
|
168
|
+
},
|
|
169
|
+
"captioning": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"dataset_consent": {
|
|
173
|
+
"type": "boolean"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"style": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
},
|
|
180
|
+
"license": {
|
|
181
|
+
"type": "string"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"required": [
|
|
185
|
+
"kind",
|
|
186
|
+
"base_model"
|
|
187
|
+
]
|
|
188
|
+
}
|
cof_cli/tokens.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Token estimation. Uses tiktoken (cl100k_base) when available, otherwise a chars-based heuristic."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
_enc = None
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _encoder():
|
|
8
|
+
global _enc
|
|
9
|
+
if _enc is None:
|
|
10
|
+
try:
|
|
11
|
+
import tiktoken # type: ignore
|
|
12
|
+
_enc = tiktoken.get_encoding("cl100k_base")
|
|
13
|
+
except Exception:
|
|
14
|
+
_enc = False
|
|
15
|
+
return _enc
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def count(text: str, lang: str = "en") -> int:
|
|
19
|
+
if not text:
|
|
20
|
+
return 0
|
|
21
|
+
enc = _encoder()
|
|
22
|
+
if enc:
|
|
23
|
+
return len(enc.encode(text))
|
|
24
|
+
# heuristic: ~4 chars/token in English, ~3.3 in French/other latin languages
|
|
25
|
+
ratio = 4.0 if lang.startswith("en") else 3.3
|
|
26
|
+
return max(1, round(len(text) / ratio))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def tokenizer_name() -> str:
|
|
30
|
+
return "cl100k_base" if _encoder() else "heuristic-chars"
|