@runapi.ai/seedance 0.2.4 → 0.2.6

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
@@ -1,6 +1,6 @@
1
1
  # Seedance API JavaScript SDK for RunAPI
2
2
 
3
- The seedance api JavaScript SDK is the language-specific package for Seedance on RunAPI. Use this seedance api package for text-to-video, image-to-video, video-to-video, animation, and edit flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
3
+ The seedance api JavaScript SDK is the language-specific package for Seedance on RunAPI. Use this seedance api package for text-to-video, image-to-video, video editing, and animation flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
4
4
 
5
5
  This seedance api README is the JavaScript package guide inside the public `seedance-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/seedance; for API reference, use https://runapi.ai/docs#seedance; for SDK docs, use https://runapi.ai/docs#sdk-seedance.
6
6
 
package/dist/index.d.mts CHANGED
@@ -12,7 +12,7 @@ type Resolution15Pro = '480p' | '720p' | '1080p';
12
12
  type Resolution2 = '480p' | '720p' | '1080p';
13
13
  type ResolutionV1 = '480p' | '720p' | '1080p';
14
14
  type ResolutionV1ProFast = '720p' | '1080p';
15
- type DurationV1 = '5' | '10';
15
+ type DurationV1 = 5 | 10;
16
16
  interface GenerationCommonParams {
17
17
  /** Text description of desired video content */
18
18
  prompt: string;
@@ -20,8 +20,8 @@ interface GenerationCommonParams {
20
20
  callback_url?: string;
21
21
  /** Generate audio track for the video */
22
22
  generate_audio?: boolean;
23
- /** Enable NSFW content check */
24
- nsfw_checker?: boolean;
23
+ /** Content safety check toggle */
24
+ enable_safety_checker?: boolean;
25
25
  }
26
26
  /**
27
27
  * seedance-1.5-pro generation parameters.
@@ -31,11 +31,11 @@ interface Generation15ProParams extends GenerationCommonParams {
31
31
  model: 'seedance-1.5-pro';
32
32
  /** Required for seedance-1.5-pro */
33
33
  aspect_ratio: AspectRatio15Pro;
34
- resolution?: Resolution15Pro;
34
+ output_resolution?: Resolution15Pro;
35
35
  /** Fixed values: 4, 8, or 12 seconds */
36
- duration?: 4 | 8 | 12;
37
- /** Up to 2 image URLs for image-to-video */
38
- input_urls?: string[];
36
+ duration_seconds: 4 | 8 | 12;
37
+ /** Up to 2 source image URLs for image-to-video */
38
+ source_image_urls?: string[];
39
39
  /** Lock camera movement */
40
40
  lock_camera?: boolean;
41
41
  }
@@ -43,9 +43,9 @@ interface Generation15ProParams extends GenerationCommonParams {
43
43
  interface Generation2BaseParams extends GenerationCommonParams {
44
44
  model: SeedanceModel2;
45
45
  aspect_ratio?: AspectRatio2;
46
- resolution?: Resolution2;
46
+ output_resolution?: Resolution2;
47
47
  /** Integer 4-15 */
48
- duration?: number;
48
+ duration_seconds?: number;
49
49
  /** Enable web search for prompt enrichment. */
50
50
  web_search?: boolean;
51
51
  }
@@ -62,9 +62,9 @@ interface Generation2TextParams extends Generation2BaseParams {
62
62
  */
63
63
  interface Generation2FrameParams extends Generation2BaseParams {
64
64
  /** First frame image URL (required for frame mode) */
65
- first_frame_url: string;
65
+ first_frame_image_url: string;
66
66
  /** Last frame image URL */
67
- last_frame_url?: string;
67
+ last_frame_image_url?: string;
68
68
  }
69
69
  /**
70
70
  * seedance-2.0/2-fast reference mode.
@@ -81,50 +81,48 @@ interface Generation2ReferenceParams extends Generation2BaseParams {
81
81
  }
82
82
  /** Common fields for v1-lite and v1-pro (not v1-pro-fast). */
83
83
  interface GenerationV1SharedParams extends GenerationCommonParams {
84
- /** `'5'` or `'10'`. Required. */
85
- duration: DurationV1;
86
- resolution?: ResolutionV1;
84
+ /** `5` or `10`. Required. */
85
+ duration_seconds: DurationV1;
86
+ output_resolution?: ResolutionV1;
87
87
  /** Lock camera movement */
88
88
  lock_camera?: boolean;
89
89
  /** Random seed; `-1` for random. Integer in [-1, 2147483647]. */
90
90
  seed?: number;
91
- /** Safety checker toggle */
92
- enable_safety_checker?: boolean;
93
91
  }
94
92
  /**
95
93
  * seedance-v1-lite text-to-video or image-to-video. Mode is auto-detected by
96
- * `input_urls` presence. `last_frame_url` is only valid in image-to-video mode.
94
+ * `first_frame_image_url` presence. `last_frame_image_url` is only valid in image-to-video mode.
97
95
  */
98
96
  interface GenerationV1LiteParams extends GenerationV1SharedParams {
99
97
  model: 'seedance-v1-lite';
100
- /** Required in text-to-video mode. Omit when `input_urls` is set. */
98
+ /** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
101
99
  aspect_ratio?: AspectRatioV1Lite;
102
- /** Up to 1 image URL. Triggers image-to-video mode when set. */
103
- input_urls?: string[];
100
+ /** First frame image URL. Triggers image-to-video mode when set. */
101
+ first_frame_image_url?: string;
104
102
  /** Ending frame image URL; image-to-video mode only. */
105
- last_frame_url?: string;
103
+ last_frame_image_url?: string;
106
104
  }
107
105
  /**
108
106
  * seedance-v1-pro text-to-video or image-to-video. Mode is auto-detected by
109
- * `input_urls` presence.
107
+ * `first_frame_image_url` presence.
110
108
  */
111
109
  interface GenerationV1ProParams extends GenerationV1SharedParams {
112
110
  model: 'seedance-v1-pro';
113
- /** Required in text-to-video mode. Omit when `input_urls` is set. */
111
+ /** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
114
112
  aspect_ratio?: AspectRatioV1Pro;
115
- /** Up to 1 image URL. Triggers image-to-video mode when set. */
116
- input_urls?: string[];
113
+ /** First frame image URL. Triggers image-to-video mode when set. */
114
+ first_frame_image_url?: string;
117
115
  }
118
116
  /**
119
117
  * seedance-v1-pro-fast image-to-video only. Smaller parameter surface —
120
- * no `aspect_ratio`, `lock_camera`, `seed`, or `enable_safety_checker`.
118
+ * no `aspect_ratio`, `lock_camera`, or `seed`.
121
119
  */
122
120
  interface GenerationV1ProFastParams extends GenerationCommonParams {
123
121
  model: 'seedance-v1-pro-fast';
124
- /** Required at least one image URL. */
125
- input_urls: [string] | [string, ...string[]];
126
- resolution?: ResolutionV1ProFast;
127
- duration: DurationV1;
122
+ /** Required first frame image URL. */
123
+ first_frame_image_url: string;
124
+ output_resolution?: ResolutionV1ProFast;
125
+ duration_seconds: DurationV1;
128
126
  }
129
127
  /** Discriminated union of all generation parameter variants */
130
128
  type TextToVideoParams = Generation15ProParams | Generation2TextParams | Generation2FrameParams | Generation2ReferenceParams | GenerationV1LiteParams | GenerationV1ProParams | GenerationV1ProFastParams;
@@ -138,13 +136,13 @@ interface TextToVideoResponse {
138
136
  id: string;
139
137
  status: AsyncTaskStatus;
140
138
  videos?: VideoMetadata[];
141
- last_frame_url?: string;
139
+ last_frame_image_url?: string;
142
140
  error?: string;
143
141
  [key: string]: unknown;
144
142
  }
145
143
  /**
146
144
  * Resolved response returned by the `run()` method after polling sees
147
- * `status: 'completed'`. Narrows `videos` to non-optional; `last_frame_url`
145
+ * `status: 'completed'`. Narrows `videos` to non-optional; `last_frame_image_url`
148
146
  * stays optional because it may be absent.
149
147
  */
150
148
  type CompletedTextToVideoResponse = TextToVideoResponse & {
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ type Resolution15Pro = '480p' | '720p' | '1080p';
12
12
  type Resolution2 = '480p' | '720p' | '1080p';
13
13
  type ResolutionV1 = '480p' | '720p' | '1080p';
14
14
  type ResolutionV1ProFast = '720p' | '1080p';
15
- type DurationV1 = '5' | '10';
15
+ type DurationV1 = 5 | 10;
16
16
  interface GenerationCommonParams {
17
17
  /** Text description of desired video content */
18
18
  prompt: string;
@@ -20,8 +20,8 @@ interface GenerationCommonParams {
20
20
  callback_url?: string;
21
21
  /** Generate audio track for the video */
22
22
  generate_audio?: boolean;
23
- /** Enable NSFW content check */
24
- nsfw_checker?: boolean;
23
+ /** Content safety check toggle */
24
+ enable_safety_checker?: boolean;
25
25
  }
26
26
  /**
27
27
  * seedance-1.5-pro generation parameters.
@@ -31,11 +31,11 @@ interface Generation15ProParams extends GenerationCommonParams {
31
31
  model: 'seedance-1.5-pro';
32
32
  /** Required for seedance-1.5-pro */
33
33
  aspect_ratio: AspectRatio15Pro;
34
- resolution?: Resolution15Pro;
34
+ output_resolution?: Resolution15Pro;
35
35
  /** Fixed values: 4, 8, or 12 seconds */
36
- duration?: 4 | 8 | 12;
37
- /** Up to 2 image URLs for image-to-video */
38
- input_urls?: string[];
36
+ duration_seconds: 4 | 8 | 12;
37
+ /** Up to 2 source image URLs for image-to-video */
38
+ source_image_urls?: string[];
39
39
  /** Lock camera movement */
40
40
  lock_camera?: boolean;
41
41
  }
@@ -43,9 +43,9 @@ interface Generation15ProParams extends GenerationCommonParams {
43
43
  interface Generation2BaseParams extends GenerationCommonParams {
44
44
  model: SeedanceModel2;
45
45
  aspect_ratio?: AspectRatio2;
46
- resolution?: Resolution2;
46
+ output_resolution?: Resolution2;
47
47
  /** Integer 4-15 */
48
- duration?: number;
48
+ duration_seconds?: number;
49
49
  /** Enable web search for prompt enrichment. */
50
50
  web_search?: boolean;
51
51
  }
@@ -62,9 +62,9 @@ interface Generation2TextParams extends Generation2BaseParams {
62
62
  */
63
63
  interface Generation2FrameParams extends Generation2BaseParams {
64
64
  /** First frame image URL (required for frame mode) */
65
- first_frame_url: string;
65
+ first_frame_image_url: string;
66
66
  /** Last frame image URL */
67
- last_frame_url?: string;
67
+ last_frame_image_url?: string;
68
68
  }
69
69
  /**
70
70
  * seedance-2.0/2-fast reference mode.
@@ -81,50 +81,48 @@ interface Generation2ReferenceParams extends Generation2BaseParams {
81
81
  }
82
82
  /** Common fields for v1-lite and v1-pro (not v1-pro-fast). */
83
83
  interface GenerationV1SharedParams extends GenerationCommonParams {
84
- /** `'5'` or `'10'`. Required. */
85
- duration: DurationV1;
86
- resolution?: ResolutionV1;
84
+ /** `5` or `10`. Required. */
85
+ duration_seconds: DurationV1;
86
+ output_resolution?: ResolutionV1;
87
87
  /** Lock camera movement */
88
88
  lock_camera?: boolean;
89
89
  /** Random seed; `-1` for random. Integer in [-1, 2147483647]. */
90
90
  seed?: number;
91
- /** Safety checker toggle */
92
- enable_safety_checker?: boolean;
93
91
  }
94
92
  /**
95
93
  * seedance-v1-lite text-to-video or image-to-video. Mode is auto-detected by
96
- * `input_urls` presence. `last_frame_url` is only valid in image-to-video mode.
94
+ * `first_frame_image_url` presence. `last_frame_image_url` is only valid in image-to-video mode.
97
95
  */
98
96
  interface GenerationV1LiteParams extends GenerationV1SharedParams {
99
97
  model: 'seedance-v1-lite';
100
- /** Required in text-to-video mode. Omit when `input_urls` is set. */
98
+ /** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
101
99
  aspect_ratio?: AspectRatioV1Lite;
102
- /** Up to 1 image URL. Triggers image-to-video mode when set. */
103
- input_urls?: string[];
100
+ /** First frame image URL. Triggers image-to-video mode when set. */
101
+ first_frame_image_url?: string;
104
102
  /** Ending frame image URL; image-to-video mode only. */
105
- last_frame_url?: string;
103
+ last_frame_image_url?: string;
106
104
  }
107
105
  /**
108
106
  * seedance-v1-pro text-to-video or image-to-video. Mode is auto-detected by
109
- * `input_urls` presence.
107
+ * `first_frame_image_url` presence.
110
108
  */
111
109
  interface GenerationV1ProParams extends GenerationV1SharedParams {
112
110
  model: 'seedance-v1-pro';
113
- /** Required in text-to-video mode. Omit when `input_urls` is set. */
111
+ /** Required in text-to-video mode. Omit when `first_frame_image_url` is set. */
114
112
  aspect_ratio?: AspectRatioV1Pro;
115
- /** Up to 1 image URL. Triggers image-to-video mode when set. */
116
- input_urls?: string[];
113
+ /** First frame image URL. Triggers image-to-video mode when set. */
114
+ first_frame_image_url?: string;
117
115
  }
118
116
  /**
119
117
  * seedance-v1-pro-fast image-to-video only. Smaller parameter surface —
120
- * no `aspect_ratio`, `lock_camera`, `seed`, or `enable_safety_checker`.
118
+ * no `aspect_ratio`, `lock_camera`, or `seed`.
121
119
  */
122
120
  interface GenerationV1ProFastParams extends GenerationCommonParams {
123
121
  model: 'seedance-v1-pro-fast';
124
- /** Required at least one image URL. */
125
- input_urls: [string] | [string, ...string[]];
126
- resolution?: ResolutionV1ProFast;
127
- duration: DurationV1;
122
+ /** Required first frame image URL. */
123
+ first_frame_image_url: string;
124
+ output_resolution?: ResolutionV1ProFast;
125
+ duration_seconds: DurationV1;
128
126
  }
129
127
  /** Discriminated union of all generation parameter variants */
130
128
  type TextToVideoParams = Generation15ProParams | Generation2TextParams | Generation2FrameParams | Generation2ReferenceParams | GenerationV1LiteParams | GenerationV1ProParams | GenerationV1ProFastParams;
@@ -138,13 +136,13 @@ interface TextToVideoResponse {
138
136
  id: string;
139
137
  status: AsyncTaskStatus;
140
138
  videos?: VideoMetadata[];
141
- last_frame_url?: string;
139
+ last_frame_image_url?: string;
142
140
  error?: string;
143
141
  [key: string]: unknown;
144
142
  }
145
143
  /**
146
144
  * Resolved response returned by the `run()` method after polling sees
147
- * `status: 'completed'`. Narrows `videos` to non-optional; `last_frame_url`
145
+ * `status: 'completed'`. Narrows `videos` to non-optional; `last_frame_image_url`
148
146
  * stays optional because it may be absent.
149
147
  */
150
148
  type CompletedTextToVideoResponse = TextToVideoResponse & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runapi.ai/seedance",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "RunAPI Seedance SDK for JavaScript, Ruby, and Go",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -25,12 +25,10 @@
25
25
  "build": "tsup",
26
26
  "test": "vitest run",
27
27
  "typecheck": "tsc --noEmit",
28
- "clean": "rm -rf dist",
29
- "test:text2video": "dotenv -e manual-tests/.env -- tsx manual-tests/test-text-to-video.ts",
30
- "test:manual": "pnpm run test:text2video"
28
+ "clean": "rm -rf dist"
31
29
  },
32
30
  "dependencies": {
33
- "@runapi.ai/core": "^0.2.4"
31
+ "@runapi.ai/core": "^0.2.5"
34
32
  },
35
33
  "devDependencies": {
36
34
  "@types/node": "^20.0.0",
@@ -34,7 +34,7 @@ Generate and edit video with Seedance through RunAPI. The default path for one-o
34
34
 
35
35
  The `runapi` binary is the runtime dependency. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config with `printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -`. Use `runapi login` only when the user explicitly wants interactive browser auth.
36
36
 
37
- Inspect the available actions and request fields with CLI help:
37
+ Inspect the available commands and request fields with CLI help:
38
38
 
39
39
  ```shell
40
40
  runapi seedance --help
@@ -54,7 +54,7 @@ runapi seedance text-to-video --async --input-file request.json
54
54
  runapi wait <task-id> --service seedance --action text-to-video
55
55
  ```
56
56
 
57
- Available actions: `text-to-video`.
57
+ Available commands: `text-to-video`.
58
58
 
59
59
  ## SDK integration path
60
60