pixelkiln 0.7.0 → 0.8.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/README.md CHANGED
@@ -24,7 +24,7 @@ tileset, GIF, and spritesheet live runs remain. An experimental ComfyUI adapter
24
24
  runs committed API-format still-image workflows on a self-hosted server. Its
25
25
  core-node smoke project has passed live generation, candidate queueing, and
26
26
  cache-only recovery on Apple MPS. An SDXL plus Pixel Art XL workflow also has
27
- four committed building and environment samples. See
27
+ four baseline samples and four refined transparency and palette samples. See
28
28
  [provider comparison](./PROVIDERS.md) for the trade-offs, including large
29
29
  environment and building workflows.
30
30
  `FakeProvider` exercises the same contract deterministically in tests.
@@ -347,7 +347,7 @@ writes, and offline provenance verification. See [Library API](./docs/LIBRARY.md
347
347
  | [Manifest reference](./docs/MANIFEST.md) | Every style/asset field and generator constraint. |
348
348
  | [Agent workflows](./docs/AGENTS.md) | Official skill install, operating model, and provider-aware safety. |
349
349
  | [Generators](./docs/GENERATORS.md) | Capability choice, measured costs, palettes, style references, and tiles. |
350
- | [Environment provider benchmark](./docs/PROVIDER_BENCHMARK.md) | Twenty-four outputs comparing buildings, landmarks, large backgrounds, cost, and file readiness. |
350
+ | [Environment provider benchmark](./docs/PROVIDER_BENCHMARK.md) | Twenty-eight outputs comparing providers, large scenes, transparency, palette size, and file readiness. |
351
351
  | [Derived artifacts](./docs/ARTIFACTS.md) | Pack, mount, export, provenance, ownership, transactions, and recovery. |
352
352
  | [Recovery](./docs/RECOVERY.md) | Restore, caches, adopt, salvage, claims, and purge safety. |
353
353
  | [Quality gates](./docs/QUALITY.md) | Plan, doctor, audit, cache, JSON, and CI. |
package/docs/COMFYUI.md CHANGED
@@ -7,6 +7,8 @@ Diffusion 1.5 workflow has passed single-image generation and a four-candidate
7
7
  review queue on Apple MPS. A higher-quality SDXL workflow has also passed four
8
8
  building and environment renders. ComfyUI Cloud is not part of this release.
9
9
 
10
+ [Visit ComfyUI](https://www.comfy.org/) or continue with the local setup below.
11
+
10
12
  ## Start ComfyUI
11
13
 
12
14
  Install and start ComfyUI using its
@@ -55,17 +57,19 @@ pixel-art quality.
55
57
 
56
58
  ## Install the tested quality stack
57
59
 
58
- The committed quality benchmark uses two public model files:
60
+ The committed quality and post-processing benchmarks use three public model
61
+ files:
59
62
 
60
63
  | File | ComfyUI folder | SHA-256 | License named by the model card |
61
64
  |---|---|---|---|
62
65
  | [`sd_xl_base_1.0.safetensors`](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors) | `models/checkpoints` | `31e35c80fc4829d14f90153f4c74cd59c90b779f6afe05a74cd6120b893f7e5b` | CreativeML Open RAIL++-M |
63
66
  | [`pixel-art-xl.safetensors`](https://huggingface.co/nerijs/pixel-art-xl/blob/main/pixel-art-xl.safetensors) | `models/loras` | `4234637cb80c998f41e348e6a6cb6bc20d8d038b2b0f256b6129b3b5e353eef7` | CreativeML OpenRAIL-M |
67
+ | [`birefnet.safetensors`](https://huggingface.co/Comfy-Org/BiRefNet/blob/main/background_removal/birefnet.safetensors) | `models/background_removal` | `9ab37426bf4de0567af6b5d21b16151357149139362e6e8992021b8ce356a154` | MIT |
64
68
 
65
69
  Download each file into the named folder, verify its checksum, then confirm the
66
- checkpoint and LoRA appear in ComfyUI. The files are about 6.9 GB and 171 MB.
67
- They are not bundled with PixelKiln. Read both model cards before distributing
68
- the models or their outputs.
70
+ checkpoint, LoRA, and background-removal model appear in ComfyUI. The files are
71
+ about 6.9 GB, 171 MB, and 444 MB. They are not bundled with PixelKiln. Read the
72
+ model cards before distributing the models or their outputs.
69
73
 
70
74
  The benchmark renders at 1024×1024, where SDXL has enough room to compose the
71
75
  scene, then uses ComfyUI's core `ImageScale` node with `nearest-exact` to write
@@ -77,6 +81,40 @@ output dimensions.
77
81
  You can reproduce the four samples with the committed
78
82
  [ComfyUI benchmark project](../benchmarks/provider-environments/comfyui/README.md).
79
83
 
84
+ ## Remove backgrounds and control the palette
85
+
86
+ ComfyUI 0.34.3 has the required nodes in core. No custom-node package is needed.
87
+ The tested isolated-asset graph runs these nodes in this order:
88
+
89
+ 1. Decode the 1024×1024 SDXL image.
90
+ 2. Run `RemoveBackground` with the loaded BiRefNet model.
91
+ 3. Invert the returned background mask for use as foreground alpha.
92
+ 4. Run `ImageQuantize` on the RGB image with 64 colors and no dithering.
93
+ 5. Join the quantized RGB image with the alpha mask.
94
+ 6. Reduce the RGBA result with `ImageScale` set to `nearest-exact`.
95
+
96
+ The order is deliberate. BiRefNet sees the full-resolution, full-color image,
97
+ while quantization cannot damage the mask. Scenic backgrounds skip BiRefNet
98
+ and use only 64-color quantization before the final scale.
99
+
100
+ The [post-processing benchmark](../benchmarks/provider-postprocessing/comfyui/README.md)
101
+ reuses the same prompts, seeds, SDXL settings, and LoRA strengths as the first
102
+ ComfyUI run. Its two isolated assets have 60% and 62% transparent pixels and 55
103
+ and 58 RGB colors. The two backgrounds use 64 and 60 colors. The original
104
+ files ranged from 16,811 to 50,985 colors.
105
+
106
+ Use PixelKiln to keep those requirements enforceable:
107
+
108
+ ```bash
109
+ pixelkiln audit --style isolated-refined --min-transparency 0.5 --max-colors 64 --check
110
+ pixelkiln audit --style background-refined --max-colors 64 --check
111
+ ```
112
+
113
+ Start without dithering for compact game art. Floyd-Steinberg can soften bands,
114
+ but it adds noisy pixel patterns. Ordered Bayer dithering is easier to art-direct
115
+ when a project needs deliberate texture. Whichever mode you choose becomes part
116
+ of the committed workflow hash.
117
+
80
118
  ## Configure the manifest
81
119
 
82
120
  Put dimensions on each asset. Put workflow configuration under
@@ -167,10 +205,9 @@ the portable reference against the current `COMFYUI_BASE_URL`.
167
205
  For large mountains, buildings, and backgrounds, model choice and working
168
206
  resolution matter more than the provider label. The SDXL benchmark produced a
169
207
  coherent 384px cliff fortress and two layered environments where the starter
170
- SD1.5 workflow did not. It still returned opaque isolated assets and thousands
171
- of source colors, so transparency and palette reduction remain separate art
172
- pipeline steps. Benchmark the exact committed workflow before assigning it a
173
- production batch.
208
+ SD1.5 workflow did not. Core post-processing then turned the isolated images
209
+ into transparent 64-color assets without changing their composition. Benchmark
210
+ the exact committed workflow before assigning it a production batch.
174
211
 
175
212
  ## Troubleshooting
176
213
 
@@ -4,8 +4,8 @@ This benchmark compares PixelLab and Retro Diffusion on five game-art briefs,
4
4
  with a four-brief ComfyUI extension using a named SDXL stack. Three briefs use
5
5
  256×256 output; two use 384×384 to test larger buildings and environment
6
6
  backgrounds. The hosted providers have two attempts per brief. ComfyUI has one
7
- attempt on each supported brief. Prompt text and seed numbers match, but seeds
8
- are not portable between models.
7
+ baseline and one post-processed attempt on each supported brief. Prompt text
8
+ and seed numbers match, but seeds are not portable between models.
9
9
 
10
10
  The benchmark tests the adapters that PixelKiln ships. It does not rank every
11
11
  model or endpoint sold by either provider.
@@ -178,13 +178,33 @@ reduction, but they are not indexed, low-palette sprites. Add explicit
178
178
  background removal and palette quantization when the target art direction
179
179
  requires them.
180
180
 
181
+ ### ComfyUI post-processing result
182
+
183
+ The follow-up graph keeps the generation settings fixed and changes only the
184
+ cleanup nodes. BiRefNet removes the isolated backgrounds, and ComfyUI's core
185
+ quantizer limits every image to 64 colors without dithering.
186
+
187
+ | Original observatory | Refined observatory | Original fortress | Refined fortress |
188
+ |---|---|---|---|
189
+ | ![Original opaque ComfyUI mountain observatory](../website/public/benchmarks/provider-environments/comfyui/isolated/a/mountain-observatory.png) | ![Transparent 64-color ComfyUI mountain observatory](../website/public/benchmarks/provider-postprocessing/comfyui/isolated/mountain-observatory.png) | ![Original opaque ComfyUI cliffside fortress](../website/public/benchmarks/provider-environments/comfyui/isolated/a/cliffside-fortress.png) | ![Transparent 64-color ComfyUI cliffside fortress](../website/public/benchmarks/provider-postprocessing/comfyui/isolated/cliffside-fortress.png) |
190
+
191
+ | Original alpine valley | 64-color alpine valley | Original volcanic pass | 64-color volcanic pass |
192
+ |---|---|---|---|
193
+ | ![Original ComfyUI alpine valley](../website/public/benchmarks/provider-environments/comfyui/background/a/alpine-valley.png) | ![64-color ComfyUI alpine valley](../website/public/benchmarks/provider-postprocessing/comfyui/background/alpine-valley.png) | ![Original ComfyUI volcanic pass](../website/public/benchmarks/provider-environments/comfyui/background/a/volcanic-pass.png) | ![64-color ComfyUI volcanic pass](../website/public/benchmarks/provider-postprocessing/comfyui/background/volcanic-pass.png) |
194
+
195
+ The cutouts retained their silhouettes while reaching 60% and 62% transparent
196
+ pixels. They use 55 and 58 RGB colors instead of 16,811 and 31,572. The scenic
197
+ images fell to 64 and 60 colors without losing their main depth bands. The
198
+ committed [post-processing project](../benchmarks/provider-postprocessing/comfyui/README.md)
199
+ contains the workflows, manifest, audit commands, and provenance.
200
+
181
201
  ## Cost and operational results
182
202
 
183
203
  | Provider | Successful images | Charged amount | Final balance |
184
204
  |---|---:|---:|---:|
185
205
  | PixelLab | 10 | 10 generations | 4,411 generations |
186
206
  | Retro Diffusion | 10 | $0.744 | $9.73 |
187
- | ComfyUI | 4 | 0 `free` PixelKiln units | No account balance |
207
+ | ComfyUI | 8 | 0 `free` PixelKiln units | No account balance |
188
208
 
189
209
  PixelLab charged one generation per image. Retro Diffusion quoted and charged
190
210
  $0.058 for each 256px RD Plus image and $0.099 for each 384px RD Plus image;
@@ -200,7 +220,7 @@ The run also caught two integration details:
200
220
 
201
221
  All three manifests now pass `doctor` and report a current plan. The hosted
202
222
  projects have ten healthy PNG cache entries each; the ComfyUI extension has
203
- four.
223
+ four baseline and four refined entries.
204
224
 
205
225
  ## Recommendation
206
226
 
@@ -215,10 +235,10 @@ were cheaper and more faithful to the brief. Try Retro Diffusion when you want
215
235
  foreground framing and a closer illustrated scene.
216
236
 
217
237
  Try the tested ComfyUI SDXL stack when local control and larger compositions
218
- matter more than ready-to-place transparency. It produced the best large
219
- building in this run and a strong layered valley, with no provider charge. It
220
- also took roughly 90 seconds per 1024px render on the tested Apple MPS machine,
221
- and every output still needs palette review.
238
+ matter most. It produced the best large building in this run and a strong
239
+ layered valley, with no provider charge. The refined core-node graph also makes
240
+ transparent, 64-color cutouts. A 1024px render took roughly 60 to 90 seconds on
241
+ the tested Apple MPS machine.
222
242
 
223
243
  Do not ask any provider for one giant finished level. Generate terrain,
224
244
  background, buildings, landmarks, and foreground pieces separately. Compose
@@ -227,5 +247,5 @@ them in the engine, then use integer nearest-neighbor scaling for display.
227
247
  This sample is useful, not definitive. Two attempts expose obvious tendencies,
228
248
  but they do not measure every style, prompt family, or model update. The new
229
249
  volcanic brief also shows why prompt coverage needs review at the object level:
230
- all four images lost the requested fortress. Rerun the committed manifests when
231
- either provider changes its models.
250
+ all providers lost the requested fortress. Rerun the committed manifests when
251
+ a provider or local model changes.
package/docs/README.md CHANGED
@@ -12,7 +12,7 @@ This source also renders at
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
13
  | [Set up PixelLab](./PIXELLAB.md) | Configure the production provider, choose a generator, and use its account workflows. |
14
14
  | [Set up Retro Diffusion](./RETRO_DIFFUSION.md) | Configure the experimental provider, choose a style, and understand its live-tested boundary. |
15
- | [Set up ComfyUI](./COMFYUI.md) | Connect a self-hosted server, install the tested SDXL pixel-art stack, and bind a committed workflow. |
15
+ | [Set up ComfyUI](./COMFYUI.md) | Install the tested SDXL and BiRefNet stack, then bind generation and cleanup workflows. |
16
16
  | [CLI reference](./CLI.md) | Every command and flag, offline/provider requirements, JSON output, and exit behavior. |
17
17
  | [Manifest reference](./MANIFEST.md) | Every style and asset field, inheritance, generator-specific constraints, mounting, and schema validation. |
18
18
  | [Agent workflows](./AGENTS.md) | Install the official skill and pair agent guidance with the deterministic CLI. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -32,6 +32,14 @@ PNG still matches the manifest dimensions. The isolated workflow uses LoRA
32
32
  strength 1.0, while the environment workflow uses 0.85. Read
33
33
  `docs/COMFYUI.md` for download links, checksums, licenses, and measured limits.
34
34
 
35
+ For production-oriented stills, prefer the core-node refinement graph in
36
+ `benchmarks/provider-postprocessing/comfyui/`. It runs BiRefNet on the decoded
37
+ full-resolution image, quantizes RGB separately, joins the inverted background
38
+ mask as alpha, and scales last. Do not quantize before background removal or
39
+ feed a scenic background through the removal model. Use `pixelkiln audit` with
40
+ both `--min-transparency` and `--max-colors` so the cleanup requirements fail in
41
+ CI when a workflow or model changes.
42
+
35
43
  The plan reports `0 free` and generation uses `--budget 0`. Explain that this
36
44
  means no metered API charge. Hardware, electricity, hosting, and model licenses
37
45
  can still cost money.