pixelkiln 0.84.0 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/MANIFEST.md CHANGED
@@ -472,7 +472,8 @@ their own page: [Characters](./CHARACTERS.md) and
472
472
  | Revision field | Type | Meaning |
473
473
  |---|---|---|
474
474
  | `mode` | enum, required | `image-to-image`, `inpaint`, `outpaint`, `reduce-colors`, `correct-pixelart`, `remove-background`, `animate`, `animate-pixminimax`, `animate-skeleton`, `interpolate`, or `edit-animation`. The selected provider must opt into the mode. |
475
- | `from` | asset id, required | Parent asset in the same style. Self-references, unknown ids, and cycles are rejected. A parent written as a set (a character's directions, an animation's frames) is read as every member: `reduce-colors`, `correct-pixelart`, and `edit-animation` take the whole set in one call; the other modes refuse it. See [Revising a whole set at once](./REVISIONS.md#revising-a-whole-set-at-once). |
475
+ | `from` | asset id, required | Parent asset, in this asset's style unless `fromStyle` names another. Self-references, unknown ids, and cycles are rejected. A parent written as a set (a character's directions, an animation's frames) is read as every member: `reduce-colors`, `correct-pixelart`, and `edit-animation` take the whole set in one call; the other modes refuse it. See [Revising a whole set at once](./REVISIONS.md#revising-a-whole-set-at-once). |
476
+ | `fromStyle` | style id | The style the parent lives in, when it is not this asset's own. The parent must be an asset in that style, and styles may depend on one another but not in a cycle. See [Across styles](./REVISIONS.md#across-styles). |
476
477
  | `mask` | string | Manifest-relative PNG required for `inpaint`; rejected for the other modes. Its dimensions must match an available source. |
477
478
  | `strength` | number 0–1 | Workflow edit/denoise strength (`image-to-image`, `correct-pixelart`); rejected for `reduce-colors`, `remove-background`, `animate`, `animate-pixminimax`, `interpolate`, and `edit-animation`. Interpretation is provider- and model-specific. |
478
479
  | `numColors` | integer 2–256 | `reduce-colors` only. Target palette size; mutually exclusive with `paletteImage`. |
package/docs/REVISIONS.md CHANGED
@@ -5,14 +5,16 @@ The parent may be committed art, a downloaded generation, or an approved
5
5
  quality output. PixelKiln hashes the exact parent and mask bytes, blocks stale
6
6
  dependencies before submission, and records the lineage in the lockfile.
7
7
 
8
- The manifest and pipeline are provider-neutral. ComfyUI and PixelLab implement
8
+ The manifest and pipeline are provider-neutral. ComfyUI, PixelLab and Scenario implement
9
9
  it; PixelLab covers `image-to-image`, `inpaint`, `reduce-colors`,
10
10
  `correct-pixelart`, `remove-background`, `animate`, `animate-pixminimax`,
11
11
  `animate-skeleton`, `interpolate`, and `edit-animation`, not `outpaint` (its API has no
12
12
  canvas-expansion endpoint). ComfyUI covers every mode generically except the
13
13
  five frame-set modes (`animate`, `animate-pixminimax`, `animate-skeleton`,
14
14
  `interpolate`, `edit-animation`), which need an ordered frame set its
15
- revision path cannot produce. Retro Diffusion and Scenario reject revision
15
+ revision path cannot produce. Scenario covers `image-to-image` only, by uploading the parent as a reference
16
+ image to its editing models ([Set up Scenario](./SCENARIO.md#reference-images-and-edits)).
17
+ Retro Diffusion rejects revision
16
18
  work during offline resolution instead of silently starting a fresh
17
19
  text-to-image job.
18
20
 
@@ -41,15 +43,10 @@ Keep the parent as its own asset and point the child at its stable asset id:
41
43
  }
42
44
  ```
43
45
 
44
- `from` names another asset in the same style. A source and its revision cannot
45
- be the same asset, and revision chains cannot contain a cycle. `source` and
46
- `revision` are mutually exclusive on one asset.
47
-
48
- Revision edges do not cross styles or providers in this version. To use output
49
- from another provider, commit or retain that PNG and declare it as a separate
50
- `source` asset in the ComfyUI revision style. The child still records the exact
51
- source hash, but the cross-provider handoff is a file boundary rather than one
52
- automatic lock dependency.
46
+ `from` names another asset. It lives in the child's own style unless
47
+ `fromStyle` names another (see [Across styles](#across-styles)). A source and its
48
+ revision cannot be the same asset, and revision chains cannot contain a cycle.
49
+ `source` and `revision` are mutually exclusive on one asset.
53
50
 
54
51
  Start with a low strength. Values around `0.2`–`0.4` give the workflow room to
55
52
  change texture and lighting while retaining more of the source. Higher values
@@ -102,6 +99,41 @@ poses" opens the same editor on its keypoints file. Saving rewrites the file
102
99
  only if it still holds what the page loaded (an edit made elsewhere since is
103
100
  refused, not overwritten), and the animation is stale until generated again.
104
101
 
102
+ ### Across styles
103
+
104
+ A style has one provider and one model, so a chain that generates with one model
105
+ and cleans up with another spans styles. Name the parent's style:
106
+
107
+ ```jsonc
108
+ {
109
+ "styles": {
110
+ "gen": { "generator": "map", "outDir": "art/gen", "providerOptions": { "scenario": { "modelId": "model_bfl-flux-2-klein-9b", "maxComputeUnits": 1 } } },
111
+ "pixelate": { "generator": "map", "outDir": "art/pixelate", "providerOptions": { "scenario": { "modelId": "model_sc-pixelate", "maxComputeUnits": 5, "referenceParameter": "image", "referenceArray": false } } }
112
+ },
113
+ "assets": {
114
+ "knight": { "prompt": "a knight, isolated on white", "styles": ["gen"] },
115
+ "knight-px": {
116
+ "prompt": "pixelate",
117
+ "styles": ["pixelate"],
118
+ "revision": { "mode": "image-to-image", "from": "knight", "fromStyle": "gen" }
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ The child starts from the parent's output file, however that style produced it
125
+ (any provider, or a placed `source`), and the dependency gate is unchanged: the
126
+ child is `blocked` until the parent is downloaded, current, and untouched, and
127
+ `gen` takes the whole chain to the end in one run, one wave per link. The parent
128
+ must be an asset in the named style. Styles may depend on one another but not
129
+ in a cycle, and `fromStyle` naming the asset's own style is the ordinary case.
130
+ `--style` still selects which specs a run returns; a parent style it excludes is
131
+ resolved, not generated.
132
+
133
+ A `quality` profile gates the style it is on. Put it on the last style of a
134
+ chain, whose parents are in other styles, and only that style's output is gated.
135
+ A profile on a style that also holds the raw parent would block the child.
136
+
105
137
  ## Inpainting
106
138
 
107
139
  An inpaint revision also declares a manifest-relative mask:
package/docs/SCENARIO.md CHANGED
@@ -31,8 +31,12 @@ override the production API root. Ordinary projects should leave it unset.
31
31
  PixelKiln calls `POST /generate/custom/{modelId}`. Scenario model inputs vary;
32
32
  inspect the model's current parameter reference before adding optional inputs.
33
33
  The initial PixelKiln contract sends `prompt`, `width`, `height`, `numOutputs`,
34
- and an optional `seed`. It accepts dimensions from 128–2048px in multiples of
35
- 16 and one to four PNG outputs.
34
+ and an optional `seed`. It accepts whole-number dimensions from 16 to 4096px and one to four PNG
35
+ outputs. Each model has its own tighter bounds (FLUX takes 128 to 2048 in
36
+ steps of 16, Retro Diffusion Plus 16 to 384); the free dry run that precedes
37
+ every paid request reports them, for example "Input width must be at least
38
+ 672", before anything is spent. A model may also return a different canvas than
39
+ the one requested, so check real dimensions.
36
40
 
37
41
  The public `model_bfl-flux-2-dev` profile documents that input shape. A custom
38
42
  LoRA used with that base can be supplied as `parameters.modelId` when the
@@ -78,9 +82,175 @@ keeps job and asset lookup scoped to the intended Scenario project.
78
82
  replace PixelKiln-owned `prompt`, dimensions, seed, output count, project, or
79
83
  budget fields.
80
84
 
81
- Style reference uploads are not implemented. A `styleImages` entry fails
82
- during free manifest resolution rather than uploading the same image on every
83
- run. Train or reuse a Scenario model for the first integration.
85
+ ## Reference images and edits
86
+
87
+ Most Scenario image models take reference images, which serve both as style
88
+ guidance and as the image to edit. PixelKiln uploads each local image to
89
+ Scenario once (`POST /assets`, free), keeps the returned asset id by content
90
+ hash in a temporary cache so a rerun does not upload it again, and sends the ids
91
+ as the model's `referenceImages` input. Two things use this:
92
+
93
+ - A style's `styleImages` are sent as references with every asset in the style.
94
+ - An `image-to-image` revision sends its parent first, then any style images.
95
+ The prompt is the edit instruction, as in
96
+ [controlled revisions](./REVISIONS.md). Masked `inpaint` and the
97
+ PixelLab animation and cleanup modes are not available, and `strength` is
98
+ refused because Scenario has no common one; use the model's own `parameters`.
99
+
100
+ ```jsonc
101
+ {
102
+ "styles": {
103
+ "edit": {
104
+ "generator": "map",
105
+ "size": 512,
106
+ "outDir": "assets/generated",
107
+ "providerOptions": {
108
+ "scenario": { "modelId": "model_bfl-flux-2-klein-9b", "maxComputeUnits": 1 }
109
+ }
110
+ }
111
+ },
112
+ "assets": {
113
+ "keep": { "prompt": "a stone mountain keep", "source": "art/keep.png" },
114
+ "keep-snow": {
115
+ "prompt": "the same keep in winter: snow on the roofs, pixel art",
116
+ "revision": { "mode": "image-to-image", "from": "keep" }
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ The adapter does not know each model's input names, so a model whose image
123
+ input is not called `referenceImages` needs `referenceParameter` (for example
124
+ `"image"`), and `referenceArray: false` if it takes one image rather than a
125
+ list. `parameters` may not also set that input. A model must accept images at
126
+ all: the free dry run, which now includes the references, rejects one that
127
+ does not before anything is spent. A reference can add to the quote (GPT Image 2
128
+ priced one text-only 512×512 request at 11 CU and the same request with a
129
+ reference at 12).
130
+
131
+ On October 5, 2026 a one-image `image-to-image` revision of the bake-off's GPT
132
+ Image 2 keep through `model_bfl-flux-2-klein-9b` quoted and billed 1 CU and
133
+ returned the same keep with snow on its roofs and battlements, banners and
134
+ layout intact. The committed
135
+ [Scenario edit smoke](../benchmarks/provider-scenario-edit/README.md) has the
136
+ manifest, lockfile, and both images. That is one sample on one model.
137
+
138
+ ### Tool models as image-to-image
139
+
140
+ Scenario's single-image tools (pixel snapper, pixelate, background removal,
141
+ upscalers) are models like any other, so they run through the same
142
+ `image-to-image` revision with no extra mode: point the style at the tool's
143
+ model, name its input `image`, and put its settings in `parameters`. The
144
+ adapter's other fields (`prompt`, `width`, `height`, `numOutputs`, `seed`) are
145
+ accepted and ignored by these tools, and the free dry run prices the exact
146
+ request. Free dry runs on October 5, 2026 quoted these on a `cu-basic` account:
147
+
148
+ | Model | CU | Inputs besides `image` |
149
+ |---|---:|---|
150
+ | `model_birefnet-background-removal` | 2 | none |
151
+ | `model_recraft-crisp-upscale` | 2 | none |
152
+ | `model_bria-remove-background`, `model_photoroom-background-removal` | 3 | none |
153
+ | `model_pixel-snapper` | 5 | `colors` 8 to 256 (default 16) |
154
+ | `model_sc-pixelate` | 5 | `pixelGridSize` 1 to 512, `removeNoise`, `colorPalette`, `colorPaletteSize` |
155
+ | `model_upscale-v3`, `model_topaz-image-upscale` | 10 | none |
156
+
157
+ ```jsonc
158
+ {
159
+ "styles": {
160
+ "snap": {
161
+ "generator": "map",
162
+ "size": 512,
163
+ "outDir": "assets/snapped",
164
+ "providerOptions": {
165
+ "scenario": {
166
+ "modelId": "model_pixel-snapper",
167
+ "maxComputeUnits": 5,
168
+ "referenceParameter": "image",
169
+ "referenceArray": false,
170
+ "parameters": { "colors": 16 }
171
+ }
172
+ }
173
+ }
174
+ },
175
+ "assets": {
176
+ "keep-snapped": {
177
+ "prompt": "snap to the pixel grid",
178
+ "revision": { "mode": "image-to-image", "from": "keep" }
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ Birefnet and Pixel Snapper were then run once each through the adapter (7 CU,
185
+ quoted and billed identically; see the
186
+ [tool-model smoke](../benchmarks/provider-scenario-tools/README.md)). Pixel
187
+ Snapper returned an 83×83, exactly-16-colour native-grid version of a 512×512
188
+ image, a different size than the manifest's canvas, and Birefnet's cutout kept
189
+ its subject at alpha 254 rather than 255. Pixelate (5 CU) was run too and returned a 23-colour, crisp pixel version at the
190
+ source's size; of the upscalers, Topaz smoothed the art, Upscale V3 repainted it
191
+ as a photoreal castle, and Recraft Crisp returned WebP, which the adapter refuses,
192
+ so none of them suits pixel art. Pixelate's output also passed `pixelkiln refine`'s
193
+ high-confidence grid gate as a 102×102, 23-colour asset, where the raw image
194
+ (low confidence) and Pixel Snapper's output (medium) did not: GPT Image 2,
195
+ then Pixelate, then free refinement made one gate-passing asset for 16 CU. They overlap PixelKiln's own offline work: `pixelkiln refine` snaps
196
+ the grid and palette for free, and PixelLab's `remove-background` revision costs
197
+ one generation. Reach for these when the art is already on Scenario.
198
+
199
+ ### Retro Diffusion on Scenario
200
+
201
+ Scenario hosts three Retro Diffusion models, and they are the most pixel-art-specific
202
+ models in its catalog: `model_retrodiffusion-plus` (18 styles from `default` and
203
+ `retro` to `isometric_asset`, `topdown_asset`, `character_turnaround`, and
204
+ `ui_element`), `model_retrodiffusion-tile` (`tileset`, `tileset_advanced`,
205
+ `single_tile`, `tile_variation`, `tile_object`, `scene_object`), and
206
+ `model_retrodiffusion-animation` (`four_angle_walking`, `walking_and_idle`,
207
+ `small_sprites`, `vfx`). On a `cu-basic` account every dry run answered
208
+ `ModelAccessRestrictedError` with `requiredPlan: cu-pro-q3-25`, so none of this
209
+ has been run, and no price is known until the plan is upgraded.
210
+
211
+ Judging from Scenario's parameter reference (nothing here was exercised), what
212
+ the adapter already supports and what it does not:
213
+
214
+ | Need | Status |
215
+ |---|---|
216
+ | `style`, `removeBg`, `tileX`, `tileY`, `strength`, `bypassPromptExpansion` | Pass-through `parameters`. |
217
+ | 16 to 384 px canvas | Accepted now; the model's bound comes from the free dry run. |
218
+ | `image` (image-to-image) | Supported through an `image-to-image` revision with `referenceParameter: "image"` and `referenceArray: false`. |
219
+ | `inputPalette` (a palette image) | Not supported: the adapter has one reference input. |
220
+ | More than 4 outputs (Plus and Tile allow 10) | Not supported: `numOutputs` stops at 4. |
221
+ | Animation as a PNG spritesheet (`returnSpritesheet: true`) | Lands as one still image; there is no frame-set output for Scenario, so a person would slice it. The default GIF output is refused. |
222
+ | Tilesets | Land as one still; PixelKiln's tile roles and exports do not apply. |
223
+
224
+ PixelKiln also has a direct [Retro Diffusion](./RETRO_DIFFUSION.md) provider
225
+ with live-tested single stills. Choosing between them is a billing and plan
226
+ question (Retro Diffusion's USD credits against Scenario's compute units), not a
227
+ feature one, until the Scenario route is measured. The first live check after
228
+ upgrading should be one `model_retrodiffusion-plus` still at 64×64 with the
229
+ default style: quote, billed amount, dimensions, and whether it comes back as
230
+ PNG.
231
+
232
+ ### Chaining models and tools
233
+
234
+ The [pipeline run](../benchmarks/provider-scenario-pipeline/README.md)
235
+ generated a character, pixelated it to a palette, cut out its background, and
236
+ refined it, for 8 CU on the cheapest path and 18 CU with GPT Image 2, ending in
237
+ a 64×64 transparent sprite that passed the `refine` gate. Three rules came out
238
+ of it:
239
+
240
+ - A revision's parent must be in the same style, and a style has one model. To
241
+ chain steps, restate the previous output in the next style as a placed
242
+ `source`: `"source": "outputs/gen-klein/knight.png"`. Run each step with
243
+ `gen --style <id>`; nothing orders them yet.
244
+ - A `quality` profile gates every asset in its style, parents included, so a raw
245
+ parent blocks its own child. Put `quality` only on a final style whose asset is
246
+ the last output placed as a `source`, then run `pixelkiln refine --style`.
247
+ - Pass the same palette to the tool (Pixelate's `colorPalette`) and to
248
+ `quality.palette`. The output then stays inside it. Pixelate's
249
+ `pixelGridSize` also set the detected native grid closely (48, 64 and 128
250
+ asked, 46, 64 and 128 found).
251
+
252
+ A palette that is too small for the art costs fidelity (a bright blue cape
253
+ became navy under a 32-colour palette), so passing the gate is not approval.
84
254
 
85
255
  ## Plan before spending
86
256
 
@@ -114,6 +284,12 @@ quote stops the run before paid work. Scenario's `costDetails` already sum to
114
284
  `creativeUnitsCost`; PixelKiln records both without double-counting. A separate
115
285
  IP-detection charge is additive when Scenario reports one.
116
286
 
287
+ A 429 on a generation request means the account's concurrent-job limit
288
+ refused it: nothing was accepted or billed, and the adapter retries for about
289
+ 80 seconds. Past that, rerun `gen`; the assets that landed are kept. A finished
290
+ job whose asset is not a PNG (some models return JPEG) is billed, so that asset
291
+ is marked failed rather than polled again.
292
+
117
293
  The command budget is still a hard ceiling over the whole selected run. The
118
294
  manifest ceiling protects each request from a changed live quote.
119
295
 
@@ -123,6 +299,24 @@ closed palette, and require named approval before pack or mount. This offline
123
299
  policy does not change the Scenario request or CU quote. See
124
300
  [Manifest quality profiles](./MANIFEST.md#quality-profiles).
125
301
 
302
+ ### Models and what they cost
303
+
304
+ A free survey on October 5, 2026 quoted every non-deprecated text-to-image
305
+ model with a prompt-only 512×512 dry run on a `cu-basic` account. 37 were
306
+ usable and 19 were refused with `ModelAccessRestrictedError` (the Retro
307
+ Diffusion Plus, Tile, and Animation models need the `cu-pro-q3-25` plan).
308
+ Quotes ran from 1 CU (FLUX.2 Klein 9b, FLUX.1 Schnell, P-Image) through 2 to 6
309
+ for the Krea 2, Recraft V4.1 Flash, Meta Muse, Ernie, Z-Image, and Qwen Image
310
+ models, 11 to 12 for GPT Image 2 and Gemini 3.1 Flash, to 16 for the FLUX.2 Dev
311
+ this page was first validated on. The
312
+ [model bake-off](../benchmarks/provider-scenario-bakeoff/README.md) ran ten of
313
+ them once: price did not predict fit, several models ignore the requested
314
+ canvas size, and one returned a JPEG, which the adapter refuses.
315
+
316
+ Scenario's catalog also lists pixel-art LoRAs, background-removal and upscale
317
+ models, and a `pixel-snapper` cleanup tool. LoRA models answer a different
318
+ endpoint than `/generate/custom/{modelId}`, which this adapter does not call.
319
+
126
320
  ### Current live validation
127
321
 
128
322
  On September 5, 2026, PixelKiln authenticated against the read-only model
@@ -184,9 +378,11 @@ for every style:
184
378
  | `numOutputs` | One to four PNG candidates; defaults to one. |
185
379
  | `projectId` | Optional Scenario ownership/routing project. |
186
380
  | `parameters` | Additional model-specific JSON inputs. PixelKiln-owned request fields cannot be overridden. |
381
+ | `referenceParameter` | The model input that takes images, default `referenceImages`. |
382
+ | `referenceArray` | `false` when that input takes one image rather than a list. |
187
383
 
188
- The current adapter supports `map`, dimensions from 128–2048px in multiples of
189
- 16, optional seed, and no style-image uploads. Every paid request is preceded
384
+ The current adapter supports `map`, whole-number dimensions from 16 to 4096px,
385
+ optional seed, style images and `image-to-image` revisions as reference uploads. Every paid request is preceded
190
386
  by an identical `dryRun=true` request. See [Set up Scenario](SCENARIO.md) for
191
387
  credentials, cost semantics, recovery, and the paid live-test boundary.
192
388
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.84.0",
3
+ "version": "0.86.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1022,6 +1022,10 @@
1022
1022
  "type": "string",
1023
1023
  "minLength": 1
1024
1024
  },
1025
+ "fromStyle": {
1026
+ "type": "string",
1027
+ "minLength": 1
1028
+ },
1025
1029
  "mask": {
1026
1030
  "type": "string",
1027
1031
  "minLength": 1
@@ -2,8 +2,10 @@
2
2
 
3
3
  Read this reference when an asset declares `revision`.
4
4
 
5
- - Treat the parent and child as separate assets. `revision.from` must name a
6
- parent in the same style.
5
+ - Treat the parent and child as separate assets. `revision.from` names the
6
+ parent, in the child's own style unless `revision.fromStyle` names another, so
7
+ a chain can generate with one provider and refine with another. A `quality`
8
+ profile gates its own style; put it on the last style of a chain.
7
9
  - Run `pixelkiln plan --only <child>` first. If it reports `blocked`, do not try
8
10
  to submit the child or work around the gate.
9
11
  - A generated parent must be current and downloaded. When the parent has a
@@ -20,11 +20,15 @@ schemas remain unverified. Require a one-asset smoke before widening a batch.
20
20
  existing Scenario asset and must not trigger another generation.
21
21
  - Treat `scenario://` job and asset references as the recovery contract.
22
22
  Temporary signed Scenario URLs must not remain in a settled lockfile.
23
- - Verify the chosen model returns PNG. The MVP rejects other media formats,
24
- style-image uploads, animation, and tiles.
23
+ - Verify the chosen model returns PNG. The adapter rejects other media
24
+ formats, animation, and tiles.
25
+ - Style images and `image-to-image` revisions are uploaded once (free) and sent
26
+ as the model's `referenceImages` input; set `referenceParameter` and
27
+ `referenceArray` for a model that names it differently. Other revision modes
28
+ and `strength` are refused.
25
29
 
26
- Scenario model parameters vary. The MVP supplies prompt, 128–2048px dimensions
27
- in multiples of 16, one to four outputs, and optional seed. Put only documented
30
+ Scenario model parameters vary. The MVP supplies prompt, 16–4096px dimensions
31
+ (each model has tighter bounds, reported by the free dry run), one to four outputs, and optional seed. Put only documented
28
32
  model inputs in `parameters`; PixelKiln rejects attempts to override its prompt,
29
33
  dimensions, seed, output count, project routing, or CU ceiling.
30
34