@byte_fluffy/nexra-sdk 0.1.0-alpha.40 → 0.1.0-alpha.42

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/README.md CHANGED
@@ -29,7 +29,7 @@ const result = await nexra.run(spec!.id, input, { quoteToken: quote.quoteToken }
29
29
 
30
30
  Media apps send the versioned Nexra category contract: ordered `content` parts plus
31
31
  the common parameters for `image.generate`, `video.generate`, `audio.generate` or
32
- `image.upscale`. The server resolves the selected model component and explicitly
32
+ `image.upscale` or `video.upscale`. The server resolves the selected model component and explicitly
33
33
  adapts that input to the channel Provider. The SDK does not expose or emulate
34
34
  Provider-native endpoints. Protocol constants, schemas and types are also
35
35
  available from `@byte_fluffy/nexra-sdk/media`.
@@ -37,6 +37,57 @@ available from `@byte_fluffy/nexra-sdk/media`.
37
37
  The default API base URL is `https://api.nexra-ai.com/v1`. When overriding
38
38
  `baseUrl`, include the `/v1` API prefix.
39
39
 
40
+ ## Image and video upscale
41
+
42
+ `0.1.0-alpha.42` adds `bytedance/image-enhancement` and
43
+ `bytedance/video-super-resolution`. Both use the Task API and the existing
44
+ asset delivery lifecycle. Read the stored result from `result.assets`; wait for
45
+ delivery to finish before treating an output URL as permanent.
46
+
47
+ ```ts
48
+ const image = await nexra.run("bytedance/image-enhancement", {
49
+ content: [{ type: "image", role: "source", source: "https://example.com/input.png" }],
50
+ resolution: "2k",
51
+ });
52
+ const video = await nexra.run("bytedance/video-super-resolution", {
53
+ content: [{ type: "video", role: "source", source: "https://example.com/input.mp4" }],
54
+ source_duration: 5, // Upper bound in seconds; checked before enhancement.
55
+ resolution: "1080p",
56
+ });
57
+ ```
58
+
59
+ Image upscale supports `144p`, `240p`, `360p`, `480p`, `540p`, `720p`,
60
+ `1080p`, and `2k` (default). Video upscale supports `720p`, `1080p` (default),
61
+ `2k`, and `4k`.
62
+
63
+ The migrated task input also accepts the existing image fields
64
+ `image_url`, `resolution_boundary`, `enable_hdr`, and `enable_wb`, or the video
65
+ fields `video_url`/`vid`, `config`, and `target.res`. Use one input contract per
66
+ request. Credentials, VOD space, and playback signing belong to the server channel.
67
+
68
+ ## Dolphin Seedance
69
+
70
+ `0.1.0-alpha.41` adds the independently addressable models
71
+ `dolphin/seedance-2-0` and `dolphin/seedance-2-5`. Each model has its own
72
+ availability, channel routes and prices. Select its public ID when submitting a task.
73
+
74
+ ```ts
75
+ const nexra = createNexra({
76
+ apiKey: process.env.NEXRA_API_KEY,
77
+ baseUrl: "https://test-api.nexra-ai.com/v1",
78
+ });
79
+ const task = await nexra.tasks.create("dolphin/seedance-2-0", {
80
+ content: [{ type: "text", role: "prompt", text: "A paper boat on calm water" }],
81
+ duration: 4,
82
+ resolution: "480p",
83
+ generate_audio: false,
84
+ });
85
+ const result = await nexra.tasks.wait(task.id);
86
+ ```
87
+
88
+ Seedance 2.0 supports 4–15 seconds and Seedance 2.5 supports 4–30 seconds.
89
+ The existing ByteDance model IDs retain their own supplies and prices.
90
+
40
91
  ## Banana 2.1
41
92
 
42
93
  Use `google/gemini-nano-banana-2.1` for Banana 2.1. The model supports
package/dist/catalog.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  listModelSpecs,
10
10
  projectMediaGeometry,
11
11
  resolveNexraLanguageReasoning
12
- } from "./chunk-Q4A3HJBX.js";
13
- import "./chunk-SIBYK5IX.js";
12
+ } from "./chunk-QPUI7EN7.js";
13
+ import "./chunk-ESPUF2D4.js";
14
14
  export {
15
15
  CatalogClient,
16
16
  applyMediaGeometry,
@@ -417,7 +417,8 @@ var NEXRA_PUBLISHED_MEDIA_OPERATIONS = [
417
417
  "image.generate",
418
418
  "video.generate",
419
419
  "audio.generate",
420
- "image.upscale"
420
+ "image.upscale",
421
+ "video.upscale"
421
422
  ];
422
423
  var NEXRA_MEDIA_FEATURES = [
423
424
  "text-to-image",
@@ -476,7 +477,7 @@ var NEXRA_MEDIA_OPERATION_DEFINITIONS = Object.freeze([
476
477
  },
477
478
  {
478
479
  operation: "video.upscale",
479
- status: "hold",
480
+ status: "active",
480
481
  outputKind: "video",
481
482
  features: ["scale-factor", "target-resolution"],
482
483
  parameterKeys: ["scale", "resolution", "output_format", "preserve_details"]
@@ -606,6 +607,17 @@ var NEXRA_MEDIA_INPUT_SCHEMAS = Object.freeze({
606
607
  preserve_details: { type: "boolean", "x-ui": { order: 13, control: "switch" } }
607
608
  },
608
609
  { minItems: 1, maxItems: 1 }
610
+ ),
611
+ "video.upscale": inputSchema(
612
+ [mediaPartSchema("video", ["source"])],
613
+ {
614
+ source_duration: { type: "number", exclusiveMinimum: 0, "x-ui": { order: 9, control: "number" } },
615
+ scale: { type: "number", exclusiveMinimum: 1, "x-ui": { order: 10, control: "number" } },
616
+ resolution: { type: "string", minLength: 1, "x-ui": { order: 11 } },
617
+ output_format: { type: "string", minLength: 1, "x-ui": { order: 12 } },
618
+ preserve_details: { type: "boolean", "x-ui": { order: 13, control: "switch" } }
619
+ },
620
+ { minItems: 1, maxItems: 1 }
609
621
  )
610
622
  });
611
623
  function nexraMediaInputSchema(operation) {