pixelkiln 0.103.0 → 0.104.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/dist/cli.js CHANGED
@@ -1428,6 +1428,9 @@ function specHash(spec, styleImageHashes, providerOptionIdentity = spec.provider
1428
1428
  terrainEnhance: spec.terrainEnhance,
1429
1429
  // Absent unless a pixflux style sets it, so every older hash stands.
1430
1430
  textGuidanceScale: spec.textGuidanceScale,
1431
+ subjectDirection: spec.subjectDirection,
1432
+ isometric: spec.isometric,
1433
+ backgroundRemoval: spec.backgroundRemoval,
1431
1434
  terrainPlatformThickness: spec.terrainPlatformThickness,
1432
1435
  // Reference images enter as their bytes' hashes, never their paths.
1433
1436
  // The starting image by its bytes, with its strength only when set.
@@ -2704,8 +2707,18 @@ var StyleObjectSchema = z.object({
2704
2707
  * it. Part of a `pixflux` asset's identity only when set.
2705
2708
  */
2706
2709
  textGuidanceScale: z.number().min(1).max(20).optional(),
2707
- /** `character` only. Draw `standard` bases and every loop in isometric view. */
2710
+ /**
2711
+ * `character` and `pixflux`. Draw `standard` character bases and every
2712
+ * loop, or a `pixflux` image, in isometric view. PixelLab calls it weakly
2713
+ * guiding on `pixflux`. Part of a `pixflux` asset's identity only when true.
2714
+ */
2708
2715
  isometric: z.boolean().optional(),
2716
+ /**
2717
+ * `pixflux` only, with `noBackground`: how the background is cut away.
2718
+ * `simple` is PixelLab's default and faster; `complex` handles fine or
2719
+ * busy edges better. Part of the asset's identity only when set.
2720
+ */
2721
+ backgroundRemoval: z.enum(["simple", "complex"]).optional(),
2709
2722
  /** `character` only, `v3` bases: let PixelLab expand the prompt into a fuller one before drawing. */
2710
2723
  enhancePrompt: z.boolean().optional(),
2711
2724
  /**
@@ -2779,6 +2792,20 @@ var StyleSchema = StyleObjectSchema.refine((s) => !(s.tileFeature && s.styleImag
2779
2792
  message: "tileFeature and styleImages cannot be combined; a connectable set derives its own tile geometry, so remove one or the other",
2780
2793
  path: ["tileFeature"]
2781
2794
  }).superRefine((style, ctx) => {
2795
+ if (style.backgroundRemoval !== void 0 && style.generator !== "pixflux") {
2796
+ ctx.addIssue({
2797
+ code: z.ZodIssueCode.custom,
2798
+ message: `backgroundRemoval is taken by pixflux styles; this one uses "${style.generator}"`,
2799
+ path: ["backgroundRemoval"]
2800
+ });
2801
+ }
2802
+ if (style.backgroundRemoval !== void 0 && !style.noBackground) {
2803
+ ctx.addIssue({
2804
+ code: z.ZodIssueCode.custom,
2805
+ message: "backgroundRemoval chooses how the background is cut away; this style keeps its background (noBackground is false)",
2806
+ path: ["backgroundRemoval"]
2807
+ });
2808
+ }
2782
2809
  if (style.quality && (style.generator === "tiles" || style.generator === "terrain" || style.generator === "animation" || style.generator === "vfx")) {
2783
2810
  ctx.addIssue({
2784
2811
  code: z.ZodIssueCode.custom,
@@ -3012,6 +3039,12 @@ var AssetSchema = z.object({
3012
3039
  * instead of starting from nothing.
3013
3040
  */
3014
3041
  initImage: z.string().min(1).optional(),
3042
+ /**
3043
+ * `pixflux` styles: the way the subject faces. PixelLab calls it weakly
3044
+ * guiding, so treat it as a nudge. Part of the asset's identity only
3045
+ * when set.
3046
+ */
3047
+ direction: CharacterDirectionSchema.optional(),
3015
3048
  /**
3016
3049
  * With `initImage`: how strongly the starting image holds, 1 to 999.
3017
3050
  * PixelLab's default is 300.
@@ -8160,6 +8193,11 @@ var PixelLabClient = class {
8160
8193
  if (args.detail) body.detail = args.detail;
8161
8194
  if (args.view) body.view = args.view;
8162
8195
  if (args.textGuidanceScale != null) body.text_guidance_scale = args.textGuidanceScale;
8196
+ if (args.direction) body.direction = args.direction;
8197
+ if (args.isometric) body.isometric = true;
8198
+ if (args.backgroundRemoval) {
8199
+ body.background_removal_task = args.backgroundRemoval === "complex" ? "remove_complex_background" : "remove_simple_background";
8200
+ }
8163
8201
  if (args.seed != null) body.seed = args.seed;
8164
8202
  const res = validateResponse(
8165
8203
  PixfluxResponseSchema,
@@ -11839,6 +11877,9 @@ var PixelLabProvider = class _PixelLabProvider {
11839
11877
  // Only a view the style states: the resolved default would steer every scene and banner top-down.
11840
11878
  view: spec.styleView,
11841
11879
  textGuidanceScale: spec.textGuidanceScale,
11880
+ direction: spec.subjectDirection,
11881
+ isometric: spec.isometric,
11882
+ backgroundRemoval: spec.backgroundRemoval,
11842
11883
  seed: spec.seed,
11843
11884
  ...await initImageArgs(spec)
11844
11885
  });
@@ -14976,6 +15017,8 @@ async function resolveSpecs(loaded, filter) {
14976
15017
  view: style.view ?? (generator === "1dir" ? "top-down" : generator === "character" ? "low top-down" : "high top-down"),
14977
15018
  ...style.view !== void 0 ? { styleView: style.view } : {},
14978
15019
  ...generator === "pixflux" && style.textGuidanceScale !== void 0 ? { textGuidanceScale: style.textGuidanceScale } : {},
15020
+ ...generator === "pixflux" && style.isometric ? { isometric: true } : {},
15021
+ ...generator === "pixflux" && style.backgroundRemoval ? { backgroundRemoval: style.backgroundRemoval } : {},
14979
15022
  styleImagePaths: style.styleImages.map((s) => s.path),
14980
15023
  outline: style.outline,
14981
15024
  shading: style.shading,
@@ -15478,6 +15521,12 @@ async function resolveSpecs(loaded, filter) {
15478
15521
  }
15479
15522
  resolved.terrainConnect = links;
15480
15523
  }
15524
+ if (asset.direction) {
15525
+ if (resolved.generator !== "pixflux") {
15526
+ throw new Error(`assets.${assetId}.direction: a facing is taken by pixflux styles; style "${styleId}" uses "${resolved.generator}"`);
15527
+ }
15528
+ resolved.subjectDirection = asset.direction;
15529
+ }
15481
15530
  if (asset.initImage) {
15482
15531
  if (!["pixflux", "map", "isometricTile"].includes(resolved.generator)) {
15483
15532
  throw new Error(