@runapi.ai/omnihuman 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -50,6 +50,9 @@ var contract = {
50
50
  ],
51
51
  "fields_by_model": {
52
52
  "omnihuman-1.5": {
53
+ "mask_urls": {
54
+ "max_items": 5
55
+ },
53
56
  "output_resolution": {
54
57
  "enum": [
55
58
  "720p",
package/dist/index.js.map CHANGED
@@ -1 +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,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,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,QACA,oBAAoB;AAAA,UA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K,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"]}
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 \"mask_urls\": {\n \"max_items\": 5\n },\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;AAA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I,QAAgC,SAAuF;AAC/H,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,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 CHANGED
@@ -13,6 +13,9 @@ var contract = {
13
13
  ],
14
14
  "fields_by_model": {
15
15
  "omnihuman-1.5": {
16
+ "mask_urls": {
17
+ "max_items": 5
18
+ },
16
19
  "output_resolution": {
17
20
  "enum": [
18
21
  "720p",
@@ -1 +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,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,wBAAwB;AAAA,IACtB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,sCAAsC;AAAA,QACpC,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,IACnB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,mCAAmC;AAAA,QACjC,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AD1CA,IAAM,WAAW;AAGV,IAAM,eAAN,MAAmB;AAAA,EACxB,YAA6B,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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"]}
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 \"mask_urls\": {\n \"max_items\": 5\n },\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,aAAa;AAAA,UACX,aAAa;AAAA,QACf;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,UAAU;AAAA,UACR,OAAO;AAAA,UACP,UAAU;AAAA,QACZ;AAAA,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAA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,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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "runapi": {
4
4
  "slug": "omnihuman"
5
5
  },
6
- "version": "0.2.8",
6
+ "version": "0.2.9",
7
7
  "description": "RunAPI OmniHuman SDK for audio-to-video and image helper workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
8
8
  "main": "./dist/index.js",
9
9
  "module": "./dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "clean": "rm -rf dist"
32
32
  },
33
33
  "dependencies": {
34
- "@runapi.ai/core": "^0.2.11"
34
+ "@runapi.ai/core": "^0.2.14"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.0.0",