@byte_fluffy/nexra-sdk 0.1.0-alpha.41 → 0.1.0-alpha.43

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,34 @@ 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
+
40
68
  ## Dolphin Seedance
41
69
 
42
70
  `0.1.0-alpha.41` adds the independently addressable models
package/dist/catalog.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  listModelSpecs,
10
10
  projectMediaGeometry,
11
11
  resolveNexraLanguageReasoning
12
- } from "./chunk-BIAPYH3J.js";
13
- import "./chunk-QHQJD3EN.js";
12
+ } from "./chunk-TV6MEAZC.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) {
@@ -2,7 +2,7 @@ import {
2
2
  normalizePublicErrorInput,
3
3
  pickPublicErrorFields,
4
4
  sortRatioDisplayOrder
5
- } from "./chunk-QHQJD3EN.js";
5
+ } from "./chunk-ESPUF2D4.js";
6
6
 
7
7
  // src/catalog/generated/audio.generated.json
8
8
  var audio_generated_default = [
@@ -2799,6 +2799,143 @@ var audio_generated_default = [
2799
2799
 
2800
2800
  // src/catalog/generated/image.generated.json
2801
2801
  var image_generated_default = [
2802
+ {
2803
+ id: "bytedance/image-enhancement",
2804
+ contractVersion: 1,
2805
+ developer: "bytedance",
2806
+ displayName: "Volcengine Image Enhancement",
2807
+ summary: "Upscale an image with Volcengine CVProcess and save the output.",
2808
+ kind: "image",
2809
+ family: "Volcengine Upscale",
2810
+ aliases: [],
2811
+ capabilities: {
2812
+ inputModalities: [
2813
+ "image"
2814
+ ],
2815
+ outputModalities: [
2816
+ "image"
2817
+ ],
2818
+ inputModes: [],
2819
+ features: []
2820
+ },
2821
+ operations: [
2822
+ {
2823
+ operation: "image.upscale",
2824
+ inputModalities: [
2825
+ "image"
2826
+ ],
2827
+ outputModalities: [
2828
+ "image"
2829
+ ],
2830
+ inputSchema: {
2831
+ $schema: "https://json-schema.org/draft/2020-12/schema",
2832
+ type: "object",
2833
+ properties: {
2834
+ content: {
2835
+ type: "array",
2836
+ minItems: 1,
2837
+ maxItems: 1,
2838
+ items: {
2839
+ oneOf: [
2840
+ {
2841
+ type: "object",
2842
+ properties: {
2843
+ type: {
2844
+ const: "image"
2845
+ },
2846
+ source: {
2847
+ oneOf: [
2848
+ {
2849
+ type: "string",
2850
+ minLength: 1
2851
+ },
2852
+ {
2853
+ type: "object",
2854
+ properties: {
2855
+ assetId: {
2856
+ type: "string",
2857
+ minLength: 1
2858
+ }
2859
+ },
2860
+ required: [
2861
+ "assetId"
2862
+ ],
2863
+ additionalProperties: false
2864
+ }
2865
+ ]
2866
+ },
2867
+ role: {
2868
+ type: "string",
2869
+ enum: [
2870
+ "source"
2871
+ ]
2872
+ }
2873
+ },
2874
+ required: [
2875
+ "type",
2876
+ "source"
2877
+ ],
2878
+ additionalProperties: false
2879
+ }
2880
+ ]
2881
+ },
2882
+ "x-ui": {
2883
+ control: "content-parts",
2884
+ order: 0
2885
+ }
2886
+ },
2887
+ resolution: {
2888
+ type: "string",
2889
+ enum: [
2890
+ "144p",
2891
+ "240p",
2892
+ "360p",
2893
+ "480p",
2894
+ "540p",
2895
+ "720p",
2896
+ "1080p",
2897
+ "2k"
2898
+ ],
2899
+ default: "2k",
2900
+ "x-ui": {
2901
+ order: 11
2902
+ }
2903
+ },
2904
+ enable_hdr: {
2905
+ type: "boolean"
2906
+ },
2907
+ enable_wb: {
2908
+ type: "boolean"
2909
+ }
2910
+ },
2911
+ required: [
2912
+ "content"
2913
+ ],
2914
+ additionalProperties: false
2915
+ },
2916
+ outputSchema: {},
2917
+ metering: {
2918
+ schemaVersion: 1,
2919
+ kind: "non_token",
2920
+ metrics: [
2921
+ {
2922
+ metric: "requests",
2923
+ requirement: "required"
2924
+ },
2925
+ {
2926
+ metric: "input_images",
2927
+ requirement: "required"
2928
+ },
2929
+ {
2930
+ metric: "output_images",
2931
+ requirement: "required"
2932
+ }
2933
+ ]
2934
+ }
2935
+ }
2936
+ ],
2937
+ endpoints: []
2938
+ },
2802
2939
  {
2803
2940
  id: "google/gemini-nano-banana-2.1",
2804
2941
  contractVersion: 1,
@@ -32592,6 +32729,168 @@ var language_generated_default = [
32592
32729
 
32593
32730
  // src/catalog/generated/video.generated.json
32594
32731
  var video_generated_default = [
32732
+ {
32733
+ id: "bytedance/video-super-resolution",
32734
+ contractVersion: 1,
32735
+ developer: "bytedance",
32736
+ displayName: "Volcengine Video Super Resolution",
32737
+ summary: "Upscale a video through Volcengine VOD and save the output.",
32738
+ kind: "video",
32739
+ family: "Volcengine Upscale",
32740
+ aliases: [],
32741
+ capabilities: {
32742
+ inputModalities: [
32743
+ "video"
32744
+ ],
32745
+ outputModalities: [
32746
+ "video"
32747
+ ],
32748
+ inputModes: [],
32749
+ features: []
32750
+ },
32751
+ operations: [
32752
+ {
32753
+ operation: "video.upscale",
32754
+ inputModalities: [
32755
+ "video"
32756
+ ],
32757
+ outputModalities: [
32758
+ "video"
32759
+ ],
32760
+ inputSchema: {
32761
+ $schema: "https://json-schema.org/draft/2020-12/schema",
32762
+ type: "object",
32763
+ properties: {
32764
+ content: {
32765
+ type: "array",
32766
+ minItems: 1,
32767
+ maxItems: 1,
32768
+ items: {
32769
+ oneOf: [
32770
+ {
32771
+ type: "object",
32772
+ properties: {
32773
+ type: {
32774
+ const: "video"
32775
+ },
32776
+ source: {
32777
+ oneOf: [
32778
+ {
32779
+ type: "string",
32780
+ minLength: 1
32781
+ },
32782
+ {
32783
+ type: "object",
32784
+ properties: {
32785
+ assetId: {
32786
+ type: "string",
32787
+ minLength: 1
32788
+ }
32789
+ },
32790
+ required: [
32791
+ "assetId"
32792
+ ],
32793
+ additionalProperties: false
32794
+ }
32795
+ ]
32796
+ },
32797
+ role: {
32798
+ type: "string",
32799
+ enum: [
32800
+ "source"
32801
+ ]
32802
+ }
32803
+ },
32804
+ required: [
32805
+ "type",
32806
+ "source"
32807
+ ],
32808
+ additionalProperties: false
32809
+ }
32810
+ ]
32811
+ },
32812
+ "x-ui": {
32813
+ control: "content-parts",
32814
+ order: 0
32815
+ }
32816
+ },
32817
+ vid: {
32818
+ type: "string",
32819
+ minLength: 1
32820
+ },
32821
+ config: {
32822
+ type: "string",
32823
+ enum: [
32824
+ "common",
32825
+ "ugc",
32826
+ "short_series",
32827
+ "aigc",
32828
+ "old_film"
32829
+ ],
32830
+ default: "common"
32831
+ },
32832
+ source_duration: {
32833
+ type: "number",
32834
+ exclusiveMinimum: 0,
32835
+ description: "Upper bound on source duration in seconds, verified before enhancement."
32836
+ },
32837
+ resolution: {
32838
+ type: "string",
32839
+ enum: [
32840
+ "720p",
32841
+ "1080p",
32842
+ "2k",
32843
+ "4k"
32844
+ ],
32845
+ default: "1080p"
32846
+ }
32847
+ },
32848
+ required: [
32849
+ "source_duration"
32850
+ ],
32851
+ additionalProperties: false,
32852
+ oneOf: [
32853
+ {
32854
+ properties: {
32855
+ content: {}
32856
+ },
32857
+ required: [
32858
+ "content"
32859
+ ]
32860
+ },
32861
+ {
32862
+ properties: {
32863
+ vid: {}
32864
+ },
32865
+ required: [
32866
+ "vid"
32867
+ ]
32868
+ }
32869
+ ]
32870
+ },
32871
+ outputSchema: {},
32872
+ metering: {
32873
+ schemaVersion: 1,
32874
+ kind: "non_token",
32875
+ metrics: [
32876
+ {
32877
+ metric: "requests",
32878
+ requirement: "required"
32879
+ },
32880
+ {
32881
+ metric: "input_video_seconds",
32882
+ requirement: "required"
32883
+ },
32884
+ {
32885
+ metric: "output_video_seconds",
32886
+ requirement: "required"
32887
+ }
32888
+ ]
32889
+ }
32890
+ }
32891
+ ],
32892
+ endpoints: []
32893
+ },
32595
32894
  {
32596
32895
  id: "dolphin/seedance-2-0",
32597
32896
  contractVersion: 1,
@@ -54747,7 +55046,7 @@ var NexraWaitTimeoutError = class extends Error {
54747
55046
  };
54748
55047
 
54749
55048
  // src/generated/version.generated.ts
54750
- var SDK_VERSION = "0.1.0-alpha.41";
55049
+ var SDK_VERSION = "0.1.0-alpha.43";
54751
55050
 
54752
55051
  // src/transport.ts
54753
55052
  var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
package/dist/index.js CHANGED
@@ -20,14 +20,14 @@ import {
20
20
  projectMediaGeometry,
21
21
  queryString,
22
22
  sleep
23
- } from "./chunk-BIAPYH3J.js";
23
+ } from "./chunk-TV6MEAZC.js";
24
24
  import {
25
25
  MEDIA_KINDS,
26
26
  TASK_STATUSES,
27
27
  createTaskRequest,
28
28
  extractUpstreamErrorMessage,
29
29
  isTerminalTaskStatus
30
- } from "./chunk-QHQJD3EN.js";
30
+ } from "./chunk-ESPUF2D4.js";
31
31
 
32
32
  // src/assets.ts
33
33
  var AssetsClient = class {
package/dist/language.js CHANGED
@@ -6,12 +6,12 @@ import {
6
6
  jsonBody,
7
7
  parseServerSentEvents,
8
8
  resolveNexraLanguageReasoning
9
- } from "./chunk-BIAPYH3J.js";
9
+ } from "./chunk-TV6MEAZC.js";
10
10
  import {
11
11
  isPublicErrorCode,
12
12
  publicErrorMessage,
13
13
  resolvePublicErrorLocale
14
- } from "./chunk-QHQJD3EN.js";
14
+ } from "./chunk-ESPUF2D4.js";
15
15
 
16
16
  // src/language/index.ts
17
17
  import { createAnthropic } from "@ai-sdk/anthropic";
package/dist/media.d.ts CHANGED
@@ -7,7 +7,7 @@ declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.gen
7
7
  type NexraGenerationOperation = (typeof NEXRA_GENERATION_OPERATIONS)[number];
8
8
  declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
9
9
  type NexraMediaOperation = (typeof NEXRA_MEDIA_OPERATIONS)[number];
10
- declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale"];
10
+ declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
11
11
  type NexraPublishedMediaOperation = (typeof NEXRA_PUBLISHED_MEDIA_OPERATIONS)[number];
12
12
  declare const NEXRA_MEDIA_FEATURES: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control", "text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference", "tts", "music", "sfx", "voice-reference", "voice-design", "scale-factor", "target-resolution"];
13
13
  type NexraMediaFeature = (typeof NEXRA_MEDIA_FEATURES)[number];
@@ -99,18 +99,27 @@ type NexraAudioGenerateInput = Readonly<{
99
99
  }>;
100
100
  type NexraImageUpscaleInput = Readonly<{
101
101
  content: readonly [NexraImageContentPart];
102
+ enable_hdr?: boolean;
103
+ enable_wb?: boolean;
102
104
  scale?: number;
103
105
  resolution?: string;
104
106
  output_format?: string;
105
107
  preserve_details?: boolean;
106
108
  }>;
107
109
  type NexraVideoUpscaleInput = Readonly<{
108
- content: readonly [NexraVideoContentPart];
110
+ source_duration: number;
111
+ config?: string;
109
112
  scale?: number;
110
113
  resolution?: string;
111
114
  output_format?: string;
112
115
  preserve_details?: boolean;
113
- }>;
116
+ }> & (Readonly<{
117
+ content: readonly [NexraVideoContentPart];
118
+ vid?: never;
119
+ }> | Readonly<{
120
+ vid: string;
121
+ content?: never;
122
+ }>);
114
123
  type NexraMediaInputByOperation = Readonly<{
115
124
  "image.generate": NexraImageGenerateInput;
116
125
  "video.generate": NexraVideoGenerateInput;
@@ -198,7 +207,7 @@ declare const NEXRA_MEDIA_OPERATION_DEFINITIONS: readonly [{
198
207
  readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
199
208
  }, {
200
209
  readonly operation: "video.upscale";
201
- readonly status: "hold";
210
+ readonly status: "active";
202
211
  readonly outputKind: "video";
203
212
  readonly features: readonly ["scale-factor", "target-resolution"];
204
213
  readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
package/dist/media.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  nexraMediaInputSchema,
11
11
  nexraMediaInputSchemaForMode,
12
12
  nexraMediaOperationForMode
13
- } from "./chunk-QHQJD3EN.js";
13
+ } from "./chunk-ESPUF2D4.js";
14
14
  export {
15
15
  NEXRA_GENERATION_OPERATIONS,
16
16
  NEXRA_MEDIA_API_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byte_fluffy/nexra-sdk",
3
- "version": "0.1.0-alpha.41",
3
+ "version": "0.1.0-alpha.43",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,