@acedatacloud/sdk 2026.722.0 → 2026.727.1
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.d.mts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +1016 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1016 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +3 -0
- package/src/resources/providers/digitalhuman.ts +123 -0
- package/src/resources/providers/dreamina.ts +68 -0
- package/src/resources/providers/fish.ts +146 -0
- package/src/resources/providers/flux.ts +71 -0
- package/src/resources/providers/hailuo.ts +65 -0
- package/src/resources/providers/happyhorse.ts +89 -0
- package/src/resources/providers/index.ts +53 -0
- package/src/resources/providers/localization.ts +45 -0
- package/src/resources/providers/luma.ts +83 -0
- package/src/resources/providers/maestro.ts +84 -0
- package/src/resources/providers/nano-banana.ts +74 -0
- package/src/resources/providers/producer.ts +182 -0
- package/src/resources/providers/seedance.ts +89 -0
- package/src/resources/providers/seedream.ts +95 -0
- package/src/resources/providers/suno.ts +437 -0
- package/src/resources/providers/wan.ts +92 -0
- package/src/runtime/tasks.ts +184 -19
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Kling } from './resources/kling';
|
|
|
18
18
|
import { WebExtrator } from './resources/webextrator';
|
|
19
19
|
import { Face } from './resources/face';
|
|
20
20
|
import { ShortUrl } from './resources/shorturl';
|
|
21
|
+
import { attachProviders } from './resources/providers';
|
|
21
22
|
|
|
22
23
|
export interface AceDataCloudOptions {
|
|
23
24
|
apiToken?: string;
|
|
@@ -81,5 +82,7 @@ export class AceDataCloud {
|
|
|
81
82
|
this.webextrator = new WebExtrator(this.transport);
|
|
82
83
|
this.face = new Face(this.transport);
|
|
83
84
|
this.shorturl = new ShortUrl(this.transport);
|
|
85
|
+
// Provider axis: one namespace per service, generated from the specs.
|
|
86
|
+
attachProviders(this as unknown as Record<string, unknown>, this.transport);
|
|
84
87
|
}
|
|
85
88
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Digitalhuman (digitalhuman) — 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 DigitalhumanGenerateOptions {
|
|
20
|
+
/** Public URL of the source face video (preferred). One of video_url/image_url required. */
|
|
21
|
+
videoUrl: string;
|
|
22
|
+
/** Spoken text -> TTS (requires voice_id). */
|
|
23
|
+
text?: string;
|
|
24
|
+
/** Audio tempo multiplier. */
|
|
25
|
+
speed?: number;
|
|
26
|
+
/** Diffusion steps (LatentSync). */
|
|
27
|
+
steps?: number;
|
|
28
|
+
/** latentsync = quality (default); heygem = fast tier. */
|
|
29
|
+
engine?: "latentsync" | "heygem";
|
|
30
|
+
/** Lip-sync strength (LatentSync). Lower loosens sync. */
|
|
31
|
+
guidance?: number;
|
|
32
|
+
/** Apply the mouth-seam reduction blend. */
|
|
33
|
+
seamFix?: boolean;
|
|
34
|
+
/** A cloned voice from POST /digital-human/voices. */
|
|
35
|
+
voiceId?: string;
|
|
36
|
+
/** Public URL of the driving audio (.wav/.mp3/.m4a). OR supply text(+voice_id). */
|
|
37
|
+
audioUrl?: string;
|
|
38
|
+
/** Public URL of a source face photo (photo-driven path). */
|
|
39
|
+
imageUrl?: string;
|
|
40
|
+
resolution?: "720p" | "540p";
|
|
41
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
42
|
+
async?: boolean;
|
|
43
|
+
/** Wait for completion before returning the handle. */
|
|
44
|
+
wait?: boolean;
|
|
45
|
+
pollInterval?: number;
|
|
46
|
+
maxWait?: number;
|
|
47
|
+
callbackUrl?: string;
|
|
48
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface DigitalhumanVoicesOptions {
|
|
53
|
+
/** Public URL of a clean 10-20s voice sample. */
|
|
54
|
+
audioUrl: string;
|
|
55
|
+
lang?: "zh" | "en";
|
|
56
|
+
/** Optional label. */
|
|
57
|
+
name?: string;
|
|
58
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
59
|
+
async?: boolean;
|
|
60
|
+
/** Wait for completion before returning the handle. */
|
|
61
|
+
wait?: boolean;
|
|
62
|
+
pollInterval?: number;
|
|
63
|
+
maxWait?: number;
|
|
64
|
+
callbackUrl?: string;
|
|
65
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** digitalhuman client. */
|
|
70
|
+
export class Digitalhuman {
|
|
71
|
+
constructor(private transport: Transport) {}
|
|
72
|
+
|
|
73
|
+
/** Digital Human video generation API — turn a portrait plus audio or text into a talking-head video. */
|
|
74
|
+
async generate(options: DigitalhumanGenerateOptions): Promise<TaskHandle> {
|
|
75
|
+
const body: Record<string, unknown> = {};
|
|
76
|
+
body["video_url"] = options.videoUrl;
|
|
77
|
+
body["text"] = options.text ?? "\u5927\u5bb6\u597d\uff0c\u8fd9\u662f\u79bb\u7ebf\u751f\u6210\u7684\u6570\u5b57\u4eba\u3002";
|
|
78
|
+
body["speed"] = options.speed ?? 1.0;
|
|
79
|
+
body["steps"] = options.steps ?? 40;
|
|
80
|
+
body["engine"] = options.engine ?? "latentsync";
|
|
81
|
+
body["guidance"] = options.guidance ?? 2.0;
|
|
82
|
+
body["seam_fix"] = options.seamFix ?? true;
|
|
83
|
+
if (options.voiceId !== undefined) body["voice_id"] = options.voiceId;
|
|
84
|
+
if (options.audioUrl !== undefined) body["audio_url"] = options.audioUrl;
|
|
85
|
+
if (options.imageUrl !== undefined) body["image_url"] = options.imageUrl;
|
|
86
|
+
body["resolution"] = options.resolution ?? "720p";
|
|
87
|
+
for (const [key, value] of Object.entries(options)) {
|
|
88
|
+
if (!["async", "audioUrl", "callbackUrl", "engine", "guidance", "imageUrl", "maxWait", "pollInterval", "resolution", "seamFix", "speed", "steps", "text", "videoUrl", "voiceId", "wait"].includes(key) && value !== undefined) {
|
|
89
|
+
body[key] = value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
93
|
+
body.async = options.async ?? true;
|
|
94
|
+
const result = (await this.transport.request('POST', "/digital-human/videos", { json: body })) as Record<string, unknown>;
|
|
95
|
+
const handle = new TaskHandle(taskId(result), "/digital-human/tasks", this.transport, result);
|
|
96
|
+
if (options.wait) {
|
|
97
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
98
|
+
}
|
|
99
|
+
return handle;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Digital Human voice-clone API — upload an audio sample to clone a custom voice for speech synthesis. */
|
|
103
|
+
async voices(options: DigitalhumanVoicesOptions): Promise<TaskHandle> {
|
|
104
|
+
const body: Record<string, unknown> = {};
|
|
105
|
+
body["audio_url"] = options.audioUrl;
|
|
106
|
+
body["lang"] = options.lang ?? "zh";
|
|
107
|
+
if (options.name !== undefined) body["name"] = options.name;
|
|
108
|
+
for (const [key, value] of Object.entries(options)) {
|
|
109
|
+
if (!["async", "audioUrl", "callbackUrl", "lang", "maxWait", "name", "pollInterval", "wait"].includes(key) && value !== undefined) {
|
|
110
|
+
body[key] = value;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
114
|
+
body.async = options.async ?? true;
|
|
115
|
+
const result = (await this.transport.request('POST', "/digital-human/voices", { json: body })) as Record<string, unknown>;
|
|
116
|
+
const handle = new TaskHandle(taskId(result), "/digital-human/tasks", this.transport, result);
|
|
117
|
+
if (options.wait) {
|
|
118
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
119
|
+
}
|
|
120
|
+
return handle;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dreamina (dreamina) — 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 DreaminaGenerateOptions {
|
|
20
|
+
/** Public URL for audio (mp3/wav). The character will lip-sync to it, and it is recommended that the duration be controlled within 60 seconds. */
|
|
21
|
+
audioUrl: string;
|
|
22
|
+
/** Public URL of portrait images. Clear frontal face effects are best. */
|
|
23
|
+
imageUrl: string;
|
|
24
|
+
/** The model being used is OmniHuman 1.5. */
|
|
25
|
+
model?: "omnihuman-1.5";
|
|
26
|
+
/** Optional text prompts for guiding expressions, emotions, stability, and style. */
|
|
27
|
+
prompt?: string;
|
|
28
|
+
/** Optional subject mask URL (from object detection) to specify and drive a particular person in a multi-person image. */
|
|
29
|
+
maskUrl?: string[];
|
|
30
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
31
|
+
async?: boolean;
|
|
32
|
+
/** Wait for completion before returning the handle. */
|
|
33
|
+
wait?: boolean;
|
|
34
|
+
pollInterval?: number;
|
|
35
|
+
maxWait?: number;
|
|
36
|
+
callbackUrl?: string;
|
|
37
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** dreamina client. */
|
|
42
|
+
export class Dreamina {
|
|
43
|
+
constructor(private transport: Transport) {}
|
|
44
|
+
|
|
45
|
+
/** Audio-driven talking-photo digital human video generation (OmniHuman 1.5) */
|
|
46
|
+
async generate(options: DreaminaGenerateOptions): Promise<TaskHandle> {
|
|
47
|
+
const body: Record<string, unknown> = {};
|
|
48
|
+
body["audio_url"] = options.audioUrl;
|
|
49
|
+
body["image_url"] = options.imageUrl;
|
|
50
|
+
body["model"] = options.model ?? "omnihuman-1.5";
|
|
51
|
+
if (options.prompt !== undefined) body["prompt"] = options.prompt;
|
|
52
|
+
if (options.maskUrl !== undefined) body["mask_url"] = options.maskUrl;
|
|
53
|
+
for (const [key, value] of Object.entries(options)) {
|
|
54
|
+
if (!["async", "audioUrl", "callbackUrl", "imageUrl", "maskUrl", "maxWait", "model", "pollInterval", "prompt", "wait"].includes(key) && value !== undefined) {
|
|
55
|
+
body[key] = value;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
59
|
+
body.async = options.async ?? true;
|
|
60
|
+
const result = (await this.transport.request('POST', "/dreamina/videos", { json: body })) as Record<string, unknown>;
|
|
61
|
+
const handle = new TaskHandle(taskId(result), "/dreamina/tasks", this.transport, result);
|
|
62
|
+
if (options.wait) {
|
|
63
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
64
|
+
}
|
|
65
|
+
return handle;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fish (fish) — 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 FishGenerateOptions {
|
|
20
|
+
/** Text content to be synthesized. Required, must be a non-empty string. */
|
|
21
|
+
text: string;
|
|
22
|
+
/** Top-p nucleus sampling parameter, controls output diversity. */
|
|
23
|
+
topP?: number;
|
|
24
|
+
/** Output audio format, default is `mp3`. */
|
|
25
|
+
format?: "mp3" | "wav" | "pcm" | "opus";
|
|
26
|
+
/** Delay mode. The upstream rejects null values, and defaults to `normal` when omitted. */
|
|
27
|
+
latency?: "normal" | "balanced";
|
|
28
|
+
/** Rhythm coverage parameters, forwarded as is to upstream (such as speech rate, volume, etc.). */
|
|
29
|
+
prosody?: Record<string, unknown>;
|
|
30
|
+
/** Is the input text subjected to text normalization processing by the upstream? */
|
|
31
|
+
normalize?: boolean;
|
|
32
|
+
/** Inline reference audio samples will be forwarded upstream as is, for zero-shot voice cloning. */
|
|
33
|
+
references?: unknown[];
|
|
34
|
+
/** MP3 bitrate when `format=mp3`. */
|
|
35
|
+
mp3Bitrate?: number;
|
|
36
|
+
/** Output the audio sampling rate (e.g., 16000, 22050, 44100). */
|
|
37
|
+
sampleRate?: number;
|
|
38
|
+
/** Sampling temperature (0.0–1.0). The higher the value, the more diverse the output; the lower the value, the more stable and consistent it is. */
|
|
39
|
+
temperature?: number;
|
|
40
|
+
/** The chunk length passed to the upstream synthesizer. */
|
|
41
|
+
chunkLength?: number;
|
|
42
|
+
/** Opus bitrate when `format=opus`. */
|
|
43
|
+
opusBitrate?: number;
|
|
44
|
+
/** Voice model ID (single speaker). A string array can also be passed in multi-speaker scenarios. */
|
|
45
|
+
referenceId?: string;
|
|
46
|
+
/** Maximum number of new tokens generated. */
|
|
47
|
+
maxNewTokens?: number;
|
|
48
|
+
/** Minimum block length. */
|
|
49
|
+
minChunkLength?: number;
|
|
50
|
+
/** The repetition penalty coefficient applied during the generation process. */
|
|
51
|
+
repetitionPenalty?: number;
|
|
52
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
53
|
+
async?: boolean;
|
|
54
|
+
/** Wait for completion before returning the handle. */
|
|
55
|
+
wait?: boolean;
|
|
56
|
+
pollInterval?: number;
|
|
57
|
+
maxWait?: number;
|
|
58
|
+
callbackUrl?: string;
|
|
59
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface FishModelOptions {
|
|
64
|
+
/** Name of the voice model. */
|
|
65
|
+
title: string;
|
|
66
|
+
/** The HTTP(S) URL of the audio file for cloning must be a single URL string. This interface does not support multipart/binary file uploads. */
|
|
67
|
+
voices: string;
|
|
68
|
+
/** Tags used for retrieval in public repositories (optional). */
|
|
69
|
+
tags?: string[];
|
|
70
|
+
/** Reference text corresponding to the audio sample (optional). */
|
|
71
|
+
texts?: string[];
|
|
72
|
+
/** The visibility of the model is set to `private` by default. */
|
|
73
|
+
visibility?: "public" | "private";
|
|
74
|
+
/** HTTP(S) URL of the voice model cover image (optional). */
|
|
75
|
+
coverImage?: string;
|
|
76
|
+
/** Description of the voice model (optional). */
|
|
77
|
+
description?: string;
|
|
78
|
+
/** If it is `true`, the upstream service will generate a sample voice after the training is completed. */
|
|
79
|
+
generateSample?: boolean;
|
|
80
|
+
/** If it is `true`, the upstream service will perform quality enhancement processing on the audio samples before training. */
|
|
81
|
+
enhanceAudioQuality?: boolean;
|
|
82
|
+
callbackUrl?: string;
|
|
83
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** fish client. */
|
|
88
|
+
export class Fish {
|
|
89
|
+
constructor(private transport: Transport) {}
|
|
90
|
+
|
|
91
|
+
/** Fish Audio text-to-speech API — convert text into natural speech using a chosen voice model. */
|
|
92
|
+
async generate(options: FishGenerateOptions): Promise<TaskHandle> {
|
|
93
|
+
const body: Record<string, unknown> = {};
|
|
94
|
+
body["text"] = options.text;
|
|
95
|
+
if (options.topP !== undefined) body["top_p"] = options.topP;
|
|
96
|
+
if (options.format !== undefined) body["format"] = options.format;
|
|
97
|
+
if (options.latency !== undefined) body["latency"] = options.latency;
|
|
98
|
+
if (options.prosody !== undefined) body["prosody"] = options.prosody;
|
|
99
|
+
if (options.normalize !== undefined) body["normalize"] = options.normalize;
|
|
100
|
+
if (options.references !== undefined) body["references"] = options.references;
|
|
101
|
+
if (options.mp3Bitrate !== undefined) body["mp3_bitrate"] = options.mp3Bitrate;
|
|
102
|
+
if (options.sampleRate !== undefined) body["sample_rate"] = options.sampleRate;
|
|
103
|
+
if (options.temperature !== undefined) body["temperature"] = options.temperature;
|
|
104
|
+
if (options.chunkLength !== undefined) body["chunk_length"] = options.chunkLength;
|
|
105
|
+
if (options.opusBitrate !== undefined) body["opus_bitrate"] = options.opusBitrate;
|
|
106
|
+
body["reference_id"] = options.referenceId ?? "d7900c21663f485ab63ebdb7e5905036";
|
|
107
|
+
if (options.maxNewTokens !== undefined) body["max_new_tokens"] = options.maxNewTokens;
|
|
108
|
+
if (options.minChunkLength !== undefined) body["min_chunk_length"] = options.minChunkLength;
|
|
109
|
+
if (options.repetitionPenalty !== undefined) body["repetition_penalty"] = options.repetitionPenalty;
|
|
110
|
+
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
|
+
body[key] = value;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
116
|
+
body.async = options.async ?? true;
|
|
117
|
+
const result = (await this.transport.request('POST', "/fish/tts", { json: body })) as Record<string, unknown>;
|
|
118
|
+
const handle = new TaskHandle(taskId(result), "/fish/tasks", this.transport, result);
|
|
119
|
+
if (options.wait) {
|
|
120
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
121
|
+
}
|
|
122
|
+
return handle;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Fish Audio model creation API — upload reference audio to create a custom voice-clone model. */
|
|
126
|
+
async model(options: FishModelOptions): Promise<Record<string, unknown>> {
|
|
127
|
+
const body: Record<string, unknown> = {};
|
|
128
|
+
body["title"] = options.title;
|
|
129
|
+
body["voices"] = options.voices;
|
|
130
|
+
if (options.tags !== undefined) body["tags"] = options.tags;
|
|
131
|
+
if (options.texts !== undefined) body["texts"] = options.texts;
|
|
132
|
+
if (options.visibility !== undefined) body["visibility"] = options.visibility;
|
|
133
|
+
if (options.coverImage !== undefined) body["cover_image"] = options.coverImage;
|
|
134
|
+
if (options.description !== undefined) body["description"] = options.description;
|
|
135
|
+
if (options.generateSample !== undefined) body["generate_sample"] = options.generateSample;
|
|
136
|
+
if (options.enhanceAudioQuality !== undefined) body["enhance_audio_quality"] = options.enhanceAudioQuality;
|
|
137
|
+
for (const [key, value] of Object.entries(options)) {
|
|
138
|
+
if (!["async", "callbackUrl", "coverImage", "description", "enhanceAudioQuality", "generateSample", "maxWait", "pollInterval", "tags", "texts", "title", "visibility", "voices", "wait"].includes(key) && value !== undefined) {
|
|
139
|
+
body[key] = value;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
143
|
+
return (await this.transport.request('POST', "/fish/model", { json: body })) as Record<string, unknown>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flux (flux) — 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 FluxGenerateOptions {
|
|
20
|
+
/** Types of operations for generating images. If it is `generate`, a new image will be created based on the prompt; if it is `edit`, the original image will be edited according to the prompt and `image_url`. */
|
|
21
|
+
action: "generate" | "edit";
|
|
22
|
+
/** Prompts for generating images. */
|
|
23
|
+
prompt: string;
|
|
24
|
+
/** Image size specifications. */
|
|
25
|
+
size?: string;
|
|
26
|
+
/** Number of generated images. */
|
|
27
|
+
count?: number;
|
|
28
|
+
/** Model used for generating images. */
|
|
29
|
+
model?: "flux-dev" | "flux-pro" | "flux-kontext-pro" | "flux-kontext-max" | "flux-2-flex" | "flux-2-pro" | "flux-2-max" | "flux-2-klein";
|
|
30
|
+
/** Link to the original image that needs editing. */
|
|
31
|
+
imageUrl?: string;
|
|
32
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
33
|
+
async?: boolean;
|
|
34
|
+
/** Wait for completion before returning the handle. */
|
|
35
|
+
wait?: boolean;
|
|
36
|
+
pollInterval?: number;
|
|
37
|
+
maxWait?: number;
|
|
38
|
+
callbackUrl?: string;
|
|
39
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** flux client. */
|
|
44
|
+
export class Flux {
|
|
45
|
+
constructor(private transport: Transport) {}
|
|
46
|
+
|
|
47
|
+
/** Flux AI image generation API, generates 1 image per request. */
|
|
48
|
+
async generate(options: FluxGenerateOptions): Promise<TaskHandle> {
|
|
49
|
+
const body: Record<string, unknown> = {};
|
|
50
|
+
body["action"] = options.action;
|
|
51
|
+
body["prompt"] = options.prompt;
|
|
52
|
+
body["size"] = options.size ?? "1024x1024";
|
|
53
|
+
if (options.count !== undefined) body["count"] = options.count;
|
|
54
|
+
if (options.model !== undefined) body["model"] = options.model;
|
|
55
|
+
if (options.imageUrl !== undefined) body["image_url"] = options.imageUrl;
|
|
56
|
+
for (const [key, value] of Object.entries(options)) {
|
|
57
|
+
if (!["action", "async", "callbackUrl", "count", "imageUrl", "maxWait", "model", "pollInterval", "prompt", "size", "wait"].includes(key) && value !== undefined) {
|
|
58
|
+
body[key] = value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
62
|
+
body.async = options.async ?? true;
|
|
63
|
+
const result = (await this.transport.request('POST', "/flux/images", { json: body })) as Record<string, unknown>;
|
|
64
|
+
const handle = new TaskHandle(taskId(result), "/flux/tasks", this.transport, result);
|
|
65
|
+
if (options.wait) {
|
|
66
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
67
|
+
}
|
|
68
|
+
return handle;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hailuo (hailuo) — 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 HailuoGenerateOptions {
|
|
20
|
+
/** The operation type for video generation. When set to `generate`, it will generate a video based on the prompt. */
|
|
21
|
+
action: "generate";
|
|
22
|
+
/** The model used for generating videos has a default value of `minimax-t2v`. */
|
|
23
|
+
model?: "minimax-i2v" | "minimax-t2v" | "minimax-i2v-director";
|
|
24
|
+
/** Prompts for generating videos. */
|
|
25
|
+
prompt?: string;
|
|
26
|
+
/** You can specify the URL of the first frame image to generate a video from the image. */
|
|
27
|
+
firstImageUrl?: string;
|
|
28
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
29
|
+
async?: boolean;
|
|
30
|
+
/** Wait for completion before returning the handle. */
|
|
31
|
+
wait?: boolean;
|
|
32
|
+
pollInterval?: number;
|
|
33
|
+
maxWait?: number;
|
|
34
|
+
callbackUrl?: string;
|
|
35
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** hailuo client. */
|
|
40
|
+
export class Hailuo {
|
|
41
|
+
constructor(private transport: Transport) {}
|
|
42
|
+
|
|
43
|
+
/** Minimax Hailuo AI video generation API. Supports minimax-t2v for text-to-video, minimax-i2v for image-to-video, and minimax-i2v-director for director mode with camera/movement instructions. */
|
|
44
|
+
async generate(options: HailuoGenerateOptions): Promise<TaskHandle> {
|
|
45
|
+
const body: Record<string, unknown> = {};
|
|
46
|
+
body["action"] = options.action;
|
|
47
|
+
if (options.model !== undefined) body["model"] = options.model;
|
|
48
|
+
body["prompt"] = options.prompt ?? "\u706b\u6c14";
|
|
49
|
+
if (options.firstImageUrl !== undefined) body["first_image_url"] = options.firstImageUrl;
|
|
50
|
+
for (const [key, value] of Object.entries(options)) {
|
|
51
|
+
if (!["action", "async", "callbackUrl", "firstImageUrl", "maxWait", "model", "pollInterval", "prompt", "wait"].includes(key) && value !== undefined) {
|
|
52
|
+
body[key] = value;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
56
|
+
body.async = options.async ?? true;
|
|
57
|
+
const result = (await this.transport.request('POST', "/hailuo/videos", { json: body })) as Record<string, unknown>;
|
|
58
|
+
const handle = new TaskHandle(taskId(result), "/hailuo/tasks", this.transport, result);
|
|
59
|
+
if (options.wait) {
|
|
60
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
61
|
+
}
|
|
62
|
+
return handle;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Happyhorse (happyhorse) — 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 HappyhorseGenerateOptions {
|
|
20
|
+
/** Random seed, range 0–2147483647. */
|
|
21
|
+
seed?: number;
|
|
22
|
+
/** HappyHorse model name. Different actions only support the corresponding model family. */
|
|
23
|
+
model?: "happyhorse-1.0-t2v" | "happyhorse-1.1-t2v" | "happyhorse-1.0-i2v" | "happyhorse-1.1-i2v" | "happyhorse-1.0-r2v" | "happyhorse-1.1-r2v" | "happyhorse-1.0-video-edit";
|
|
24
|
+
/** Output video aspect ratio. Text-to-video and reference image-to-video support this parameter; the first frame image-to-video will follow the aspect ratio of the first frame image. */
|
|
25
|
+
ratio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
|
|
26
|
+
/** Operation types. `generate` is for generating video from text, `image_to_video` is for generating video from the first frame image, `reference_to_video` is for generating video from reference images, and `video_edit` is for video editing based on video and reference images. */
|
|
27
|
+
action?: "generate" | "image_to_video" | "reference_to_video" | "video_edit";
|
|
28
|
+
/** Text prompt words. Text-to-video, reference image to video, and video editing scenarios are required. */
|
|
29
|
+
prompt?: string;
|
|
30
|
+
/** Output video duration (seconds), value range 3–15. The output duration of `video_edit` is determined by the input video. */
|
|
31
|
+
duration?: number;
|
|
32
|
+
/** The input image URL for the first frame of the video. Only used by `image_to_video`. */
|
|
33
|
+
imageUrl?: string;
|
|
34
|
+
/** URL of the video to be edited. For `video_edit` use only. */
|
|
35
|
+
videoUrl?: string;
|
|
36
|
+
/** Whether to add the HappyHorse watermark. Default is off. */
|
|
37
|
+
watermark?: boolean;
|
|
38
|
+
/** Reference image URL array. `reference_to_video` supports 1–9 images, `video_edit` supports 0–5 images. */
|
|
39
|
+
imageUrls?: string[];
|
|
40
|
+
/** Output video resolution, optional 720P or 1080P. */
|
|
41
|
+
resolution?: "720P" | "1080P";
|
|
42
|
+
/** Audio strategy for video editing. `auto` is determined by the model, `origin` retains the original audio of the input video. */
|
|
43
|
+
audioSetting?: "auto" | "origin";
|
|
44
|
+
/** Submit asynchronously and poll. Defaults to true. */
|
|
45
|
+
async?: boolean;
|
|
46
|
+
/** Wait for completion before returning the handle. */
|
|
47
|
+
wait?: boolean;
|
|
48
|
+
pollInterval?: number;
|
|
49
|
+
maxWait?: number;
|
|
50
|
+
callbackUrl?: string;
|
|
51
|
+
/** Any parameter added upstream before the SDK is regenerated. */
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** happyhorse client. */
|
|
56
|
+
export class Happyhorse {
|
|
57
|
+
constructor(private transport: Transport) {}
|
|
58
|
+
|
|
59
|
+
/** Call /happyhorse/videos. */
|
|
60
|
+
async generate(options: HappyhorseGenerateOptions = {}): Promise<TaskHandle> {
|
|
61
|
+
const body: Record<string, unknown> = {};
|
|
62
|
+
if (options.seed !== undefined) body["seed"] = options.seed;
|
|
63
|
+
body["model"] = options.model ?? "happyhorse-1.1-t2v";
|
|
64
|
+
body["ratio"] = options.ratio ?? "16:9";
|
|
65
|
+
body["action"] = options.action ?? "generate";
|
|
66
|
+
body["prompt"] = options.prompt ?? "A cinematic white horse lifts its head, the mane moves gently in the sunrise wind, slow camera push in, warm film lighting";
|
|
67
|
+
body["duration"] = options.duration ?? 5;
|
|
68
|
+
body["image_url"] = options.imageUrl ?? "https://cdn.acedata.cloud/b1c82e4937.png";
|
|
69
|
+
body["video_url"] = options.videoUrl ?? "https://platform2.cdn.acedata.cloud/happyhorse/27837f92-d1c1-4db4-ad9a-4e6e81d9f6c1.mp4";
|
|
70
|
+
body["watermark"] = options.watermark ?? false;
|
|
71
|
+
if (options.imageUrls !== undefined) body["image_urls"] = options.imageUrls;
|
|
72
|
+
body["resolution"] = options.resolution ?? "1080P";
|
|
73
|
+
body["audio_setting"] = options.audioSetting ?? "auto";
|
|
74
|
+
for (const [key, value] of Object.entries(options)) {
|
|
75
|
+
if (!["action", "async", "audioSetting", "callbackUrl", "duration", "imageUrl", "imageUrls", "maxWait", "model", "pollInterval", "prompt", "ratio", "resolution", "seed", "videoUrl", "wait", "watermark"].includes(key) && value !== undefined) {
|
|
76
|
+
body[key] = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
|
|
80
|
+
body.async = options.async ?? true;
|
|
81
|
+
const result = (await this.transport.request('POST', "/happyhorse/videos", { json: body })) as Record<string, unknown>;
|
|
82
|
+
const handle = new TaskHandle(taskId(result), "/happyhorse/tasks", this.transport, result);
|
|
83
|
+
if (options.wait) {
|
|
84
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
85
|
+
}
|
|
86
|
+
return handle;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** Provider-axis clients, generated from the platform OpenAPI specs. */
|
|
2
|
+
|
|
3
|
+
export { Digitalhuman } from './digitalhuman';
|
|
4
|
+
export { Dreamina } from './dreamina';
|
|
5
|
+
export { Fish } from './fish';
|
|
6
|
+
export { Flux } from './flux';
|
|
7
|
+
export { Hailuo } from './hailuo';
|
|
8
|
+
export { Happyhorse } from './happyhorse';
|
|
9
|
+
export { Localization } from './localization';
|
|
10
|
+
export { Luma } from './luma';
|
|
11
|
+
export { Maestro } from './maestro';
|
|
12
|
+
export { NanoBanana } from './nano-banana';
|
|
13
|
+
export { Producer } from './producer';
|
|
14
|
+
export { Seedance } from './seedance';
|
|
15
|
+
export { Seedream } from './seedream';
|
|
16
|
+
export { Suno } from './suno';
|
|
17
|
+
export { Wan } from './wan';
|
|
18
|
+
|
|
19
|
+
import { Transport } from '../../runtime/transport';
|
|
20
|
+
import { Digitalhuman } from './digitalhuman';
|
|
21
|
+
import { Dreamina } from './dreamina';
|
|
22
|
+
import { Fish } from './fish';
|
|
23
|
+
import { Flux } from './flux';
|
|
24
|
+
import { Hailuo } from './hailuo';
|
|
25
|
+
import { Happyhorse } from './happyhorse';
|
|
26
|
+
import { Localization } from './localization';
|
|
27
|
+
import { Luma } from './luma';
|
|
28
|
+
import { Maestro } from './maestro';
|
|
29
|
+
import { NanoBanana } from './nano-banana';
|
|
30
|
+
import { Producer } from './producer';
|
|
31
|
+
import { Seedance } from './seedance';
|
|
32
|
+
import { Seedream } from './seedream';
|
|
33
|
+
import { Suno } from './suno';
|
|
34
|
+
import { Wan } from './wan';
|
|
35
|
+
|
|
36
|
+
/** Bind every generated provider client onto `client`. */
|
|
37
|
+
export function attachProviders(client: Record<string, unknown>, transport: Transport): void {
|
|
38
|
+
client.digitalhuman = new Digitalhuman(transport);
|
|
39
|
+
client.dreamina = new Dreamina(transport);
|
|
40
|
+
client.fish = new Fish(transport);
|
|
41
|
+
client.flux = new Flux(transport);
|
|
42
|
+
client.hailuo = new Hailuo(transport);
|
|
43
|
+
client.happyhorse = new Happyhorse(transport);
|
|
44
|
+
client.localization = new Localization(transport);
|
|
45
|
+
client.luma = new Luma(transport);
|
|
46
|
+
client.maestro = new Maestro(transport);
|
|
47
|
+
client.nanobanana = new NanoBanana(transport);
|
|
48
|
+
client.producer = new Producer(transport);
|
|
49
|
+
client.seedance = new Seedance(transport);
|
|
50
|
+
client.seedream = new Seedream(transport);
|
|
51
|
+
client.suno = new Suno(transport);
|
|
52
|
+
client.wan = new Wan(transport);
|
|
53
|
+
}
|