@picsart/ai-sdk 5.30.0 → 5.31.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.
Files changed (3) hide show
  1. package/index.d.ts +11 -4
  2. package/index.js +2 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2482,6 +2482,11 @@ interface ClientConfig {
2482
2482
  apiUrl: string;
2483
2483
  /** Enable Drive integration — auto-save generations to a Drive folder. */
2484
2484
  drive?: DriveConfig;
2485
+ /**
2486
+ * Input-transformation defaults applied to every generation. A per-call
2487
+ * `options.inputsTransformation` overrides this field by field.
2488
+ */
2489
+ inputsTransformation?: PayloadInputsTransformationOptions;
2485
2490
  /**
2486
2491
  * Voice/avatar catalog behavior. `{ preload: true }` loads the first page
2487
2492
  * of every catalog-bound param in the background at client creation.
@@ -2527,8 +2532,9 @@ interface PayloadInputsTransformationOptions {
2527
2532
  /**
2528
2533
  * Downscale input images that exceed the vendor's download size cap
2529
2534
  * (e.g. ByteDance's 30 MiB) and retry the generation once, instead of
2530
- * failing with an input-limit error. Defaults to true; workers without
2531
- * input transformation ignore it.
2535
+ * failing with an input-limit error. Opt-in — defaults to false, so an
2536
+ * oversized input fails fast unless you set this; workers without input
2537
+ * transformation ignore it.
2532
2538
  */
2533
2539
  downscaleOversizedImages?: boolean;
2534
2540
  }
@@ -2550,8 +2556,9 @@ interface GenerateOptions {
2550
2556
  folder?: DriveFolder;
2551
2557
  /** Save result to Picsart Drive via backend. Injected into the workflow payload. */
2552
2558
  drive?: PayloadDriveOptions;
2553
- /** Input-transformation settings. Injected into the workflow payload; when
2554
- * omitted, oversized-image downscaling defaults to enabled. */
2559
+ /** Input-transformation settings for this call overrides the client-level
2560
+ * `inputsTransformation`. When neither is set, oversized-image downscaling
2561
+ * stays off (opt-in). */
2555
2562
  inputsTransformation?: PayloadInputsTransformationOptions;
2556
2563
  /**
2557
2564
  * App identity stamped onto the saved generation (appId/appType).
package/index.js CHANGED
@@ -10712,6 +10712,7 @@ function createClient(config) {
10712
10712
  const supportsSubmit = typeof transport.submit === "function";
10713
10713
  const apis = createApis(isConfig ? config : null);
10714
10714
  const catalogs = createCatalogs(transport, isConfig ? config.catalogs : void 0);
10715
+ const inputsTransformationConfig = isConfig ? config.inputsTransformation : void 0;
10715
10716
  const driveConfig = isConfig ? config.drive : void 0;
10716
10717
  const driveClient = isConfig && driveConfig ? createDriveClient(resolveFetch(config), config.apiUrl, driveConfig.folder) : null;
10717
10718
  async function executeModel(model, workflow, payload, options) {
@@ -10754,7 +10755,7 @@ function createClient(config) {
10754
10755
  options: {
10755
10756
  ...existing,
10756
10757
  inputs_transformation: {
10757
- downscale_oversized_images: inputsTransformation?.downscaleOversizedImages ?? true
10758
+ downscale_oversized_images: inputsTransformation?.downscaleOversizedImages ?? inputsTransformationConfig?.downscaleOversizedImages ?? false
10758
10759
  },
10759
10760
  ...drive ? { drive } : {}
10760
10761
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.30.0",
3
+ "version": "5.31.0",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",