pixelkiln 0.52.0 → 0.53.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
@@ -10755,7 +10755,19 @@ var NewAssetSchema = z5.object({
10755
10755
  size: z5.number().int().optional(),
10756
10756
  tags: z5.array(z5.string()).optional(),
10757
10757
  /** Restrict to these styles; empty or omitted means every style. */
10758
- styles: z5.array(z5.string().min(1)).optional()
10758
+ styles: z5.array(z5.string().min(1)).optional(),
10759
+ /**
10760
+ * A controlled regeneration of another asset in the same manifest,
10761
+ * instead of a fresh generation. `inpaint` needs a mask upload the
10762
+ * gallery does not offer yet, so only `image-to-image` can be created
10763
+ * here; hand-edit the manifest for the other modes.
10764
+ */
10765
+ revision: z5.object({
10766
+ mode: z5.literal("image-to-image"),
10767
+ /** Asset id of the parent this revises; must already exist. */
10768
+ from: z5.string().min(1),
10769
+ strength: z5.number().min(0).max(1).optional()
10770
+ }).strict().optional()
10759
10771
  }).strict();
10760
10772
  var CANDIDATE_OPTION = {
10761
10773
  retrodiffusion: "numImages",
@@ -10921,6 +10933,9 @@ function applyEdit(raw, edit) {
10921
10933
  }
10922
10934
  asset2.styles = styles;
10923
10935
  }
10936
+ if (edit.asset.revision && !Object.hasOwn(raw.assets, edit.asset.revision.from)) {
10937
+ throw new ManifestEditError(`revision parent "${edit.asset.revision.from}" is not declared by the manifest`);
10938
+ }
10924
10939
  raw.assets[edit.assetId] = asset2;
10925
10940
  return;
10926
10941
  }