pixelkiln 0.10.0 → 0.12.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 CHANGED
@@ -36,7 +36,7 @@ build time. Do not create a second documentation copy under `website/`.
36
36
  Website sprites are generated from `website/art/pixelkiln.manifest.json`.
37
37
  Treat those requests as paid work: run `plan` and `audit` first, use an explicit
38
38
  hard budget, and commit the manifest, lockfile, and reviewed outputs together.
39
- The Review UI showcase should be captured at 1280×720 only after every asset
39
+ Capture the Review UI at 1280×720 only after every asset
40
40
  loads. Give a replacement capture a new public filename and update the page
41
41
  reference so deployed image caches cannot retain the old version.
42
42
 
package/PROVIDERS.md CHANGED
@@ -1,16 +1,15 @@
1
1
  # Provider comparison
2
2
 
3
- PixelKiln can route one manifest through PixelLab, Retro Diffusion, or a
4
- self-hosted ComfyUI server.
5
- The project model keeps planning, hard budgets, lockfile provenance, human
6
- review, recovery, and packaging. Each adapter owns its service's
7
- authentication, pricing, validation, request lifecycle, and output formats.
3
+ PixelKiln can run one manifest through PixelLab, Retro Diffusion, or a
4
+ self-hosted ComfyUI server. Planning, budgets, review, recovery, and packaging
5
+ stay the same. Each adapter handles its service's authentication, prices,
6
+ request lifecycle, and file formats.
8
7
 
9
8
  PixelLab remains the default so existing manifests and spec hashes remain
10
9
  compatible. Select another backend with the manifest's top-level `provider`
11
10
  field and keep its settings under the matching `providerOptions` key.
12
11
 
13
- Ready to configure a project? Use [Set up PixelLab](./docs/PIXELLAB.md),
12
+ To configure a project, use [Set up PixelLab](./docs/PIXELLAB.md),
14
13
  [Set up Retro Diffusion](./docs/RETRO_DIFFUSION.md), or
15
14
  [Set up ComfyUI](./docs/COMFYUI.md). This page focuses on choosing between
16
15
  them.
@@ -41,7 +40,7 @@ the providers offer directly.
41
40
 
42
41
  | Decision | PixelLab | Retro Diffusion |
43
42
  |---|---|---|
44
- | Best fit today | Established PixelKiln projects, account reconciliation, and fully live-tested generation | Native pixel-art styles, cash-denominated cost control, animation, and alternate tileset workflows |
43
+ | Best fit today | Existing PixelKiln projects, account reconciliation, and live-tested generation | Native pixel-art styles, USD budgets, animation, and alternate tileset workflows |
45
44
  | PixelKiln generators | `map`, `pixflux`, `1dir`, `tiles` | `map` and `pixflux` stills, `tiles`, `animation` |
46
45
  | Output | PNG stills, candidates, and structural tile members | PNG stills/tiles/spritesheets or animated GIF |
47
46
  | Candidate review | Yes; count varies by generator and size | Yes for 1–16 still candidates; animations and tilesets currently use one result |
@@ -72,13 +71,13 @@ prompt, size, batch, and optional seed inputs PixelKiln may replace.
72
71
  | Cost model | `0 free`; local compute and hosting are outside PixelKiln's estimate |
73
72
  | Reproducibility | Workflow content is hashed; model files, custom-node versions, and runtime settings must still be managed outside PixelKiln |
74
73
  | Account lifecycle | Read-only connectivity check; no balance, remote object listing, tagging, or purge |
75
- | Confidence | Full mocked coverage plus live generation, four-candidate review, and cache-only restore on Apple MPS; cleanup and native-grid experiments remain manual, and aesthetic approval remains human |
74
+ | Confidence | Full mocked coverage plus live generation, four-candidate review, cache-only restore, and three provider-neutral refinement runs on Apple MPS; background removal stays in the graph and aesthetic approval remains human |
76
75
 
77
- Choose ComfyUI when workflow ownership is worth manual validation. If the goal
78
- is the least cleanup between a prompt and usable pixel art, start with a
79
- specialized hosted provider. Two ComfyUI machines can share the same graph but
80
- differ in checkpoint bytes, custom-node versions, or sampler behavior. Commit
81
- the workflow and document the external model stack used to validate it.
76
+ Choose ComfyUI when control over the graph is worth the extra validation. Start
77
+ with a hosted provider when you want less cleanup. Two ComfyUI machines can run
78
+ the same graph and still differ because their checkpoint bytes, custom nodes,
79
+ or sampler settings differ. Commit the workflow and record the model stack used
80
+ to test it.
82
81
 
83
82
  ## Large environments, mountains, and buildings
84
83
 
@@ -92,11 +91,11 @@ background. That distinction matters more than raw canvas size.
92
91
  | Style consistency across a set | `1dir` accepts a style reference and returns size-dependent candidates, but it is more expensive and capped at the square-object range. | RD Pro accepts up to nine references and has stronger prompt following, but its common styles top out at 256×256 and cost $0.18 per image. Environment-specific RD Plus styles trade references for a larger 384px canvas. | LoRAs, reference adapters, ControlNet, and shared latent settings can live in the committed workflow. Reproducibility also depends on external model and custom-node versions. |
93
92
  | Very large final scene | Generate reusable objects, terrain, and background layers separately; assemble them deterministically and integer-upscale the result. | Use the same layered approach. The API has a 512px overall ceiling, but the useful environment and scene-object styles currently cap at 384px. | The graph can tile, upscale, or composite beyond hosted-provider limits, but memory and seam quality become workflow concerns. Prefer reusable layers unless the scene truly needs one render. |
94
93
 
95
- For production environments, prefer a kit over a monolith: seamless terrain,
96
- separate landmarks/buildings, foreground occluders, and a distant backdrop.
97
- This produces reusable assets, cleaner parallax, easier collision/lighting, and
98
- cheaper targeted re-rolls. Generate at the intended native pixel resolution,
99
- then scale by an integer with nearest-neighbor filtering.
94
+ For a production environment, build a kit: seamless terrain, separate
95
+ landmarks and buildings, foreground occluders, and a distant backdrop. You can
96
+ rerun one weak piece, set collision per object, and move layers independently
97
+ for parallax. Generate each piece at its native pixel resolution, then use
98
+ integer nearest-neighbor scaling.
100
99
 
101
100
  A visual benchmark should use the same briefs for an isolated building, a
102
101
  top-down landmark, and a full scenic background. Use the same intended native
@@ -152,7 +151,7 @@ complete claim checks. Keep the provider lockfiles separate. Package their
152
151
  reviewed outputs independently, or combine explicit files with `pixelkiln pack
153
152
  --inputs <file> --out <path>`.
154
153
 
155
- This is a useful split when PixelLab handles prompt-sensitive buildings and
154
+ This split works when PixelLab handles prompt-sensitive buildings and
156
155
  account recovery, Retro Diffusion handles environment-styled backdrops, clean
157
156
  cutouts, or native animation, and ComfyUI handles private or project-specific
158
157
  model experiments that can absorb manual cleanup. Retro Diffusion is not a higher-resolution
@@ -207,11 +206,11 @@ estimate and hard budget remain enforced.
207
206
 
208
207
  ## What to build next
209
208
 
210
- The first ComfyUI release has a live, versioned core-node reference workflow.
211
- Transport, candidate review, provenance, and cache recovery work. Art quality is
212
- still the gap. The tested SDXL plus Pixel Art XL graph is useful for composition,
213
- but it is not a production preset. Native-grid recovery, final palette
214
- enforcement, prompt coverage, and aesthetic approval remain manual.
209
+ The ComfyUI adapter now has a live, versioned core-node workflow. Generation,
210
+ candidate review, cache recovery, native-grid recovery, palette enforcement,
211
+ and the approval record work. The tested SDXL plus Pixel Art XL graph can find
212
+ a composition, but it is not a production preset. Background removal stays in
213
+ the graph. A person must still check the brief, pixel clusters, and drawing.
215
214
 
216
215
  Native per-style provider routing remains the highest-value orchestration
217
216
  feature. One manifest should be able to send a building style to PixelLab, an
@@ -238,20 +237,18 @@ documents free cost preflights. That combination adds something the current
238
237
  providers do not: a project-specific visual model with a cost check that can be
239
238
  captured before submission.
240
239
 
241
- Recommended order:
240
+ Recommended order from here:
242
241
 
243
- 1. Build a provider-neutral post-processing record for background removal,
244
- native-grid recovery, final palette enforcement, and human approval.
245
- 2. Benchmark pinned ComfyUI models and prompt patterns across at least two scene
242
+ 1. Benchmark pinned ComfyUI models and prompt patterns across at least two scene
246
243
  families. Reject any supposed improvement that helps only one subject.
247
- 3. Add per-style provider selection, provider-keyed budgets, and mixed-provider
244
+ 2. Add per-style provider selection, provider-keyed budgets, and mixed-provider
248
245
  integration tests.
249
- 4. Finish live Retro Diffusion multi-candidate, tileset, GIF, and spritesheet
246
+ 3. Finish live Retro Diffusion multi-candidate, tileset, GIF, and spritesheet
250
247
  smoke tests.
251
- 5. Build the Scenario still-image spike from issue #52 with dry-run cost, submit, poll,
248
+ 4. Build the Scenario still-image spike from issue #52 with dry-run cost, submit, poll,
252
249
  download, and one custom-model or reference-image benchmark.
253
- 6. Design ComfyUI Cloud as a separate authenticated and billable adapter.
254
- 7. Consider general raster marketplaces only with explicit nearest-neighbor,
250
+ 5. Design ComfyUI Cloud as a separate authenticated and billable adapter.
251
+ 6. Consider general raster marketplaces only with explicit nearest-neighbor,
255
252
  palette, transparency, and reproducibility checks.
256
253
 
257
254
  Midjourney is not an adapter target without an official public API. Automating
package/README.md CHANGED
@@ -6,42 +6,38 @@
6
6
  [Documentation](https://pixelkiln.griffen.codes/docs) ·
7
7
  [GitHub](https://github.com/gfargo/pixelkiln)
8
8
 
9
- Manifest-driven pixel-art generation, review, recovery, quality control, and
10
- game-ready asset packaging.
11
-
12
- PixelKiln treats generated art like a build pipeline: declare assets once,
13
- preview cost and drift, generate only the missing work, review candidates in a
14
- local contact sheet, and commit exact provenance beside the files. No LLM is in
15
- the orchestration loop; provider calls, polling, hashing, downloads, and filing
16
- are deterministic software mechanics.
17
-
18
- The orchestration layer is provider-neutral. PixelLab is the production,
19
- live-tested backend. An experimental Retro Diffusion adapter supports native
20
- pixel-art stills, candidate batches, tileset sheets, animated GIFs, and PNG
21
- spritesheets. Authenticated RD Fast and RD Plus single-candidate still paths
22
- have passed from quote through validated output and recovery. Multi-candidate,
23
- tileset, GIF, and spritesheet live runs remain. An experimental ComfyUI adapter
24
- runs committed API-format still-image workflows on a self-hosted server. Its
25
- core-node smoke project has passed live generation, candidate queueing, and
26
- cache-only recovery on Apple MPS. An SDXL plus Pixel Art XL workflow also has
27
- four baseline samples and four diagnostic cleanup samples. It is source
28
- material, not a production-ready pixel-art preset. See
29
- [provider comparison](./PROVIDERS.md) for the trade-offs, including large
30
- environment and building workflows.
31
- `FakeProvider` exercises the same contract deterministically in tests.
32
-
33
- > **Release status:** PixelKiln is published on npm. Merges to `main` use
34
- > Semantic Release and npm Trusted Publishing, with signed provenance and no
35
- > long-lived npm publishing token.
9
+ Generate pixel art from a manifest, review it locally, recover paid work, and
10
+ package the accepted files for a game engine.
11
+
12
+ PixelKiln treats generated art as build output. Declare assets once, inspect the
13
+ cost and changed work, generate only what is missing, choose candidates in a
14
+ local contact sheet, and commit the source and output hashes. No LLM chooses
15
+ what to run or which image wins. The CLI handles provider calls, polling,
16
+ hashing, downloads, and file placement.
17
+
18
+ PixelLab is the production backend. Retro Diffusion and self-hosted ComfyUI are
19
+ experimental. The Retro Diffusion adapter has live coverage for RD Fast and RD
20
+ Plus stills; its multi-candidate, tileset, GIF, and spritesheet paths are tested
21
+ with fixtures but still need paid live runs. ComfyUI has passed local generation,
22
+ four-candidate review, cache recovery, and native-grid refinement on Apple MPS.
23
+ Its tested SDXL workflow can find a composition, but it is not a finished
24
+ pixel-art preset. The [provider comparison](./PROVIDERS.md) lists the tested
25
+ limits and the best route for buildings and environments. `FakeProvider` covers
26
+ the same contract in automated tests.
27
+
28
+ ## Release
29
+
30
+ PixelKiln is published on npm. Merges to `main` use Semantic Release and npm
31
+ Trusted Publishing, with signed provenance and no long-lived npm token.
36
32
 
37
33
  ## Why PixelKiln
38
34
 
39
- A typical image-generation account becomes two unrelated piles: remote objects
40
- that cost money and local files with no durable explanation of where they came
41
- from. Handwritten prompts drift, failed downloads look like failed generations,
42
- and regenerating a whole set is easier than determining what is actually stale.
35
+ Image generators leave two piles behind: remote jobs that cost money and local
36
+ files that no longer explain where they came from. Prompts drift. Failed
37
+ downloads look like failed generations. Teams rerun whole sets because they
38
+ cannot tell which asset changed.
43
39
 
44
- PixelKiln supplies the missing project model:
40
+ PixelKiln keeps the missing record:
45
41
 
46
42
  - a committed manifest defines assets, styles, generators, budgets, and output;
47
43
  - a committed lockfile maps each style/asset to paid provider work and exact
@@ -69,7 +65,7 @@ PixelKiln supplies the missing project model:
69
65
  | Artifact integrity | Portable source/output hashes, canonical fingerprints, manual-edit protection, transactional promotion, crash journal recovery. |
70
66
  | Library/extension | Public TypeScript primitives, provider capability interface, and deterministic `FakeProvider`. |
71
67
 
72
- ### Human review, kept local
68
+ ### Local human review
73
69
 
74
70
  `pixelkiln pick` opens an actual local candidate sheet; the orchestration layer
75
71
  never asks a model to choose artwork for you.
@@ -78,7 +74,7 @@ never asks a model to choose artwork for you.
78
74
 
79
75
  Use Left/Right to inspect alternatives, Enter or 1–9 to select, and 0 to leave
80
76
  a row unresolved. Nothing is applied when the window is closed without using
81
- **Apply selections**. See the [CLI reference](docs/CLI.md#pick) for the complete
77
+ **Apply selections**. See the [CLI reference](docs/CLI.md#pick) for the full
82
78
  review workflow.
83
79
 
84
80
  ## Install
@@ -197,8 +193,14 @@ and native-grid recovery for model output that only looks like pixel art. The
197
193
  ComfyUI guidance is quality-first: start with 48–128px native components,
198
194
  apply the final palette after grid recovery, require prompt-coverage and human
199
195
  cluster-and-silhouette review, and compose larger scenes from accepted parts
200
- instead of chasing a larger raster. Those cleanup and approval steps are manual
201
- today.
196
+ instead of chasing a larger raster. Background removal and the art decision
197
+ still need the graph and a person. `pixelkiln refine` now handles grid recovery,
198
+ final palette enforcement, measurable checks, and the hash-bound approval
199
+ record.
200
+
201
+ Versioned recipes capture tested workflows, model hashes, license links, and
202
+ manifest-ready styles with quality boundaries. Start with `pixelkiln recipe install comfyui/pixel-art-xl-environment@1.0.0`.
203
+ Recipes install no models and make no provider calls. See [Versioned recipes](./docs/RECIPES.md).
202
204
 
203
205
  The schema rejects unknown fields and invalid generator combinations before
204
206
  planning. See the [Manifest reference](./docs/MANIFEST.md).
@@ -219,6 +221,12 @@ pixelkiln restore
219
221
  # Optional local gates.
220
222
  pixelkiln audit --check --max-distance 35 --min-transparency 0.1
221
223
  pixelkiln cache --check
224
+
225
+ # Provider-neutral pixel cleanup after selecting a generated candidate.
226
+ pixelkiln refine --from candidate.png --out art/native.png \
227
+ --palette "#141b1e,#23312a,#384d4f,#526a8d,#709fcf,#865c45,#c6a766,#f1bb70"
228
+ pixelkiln refine approve --from art/native.pixelkiln.json --reviewer "Your Name"
229
+ pixelkiln refine check --from art/native.pixelkiln.json
222
230
  ```
223
231
 
224
232
  Repeated `--style`, `--only`, `--claims`, and `--output-role` filters
@@ -339,9 +347,10 @@ const plan = await buildPlan(specs, await loadLock("pixelkiln.lock.json"))
339
347
  console.log(plan.cost, plan.costUnit, plan.actionable.length)
340
348
  ```
341
349
 
342
- The package also exports audit gates, lock/output helpers, provider contracts,
343
- pipeline stages, sprite packing/mounting, tile exporters, managed artifact
344
- writes, and offline provenance verification. See [Library API](./docs/LIBRARY.md).
350
+ The package also exports audit and image-regression gates, provider-neutral refinement, lock/output
351
+ helpers, provider contracts, pipeline stages, sprite packing/mounting, tile
352
+ exporters, managed artifact writes, and offline provenance verification. See
353
+ [Library API](./docs/LIBRARY.md).
345
354
 
346
355
  ## Documentation
347
356
 
@@ -352,14 +361,15 @@ writes, and offline provenance verification. See [Library API](./docs/LIBRARY.md
352
361
  | [Set up PixelLab](./docs/PIXELLAB.md) | Production-provider credentials, manifest, generators, and account workflows. |
353
362
  | [Set up Retro Diffusion](./docs/RETRO_DIFFUSION.md) | Experimental-provider credentials, styles, formats, cost checks, and limits. |
354
363
  | [Set up ComfyUI](./docs/COMFYUI.md) | Experimental self-hosted server, workflow bindings, local cost semantics, and limits. |
364
+ | [Versioned recipes](./docs/RECIPES.md) | Pinned workflow packs, model hashes, manifest templates, and quality contracts. |
355
365
  | [CLI reference](./docs/CLI.md) | Every command, flag, JSON mode, and exit contract. |
356
366
  | [Manifest reference](./docs/MANIFEST.md) | Every style/asset field and generator constraint. |
357
367
  | [Agent workflows](./docs/AGENTS.md) | Official skill install, operating model, and provider-aware safety. |
358
368
  | [Generators](./docs/GENERATORS.md) | Capability choice, measured costs, palettes, style references, and tiles. |
359
- | [Environment provider benchmark](./docs/PROVIDER_BENCHMARK.md) | Thirty provider outputs plus three deterministic native-grid results comparing large scenes, transparency, palette size, and file readiness. |
360
- | [Derived artifacts](./docs/ARTIFACTS.md) | Pack, mount, export, provenance, ownership, transactions, and recovery. |
369
+ | [Environment provider benchmark](./docs/PROVIDER_BENCHMARK.md) | Thirty provider outputs plus native-grid and final-palette results comparing large scenes, transparency, palette size, and file readiness. |
370
+ | [Derived artifacts](./docs/ARTIFACTS.md) | Refine, pack, mount, export, provenance, ownership, transactions, and recovery. |
361
371
  | [Recovery](./docs/RECOVERY.md) | Restore, caches, adopt, salvage, claims, and purge safety. |
362
- | [Quality gates](./docs/QUALITY.md) | Plan, doctor, audit, cache, JSON, and CI. |
372
+ | [Quality gates](./docs/QUALITY.md) | Image baselines, plan, doctor, refine, audit, cache, human approval, JSON, and CI. |
363
373
  | [Architecture](./docs/ARCHITECTURE.md) | State model, lockfile, providers, concurrency, and output identity. |
364
374
  | [Library API](./docs/LIBRARY.md) | Public TypeScript contracts and examples. |
365
375
  | [Tiles](./docs/TILES.md) | Structural outputs and generic/Tiled/Godot formats. |
package/SECURITY.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  ## Supported versions
4
4
 
5
- Until the first npm release, security fixes are applied to `main`. After
6
- publication, the latest released line and `main` are supported; older versions
7
- may be asked to upgrade before a fix is backported.
5
+ Security fixes target `main` and the latest npm release. Older versions may
6
+ need to upgrade before a fix is backported.
8
7
 
9
8
  ## Reporting a vulnerability
10
9
 
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ type GridConfidence = "low" | "medium" | "high";
3
+
2
4
  type TilesetFormat = "generic" | "tiled" | "godot";
3
5
 
4
6
  interface Args {
@@ -34,11 +36,19 @@ interface Args {
34
36
  minTransparency?: number;
35
37
  maxColors?: number;
36
38
  sigma?: number;
37
- /** `workspace`: add/remove/list/status/claims. */
39
+ palette: string[];
40
+ fixerPython?: string;
41
+ fixerRevision?: string;
42
+ minGridConfidence?: GridConfidence;
43
+ reviewer?: string;
44
+ note?: string;
45
+ /** ComfyUI `models` directory used for offline recipe model verification. */
46
+ modelRoot?: string;
47
+ /** Subcommand for `quality`, `recipe`, `refine`, or `workspace`. */
38
48
  subcommand?: string;
39
49
  /** Path to a workspace catalog. Defaults to `pixelkiln.workspace.json` in cwd. */
40
50
  workspace?: string;
41
- /** `workspace add`: manifest path. `workspace remove`: project id or manifest path. */
51
+ /** Positional target for recipe and workspace subcommands. */
42
52
  target?: string;
43
53
  /** `workspace add`: provider id to register the project under. Defaults to "pixellab". */
44
54
  provider?: string;
@@ -52,7 +62,7 @@ interface Args {
52
62
  */
53
63
  explicitLock?: string;
54
64
  }
55
- declare const COMMANDS: readonly ["init", "plan", "doctor", "gen", "submit", "poll", "pick", "fetch", "restore", "adopt", "accept", "salvage", "purge", "prune", "audit", "cache", "pack", "mount", "export", "tag", "balance", "status", "workspace", "help", "--help", "-h", "--version", "-v"];
65
+ declare const COMMANDS: readonly ["init", "plan", "doctor", "gen", "submit", "poll", "pick", "fetch", "restore", "adopt", "accept", "salvage", "purge", "prune", "audit", "cache", "pack", "mount", "export", "tag", "balance", "status", "quality", "refine", "recipe", "workspace", "help", "--help", "-h", "--version", "-v"];
56
66
  /**
57
67
  * Strict parsing. Unknown flags are a hard error rather than being ignored,
58
68
  * because a silently-dropped filter is expensive here: `--styles neon` (plural,