pixelkiln 0.92.2 → 0.92.3

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/dist/index.cjs CHANGED
@@ -264,6 +264,7 @@ __export(index_exports, {
264
264
  parseVfxStep: () => parseVfxStep,
265
265
  parseWorkspace: () => parseWorkspace,
266
266
  pickHistory: () => pickHistory,
267
+ pixMiniMaxCost: () => pixMiniMaxCost,
267
268
  pixelateFile: () => pixelateFile,
268
269
  pngSize: () => pngSize,
269
270
  poll: () => poll,
@@ -355,6 +356,7 @@ __export(index_exports, {
355
356
  tilesCost: () => tilesCost,
356
357
  toPortablePath: () => toPortablePath,
357
358
  totalSpend: () => totalSpend,
359
+ uiElementCandidateCount: () => uiElementCandidateCount,
358
360
  unzoomFile: () => unzoomFile,
359
361
  upsert: () => upsert,
360
362
  validateCostEstimate: () => validateCostEstimate,
@@ -431,6 +433,17 @@ function candidateCount(size) {
431
433
  if (size <= 170) return 4;
432
434
  return 1;
433
435
  }
436
+ function uiElementCandidateCount(size) {
437
+ if (size <= 32) return 64;
438
+ if (size <= 35) return 49;
439
+ if (size <= 41) return 36;
440
+ if (size <= 50) return 25;
441
+ if (size <= 64) return 16;
442
+ if (size <= 84) return 9;
443
+ if (size === 85) return 16;
444
+ if (size <= 170) return 4;
445
+ return 1;
446
+ }
434
447
  function generationCost(width, height, generator = "map") {
435
448
  if (generator === "vfx") return 0;
436
449
  if (generator === "map" || generator === "pixflux") return 1;
@@ -447,6 +460,16 @@ function proTierCost(width, height) {
447
460
  if (px <= 102400) return PRO_TIER_PRICES[1];
448
461
  return PRO_TIER_PRICES[2];
449
462
  }
463
+ function pixMiniMaxCost(width, height, frames, enhancePrompt = false) {
464
+ const f = width * height * Math.max(1, frames) / 4096;
465
+ let units;
466
+ if (f <= 8) units = 1;
467
+ else if (f <= 16) units = 1 + (f - 8) / 8;
468
+ else if (f <= 40) units = 2 + (f - 16) / 6;
469
+ else units = 6 + (f - 40) / 6;
470
+ const base = Math.max(1, Math.ceil(units - 1e-9));
471
+ return enhancePrompt ? base + 0.05 : base;
472
+ }
450
473
  function tilesCost(tileSize, variations) {
451
474
  const px = tileSize * tileSize * Math.max(1, variations);
452
475
  if (px <= 1024) return PRO_TIER_PRICES[0];
@@ -3266,10 +3289,10 @@ var PixelLabClient = class {
3266
3289
  * limited to 400x400 and no style reference. Like a revision, this hands
3267
3290
  * back a plain background job with no resource of its own; unlike a
3268
3291
  * revision, one call returns several candidate images to pick from (the
3269
- * same 4/16/64-by-size tiering as `1dir`), not a single result, and its
3270
- * completed shape has not been exercised live yet — `pollImagePro` in
3271
- * pixellab.ts fails loudly rather than guess if `last_response.images`
3272
- * turns out not to be the real field name.
3292
+ * same 4/16/64-by-size tiering as `1dir`), not a single result. It has run
3293
+ * live (a 64x64 call billed 10, October 2026); `pollImagePro` in
3294
+ * pixellab.ts still fails loudly rather than guess if `last_response.images`
3295
+ * is not the field name.
3273
3296
  *
3274
3297
  * Reference images and a style image (`reference_images`, `style_image` +
3275
3298
  * `style_options`) exist on this endpoint but are not modeled here yet.
@@ -3380,7 +3403,8 @@ var PixelLabClient = class {
3380
3403
  * guided by an optional concept image and a natural-language color
3381
3404
  * palette. A plain background job; unlike `/create-ui-asset` there is no
3382
3405
  * piece/element layout, and sizes start at 16px instead of 192. Its
3383
- * completed shape has not been exercised live; `pollUiElement` reads it
3406
+ * completed shape came back as a list of candidates on a live
3407
+ * 32x32 call (64 of them, billed 10); `pollUiElement` still reads it
3384
3408
  * defensively.
3385
3409
  */
3386
3410
  async generateUiV2(args) {
@@ -3626,11 +3650,10 @@ var PixelLabClient = class {
3626
3650
  * no PixelLab character/object resource required — unlike `animateCharacter`
3627
3651
  * / `animateObject`, `firstFrame` is whatever bytes the caller has on hand.
3628
3652
  * A plain background job, like every other PixelLab async submission;
3629
- * unlike `inpaintV3`/`editImagesV2`, its completed shape has not been
3630
- * exercised against a live account (request/response fields here come from
3631
- * the live OpenAPI document, not an observed call — `pollAnimateRevision`
3632
- * in pixellab.ts checks several plausible field names for the frame list
3633
- * defensively, the same as `pollRevision` already does for image edits).
3653
+ * like `inpaintV3`/`editImagesV2`, it has run live (November 2026, a
3654
+ * 64x64 call of 4 frames billed 1 and returned 5 frames); `pollAnimateRevision`
3655
+ * in pixellab.ts still checks several plausible field names for the frame
3656
+ * list defensively, the same as `pollRevision` does for image edits.
3634
3657
  */
3635
3658
  async animateWithTextV3(args) {
3636
3659
  const body = { first_frame: args.firstFrame, action: args.action };
@@ -3714,8 +3737,8 @@ var PixelLabClient = class {
3714
3737
  * `runEstimateSkeleton` in `src/cli/commands`) so the only PixelLab
3715
3738
  * endpoint composed into `animate-with-skeleton-v3`'s submission is that
3716
3739
  * one endpoint itself, not two unverified calls chained together.
3717
- * Synchronous per this endpoint's own framing; unverified against a live
3718
- * account (see `EstimateSkeletonResponseSchema`'s own caveat).
3740
+ * Synchronous, and it has run live (October 2026; see
3741
+ * `EstimateSkeletonResponseSchema`).
3719
3742
  */
3720
3743
  async estimateSkeleton(args) {
3721
3744
  const body = { image: { type: "base64", base64: args.image.base64, format: args.image.format } };
@@ -5627,12 +5650,15 @@ var PixelLabProvider = class _PixelLabProvider {
5627
5650
  const width = spec.revision.sourceWidth ?? spec.width;
5628
5651
  const height = spec.revision.sourceHeight ?? spec.height;
5629
5652
  const side = spec.revision.mode === "edit-animation" ? Math.ceil(Math.sqrt(Math.max(1, spec.revision.sourceMembers?.length ?? 1))) : 1;
5630
- return { unit: "generations", amount: generationCost(width * side, height * side, "1dir"), candidates: 1 };
5653
+ return { unit: "generations", amount: proTierCost(width * side, height * side), candidates: 1 };
5631
5654
  }
5632
5655
  if (spec.revision?.mode === "animate" || spec.revision?.mode === "animate-pixminimax") {
5633
5656
  const width = spec.revision.sourceWidth ?? spec.width;
5634
5657
  const height = spec.revision.sourceHeight ?? spec.height;
5635
5658
  const frames = spec.revision.frames ?? 8;
5659
+ if (spec.revision.mode === "animate-pixminimax") {
5660
+ return { unit: "generations", amount: pixMiniMaxCost(width, height, frames, spec.revision.enhancePrompt), candidates: 1 };
5661
+ }
5636
5662
  const base = Math.max(1, Math.ceil(width * height * frames / 65536));
5637
5663
  return { unit: "generations", amount: spec.revision.enhancePrompt ? base + 0.05 : base, candidates: 1 };
5638
5664
  }
@@ -5663,7 +5689,7 @@ var PixelLabProvider = class _PixelLabProvider {
5663
5689
  return {
5664
5690
  unit: "generations",
5665
5691
  amount: generationCost(spec.width, spec.height, spec.generator),
5666
- candidates: spec.generator === "1dir" || spec.generator === "imagePro" ? candidateCount(spec.size) : 1
5692
+ candidates: spec.generator === "1dir" || spec.generator === "imagePro" ? candidateCount(spec.size) : spec.generator === "uiElement" ? uiElementCandidateCount(spec.size) : 1
5667
5693
  };
5668
5694
  }
5669
5695
  validate(spec, styleImages) {
@@ -7513,15 +7539,15 @@ var PixelLabProvider = class _PixelLabProvider {
7513
7539
  * `pollRevision` above, but completing with an ORDERED FRAME LIST instead
7514
7540
  * of a single image — the same `review-set` shape `pollCharacterAnimation`
7515
7541
  * returns, minus any character/object resource to look the result up on
7516
- * (there is none; this operates on a loose image). Unlike every other
7517
- * PixelLab call this adapter makes, the completed shape for
7518
- * `/animate-with-text-v3`/`/animate-pixminimax` has never been exercised
7519
- * against a live account — the checks below are an informed guess (hosted
7520
- * URLs under a plausible key name, the same `storage_urls.frames` shape
7521
- * character animations use, or inline base64 per frame, decoded to a local
7522
- * cache file the same way `pollRevision`'s single-image case already is)
7523
- * rather than an observed shape, and fail loudly, naming the keys actually
7524
- * received, for whatever the real shape turns out to be.
7542
+ * (there is none; this operates on a loose image). Both
7543
+ * `/animate-with-text-v3` and `/animate-pixminimax` have run live
7544
+ * (November 2026) and the completed jobs were read correctly. The checks
7545
+ * below stay defensive (hosted URLs under a plausible key name, the same
7546
+ * `storage_urls.frames` shape character animations use, or inline base64
7547
+ * per frame, decoded to a local cache file the same way `pollRevision`'s
7548
+ * single-image case is) and fail loudly, naming the keys actually
7549
+ * received, if a shape ever differs. PixMiniMax includes the input frame,
7550
+ * so a set holds the requested count plus one.
7525
7551
  */
7526
7552
  async pollAnimateRevision(jobId, context) {
7527
7553
  const job = await this.client.getBackgroundJob(jobId);
@@ -7662,7 +7688,7 @@ var PixelLabProvider = class _PixelLabProvider {
7662
7688
  }
7663
7689
  return {
7664
7690
  status: "failed",
7665
- error: `Invalid PixelLab response for imagePro job ${jobId}: completed with no recognized images array (got: ${Object.keys(done).join(", ") || "no keys"}); this endpoint's completed shape has not been exercised live yet -- update pollImagePro in src/providers/pixellab.ts with the real shape`
7691
+ error: `Invalid PixelLab response for imagePro job ${jobId}: completed with no recognized images array (got: ${Object.keys(done).join(", ") || "no keys"}); update pollImagePro in src/providers/pixellab.ts with the real shape`
7666
7692
  };
7667
7693
  }
7668
7694
  /**
@@ -21620,6 +21646,7 @@ async function workspaceStatus(ws, dir) {
21620
21646
  parseVfxStep,
21621
21647
  parseWorkspace,
21622
21648
  pickHistory,
21649
+ pixMiniMaxCost,
21623
21650
  pixelateFile,
21624
21651
  pngSize,
21625
21652
  poll,
@@ -21711,6 +21738,7 @@ async function workspaceStatus(ws, dir) {
21711
21738
  tilesCost,
21712
21739
  toPortablePath,
21713
21740
  totalSpend,
21741
+ uiElementCandidateCount,
21714
21742
  unzoomFile,
21715
21743
  upsert,
21716
21744
  validateCostEstimate,