@runapi.ai/omnihuman 0.2.8

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # OmniHuman JavaScript SDK for RunAPI
2
+
3
+ The OmniHuman JavaScript SDK is the language-specific package for OmniHuman on RunAPI. Use this package for audio-driven talking-head video generation, human identification, and subject-mask detection when your application needs request bodies, task status lookup, and consistent RunAPI errors in JavaScript or TypeScript.
4
+
5
+ This README is the JavaScript package guide inside the public `omnihuman-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/omnihuman; for API reference, use https://runapi.ai/docs#omnihuman; for SDK docs, use https://runapi.ai/docs#sdk-omnihuman.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @runapi.ai/omnihuman
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```typescript
16
+ import { OmnihumanClient } from '@runapi.ai/omnihuman';
17
+
18
+ const client = new OmnihumanClient();
19
+ const task = await client.audioToVideo.create({
20
+ model: 'omnihuman-1.5',
21
+ source_image_url: 'https://cdn.runapi.ai/public/samples/portrait.jpg',
22
+ source_audio_url: 'https://cdn.runapi.ai/public/samples/voice.mp3',
23
+ output_resolution: '720p',
24
+ });
25
+ const status = await client.audioToVideo.get(task.id);
26
+ ```
27
+
28
+ Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
29
+
30
+ RunAPI-generated file URLs are temporary. Download and store generated videos, masks, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
31
+
32
+ ## Language notes
33
+
34
+ Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building video applications. The available resources are `audioToVideo`, `humanIdentification`, and `subjectDetection`. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
35
+
36
+ ## Links
37
+
38
+ - Model page: https://runapi.ai/models/omnihuman
39
+ - SDK docs: https://runapi.ai/docs#sdk-omnihuman
40
+ - Product docs: https://runapi.ai/docs#omnihuman
41
+ - Pricing and rate limits: https://runapi.ai/models/omnihuman/1.5
42
+ - Human identification: https://runapi.ai/models/omnihuman/1.5-human-identification
43
+ - Subject detection: https://runapi.ai/models/omnihuman/1.5-subject-detection
44
+ - Provider comparison: https://runapi.ai/providers/bytedance
45
+ - Full catalog: https://runapi.ai/models
46
+ - Repository: https://github.com/runapi-ai/omnihuman-sdk
47
+
48
+ ## License
49
+
50
+ Licensed under the Apache License, Version 2.0.
@@ -0,0 +1,142 @@
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
+ export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
+
4
+ type OmniHumanAudioToVideoModel = 'omnihuman-1.5';
5
+ type OmniHumanHumanIdentificationModel = 'omnihuman-1.5-human-identification';
6
+ type OmniHumanSubjectDetectionModel = 'omnihuman-1.5-subject-detection';
7
+ /** Output resolution. Defaults to 1080p. */
8
+ type OmniHumanOutputResolution = '720p' | '1080p';
9
+ /** Parameters for audio-to-video talking-head generation. */
10
+ interface AudioToVideoParams {
11
+ model: OmniHumanAudioToVideoModel;
12
+ /** Source image URL containing the target person. */
13
+ source_image_url: string;
14
+ /** Source audio URL that drives the generated motion and timing. */
15
+ source_audio_url: string;
16
+ /** Optional mask URLs from subject detection; at most 5 URLs. */
17
+ mask_urls?: string[];
18
+ /** Optional generation guidance prompt. Up to 1000 characters. */
19
+ prompt?: string;
20
+ /** Output resolution. Defaults to 1080p. */
21
+ output_resolution?: OmniHumanOutputResolution;
22
+ /** Enable faster generation mode when available. */
23
+ enable_fast_mode?: boolean;
24
+ /** Reproducibility seed. */
25
+ seed?: number;
26
+ /** URL for completion callback notifications. */
27
+ callback_url?: string;
28
+ }
29
+ /** Parameters for human identification helper requests. */
30
+ interface HumanIdentificationParams {
31
+ model: OmniHumanHumanIdentificationModel;
32
+ /** Source image URL to analyze for human regions. */
33
+ source_image_url: string;
34
+ /** URL for completion callback notifications. */
35
+ callback_url?: string;
36
+ }
37
+ /** Parameters for subject detection helper requests. */
38
+ interface SubjectDetectionParams {
39
+ model: OmniHumanSubjectDetectionModel;
40
+ /** Source image URL to analyze for subject masks. */
41
+ source_image_url: string;
42
+ /** URL for completion callback notifications. */
43
+ callback_url?: string;
44
+ }
45
+ interface TaskCreateResponse {
46
+ id: string;
47
+ status?: AsyncTaskStatus;
48
+ }
49
+ /** A generated video file with a download URL. */
50
+ interface Video {
51
+ url: string;
52
+ }
53
+ /** A returned mask file with a download URL. */
54
+ interface Mask {
55
+ url: string;
56
+ }
57
+ interface AudioToVideoResponse {
58
+ id: string;
59
+ status: AsyncTaskStatus;
60
+ videos?: Video[];
61
+ error?: string;
62
+ [key: string]: unknown;
63
+ }
64
+ type CompletedAudioToVideoResponse = AudioToVideoResponse & {
65
+ status: 'completed';
66
+ videos: Video[];
67
+ };
68
+ interface HumanIdentificationResponse {
69
+ id: string;
70
+ status: AsyncTaskStatus;
71
+ subject_status?: number;
72
+ error?: string;
73
+ [key: string]: unknown;
74
+ }
75
+ type CompletedHumanIdentificationResponse = HumanIdentificationResponse & {
76
+ status: 'completed';
77
+ subject_status: number;
78
+ };
79
+ interface SubjectDetectionResponse {
80
+ id: string;
81
+ status: AsyncTaskStatus;
82
+ masks?: Mask[];
83
+ error?: string;
84
+ [key: string]: unknown;
85
+ }
86
+ type CompletedSubjectDetectionResponse = SubjectDetectionResponse & {
87
+ status: 'completed';
88
+ masks: Mask[];
89
+ };
90
+
91
+ /** Generate a talking-head video from a source image and driving audio. */
92
+ declare class AudioToVideo {
93
+ private readonly http;
94
+ constructor(http: HttpClient);
95
+ run(params: AudioToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedAudioToVideoResponse>;
96
+ create(params: AudioToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
97
+ get(id: string, options?: RequestOptions): Promise<AudioToVideoResponse>;
98
+ }
99
+
100
+ /** Identify human regions in a source image before generation. */
101
+ declare class HumanIdentification {
102
+ private readonly http;
103
+ constructor(http: HttpClient);
104
+ run(params: HumanIdentificationParams, options?: RequestOptions & PollingOptions): Promise<CompletedHumanIdentificationResponse>;
105
+ create(params: HumanIdentificationParams, options?: RequestOptions): Promise<TaskCreateResponse>;
106
+ get(id: string, options?: RequestOptions): Promise<HumanIdentificationResponse>;
107
+ }
108
+
109
+ /** Detect subject masks in a source image before generation. */
110
+ declare class SubjectDetection {
111
+ private readonly http;
112
+ constructor(http: HttpClient);
113
+ run(params: SubjectDetectionParams, options?: RequestOptions & PollingOptions): Promise<CompletedSubjectDetectionResponse>;
114
+ create(params: SubjectDetectionParams, options?: RequestOptions): Promise<TaskCreateResponse>;
115
+ get(id: string, options?: RequestOptions): Promise<SubjectDetectionResponse>;
116
+ }
117
+
118
+ /**
119
+ * OmniHuman audio-to-video generation and helper endpoint API client.
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * const client = new OmnihumanClient({ apiKey: 'your-api-key' });
124
+ *
125
+ * const result = await client.audioToVideo.run({
126
+ * model: 'omnihuman-1.5',
127
+ * source_image_url: 'https://cdn.runapi.ai/public/samples/portrait.jpg',
128
+ * source_audio_url: 'https://cdn.runapi.ai/public/samples/voice.mp3',
129
+ * });
130
+ * ```
131
+ */
132
+ declare class OmnihumanClient extends BaseClient {
133
+ /** Generate a talking-head video from a source image and driving audio. */
134
+ readonly audioToVideo: AudioToVideo;
135
+ /** Identify human regions in a source image before generation. */
136
+ readonly humanIdentification: HumanIdentification;
137
+ /** Detect subject masks in a source image before generation. */
138
+ readonly subjectDetection: SubjectDetection;
139
+ constructor(options?: ClientOptions);
140
+ }
141
+
142
+ export { type AudioToVideoParams, type AudioToVideoResponse, type CompletedAudioToVideoResponse, type CompletedHumanIdentificationResponse, type CompletedSubjectDetectionResponse, type HumanIdentificationParams, type HumanIdentificationResponse, type Mask, type OmniHumanAudioToVideoModel, type OmniHumanHumanIdentificationModel, type OmniHumanOutputResolution, type OmniHumanSubjectDetectionModel, OmnihumanClient, type SubjectDetectionParams, type SubjectDetectionResponse, type TaskCreateResponse, type Video };
@@ -0,0 +1,142 @@
1
+ import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
+ export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
+
4
+ type OmniHumanAudioToVideoModel = 'omnihuman-1.5';
5
+ type OmniHumanHumanIdentificationModel = 'omnihuman-1.5-human-identification';
6
+ type OmniHumanSubjectDetectionModel = 'omnihuman-1.5-subject-detection';
7
+ /** Output resolution. Defaults to 1080p. */
8
+ type OmniHumanOutputResolution = '720p' | '1080p';
9
+ /** Parameters for audio-to-video talking-head generation. */
10
+ interface AudioToVideoParams {
11
+ model: OmniHumanAudioToVideoModel;
12
+ /** Source image URL containing the target person. */
13
+ source_image_url: string;
14
+ /** Source audio URL that drives the generated motion and timing. */
15
+ source_audio_url: string;
16
+ /** Optional mask URLs from subject detection; at most 5 URLs. */
17
+ mask_urls?: string[];
18
+ /** Optional generation guidance prompt. Up to 1000 characters. */
19
+ prompt?: string;
20
+ /** Output resolution. Defaults to 1080p. */
21
+ output_resolution?: OmniHumanOutputResolution;
22
+ /** Enable faster generation mode when available. */
23
+ enable_fast_mode?: boolean;
24
+ /** Reproducibility seed. */
25
+ seed?: number;
26
+ /** URL for completion callback notifications. */
27
+ callback_url?: string;
28
+ }
29
+ /** Parameters for human identification helper requests. */
30
+ interface HumanIdentificationParams {
31
+ model: OmniHumanHumanIdentificationModel;
32
+ /** Source image URL to analyze for human regions. */
33
+ source_image_url: string;
34
+ /** URL for completion callback notifications. */
35
+ callback_url?: string;
36
+ }
37
+ /** Parameters for subject detection helper requests. */
38
+ interface SubjectDetectionParams {
39
+ model: OmniHumanSubjectDetectionModel;
40
+ /** Source image URL to analyze for subject masks. */
41
+ source_image_url: string;
42
+ /** URL for completion callback notifications. */
43
+ callback_url?: string;
44
+ }
45
+ interface TaskCreateResponse {
46
+ id: string;
47
+ status?: AsyncTaskStatus;
48
+ }
49
+ /** A generated video file with a download URL. */
50
+ interface Video {
51
+ url: string;
52
+ }
53
+ /** A returned mask file with a download URL. */
54
+ interface Mask {
55
+ url: string;
56
+ }
57
+ interface AudioToVideoResponse {
58
+ id: string;
59
+ status: AsyncTaskStatus;
60
+ videos?: Video[];
61
+ error?: string;
62
+ [key: string]: unknown;
63
+ }
64
+ type CompletedAudioToVideoResponse = AudioToVideoResponse & {
65
+ status: 'completed';
66
+ videos: Video[];
67
+ };
68
+ interface HumanIdentificationResponse {
69
+ id: string;
70
+ status: AsyncTaskStatus;
71
+ subject_status?: number;
72
+ error?: string;
73
+ [key: string]: unknown;
74
+ }
75
+ type CompletedHumanIdentificationResponse = HumanIdentificationResponse & {
76
+ status: 'completed';
77
+ subject_status: number;
78
+ };
79
+ interface SubjectDetectionResponse {
80
+ id: string;
81
+ status: AsyncTaskStatus;
82
+ masks?: Mask[];
83
+ error?: string;
84
+ [key: string]: unknown;
85
+ }
86
+ type CompletedSubjectDetectionResponse = SubjectDetectionResponse & {
87
+ status: 'completed';
88
+ masks: Mask[];
89
+ };
90
+
91
+ /** Generate a talking-head video from a source image and driving audio. */
92
+ declare class AudioToVideo {
93
+ private readonly http;
94
+ constructor(http: HttpClient);
95
+ run(params: AudioToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedAudioToVideoResponse>;
96
+ create(params: AudioToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
97
+ get(id: string, options?: RequestOptions): Promise<AudioToVideoResponse>;
98
+ }
99
+
100
+ /** Identify human regions in a source image before generation. */
101
+ declare class HumanIdentification {
102
+ private readonly http;
103
+ constructor(http: HttpClient);
104
+ run(params: HumanIdentificationParams, options?: RequestOptions & PollingOptions): Promise<CompletedHumanIdentificationResponse>;
105
+ create(params: HumanIdentificationParams, options?: RequestOptions): Promise<TaskCreateResponse>;
106
+ get(id: string, options?: RequestOptions): Promise<HumanIdentificationResponse>;
107
+ }
108
+
109
+ /** Detect subject masks in a source image before generation. */
110
+ declare class SubjectDetection {
111
+ private readonly http;
112
+ constructor(http: HttpClient);
113
+ run(params: SubjectDetectionParams, options?: RequestOptions & PollingOptions): Promise<CompletedSubjectDetectionResponse>;
114
+ create(params: SubjectDetectionParams, options?: RequestOptions): Promise<TaskCreateResponse>;
115
+ get(id: string, options?: RequestOptions): Promise<SubjectDetectionResponse>;
116
+ }
117
+
118
+ /**
119
+ * OmniHuman audio-to-video generation and helper endpoint API client.
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * const client = new OmnihumanClient({ apiKey: 'your-api-key' });
124
+ *
125
+ * const result = await client.audioToVideo.run({
126
+ * model: 'omnihuman-1.5',
127
+ * source_image_url: 'https://cdn.runapi.ai/public/samples/portrait.jpg',
128
+ * source_audio_url: 'https://cdn.runapi.ai/public/samples/voice.mp3',
129
+ * });
130
+ * ```
131
+ */
132
+ declare class OmnihumanClient extends BaseClient {
133
+ /** Generate a talking-head video from a source image and driving audio. */
134
+ readonly audioToVideo: AudioToVideo;
135
+ /** Identify human regions in a source image before generation. */
136
+ readonly humanIdentification: HumanIdentification;
137
+ /** Detect subject masks in a source image before generation. */
138
+ readonly subjectDetection: SubjectDetection;
139
+ constructor(options?: ClientOptions);
140
+ }
141
+
142
+ export { type AudioToVideoParams, type AudioToVideoResponse, type CompletedAudioToVideoResponse, type CompletedHumanIdentificationResponse, type CompletedSubjectDetectionResponse, type HumanIdentificationParams, type HumanIdentificationResponse, type Mask, type OmniHumanAudioToVideoModel, type OmniHumanHumanIdentificationModel, type OmniHumanOutputResolution, type OmniHumanSubjectDetectionModel, OmnihumanClient, type SubjectDetectionParams, type SubjectDetectionResponse, type TaskCreateResponse, type Video };
package/dist/index.js ADDED
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ AuthenticationError: () => import_core5.AuthenticationError,
24
+ InsufficientCreditsError: () => import_core5.InsufficientCreditsError,
25
+ NetworkError: () => import_core5.NetworkError,
26
+ NotFoundError: () => import_core5.NotFoundError,
27
+ OmnihumanClient: () => OmnihumanClient,
28
+ RateLimitError: () => import_core5.RateLimitError,
29
+ RunApiError: () => import_core5.RunApiError,
30
+ ServiceUnavailableError: () => import_core5.ServiceUnavailableError,
31
+ TaskFailedError: () => import_core5.TaskFailedError,
32
+ TaskTimeoutError: () => import_core5.TaskTimeoutError,
33
+ TimeoutError: () => import_core5.TimeoutError,
34
+ ValidationError: () => import_core5.ValidationError
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // src/client.ts
39
+ var import_core4 = require("@runapi.ai/core");
40
+
41
+ // src/resources/audio-to-video.ts
42
+ var import_core = require("@runapi.ai/core");
43
+ var import_internal = require("@runapi.ai/core/internal");
44
+
45
+ // src/contract_gen.ts
46
+ var contract = {
47
+ "audio-to-video": {
48
+ "models": [
49
+ "omnihuman-1.5"
50
+ ],
51
+ "fields_by_model": {
52
+ "omnihuman-1.5": {
53
+ "output_resolution": {
54
+ "enum": [
55
+ "720p",
56
+ "1080p"
57
+ ]
58
+ },
59
+ "prompt": {
60
+ "max": 1e3,
61
+ "length": true
62
+ },
63
+ "seed": {
64
+ "type": "integer"
65
+ },
66
+ "source_audio_url": {
67
+ "required": true
68
+ },
69
+ "source_image_url": {
70
+ "required": true
71
+ }
72
+ }
73
+ }
74
+ },
75
+ "human-identification": {
76
+ "models": [
77
+ "omnihuman-1.5-human-identification"
78
+ ],
79
+ "fields_by_model": {
80
+ "omnihuman-1.5-human-identification": {
81
+ "source_image_url": {
82
+ "required": true
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "subject-detection": {
88
+ "models": [
89
+ "omnihuman-1.5-subject-detection"
90
+ ],
91
+ "fields_by_model": {
92
+ "omnihuman-1.5-subject-detection": {
93
+ "source_image_url": {
94
+ "required": true
95
+ }
96
+ }
97
+ }
98
+ }
99
+ };
100
+
101
+ // src/resources/audio-to-video.ts
102
+ var ENDPOINT = "/api/v1/omnihuman/audio_to_video";
103
+ var AudioToVideo = class {
104
+ constructor(http) {
105
+ this.http = http;
106
+ }
107
+ http;
108
+ async run(params, options) {
109
+ const { id } = await this.create(params, options);
110
+ const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
111
+ maxWaitMs: options?.maxWaitMs,
112
+ pollIntervalMs: options?.pollIntervalMs
113
+ });
114
+ return response;
115
+ }
116
+ async create(params, options) {
117
+ const body = (0, import_core.compactParams)(params);
118
+ (0, import_core.validateParams)(contract["audio-to-video"], body);
119
+ return this.http.request("POST", ENDPOINT, {
120
+ body,
121
+ ...options
122
+ });
123
+ }
124
+ async get(id, options) {
125
+ return this.http.request("GET", `${ENDPOINT}/${id}`, options ?? {});
126
+ }
127
+ };
128
+
129
+ // src/resources/human-identification.ts
130
+ var import_core2 = require("@runapi.ai/core");
131
+ var import_internal2 = require("@runapi.ai/core/internal");
132
+ var ENDPOINT2 = "/api/v1/omnihuman/human_identification";
133
+ var HumanIdentification = class {
134
+ constructor(http) {
135
+ this.http = http;
136
+ }
137
+ http;
138
+ async run(params, options) {
139
+ const { id } = await this.create(params, options);
140
+ const response = await (0, import_internal2.pollUntilComplete)(() => this.get(id, options), {
141
+ maxWaitMs: options?.maxWaitMs,
142
+ pollIntervalMs: options?.pollIntervalMs
143
+ });
144
+ return response;
145
+ }
146
+ async create(params, options) {
147
+ const body = (0, import_core2.compactParams)(params);
148
+ (0, import_core2.validateParams)(contract["human-identification"], body);
149
+ return this.http.request("POST", ENDPOINT2, {
150
+ body,
151
+ ...options
152
+ });
153
+ }
154
+ async get(id, options) {
155
+ return this.http.request("GET", `${ENDPOINT2}/${id}`, options ?? {});
156
+ }
157
+ };
158
+
159
+ // src/resources/subject-detection.ts
160
+ var import_core3 = require("@runapi.ai/core");
161
+ var import_internal3 = require("@runapi.ai/core/internal");
162
+ var ENDPOINT3 = "/api/v1/omnihuman/subject_detection";
163
+ var SubjectDetection = class {
164
+ constructor(http) {
165
+ this.http = http;
166
+ }
167
+ http;
168
+ async run(params, options) {
169
+ const { id } = await this.create(params, options);
170
+ const response = await (0, import_internal3.pollUntilComplete)(() => this.get(id, options), {
171
+ maxWaitMs: options?.maxWaitMs,
172
+ pollIntervalMs: options?.pollIntervalMs
173
+ });
174
+ return response;
175
+ }
176
+ async create(params, options) {
177
+ const body = (0, import_core3.compactParams)(params);
178
+ (0, import_core3.validateParams)(contract["subject-detection"], body);
179
+ return this.http.request("POST", ENDPOINT3, {
180
+ body,
181
+ ...options
182
+ });
183
+ }
184
+ async get(id, options) {
185
+ return this.http.request("GET", `${ENDPOINT3}/${id}`, options ?? {});
186
+ }
187
+ };
188
+
189
+ // src/client.ts
190
+ var OmnihumanClient = class extends import_core4.BaseClient {
191
+ /** Generate a talking-head video from a source image and driving audio. */
192
+ audioToVideo;
193
+ /** Identify human regions in a source image before generation. */
194
+ humanIdentification;
195
+ /** Detect subject masks in a source image before generation. */
196
+ subjectDetection;
197
+ constructor(options = {}) {
198
+ super(options);
199
+ this.audioToVideo = new AudioToVideo(this.http);
200
+ this.humanIdentification = new HumanIdentification(this.http);
201
+ this.subjectDetection = new SubjectDetection(this.http);
202
+ }
203
+ };
204
+
205
+ // src/index.ts
206
+ var import_core5 = require("@runapi.ai/core");
207
+ // Annotate the CommonJS export names for ESM import in node:
208
+ 0 && (module.exports = {
209
+ AuthenticationError,
210
+ InsufficientCreditsError,
211
+ NetworkError,
212
+ NotFoundError,
213
+ OmnihumanClient,
214
+ RateLimitError,
215
+ RunApiError,
216
+ ServiceUnavailableError,
217
+ TaskFailedError,
218
+ TaskTimeoutError,
219
+ TimeoutError,
220
+ ValidationError
221
+ });
222
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/audio-to-video.ts","../src/contract_gen.ts","../src/resources/human-identification.ts","../src/resources/subject-detection.ts"],"sourcesContent":["export { OmnihumanClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { AudioToVideo } from './resources/audio-to-video';\nimport { HumanIdentification } from './resources/human-identification';\nimport { SubjectDetection } from './resources/subject-detection';\n\n/**\n * OmniHuman audio-to-video generation and helper endpoint API client.\n *\n * @example\n * ```typescript\n * const client = new OmnihumanClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.audioToVideo.run({\n * model: 'omnihuman-1.5',\n * source_image_url: 'https://cdn.runapi.ai/public/samples/portrait.jpg',\n * source_audio_url: 'https://cdn.runapi.ai/public/samples/voice.mp3',\n * });\n * ```\n */\nexport class OmnihumanClient extends BaseClient {\n /** Generate a talking-head video from a source image and driving audio. */\n public readonly audioToVideo: AudioToVideo;\n /** Identify human regions in a source image before generation. */\n public readonly humanIdentification: HumanIdentification;\n /** Detect subject masks in a source image before generation. */\n public readonly subjectDetection: SubjectDetection;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.audioToVideo = new AudioToVideo(this.http);\n this.humanIdentification = new HumanIdentification(this.http);\n this.subjectDetection = new SubjectDetection(this.http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n AudioToVideoParams,\n AudioToVideoResponse,\n CompletedAudioToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/omnihuman/audio_to_video';\n\n/** Generate a talking-head video from a source image and driving audio. */\nexport class AudioToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: AudioToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedAudioToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<AudioToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedAudioToVideoResponse;\n }\n\n async create(params: AudioToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['audio-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<AudioToVideoResponse> {\n return this.http.request<AudioToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export const contract = {\n \"audio-to-video\": {\n \"models\": [\n \"omnihuman-1.5\"\n ],\n \"fields_by_model\": {\n \"omnihuman-1.5\": {\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"prompt\": {\n \"max\": 1000,\n \"length\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_audio_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"human-identification\": {\n \"models\": [\n \"omnihuman-1.5-human-identification\"\n ],\n \"fields_by_model\": {\n \"omnihuman-1.5-human-identification\": {\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"subject-detection\": {\n \"models\": [\n \"omnihuman-1.5-subject-detection\"\n ],\n \"fields_by_model\": {\n \"omnihuman-1.5-subject-detection\": {\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedHumanIdentificationResponse,\n HumanIdentificationParams,\n HumanIdentificationResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/omnihuman/human_identification';\n\n/** Identify human regions in a source image before generation. */\nexport class HumanIdentification {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: HumanIdentificationParams, options?: RequestOptions & PollingOptions): Promise<CompletedHumanIdentificationResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<HumanIdentificationResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedHumanIdentificationResponse;\n }\n\n async create(params: HumanIdentificationParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['human-identification'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<HumanIdentificationResponse> {\n return this.http.request<HumanIdentificationResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedSubjectDetectionResponse,\n SubjectDetectionParams,\n SubjectDetectionResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/omnihuman/subject_detection';\n\n/** Detect subject masks in a source image before generation. */\nexport class SubjectDetection {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: SubjectDetectionParams, options?: RequestOptions & PollingOptions): Promise<CompletedSubjectDetectionResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<SubjectDetectionResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedSubjectDetectionResponse;\n }\n\n async create(params: SubjectDetectionParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['subject-detection'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<SubjectDetectionResponse> {\n return this.http.request<SubjectDetectionResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAA+C;;;ACC/C,kBAA8C;AAC9C,sBAAkC;;;ACF3B,IAAM,WAAW;AAAA,EACtB,kBAAkB;AAAA,IAChB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,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OAAO;AAChD,UAAM,WAAW,UAAM,oCAA4C,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MAC9F,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAAgC,SAAuD;AAClG,UAAM,WAAO,4BAAc,MAAM;AACjC,qCAAe,SAAS,mBAAmB,GAAmB,IAA+B;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAA6D;AACjF,WAAO,KAAK,KAAK,QAAkC,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EAC9F;AACF;;;AJnBO,IAAM,kBAAN,cAA8B,wBAAW;AAAA;AAAA,EAE9B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,sBAAsB,IAAI,oBAAoB,KAAK,IAAI;AAC5D,SAAK,mBAAmB,IAAI,iBAAiB,KAAK,IAAI;AAAA,EACxD;AACF;;;AD9BA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,196 @@
1
+ // src/client.ts
2
+ import { BaseClient } from "@runapi.ai/core";
3
+
4
+ // src/resources/audio-to-video.ts
5
+ import { compactParams, validateParams } from "@runapi.ai/core";
6
+ import { pollUntilComplete } from "@runapi.ai/core/internal";
7
+
8
+ // src/contract_gen.ts
9
+ var contract = {
10
+ "audio-to-video": {
11
+ "models": [
12
+ "omnihuman-1.5"
13
+ ],
14
+ "fields_by_model": {
15
+ "omnihuman-1.5": {
16
+ "output_resolution": {
17
+ "enum": [
18
+ "720p",
19
+ "1080p"
20
+ ]
21
+ },
22
+ "prompt": {
23
+ "max": 1e3,
24
+ "length": true
25
+ },
26
+ "seed": {
27
+ "type": "integer"
28
+ },
29
+ "source_audio_url": {
30
+ "required": true
31
+ },
32
+ "source_image_url": {
33
+ "required": true
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "human-identification": {
39
+ "models": [
40
+ "omnihuman-1.5-human-identification"
41
+ ],
42
+ "fields_by_model": {
43
+ "omnihuman-1.5-human-identification": {
44
+ "source_image_url": {
45
+ "required": true
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "subject-detection": {
51
+ "models": [
52
+ "omnihuman-1.5-subject-detection"
53
+ ],
54
+ "fields_by_model": {
55
+ "omnihuman-1.5-subject-detection": {
56
+ "source_image_url": {
57
+ "required": true
58
+ }
59
+ }
60
+ }
61
+ }
62
+ };
63
+
64
+ // src/resources/audio-to-video.ts
65
+ var ENDPOINT = "/api/v1/omnihuman/audio_to_video";
66
+ var AudioToVideo = class {
67
+ constructor(http) {
68
+ this.http = http;
69
+ }
70
+ http;
71
+ async run(params, options) {
72
+ const { id } = await this.create(params, options);
73
+ const response = await pollUntilComplete(() => this.get(id, options), {
74
+ maxWaitMs: options?.maxWaitMs,
75
+ pollIntervalMs: options?.pollIntervalMs
76
+ });
77
+ return response;
78
+ }
79
+ async create(params, options) {
80
+ const body = compactParams(params);
81
+ validateParams(contract["audio-to-video"], body);
82
+ return this.http.request("POST", ENDPOINT, {
83
+ body,
84
+ ...options
85
+ });
86
+ }
87
+ async get(id, options) {
88
+ return this.http.request("GET", `${ENDPOINT}/${id}`, options ?? {});
89
+ }
90
+ };
91
+
92
+ // src/resources/human-identification.ts
93
+ import { compactParams as compactParams2, validateParams as validateParams2 } from "@runapi.ai/core";
94
+ import { pollUntilComplete as pollUntilComplete2 } from "@runapi.ai/core/internal";
95
+ var ENDPOINT2 = "/api/v1/omnihuman/human_identification";
96
+ var HumanIdentification = class {
97
+ constructor(http) {
98
+ this.http = http;
99
+ }
100
+ http;
101
+ async run(params, options) {
102
+ const { id } = await this.create(params, options);
103
+ const response = await pollUntilComplete2(() => this.get(id, options), {
104
+ maxWaitMs: options?.maxWaitMs,
105
+ pollIntervalMs: options?.pollIntervalMs
106
+ });
107
+ return response;
108
+ }
109
+ async create(params, options) {
110
+ const body = compactParams2(params);
111
+ validateParams2(contract["human-identification"], body);
112
+ return this.http.request("POST", ENDPOINT2, {
113
+ body,
114
+ ...options
115
+ });
116
+ }
117
+ async get(id, options) {
118
+ return this.http.request("GET", `${ENDPOINT2}/${id}`, options ?? {});
119
+ }
120
+ };
121
+
122
+ // src/resources/subject-detection.ts
123
+ import { compactParams as compactParams3, validateParams as validateParams3 } from "@runapi.ai/core";
124
+ import { pollUntilComplete as pollUntilComplete3 } from "@runapi.ai/core/internal";
125
+ var ENDPOINT3 = "/api/v1/omnihuman/subject_detection";
126
+ var SubjectDetection = class {
127
+ constructor(http) {
128
+ this.http = http;
129
+ }
130
+ http;
131
+ async run(params, options) {
132
+ const { id } = await this.create(params, options);
133
+ const response = await pollUntilComplete3(() => this.get(id, options), {
134
+ maxWaitMs: options?.maxWaitMs,
135
+ pollIntervalMs: options?.pollIntervalMs
136
+ });
137
+ return response;
138
+ }
139
+ async create(params, options) {
140
+ const body = compactParams3(params);
141
+ validateParams3(contract["subject-detection"], body);
142
+ return this.http.request("POST", ENDPOINT3, {
143
+ body,
144
+ ...options
145
+ });
146
+ }
147
+ async get(id, options) {
148
+ return this.http.request("GET", `${ENDPOINT3}/${id}`, options ?? {});
149
+ }
150
+ };
151
+
152
+ // src/client.ts
153
+ var OmnihumanClient = class extends BaseClient {
154
+ /** Generate a talking-head video from a source image and driving audio. */
155
+ audioToVideo;
156
+ /** Identify human regions in a source image before generation. */
157
+ humanIdentification;
158
+ /** Detect subject masks in a source image before generation. */
159
+ subjectDetection;
160
+ constructor(options = {}) {
161
+ super(options);
162
+ this.audioToVideo = new AudioToVideo(this.http);
163
+ this.humanIdentification = new HumanIdentification(this.http);
164
+ this.subjectDetection = new SubjectDetection(this.http);
165
+ }
166
+ };
167
+
168
+ // src/index.ts
169
+ import {
170
+ RunApiError,
171
+ AuthenticationError,
172
+ InsufficientCreditsError,
173
+ NotFoundError,
174
+ ValidationError,
175
+ RateLimitError,
176
+ ServiceUnavailableError,
177
+ NetworkError,
178
+ TimeoutError,
179
+ TaskTimeoutError,
180
+ TaskFailedError
181
+ } from "@runapi.ai/core";
182
+ export {
183
+ AuthenticationError,
184
+ InsufficientCreditsError,
185
+ NetworkError,
186
+ NotFoundError,
187
+ OmnihumanClient,
188
+ RateLimitError,
189
+ RunApiError,
190
+ ServiceUnavailableError,
191
+ TaskFailedError,
192
+ TaskTimeoutError,
193
+ TimeoutError,
194
+ ValidationError
195
+ };
196
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/audio-to-video.ts","../src/contract_gen.ts","../src/resources/human-identification.ts","../src/resources/subject-detection.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { AudioToVideo } from './resources/audio-to-video';\nimport { HumanIdentification } from './resources/human-identification';\nimport { SubjectDetection } from './resources/subject-detection';\n\n/**\n * OmniHuman audio-to-video generation and helper endpoint API client.\n *\n * @example\n * ```typescript\n * const client = new OmnihumanClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.audioToVideo.run({\n * model: 'omnihuman-1.5',\n * source_image_url: 'https://cdn.runapi.ai/public/samples/portrait.jpg',\n * source_audio_url: 'https://cdn.runapi.ai/public/samples/voice.mp3',\n * });\n * ```\n */\nexport class OmnihumanClient extends BaseClient {\n /** Generate a talking-head video from a source image and driving audio. */\n public readonly audioToVideo: AudioToVideo;\n /** Identify human regions in a source image before generation. */\n public readonly humanIdentification: HumanIdentification;\n /** Detect subject masks in a source image before generation. */\n public readonly subjectDetection: SubjectDetection;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.audioToVideo = new AudioToVideo(this.http);\n this.humanIdentification = new HumanIdentification(this.http);\n this.subjectDetection = new SubjectDetection(this.http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n AudioToVideoParams,\n AudioToVideoResponse,\n CompletedAudioToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/omnihuman/audio_to_video';\n\n/** Generate a talking-head video from a source image and driving audio. */\nexport class AudioToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: AudioToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedAudioToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<AudioToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedAudioToVideoResponse;\n }\n\n async create(params: AudioToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['audio-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<AudioToVideoResponse> {\n return this.http.request<AudioToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export const contract = {\n \"audio-to-video\": {\n \"models\": [\n \"omnihuman-1.5\"\n ],\n \"fields_by_model\": {\n \"omnihuman-1.5\": {\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"prompt\": {\n \"max\": 1000,\n \"length\": true\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_audio_url\": {\n \"required\": true\n },\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"human-identification\": {\n \"models\": [\n \"omnihuman-1.5-human-identification\"\n ],\n \"fields_by_model\": {\n \"omnihuman-1.5-human-identification\": {\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n },\n \"subject-detection\": {\n \"models\": [\n \"omnihuman-1.5-subject-detection\"\n ],\n \"fields_by_model\": {\n \"omnihuman-1.5-subject-detection\": {\n \"source_image_url\": {\n \"required\": true\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedHumanIdentificationResponse,\n HumanIdentificationParams,\n HumanIdentificationResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/omnihuman/human_identification';\n\n/** Identify human regions in a source image before generation. */\nexport class HumanIdentification {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: HumanIdentificationParams, options?: RequestOptions & PollingOptions): Promise<CompletedHumanIdentificationResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<HumanIdentificationResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedHumanIdentificationResponse;\n }\n\n async create(params: HumanIdentificationParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['human-identification'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<HumanIdentificationResponse> {\n return this.http.request<HumanIdentificationResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedSubjectDetectionResponse,\n SubjectDetectionParams,\n SubjectDetectionResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/omnihuman/subject_detection';\n\n/** Detect subject masks in a source image before generation. */\nexport class SubjectDetection {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: SubjectDetectionParams, options?: RequestOptions & PollingOptions): Promise<CompletedSubjectDetectionResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<SubjectDetectionResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedSubjectDetectionResponse;\n }\n\n async create(params: SubjectDetectionParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['subject-detection'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<SubjectDetectionResponse> {\n return this.http.request<SubjectDetectionResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export { OmnihumanClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,kBAAsC;;;ACC/C,SAAS,eAAe,sBAAsB;AAC9C,SAAS,yBAAyB;;;ACF3B,IAAM,WAAW;AAAA,EACtB,kBAAkB;AAAA,IAChB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,iBAAiB;AAAA,QACf,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,UAAU;AAAA,UACR,OAAO;AAAA,UACP,UAAU;AAAA,QACZ;AAAA,Q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B,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAAgC,SAAuD;AAClG,UAAM,OAAOC,eAAc,MAAM;AACjC,IAAAC,gBAAe,SAAS,mBAAmB,GAAmB,IAA+B;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQH,WAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAA6D;AACjF,WAAO,KAAK,KAAK,QAAkC,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EAC9F;AACF;;;AJnBO,IAAM,kBAAN,cAA8B,WAAW;AAAA;AAAA,EAE9B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,sBAAsB,IAAI,oBAAoB,KAAK,IAAI;AAC5D,SAAK,mBAAmB,IAAI,iBAAiB,KAAK,IAAI;AAAA,EACxD;AACF;;;AK9BA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams","compactParams","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams"]}
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@runapi.ai/omnihuman",
3
+ "runapi": {
4
+ "slug": "omnihuman"
5
+ },
6
+ "version": "0.2.8",
7
+ "description": "RunAPI OmniHuman SDK for audio-to-video and image helper workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
8
+ "main": "./dist/index.js",
9
+ "module": "./dist/index.mjs",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "skills",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "engines": {
25
+ "node": ">=18.0.0"
26
+ },
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "test": "vitest run",
30
+ "typecheck": "tsc --noEmit",
31
+ "clean": "rm -rf dist"
32
+ },
33
+ "dependencies": {
34
+ "@runapi.ai/core": "^0.2.11"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^20.0.0",
38
+ "@vitest/coverage-v8": "^1.6.0",
39
+ "tsup": "^8.0.0",
40
+ "typescript": "^5.4.0",
41
+ "vitest": "^1.6.0"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "keywords": [
47
+ "runapi",
48
+ "runapi-ai",
49
+ "omnihuman",
50
+ "api",
51
+ "sdk",
52
+ "typescript",
53
+ "python",
54
+ "ruby",
55
+ "golang",
56
+ "java",
57
+ "maven",
58
+ "gradle",
59
+ "video-generation",
60
+ "audio-to-video",
61
+ "video-api",
62
+ "omnihuman-api"
63
+ ],
64
+ "author": "RunAPI",
65
+ "license": "Apache-2.0",
66
+ "homepage": "https://runapi.ai/models/omnihuman",
67
+ "repository": {
68
+ "type": "git",
69
+ "url": "git+https://github.com/runapi-ai/omnihuman-sdk.git"
70
+ },
71
+ "bugs": {
72
+ "url": "https://github.com/runapi-ai/omnihuman-sdk/issues"
73
+ }
74
+ }
@@ -0,0 +1,83 @@
1
+ <p align="center">
2
+ <a href="https://github.com/runapi-ai/omnihuman">
3
+ <h3 align="center">OmniHuman API Skill for RunAPI</h3>
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ Install this agent skill, inspect OmniHuman fields, then create audio-driven video and helper tasks through the RunAPI CLI.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://runapi.ai/models/omnihuman"><strong>Model Reference</strong></a> · <a href="https://github.com/runapi-ai/cli"><strong>CLI</strong></a> · <a href="https://github.com/runapi-ai/omnihuman-sdk"><strong>SDK</strong></a>
13
+ </p>
14
+
15
+ <div align="center">
16
+
17
+ [![skills.sh](https://www.skills.sh/b/runapi-ai/omnihuman)](https://www.skills.sh/runapi-ai/omnihuman/omnihuman)
18
+ [![ClawHub](https://img.shields.io/badge/ClawHub-runapi--omnihuman-111827)](https://clawhub.ai/runapi-ai/runapi-omnihuman)
19
+ [![License](https://img.shields.io/github/license/runapi-ai/omnihuman)](https://github.com/runapi-ai/omnihuman/blob/main/LICENSE)
20
+
21
+ </div>
22
+ <br/>
23
+
24
+ Create OmniHuman audio-to-video tasks and helper tasks for human identification and subject-mask detection through RunAPI. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents use OmniHuman through RunAPI.
25
+
26
+ The canonical agent file is `skills/omnihuman/SKILL.md`.
27
+
28
+ ## Variants
29
+
30
+ - Audio to video: generate talking-head video from a source image and driving audio with `runapi omnihuman audio-to-video`.
31
+ - Human identification: identify human regions in a source image with `runapi omnihuman human-identification`.
32
+ - Subject detection: detect subject masks in a source image with `runapi omnihuman subject-detection`.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ npx skills add runapi-ai/omnihuman -g
38
+ ```
39
+
40
+ Or paste this prompt to your AI agent:
41
+
42
+ ```text
43
+ Install the omnihuman skill for me:
44
+
45
+ 1. Clone https://github.com/runapi-ai/omnihuman
46
+ 2. Copy the skills/omnihuman/ directory into your
47
+ user-level skills directory.
48
+ 3. Verify that SKILL.md is present.
49
+ 4. Confirm the install path when done.
50
+ ```
51
+
52
+ ## Quick example
53
+
54
+ ```shell
55
+ runapi omnihuman human-identification --async --input-file identify-human.json
56
+ runapi omnihuman subject-detection --async --input-file detect-subject.json
57
+ runapi omnihuman audio-to-video --async --input-file audio-to-video.json
58
+ runapi wait <task-id> --service omnihuman --action audio-to-video
59
+ ```
60
+
61
+ ## Routing
62
+
63
+ - Model page: https://runapi.ai/models/omnihuman
64
+ - Product docs: https://runapi.ai/docs#omnihuman
65
+ - SDK docs: https://runapi.ai/docs#sdk-omnihuman
66
+ - SDK repository: https://github.com/runapi-ai/omnihuman-sdk
67
+ - Audio-to-video pricing and rate limits: https://runapi.ai/models/omnihuman/1.5
68
+ - Human-identification pricing and rate limits: https://runapi.ai/models/omnihuman/1.5-human-identification
69
+ - Subject-detection pricing and rate limits: https://runapi.ai/models/omnihuman/1.5-subject-detection
70
+ - Provider comparison: https://runapi.ai/providers/bytedance
71
+ - Browse all RunAPI models and skills: https://runapi.ai/models
72
+
73
+ ## Agent rules
74
+
75
+ - Integration work uses the target language SDK; one-off generation, manual smoke tests, debugging, or user-requested CLI runs use the RunAPI CLI skill: https://github.com/runapi-ai/cli-skill
76
+ - RunAPI-generated file URLs are temporary. Download and store generated videos, masks, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
77
+ - Keep API keys in `RUNAPI_API_KEY` or RunAPI CLI config; never commit secrets.
78
+ - Prefer `create`, `get`, and `run` JSON passthrough patterns instead of inventing flags for every model parameter.
79
+ - For pricing, rate-limit, and commercial-usage answers, link to the variant page rather than the repository README.
80
+
81
+ ## License
82
+
83
+ Licensed under the Apache License, Version 2.0.
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: omnihuman
3
+ description: Create OmniHuman audio-to-video tasks and helper tasks for human identification and subject-mask detection through RunAPI. Use when the user asks an agent to generate talking-head video from an image and audio file, identify human regions, or detect subject masks with OmniHuman. Default to the RunAPI CLI for one-off calls; use SDKs only when integrating RunAPI into an app or backend.
4
+ documentation: https://runapi.ai/models/omnihuman.md
5
+ provider_page: https://runapi.ai/providers/bytedance.md
6
+ catalog: https://runapi.ai/models.md
7
+ metadata:
8
+ openclaw:
9
+ homepage: https://runapi.ai/models/omnihuman
10
+ requires:
11
+ bins:
12
+ - runapi
13
+ install:
14
+ - kind: brew
15
+ formula: runapi-ai/tap/runapi
16
+ bins:
17
+ - runapi
18
+ envVars:
19
+ - name: RUNAPI_API_KEY
20
+ required: false
21
+ description: Optional RunAPI API key; agents should prefer environment auth or saved CLI config. Browser login is interactive only.
22
+ ---
23
+
24
+ # OmniHuman On RunAPI
25
+
26
+ Create OmniHuman audio-to-video tasks and helper tasks for human identification and subject-mask detection through RunAPI. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
27
+
28
+ ## Critical: Integration Runtime
29
+
30
+ - Integration work (app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production codebase) uses the **SDK integration path** for the target language.
31
+ - One-off generation, editing, transformation, manual smoke tests, debugging, or user-requested CLI runs use the **CLI path** with the `runapi` binary. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill.
32
+ - Never shell out to the `runapi` CLI as the production runtime integration layer.
33
+
34
+ ## SDK integration path
35
+
36
+ When integrating OmniHuman into an app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production workflow, start by checking the current SDK package and official usage. Confirm install commands, client methods (`create`, `get`, `run`), request fields, response shape, and error classes before using CLI help or raw HTTP examples. Use a RunAPI SDK package:
37
+
38
+ - JavaScript / TypeScript: `@runapi.ai/omnihuman`
39
+ - Python: `runapi-omnihuman`
40
+ - Ruby: `runapi-omnihuman`
41
+ - Go: `github.com/runapi-ai/omnihuman-sdk/go`
42
+ - Java: `ai.runapi:runapi-omnihuman`
43
+ - PHP: `runapi-ai/omnihuman`
44
+
45
+ ## Variants
46
+
47
+ - Audio to video: generate talking-head video from a source image and driving audio with `runapi omnihuman audio-to-video`.
48
+ - Human identification: identify human regions in a source image with `runapi omnihuman human-identification`.
49
+ - Subject detection: detect subject masks in a source image with `runapi omnihuman subject-detection`.
50
+
51
+ ## CLI path
52
+
53
+ The `runapi` binary is the one-off and manual testing runtime dependency. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill. 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.
54
+
55
+ Inspect the available commands and request fields with CLI help:
56
+
57
+ ```shell
58
+ runapi omnihuman --help
59
+ runapi omnihuman audio-to-video --help
60
+ runapi omnihuman human-identification --help
61
+ runapi omnihuman subject-detection --help
62
+ ```
63
+
64
+ Run one-off tasks:
65
+
66
+ ```shell
67
+ runapi omnihuman human-identification --input-file identify-human.json
68
+ runapi omnihuman subject-detection --input-file detect-subject.json
69
+ runapi omnihuman audio-to-video --input-file audio-to-video.json
70
+ ```
71
+
72
+ Submit asynchronously and poll separately:
73
+
74
+ ```shell
75
+ runapi omnihuman audio-to-video --async --input-file audio-to-video.json
76
+ runapi wait <task-id> --service omnihuman --action audio-to-video
77
+ ```
78
+
79
+ Use the same async pattern with `--action human-identification` or `--action subject-detection` for helper tasks.
80
+
81
+ Available commands: `audio-to-video`, `human-identification`, `subject-detection`.
82
+
83
+ ## Generated file storage
84
+
85
+ RunAPI-generated file URLs are temporary. Download and store generated videos, masks, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
86
+
87
+ ## References
88
+
89
+ - Model overview, pricing, and rate limits: https://runapi.ai/models/omnihuman.md
90
+ - Audio-to-video variant: https://runapi.ai/models/omnihuman/1.5.md
91
+ - Human-identification variant: https://runapi.ai/models/omnihuman/1.5-human-identification.md
92
+ - Subject-detection variant: https://runapi.ai/models/omnihuman/1.5-subject-detection.md
93
+ - Provider comparison: https://runapi.ai/providers/bytedance.md
94
+ - Full model catalog: https://runapi.ai/models.md