@acedatacloud/sdk 2026.817.0 → 2026.905.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/index.js +96 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/fish.ts +8 -7
- package/src/resources/providers/index.ts +3 -0
- package/src/resources/providers/qwen-image.ts +86 -0
- package/src/resources/providers/seedream.ts +34 -34
- package/src/resources/providers/wan.ts +43 -31
package/package.json
CHANGED
|
@@ -22,15 +22,15 @@ export interface FishGenerateOptions {
|
|
|
22
22
|
/** Top-p nucleus sampling parameter, controls output diversity. */
|
|
23
23
|
topP?: number;
|
|
24
24
|
/** Output audio format, default is `mp3`. */
|
|
25
|
-
format?: "mp3" | "wav" | "pcm"
|
|
25
|
+
format?: "mp3" | "wav" | "pcm";
|
|
26
26
|
/** Delay mode. The upstream rejects null values, and defaults to `normal` when omitted. */
|
|
27
27
|
latency?: "normal" | "balanced";
|
|
28
28
|
/** Rhythm coverage parameters, forwarded as is to upstream (such as speech rate, volume, etc.). */
|
|
29
29
|
prosody?: Record<string, unknown>;
|
|
30
30
|
/** Is the input text subjected to text normalization processing by the upstream? */
|
|
31
31
|
normalize?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
references?: Array<
|
|
32
|
+
/** One-shot voice clone reference; cannot be combined with reference_id. */
|
|
33
|
+
references?: Array<{ audio: string; text: string }>;
|
|
34
34
|
/** MP3 bitrate when `format=mp3`. */
|
|
35
35
|
mp3Bitrate?: number;
|
|
36
36
|
/** Output the audio sampling rate (e.g., 16000, 22050, 44100). */
|
|
@@ -41,14 +41,15 @@ export interface FishGenerateOptions {
|
|
|
41
41
|
chunkLength?: number;
|
|
42
42
|
/** Opus bitrate when `format=opus`. */
|
|
43
43
|
opusBitrate?: number;
|
|
44
|
-
/**
|
|
45
|
-
referenceId?: string;
|
|
44
|
+
/** Saved/public voice ID; cannot be combined with references. */
|
|
45
|
+
referenceId?: string | string[];
|
|
46
46
|
/** Maximum number of new tokens generated. */
|
|
47
47
|
maxNewTokens?: number;
|
|
48
48
|
/** Minimum block length. */
|
|
49
49
|
minChunkLength?: number;
|
|
50
50
|
/** The repetition penalty coefficient applied during the generation process. */
|
|
51
51
|
repetitionPenalty?: number;
|
|
52
|
+
model?: "s1" | "s2-pro" | "s2.1-pro";
|
|
52
53
|
/** Submit asynchronously and poll. Defaults to true. */
|
|
53
54
|
async?: boolean;
|
|
54
55
|
/** Wait for completion before returning the handle. */
|
|
@@ -108,13 +109,13 @@ export class Fish {
|
|
|
108
109
|
if (options.minChunkLength !== undefined) body["min_chunk_length"] = options.minChunkLength;
|
|
109
110
|
if (options.repetitionPenalty !== undefined) body["repetition_penalty"] = options.repetitionPenalty;
|
|
110
111
|
for (const [key, value] of Object.entries(options)) {
|
|
111
|
-
if (!["async", "callbackUrl", "chunkLength", "format", "latency", "maxNewTokens", "maxWait", "minChunkLength", "mp3Bitrate", "normalize", "opusBitrate", "pollInterval", "prosody", "referenceId", "references", "repetitionPenalty", "sampleRate", "temperature", "text", "topP", "wait"].includes(key) && value !== undefined) {
|
|
112
|
+
if (!["async", "callbackUrl", "chunkLength", "format", "latency", "maxNewTokens", "maxWait", "minChunkLength", "model", "mp3Bitrate", "normalize", "opusBitrate", "pollInterval", "prosody", "referenceId", "references", "repetitionPenalty", "sampleRate", "temperature", "text", "topP", "wait"].includes(key) && value !== undefined) {
|
|
112
113
|
body[key] = value;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
116
117
|
body.async = options.async ?? true;
|
|
117
|
-
const result = (await this.transport.request('POST', "/fish/tts", { json: body })) as Record<string, unknown>;
|
|
118
|
+
const result = (await this.transport.request('POST', "/fish/tts", { json: body, headers: options.model !== undefined ? {"model": options.model} : {} })) as Record<string, unknown>;
|
|
118
119
|
const handle = new TaskHandle(taskId(result), "/fish/tasks", this.transport, result);
|
|
119
120
|
if (options.wait) {
|
|
120
121
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
@@ -12,6 +12,7 @@ export { Maestro } from './maestro';
|
|
|
12
12
|
export { Minimax } from './minimax';
|
|
13
13
|
export { NanoBanana } from './nano-banana';
|
|
14
14
|
export { Producer } from './producer';
|
|
15
|
+
export { QwenImage } from './qwen-image';
|
|
15
16
|
export { Seedance } from './seedance';
|
|
16
17
|
export { Seedream } from './seedream';
|
|
17
18
|
export { Suno } from './suno';
|
|
@@ -30,6 +31,7 @@ import { Maestro } from './maestro';
|
|
|
30
31
|
import { Minimax } from './minimax';
|
|
31
32
|
import { NanoBanana } from './nano-banana';
|
|
32
33
|
import { Producer } from './producer';
|
|
34
|
+
import { QwenImage } from './qwen-image';
|
|
33
35
|
import { Seedance } from './seedance';
|
|
34
36
|
import { Seedream } from './seedream';
|
|
35
37
|
import { Suno } from './suno';
|
|
@@ -49,6 +51,7 @@ export function attachProviders(client: Record<string, unknown>, transport: Tran
|
|
|
49
51
|
client.minimax = new Minimax(transport);
|
|
50
52
|
client.nanobanana = new NanoBanana(transport);
|
|
51
53
|
client.producer = new Producer(transport);
|
|
54
|
+
client.qwenimage = new QwenImage(transport);
|
|
52
55
|
client.seedance = new Seedance(transport);
|
|
53
56
|
client.seedream = new Seedream(transport);
|
|
54
57
|
client.suno = new Suno(transport);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QwenImage (qwen-image) — generated from the platform OpenAPI spec.
|
|
3
|
+
*
|
|
4
|
+
* Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
|
|
5
|
+
* names, types, enums and required-ness all come from the live spec.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { Transport } from '../../runtime/transport';
|
|
9
|
+
import { TaskHandle } from '../../runtime/tasks';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function taskId(result: Record<string, unknown>): string {
|
|
13
|
+
if (typeof result?.task_id === 'string') return result.task_id;
|
|
14
|
+
const data = result?.data as Record<string, unknown> | undefined;
|
|
15
|
+
if (data && typeof data.task_id === 'string') return data.task_id;
|
|
16
|
+
return typeof result?.id === 'string' ? result.id : '';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface QwenImageGenerateOptions {
|
|
20
|
+
/** $t(qwen_image_images_model) */
|
|
21
|
+
model: "qwen-image-3.0" | "qwen-image-3.0-pro";
|
|
22
|
+
/** $t(qwen_image_images_prompt) */
|
|
23
|
+
prompt: string;
|
|
24
|
+
/** $t(qwen_image_images_image_urls) */
|
|
25
|
+
imageUrls?: string[];
|
|
26
|
+
/** $t(qwen_image_images_n) */
|
|
27
|
+
n?: number;
|
|
28
|
+
/** $t(qwen_image_images_size) */
|
|
29
|
+
size?: string;
|
|
30
|
+
/** $t(qwen_image_images_prompt_extend) */
|
|
31
|
+
promptExtend?: boolean;
|
|
32
|
+
/** $t(qwen_image_images_prompt_extend_mode) */
|
|
33
|
+
promptExtendMode?: "direct" | "agent";
|
|
34
|
+
/** $t(qwen_image_images_enable_thinking) */
|
|
35
|
+
enableThinking?: boolean;
|
|
36
|
+
/** $t(qwen_image_images_negative_prompt) */
|
|
37
|
+
negativePrompt?: string;
|
|
38
|
+
/** $t(qwen_image_images_seed) */
|
|
39
|
+
seed?: number;
|
|
40
|
+
/** $t(qwen_image_images_watermark) */
|
|
41
|
+
watermark?: boolean;
|
|
42
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
43
|
+
async?: boolean;
|
|
44
|
+
/** Wait for completion before returning the handle. */
|
|
45
|
+
wait?: boolean;
|
|
46
|
+
pollInterval?: number;
|
|
47
|
+
maxWait?: number;
|
|
48
|
+
callbackUrl?: string;
|
|
49
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** qwen-image client. */
|
|
54
|
+
export class QwenImage {
|
|
55
|
+
constructor(private transport: Transport) {}
|
|
56
|
+
|
|
57
|
+
/** Call /qwen-image/images. */
|
|
58
|
+
async generate(options: QwenImageGenerateOptions): Promise<TaskHandle> {
|
|
59
|
+
const body: Record<string, unknown> = {};
|
|
60
|
+
body["model"] = options.model;
|
|
61
|
+
body["prompt"] = options.prompt;
|
|
62
|
+
if (options.imageUrls !== undefined) body["image_urls"] = options.imageUrls;
|
|
63
|
+
body["n"] = options.n ?? 1;
|
|
64
|
+
if (options.size !== undefined) body["size"] = options.size;
|
|
65
|
+
body["prompt_extend"] = options.promptExtend ?? true;
|
|
66
|
+
body["prompt_extend_mode"] = options.promptExtendMode ?? "direct";
|
|
67
|
+
body["enable_thinking"] = options.enableThinking ?? true;
|
|
68
|
+
if (options.negativePrompt !== undefined) body["negative_prompt"] = options.negativePrompt;
|
|
69
|
+
if (options.seed !== undefined) body["seed"] = options.seed;
|
|
70
|
+
body["watermark"] = options.watermark ?? false;
|
|
71
|
+
for (const [key, value] of Object.entries(options)) {
|
|
72
|
+
if (!["async", "callbackUrl", "enableThinking", "imageUrls", "maxWait", "model", "n", "negativePrompt", "pollInterval", "prompt", "promptExtend", "promptExtendMode", "seed", "size", "wait", "watermark"].includes(key) && value !== undefined) {
|
|
73
|
+
body[key] = value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
77
|
+
body.async = options.async ?? true;
|
|
78
|
+
const result = (await this.transport.request('POST', "/qwen-image/images", { json: body })) as Record<string, unknown>;
|
|
79
|
+
const handle = new TaskHandle(taskId(result), "/qwen-image/tasks", this.transport, result);
|
|
80
|
+
if (options.wait) {
|
|
81
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
82
|
+
}
|
|
83
|
+
return handle;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
@@ -17,34 +17,34 @@ function taskId(result: Record<string, unknown>): string {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface SeedreamGenerateOptions {
|
|
20
|
-
/**
|
|
21
|
-
model: "doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-260128" | "doubao-seedream-
|
|
22
|
-
/**
|
|
23
|
-
prompt
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
size?: "1K" | "2K" | "3K" | "4K"
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/**
|
|
20
|
+
/** Full model ID. Seedream 5.0 Pro supports single-image generation, precise editing, transparent backgrounds, and layer decomposition; Seedream 5.0 Lite supports single or sequential images, streaming, and web search. */
|
|
21
|
+
model: "doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-260128" | "doubao-seedream-5-0-lite-260128" | "doubao-seedream-4-0-250828" | "doubao-seedream-4-5-251128";
|
|
22
|
+
/** Generation or editing prompt. Optional only for Seedream 5.0 Pro layer decomposition, where omission automatically decomposes the main elements. */
|
|
23
|
+
prompt?: string;
|
|
24
|
+
/** One reference image URL/base64 string or an array. Pro accepts up to 10 images in regular mode and exactly one for decomposition; Lite/4.x accept up to 14. Each image must be at most 30 MB. */
|
|
25
|
+
image?: string | string[];
|
|
26
|
+
/** Output size. Pro supports 1K/1.5K/2K or valid dimensions; decomposition also supports auto. Lite supports 2K/3K/4K or valid dimensions. */
|
|
27
|
+
size?: "1K" | "1.5K" | "2K" | "3K" | "4K" | "auto" | `${number}x${number}`;
|
|
28
|
+
/** Sequential image mode. auto lets supported Lite/4.x models generate a related set; disabled returns one image. Not supported by Pro. */
|
|
29
|
+
sequentialImageGeneration?: "auto" | "disabled";
|
|
30
|
+
/** Sequential image options. max_images is 1-15 and input images plus outputs must not exceed 15. */
|
|
31
|
+
sequentialImageGenerationOptions?: Record<string, unknown>;
|
|
32
|
+
/** Stream normalized image events. Supported by Lite/4.x only and cannot be combined with async or callback_url. */
|
|
33
33
|
stream?: boolean;
|
|
34
|
-
/**
|
|
34
|
+
/** Image response format: url or b64_json. */
|
|
35
|
+
responseFormat?: "url" | "b64_json";
|
|
36
|
+
/** Whether to add the AI-generated watermark. */
|
|
35
37
|
watermark?: boolean;
|
|
36
|
-
/**
|
|
38
|
+
/** Output image format, jpeg or png. Supported by Seedream 5.0 Pro and Lite. */
|
|
37
39
|
outputFormat?: "jpeg" | "png";
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
responseFormat?: string;
|
|
42
|
-
/** Optional prompt word optimization configuration. Only supports `doubao-seedream-5.0-lite`, `doubao-seedream-4.5` (only in `standard` mode), and `doubao-seedream-4.0`. */
|
|
40
|
+
/** Model tools. Seedream 5.0 Lite supports web_search. */
|
|
41
|
+
tools?: Array<Record<string, unknown>>;
|
|
42
|
+
/** Prompt optimization. Pro supports standard/fast; Lite and 4.5 support standard; 4.0 supports standard/fast. */
|
|
43
43
|
optimizePromptOptions?: Record<string, unknown>;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
|
|
44
|
+
/** Seedream 5.0 Pro layer decomposition. Requires exactly one PNG/JPEG and returns one base image plus up to 16 transparent PNG layers. */
|
|
45
|
+
layerDecomposition?: boolean;
|
|
46
|
+
/** Seedream 5.0 Pro background mode. transparent requires one transparent PNG input and PNG output; opaque produces a regular background. */
|
|
47
|
+
background?: "transparent" | "opaque";
|
|
48
48
|
/** Submit asynchronously and poll. Defaults to true. */
|
|
49
49
|
async?: boolean;
|
|
50
50
|
/** Wait for completion before returning the handle. */
|
|
@@ -60,25 +60,25 @@ export interface SeedreamGenerateOptions {
|
|
|
60
60
|
export class Seedream {
|
|
61
61
|
constructor(private transport: Transport) {}
|
|
62
62
|
|
|
63
|
-
/**
|
|
63
|
+
/** Call /seedream/images. */
|
|
64
64
|
async generate(options: SeedreamGenerateOptions): Promise<TaskHandle> {
|
|
65
65
|
const body: Record<string, unknown> = {};
|
|
66
66
|
body["model"] = options.model;
|
|
67
|
-
body["prompt"] = options.prompt;
|
|
68
|
-
if (options.seed !== undefined) body["seed"] = options.seed;
|
|
69
|
-
if (options.size !== undefined) body["size"] = options.size;
|
|
67
|
+
if (options.prompt !== undefined) body["prompt"] = options.prompt;
|
|
70
68
|
if (options.image !== undefined) body["image"] = options.image;
|
|
71
|
-
if (options.
|
|
69
|
+
if (options.size !== undefined) body["size"] = options.size;
|
|
70
|
+
if (options.sequentialImageGeneration !== undefined) body["sequential_image_generation"] = options.sequentialImageGeneration;
|
|
71
|
+
if (options.sequentialImageGenerationOptions !== undefined) body["sequential_image_generation_options"] = options.sequentialImageGenerationOptions;
|
|
72
72
|
if (options.stream !== undefined) body["stream"] = options.stream;
|
|
73
|
+
if (options.responseFormat !== undefined) body["response_format"] = options.responseFormat;
|
|
73
74
|
if (options.watermark !== undefined) body["watermark"] = options.watermark;
|
|
74
75
|
if (options.outputFormat !== undefined) body["output_format"] = options.outputFormat;
|
|
75
|
-
if (options.
|
|
76
|
-
if (options.responseFormat !== undefined) body["response_format"] = options.responseFormat;
|
|
76
|
+
if (options.tools !== undefined) body["tools"] = options.tools;
|
|
77
77
|
if (options.optimizePromptOptions !== undefined) body["optimize_prompt_options"] = options.optimizePromptOptions;
|
|
78
|
-
if (options.
|
|
79
|
-
if (options.
|
|
78
|
+
if (options.layerDecomposition !== undefined) body["layer_decomposition"] = options.layerDecomposition;
|
|
79
|
+
if (options.background !== undefined) body["background"] = options.background;
|
|
80
80
|
for (const [key, value] of Object.entries(options)) {
|
|
81
|
-
if (!["async", "
|
|
81
|
+
if (!["async", "background", "callbackUrl", "image", "layerDecomposition", "maxWait", "model", "optimizePromptOptions", "outputFormat", "pollInterval", "prompt", "responseFormat", "sequentialImageGeneration", "sequentialImageGenerationOptions", "size", "stream", "tools", "wait", "watermark"].includes(key) && value !== undefined) {
|
|
82
82
|
body[key] = value;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -17,32 +17,40 @@ function taskId(result: Record<string, unknown>): string {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface WanGenerateOptions {
|
|
20
|
-
/**
|
|
21
|
-
model: "wan2.6-i2v" | "wan2.6-r2v" | "wan2.6-i2v-flash" | "wan2.6-t2v";
|
|
22
|
-
/**
|
|
23
|
-
action: "text2video" | "image2video";
|
|
24
|
-
/** Prompts for generating videos. */
|
|
25
|
-
prompt: string;
|
|
26
|
-
/** Video size specifications. */
|
|
27
|
-
size?: string;
|
|
28
|
-
/** Specify whether the generated video contains sound. */
|
|
20
|
+
/** $t(wan_videos_model) */
|
|
21
|
+
model: "wan2.6-i2v" | "wan2.6-r2v" | "wan2.6-i2v-flash" | "wan2.6-t2v" | "wan3.0-video";
|
|
22
|
+
/** $t(wan_videos_audio) */
|
|
29
23
|
audio?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
duration?: number;
|
|
32
|
-
/** The URL of the audio file, the model will generate the corresponding video based on that audio. */
|
|
33
|
-
audioUrl?: string;
|
|
34
|
-
/** The URL of the starting frame image, which will serve as the first frame of the generated video. */
|
|
35
|
-
imageUrl?: string;
|
|
36
|
-
/** Specify the type of shots for the video, that is, whether the video consists of a single continuous shot (`single`) or multiple switching shots (`multi`). */
|
|
37
|
-
shotType?: "single" | "multi";
|
|
38
|
-
/** Specify the resolution level for generating the video, used to adjust the video clarity (total pixel count). The model will automatically scale to a similar total pixel count based on the selected resolution level, and the aspect ratio of the generated video will strive to remain consistent with the aspect ratio of the input image `image_url`. */
|
|
39
|
-
resolution?: "480P" | "720P" | "1080P";
|
|
40
|
-
/** Whether to enable intelligent rewriting of prompts. Once enabled, a large model will be used to intelligently expand the input prompts, which can significantly improve the generation effect of shorter prompts, but will increase processing time. */
|
|
24
|
+
/** $t(wan_videos_prompt_extend) */
|
|
41
25
|
promptExtend?: boolean;
|
|
42
|
-
/**
|
|
26
|
+
/** $t(wan_videos_action) */
|
|
27
|
+
action?: "text2video" | "image2video";
|
|
28
|
+
/** $t(wan_videos_resolution) */
|
|
29
|
+
resolution?: "480P" | "720P" | "1080P";
|
|
30
|
+
/** $t(wan_videos_shot_type) */
|
|
31
|
+
shotType?: "single" | "multi";
|
|
32
|
+
/** $t(wan_videos_duration) */
|
|
33
|
+
duration?: number;
|
|
34
|
+
/** $t(wan_videos_prompt) */
|
|
35
|
+
prompt?: string;
|
|
36
|
+
/** $t(wan_videos_negative_prompt) */
|
|
43
37
|
negativePrompt?: string;
|
|
44
|
-
/**
|
|
38
|
+
/** $t(wan_videos_size) */
|
|
39
|
+
size?: string;
|
|
40
|
+
/** $t(wan_videos_audio_url) */
|
|
41
|
+
audioUrl?: string;
|
|
42
|
+
/** $t(wan_videos_reference_video_urls) */
|
|
45
43
|
referenceVideoUrls?: string[];
|
|
44
|
+
/** $t(wan_videos_image_url) */
|
|
45
|
+
imageUrl?: string;
|
|
46
|
+
/** $t(wan_videos_media) */
|
|
47
|
+
media?: Array<Record<string, unknown>>;
|
|
48
|
+
/** $t(wan_videos_ratio) */
|
|
49
|
+
ratio?: "adaptive" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
|
|
50
|
+
/** $t(wan_videos_seed) */
|
|
51
|
+
seed?: number;
|
|
52
|
+
/** $t(wan_videos_watermark) */
|
|
53
|
+
watermark?: boolean;
|
|
46
54
|
/** Submit asynchronously and poll. Defaults to true. */
|
|
47
55
|
async?: boolean;
|
|
48
56
|
/** Wait for completion before returning the handle. */
|
|
@@ -62,20 +70,24 @@ export class Wan {
|
|
|
62
70
|
async generate(options: WanGenerateOptions): Promise<TaskHandle> {
|
|
63
71
|
const body: Record<string, unknown> = {};
|
|
64
72
|
body["model"] = options.model;
|
|
65
|
-
body["action"] = options.action;
|
|
66
|
-
body["prompt"] = options.prompt;
|
|
67
|
-
if (options.size !== undefined) body["size"] = options.size;
|
|
68
73
|
body["audio"] = options.audio ?? false;
|
|
69
|
-
if (options.duration !== undefined) body["duration"] = options.duration;
|
|
70
|
-
if (options.audioUrl !== undefined) body["audio_url"] = options.audioUrl;
|
|
71
|
-
if (options.imageUrl !== undefined) body["image_url"] = options.imageUrl;
|
|
72
|
-
if (options.shotType !== undefined) body["shot_type"] = options.shotType;
|
|
73
|
-
if (options.resolution !== undefined) body["resolution"] = options.resolution;
|
|
74
74
|
body["prompt_extend"] = options.promptExtend ?? false;
|
|
75
|
+
body["action"] = options.action ?? "text2video";
|
|
76
|
+
if (options.resolution !== undefined) body["resolution"] = options.resolution;
|
|
77
|
+
if (options.shotType !== undefined) body["shot_type"] = options.shotType;
|
|
78
|
+
if (options.duration !== undefined) body["duration"] = options.duration;
|
|
79
|
+
if (options.prompt !== undefined) body["prompt"] = options.prompt;
|
|
75
80
|
if (options.negativePrompt !== undefined) body["negative_prompt"] = options.negativePrompt;
|
|
81
|
+
if (options.size !== undefined) body["size"] = options.size;
|
|
82
|
+
if (options.audioUrl !== undefined) body["audio_url"] = options.audioUrl;
|
|
76
83
|
if (options.referenceVideoUrls !== undefined) body["reference_video_urls"] = options.referenceVideoUrls;
|
|
84
|
+
if (options.imageUrl !== undefined) body["image_url"] = options.imageUrl;
|
|
85
|
+
if (options.media !== undefined) body["media"] = options.media;
|
|
86
|
+
if (options.ratio !== undefined) body["ratio"] = options.ratio;
|
|
87
|
+
if (options.seed !== undefined) body["seed"] = options.seed;
|
|
88
|
+
body["watermark"] = options.watermark ?? false;
|
|
77
89
|
for (const [key, value] of Object.entries(options)) {
|
|
78
|
-
if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "referenceVideoUrls", "resolution", "shotType", "size", "wait"].includes(key) && value !== undefined) {
|
|
90
|
+
if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "media", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "ratio", "referenceVideoUrls", "resolution", "seed", "shotType", "size", "wait", "watermark"].includes(key) && value !== undefined) {
|
|
79
91
|
body[key] = value;
|
|
80
92
|
}
|
|
81
93
|
}
|