pixelkiln 0.148.1 → 0.149.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.
package/docs/CLI.md CHANGED
@@ -7,7 +7,7 @@ pixelkiln <command> [options]
7
7
  Unknown commands, positional arguments, and flags are errors. The only
8
8
  positional words accepted are a command's own subcommands (`refine approve`,
9
9
  `workspace add <manifest>`, and the like), `estimate-skeleton`'s one image
10
- path, `anchors`'s and `redraw`'s asset id, and `skeleton-preview`'s keypoints file or asset id. Repeated `--style`, `--only`, `--claims`, and `--output-role` values
10
+ path, `anchors`'s, `redraw`'s and `layer preview`'s asset id, and `skeleton-preview`'s keypoints file or asset id. Repeated `--style`, `--only`, `--claims`, and `--output-role` values
11
11
  accumulate; comma-separated values work too. This strict parsing prevents a misspelled filter
12
12
  from widening a paid run.
13
13
 
@@ -61,6 +61,7 @@ Which command:
61
61
  | start an `animate-skeleton` keypoints file from an image | `pixelkiln estimate-skeleton poses/hero.png --out poses/hero-swing.json` |
62
62
  | find the hands in every frame so a held item can be pinned to one | `pixelkiln anchors hero.sword` |
63
63
  | draw one wrong frame of a paperdoll layer again, not the whole layer | `pixelkiln redraw hero.robe --frame walk.south.frame-05` |
64
+ | see a paperdoll layer's mask and keyed input for every frame before paying | `pixelkiln layer preview hero.robe` |
64
65
  | see a keypoints file's poses over the source before paying | `pixelkiln skeleton-preview hero-swing` |
65
66
  | work across several projects | `pixelkiln workspace add ../other/pixelkiln.manifest.json`, then `--workspace` on `gallery` and `salvage` |
66
67
 
@@ -2169,6 +2170,23 @@ be downloaded and unchanged in the manifest since; a held item is refused.
2169
2170
 
2170
2171
  See [Redrawing one frame](./PAPERDOLL.md#redrawing-one-frame).
2171
2172
 
2173
+ ### `layer`
2174
+
2175
+ ```bash
2176
+ pixelkiln layer preview <layer> [--style <id>]
2177
+ ```
2178
+
2179
+ Builds a drawn paperdoll layer's sheet, keyed sheet and mask exactly as `gen`
2180
+ would send them, and writes them to `.pixelkiln/layers/<style>/<layer>/preview/`
2181
+ without calling any provider: `sheet.png`, `keyed.png`, `mask.png`,
2182
+ `overlay.png` (the mask over the frames) and `frames/`, each frame's keyed
2183
+ input and mask. It prints each frame's neck row, the frames whose own
2184
+ narrowest row was overruled, and what the inpaint would cost at that sheet
2185
+ size. Free, offline, and outside the plan; the sources must be downloaded. A
2186
+ held item is refused, since it is placed rather than inpainted.
2187
+
2188
+ See [Previewing before paying](./PAPERDOLL.md#previewing-before-paying).
2189
+
2172
2190
  ## Utility commands
2173
2191
 
2174
2192
  ### `help`
package/docs/PAPERDOLL.md CHANGED
@@ -40,7 +40,8 @@ A layer avoids the problem by painting the item onto the body's own frames:
40
40
  cut to the one box that holds them all, and laid on a single sheet.
41
41
  3. **Mask.** White where the provider may paint, black where it may not.
42
42
  4. **Key.** Inside the mask, skin is repainted cyan, keeping its shading.
43
- Outside it the frame keeps its own colours.
43
+ Outside it the frame keeps its own colours. With `cover`, everything
44
+ inside the mask is keyed, whatever its colour.
44
45
  5. **Inpaint.** One masked inpaint over the whole sheet.
45
46
  6. **Cut.** Pixels the provider repainted, that are not still cyan, are the
46
47
  layer. It is split back into one PNG per source frame.
@@ -175,6 +176,28 @@ tried it).
175
176
  "layer": { "of": ["mira", "mira.walk.south"], "skin": ["#f6b58a", "#e58a62", "#f2a076", "#d87855"] }
176
177
  ```
177
178
 
179
+ ### A base that cannot be bare
180
+
181
+ Some characters cannot be generated bare. PixelLab's character state edit
182
+ refused "no clothes" on an adult-proportioned figure (`character generation
183
+ failed upstream`, not billed) and accepted plain underwear. Make the
184
+ underwear part of the base itself, generated with it, and treat it as body:
185
+
186
+ ```json
187
+ "layer": { "of": ["mira", "mira.idle.east"], "cover": true }
188
+ ```
189
+
190
+ `cover` keys every opaque pixel inside the mask, whatever its colour, so the
191
+ provider sees the underwear as skin to dress over. Without it, the default
192
+ keys skin only: dark underwear went to the provider as existing clothing, and
193
+ on a 256px side-view base 5 of 8 frames came back with the underwear kept and
194
+ the outfit drawn around it. Keyed by hand, all 8 came back fully dressed.
195
+
196
+ Layers over such a base are additive only: a garment narrower than the
197
+ underwear leaves it showing, and nothing removes it. The head and hair stay
198
+ outside the mask, as on any outfit. `skin` has the opposite goal (key only
199
+ the skin, keep the clothes) and is not needed with `cover`.
200
+
178
201
  ### One piece at a time
179
202
 
180
203
  An outfit does not have to be one layer. Ask for a single garment and say
@@ -665,13 +688,53 @@ Every step's file is kept in `.pixelkiln/layers/<style>/<asset>/`:
665
688
  | `result.png` | What it returned. |
666
689
  | `layout.json` | Which cell is which frame, and the sheet's size. |
667
690
 
691
+ ### How the mask finds the neck
692
+
693
+ The computed mask finds the head on every frame, then puts the neck a fixed
694
+ distance below the top of it:
695
+
696
+ - **The distance** is the median, over the sheet's frames, of what the
697
+ narrowest row in the upper part of each figure says. One frame whose
698
+ narrowest row is somewhere else (a shoulder in shadow, an elbow tucked in)
699
+ takes its neck from the others. On a 256px 8-frame idle, the narrowest-row
700
+ rule alone put the neck 30 rows low on 2 frames, and those came back as a
701
+ tube top with detached sleeves.
702
+ - **The top of the head** is the first row of the frame at least half as wide
703
+ as a head, so a hand raised above it is passed over. A head that moves down
704
+ the cell, as in a sit-down loop, takes the neck with it.
705
+ - **Above the neck**, an arm raised clear of the head's columns is part of
706
+ the mask and gets its sleeve. The head, and anything joined to it, is not.
707
+ - **Pinholes**: on a bare base, a dark pixel (a tattoo, deep shading) with
708
+ keyed skin no more than 3px away on both sides of its row is keyed too.
709
+ Left in its own colour it comes back unchanged and leaves a speck-sized hole
710
+ in the garment.
711
+
712
+ Generating a layer prints each frame's neck row, and names the frames whose
713
+ own narrowest row was overruled.
714
+
715
+ ### Previewing before paying
716
+
717
+ ```bash
718
+ pixelkiln layer preview hero.leather
719
+ ```
720
+
721
+ Builds the sheet, keyed sheet and mask exactly as `gen` would send them, and
722
+ writes them to `.pixelkiln/layers/<style>/<asset>/preview/` without calling
723
+ the provider: `sheet.png`, `keyed.png`, `mask.png`, `overlay.png` (the mask in
724
+ magenta over the frames) and `frames/`, each frame's own keyed input and
725
+ mask. It prints every frame's neck row and the inpaint's price at that sheet
726
+ size. It is free, needs no API key, and leaves the plan as it was. Look at
727
+ `overlay.png` before the first `gen` of a layer over a new base or a new loop.
728
+
729
+ ### Replacing a step's file
730
+
668
731
  When a step produces the wrong thing, replace its file. The computed mask
669
- finds each neck as the narrowest row in the upper part of the figure. That
670
- holds for a bald base with its arms down, and fails for hair wider than the
671
- head or an arm raised beside it. To fix it:
732
+ still assumes the head is on top and roughly upright: hair wider than the
733
+ shoulders, long hair over them, or limbs across the head need a mask of their
734
+ own. To make one:
672
735
 
673
- 1. Run the layer once.
674
- 2. Open `mask.png` from the work folder in any pixel editor.
736
+ 1. Run `pixelkiln layer preview <asset>` (or the layer once).
737
+ 2. Open `mask.png` from the preview (or work) folder in any pixel editor.
675
738
  3. Paint white where the layer may go and black everywhere else. Pure white
676
739
  and pure black only.
677
740
  4. Save it into the project (the work folder is git-ignored) and name it:
@@ -792,7 +855,7 @@ stated when the job was submitted.
792
855
  tried and left 3 of 18 frames undressed and erased props in others.
793
856
 
794
857
  Not tested: sizes other than 64px, quadrupeds, more than 56 frames,
795
- attack animations (where limbs cross the head and the neck detection is
858
+ attack animations (where limbs cross the head and the head detection is
796
859
  weakest), hair, capes, shields, and two held items at once. For placed
797
860
  items: `tilt` and `lean` through the pipeline (they were tried in a script),
798
861
  a `place` correction, `grasp` on the left hand's far side or with a `radius`
@@ -814,6 +877,7 @@ A `layer` asset needs a `prompt` and a `layer` object. It takes no
814
877
  | `mask` | computed | A black-and-white PNG the size of the sheet. |
815
878
  | `keyed` | computed | A PNG the size of the sheet, sent instead of the keyed sheet. |
816
879
  | `skin` | all but outline | The colours that are skin, for a character that is not bare. |
880
+ | `cover` | `false` | Key everything inside the mask, not only skin: for a base that wears underwear. |
817
881
  | `key` | `#00ffff` | The stand-in colour. Change it for an item that is itself cyan. |
818
882
  | `clean` | `true` | Clean loop frames against the stills among `of` before sheeting them. |
819
883
  | `offset` | none | `[x, y]` pixels to move every frame by, or `{ "<of asset>": [x, y], "*": [x, y] }`. Free to change on a drawn layer. |
@@ -951,7 +1015,8 @@ That one was not tried.
951
1015
  | Hair covers the face, or a pack is on the chest, in some frames | The model read a front view as a back view. | Give each loop its own sheet row with `columns` and say in the prompt which way each row faces. See [Field notes](#field-notes). |
952
1016
  | Part of an arm or leg is missing after cleaning | It was shaded in a colour the rotations do not use. | Regenerate the loop (`gen --force --only <loop>`), or turn `clean` off for it. |
953
1017
  | Pale specks around the dressed character | The loop's own files were never cleaned; the layer is fine. | Set `"clean": true` on the loop and run `pixelkiln fetch`. |
954
- | Sleeves or collar missing where an arm is raised | The computed mask put the neck in the wrong row for that frame. | Supply a `mask`. |
1018
+ | Sleeves or collar missing on some frames | The computed mask left the chest or a raised arm out on those frames. | Check `pixelkiln layer preview <asset>` and its `overlay.png`; supply a `mask` if a frame is still wrong. |
1019
+ | Underwear kept, the outfit drawn around it | The base wears underwear and only skin was keyed. | Set `"cover": true`. |
955
1020
  | The outfit differs between two loops | They were dressed by two layers. | Put both loops in one layer's `of`. |
956
1021
  | Old clothes show at the edges | The base is not bare. | Use a bare base, or accept it. |
957
1022
  | A fringe in the key colour at wrists or collar | Shades of the key the cut did not recognise. | Change `key` to a colour further from the outfit's, or open an issue with `result.png`. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.148.1",
3
+ "version": "0.149.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -87,6 +87,21 @@ hands mid-walk and an inpainted shield was drawn face-on in a side view.
87
87
  - `pixelkiln pack --style <style>` puts the character and its layers on one
88
88
  sheet; the generic atlas's `layers` section pairs each layer frame with
89
89
  the frame it goes over and the offset to draw it at.
90
+ - Before the first paid `gen` of a drawn layer, run `pixelkiln layer preview
91
+ <layer>`: free and offline, it writes the sheet, keyed sheet, mask and an
92
+ `overlay.png` of the mask over the frames, plus each frame's own, to
93
+ `.pixelkiln/layers/<style>/<asset>/preview/`, and prints every frame's neck
94
+ row and the price. Look at the overlay; a frame it names as overruled
95
+ is the one to check first.
96
+ - A base that wears underwear (some characters cannot be generated bare;
97
+ PixelLab refused "no clothes" on an adult-proportioned figure and accepted
98
+ underwear) needs `"cover": true`: everything inside the mask is keyed, so
99
+ the outfit goes over the underwear instead of around it. Layers over it are
100
+ additive only. Do not combine it with `skin`, which keeps clothes.
101
+ - The computed mask finds the head per frame and puts the neck a fixed
102
+ distance below it, taken from the median of the frames; it includes an arm
103
+ raised beside the head. Hair over the shoulders or limbs across the head
104
+ still need a supplied mask.
90
105
  - `mask` and `keyed` replace the computed sheet inputs with PNGs the person
91
106
  supplies. Every intermediate file is in
92
107
  `.pixelkiln/layers/<style>/<asset>/`.