pixelkiln 0.2.0 → 0.4.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/CONTRIBUTING.md +50 -1
- package/NAMING.md +15 -15
- package/PROVIDERS.md +128 -90
- package/README.md +57 -16
- package/SECURITY.md +4 -3
- package/dist/cli.d.ts +18 -1
- package/dist/cli.js +1248 -281
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +911 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +547 -228
- package/dist/index.d.ts +547 -228
- package/dist/index.js +887 -102
- package/dist/index.js.map +1 -1
- package/docs/AGENTS.md +13 -6
- package/docs/ARCHITECTURE.md +27 -15
- package/docs/CLI.md +57 -4
- package/docs/ENDPOINTS.md +39 -38
- package/docs/GENERATORS.md +6 -1
- package/docs/GETTING_STARTED.md +24 -5
- package/docs/LIBRARY.md +4 -4
- package/docs/MANIFEST.md +103 -5
- package/docs/PIXELLAB.md +100 -0
- package/docs/PROVIDER_BENCHMARK.md +134 -0
- package/docs/README.md +4 -1
- package/docs/RECOVERY.md +46 -1
- package/docs/RETRO_DIFFUSION.md +110 -0
- package/docs/TILES.md +1 -1
- package/examples/minimal/README.md +2 -2
- package/package.json +3 -1
- package/schema/manifest.schema.json +15 -1
- package/schema/workspace.schema.json +54 -0
- package/skills/pixelkiln/SKILL.md +15 -8
package/docs/MANIFEST.md
CHANGED
|
@@ -9,6 +9,7 @@ directory. The canonical machine-readable contract is
|
|
|
9
9
|
{
|
|
10
10
|
"$schema": "./node_modules/pixelkiln/schema/manifest.schema.json",
|
|
11
11
|
"name": "my-game",
|
|
12
|
+
"provider": "pixellab",
|
|
12
13
|
"styles": {
|
|
13
14
|
"base": {
|
|
14
15
|
"generator": "map",
|
|
@@ -31,6 +32,7 @@ Unknown properties are rejected at every level.
|
|
|
31
32
|
|---|---|---|
|
|
32
33
|
| `$schema` | no | Editor schema URL/path. It does not affect generation identity. |
|
|
33
34
|
| `name` | yes | Project/account tag namespace. |
|
|
35
|
+
| `provider` | no | Provider registry id. Defaults to `pixellab`; `retrodiffusion` is experimental. |
|
|
34
36
|
| `styles` | yes | Map of style id to inherited generation/output settings. |
|
|
35
37
|
| `assets` | yes | Map of stable asset id to subject and per-asset overrides. |
|
|
36
38
|
|
|
@@ -42,19 +44,20 @@ not merely a label edit.
|
|
|
42
44
|
|
|
43
45
|
| Field | Type/default | Meaning |
|
|
44
46
|
|---|---|---|
|
|
45
|
-
| `generator` | `map` | `map`, `1dir`, `pixflux`, or `
|
|
47
|
+
| `generator` | `map` | `map`, `1dir`, `pixflux`, `tiles`, or provider-specific `animation`. |
|
|
46
48
|
| `outDir` | string, required | Output directory relative to the manifest. |
|
|
47
49
|
| `promptPrefix` | `""` | Prepended to every participating asset prompt. |
|
|
48
50
|
| `promptSuffix` | `""` | Appended to every participating asset prompt. |
|
|
49
51
|
| `styleImages` | `[]` | `{ "path": "..." }` reference images. Paths are manifest-relative. |
|
|
50
52
|
| `size` | integer 32–256 | Square size for `1dir`; a style reference's dimensions take precedence when present. |
|
|
51
|
-
| `view` | string |
|
|
52
|
-
| `outline` | string | PixelLab `map` outline
|
|
53
|
-
| `shading` | string | PixelLab shading
|
|
54
|
-
| `detail` | string | PixelLab detail
|
|
53
|
+
| `view` | string | PixelLab `map`: `low top-down`, `high top-down`, or `side`. Other generators interpret this separately. |
|
|
54
|
+
| `outline` | string | PixelLab `map`: `single color outline`, `selective outline`, or `lineless`. |
|
|
55
|
+
| `shading` | string | PixelLab `map`: `flat shading`, `basic shading`, `medium shading`, or `detailed shading`. |
|
|
56
|
+
| `detail` | string | PixelLab `map`: `low detail`, `medium detail`, or `high detail`. |
|
|
55
57
|
| `seed` | integer | Deterministic provider seed where supported. |
|
|
56
58
|
| `palette` | hex array, `[]` | Forced palette for `pixflux`; `#` is optional. |
|
|
57
59
|
| `noBackground` | boolean, `true` | `pixflux` background removal. Set false for scenes/backdrops. |
|
|
60
|
+
| `providerOptions` | object, `{}` | Options grouped by provider id. Only the active provider's object is resolved and hashed. |
|
|
58
61
|
| `tileSize` | integer 16–256 | Edge length for `tiles` when no style reference supplies geometry. |
|
|
59
62
|
| `tileType` | enum | `hex`, `hex_pointy`, `isometric`, `oblique`, `octagon`, or `square_topdown`. |
|
|
60
63
|
| `tileView` | enum | `top-down`, `high top-down`, `low top-down`, or `side`. |
|
|
@@ -77,6 +80,101 @@ Generator-specific fields are validated before planning. Important constraints:
|
|
|
77
80
|
|
|
78
81
|
See [generator selection](./GENERATORS.md) for costs and trade-offs.
|
|
79
82
|
|
|
83
|
+
## Experimental Retro Diffusion
|
|
84
|
+
|
|
85
|
+
Retro Diffusion maps `map` and `pixflux` to still generation, `tiles` to its
|
|
86
|
+
tileset family, and `animation` to GIF or PNG-spritesheet generation. Durable
|
|
87
|
+
sources and lock outputs record `image/png` or `image/gif`, so recovery retains
|
|
88
|
+
the correct extension and validates the correct structure.
|
|
89
|
+
|
|
90
|
+
```jsonc
|
|
91
|
+
{
|
|
92
|
+
"name": "my-game",
|
|
93
|
+
"provider": "retrodiffusion",
|
|
94
|
+
"styles": {
|
|
95
|
+
"base": {
|
|
96
|
+
"generator": "map",
|
|
97
|
+
"outDir": "assets/generated/base",
|
|
98
|
+
"providerOptions": {
|
|
99
|
+
"retrodiffusion": {
|
|
100
|
+
"promptStyle": "rd_plus__default",
|
|
101
|
+
"numImages": 4,
|
|
102
|
+
"removeBg": true
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"assets": {
|
|
108
|
+
"anvil": { "prompt": "a compact blacksmith anvil" }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`promptStyle` accepts a live Retro Diffusion still-style selector,
|
|
114
|
+
`numImages` accepts 1–16 candidates, and `removeBg` overrides
|
|
115
|
+
`noBackground`. The Retro Diffusion API accepts 16–512px output, while the
|
|
116
|
+
shared PixelKiln manifest currently limits arbitrary width and height to
|
|
117
|
+
16–400px and square `size` to 32–256px. Selected styles can impose smaller
|
|
118
|
+
limits. RD Pro and user styles accept up to nine reference images. Costs are
|
|
119
|
+
planned in USD and checked again with Retro Diffusion's free authoritative
|
|
120
|
+
quote endpoint before the paid request is sent. Authenticated single-candidate
|
|
121
|
+
RD Fast and RD Plus paths have passed from quote through validated output and
|
|
122
|
+
recovery.
|
|
123
|
+
Multi-candidate, tileset, GIF, and spritesheet paths remain mock-tested, so the
|
|
124
|
+
adapter is still experimental.
|
|
125
|
+
|
|
126
|
+
Additional Retro Diffusion options are:
|
|
127
|
+
|
|
128
|
+
| Option | Meaning |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `framesDuration` | Animation duration: `4`, `6`, `8`, `10`, `12`, or `16`. |
|
|
131
|
+
| `returnSpritesheet` | Return a PNG spritesheet instead of an animated GIF. |
|
|
132
|
+
| `extraPrompt` | Outside texture description for `rd_tile__tileset_advanced`. |
|
|
133
|
+
| `tileX` / `tileY` | Make supported still styles seamless on either axis. |
|
|
134
|
+
|
|
135
|
+
An animation style is declared explicitly:
|
|
136
|
+
|
|
137
|
+
```jsonc
|
|
138
|
+
{
|
|
139
|
+
"generator": "animation",
|
|
140
|
+
"size": 64,
|
|
141
|
+
"outDir": "assets/generated/animations",
|
|
142
|
+
"providerOptions": {
|
|
143
|
+
"retrodiffusion": {
|
|
144
|
+
"promptStyle": "rd_animation__any_animation",
|
|
145
|
+
"numImages": 1,
|
|
146
|
+
"framesDuration": 8,
|
|
147
|
+
"returnSpritesheet": false
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The default output is `<assetId>.gif`; `returnSpritesheet: true` produces
|
|
154
|
+
`<assetId>.png`. Advanced animation styles require exactly one `styleImages`
|
|
155
|
+
input. PixelKiln currently limits animation batches to one so selection never
|
|
156
|
+
loses the output media type.
|
|
157
|
+
|
|
158
|
+
For a Wang-style tileset sheet:
|
|
159
|
+
|
|
160
|
+
```jsonc
|
|
161
|
+
{
|
|
162
|
+
"generator": "tiles",
|
|
163
|
+
"tileSize": 32,
|
|
164
|
+
"outDir": "assets/generated/tiles",
|
|
165
|
+
"providerOptions": {
|
|
166
|
+
"retrodiffusion": {
|
|
167
|
+
"promptStyle": "rd_tile__tileset",
|
|
168
|
+
"numImages": 1
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`rd_tile__tileset_advanced` accepts `extraPrompt` and up to two style images;
|
|
175
|
+
`rd_tile__tile_variation` requires one style image. Provider-specific size and
|
|
176
|
+
input constraints are checked during the free planning phase.
|
|
177
|
+
|
|
80
178
|
## Asset fields
|
|
81
179
|
|
|
82
180
|
| Field | Type/default | Meaning |
|
package/docs/PIXELLAB.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Set up PixelLab
|
|
2
|
+
|
|
3
|
+
PixelLab is PixelKiln's default provider and the production choice for current
|
|
4
|
+
projects. Its generation and account-management paths have been exercised
|
|
5
|
+
against a live account.
|
|
6
|
+
|
|
7
|
+
[Visit PixelLab](https://www.pixellab.ai/) or open the
|
|
8
|
+
[official API reference](https://api.pixellab.ai/v2/docs).
|
|
9
|
+
|
|
10
|
+
## Add the credential
|
|
11
|
+
|
|
12
|
+
Create `.env.local` beside `pixelkiln.manifest.json`:
|
|
13
|
+
|
|
14
|
+
```dotenv
|
|
15
|
+
PIXELLAB_API_KEY=...
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Keep this file out of Git. PixelKiln also reads the variable from the current
|
|
19
|
+
process environment.
|
|
20
|
+
|
|
21
|
+
## Select PixelLab
|
|
22
|
+
|
|
23
|
+
The `provider` field is optional because `pixellab` is the default. Declaring it
|
|
24
|
+
makes the choice clear:
|
|
25
|
+
|
|
26
|
+
```jsonc
|
|
27
|
+
{
|
|
28
|
+
"name": "my-game",
|
|
29
|
+
"provider": "pixellab",
|
|
30
|
+
"styles": {
|
|
31
|
+
"props": {
|
|
32
|
+
"generator": "map",
|
|
33
|
+
"outDir": "assets/generated/props",
|
|
34
|
+
"promptSuffix": ", isolated pixel-art game asset"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"assets": {
|
|
38
|
+
"anvil": {
|
|
39
|
+
"prompt": "a compact blacksmith anvil",
|
|
40
|
+
"width": 64,
|
|
41
|
+
"height": 64
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Run the free checks before a paid request:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pixelkiln doctor --dry-run
|
|
51
|
+
pixelkiln plan
|
|
52
|
+
pixelkiln gen --budget 1
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Copy the exact estimate from `plan` into `--budget`. PixelLab budgets use
|
|
56
|
+
subscription generations.
|
|
57
|
+
|
|
58
|
+
## Choose a generator
|
|
59
|
+
|
|
60
|
+
| Generator | Start here when | Measured cost |
|
|
61
|
+
|---|---|---:|
|
|
62
|
+
| `map` | You need one prop, icon, building, or landmark at arbitrary dimensions | 1 generation |
|
|
63
|
+
| `pixflux` | You need a closed palette or a full-bleed background | 1 generation |
|
|
64
|
+
| `1dir` | You need references or several candidates for human review | 20 to 40 generations |
|
|
65
|
+
| `tiles` | You need ground variations or a connected structural set | 20 to 40 generations |
|
|
66
|
+
|
|
67
|
+
`map` accepts these values:
|
|
68
|
+
|
|
69
|
+
- `view`: `low top-down`, `high top-down`, or `side`
|
|
70
|
+
- `outline`: `single color outline`, `selective outline`, or `lineless`
|
|
71
|
+
- `shading`: `flat shading`, `basic shading`, `medium shading`, or `detailed shading`
|
|
72
|
+
- `detail`: `low detail`, `medium detail`, or `high detail`
|
|
73
|
+
|
|
74
|
+
PixelLab describes map objects as transparent, but the 256px map objects in our
|
|
75
|
+
[environment benchmark](./PROVIDER_BENCHMARK.md) were opaque. Check the alpha
|
|
76
|
+
channel before building a production batch. For a scenic background, use
|
|
77
|
+
`pixflux` with `noBackground: false`.
|
|
78
|
+
|
|
79
|
+
Read [Generator selection](./GENERATORS.md) for the full constraints and
|
|
80
|
+
measured economics.
|
|
81
|
+
|
|
82
|
+
## Account workflows
|
|
83
|
+
|
|
84
|
+
The PixelLab adapter supports `balance`, `adopt`, `salvage`, `tag`, and the
|
|
85
|
+
separate confirmed `purge` flow. These are useful when several projects share
|
|
86
|
+
one provider account or when existing local art needs its original provenance.
|
|
87
|
+
Read [Recovery and account safety](./RECOVERY.md) before changing remote
|
|
88
|
+
objects.
|
|
89
|
+
|
|
90
|
+
PixelLab's official
|
|
91
|
+
[MCP server](https://github.com/pixellab-code/pixellab-mcp) gives agents direct
|
|
92
|
+
access to PixelLab generation tools. It complements PixelKiln: the MCP handles
|
|
93
|
+
creation, while PixelKiln owns project state, budgets, review, recovery, and
|
|
94
|
+
packaging.
|
|
95
|
+
|
|
96
|
+
## What is outside this adapter
|
|
97
|
+
|
|
98
|
+
PixelLab offers more than PixelKiln currently exposes. Character generation,
|
|
99
|
+
multi-direction rotation, and animation are not part of this adapter. Use the
|
|
100
|
+
[manifest reference](./MANIFEST.md) for the fields PixelKiln supports today.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Environment provider benchmark
|
|
2
|
+
|
|
3
|
+
This benchmark compares PixelLab and Retro Diffusion on three 256×256 game-art
|
|
4
|
+
briefs. Each brief has two attempts. The test uses the same prompt text and seed
|
|
5
|
+
numbers for both providers, but seeds are not portable between models.
|
|
6
|
+
|
|
7
|
+
The benchmark tests the adapters that PixelKiln ships. It does not rank every
|
|
8
|
+
model or endpoint sold by either provider.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
| Brief | PixelLab route | Retro Diffusion style | Intended output |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| Mountain observatory | `map`, high top-down view | `rd_plus__isometric_asset` | Isolated building on a snowy ridge |
|
|
15
|
+
| River gate | `map`, low top-down view | `rd_plus__topdown_asset` | Isolated landmark spanning water |
|
|
16
|
+
| Alpine valley | `pixflux`, background kept | `rd_plus__environment` | Full scenic background |
|
|
17
|
+
|
|
18
|
+
Both manifests request 256×256 output with seeds `31415` and `27182`. The
|
|
19
|
+
provider-specific route or style is allowed to do its job. No image was picked,
|
|
20
|
+
edited, cropped, or post-processed.
|
|
21
|
+
|
|
22
|
+
PixelLab rejected `view: "isometric"` on the `map` endpoint with HTTP 422. The
|
|
23
|
+
successful observatory attempts use the supported `high top-down` view while
|
|
24
|
+
the shared prompt still asks for an isometric three-quarter view. This is a
|
|
25
|
+
real adapter constraint, so the benchmark records it instead of hiding it.
|
|
26
|
+
|
|
27
|
+
The committed manifests and lockfiles are here:
|
|
28
|
+
|
|
29
|
+
- [PixelLab manifest](../benchmarks/provider-environments/pixellab/pixelkiln.manifest.json)
|
|
30
|
+
- [PixelLab lockfile](../benchmarks/provider-environments/pixellab/pixelkiln.lock.json)
|
|
31
|
+
- [Retro Diffusion manifest](../benchmarks/provider-environments/retrodiffusion/pixelkiln.manifest.json)
|
|
32
|
+
- [Retro Diffusion lockfile](../benchmarks/provider-environments/retrodiffusion/pixelkiln.lock.json)
|
|
33
|
+
|
|
34
|
+
## Mountain observatory
|
|
35
|
+
|
|
36
|
+
Prompt: `a compact stone observatory built into a snowy mountain ridge,
|
|
37
|
+
isometric three-quarter view, cedar roof, warm windows, isolated with no
|
|
38
|
+
scenery`
|
|
39
|
+
|
|
40
|
+
| PixelLab A | PixelLab B | Retro Diffusion A | Retro Diffusion B |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
|  |  |  |  |
|
|
43
|
+
|
|
44
|
+
PixelLab followed more of the brief. Both attempts place a substantial stone
|
|
45
|
+
building on a snowy ridge, and the first reads as an observatory. Retro
|
|
46
|
+
Diffusion produced tidy cutouts, but both are small cabins on snow-covered
|
|
47
|
+
rocks. The observatory and mountain-ridge ideas mostly disappeared.
|
|
48
|
+
|
|
49
|
+
The trade-off is file readiness. Retro Diffusion removed the background and
|
|
50
|
+
used 35 and 36 colors. PixelLab returned opaque pale backgrounds and used 264
|
|
51
|
+
and 266 colors. PixelLab wins prompt coverage. Retro Diffusion needs less
|
|
52
|
+
cleanup before placement in a game map.
|
|
53
|
+
|
|
54
|
+
## River gate
|
|
55
|
+
|
|
56
|
+
Prompt: `a fortified village gate spanning a narrow river, three-quarter
|
|
57
|
+
top-down view, stone towers, timber bridge, isolated with no scenery`
|
|
58
|
+
|
|
59
|
+
| PixelLab A | PixelLab B | Retro Diffusion A | Retro Diffusion B |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
|  |  |  |  |
|
|
62
|
+
|
|
63
|
+
All four results are usable concepts. PixelLab shows more of the surrounding
|
|
64
|
+
riverbank and makes the bridge-water relationship obvious. Its outputs are
|
|
65
|
+
opaque scene patches. Retro Diffusion gives cleaner standalone fortifications.
|
|
66
|
+
Attempt B carries water through the gate; attempt A reads more like a drawbridge
|
|
67
|
+
than a river crossing.
|
|
68
|
+
|
|
69
|
+
PixelLab again follows the whole brief more reliably. Retro Diffusion is easier
|
|
70
|
+
to drop onto an existing map because its outputs have 56% to 64% transparent
|
|
71
|
+
pixels. The Retro Diffusion files also stay between 43 and 47 colors, compared
|
|
72
|
+
with PixelLab's 226 to 240.
|
|
73
|
+
|
|
74
|
+
## Alpine valley background
|
|
75
|
+
|
|
76
|
+
Prompt: `a wide alpine valley at dusk, layered mountains, pine forest, winding
|
|
77
|
+
river, small warm-lit village, full-bleed scenic background`
|
|
78
|
+
|
|
79
|
+
| PixelLab A | PixelLab B | Retro Diffusion A | Retro Diffusion B |
|
|
80
|
+
|---|---|---|---|
|
|
81
|
+
|  |  |  |  |
|
|
82
|
+
|
|
83
|
+
PixelLab's Pixflux route is the surprise here. Both results preserve the wide
|
|
84
|
+
valley, layered mountains, dusk light, winding river, and tiny settlement. They
|
|
85
|
+
also use only 22 and 38 colors. The shapes read cleanly at native size.
|
|
86
|
+
|
|
87
|
+
Retro Diffusion produced attractive scenes with stronger foreground framing
|
|
88
|
+
and more conventional depth. They feel like places the player could enter, but
|
|
89
|
+
the framing narrows the valley and pushes the result toward illustration rather
|
|
90
|
+
than a reusable background layer. They use 37 and 46 colors.
|
|
91
|
+
|
|
92
|
+
For this brief, PixelLab wins on prompt coverage, graphic clarity, consistency,
|
|
93
|
+
and cost. Retro Diffusion wins if the desired result is a closer, more cinematic
|
|
94
|
+
scene.
|
|
95
|
+
|
|
96
|
+
## Cost and operational results
|
|
97
|
+
|
|
98
|
+
| Provider | Successful images | Charged amount | Final balance |
|
|
99
|
+
|---|---:|---:|---:|
|
|
100
|
+
| PixelLab | 6 | 6 generations | 4,415 generations |
|
|
101
|
+
| Retro Diffusion | 6 | $0.348 | $0.135 |
|
|
102
|
+
|
|
103
|
+
PixelLab charged one generation per image. Retro Diffusion quoted and charged
|
|
104
|
+
$0.058 per RD Plus image.
|
|
105
|
+
|
|
106
|
+
The run also caught two integration details:
|
|
107
|
+
|
|
108
|
+
- PixelLab's `map` endpoint rejected the literal `isometric` view. PixelKiln
|
|
109
|
+
should document or validate the accepted values before submission.
|
|
110
|
+
- Retro Diffusion rounded its live quote up from PixelKiln's formula result of
|
|
111
|
+
$0.057768 to $0.058. PixelKiln now rounds offline estimates up to the live
|
|
112
|
+
quote precision, so planning remains a safe ceiling.
|
|
113
|
+
|
|
114
|
+
Both manifests now pass `doctor`, report a current plan, and have six healthy
|
|
115
|
+
PNG cache entries.
|
|
116
|
+
|
|
117
|
+
## Recommendation
|
|
118
|
+
|
|
119
|
+
For large isolated buildings or landmarks, start with PixelLab when prompt
|
|
120
|
+
coverage matters most. Budget for background cleanup. Start with Retro
|
|
121
|
+
Diffusion when a transparent, compact, low-color asset matters more than
|
|
122
|
+
capturing every noun in a complex prompt.
|
|
123
|
+
|
|
124
|
+
For full scenic backgrounds, start with PixelLab Pixflux. These two attempts
|
|
125
|
+
were cheaper and more faithful to the brief. Try Retro Diffusion when you want
|
|
126
|
+
foreground framing and a closer illustrated scene.
|
|
127
|
+
|
|
128
|
+
Do not ask either provider for one giant finished level. Generate terrain,
|
|
129
|
+
background, buildings, landmarks, and foreground pieces separately. Compose
|
|
130
|
+
them in the engine, then use integer nearest-neighbor scaling for display.
|
|
131
|
+
|
|
132
|
+
This sample is useful, not definitive. Two attempts expose obvious tendencies,
|
|
133
|
+
but they do not measure every style, prompt family, or model update. Rerun the
|
|
134
|
+
committed manifests when either provider changes its models.
|
package/docs/README.md
CHANGED
|
@@ -10,6 +10,8 @@ This source also renders at
|
|
|
10
10
|
| Guide | Use it for |
|
|
11
11
|
|---|---|
|
|
12
12
|
| [Getting started](./GETTING_STARTED.md) | Install from a checkout, create or adopt a project, run the everyday workflow, and decide what belongs in Git. |
|
|
13
|
+
| [Set up PixelLab](./PIXELLAB.md) | Configure the production provider, choose a generator, and use its account workflows. |
|
|
14
|
+
| [Set up Retro Diffusion](./RETRO_DIFFUSION.md) | Configure the experimental provider, choose a style, and understand its live-tested boundary. |
|
|
13
15
|
| [CLI reference](./CLI.md) | Every command and flag, offline/provider requirements, JSON output, and exit behavior. |
|
|
14
16
|
| [Manifest reference](./MANIFEST.md) | Every style and asset field, inheritance, generator-specific constraints, mounting, and schema validation. |
|
|
15
17
|
| [Agent workflows](./AGENTS.md) | Install the official skill and pair agent guidance with the deterministic CLI. |
|
|
@@ -19,6 +21,7 @@ This source also renders at
|
|
|
19
21
|
| Guide | Use it for |
|
|
20
22
|
|---|---|
|
|
21
23
|
| [Generators](./GENERATORS.md) | Choose between `map`, `1dir`, `pixflux`, and `tiles`; understand measured costs and capability trade-offs. |
|
|
24
|
+
| [Environment provider benchmark](./PROVIDER_BENCHMARK.md) | Compare PixelLab and Retro Diffusion on buildings, landmarks, backgrounds, cost, transparency, and prompt coverage. |
|
|
22
25
|
| [Derived artifacts](./ARTIFACTS.md) | Pack, mount, and export; provenance companions; ownership; force takeover; transactional and crash recovery. |
|
|
23
26
|
| [Recovery and account safety](./RECOVERY.md) | Restore, caches, adopt, salvage, cross-project claims, tagging, and confirmed purge. |
|
|
24
27
|
| [Quality gates](./QUALITY.md) | Plan, doctor, audit, cache checks, JSON contracts, and CI usage. |
|
|
@@ -31,7 +34,7 @@ This source also renders at
|
|
|
31
34
|
| [Library API](./LIBRARY.md) | Public TypeScript imports for planning, auditing, providers, packing, exporting, and managed artifact writes. |
|
|
32
35
|
| [Tiles and engine exports](./TILES.md) | Structural tile roles, provider rule preservation, generic JSON, Tiled Wang sets, and Godot terrain sets. |
|
|
33
36
|
| [Measured PixelLab endpoints](./ENDPOINTS.md) | Live-account cost and payload research, endpoint recipes, limits, and unresolved API behavior. |
|
|
34
|
-
| [
|
|
37
|
+
| [PixelLab vs. Retro Diffusion](../PROVIDERS.md) | Provider selection, costs, adapter capabilities, confidence, and next work. Start with the provider-specific setup guides above when you are ready to configure a project. |
|
|
35
38
|
|
|
36
39
|
## Project policies
|
|
37
40
|
|
package/docs/RECOVERY.md
CHANGED
|
@@ -23,7 +23,8 @@ retries at zero generation cost.
|
|
|
23
23
|
|
|
24
24
|
Two ignored caches accelerate recovery:
|
|
25
25
|
|
|
26
|
-
- `.pixelkiln/cache/<sha256>.png`: content-addressed
|
|
26
|
+
- `.pixelkiln/cache/<sha256>.png` or `<sha256>.gif`: content-addressed,
|
|
27
|
+
structurally validated generated media bytes;
|
|
27
28
|
- `pixelkiln.cache.json`: provider object id → remote image hash.
|
|
28
29
|
|
|
29
30
|
```bash
|
|
@@ -86,6 +87,50 @@ array to stdout and human diagnostics to stderr for piping into `jq`.
|
|
|
86
87
|
Imported ids are derived from prompts and land under `_salvaged/`; review and
|
|
87
88
|
rename them before treating them as stable application ids.
|
|
88
89
|
|
|
90
|
+
## Shared workspace catalog
|
|
91
|
+
|
|
92
|
+
For a single project, its own lockfile is the whole claim set. On a shared
|
|
93
|
+
account with several sibling projects, repeating `--claims` on every salvage
|
|
94
|
+
run is easy to get wrong. A forgotten lockfile makes another project's paid
|
|
95
|
+
art look unclaimed. `workspace` fixes that by registering every sibling once,
|
|
96
|
+
outside any one manifest:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pixelkiln workspace add ../other-game/pixelkiln.manifest.json
|
|
100
|
+
pixelkiln workspace add ../another-game/pixelkiln.manifest.json --name another
|
|
101
|
+
pixelkiln workspace status
|
|
102
|
+
pixelkiln workspace claims
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`workspace status` reports aggregate provider, spend-by-unit, and plan state
|
|
106
|
+
per project, offline. `workspace claims` validates the catalog and emits the
|
|
107
|
+
exact union of `objectId`/`reviewObjectId`/`jobId` across every registered
|
|
108
|
+
lock. This is the same union rule `--claims` uses, so the two paths cannot drift.
|
|
109
|
+
|
|
110
|
+
A registered lockfile that is missing or unreadable is a hard error for
|
|
111
|
+
`claims`, never a silent skip: an incomplete claim set is precisely what makes
|
|
112
|
+
another project's shipped art look orphaned. `workspace add` still lets you
|
|
113
|
+
register a brand-new project before its first `gen`. It warns rather than
|
|
114
|
+
refusing because the project has no lock yet, but `claims` and
|
|
115
|
+
`salvage --workspace` both refuse until every registered project has one.
|
|
116
|
+
|
|
117
|
+
Salvage accepts the catalog directly instead of a repeated `--claims` list:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pixelkiln salvage --workspace pixelkiln.workspace.json --dry-run
|
|
121
|
+
pixelkiln salvage --workspace pixelkiln.workspace.json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`--claims` still works and unions with a workspace's claim set. This helps a
|
|
125
|
+
one-off lockfile that isn't part of the catalog. Choose one workflow per
|
|
126
|
+
account: `--claims` for an occasional cross-project check, `workspace` once
|
|
127
|
+
sibling projects are a standing arrangement worth registering once.
|
|
128
|
+
|
|
129
|
+
The catalog stores paths and project identity, never a credential. Each
|
|
130
|
+
project still loads its own provider key from its own `.env`. `workspace
|
|
131
|
+
remove` only edits the catalog file; it never touches art, a lock, or the
|
|
132
|
+
provider account.
|
|
133
|
+
|
|
89
134
|
## Confirmed purge
|
|
90
135
|
|
|
91
136
|
Deletion is a separate command:
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Set up Retro Diffusion
|
|
2
|
+
|
|
3
|
+
Retro Diffusion support is experimental. Authenticated RD Fast and RD Plus
|
|
4
|
+
single-candidate stills have passed from the provider's cost quote through
|
|
5
|
+
validated download, provenance, and recovery. Multi-candidate, tileset, GIF,
|
|
6
|
+
and PNG spritesheet paths have integration tests but still need representative
|
|
7
|
+
paid live runs.
|
|
8
|
+
|
|
9
|
+
[Visit Retro Diffusion](https://www.retrodiffusion.ai/) or open the
|
|
10
|
+
[official API guide](https://www.retrodiffusion.ai/app/guide/api).
|
|
11
|
+
|
|
12
|
+
## Add the credential
|
|
13
|
+
|
|
14
|
+
Create `.env.local` beside `pixelkiln.manifest.json`:
|
|
15
|
+
|
|
16
|
+
```dotenv
|
|
17
|
+
RD_API_KEY=...
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Keep this file out of Git. PixelKiln also reads the variable from the current
|
|
21
|
+
process environment.
|
|
22
|
+
|
|
23
|
+
## Select Retro Diffusion
|
|
24
|
+
|
|
25
|
+
Set the top-level provider and keep service-specific choices under the provider
|
|
26
|
+
namespace:
|
|
27
|
+
|
|
28
|
+
```jsonc
|
|
29
|
+
{
|
|
30
|
+
"name": "my-game",
|
|
31
|
+
"provider": "retrodiffusion",
|
|
32
|
+
"styles": {
|
|
33
|
+
"props": {
|
|
34
|
+
"generator": "map",
|
|
35
|
+
"outDir": "assets/generated/props",
|
|
36
|
+
"providerOptions": {
|
|
37
|
+
"retrodiffusion": {
|
|
38
|
+
"promptStyle": "rd_plus__default",
|
|
39
|
+
"numImages": 4,
|
|
40
|
+
"removeBg": true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"assets": {
|
|
46
|
+
"anvil": {
|
|
47
|
+
"prompt": "a compact blacksmith anvil",
|
|
48
|
+
"width": 64,
|
|
49
|
+
"height": 64
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Run the free checks before a paid request:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pixelkiln doctor --dry-run
|
|
59
|
+
pixelkiln plan
|
|
60
|
+
pixelkiln gen --budget 0.1
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Copy the exact USD estimate from `plan` into `--budget`. Before PixelKiln sends
|
|
64
|
+
the paid request, it asks Retro Diffusion for a free authoritative quote and
|
|
65
|
+
stops if that quote exceeds the remaining budget.
|
|
66
|
+
|
|
67
|
+
## Match the style to the workflow
|
|
68
|
+
|
|
69
|
+
| PixelKiln generator | Retro Diffusion selector | Output |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `map` or `pixflux` | A normal RD still style such as `rd_fast__default`, `rd_plus__default`, or an environment style | 1 to 16 PNG candidates |
|
|
72
|
+
| `tiles` | `rd_tile__*` | One PNG tileset or tile asset |
|
|
73
|
+
| `animation` | `rd_animation__*` or `rd_advanced_animation__*` | Animated GIF or PNG spritesheet |
|
|
74
|
+
|
|
75
|
+
The provider's style catalog can change. Use its live catalog when choosing a
|
|
76
|
+
selector instead of assuming an example name will remain available.
|
|
77
|
+
|
|
78
|
+
Useful options under `providerOptions.retrodiffusion` include:
|
|
79
|
+
|
|
80
|
+
- `numImages`: 1 to 16 still candidates
|
|
81
|
+
- `removeBg`: background removal for stills
|
|
82
|
+
- `framesDuration`: 4, 6, 8, 10, 12, or 16 for animation
|
|
83
|
+
- `returnSpritesheet`: PNG spritesheet instead of the default GIF
|
|
84
|
+
- `tileX` and `tileY`: seamless axes for supported still styles
|
|
85
|
+
- `extraPrompt`: outside texture for `rd_tile__tileset_advanced`
|
|
86
|
+
|
|
87
|
+
RD Pro and user still styles accept up to nine reference images. Advanced
|
|
88
|
+
animation and tile modes have narrower input rules. PixelKiln validates those
|
|
89
|
+
rules during planning. See the [manifest reference](./MANIFEST.md#experimental-retro-diffusion)
|
|
90
|
+
for complete examples.
|
|
91
|
+
|
|
92
|
+
## Current operational limits
|
|
93
|
+
|
|
94
|
+
The adapter can report `balance`, but it does not yet expose Retro Diffusion
|
|
95
|
+
account listing, adoption, salvage, tagging, or deletion. Paid output still has
|
|
96
|
+
PixelKiln lockfile provenance and local cache recovery.
|
|
97
|
+
|
|
98
|
+
The shared PixelKiln manifest currently allows arbitrary width and height from
|
|
99
|
+
16 to 400 pixels, while Retro Diffusion styles can impose smaller limits. In
|
|
100
|
+
the current service catalog, the useful environment and scene-object styles
|
|
101
|
+
top out at 384px. Build very large scenes from separate terrain, background,
|
|
102
|
+
building, landmark, and foreground layers.
|
|
103
|
+
|
|
104
|
+
The [environment benchmark](./PROVIDER_BENCHMARK.md) found clean transparent,
|
|
105
|
+
low-color Retro Diffusion cutouts, while PixelLab followed the more complex
|
|
106
|
+
building prompts more closely. Read [PixelLab vs. Retro Diffusion](../PROVIDERS.md)
|
|
107
|
+
before committing to a large batch.
|
|
108
|
+
|
|
109
|
+
Retro Diffusion publishes its API examples and pricing formulas in the
|
|
110
|
+
[official API repository](https://github.com/Retro-Diffusion/api-examples).
|
package/docs/TILES.md
CHANGED
|
@@ -53,7 +53,7 @@ The companion record is engine-neutral: it stores portable source paths and
|
|
|
53
53
|
SHA-256s, export options (including raw provider rules), output hashes, and a
|
|
54
54
|
canonical fingerprint. `verifyArtifactBundle()` can detect changed inputs,
|
|
55
55
|
edited/missing outputs, or altered provenance offline without rebuilding the
|
|
56
|
-
atlas. The project manifest and lockfile are conservative inputs,
|
|
56
|
+
atlas. The project manifest and lockfile are conservative inputs, so
|
|
57
57
|
newly declared or recorded tiles also make an older export stale. The TSJ/TRES
|
|
58
58
|
contracts therefore remain free of PixelKiln-only fields.
|
|
59
59
|
|
|
@@ -22,5 +22,5 @@ Add a second entry under `styles` with a different `outDir`, then:
|
|
|
22
22
|
pixelkiln gen --style neon
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Every asset re-derives under the new style. The original files are untouched
|
|
26
|
-
|
|
25
|
+
Every asset re-derives under the new style. The original files are untouched.
|
|
26
|
+
Styles are separate namespaces in both the output tree and the lockfile.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixelkiln",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
"sprites",
|
|
79
79
|
"game-assets",
|
|
80
80
|
"pixellab",
|
|
81
|
+
"retro-diffusion",
|
|
82
|
+
"image-generation",
|
|
81
83
|
"asset-pipeline",
|
|
82
84
|
"generative",
|
|
83
85
|
"lockfile",
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"name": {
|
|
11
11
|
"type": "string"
|
|
12
12
|
},
|
|
13
|
+
"provider": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1,
|
|
16
|
+
"default": "pixellab"
|
|
17
|
+
},
|
|
13
18
|
"styles": {
|
|
14
19
|
"type": "object",
|
|
15
20
|
"additionalProperties": {
|
|
@@ -21,7 +26,8 @@
|
|
|
21
26
|
"1dir",
|
|
22
27
|
"map",
|
|
23
28
|
"pixflux",
|
|
24
|
-
"tiles"
|
|
29
|
+
"tiles",
|
|
30
|
+
"animation"
|
|
25
31
|
],
|
|
26
32
|
"default": "map"
|
|
27
33
|
},
|
|
@@ -155,6 +161,14 @@
|
|
|
155
161
|
"type": "string"
|
|
156
162
|
},
|
|
157
163
|
"default": []
|
|
164
|
+
},
|
|
165
|
+
"providerOptions": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"additionalProperties": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"additionalProperties": {}
|
|
170
|
+
},
|
|
171
|
+
"default": {}
|
|
158
172
|
}
|
|
159
173
|
},
|
|
160
174
|
"required": [
|