pixelkiln 0.138.0 → 0.138.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/dist/cli.js CHANGED
@@ -15284,24 +15284,7 @@ var RetroDiffusionProvider = class _RetroDiffusionProvider {
15284
15284
  const options = retroOptions(spec);
15285
15285
  const style = resolvedPromptStyle(spec, options);
15286
15286
  const count = options.numImages ?? 1;
15287
- const pixels = spec.width * spec.height;
15288
- let each;
15289
- if (style.startsWith("rd_advanced_animation__")) {
15290
- each = /__(?:custom_action|subtle_motion)$/.test(style) ? 0.25 : 0.14;
15291
- } else if (style.startsWith("rd_animation__")) {
15292
- each = /__(?:any_animation|8_dir_rotation)$/.test(style) ? 0.25 : 0.07;
15293
- } else if (/^rd_tile__tileset(?:_advanced)?$/.test(style)) {
15294
- each = 0.1;
15295
- } else if (style.startsWith("rd_pro__")) {
15296
- each = 0.18;
15297
- } else if (style.startsWith("rd_fast__")) {
15298
- each = Math.max(0.015, (pixels + 1e5) / 6e6);
15299
- } else if (isLowResolutionStyle(style)) {
15300
- each = Math.max(0.02, (pixels + 13700) / 6e5);
15301
- } else {
15302
- each = Math.max(0.025, (pixels + 5e4) / 2e6);
15303
- }
15304
- return { unit: "usd", amount: roundUsdEstimate(each * count), candidates: count };
15287
+ return { unit: "usd", amount: roundUsdEstimate(retroUsdPerImage(style, spec) * count), candidates: count };
15305
15288
  }
15306
15289
  validate(spec, styleImages) {
15307
15290
  const options = retroOptions(spec);
@@ -15516,6 +15499,24 @@ function validateTile(style, spec, styleImages, count, options) {
15516
15499
  }
15517
15500
  }
15518
15501
  }
15502
+ function retroUsdPerImage(style, spec) {
15503
+ if (style.startsWith("rd_advanced_animation__")) {
15504
+ return /__(?:custom_action|subtle_motion)$/.test(style) ? 0.25 : 0.14;
15505
+ }
15506
+ if (style.startsWith("rd_animation__")) {
15507
+ return /__(?:any_animation|8_dir_rotation)$/.test(style) ? 0.25 : 0.07;
15508
+ }
15509
+ if (/^rd_tile__tileset(?:_advanced)?$/.test(style)) return 0.1;
15510
+ if (style.startsWith("rd_tile__")) return 0.06;
15511
+ if (style.startsWith("rd_pro__")) return 0.18;
15512
+ if (style.startsWith("rd_core__")) return 0.1;
15513
+ if (style.startsWith("rd_plus__") || style.startsWith("rd_mini__")) return 0.06;
15514
+ if (style.startsWith("rd_lite__")) return 0.05;
15515
+ if (style.startsWith("rd_fast__") || style.endsWith(":rd_flux") || style === "item_sheet") return 0.03;
15516
+ const pixels = spec.width * spec.height;
15517
+ const formula = isLowResolutionStyle(style) ? (pixels + 13700) / 6e5 : (pixels + 5e4) / 2e6;
15518
+ return Math.max(0.06, formula);
15519
+ }
15519
15520
  function isLowResolutionStyle(style) {
15520
15521
  return /(?:^|__)(?:mc_|low_res|classic|skill_icon|topdown_item)/.test(style);
15521
15522
  }