pixelkiln 0.94.0 → 0.96.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/dist/cli.js +3940 -3471
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1233 -792
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1227 -67
- package/dist/index.d.ts +1227 -67
- package/dist/index.js +1198 -760
- package/dist/index.js.map +1 -1
- package/docs/CLI.md +27 -0
- package/docs/MANIFEST.md +51 -1
- package/package.json +1 -1
- package/schema/manifest.schema.json +81 -0
package/docs/CLI.md
CHANGED
|
@@ -350,6 +350,27 @@ one asset. Entries already in the lockfile are skipped unless `--force`;
|
|
|
350
350
|
`--dry-run` and `--json` show what would be written. Characters and effects
|
|
351
351
|
are not imported this way.
|
|
352
352
|
|
|
353
|
+
Art made through the PixelLab MCP is usually rolled interactively and then
|
|
354
|
+
post-processed. Record that with `--tool` (the call that made it), `--prompt`
|
|
355
|
+
(the prompt it was rolled with, kept as the entry's prompt), `--seed`, `--cost`
|
|
356
|
+
(credits spent, in the asset's cost unit, counted in recorded spend), and one
|
|
357
|
+
`--step "<text>"` per thing done afterwards, in order (`downscale 0.75, box`,
|
|
358
|
+
`palette-snap lowplants`). Steps are free text: pixelkiln records them and never
|
|
359
|
+
runs them. `--raw <png>` also records the unprocessed original; when the file on
|
|
360
|
+
disk later equals it, `plan` says the original was dropped back over the
|
|
361
|
+
processed art instead of "modified". These go in an `origin` object on the lock
|
|
362
|
+
entry, separate from `imported`, so older versions still read the lockfile.
|
|
363
|
+
|
|
364
|
+
The imported bytes are cached, and re-importing different art with `--force`
|
|
365
|
+
keeps the earlier version in `history`, so `restore --generation <n|hash>` brings
|
|
366
|
+
it back with no provider and no network. `history` marks imported generations and
|
|
367
|
+
lists their tool and steps.
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
pixelkiln adopt --local --only rock --source mcp --tool create_image_pro_flash \
|
|
371
|
+
--seed 42 --cost 3 --step "downscale 0.75, box" --step "palette-snap lowplants" --raw raw/rock.png
|
|
372
|
+
```
|
|
373
|
+
|
|
353
374
|
```bash
|
|
354
375
|
pixelkiln adopt --local --only rockfall_pile_iso --source mcp --note "imageProFlash, box-downscaled"
|
|
355
376
|
pixelkiln adopt --local --style props --dry-run
|
|
@@ -1325,6 +1346,12 @@ Print the package version. `-v` is an alias.
|
|
|
1325
1346
|
| `--local` | adopt | Record local files as `imported` lock entries offline, with no provider key. |
|
|
1326
1347
|
| `--source <name>` | adopt --local | Where the art came from (`mcp`, `hand`, a tool name); default `external`. |
|
|
1327
1348
|
| `--object-id <id>` | adopt --local | The provider object id of the single asset being imported. |
|
|
1349
|
+
| `--tool <name>` | adopt --local | The tool call that made the art, recorded under `origin`. |
|
|
1350
|
+
| `--prompt <text>` | adopt --local | The prompt the art was rolled with; becomes the entry's prompt. |
|
|
1351
|
+
| `--seed <n>` | adopt --local | The seed it was rolled with. |
|
|
1352
|
+
| `--cost <n>` | adopt --local | Credits spent making it, in the asset's cost unit; counts toward recorded spend. |
|
|
1353
|
+
| `--step <text>` | adopt --local | One post-generation step, in order; repeatable, free text, recorded and never run. |
|
|
1354
|
+
| `--raw <png>` | adopt --local | The unprocessed original, for one asset; its hash is recorded and its bytes cached. |
|
|
1328
1355
|
| `--port <n>` | pick/salvage/gallery | Local review or gallery server port; otherwise chooses a free port. |
|
|
1329
1356
|
| `--out <path>` | pack/export/refine/recipe install/quality snapshot/unzoom/pixelate/normal-map/vfx/font | Output base override, final native PNG for path-mode refine, exact recipe destination, quality baseline path, the unzoomed, pixelated, or normal-map PNG, the effect's `<base>.png`/`.gif`/`.json`/`.vfx.json`, or the font's `<base>.ttf`/`<base>.png`. Export requires one selected tileset. |
|
|
1330
1357
|
| `--inputs <path>` | pack/quality snapshot | JSON input array; requires `--out`. Quality cases use `{ id, path, record?, tolerances? }`. |
|
package/docs/MANIFEST.md
CHANGED
|
@@ -56,7 +56,7 @@ not merely a label edit.
|
|
|
56
56
|
|
|
57
57
|
| Field | Type/default | Meaning |
|
|
58
58
|
|---|---|---|
|
|
59
|
-
| `prompt` | string, required unless `mirror`, `portrait`, `outfit`, or a template loop (`animation.template`) | The subject wording wrapped by the selected style's prompt prefix and suffix. A template loop is described by its template; a v3, pro, or sentence (`skeleton-v3` with no template) loop still needs the motion in words. |
|
|
59
|
+
| `prompt` | string, required unless `mirror`, `derive`, `external`, `portrait`, `outfit`, or a template loop (`animation.template`) | The subject wording wrapped by the selected style's prompt prefix and suffix. A template loop is described by its template; a v3, pro, or sentence (`skeleton-v3` with no template) loop still needs the motion in words. |
|
|
60
60
|
| `width` / `height` | integer 16–8192 | Per-asset dimensions for generators that accept rectangular output. Provider limits may be lower. |
|
|
61
61
|
| `size` | integer 16–8192 | Per-asset square size where the generator uses one dimension. |
|
|
62
62
|
| `file` | string | Output path below the style's `outDir`; defaults to `<category>/<assetId>.png`. |
|
|
@@ -70,6 +70,8 @@ not merely a label edit.
|
|
|
70
70
|
| `portrait` | object | `character` styles: a bust of a base or state's south sprite, `{ "of": "<asset>", "size": 64 }`; `size` is 16, 32, 48, 64 (default), 128, or 160. See [Portraits](./CHARACTERS.md#portraits). |
|
|
71
71
|
| `outfit` | object | `character` styles: an existing loop's frames re-clothed from an outfit image, `{ "of": "<loop asset>", "reference": "<image>" }`, with optional `additionalInstructions`. See [Outfit transfer](./CHARACTERS.md#outfit-transfer). |
|
|
72
72
|
| `mirror` | string | Another asset of the same style flipped left to right, made locally at no cost. See [Mirrors](./CHARACTERS.md#mirrors). |
|
|
73
|
+
| `derive` | object | Made from existing pixels by one local transform, at no cost, with no provider. See [Derived and external assets](#derived-and-external-assets). |
|
|
74
|
+
| `external` | object | Built by a script or tool outside pixelkiln; pixelkiln records and tracks the file but never builds it. See [Derived and external assets](#derived-and-external-assets). |
|
|
73
75
|
| `vfx` | object | `vfx` styles, PixelLab only: the effect to render. `{ "preset": "explosion", "parts": [{ "name": "scorch_mark" }], "sprite": "art/chars/hero.png", "fps": 12 }`; start from one `preset` or one `recipe` (a recipe JSON or a `.vfx.json` record), with optional `parts`, `sprite`, `fps`, and `name`. Or give a `description` (with optional `artist`: `lite` or `pro`, a local PNG `sprite`, and `name`) for PixelLab's paid VFX artist instead; it excludes `preset`, `recipe`, `parts`, and `fps`. Replaces `prompt` as the required field. See [`vfx`](./GENERATORS.md#vfx) and [Described effects](./GENERATORS.md#described-effects-the-paid-vfx-artist). |
|
|
74
76
|
| `scene` | object | `map` styles, PixelLab only: draw this object into a scene image, in its style. `{ "image": "scene.png", "placement": { "oval": 0.3 } }`; `placement` is `oval` or `rectangle` (a fraction, 0.05–0.95) or `mask` (a PNG the size of the scene). See [Drawing into a scene](./GENERATORS.md#drawing-into-a-scene). |
|
|
75
77
|
| `connect` | object | `terrain` styles, PixelLab only: share a terrain with another set in the same style, keyed by this set's own side. `{ "lower": { "of": "coast", "terrain": "upper" } }` makes this set's lower terrain `coast`'s upper. The other set generates first; regenerating it makes this one stale. A sidescroller set connects only `lower`. Cycles are rejected. |
|
|
@@ -430,6 +432,54 @@ changing `provider` alone:
|
|
|
430
432
|
declare bindings (ComfyUI); a provider without them rejects a non-empty
|
|
431
433
|
object rather than ignoring it.
|
|
432
434
|
|
|
435
|
+
## Derived and external assets
|
|
436
|
+
|
|
437
|
+
Not every asset is generated. Art recolored from another asset, or built by a
|
|
438
|
+
script, still belongs in `plan`, the lockfile, and quality snapshots. Two
|
|
439
|
+
asset kinds declare that, and they are deliberately separate: one pixelkiln
|
|
440
|
+
makes itself, one it only keeps track of.
|
|
441
|
+
|
|
442
|
+
### `derive`: made by pixelkiln from existing pixels
|
|
443
|
+
|
|
444
|
+
```json
|
|
445
|
+
"hedge_autumn": { "derive": { "from": "hedge", "transform": "recolor", "map": { "#4a7a3a": "#b8742c" } } },
|
|
446
|
+
"hedge_2x": { "derive": { "from": "hedge", "transform": "scale", "width": 64, "height": 64 } },
|
|
447
|
+
"tile_snapped": { "derive": { "file": "art/tile.png", "transform": "palette-snap", "palette": ["#000000", "#ffffff"] } }
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
The input is `from` (another asset of the same style, which must be a single
|
|
451
|
+
image) or `file` (a committed PNG, relative to the manifest), never both. The
|
|
452
|
+
transform is one of:
|
|
453
|
+
|
|
454
|
+
| `transform` | Fields | Does |
|
|
455
|
+
|---|---|---|
|
|
456
|
+
| `recolor` | `map` | Replaces exact `#rrggbb` colors. Unmapped colors and every alpha value stay. |
|
|
457
|
+
| `palette-snap` | `palette` (2 to 256 colors) | Moves every visible pixel to the nearest palette color. |
|
|
458
|
+
| `scale` | `width`, `height`, `mode` | Resizes to the exact size. `nearest` (default) keeps hard edges; `box` averages the covered pixels, weighted by alpha. |
|
|
459
|
+
|
|
460
|
+
`gen` writes the file in the wave after its source lands, calls no provider, and
|
|
461
|
+
costs nothing in any unit. The plan reports a derived asset `stale`, free to fix,
|
|
462
|
+
when its source's recorded output, its `file`, the transform, or its parameters
|
|
463
|
+
change. An edit by hand makes it `orphaned`, like any generated file. The lock entry
|
|
464
|
+
records the input's hash under `derive`.
|
|
465
|
+
|
|
466
|
+
### `external`: built elsewhere, tracked here
|
|
467
|
+
|
|
468
|
+
```json
|
|
469
|
+
"dock": { "external": { "builder": "python tools/iso_kit.py dock", "inputs": ["tools/iso_kit.py"] } }
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
pixelkiln never runs the `builder`; it is the command you run, recorded so the
|
|
473
|
+
plan can tell you what to do. `inputs` are files the builder reads. Their hashes
|
|
474
|
+
and the builder text are the asset's identity. Record the built file with
|
|
475
|
+
`adopt --local`, which stores the file's hash, the builder, and the inputs' hashes.
|
|
476
|
+
|
|
477
|
+
An external asset is never actionable, so `gen` skips it, including under
|
|
478
|
+
`--force`. The plan reports it as: `untracked` when the file exists but is not
|
|
479
|
+
recorded (run `adopt --local`), `orphaned` when the file is missing, when the
|
|
480
|
+
builder or an input changed, or when the file changed since it was recorded
|
|
481
|
+
(rebuild, then `adopt --local --force`), and `ok` otherwise.
|
|
482
|
+
|
|
433
483
|
## Characters and mirrors
|
|
434
484
|
|
|
435
485
|
A `character` style holds a base drawn facing 4 or 8 directions, states, and
|
package/package.json
CHANGED
|
@@ -1825,6 +1825,87 @@
|
|
|
1825
1825
|
"type": "string",
|
|
1826
1826
|
"minLength": 1
|
|
1827
1827
|
},
|
|
1828
|
+
"derive": {
|
|
1829
|
+
"type": "object",
|
|
1830
|
+
"properties": {
|
|
1831
|
+
"from": {
|
|
1832
|
+
"type": "string",
|
|
1833
|
+
"minLength": 1
|
|
1834
|
+
},
|
|
1835
|
+
"file": {
|
|
1836
|
+
"type": "string",
|
|
1837
|
+
"minLength": 1
|
|
1838
|
+
},
|
|
1839
|
+
"transform": {
|
|
1840
|
+
"type": "string",
|
|
1841
|
+
"enum": [
|
|
1842
|
+
"recolor",
|
|
1843
|
+
"palette-snap",
|
|
1844
|
+
"scale"
|
|
1845
|
+
]
|
|
1846
|
+
},
|
|
1847
|
+
"map": {
|
|
1848
|
+
"type": "object",
|
|
1849
|
+
"additionalProperties": {
|
|
1850
|
+
"type": "string",
|
|
1851
|
+
"pattern": "^#?[0-9a-f]{6}$"
|
|
1852
|
+
},
|
|
1853
|
+
"propertyNames": {
|
|
1854
|
+
"pattern": "^#?[0-9a-f]{6}$"
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
"palette": {
|
|
1858
|
+
"type": "array",
|
|
1859
|
+
"items": {
|
|
1860
|
+
"type": "string",
|
|
1861
|
+
"pattern": "^#?[0-9a-f]{6}$"
|
|
1862
|
+
},
|
|
1863
|
+
"minItems": 2,
|
|
1864
|
+
"maxItems": 256
|
|
1865
|
+
},
|
|
1866
|
+
"width": {
|
|
1867
|
+
"type": "integer",
|
|
1868
|
+
"minimum": 1,
|
|
1869
|
+
"maximum": 4096
|
|
1870
|
+
},
|
|
1871
|
+
"height": {
|
|
1872
|
+
"type": "integer",
|
|
1873
|
+
"minimum": 1,
|
|
1874
|
+
"maximum": 4096
|
|
1875
|
+
},
|
|
1876
|
+
"mode": {
|
|
1877
|
+
"type": "string",
|
|
1878
|
+
"enum": [
|
|
1879
|
+
"nearest",
|
|
1880
|
+
"box"
|
|
1881
|
+
]
|
|
1882
|
+
}
|
|
1883
|
+
},
|
|
1884
|
+
"required": [
|
|
1885
|
+
"transform"
|
|
1886
|
+
],
|
|
1887
|
+
"additionalProperties": false
|
|
1888
|
+
},
|
|
1889
|
+
"external": {
|
|
1890
|
+
"type": "object",
|
|
1891
|
+
"properties": {
|
|
1892
|
+
"builder": {
|
|
1893
|
+
"type": "string",
|
|
1894
|
+
"minLength": 1
|
|
1895
|
+
},
|
|
1896
|
+
"inputs": {
|
|
1897
|
+
"type": "array",
|
|
1898
|
+
"items": {
|
|
1899
|
+
"type": "string",
|
|
1900
|
+
"minLength": 1
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
},
|
|
1904
|
+
"required": [
|
|
1905
|
+
"builder"
|
|
1906
|
+
],
|
|
1907
|
+
"additionalProperties": false
|
|
1908
|
+
},
|
|
1828
1909
|
"outputRole": {
|
|
1829
1910
|
"type": "string",
|
|
1830
1911
|
"minLength": 1
|