pixelkiln 0.3.0 → 0.4.1
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 +2 -1
- package/PROVIDERS.md +128 -90
- package/README.md +37 -9
- package/SECURITY.md +4 -3
- package/dist/cli.js +667 -146
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +622 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +380 -228
- package/dist/index.d.ts +380 -228
- package/dist/index.js +609 -83
- package/dist/index.js.map +1 -1
- package/docs/AGENTS.md +12 -5
- package/docs/ARCHITECTURE.md +25 -15
- package/docs/CLI.md +23 -17
- package/docs/GENERATORS.md +5 -0
- 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 +8 -7
- package/docs/RETRO_DIFFUSION.md +110 -0
- package/package.json +4 -2
- package/schema/manifest.schema.json +15 -1
- package/skills/pixelkiln/SKILL.md +15 -8
package/docs/AGENTS.md
CHANGED
|
@@ -35,7 +35,7 @@ The skill guides the workflow; PixelKiln remains the deterministic execution
|
|
|
35
35
|
layer. This separation keeps agent reasoning out of polling, hashing, downloads,
|
|
36
36
|
state transitions, and output placement.
|
|
37
37
|
|
|
38
|
-
## PixelLab MCP and PixelKiln
|
|
38
|
+
## Providers, PixelLab MCP, and PixelKiln
|
|
39
39
|
|
|
40
40
|
The [official PixelLab MCP server](https://github.com/pixellab-code/pixellab-mcp)
|
|
41
41
|
gives an agent direct PixelLab creation tools. It is complementary to PixelKiln,
|
|
@@ -47,10 +47,17 @@ not a replacement:
|
|
|
47
47
|
| PixelKiln skill | Agent guidance for safe project-level operations. |
|
|
48
48
|
| PixelKiln library/CLI | Budgets, state, provenance, review, recovery, audit, and packaging. |
|
|
49
49
|
| PixelLab adapter | The current production and live-tested generation backend. |
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
| Retro Diffusion adapter | Experimental backend; authenticated paid single-still lifecycle plus mocked advanced-workflow tests. |
|
|
51
|
+
|
|
52
|
+
PixelKiln's core is provider-neutral, but PixelLab remains the only production
|
|
53
|
+
and paid-generation-tested adapter. Retro Diffusion generation support is
|
|
54
|
+
experimental. Paid RD Fast and RD Plus single-candidate stills have passed from
|
|
55
|
+
quote through validated download and recovery. Multi-candidate, tileset, GIF,
|
|
56
|
+
and spritesheet workflows still need representative live smoke tests. See
|
|
57
|
+
[PixelLab vs. Retro Diffusion](../PROVIDERS.md) before choosing a provider for a
|
|
58
|
+
new project or a large environment asset. Once chosen, follow
|
|
59
|
+
[Set up PixelLab](./PIXELLAB.md) or
|
|
60
|
+
[Set up Retro Diffusion](./RETRO_DIFFUSION.md).
|
|
54
61
|
|
|
55
62
|
## Recommended first prompt
|
|
56
63
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -5,7 +5,7 @@ PixelKiln separates provider mechanics from the project state machine:
|
|
|
5
5
|
```text
|
|
6
6
|
manifest + lock + planning + review + recovery + artifact pipelines
|
|
7
7
|
──────────────────── Provider interface ─────────────────────────
|
|
8
|
-
PixelLabProvider
|
|
8
|
+
PixelLabProvider RetroDiffusionProvider FakeProvider future adapters
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Everything above the provider boundary is backend-neutral. URL shapes, auth
|
|
@@ -31,7 +31,8 @@ retain:
|
|
|
31
31
|
- provider and remote object/job ids;
|
|
32
32
|
- explicit lifecycle status and errors;
|
|
33
33
|
- source URLs/candidates/selections;
|
|
34
|
-
- `outputs[]` with portable path, SHA-256,
|
|
34
|
+
- `outputs[]` with portable path, SHA-256, optional structural role, and
|
|
35
|
+
optional PNG/GIF media type;
|
|
35
36
|
- provider-specific metadata under a provider-id namespace;
|
|
36
37
|
- successful submission cost and cost unit.
|
|
37
38
|
|
|
@@ -41,9 +42,10 @@ are rebased in memory and rewritten portably on the next save. The current
|
|
|
41
42
|
manifest remains destination authority; a stale lock path cannot redirect
|
|
42
43
|
restore into an unrelated project file.
|
|
43
44
|
|
|
44
|
-
Cost units that differ are never summed.
|
|
45
|
-
|
|
46
|
-
count also belongs to the provider estimate rather
|
|
45
|
+
Cost units that differ are never summed. Built-in adapters currently use
|
|
46
|
+
`generations`, `usd`, and `free`; custom adapters may register another
|
|
47
|
+
non-empty unit. Candidate count also belongs to the provider estimate rather
|
|
48
|
+
than being assumed globally.
|
|
47
49
|
|
|
48
50
|
## State machine
|
|
49
51
|
|
|
@@ -72,8 +74,9 @@ and exporters all use the same role model. A consumer must request a role when
|
|
|
72
74
|
there is no unambiguous primary output.
|
|
73
75
|
|
|
74
76
|
PNG ingestion validates signature, chunks, CRCs, palettes, compressed data,
|
|
75
|
-
scanlines, dimensions, and supported color modes
|
|
76
|
-
|
|
77
|
+
scanlines, dimensions, and supported color modes. GIF ingestion walks the
|
|
78
|
+
logical screen, color tables, extensions, image-data blocks, and trailer. Both
|
|
79
|
+
formats are validated before bytes become durable output or recovery cache data.
|
|
77
80
|
|
|
78
81
|
## Concurrency and lock saves
|
|
79
82
|
|
|
@@ -112,11 +115,18 @@ byte is structurally validated before use.
|
|
|
112
115
|
|
|
113
116
|
## Provider capability boundary
|
|
114
117
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
Providers are selected from a registry by the manifest's top-level `provider`
|
|
119
|
+
id. Required members cover support/estimate, submit, poll, and download;
|
|
120
|
+
candidate selection is required only when an adapter can return alternatives.
|
|
121
|
+
Account-wide listing, tagging, deletion, and balance are optional. Commands
|
|
122
|
+
such as adopt or salvage report a capability gap rather than failing through
|
|
123
|
+
an undefined method.
|
|
124
|
+
|
|
125
|
+
`PixelLabProvider` is production and live-tested. `RetroDiffusionProvider` is
|
|
126
|
+
an experimental still, tileset, and animation adapter. Authenticated RD Fast
|
|
127
|
+
and RD Plus single-candidate still lifecycles have passed end to end. Its
|
|
128
|
+
multi-candidate, tileset, GIF, and spritesheet paths retain mocked coverage
|
|
129
|
+
pending paid live smokes. `FakeProvider` implements the same contract in memory, which
|
|
130
|
+
keeps the paid pipeline testable without credentials or network access. See
|
|
131
|
+
[library API](./LIBRARY.md) and
|
|
132
|
+
[PixelLab vs. Retro Diffusion](../PROVIDERS.md).
|
package/docs/CLI.md
CHANGED
|
@@ -9,6 +9,11 @@ Unknown commands, positional arguments, and flags are errors. Repeated
|
|
|
9
9
|
separated values work too. This strict parsing prevents a misspelled filter
|
|
10
10
|
from widening a paid run.
|
|
11
11
|
|
|
12
|
+
The manifest's top-level `provider` field selects the provider for `plan`,
|
|
13
|
+
`doctor`, and pipeline commands. It defaults to `pixellab`; the built-in
|
|
14
|
+
`retrodiffusion` adapter is experimental and supports still-image
|
|
15
|
+
`map`/`pixflux`, `tiles` sheets, and `animation` GIF/spritesheet work.
|
|
16
|
+
|
|
12
17
|
## Everyday pipeline
|
|
13
18
|
|
|
14
19
|
### `init`
|
|
@@ -73,9 +78,10 @@ for a screenshot of the actual interface.
|
|
|
73
78
|
|
|
74
79
|
### `fetch`
|
|
75
80
|
|
|
76
|
-
Download completed or selected outputs, validate complete PNG structure,
|
|
77
|
-
the manifest-authoritative destinations, populate the content cache, and
|
|
78
|
-
output hashes. `--tag` also pushes manifest tags after successful
|
|
81
|
+
Download completed or selected outputs, validate complete PNG or GIF structure,
|
|
82
|
+
write the manifest-authoritative destinations, populate the content cache, and
|
|
83
|
+
update output hashes. `--tag` also pushes manifest tags after successful
|
|
84
|
+
downloads when the provider supports tagging.
|
|
79
85
|
|
|
80
86
|
### `restore`
|
|
81
87
|
|
|
@@ -134,7 +140,8 @@ or download artwork.
|
|
|
134
140
|
|
|
135
141
|
### `balance`
|
|
136
142
|
|
|
137
|
-
Show the provider's remaining balance and cost unit.
|
|
143
|
+
Show the manifest-selected provider's remaining balance and cost unit. Reports
|
|
144
|
+
a capability error when an installed provider has no balance endpoint.
|
|
138
145
|
|
|
139
146
|
### `status`
|
|
140
147
|
|
|
@@ -160,29 +167,28 @@ Subcommands:
|
|
|
160
167
|
|
|
161
168
|
| Subcommand | Effect |
|
|
162
169
|
|---|---|
|
|
163
|
-
| `add <manifest>` | Registers a project. Id defaults to the manifest's `name`; `--name` overrides it. Lock defaults to `pixelkiln.lock.json` beside the manifest; `--lock` overrides it. `--provider`
|
|
170
|
+
| `add <manifest>` | Registers a project. Id defaults to the manifest's `name`; `--name` overrides it. Lock defaults to `pixelkiln.lock.json` beside the manifest; `--lock` overrides it. `--provider` overrides the manifest's provider id; `--account` sets a free-form account label. Refuses a duplicate id or a lockfile already registered under another id. Warns, but does not refuse, when the lock does not exist yet. |
|
|
164
171
|
| `remove <id-or-manifest>` | Drops a registration by project id or by manifest path. Touches no art, no lock, no provider account. |
|
|
165
172
|
| `list` | Lists registered projects and catalog diagnostics. Refuses if the catalog file does not exist. |
|
|
166
173
|
| `status` | Aggregate provider, spend-by-unit, plan state, and claim count, offline. Provider cost units are never summed across each other. Refuses if the catalog file does not exist. |
|
|
167
|
-
| `claims` | Validates the catalog and emits the exact union of `objectId`/`reviewObjectId`/`jobId` across every registered lock. Refuses
|
|
174
|
+
| `claims` | Validates the catalog and emits the exact union of `objectId`/`reviewObjectId`/`jobId` across every registered lock. Refuses to omit a project when any registered lock is missing or unreadable, or when the catalog has a duplicate id or lock path. |
|
|
168
175
|
|
|
169
176
|
`--workspace <path>` selects the catalog file; it defaults to
|
|
170
177
|
`pixelkiln.workspace.json` in the current directory. Stored paths are relative
|
|
171
178
|
to the catalog file's own directory, so a catalog survives a clone or move.
|
|
172
179
|
`list`/`status` support `--json` and `--check` (nonzero exit on any error-level
|
|
173
180
|
diagnostic); both treat a nonexistent catalog file as a hard error rather than
|
|
174
|
-
an empty, vacuously-safe one
|
|
175
|
-
set. In `--json` output, the `workspace` key always names the catalog *file*;
|
|
176
|
-
`status`
|
|
181
|
+
an empty, vacuously-safe one. This is the same hazard class as an incomplete
|
|
182
|
+
claim set. In `--json` output, the `workspace` key always names the catalog *file*;
|
|
183
|
+
`status` also reports `dir`, the catalog's own directory that
|
|
177
184
|
registered paths resolve against.
|
|
178
185
|
|
|
179
|
-
Passing `--workspace <path>` to `salvage` derives its claim set
|
|
180
|
-
sibling-manifest style signal
|
|
181
|
-
`--claims` still works and
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
guarantee. See
|
|
186
|
+
Passing `--workspace <path>` to `salvage` derives its claim set and its
|
|
187
|
+
sibling-manifest style signal from every project the catalog registers.
|
|
188
|
+
`--claims` still works and joins both the lockfile claim set and sibling
|
|
189
|
+
manifest list. A missing or unreadable registered lock is a hard error there
|
|
190
|
+
too. PixelKiln never skips one because the catalog exists to guarantee a
|
|
191
|
+
complete account-wide claim set. See
|
|
186
192
|
[Recovery and account safety](./RECOVERY.md#shared-workspace-catalog).
|
|
187
193
|
|
|
188
194
|
## Local quality and derived output
|
|
@@ -262,7 +268,7 @@ Print the package version. `-v` is an alias.
|
|
|
262
268
|
| `--tag` | fetch/adopt | Also push tags after the command's primary work. |
|
|
263
269
|
| `--claims <paths>` | salvage | Other project lockfiles; repeatable and comma-separated. |
|
|
264
270
|
| `--workspace <path>` | workspace/salvage | Workspace catalog path; defaults to `pixelkiln.workspace.json`. On salvage, derives the claim set instead of repeated `--claims`. |
|
|
265
|
-
| `--provider <id>` | workspace add | Provider id to register the project under; defaults to
|
|
271
|
+
| `--provider <id>` | workspace add | Provider id to register the project under; defaults to the target manifest's provider. |
|
|
266
272
|
| `--account <label>` | workspace add | Free-form account label, e.g. distinguishing sandboxes. |
|
|
267
273
|
| `--all` | salvage dry run | List every unclaimed object rather than the first 30. |
|
|
268
274
|
| `--from <dir>` | init | Existing source tree to scan. |
|
package/docs/GENERATORS.md
CHANGED
|
@@ -32,6 +32,11 @@ It does not accept style images or a forced palette. On a measured 1-bit restyle
|
|
|
32
32
|
switching from reference-anchored generation to `map` changed median palette
|
|
33
33
|
distance from 6.6 to 41.9; cheap output is not cheap when unusable.
|
|
34
34
|
|
|
35
|
+
The API describes map objects as transparent, but both 256px isolated-object
|
|
36
|
+
attempts in the [environment provider benchmark](./PROVIDER_BENCHMARK.md) were
|
|
37
|
+
opaque. `map` has no `noBackground` control in PixelKiln. Check alpha before
|
|
38
|
+
assuming the file can be placed directly over a map.
|
|
39
|
+
|
|
35
40
|
## `1dir`
|
|
36
41
|
|
|
37
42
|
`1dir` is the single-facing sibling of PixelLab's rotatable/animated object
|
package/docs/GETTING_STARTED.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Getting started
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
PixelKiln turns a committed asset manifest into generated files with a
|
|
4
4
|
committed provenance lockfile. Planning, auditing, packing, mounting, and
|
|
5
5
|
exporting are local operations. Only generation, provider polling, candidate
|
|
6
6
|
selection, downloads, tagging, account adoption, salvage, purge, and balance
|
|
@@ -9,7 +9,8 @@ checks need provider access.
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
11
11
|
- Node.js 20 or newer
|
|
12
|
-
- A
|
|
12
|
+
- A credential for the manifest's selected provider: `PIXELLAB_API_KEY` for
|
|
13
|
+
PixelLab or `RD_API_KEY` for experimental Retro Diffusion support
|
|
13
14
|
- A repository checkout until the first npm release in
|
|
14
15
|
[issue #1](https://github.com/gfargo/pixelkiln/issues/1) is complete
|
|
15
16
|
|
|
@@ -53,6 +54,24 @@ in `.env.local` beside the manifest:
|
|
|
53
54
|
PIXELLAB_API_KEY=...
|
|
54
55
|
```
|
|
55
56
|
|
|
57
|
+
For experimental Retro Diffusion generation, set the manifest's
|
|
58
|
+
top-level `provider` to `retrodiffusion` and use:
|
|
59
|
+
|
|
60
|
+
```dotenv
|
|
61
|
+
RD_API_KEY=...
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Its still, tileset-sheet, animated-GIF, and PNG-spritesheet workflows are
|
|
65
|
+
implemented. Authenticated single-candidate RD Fast and RD Plus stills have
|
|
66
|
+
passed from quote through validated download, provenance, and cache.
|
|
67
|
+
Multi-candidate, tileset, GIF, and spritesheet live runs remain, so PixelLab
|
|
68
|
+
remains the production adapter. See
|
|
69
|
+
[Manifest reference](MANIFEST.md#experimental-retro-diffusion) for
|
|
70
|
+
provider options and current limits, or
|
|
71
|
+
[PixelLab vs. Retro Diffusion](../PROVIDERS.md) for selection guidance.
|
|
72
|
+
The provider setup guides give the shortest complete path for
|
|
73
|
+
[PixelLab](PIXELLAB.md) and [Retro Diffusion](RETRO_DIFFUSION.md).
|
|
74
|
+
|
|
56
75
|
Before spending anything, validate and price the selected work:
|
|
57
76
|
|
|
58
77
|
```bash
|
|
@@ -134,8 +153,8 @@ pipeline stages also exit nonzero after partial failures or timeouts.
|
|
|
134
153
|
- `restore` repairs missing generated outputs without buying new generations.
|
|
135
154
|
- `.pixelkiln/cache/` stores downloaded PNG bytes by SHA-256, so restoration can
|
|
136
155
|
still work after a temporary provider URL expires.
|
|
137
|
-
- `cache --check` verifies hashes and
|
|
138
|
-
trusting recovery bytes, then validates the account object-hash cache.
|
|
156
|
+
- `cache --check` verifies hashes and structurally validates cached PNG/GIF
|
|
157
|
+
media before trusting recovery bytes, then validates the account object-hash cache.
|
|
139
158
|
`cache --prune` removes corrupt, partial, and unreferenced project content
|
|
140
159
|
plus invalid hash entries. It does not mistake
|
|
141
160
|
objects belonging to another project for disposable account data.
|
|
@@ -143,7 +162,7 @@ pipeline stages also exit nonzero after partial failures or timeouts.
|
|
|
143
162
|
- `salvage --claims <every-other-lockfile>` reviews remote objects no project
|
|
144
163
|
currently claims. `salvage` never deletes; `purge` is a separate confirmed
|
|
145
164
|
operation.
|
|
146
|
-
-
|
|
165
|
+
- PixelKiln refuses to overwrite a file whose bytes differ from its recorded
|
|
147
166
|
hash. Resolve intentional hand edits explicitly.
|
|
148
167
|
|
|
149
168
|
## What belongs in Git
|
package/docs/LIBRARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Library API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
PixelKiln's public package entry point exposes the same provider-independent
|
|
4
4
|
primitives used by the CLI. Use these when a build tool, editor integration, or
|
|
5
5
|
game pipeline needs structured results instead of terminal output.
|
|
6
6
|
|
|
@@ -130,9 +130,9 @@ await fetchAssets(provider, specs, lock, lockPath)
|
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
Provider-backed operations mutate the supplied lock object; persist at the
|
|
133
|
-
workflow boundary with `saveLock`. See
|
|
134
|
-
|
|
135
|
-
units.
|
|
133
|
+
workflow boundary with `saveLock`. See
|
|
134
|
+
[PixelLab vs. Retro Diffusion](../PROVIDERS.md) before selecting or implementing
|
|
135
|
+
another backend, especially its optional capabilities and cost units.
|
|
136
136
|
|
|
137
137
|
`submit` validates adapter estimates again at the spending boundary and returns
|
|
138
138
|
`{ spent, unit }` for successful submissions. Lock entries retain fractional
|
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.
|