@acedatacloud/sdk 2026.817.0 → 2026.824.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 +84 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +84 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/index.ts +3 -0
- package/src/resources/providers/qwen-image.ts +86 -0
- package/src/resources/providers/wan.ts +43 -31
package/package.json
CHANGED
|
@@ -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,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
|
}
|