pixelkiln 0.121.1 → 0.122.0

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.
@@ -224,6 +224,9 @@ single direction before a batch.
224
224
 
225
225
  ### Loops from a sentence
226
226
 
227
+ (For how this stored skeleton differs from the keypoints you edit yourself, see
228
+ [Skeletons and rigging](./SKELETONS.md#which-skeleton-is-which).)
229
+
227
230
  `mode: "skeleton-v3"` with **no `template`** animates the asset's `prompt`
228
231
  instead: PixelLab writes the sentence into one 3D motion and draws the
229
232
  character from it, with no template to pick. `frames` takes PixelLab's own
package/docs/PAPERDOLL.md CHANGED
@@ -428,7 +428,8 @@ character holding it faces:
428
428
  ![An armoured character turning through eight directions, its greatsword leaning the way it faces](../website/public/sprites/paperdoll/showcase-8dir.png)
429
429
 
430
430
  **The anchors file**, which is every frame's skeleton and so where its hands
431
- are:
431
+ are (see [Skeletons and rigging](./SKELETONS.md#pin-items-to-a-hand) for how
432
+ it relates to the other skeletons):
432
433
 
433
434
  ```bash
434
435
  pixelkiln anchors hero.sword
package/docs/README.md CHANGED
@@ -23,6 +23,7 @@ provider you are using. These Markdown files also render at
23
23
  | Guide | Use it for |
24
24
  |---|---|
25
25
  | [Characters](./CHARACTERS.md) | A base in 4 or 8 directions from a prompt or your own sprite, states, loops, mirrors, portraits, outfit transfer, the four PixelLab engines, and what each costs. |
26
+ | [Skeletons and rigging](./SKELETONS.md) | The 18-joint skeleton every pose tool shares: estimating and correcting one, animating from poses or from a character's stored skeleton, pinning items to a hand, OpenPose maps, and 3D rigs, with what each costs. |
26
27
  | [Paperdoll layers](./PAPERDOLL.md) | One bare character and any number of outfits, hats and held items as transparent layers that match every frame: how it works, a base built for it, masks, cleaning loops, measured cost, and limits. |
27
28
  | [Generators](./GENERATORS.md) | Choose between still, tile, character, hosted animation, and ComfyUI frame-set workflows. |
28
29
  | [Environment provider benchmark](./PROVIDER_BENCHMARK.md) | Compare PixelLab, Retro Diffusion, and ComfyUI on buildings, backgrounds, cleanup, and native-grid recovery. |
package/docs/REVISIONS.md CHANGED
@@ -493,6 +493,9 @@ rather than failing partway through submission.
493
493
 
494
494
  ## Skeleton-driven animation
495
495
 
496
+ [Skeletons and rigging](./SKELETONS.md) covers every tool that uses a
497
+ skeleton; this section is the reference for the revision mode.
498
+
496
499
  A third mode, `animate-skeleton`, poses the source image frame-by-frame from
497
500
  a supplied 18-joint skeleton per frame instead of a text motion description:
498
501
 
@@ -0,0 +1,250 @@
1
+ # Skeletons and rigging
2
+
3
+ A skeleton is where a character's joints are in one frame: 18 points, from the
4
+ nose and ears down to the ankles. PixelKiln uses that skeleton in several
5
+ places, and they share it. It is estimated from a sprite, corrected by hand,
6
+ used to pose an animation, used to find a hand to pin a sword to, used to pose
7
+ AI-drawn frames, and used to rig a 3D model. This guide shows how those pieces
8
+ connect. Each section links to the full reference.
9
+
10
+ | You want to | Use | Costs |
11
+ |---|---|---|
12
+ | Get the skeleton of a sprite | `pixelkiln estimate-skeleton`, or the gallery | 0.1 generation per estimate |
13
+ | Check or correct a skeleton | `pixelkiln skeleton-preview`, then edit the JSON | Nothing |
14
+ | Animate a sprite from poses you set | an `animate-skeleton` revision | 2 to 4 generations a loop |
15
+ | Animate a character from a sentence or template, posed through its 3D skeleton | a `skeleton-v3` loop | 3 generations a direction (measured) |
16
+ | Pin a held item to the hand in every frame | `pixelkiln anchors`, then an `attach` layer | 0.1 a frame to anchor, nothing to place |
17
+ | Pose frames drawn on your own GPU | OpenPose maps with ComfyUI | Nothing (in progress) |
18
+ | Rig a 3D model made from the sprites | the 3D research | Research, not a command |
19
+
20
+ ## The 18 joints
21
+
22
+ PixelLab names a skeleton's joints with 18 labels, one point each:
23
+
24
+ | Joint | PixelLab label | OpenPose (COCO-18) index |
25
+ |---|---|---|
26
+ | nose | `NOSE` | 0 |
27
+ | neck | `NECK` | 1 |
28
+ | right shoulder, elbow, wrist | `RIGHT SHOULDER`, `RIGHT ELBOW`, `RIGHT ARM` | 2, 3, 4 |
29
+ | left shoulder, elbow, wrist | `LEFT SHOULDER`, `LEFT ELBOW`, `LEFT ARM` | 5, 6, 7 |
30
+ | right hip, knee, ankle | `RIGHT HIP`, `RIGHT KNEE`, `RIGHT LEG` | 8, 9, 10 |
31
+ | left hip, knee, ankle | `LEFT HIP`, `LEFT KNEE`, `LEFT LEG` | 11, 12, 13 |
32
+ | right eye, left eye | `RIGHT EYE`, `LEFT EYE` | 14, 15 |
33
+ | right ear, left ear | `RIGHT EAR`, `LEFT EAR` | 16, 17 |
34
+
35
+ `ARM` is the wrist and `LEG` the ankle. The two lists name the same 18
36
+ points, so a pose made for one can be converted to the other. They store it
37
+ differently:
38
+
39
+ - **PixelLab** stores each joint as `{label, x, y, z_index, depth}`. `x` and
40
+ `y` run from 0 to 1 across the image, and `z_index` says what is drawn in
41
+ front. A keypoints file holds the starting pose as `firstFrameKeypoints` and
42
+ 3 to 15 more as `frames`; `src/skeleton.ts` validates it.
43
+ - **OpenPose** draws the joints as an image: coloured limbs on black, one
44
+ colour per limb. Left and right are told apart by colour, so a map must keep
45
+ the figure's left side in the left colours in every frame.
46
+
47
+ "Right" is the character's own right. On a sprite facing the viewer, its right
48
+ hand is on the left of the picture.
49
+
50
+ ## How much skeleton a sprite can carry
51
+
52
+ The 18 joints stop at the wrist. Whether a hand needs more depends on how many
53
+ pixels the hand has, so the right skeleton grows with the sprite. Measured on two
54
+ PixelLab characters of the same kind, a native 64px figure and a native 256px
55
+ one, with the 256px drawing also reduced to 128px. Each skeleton was estimated
56
+ with `estimate-skeleton`. The yellow hand points were read off the drawing by
57
+ eye: no tool estimates them yet.
58
+
59
+ ![The same kind of figure at 64, 128 and 256px with its estimated skeleton, and each right hand enlarged: at 64px only the wrist, at 128px the wrist and a fingertip, at 256px the knuckles, the fingertip and the thumb](../website/public/showcase/skeleton/resolution.png)
60
+
61
+ | Sprite | Hand, past the wrist | What the hand can carry | Skeleton that fits | What it is good for |
62
+ |---|---|---|---|---|
63
+ | 64px | 6 × 5 px, 25 pixels | the wrist | the 18 joints | Animation from poses; held items pinned a little past the wrist. Fingers are one or two pixels; there is nothing to pose. |
64
+ | 128px (the 256px drawing reduced) | 12 × 7 px, 55 pixels | the wrist and the fingertip: which way the hand points | 18 + 1 point per hand | Turning a held sword or torch the way the hand points. |
65
+ | 256px | 24 × 14 px, 214 pixels; the four fingers drawn as one block, the thumb apart | the wrist, the knuckles, the fingertip, the thumb's base and tip | 18 + 4 points per hand | Closing a hand around a handle; a 3D rig with a hand, a thumb and one finger chain. |
66
+ | Larger, with each finger drawn | not measured | every finger joint | 18 + 21 points per hand (OpenPose, MediaPipe); 15 finger bones per hand (Godot, VRM) | Hand poses and gestures. |
67
+
68
+ Notes from the measurement:
69
+
70
+ - **Even 256px does not draw fingers apart.** The 256px figure's hand is a palm,
71
+ one block of fingers and a thumb. A 21-point hand would put four of its five
72
+ fingers on the same pixels, so a four-point hand is what a 256px sprite can
73
+ honestly carry.
74
+ - **The four points map onto the bigger skeletons.** In the 21-point hand of
75
+ OpenPose and MediaPipe they are the wrist (0), the thumb's base (2) and tip (4),
76
+ the middle finger's knuckle (9) and its tip (12). In a 3D rig they are the hand
77
+ bone, the thumb bones, and one finger chain that the other fingers can copy.
78
+ - **128px and 256px are where hands start to matter:** characters made as the
79
+ source for a 3D model, such as the 256px research bodies the 3D work starts
80
+ from, and any character that grips a sword, a staff or a shield.
81
+
82
+ **Not built yet.** PixelLab's `/estimate-skeleton` returns the 18 joints and no
83
+ hand points, `animate-skeleton` takes only those 18 labels, and a held item is
84
+ placed a little past the wrist. Hand points would need either PixelLab's custom-skeleton estimate
85
+ (`estimate_custom_skeleton` among its MCP tools, which takes joint names you
86
+ choose; not tried) or a local
87
+ hand estimator such as MediaPipe (not tried on pixel art). Both are open.
88
+
89
+ ## Estimate one
90
+
91
+ ```bash
92
+ pixelkiln estimate-skeleton hero-south.png --out poses/hero-wave.json --frames 8
93
+ ```
94
+
95
+ This sends the sprite to PixelLab's `/estimate-skeleton` and writes a
96
+ keypoints file: the estimated pose, and `--frames` copies of it (3 to 15) to
97
+ move into a motion. The image must be square at 16, 32, 64, 128 or 256
98
+ pixels. It is a direct call on your account, outside the plan and the budget,
99
+ like `balance`. See [`estimate-skeleton`](./CLI.md#estimate-skeleton).
100
+
101
+ In the gallery (`pixelkiln gallery --edit`), a sprite's **+ Skeleton
102
+ animation** form estimates the skeleton and declares the revision in one step.
103
+ It asks before each estimate, and `--estimate-limit` caps how many a session
104
+ makes. See [`gallery`](./CLI.md#gallery), under `--estimate-limit`.
105
+
106
+ ## Check and correct it
107
+
108
+ ```bash
109
+ pixelkiln skeleton-preview poses/hero-wave.json --from hero-south.png
110
+ ```
111
+
112
+ This draws every pose over the sprite on one sheet: the starting pose at full
113
+ strength, each frame after it over a dimmed copy. Right-side bones are
114
+ orange, left-side blue, and the head and spine white. It runs locally and
115
+ costs nothing.
116
+
117
+ ![A bare figure's estimated pose with its arms at its sides, then eight poses raising its right arm into a wave](../website/public/showcase/skeleton/base-wave-poses.png)
118
+
119
+ Check the starting pose before anything else. PixelLab redraws that frame
120
+ first to learn the sprite's colours and background. A starting pose that does
121
+ not match the picture gives no error, but it degrades every frame drawn from
122
+ it. Clothing and gear can fool the estimate: on a character carrying a sword
123
+ and a pack on its back, it read the straps and hilt as both arms raised,
124
+ although the arms hung at its sides. Use a sprite with nothing on its back,
125
+ such as a paperdoll's bare base, or move the joints back by hand. See
126
+ [`skeleton-preview`](./CLI.md#skeleton-preview).
127
+
128
+ ## Animate from poses
129
+
130
+ An `animate-skeleton` revision sends a sprite and a keypoints file to
131
+ PixelLab's `/animate-with-skeleton-v3`. You get one frame per pose:
132
+
133
+ ```json
134
+ "hero.wave": {
135
+ "prompt": "waving",
136
+ "revision": {
137
+ "mode": "animate-skeleton",
138
+ "from": "hero",
139
+ "keypointsFile": "poses/hero-wave.json",
140
+ "direction": "south",
141
+ "description": "a young adventurer in a blue tunic"
142
+ }
143
+ }
144
+ ```
145
+
146
+ `prompt` is the motion's short label, and `description` is what the character
147
+ looks like; PixelLab requires both. Eight frames at 64×64 billed 3 generations.
148
+ PixelLab's own anchors are 3 frames for 2 generations and 15 frames for 4.
149
+ See [Skeleton-driven animation](./REVISIONS.md#skeleton-driven-animation).
150
+
151
+ ## Animate through the character's own skeleton
152
+
153
+ A `skeleton-v3` loop uses a different skeleton: the 3D one PixelLab stores
154
+ with a character it drew on the v3 engine. You give it a template (`walk`) or
155
+ a sentence, and PixelLab poses that stored skeleton for you; you never edit
156
+ joints:
157
+
158
+ ```json
159
+ "mira.wave": {
160
+ "prompt": "cheerfully waving both arms overhead",
161
+ "animation": { "of": "mira", "mode": "skeleton-v3", "frames": 8, "directions": ["south"] }
162
+ }
163
+ ```
164
+
165
+ It needs a character PixelLab stored a skeleton for. A `v3` base has one; a
166
+ `standard` base does not, and PixelLab refuses it. Measured: 3 generations a
167
+ direction. See [Characters](./CHARACTERS.md#animations).
168
+
169
+ ## Pin items to a hand
170
+
171
+ A held item in a paperdoll is a sprite placed on the hand in every frame, and
172
+ the skeleton is how the hand is found:
173
+
174
+ ```bash
175
+ pixelkiln anchors hero.sword
176
+ ```
177
+
178
+ This estimates the skeleton of every frame the item is held in, at 0.1
179
+ generation each, and writes an anchors file. The item goes a little past the
180
+ wrist, along the forearm. It is paid once per character: every item the
181
+ character holds reads the same file, and a rerun estimates only new or changed
182
+ frames. Placing the items costs nothing. On the site's knight, 56 frames cost
183
+ 5.6 generations to anchor, and the sword stayed in the right hand in all 56.
184
+ See [Paperdoll layers: held items](./PAPERDOLL.md#held-items-and-accessories).
185
+
186
+ ## Pose frames you draw yourself
187
+
188
+ With ComfyUI on your own machine, an OpenPose ControlNet poses each frame from
189
+ a pose map, the image form of the same 18 joints. Work on a recipe for this is
190
+ in progress ([#79](https://github.com/gfargo/pixelkiln/issues/79)); the maps
191
+ must keep scale, camera and ground line fixed across a set. See
192
+ [Set up ComfyUI](./COMFYUI.md).
193
+
194
+ ## Rig a 3D model
195
+
196
+ The 3D research builds a mesh from a character's eight drawn directions,
197
+ binds it to a skeleton, and drives it with motion. It is research, not a
198
+ command yet. See [Research: 3D models from sprites](./RESEARCH_3D.md).
199
+
200
+ ## Which skeleton is which
201
+
202
+ These are separate skeletons that share the same 18 joints:
203
+
204
+ | Skeleton | Where it lives | Who moves it |
205
+ |---|---|---|
206
+ | A keypoints file | committed JSON, beside the manifest | you, joint by joint |
207
+ | An anchors file | committed JSON, one entry per frame | nobody: it records where the joints already are |
208
+ | PixelLab's stored 3D skeleton | on your PixelLab account, with a v3 character | PixelLab, from a template or a sentence |
209
+ | An OpenPose map | a committed PNG per frame | you, or a script |
210
+ | A 3D rig | the research's model files | motion data, retargeted |
211
+
212
+ A keypoints file and an anchors file are local files PixelKiln reads, hashes
213
+ and checks. A stored 3D skeleton is never downloaded, so PixelKiln cannot show
214
+ or edit it.
215
+
216
+ ## Formats, libraries and rigs
217
+
218
+ The same body joints turn up under other names. Hands are where they part.
219
+ Counts are from each project's own documentation (November 2026); "unchecked"
220
+ means no primary source confirmed the number.
221
+
222
+ | Format | Kind | Body | Hand, per hand | License | Used in PixelKiln |
223
+ |---|---|---|---|---|---|
224
+ | [PixelLab skeleton](https://api.pixellab.ai/v2/openapi.json) | 2D joints | 18 | none | PixelLab's terms | `estimate-skeleton`, `animate-skeleton`, `anchors` |
225
+ | [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) | 2D keypoints | 18 (COCO) or 25 (BODY_25, with feet) | 21 | Non-commercial; commercial use needs a paid license | Its 18-point *format*, drawn by our own script for ComfyUI pose maps. The OpenPose software is not used. |
226
+ | [COCO-WholeBody](https://github.com/jin-s13/COCO-WholeBody) / [DWPose](https://github.com/IDEA-Research/DWPose) | 2D keypoints | 17 + 6 feet (133 with face and hands) | 21 | DWPose code Apache-2.0; the training data is CC BY-NC, and the weights' terms are not stated | Not used |
227
+ | [MediaPipe Pose](https://developers.google.com/edge/mediapipe/solutions/vision/pose_landmarker) and [Hand Landmarker](https://developers.google.com/edge/mediapipe/solutions/vision/hand_landmarker) | 2D landmarks | 33 | 21 | Apache-2.0 | Not used; a candidate hand estimator |
228
+ | [xinsir OpenPose ControlNet (SDXL)](https://huggingface.co/xinsir/controlnet-openpose-sdxl-1.0) | pose control | body | not claimed: its card never says it was trained on hands | Apache-2.0 | The ComfyUI pose lane (#79) |
229
+ | [Godot 4 SkeletonProfileHumanoid](https://docs.godotengine.org/en/stable/classes/class_skeletonprofilehumanoid.html) | 3D rig | 56 bones in all | 15 | MIT | A target for exported rigs |
230
+ | [VRM 1.0 humanoid](https://github.com/vrm-c/vrm-specification/blob/master/specification/VRMC_vrm-1.0/humanoid.md) | 3D rig | 15 required bones, 40 optional | 15, all optional | VRM specification | Not used |
231
+ | [glTF 2.0 skins](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc) | 3D file format | any | any | Khronos | The 3D research writes `.glb` |
232
+ | [Quaternius Universal Animation Library](https://quaternius.com/packs/universalanimationlibrary.html) | 3D animations | unchecked (Unreal mannequin names) | unchecked | CC0 | The 3D research retargets its walks and attacks |
233
+ | [DragonBones](https://github.com/DragonBones/DragonBonesJS) / [Spine](https://esotericsoftware.com/spine-runtimes-license) | 2D bones | any | any | DragonBones MIT; Spine needs an editor license per user | Not used |
234
+
235
+ Unity's Humanoid avatar, Mixamo and Unreal's mannequin all have finger bones, but
236
+ their counts were not confirmed from a primary source.
237
+
238
+ What this means in practice:
239
+
240
+ - **A 64px character needs nothing past the 18 joints,** and those convert to
241
+ OpenPose's 18 directly.
242
+ - **For hands, the 21-point hand of OpenPose and MediaPipe is the 2D format to
243
+ meet,** and Godot and VRM's 15 finger bones the 3D one. A 256px sprite's four
244
+ hand points fill part of each, and the rest can be copied from the middle
245
+ finger.
246
+ - **Check licenses before shipping.** OpenPose's software and DWPose's weights
247
+ are not cleared for commercial use; MediaPipe, Godot and the xinsir ControlNet
248
+ are.
249
+ - **Hand points in a ControlNet pose map are unproven.** The ControlNet in use
250
+ does not say it learned hands, so drawing them may do nothing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.121.1",
3
+ "version": "0.122.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,