vidspotai-shared 1.0.133 → 1.0.135
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/lib/globals/aiModels/providers/falVideo.d.ts +34 -0
- package/lib/globals/aiModels/providers/falVideo.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/falVideo.js +102 -0
- package/lib/globals/index.d.ts +1 -0
- package/lib/globals/index.d.ts.map +1 -1
- package/lib/globals/index.js +1 -0
- package/lib/globals/musicStudio.d.ts +90 -0
- package/lib/globals/musicStudio.d.ts.map +1 -0
- package/lib/globals/musicStudio.js +221 -0
- package/lib/globals/types.d.ts +10 -1
- package/lib/globals/types.d.ts.map +1 -1
- package/lib/globals/types.js +12 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.d.ts.map +1 -1
- package/lib/models/index.js +1 -0
- package/lib/models/musicJob.model.d.ts +73 -0
- package/lib/models/musicJob.model.d.ts.map +1 -0
- package/lib/models/musicJob.model.js +2 -0
- package/lib/services/aiGen/providers/fal/falMusic.service.d.ts +63 -0
- package/lib/services/aiGen/providers/fal/falMusic.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/fal/falMusic.service.js +310 -0
- package/lib/services/aiGen/providers/fal/falVideo.service.d.ts +39 -0
- package/lib/services/aiGen/providers/fal/falVideo.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/fal/falVideo.service.js +266 -0
- package/lib/services/aiGen/providers/fal/index.d.ts +1 -0
- package/lib/services/aiGen/providers/fal/index.d.ts.map +1 -1
- package/lib/services/aiGen/providers/fal/index.js +1 -0
- package/lib/services/firestore.service.d.ts +2 -0
- package/lib/services/firestore.service.d.ts.map +1 -1
- package/lib/services/firestore.service.js +3 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/music/index.d.ts +3 -0
- package/lib/services/music/index.d.ts.map +1 -0
- package/lib/services/music/index.js +18 -0
- package/lib/services/music/musicLyricWriter.d.ts +25 -0
- package/lib/services/music/musicLyricWriter.d.ts.map +1 -0
- package/lib/services/music/musicLyricWriter.js +58 -0
- package/lib/services/music/musicLyrics.d.ts +66 -0
- package/lib/services/music/musicLyrics.d.ts.map +1 -0
- package/lib/services/music/musicLyrics.js +258 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IModelSchema } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* fal.ai-HOSTED video generators — served by FalVideoService
|
|
4
|
+
* (services/aiGen/providers/fal/falVideo.service.ts) over fal's queue API.
|
|
5
|
+
*
|
|
6
|
+
* ─── Kling 4.0 / 4.0 Flash ────────────────────────────────────────────────
|
|
7
|
+
* Kling's native 4.0 API isn't available to us yet (kling.ai/dev/pricing
|
|
8
|
+
* 2026-10-27 lists it "Coming Soon"; resource packs don't cover it), so 4.0
|
|
9
|
+
* ships through fal. Endpoints (schemas pulled 2026-10-27 from
|
|
10
|
+
* fal.ai/api/openapi/queue/openapi.json?endpoint_id=…):
|
|
11
|
+
* fal-ai/kling-video/v4/text-to-video prompt|multi_prompt, 3–30s, 16:9/9:16/1:1/21:9, 720p|1080p
|
|
12
|
+
* fal-ai/kling-video/v4/image-to-video start_image_url (+end, ≤8 middle keyframes); ratio follows the frame
|
|
13
|
+
* fal-ai/kling-video/v4/reference-to-video ≤10 image_urls, ≤5 video_urls (30s total), @Image1/@Video1 citations
|
|
14
|
+
* fal-ai/kling-video/v4/flash/text-to-video 3–20s, 720p only
|
|
15
|
+
* fal-ai/kling-video/v4/flash/image-to-video
|
|
16
|
+
* `resolution` defaults to 1080p on fal — FalVideoService ALWAYS sends it so
|
|
17
|
+
* a std request can't silently bill at the 1080p rate.
|
|
18
|
+
* Native stereo audio is always on (no toggle) → listed in chains.ts AUDIO_MODELS
|
|
19
|
+
* rather than declaring an `audio` field.
|
|
20
|
+
*
|
|
21
|
+
* Pricing verified 2026-10-27 against https://api.fal.ai/v1/models/pricing:
|
|
22
|
+
* v4 text/image/reference-to-video $0.157 / output-second (720p base)
|
|
23
|
+
* v4 flash text/image-to-video $0.094 / output-second (720p only)
|
|
24
|
+
* 1080p = 1.5× (matches Kling's own preview units: 1.0 vs 1.5 units/s).
|
|
25
|
+
*
|
|
26
|
+
* Live-verified 2026-10-27 via FalVideoService: v4 text-to-video (5s 16:9
|
|
27
|
+
* 720p → 5.04s 1280x720 + stereo AAC, ~5 min) and v4 image-to-video (3s →
|
|
28
|
+
* 3.04s, ~6 min). The queue's status/result base is the OWNER app
|
|
29
|
+
* (`fal-ai/kling-video`), not the sub-endpoint — taken from status_url.
|
|
30
|
+
* With a reference VIDEO, fal (like Kling) bills 0.6× the rate on
|
|
31
|
+
* (output × 2) when input ≤ output, else (input + output) seconds.
|
|
32
|
+
*/
|
|
33
|
+
export declare const falVideoConfigs: Record<string, IModelSchema>;
|
|
34
|
+
//# sourceMappingURL=falVideo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"falVideo.d.ts","sourceRoot":"","sources":["../../../../src/globals/aiModels/providers/falVideo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAsExD,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.falVideoConfigs = void 0;
|
|
4
|
+
const range = (min, max) => Array.from({ length: max - min + 1 }, (_, i) => min + i);
|
|
5
|
+
/**
|
|
6
|
+
* fal.ai-HOSTED video generators — served by FalVideoService
|
|
7
|
+
* (services/aiGen/providers/fal/falVideo.service.ts) over fal's queue API.
|
|
8
|
+
*
|
|
9
|
+
* ─── Kling 4.0 / 4.0 Flash ────────────────────────────────────────────────
|
|
10
|
+
* Kling's native 4.0 API isn't available to us yet (kling.ai/dev/pricing
|
|
11
|
+
* 2026-10-27 lists it "Coming Soon"; resource packs don't cover it), so 4.0
|
|
12
|
+
* ships through fal. Endpoints (schemas pulled 2026-10-27 from
|
|
13
|
+
* fal.ai/api/openapi/queue/openapi.json?endpoint_id=…):
|
|
14
|
+
* fal-ai/kling-video/v4/text-to-video prompt|multi_prompt, 3–30s, 16:9/9:16/1:1/21:9, 720p|1080p
|
|
15
|
+
* fal-ai/kling-video/v4/image-to-video start_image_url (+end, ≤8 middle keyframes); ratio follows the frame
|
|
16
|
+
* fal-ai/kling-video/v4/reference-to-video ≤10 image_urls, ≤5 video_urls (30s total), @Image1/@Video1 citations
|
|
17
|
+
* fal-ai/kling-video/v4/flash/text-to-video 3–20s, 720p only
|
|
18
|
+
* fal-ai/kling-video/v4/flash/image-to-video
|
|
19
|
+
* `resolution` defaults to 1080p on fal — FalVideoService ALWAYS sends it so
|
|
20
|
+
* a std request can't silently bill at the 1080p rate.
|
|
21
|
+
* Native stereo audio is always on (no toggle) → listed in chains.ts AUDIO_MODELS
|
|
22
|
+
* rather than declaring an `audio` field.
|
|
23
|
+
*
|
|
24
|
+
* Pricing verified 2026-10-27 against https://api.fal.ai/v1/models/pricing:
|
|
25
|
+
* v4 text/image/reference-to-video $0.157 / output-second (720p base)
|
|
26
|
+
* v4 flash text/image-to-video $0.094 / output-second (720p only)
|
|
27
|
+
* 1080p = 1.5× (matches Kling's own preview units: 1.0 vs 1.5 units/s).
|
|
28
|
+
*
|
|
29
|
+
* Live-verified 2026-10-27 via FalVideoService: v4 text-to-video (5s 16:9
|
|
30
|
+
* 720p → 5.04s 1280x720 + stereo AAC, ~5 min) and v4 image-to-video (3s →
|
|
31
|
+
* 3.04s, ~6 min). The queue's status/result base is the OWNER app
|
|
32
|
+
* (`fal-ai/kling-video`), not the sub-endpoint — taken from status_url.
|
|
33
|
+
* With a reference VIDEO, fal (like Kling) bills 0.6× the rate on
|
|
34
|
+
* (output × 2) when input ≤ output, else (input + output) seconds.
|
|
35
|
+
*/
|
|
36
|
+
exports.falVideoConfigs = {
|
|
37
|
+
"fal-kling-v4.0": {
|
|
38
|
+
modelId: "fal-ai/kling-video/v4",
|
|
39
|
+
type: ["text-to-video", "image-to-video"],
|
|
40
|
+
tier: "T3",
|
|
41
|
+
fields: {
|
|
42
|
+
prompt: { required: true },
|
|
43
|
+
aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "21:9"] },
|
|
44
|
+
// Every integer 3–30 is legal; billed per delivered second.
|
|
45
|
+
duration: { allowedValues: range(3, 30), default: 5 },
|
|
46
|
+
// std→720p, pro→1080p (Kling's own equivalence). Explicit resolution wins.
|
|
47
|
+
mode: { allowedValues: ["std", "pro"] },
|
|
48
|
+
resolution: { allowedValues: ["720p", "1080p"], default: "720p" },
|
|
49
|
+
inputImageUrl: {}, // → start_image_url
|
|
50
|
+
lastFrameImageUrl: {}, // → end_image_url
|
|
51
|
+
referenceImageUrls: { max: 10 }, // → reference-to-video image_urls (@Image1…)
|
|
52
|
+
referenceVideoUrls: { max: 5 }, // → reference-to-video video_urls (@Video1…)
|
|
53
|
+
multiShot: {}, // → multi_prompt[] (≤512 chars/shot)
|
|
54
|
+
},
|
|
55
|
+
concurrentRequests: 5,
|
|
56
|
+
pollIntervalMs: 10000,
|
|
57
|
+
// 30s 1080p generations run long on fal's queue.
|
|
58
|
+
pollTimeoutMs: 30 * 60000,
|
|
59
|
+
cost: {
|
|
60
|
+
perSecondByResolution: { "720p": 0.157, "1080p": 0.2355 },
|
|
61
|
+
videoInputPerSecondByResolution: { "720p": 0.0942, "1080p": 0.1413 },
|
|
62
|
+
},
|
|
63
|
+
guidance: {
|
|
64
|
+
quality: 5,
|
|
65
|
+
speed: 3,
|
|
66
|
+
bestFor: "Kling's newest flagship: long single takes up to 30s, native stereo audio, up to 10 keyframes, and Omni reference (10 images + 5 videos cited as @Image1/@Video1). Best Kling for cinematic, multi-shot storytelling.",
|
|
67
|
+
notes: "Audio is always on and included in the price. 1080p costs 1.5× 720p. A reference video bills on input+output seconds. No 4K yet.",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
// GATED 2026-10-27: a live smoke test of both fal Flash endpoints
|
|
71
|
+
// (flash/text-to-video 3s 9:16, flash/image-to-video 3s) returned fal's
|
|
72
|
+
// canned schema-example clips (12s, 16:9, byte-identical file sizes
|
|
73
|
+
// 3478246 / 2953131) instead of a generation — Flash isn't really live on
|
|
74
|
+
// fal yet. Set KLING_V4_FLASH_LIVE=true (Doppler + Railway) only after a
|
|
75
|
+
// re-test returns a real clip at the requested duration/ratio.
|
|
76
|
+
"fal-kling-v4.0-flash": {
|
|
77
|
+
modelId: "fal-ai/kling-video/v4/flash",
|
|
78
|
+
type: ["text-to-video", "image-to-video"],
|
|
79
|
+
tier: "T2",
|
|
80
|
+
gatedByEnv: "KLING_V4_FLASH_LIVE",
|
|
81
|
+
fields: {
|
|
82
|
+
prompt: { required: true },
|
|
83
|
+
aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "21:9"] },
|
|
84
|
+
duration: { allowedValues: range(3, 20), default: 5 },
|
|
85
|
+
mode: { allowedValues: ["std"] },
|
|
86
|
+
resolution: { allowedValues: ["720p"], default: "720p" },
|
|
87
|
+
inputImageUrl: {}, // → start_image_url
|
|
88
|
+
},
|
|
89
|
+
concurrentRequests: 5,
|
|
90
|
+
pollIntervalMs: 10000,
|
|
91
|
+
pollTimeoutMs: 20 * 60000,
|
|
92
|
+
cost: {
|
|
93
|
+
perSecondByResolution: { "720p": 0.094 },
|
|
94
|
+
},
|
|
95
|
+
guidance: {
|
|
96
|
+
quality: 4,
|
|
97
|
+
speed: 5,
|
|
98
|
+
bestFor: "Fast, budget Kling 4.0: text or image to video up to 20s with native audio at 720p. Great for drafts, social clips and high-volume B-roll.",
|
|
99
|
+
notes: "720p only, no end frame or references. About 40% cheaper than Kling 4.0.",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
package/lib/globals/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/globals/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/globals/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
package/lib/globals/index.js
CHANGED
|
@@ -23,4 +23,5 @@ __exportStar(require("./ttsModels"), exports);
|
|
|
23
23
|
__exportStar(require("./types"), exports);
|
|
24
24
|
__exportStar(require("./unlimitedPlanFairUse"), exports);
|
|
25
25
|
__exportStar(require("./videoTools"), exports);
|
|
26
|
+
__exportStar(require("./musicStudio"), exports);
|
|
26
27
|
__exportStar(require("./posterExport"), exports);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Music Studio — the /ai-music-generator tool (async `musicJobs` + the
|
|
3
|
+
* MUSIC_JOBS worker). One catalog for every model and track operation the
|
|
4
|
+
* studio offers: provider app ids, what each model can do, length caps and
|
|
5
|
+
* provider pricing. The controller bills from here, the worker builds provider
|
|
6
|
+
* input from here, and the frontend mirrors the public parts (labels, caps)
|
|
7
|
+
* in its own constants.
|
|
8
|
+
*
|
|
9
|
+
* Pricing is fal's list price, verified 2026-10-25 against
|
|
10
|
+
* https://api.fal.ai/v1/models/pricing (Lyria 2 is Vertex's flat per-clip
|
|
11
|
+
* price — it stays on the existing Vertex path, see googleMusic.ts). Live
|
|
12
|
+
* generations measured the same day: MiniMax 2.5 51.8 s for a 51 s song,
|
|
13
|
+
* ACE-Step 20 s for 30 s, Lyria 3 16 s, ElevenLabs 8.9 s for 20 s.
|
|
14
|
+
*/
|
|
15
|
+
export type MusicModelKey = "minimax-music-2.5" | "minimax-music-2" | "elevenlabs-music" | "lyria-3" | "ace-step" | "diffrhythm" | "stable-audio-2.5" | "beatoven" | "cassetteai" | "google-lyria-2";
|
|
16
|
+
export interface MusicModelSpec {
|
|
17
|
+
key: MusicModelKey;
|
|
18
|
+
/** fal app id; `null` = served by the Vertex Lyria 2 path, not fal. */
|
|
19
|
+
falApp: string | null;
|
|
20
|
+
/** Can sing (lead + backing vocals). False = instrumental only. */
|
|
21
|
+
vocals: boolean;
|
|
22
|
+
/** Takes user-written lyrics. */
|
|
23
|
+
lyrics: boolean;
|
|
24
|
+
/** Needs lyrics to sing — the worker writes them from the prompt when absent. */
|
|
25
|
+
requiresLyrics: boolean;
|
|
26
|
+
/** Can produce a vocal-free track on request. */
|
|
27
|
+
instrumental: boolean;
|
|
28
|
+
/** Length bounds in seconds. `fixedSec` = the model picks/returns this length. */
|
|
29
|
+
minSec: number;
|
|
30
|
+
maxSec: number;
|
|
31
|
+
defaultSec: number;
|
|
32
|
+
fixedSec?: number;
|
|
33
|
+
/** Allowed lengths when the model only supports a few (DiffRhythm). */
|
|
34
|
+
allowedSec?: readonly number[];
|
|
35
|
+
/** USD cost: flat per generation, or per second of output. */
|
|
36
|
+
usdPerTrack?: number;
|
|
37
|
+
usdPerSecond?: number;
|
|
38
|
+
/** Max prompt length the provider accepts. */
|
|
39
|
+
maxPromptChars: number;
|
|
40
|
+
}
|
|
41
|
+
export declare const MUSIC_MODELS: Record<MusicModelKey, MusicModelSpec>;
|
|
42
|
+
export declare const MUSIC_MODEL_KEYS: MusicModelKey[];
|
|
43
|
+
export declare const DEFAULT_STUDIO_MODEL: MusicModelKey;
|
|
44
|
+
/** Operations on a track. `generate` and `convert` create one from scratch / from a recording. */
|
|
45
|
+
export type MusicJobOp = "generate" | "extend" | "remix" | "section" | "convert" | "stems";
|
|
46
|
+
/** fal apps behind the track operations. */
|
|
47
|
+
export declare const MUSIC_OP_APPS: {
|
|
48
|
+
readonly extend: "fal-ai/ace-step/audio-outpaint";
|
|
49
|
+
readonly remix: "fal-ai/ace-step/audio-to-audio";
|
|
50
|
+
readonly section: "fal-ai/ace-step/audio-inpaint";
|
|
51
|
+
readonly convert: "fal-ai/stable-audio-25/audio-to-audio";
|
|
52
|
+
readonly stems: "fal-ai/demucs";
|
|
53
|
+
readonly lyricSync: "fal-ai/elevenlabs/speech-to-text";
|
|
54
|
+
};
|
|
55
|
+
/** The six stems htdemucs_6s returns. */
|
|
56
|
+
export declare const MUSIC_STEMS: readonly ["vocals", "drums", "bass", "guitar", "piano", "other"];
|
|
57
|
+
export type MusicStemName = (typeof MUSIC_STEMS)[number];
|
|
58
|
+
export declare const MUSIC_LIMITS: {
|
|
59
|
+
/** Longest track any op will produce or accept. */
|
|
60
|
+
readonly maxTrackSec: 480;
|
|
61
|
+
/** ACE-Step outpaint adds at most this much per call. */
|
|
62
|
+
readonly maxExtendSec: 107;
|
|
63
|
+
readonly minExtendSec: 10;
|
|
64
|
+
/** ACE-Step works on (and inpaints within) the first 240 s of a track. */
|
|
65
|
+
readonly maxEditableSec: 240;
|
|
66
|
+
/** Hummed / uploaded recordings for `convert`. */
|
|
67
|
+
readonly maxConvertSec: 190;
|
|
68
|
+
readonly maxLyricsChars: 3500;
|
|
69
|
+
readonly maxPromptChars: 2000;
|
|
70
|
+
};
|
|
71
|
+
/** Length a generation will be billed and requested at for `model`. */
|
|
72
|
+
export declare function resolveMusicDuration(model: MusicModelSpec, requestedSec?: number): number;
|
|
73
|
+
export interface MusicCreditInput {
|
|
74
|
+
op: MusicJobOp;
|
|
75
|
+
modelKey?: MusicModelKey;
|
|
76
|
+
/** Generation length, extension length, or the source track's length (remix/section/stems). */
|
|
77
|
+
durationSec: number;
|
|
78
|
+
/** Will a lyric-sync pass run (vocal output)? */
|
|
79
|
+
withLyricSync?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Provider cost in USD for one music job. */
|
|
82
|
+
export declare function musicJobUsd({ op, modelKey, durationSec, withLyricSync }: MusicCreditInput): number;
|
|
83
|
+
/**
|
|
84
|
+
* Credits for one music job. Song generations use `floor` — the caller passes
|
|
85
|
+
* MIN_CREDITS_PER_IMAGE_OP for paid plans (cheap generations aren't billed as
|
|
86
|
+
* $1 ops) and leaves the standard floor for free accounts, exactly as the
|
|
87
|
+
* image controller does. Stem separation is a utility and floors at 1.
|
|
88
|
+
*/
|
|
89
|
+
export declare function musicJobCredits(input: MusicCreditInput, floor?: number): number;
|
|
90
|
+
//# sourceMappingURL=musicStudio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"musicStudio.d.ts","sourceRoot":"","sources":["../../src/globals/musicStudio.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,SAAS,GACT,UAAU,GACV,YAAY,GACZ,kBAAkB,GAClB,UAAU,GACV,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,aAAa,CAAC;IACnB,uEAAuE;IACvE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAC;IAChB,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,iFAAiF;IACjF,cAAc,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACj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aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,8CAA8C;AAC9C,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAalG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,GAAE,MAAgC,GAAG,MAAM,CAIxG"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MUSIC_LIMITS = exports.MUSIC_STEMS = exports.MUSIC_OP_APPS = exports.DEFAULT_STUDIO_MODEL = exports.MUSIC_MODEL_KEYS = exports.MUSIC_MODELS = void 0;
|
|
4
|
+
exports.resolveMusicDuration = resolveMusicDuration;
|
|
5
|
+
exports.musicJobUsd = musicJobUsd;
|
|
6
|
+
exports.musicJobCredits = musicJobCredits;
|
|
7
|
+
const helpers_1 = require("../utils/helpers");
|
|
8
|
+
const creditUnit_1 = require("./creditUnit");
|
|
9
|
+
exports.MUSIC_MODELS = {
|
|
10
|
+
"minimax-music-2.5": {
|
|
11
|
+
key: "minimax-music-2.5",
|
|
12
|
+
falApp: "fal-ai/minimax-music/v2.5",
|
|
13
|
+
vocals: true,
|
|
14
|
+
lyrics: true,
|
|
15
|
+
requiresLyrics: false, // lyrics_optimizer writes them
|
|
16
|
+
instrumental: true,
|
|
17
|
+
minSec: 30,
|
|
18
|
+
maxSec: 300,
|
|
19
|
+
defaultSec: 150,
|
|
20
|
+
fixedSec: 150, // length follows the lyrics; billed flat
|
|
21
|
+
usdPerTrack: 0.15,
|
|
22
|
+
maxPromptChars: 2000,
|
|
23
|
+
},
|
|
24
|
+
"minimax-music-2": {
|
|
25
|
+
key: "minimax-music-2",
|
|
26
|
+
falApp: "fal-ai/minimax-music/v2",
|
|
27
|
+
vocals: true,
|
|
28
|
+
lyrics: true,
|
|
29
|
+
requiresLyrics: true,
|
|
30
|
+
instrumental: false,
|
|
31
|
+
minSec: 30,
|
|
32
|
+
maxSec: 300,
|
|
33
|
+
defaultSec: 120,
|
|
34
|
+
fixedSec: 120,
|
|
35
|
+
usdPerTrack: 0.03,
|
|
36
|
+
maxPromptChars: 2000,
|
|
37
|
+
},
|
|
38
|
+
"elevenlabs-music": {
|
|
39
|
+
key: "elevenlabs-music",
|
|
40
|
+
falApp: "fal-ai/elevenlabs/music",
|
|
41
|
+
vocals: true,
|
|
42
|
+
lyrics: true,
|
|
43
|
+
requiresLyrics: false,
|
|
44
|
+
instrumental: true,
|
|
45
|
+
minSec: 10,
|
|
46
|
+
// Provider accepts 600 s; the studio's promise is "up to eight minutes".
|
|
47
|
+
maxSec: 480,
|
|
48
|
+
defaultSec: 120,
|
|
49
|
+
usdPerSecond: 0.6 / 60,
|
|
50
|
+
maxPromptChars: 4100,
|
|
51
|
+
},
|
|
52
|
+
"lyria-3": {
|
|
53
|
+
key: "lyria-3",
|
|
54
|
+
falApp: "fal-ai/lyria3",
|
|
55
|
+
vocals: true,
|
|
56
|
+
lyrics: true,
|
|
57
|
+
requiresLyrics: false,
|
|
58
|
+
instrumental: true,
|
|
59
|
+
minSec: 30,
|
|
60
|
+
maxSec: 30,
|
|
61
|
+
defaultSec: 30,
|
|
62
|
+
fixedSec: 30,
|
|
63
|
+
usdPerTrack: 0.04,
|
|
64
|
+
maxPromptChars: 5000,
|
|
65
|
+
},
|
|
66
|
+
"ace-step": {
|
|
67
|
+
key: "ace-step",
|
|
68
|
+
falApp: "fal-ai/ace-step",
|
|
69
|
+
vocals: true,
|
|
70
|
+
lyrics: true,
|
|
71
|
+
requiresLyrics: false, // prompt-to-audio writes tags + lyrics
|
|
72
|
+
instrumental: true,
|
|
73
|
+
minSec: 10,
|
|
74
|
+
maxSec: 240,
|
|
75
|
+
defaultSec: 120,
|
|
76
|
+
usdPerSecond: 0.0002,
|
|
77
|
+
maxPromptChars: 2000,
|
|
78
|
+
},
|
|
79
|
+
diffrhythm: {
|
|
80
|
+
key: "diffrhythm",
|
|
81
|
+
falApp: "fal-ai/diffrhythm",
|
|
82
|
+
vocals: true,
|
|
83
|
+
lyrics: true,
|
|
84
|
+
requiresLyrics: true,
|
|
85
|
+
instrumental: false,
|
|
86
|
+
minSec: 95,
|
|
87
|
+
maxSec: 285,
|
|
88
|
+
defaultSec: 95,
|
|
89
|
+
allowedSec: [95, 285],
|
|
90
|
+
usdPerSecond: 0.001,
|
|
91
|
+
maxPromptChars: 1000,
|
|
92
|
+
},
|
|
93
|
+
"stable-audio-2.5": {
|
|
94
|
+
key: "stable-audio-2.5",
|
|
95
|
+
falApp: "fal-ai/stable-audio-25/text-to-audio",
|
|
96
|
+
vocals: false,
|
|
97
|
+
lyrics: false,
|
|
98
|
+
requiresLyrics: false,
|
|
99
|
+
instrumental: true,
|
|
100
|
+
minSec: 10,
|
|
101
|
+
maxSec: 190,
|
|
102
|
+
defaultSec: 90,
|
|
103
|
+
usdPerTrack: 0.2,
|
|
104
|
+
maxPromptChars: 2000,
|
|
105
|
+
},
|
|
106
|
+
beatoven: {
|
|
107
|
+
key: "beatoven",
|
|
108
|
+
falApp: "beatoven/music-generation",
|
|
109
|
+
vocals: false,
|
|
110
|
+
lyrics: false,
|
|
111
|
+
requiresLyrics: false,
|
|
112
|
+
instrumental: true,
|
|
113
|
+
minSec: 10,
|
|
114
|
+
maxSec: 150,
|
|
115
|
+
defaultSec: 90,
|
|
116
|
+
usdPerTrack: 0.1,
|
|
117
|
+
maxPromptChars: 2000,
|
|
118
|
+
},
|
|
119
|
+
cassetteai: {
|
|
120
|
+
key: "cassetteai",
|
|
121
|
+
falApp: "cassetteai/music-generator",
|
|
122
|
+
vocals: false,
|
|
123
|
+
lyrics: false,
|
|
124
|
+
requiresLyrics: false,
|
|
125
|
+
instrumental: true,
|
|
126
|
+
minSec: 10,
|
|
127
|
+
maxSec: 180,
|
|
128
|
+
defaultSec: 60,
|
|
129
|
+
usdPerSecond: 0.02 / 60,
|
|
130
|
+
maxPromptChars: 2000,
|
|
131
|
+
},
|
|
132
|
+
"google-lyria-2": {
|
|
133
|
+
key: "google-lyria-2",
|
|
134
|
+
falApp: null,
|
|
135
|
+
vocals: false,
|
|
136
|
+
lyrics: false,
|
|
137
|
+
requiresLyrics: false,
|
|
138
|
+
instrumental: true,
|
|
139
|
+
minSec: 30,
|
|
140
|
+
maxSec: 30,
|
|
141
|
+
defaultSec: 30,
|
|
142
|
+
fixedSec: 30,
|
|
143
|
+
usdPerTrack: 0.06,
|
|
144
|
+
maxPromptChars: 2000,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
exports.MUSIC_MODEL_KEYS = Object.keys(exports.MUSIC_MODELS);
|
|
148
|
+
exports.DEFAULT_STUDIO_MODEL = "minimax-music-2.5";
|
|
149
|
+
/** fal apps behind the track operations. */
|
|
150
|
+
exports.MUSIC_OP_APPS = {
|
|
151
|
+
extend: "fal-ai/ace-step/audio-outpaint",
|
|
152
|
+
remix: "fal-ai/ace-step/audio-to-audio",
|
|
153
|
+
section: "fal-ai/ace-step/audio-inpaint",
|
|
154
|
+
convert: "fal-ai/stable-audio-25/audio-to-audio",
|
|
155
|
+
stems: "fal-ai/demucs",
|
|
156
|
+
lyricSync: "fal-ai/elevenlabs/speech-to-text",
|
|
157
|
+
};
|
|
158
|
+
/** The six stems htdemucs_6s returns. */
|
|
159
|
+
exports.MUSIC_STEMS = ["vocals", "drums", "bass", "guitar", "piano", "other"];
|
|
160
|
+
exports.MUSIC_LIMITS = {
|
|
161
|
+
/** Longest track any op will produce or accept. */
|
|
162
|
+
maxTrackSec: 480,
|
|
163
|
+
/** ACE-Step outpaint adds at most this much per call. */
|
|
164
|
+
maxExtendSec: 107,
|
|
165
|
+
minExtendSec: 10,
|
|
166
|
+
/** ACE-Step works on (and inpaints within) the first 240 s of a track. */
|
|
167
|
+
maxEditableSec: 240,
|
|
168
|
+
/** Hummed / uploaded recordings for `convert`. */
|
|
169
|
+
maxConvertSec: 190,
|
|
170
|
+
maxLyricsChars: 3500,
|
|
171
|
+
maxPromptChars: 2000,
|
|
172
|
+
};
|
|
173
|
+
/** USD rates for the track operations (per second of audio processed/produced). */
|
|
174
|
+
const OP_USD_PER_SECOND = {
|
|
175
|
+
extend: 0.0002,
|
|
176
|
+
remix: 0.0002,
|
|
177
|
+
section: 0.0002,
|
|
178
|
+
stems: 0.0007,
|
|
179
|
+
};
|
|
180
|
+
const CONVERT_USD = 0.2;
|
|
181
|
+
/** ElevenLabs Scribe pass that times the lyrics on vocal tracks. */
|
|
182
|
+
const LYRIC_SYNC_USD_PER_SECOND = 0.03 / 60;
|
|
183
|
+
/** Length a generation will be billed and requested at for `model`. */
|
|
184
|
+
function resolveMusicDuration(model, requestedSec) {
|
|
185
|
+
if (model.fixedSec)
|
|
186
|
+
return model.fixedSec;
|
|
187
|
+
const want = requestedSec ?? model.defaultSec;
|
|
188
|
+
if (model.allowedSec) {
|
|
189
|
+
return model.allowedSec.reduce((best, s) => (Math.abs(s - want) < Math.abs(best - want) ? s : best));
|
|
190
|
+
}
|
|
191
|
+
return Math.min(Math.max(Math.round(want), model.minSec), model.maxSec);
|
|
192
|
+
}
|
|
193
|
+
/** Provider cost in USD for one music job. */
|
|
194
|
+
function musicJobUsd({ op, modelKey, durationSec, withLyricSync }) {
|
|
195
|
+
const seconds = Math.max(1, Math.ceil(durationSec));
|
|
196
|
+
let usd;
|
|
197
|
+
if (op === "generate") {
|
|
198
|
+
const model = exports.MUSIC_MODELS[modelKey ?? exports.DEFAULT_STUDIO_MODEL];
|
|
199
|
+
usd = model.usdPerTrack ?? (model.usdPerSecond ?? 0) * seconds;
|
|
200
|
+
}
|
|
201
|
+
else if (op === "convert") {
|
|
202
|
+
usd = CONVERT_USD;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
usd = OP_USD_PER_SECOND[op] * seconds;
|
|
206
|
+
}
|
|
207
|
+
if (withLyricSync)
|
|
208
|
+
usd += LYRIC_SYNC_USD_PER_SECOND * seconds;
|
|
209
|
+
return usd;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Credits for one music job. Song generations use `floor` — the caller passes
|
|
213
|
+
* MIN_CREDITS_PER_IMAGE_OP for paid plans (cheap generations aren't billed as
|
|
214
|
+
* $1 ops) and leaves the standard floor for free accounts, exactly as the
|
|
215
|
+
* image controller does. Stem separation is a utility and floors at 1.
|
|
216
|
+
*/
|
|
217
|
+
function musicJobCredits(input, floor = creditUnit_1.MIN_CREDITS_PER_PAID_OP) {
|
|
218
|
+
const usd = musicJobUsd(input);
|
|
219
|
+
const opFloor = input.op === "stems" ? creditUnit_1.MIN_CREDITS_PER_UTILITY_OP : floor;
|
|
220
|
+
return (0, helpers_1.getCreditsFromCost)(usd, true, opFloor);
|
|
221
|
+
}
|
package/lib/globals/types.d.ts
CHANGED
|
@@ -191,7 +191,14 @@ export declare enum ERedisQueues {
|
|
|
191
191
|
* wait + a local ffmpeg pass, so it gets its own queue (and sits with the
|
|
192
192
|
* heavy queues in workerRoles).
|
|
193
193
|
*/
|
|
194
|
-
VIDEO_TOOL_JOBS = "video-tool-job-queue"
|
|
194
|
+
VIDEO_TOOL_JOBS = "video-tool-job-queue",
|
|
195
|
+
/**
|
|
196
|
+
* Music Studio — one job per /v1/music/jobs call: song generation (10
|
|
197
|
+
* models), extend / remix / section regeneration, recording-to-song, and
|
|
198
|
+
* stem separation, plus a lyric-sync pass on vocal tracks. Provider waits
|
|
199
|
+
* run up to a few minutes, so it gets its own queue.
|
|
200
|
+
*/
|
|
201
|
+
MUSIC_JOBS = "music-job-queue"
|
|
195
202
|
}
|
|
196
203
|
export declare const REDIS_QUEUES: ERedisQueues[];
|
|
197
204
|
/** X8 Social Suite — connected social platforms. Value = stable storage key. */
|
|
@@ -349,6 +356,8 @@ export declare enum ENotificationType {
|
|
|
349
356
|
IMAGE_FAILED = "image.failed",
|
|
350
357
|
UPSCALE_COMPLETED = "upscale.completed",
|
|
351
358
|
UPSCALE_FAILED = "upscale.failed",
|
|
359
|
+
MUSIC_COMPLETED = "music.completed",
|
|
360
|
+
MUSIC_FAILED = "music.failed",
|
|
352
361
|
CREDITS_LOW = "credits.low",
|
|
353
362
|
SUBSCRIPTION_RENEWED = "subscription.renewed",
|
|
354
363
|
SUBSCRIPTION_PAYMENT_FAILED = "subscription.paymentFailed",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/globals/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,cAAc,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,MAAM,EAAE,GAAG,EAAE,CAAC;CACf;AAED,oBAAY,eAAe;IACzB,MAAM,WAAW,CAAE,wCAAwC;IAC3D,WAAW,eAAe,CAAE,2DAA2D;IAGvF,SAAS,cAAc,CAAE,8CAA8C;IACvE,MAAM,WAAW,CAAE,+BAA+B;IAClD,mBAAmB,uBAAuB,CAAE,oEAAoE;IAChH,SAAS,cAAc;CACxB;AAED,oBAAY,iBAAiB;IAC3B,WAAW,eAAe,CAAE,qFAAqF;IACjH,SAAS,cAAc,CAAE,2FAA2F;IACpH,OAAO,YAAY,CAAE,kKAAkK;IACvL,MAAM,WAAW,CAAE,kEAAkE;IACrF,SAAS,cAAc,CAAE,sCAAsC;IAC/D;;;;;OAKG;IACH,SAAS,aAAa;IACtB;;;;;;OAMG;IACH,SAAS,cAAc;CACxB;AAMD,oBAAY,YAAY;IACtB,UAAU,oBAAoB;IAC9B,iJAAiJ;IACjJ,eAAe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ChB,MAAM,OAAO;IACb,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,KAAK,OAAO;IACZ,MAAM,OAAO;IACb,IAAI,OAAO;IACX,OAAO,OAAO;IACd,SAAS,OAAO;IAChB,IAAI,OAAO;IACX,UAAU,OAAO;CAClB;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,GAAG,SAAS;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,CAAC;CACf;AAED,eAAO,MAAM,oBAAoB;;;;iBAQ/B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;iBAQ5B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAiB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,yBAAyB;;;;iBAapC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;iBAEhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/lib/globals/types.js
CHANGED
|
@@ -193,6 +193,13 @@ var ERedisQueues;
|
|
|
193
193
|
* heavy queues in workerRoles).
|
|
194
194
|
*/
|
|
195
195
|
ERedisQueues["VIDEO_TOOL_JOBS"] = "video-tool-job-queue";
|
|
196
|
+
/**
|
|
197
|
+
* Music Studio — one job per /v1/music/jobs call: song generation (10
|
|
198
|
+
* models), extend / remix / section regeneration, recording-to-song, and
|
|
199
|
+
* stem separation, plus a lyric-sync pass on vocal tracks. Provider waits
|
|
200
|
+
* run up to a few minutes, so it gets its own queue.
|
|
201
|
+
*/
|
|
202
|
+
ERedisQueues["MUSIC_JOBS"] = "music-job-queue";
|
|
196
203
|
})(ERedisQueues || (exports.ERedisQueues = ERedisQueues = {}));
|
|
197
204
|
exports.REDIS_QUEUES = [
|
|
198
205
|
ERedisQueues.VIDEO_JOBS,
|
|
@@ -217,6 +224,7 @@ exports.REDIS_QUEUES = [
|
|
|
217
224
|
ERedisQueues.UPSCALE_IMAGE_JOBS,
|
|
218
225
|
ERedisQueues.UPSCALE_VIDEO_JOBS,
|
|
219
226
|
ERedisQueues.VIDEO_TOOL_JOBS,
|
|
227
|
+
ERedisQueues.MUSIC_JOBS,
|
|
220
228
|
];
|
|
221
229
|
/** X8 Social Suite — connected social platforms. Value = stable storage key. */
|
|
222
230
|
var ESocialProvider;
|
|
@@ -386,6 +394,8 @@ var ENotificationType;
|
|
|
386
394
|
ENotificationType["IMAGE_FAILED"] = "image.failed";
|
|
387
395
|
ENotificationType["UPSCALE_COMPLETED"] = "upscale.completed";
|
|
388
396
|
ENotificationType["UPSCALE_FAILED"] = "upscale.failed";
|
|
397
|
+
ENotificationType["MUSIC_COMPLETED"] = "music.completed";
|
|
398
|
+
ENotificationType["MUSIC_FAILED"] = "music.failed";
|
|
389
399
|
ENotificationType["CREDITS_LOW"] = "credits.low";
|
|
390
400
|
ENotificationType["SUBSCRIPTION_RENEWED"] = "subscription.renewed";
|
|
391
401
|
ENotificationType["SUBSCRIPTION_PAYMENT_FAILED"] = "subscription.paymentFailed";
|
|
@@ -405,6 +415,8 @@ exports.DEFAULT_NOTIFICATION_PREFERENCES = {
|
|
|
405
415
|
[ENotificationType.IMAGE_FAILED]: true,
|
|
406
416
|
[ENotificationType.UPSCALE_COMPLETED]: true,
|
|
407
417
|
[ENotificationType.UPSCALE_FAILED]: true,
|
|
418
|
+
[ENotificationType.MUSIC_COMPLETED]: true,
|
|
419
|
+
[ENotificationType.MUSIC_FAILED]: true,
|
|
408
420
|
[ENotificationType.CREDITS_LOW]: true,
|
|
409
421
|
[ENotificationType.SUBSCRIPTION_RENEWED]: true,
|
|
410
422
|
[ENotificationType.SUBSCRIPTION_PAYMENT_FAILED]: true,
|
package/lib/models/index.d.ts
CHANGED
|
@@ -23,5 +23,6 @@ export * from "./posterProject.model";
|
|
|
23
23
|
export * from "./upscale.model";
|
|
24
24
|
export * from "./klingElement.model";
|
|
25
25
|
export * from "./videoTool.model";
|
|
26
|
+
export * from "./musicJob.model";
|
|
26
27
|
export * from "./posterExport.model";
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
package/lib/models/index.js
CHANGED
|
@@ -39,4 +39,5 @@ __exportStar(require("./posterProject.model"), exports);
|
|
|
39
39
|
__exportStar(require("./upscale.model"), exports);
|
|
40
40
|
__exportStar(require("./klingElement.model"), exports);
|
|
41
41
|
__exportStar(require("./videoTool.model"), exports);
|
|
42
|
+
__exportStar(require("./musicJob.model"), exports);
|
|
42
43
|
__exportStar(require("./posterExport.model"), exports);
|