vidspotai-shared 1.0.124 → 1.0.126

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.
Files changed (153) hide show
  1. package/lib/globals/aiModels/enums.d.ts +38 -0
  2. package/lib/globals/aiModels/enums.d.ts.map +1 -1
  3. package/lib/globals/aiModels/enums.js +49 -1
  4. package/lib/globals/aiModels/index.d.ts.map +1 -1
  5. package/lib/globals/aiModels/index.js +2 -0
  6. package/lib/globals/aiModels/providers/alibaba.d.ts.map +1 -1
  7. package/lib/globals/aiModels/providers/alibaba.js +460 -53
  8. package/lib/globals/aiModels/providers/bytedance.d.ts.map +1 -1
  9. package/lib/globals/aiModels/providers/bytedance.js +221 -39
  10. package/lib/globals/aiModels/providers/google.d.ts.map +1 -1
  11. package/lib/globals/aiModels/providers/google.js +178 -32
  12. package/lib/globals/aiModels/providers/kling.d.ts.map +1 -1
  13. package/lib/globals/aiModels/providers/kling.js +86 -12
  14. package/lib/globals/aiModels/providers/minimax.d.ts.map +1 -1
  15. package/lib/globals/aiModels/providers/minimax.js +77 -0
  16. package/lib/globals/aiModels/providers/openai.d.ts.map +1 -1
  17. package/lib/globals/aiModels/providers/openai.js +12 -0
  18. package/lib/globals/aiModels/providers/pixverse.d.ts.map +1 -1
  19. package/lib/globals/aiModels/providers/pixverse.js +101 -28
  20. package/lib/globals/aiModels/providers/runway.d.ts.map +1 -1
  21. package/lib/globals/aiModels/providers/runway.js +450 -24
  22. package/lib/globals/aiModels/providers/xai.d.ts +4 -0
  23. package/lib/globals/aiModels/providers/xai.d.ts.map +1 -0
  24. package/lib/globals/aiModels/providers/xai.js +72 -0
  25. package/lib/globals/aiModels/tierHelpers.d.ts +10 -0
  26. package/lib/globals/aiModels/tierHelpers.d.ts.map +1 -1
  27. package/lib/globals/aiModels/tierHelpers.js +48 -7
  28. package/lib/globals/aiModels/types.d.ts +21 -0
  29. package/lib/globals/aiModels/types.d.ts.map +1 -1
  30. package/lib/models/image.model.d.ts +24 -0
  31. package/lib/models/image.model.d.ts.map +1 -1
  32. package/lib/models/image.model.js +12 -0
  33. package/lib/models/index.d.ts +1 -0
  34. package/lib/models/index.d.ts.map +1 -1
  35. package/lib/models/index.js +1 -0
  36. package/lib/models/klingElement.model.d.ts +52 -0
  37. package/lib/models/klingElement.model.d.ts.map +1 -0
  38. package/lib/models/klingElement.model.js +24 -0
  39. package/lib/models/user.model.d.ts +7 -1
  40. package/lib/models/user.model.d.ts.map +1 -1
  41. package/lib/models/video.model.d.ts +11 -0
  42. package/lib/models/video.model.d.ts.map +1 -1
  43. package/lib/schemas/videoPlan.schema.d.ts +88 -0
  44. package/lib/schemas/videoPlan.schema.d.ts.map +1 -1
  45. package/lib/schemas/videoPlan.schema.js +27 -1
  46. package/lib/services/agent/executor/visual.d.ts.map +1 -1
  47. package/lib/services/agent/executor/visual.js +40 -2
  48. package/lib/services/agent/mentionedRefs.d.ts.map +1 -1
  49. package/lib/services/agent/mentionedRefs.js +4 -1
  50. package/lib/services/agent/planner/structuralRules.d.ts.map +1 -1
  51. package/lib/services/agent/planner/structuralRules.js +8 -3
  52. package/lib/services/agent/poster/posterAgent.schema.d.ts +3 -3
  53. package/lib/services/agent/providerFallback/chains.d.ts +25 -0
  54. package/lib/services/agent/providerFallback/chains.d.ts.map +1 -1
  55. package/lib/services/agent/providerFallback/chains.js +59 -5
  56. package/lib/services/agent/repair/strategies/llmRepair.strategy.d.ts.map +1 -1
  57. package/lib/services/agent/repair/strategies/llmRepair.strategy.js +2 -0
  58. package/lib/services/agent/tools/animateImage.tool.d.ts +31 -0
  59. package/lib/services/agent/tools/animateImage.tool.d.ts.map +1 -1
  60. package/lib/services/agent/tools/animateImage.tool.js +10 -3
  61. package/lib/services/agent/tools/generateImage.tool.d.ts +8 -4
  62. package/lib/services/agent/tools/generateImage.tool.d.ts.map +1 -1
  63. package/lib/services/agent/tools/generateImage.tool.js +24 -7
  64. package/lib/services/agent/tools/generateVideo.tool.d.ts +32 -0
  65. package/lib/services/agent/tools/generateVideo.tool.d.ts.map +1 -1
  66. package/lib/services/agent/tools/generateVideo.tool.js +37 -9
  67. package/lib/services/agent/tools/planVideo.tool.d.ts +19 -0
  68. package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -1
  69. package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
  70. package/lib/services/aiGen/aiGenFactory.service.js +40 -0
  71. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts +6 -3
  72. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts.map +1 -1
  73. package/lib/services/aiGen/canonicalAdapters/cameraControl.types.js +35 -0
  74. package/lib/services/aiGen/canonicalAdapters/cameraDirection.d.ts +36 -0
  75. package/lib/services/aiGen/canonicalAdapters/cameraDirection.d.ts.map +1 -0
  76. package/lib/services/aiGen/canonicalAdapters/cameraDirection.js +168 -0
  77. package/lib/services/aiGen/canonicalAdapters/index.d.ts +1 -0
  78. package/lib/services/aiGen/canonicalAdapters/index.d.ts.map +1 -1
  79. package/lib/services/aiGen/canonicalAdapters/index.js +1 -0
  80. package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts +3 -2
  81. package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts.map +1 -1
  82. package/lib/services/aiGen/helpers.d.ts +40 -0
  83. package/lib/services/aiGen/helpers.d.ts.map +1 -1
  84. package/lib/services/aiGen/helpers.js +48 -2
  85. package/lib/services/aiGen/index.d.ts +1 -0
  86. package/lib/services/aiGen/index.d.ts.map +1 -1
  87. package/lib/services/aiGen/index.js +3 -0
  88. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +13 -1
  89. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -1
  90. package/lib/services/aiGen/providers/alibaba/alibaba.js +313 -33
  91. package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts +29 -1
  92. package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
  93. package/lib/services/aiGen/providers/bytedance/bytedance.service.js +371 -54
  94. package/lib/services/aiGen/providers/google/google.service.d.ts +16 -0
  95. package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
  96. package/lib/services/aiGen/providers/google/google.service.js +372 -116
  97. package/lib/services/aiGen/providers/google/googleKeyPool.d.ts +6 -0
  98. package/lib/services/aiGen/providers/google/googleKeyPool.d.ts.map +1 -1
  99. package/lib/services/aiGen/providers/google/googleKeyPool.js +8 -0
  100. package/lib/services/aiGen/providers/kling/kling.service.d.ts +17 -1
  101. package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
  102. package/lib/services/aiGen/providers/kling/kling.service.js +59 -3
  103. package/lib/services/aiGen/providers/kling/klingCredits.d.ts +1 -1
  104. package/lib/services/aiGen/providers/kling/klingCredits.d.ts.map +1 -1
  105. package/lib/services/aiGen/providers/kling/klingCredits.js +19 -1
  106. package/lib/services/aiGen/providers/kling/klingRequests.d.ts +37 -7
  107. package/lib/services/aiGen/providers/kling/klingRequests.d.ts.map +1 -1
  108. package/lib/services/aiGen/providers/kling/klingRequests.js +191 -13
  109. package/lib/services/aiGen/providers/kling/types.d.ts +78 -0
  110. package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -1
  111. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts +11 -2
  112. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts.map +1 -1
  113. package/lib/services/aiGen/providers/minimax/minimax.service.js +168 -2
  114. package/lib/services/aiGen/providers/minimax/types.d.ts +63 -0
  115. package/lib/services/aiGen/providers/minimax/types.d.ts.map +1 -1
  116. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts +12 -0
  117. package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
  118. package/lib/services/aiGen/providers/pixverse/pixverse.service.js +131 -17
  119. package/lib/services/aiGen/providers/runway/hostedModels.d.ts +84 -0
  120. package/lib/services/aiGen/providers/runway/hostedModels.d.ts.map +1 -0
  121. package/lib/services/aiGen/providers/runway/hostedModels.js +266 -0
  122. package/lib/services/aiGen/providers/runway/index.d.ts +1 -0
  123. package/lib/services/aiGen/providers/runway/index.d.ts.map +1 -1
  124. package/lib/services/aiGen/providers/runway/index.js +1 -0
  125. package/lib/services/aiGen/providers/runway/runway.service.d.ts +1 -1
  126. package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -1
  127. package/lib/services/aiGen/providers/runway/runway.service.js +118 -21
  128. package/lib/services/aiGen/providers/runway/types.d.ts +18 -3
  129. package/lib/services/aiGen/providers/runway/types.d.ts.map +1 -1
  130. package/lib/services/aiGen/providers/runway/types.js +31 -3
  131. package/lib/services/aiGen/providers/types.d.ts +55 -0
  132. package/lib/services/aiGen/providers/types.d.ts.map +1 -1
  133. package/lib/services/aiGen/providers/xai/xai.service.d.ts +19 -0
  134. package/lib/services/aiGen/providers/xai/xai.service.d.ts.map +1 -0
  135. package/lib/services/aiGen/providers/xai/xai.service.js +205 -0
  136. package/lib/services/firestore.service.d.ts +4 -0
  137. package/lib/services/firestore.service.d.ts.map +1 -1
  138. package/lib/services/firestore.service.js +5 -0
  139. package/lib/services/index.d.ts +2 -0
  140. package/lib/services/index.d.ts.map +1 -1
  141. package/lib/services/index.js +2 -0
  142. package/lib/services/klingElements/klingElementLibrary.service.d.ts +37 -0
  143. package/lib/services/klingElements/klingElementLibrary.service.d.ts.map +1 -0
  144. package/lib/services/klingElements/klingElementLibrary.service.js +179 -0
  145. package/lib/services/trialGuard/index.d.ts +2 -0
  146. package/lib/services/trialGuard/index.d.ts.map +1 -0
  147. package/lib/services/trialGuard/index.js +17 -0
  148. package/lib/services/trialGuard/trialSignals.d.ts +88 -0
  149. package/lib/services/trialGuard/trialSignals.d.ts.map +1 -0
  150. package/lib/services/trialGuard/trialSignals.js +160 -0
  151. package/lib/utils/helpers.d.ts.map +1 -1
  152. package/lib/utils/helpers.js +5 -1
  153. package/package.json +2 -1
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.alibabaConfigs = void 0;
4
+ /** Wan 2.6 / 2.7: any integer 2–15s (re-read 2026-09-29). */
5
+ const WAN_2_15_DURATIONS = Array.from({ length: 14 }, (_, i) => i + 2);
4
6
  const wanCommonFields = {
5
7
  prompt: { required: true },
6
8
  aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"] },
@@ -11,7 +13,233 @@ const wanCommonFields = {
11
13
  watermark: {},
12
14
  promptOptimizer: {},
13
15
  };
16
+ // ───────────────────────────────────────────────────────────────────────
17
+ // Wan 3.0 + HappyHorse — the input.media[] generation (DashScope video-synthesis).
18
+ // Sources (read 2026-09-29): alibabacloud.com/help/en/model-studio/
19
+ // wan3-video-generation-api-reference, happyhorse-{text-to-video,image-to-video,
20
+ // reference-to-video,video-edit}-api-reference, model-pricing (International).
21
+ // Our resolution values stay lowercase; the service upper-cases them ("1080P").
22
+ // ───────────────────────────────────────────────────────────────────────
23
+ /** Durations 2–30s (Wan 3.0; with video input, input + output ≤ 30s). */
24
+ const WAN3_DURATIONS = Array.from({ length: 29 }, (_, i) => i + 2);
25
+ /** Durations 3–15s (HappyHorse 1.1). */
26
+ const HAPPYHORSE_DURATIONS = Array.from({ length: 13 }, (_, i) => i + 3);
27
+ const wan3Fields = {
28
+ prompt: {}, // prompt or media — the reference/frame modes can run on media alone
29
+ aspectRatio: { allowedValues: ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"] },
30
+ resolution: { allowedValues: ["480p", "720p", "1080p"], default: "1080p" },
31
+ duration: { allowedValues: WAN3_DURATIONS, default: 5 },
32
+ audio: {},
33
+ seed: {},
34
+ watermark: {},
35
+ promptOptimizer: {},
36
+ inputImageUrl: {}, // media first_frame
37
+ lastFrameImageUrl: {}, // media last_frame
38
+ referenceImageUrls: { max: 10 },
39
+ referenceVideoUrls: { max: 5 }, // ≤15s combined
40
+ referenceAudioUrls: { max: 5 }, // ≤15s combined
41
+ inputVideoUrl: {}, // sent as the first reference_video
42
+ // Document (`file`, ≤100MB / ≤50 pages) or public web page (`link`) the model
43
+ // parses into a video — one or the other, never with first/last frames.
44
+ // Forces prompt_extend on (API requirement).
45
+ referenceDocumentUrl: {},
46
+ referenceWebPageUrl: {},
47
+ };
14
48
  exports.alibabaConfigs = {
49
+ // --- Wan 3.0 --- all-in-one (preview): text, first/last frame, or references.
50
+ "alibaba-wan-3.0": {
51
+ modelId: "wan3.0-video",
52
+ type: ["text-to-video", "image-to-video", "video-to-video"],
53
+ tier: "T3",
54
+ fields: wan3Fields,
55
+ cost: {
56
+ // International list price per second (a limited-time 30% discount is
57
+ // not applied here). Input reference-video seconds are billed too.
58
+ perSecondByResolution: { "480p": 0.05, "720p": 0.10, "1080p": 0.20 },
59
+ inputVideoPerSecond: { "480p": 0.05, "720p": 0.10, "1080p": 0.20 },
60
+ },
61
+ guidance: {
62
+ quality: 5,
63
+ speed: 2,
64
+ bestFor: "Long single shots (up to 30s, 30fps) and multimodal reference video: up to 10 images, 5 videos and 5 audio clips referenced in the prompt as \"Image 1\" / \"Video 1\" / \"Audio 1\"; also first/last frame.",
65
+ notes: "Preview. First/last frame can't be combined with references. $1.00 for 5s at 1080p, $0.50 at 720p. Generates audio by default.",
66
+ },
67
+ },
68
+ // --- Wan 3.0 Prime --- the higher-quality Wan 3.0 tier, same inputs.
69
+ "alibaba-wan-3.0-prime": {
70
+ modelId: "wan3.0-video-prime",
71
+ type: ["text-to-video", "image-to-video", "video-to-video"],
72
+ tier: "T3",
73
+ fields: wan3Fields,
74
+ cost: {
75
+ perSecondByResolution: { "480p": 0.068, "720p": 0.14, "1080p": 0.28 },
76
+ inputVideoPerSecond: { "480p": 0.068, "720p": 0.14, "1080p": 0.28 },
77
+ },
78
+ guidance: {
79
+ quality: 5,
80
+ speed: 1,
81
+ bestFor: "Hero shots where Wan 3.0 quality matters more than cost; same modes and reference limits as Wan 3.0.",
82
+ notes: "Preview. About 40% more than Wan 3.0: $1.40 for 5s at 1080p.",
83
+ },
84
+ },
85
+ // --- HappyHorse 1.1 t2v ---
86
+ "alibaba-happyhorse-1.1-t2v": {
87
+ modelId: "happyhorse-1.1-t2v",
88
+ type: ["text-to-video"],
89
+ tier: "T3",
90
+ fields: {
91
+ prompt: { required: true }, // ≤5000 chars
92
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5", "5:4", "9:21", "21:9"] },
93
+ resolution: { allowedValues: ["480p", "720p", "1080p"], default: "1080p" },
94
+ duration: { allowedValues: HAPPYHORSE_DURATIONS, default: 5 },
95
+ seed: {},
96
+ watermark: {},
97
+ },
98
+ cost: { perSecondByResolution: { "480p": 0.07, "720p": 0.14, "1080p": 0.18 } },
99
+ guidance: {
100
+ quality: 4,
101
+ speed: 3,
102
+ bestFor: "Cinematic text-to-video with the widest aspect set (incl. 4:5 / 5:4 social crops and 9:21); prompts in any language.",
103
+ notes: "$0.90 for 5s at 1080p, $0.35 at 480p. No first/last frame.",
104
+ },
105
+ },
106
+ // --- HappyHorse 1.1 i2v --- first frame only; output aspect follows the image.
107
+ "alibaba-happyhorse-1.1-i2v": {
108
+ modelId: "happyhorse-1.1-i2v",
109
+ type: ["image-to-video"],
110
+ tier: "T2",
111
+ acceptedImageFormats: ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/bmp"],
112
+ fields: {
113
+ prompt: {},
114
+ inputImageUrl: { required: true }, // ≥300px, aspect 1:2.5–2.5:1, ≤20MB
115
+ resolution: { allowedValues: ["480p", "720p", "1080p"], default: "1080p" },
116
+ duration: { allowedValues: HAPPYHORSE_DURATIONS, default: 5 },
117
+ seed: {},
118
+ watermark: {},
119
+ },
120
+ cost: { perSecondByResolution: { "480p": 0.07, "720p": 0.14, "1080p": 0.18 } },
121
+ guidance: {
122
+ quality: 4,
123
+ speed: 3,
124
+ bestFor: "Animating a still from its first frame; prompt is optional.",
125
+ notes: "No last frame and no ratio (follows the image). $0.90 for 5s at 1080p.",
126
+ },
127
+ },
128
+ // --- HappyHorse 1.1 r2v --- 1–9 reference images, cited as "[Image 1]" etc.
129
+ "alibaba-happyhorse-1.1-r2v": {
130
+ modelId: "happyhorse-1.1-r2v",
131
+ type: ["text-to-video"],
132
+ tier: "T3",
133
+ fields: {
134
+ prompt: { required: true },
135
+ referenceImageUrls: { required: true, max: 9 }, // shortest side ≥400px
136
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5", "5:4", "9:21", "21:9"] },
137
+ resolution: { allowedValues: ["480p", "720p", "1080p"], default: "1080p" },
138
+ duration: { allowedValues: HAPPYHORSE_DURATIONS, default: 5 },
139
+ seed: {},
140
+ watermark: {},
141
+ },
142
+ cost: { perSecondByResolution: { "480p": 0.07, "720p": 0.14, "1080p": 0.18 } },
143
+ guidance: {
144
+ quality: 4,
145
+ speed: 3,
146
+ bestFor: "Keeping characters, products or styles consistent from up to 9 reference images, cited in the prompt as \"[Image 1]\", \"[Image 2]\"…",
147
+ notes: "Needs at least one reference image. $0.90 for 5s at 1080p.",
148
+ },
149
+ },
150
+ // --- HappyHorse 1.0 t2v / i2v / r2v --- the previous generation. Same
151
+ // request shape as 1.1 but no 480P tier and a pricier 1080P ($0.24/s vs
152
+ // $0.18/s), so 1.1 is the better default; kept for parity / A-B comparisons.
153
+ // EOL: none announced (checked 2026-09-29).
154
+ "alibaba-happyhorse-1.0-t2v": {
155
+ modelId: "happyhorse-1.0-t2v",
156
+ type: ["text-to-video"],
157
+ tier: "T3",
158
+ fields: {
159
+ prompt: { required: true }, // ≤5000 chars
160
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5", "5:4", "9:21", "21:9"] },
161
+ resolution: { allowedValues: ["720p", "1080p"], default: "1080p" },
162
+ duration: { allowedValues: HAPPYHORSE_DURATIONS, default: 5 },
163
+ seed: {},
164
+ watermark: {},
165
+ },
166
+ cost: { perSecondByResolution: { "720p": 0.14, "1080p": 0.24 } },
167
+ guidance: {
168
+ quality: 4,
169
+ speed: 3,
170
+ bestFor: "Text-to-video on the original HappyHorse model; same aspect set as 1.1.",
171
+ notes: "Previous generation: no 480p, and 1080p costs more than 1.1 ($1.20 vs $0.90 for 5s). Prefer 1.1 unless comparing.",
172
+ },
173
+ },
174
+ "alibaba-happyhorse-1.0-i2v": {
175
+ modelId: "happyhorse-1.0-i2v",
176
+ type: ["image-to-video"],
177
+ tier: "T2",
178
+ acceptedImageFormats: ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/bmp"],
179
+ fields: {
180
+ prompt: {},
181
+ inputImageUrl: { required: true }, // ≥300px, aspect 1:2.5–2.5:1, ≤20MB
182
+ resolution: { allowedValues: ["720p", "1080p"], default: "1080p" },
183
+ duration: { allowedValues: HAPPYHORSE_DURATIONS, default: 5 },
184
+ seed: {},
185
+ watermark: {},
186
+ },
187
+ cost: { perSecondByResolution: { "720p": 0.14, "1080p": 0.24 } },
188
+ guidance: {
189
+ quality: 4,
190
+ speed: 3,
191
+ bestFor: "Animating a still from its first frame on the original HappyHorse model.",
192
+ notes: "Previous generation: no 480p, no last frame, ratio follows the image. $1.20 for 5s at 1080p; prefer 1.1.",
193
+ },
194
+ },
195
+ "alibaba-happyhorse-1.0-r2v": {
196
+ modelId: "happyhorse-1.0-r2v",
197
+ type: ["text-to-video"],
198
+ tier: "T3",
199
+ fields: {
200
+ prompt: { required: true },
201
+ referenceImageUrls: { required: true, max: 9 }, // shortest side ≥400px
202
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5", "5:4", "9:21", "21:9"] },
203
+ resolution: { allowedValues: ["720p", "1080p"], default: "1080p" },
204
+ duration: { allowedValues: HAPPYHORSE_DURATIONS, default: 5 },
205
+ seed: {},
206
+ watermark: {},
207
+ },
208
+ cost: { perSecondByResolution: { "720p": 0.14, "1080p": 0.24 } },
209
+ guidance: {
210
+ quality: 4,
211
+ speed: 3,
212
+ bestFor: "Consistent characters/products from up to 9 reference images (\"[Image 1]\"…) on the original HappyHorse model.",
213
+ notes: "Previous generation: no 480p. $1.20 for 5s at 1080p; prefer 1.1.",
214
+ },
215
+ },
216
+ // --- HappyHorse 1.0 video edit --- restyle/replace in an existing clip.
217
+ "alibaba-happyhorse-1.0-video-edit": {
218
+ modelId: "happyhorse-1.0-video-edit",
219
+ type: ["video-to-video"],
220
+ tier: "T3",
221
+ fields: {
222
+ prompt: { required: true },
223
+ inputVideoUrl: { required: true }, // MP4/MOV, 3–60s; only the first 15s is used
224
+ referenceImageUrls: { max: 5 },
225
+ resolution: { allowedValues: ["720p", "1080p"], default: "1080p" },
226
+ audio: {}, // false keeps the source audio (audio_setting "origin")
227
+ seed: {},
228
+ watermark: {},
229
+ },
230
+ cost: {
231
+ // List price; billed on input + output seconds. Output length matches
232
+ // the input (capped at 15s), so `duration` is the clip length.
233
+ perSecondByResolution: { "720p": 0.14, "1080p": 0.24 },
234
+ inputVideoPerSecond: { "720p": 0.14, "1080p": 0.24 },
235
+ },
236
+ guidance: {
237
+ quality: 4,
238
+ speed: 2,
239
+ bestFor: "Editing an existing clip by instruction (swap outfit, restyle, replace an object), optionally guided by up to 5 reference images.",
240
+ notes: "Output length follows the input (3–15s). Billed on input and output seconds: a 5s edit at 1080p is about $2.40.",
241
+ },
242
+ },
15
243
  // --- Wan 2.7 t2v --- newest text-to-video (Singapore region)
16
244
  "alibaba-wan-2.7-t2v": {
17
245
  modelId: "wan2.7-t2v",
@@ -20,34 +248,135 @@ exports.alibabaConfigs = {
20
248
  fields: {
21
249
  ...wanCommonFields,
22
250
  resolution: { allowedValues: ["720p", "1080p"] },
23
- duration: { allowedValues: [5, 10] },
251
+ // duration: { allowedValues: [5, 10] }, // REMOVED FOR v2 — docs allow 2–15
252
+ duration: { allowedValues: WAN_2_15_DURATIONS },
253
+ inputAudioUrl: {}, // input.audio_url — WAV/MP3, 2–30s, drives the soundtrack
24
254
  },
25
- cost: {
26
- // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
27
- table: {
28
- "1280x720": { 5: 0.50, 10: 1.00 },
29
- "1920x1080": { 5: 0.75, 10: 1.50 },
30
- },
255
+ // REMOVED FOR v2 — kept for reference: a 5/10s table keyed by pixel size,
256
+ // which couldn't price the 2–15s range these models accept.
257
+ // cost: {
258
+ // table: {
259
+ // "1280x720": { 5: 0.50, 10: 1.00 },
260
+ // "1920x1080": { 5: 0.75, 10: 1.50 },
261
+ // },
262
+ // },
263
+ // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
264
+ cost: { perSecondByResolution: { "720p": 0.10, "1080p": 0.15 } },
265
+ guidance: {
266
+ quality: 4,
267
+ speed: 3,
268
+ bestFor: "Text-to-video with generated audio, or a soundtrack driven by your own audio clip.",
269
+ notes: "Uses resolution + ratio (not a pixel size). $0.75 for 5s at 1080p.",
31
270
  },
32
271
  },
33
272
  // --- Wan 2.7 i2v --- newest image-to-video; supports first-last-frame interpolation
34
273
  "alibaba-wan-2.7-i2v": {
35
274
  modelId: "wan2.7-i2v",
36
- type: ["image-to-video"],
275
+ // REMOVED FOR v2 — kept for reference: type: ["image-to-video"],
276
+ type: ["image-to-video", "video-to-video"], // video-to-video = first_clip continuation
37
277
  tier: "T3",
38
278
  fields: {
39
279
  ...wanCommonFields,
280
+ // No ratio: output follows the first frame / first clip.
281
+ aspectRatio: {},
40
282
  resolution: { allowedValues: ["720p", "1080p"] },
41
- duration: { allowedValues: [5, 10] },
42
- inputImageUrl: { required: true },
283
+ // duration: { allowedValues: [5, 10] }, // REMOVED FOR v2 — docs allow 2–15
284
+ duration: { allowedValues: WAN_2_15_DURATIONS },
285
+ // inputImageUrl: { required: true }, // REMOVED FOR v2 — a first clip can replace it
286
+ inputImageUrl: {}, // media first_frame
43
287
  lastFrameImageUrl: {}, // FLF interpolation
288
+ inputVideoUrl: {}, // media first_clip (2–10s) — continued up to `duration` total
289
+ inputAudioUrl: {}, // media driving_audio (WAV/MP3, 2–30s)
290
+ },
291
+ // REMOVED FOR v2 — kept for reference (5/10s table only):
292
+ // cost: {
293
+ // table: {
294
+ // "1280x720": { 5: 0.50, 10: 1.00 },
295
+ // "1920x1080": { 5: 0.75, 10: 1.50 },
296
+ // },
297
+ // },
298
+ // Alibaba intl (with audio): 720p $0.10/s, 1080p $0.15/s. A first-clip
299
+ // continuation is billed on the full output `duration` (clip included).
300
+ cost: { perSecondByResolution: { "720p": 0.10, "1080p": 0.15 } },
301
+ guidance: {
302
+ quality: 4,
303
+ speed: 3,
304
+ bestFor: "Image-to-video with first+last frame, audio-driven motion (driving audio), or continuing an existing 2–10s clip.",
305
+ notes: "Output aspect follows the input. $0.75 for 5s at 1080p.",
306
+ },
307
+ },
308
+ // --- Wan 2.7 r2v --- multi-subject reference-to-video with per-subject voices.
309
+ // Source: alibabacloud.com/help/en/model-studio/wan-video-to-video-api-reference
310
+ // (read 2026-09-29). input.media[]: ≤1 first_frame + 1–5 reference images/videos
311
+ // (combined), each image/video optionally carrying a `reference_voice`.
312
+ // EOL: none announced (checked 2026-09-29).
313
+ "alibaba-wan-2.7-r2v": {
314
+ modelId: "wan2.7-r2v",
315
+ type: ["text-to-video", "image-to-video"],
316
+ tier: "T3",
317
+ fields: {
318
+ prompt: { required: true }, // ≤5000 chars; cite "Image 1" / "Video 1"
319
+ negative_prompt: {},
320
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"] }, // ignored with a first frame
321
+ resolution: { allowedValues: ["720p", "1080p"], default: "1080p" },
322
+ duration: { allowedValues: WAN_2_15_DURATIONS, default: 5 }, // 2–10 when a reference video is present
323
+ inputImageUrl: {}, // media first_frame (optional composition control)
324
+ referenceImageUrls: { max: 5 }, // images + videos ≤ 5 combined
325
+ referenceVideoUrls: { max: 5 }, // MP4/MOV 1–30s; the subject's voice is reused
326
+ // Voices (WAV/MP3, 1–10s), matched in order to the subjects as sent:
327
+ // reference videos first, then reference images. Overrides a video's audio.
328
+ referenceAudioUrls: { max: 5 },
329
+ seed: {},
330
+ watermark: {},
331
+ promptOptimizer: {},
332
+ },
333
+ cost: {
334
+ // Input and output seconds both billed (International list). Input video
335
+ // is capped at 5s total (5s ÷ number of reference videos, per video) —
336
+ // min(total, 5) is the safe upper bound we charge.
337
+ perSecondByResolution: { "720p": 0.10, "1080p": 0.15 },
338
+ inputVideoPerSecond: { "720p": 0.10, "1080p": 0.15 },
339
+ inputVideoBillableMaxSec: 5,
340
+ },
341
+ guidance: {
342
+ quality: 4,
343
+ speed: 3,
344
+ bestFor: "Multi-character scenes from up to 5 reference images/videos (cited \"Image 1\" / \"Video 1\"), each with its own voice; accepts a storyboard grid image; optional first frame.",
345
+ notes: "Images are free; reference videos add at most 5 billed seconds. $0.75 for 5s at 1080p. Max 10s when a reference video is used.",
346
+ },
347
+ },
348
+ // --- Wan 2.7 video edit --- instruction edit of a 2–10s clip.
349
+ // Source: alibabacloud.com/help/en/model-studio/wan-video-editing-api-reference
350
+ // (read 2026-09-29). EOL: none announced (checked 2026-09-29).
351
+ "alibaba-wan-2.7-videoedit": {
352
+ modelId: "wan2.7-videoedit",
353
+ type: ["video-to-video"],
354
+ tier: "T3",
355
+ fields: {
356
+ prompt: {}, // the edit instruction (≤5000 chars)
357
+ negative_prompt: {},
358
+ inputVideoUrl: { required: true }, // MP4/MOV, 2–10s, ≤100MB
359
+ referenceImageUrls: { max: 4 },
360
+ // Omitted → keeps the input's shape; set → forces this ratio.
361
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"] },
362
+ resolution: { allowedValues: ["720p", "1080p"], default: "1080p" },
363
+ // Output = the input clip; a shorter duration truncates it from 0s.
364
+ duration: { allowedValues: Array.from({ length: 9 }, (_, i) => i + 2), default: 5 },
365
+ audio: {}, // false keeps the source audio (audio_setting "origin")
366
+ seed: {},
367
+ watermark: {},
368
+ promptOptimizer: {},
44
369
  },
45
370
  cost: {
46
- // Alibaba intl (with audio): 720p $0.10/s, 1080p $0.15/s.
47
- table: {
48
- "1280x720": { 5: 0.50, 10: 1.00 },
49
- "1920x1080": { 5: 0.75, 10: 1.50 },
50
- },
371
+ // Billed on input + output seconds (International list).
372
+ perSecondByResolution: { "720p": 0.10, "1080p": 0.15 },
373
+ inputVideoPerSecond: { "720p": 0.10, "1080p": 0.15 },
374
+ },
375
+ guidance: {
376
+ quality: 4,
377
+ speed: 3,
378
+ bestFor: "Cheaper instruction edits of a short clip (restyle, swap clothes, add an object from up to 4 reference images).",
379
+ notes: "Clip must be 2–10s. Billed on input + output: a 5s edit at 1080p is $1.50 (vs about $2.40 on HappyHorse edit).",
51
380
  },
52
381
  },
53
382
  // --- Wan 2.6 t2v --- 720p/1080p only (no 480p); 5/10s
@@ -58,15 +387,20 @@ exports.alibabaConfigs = {
58
387
  fields: {
59
388
  ...wanCommonFields,
60
389
  resolution: { allowedValues: ["720p", "1080p"] },
61
- duration: { allowedValues: [5, 10] },
62
- },
63
- cost: {
64
- // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
65
- table: {
66
- "1280x720": { 5: 0.50, 10: 1.00 },
67
- "1920x1080": { 5: 0.75, 10: 1.50 },
68
- },
390
+ // duration: { allowedValues: [5, 10] }, // REMOVED FOR v2 — docs allow 2–15
391
+ duration: { allowedValues: WAN_2_15_DURATIONS },
392
+ inputAudioUrl: {}, // input.audio_url
69
393
  },
394
+ // REMOVED FOR v2 — kept for reference: a 5/10s table keyed by pixel size,
395
+ // which couldn't price the 2–15s range these models accept.
396
+ // cost: {
397
+ // table: {
398
+ // "1280x720": { 5: 0.50, 10: 1.00 },
399
+ // "1920x1080": { 5: 0.75, 10: 1.50 },
400
+ // },
401
+ // },
402
+ // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
403
+ cost: { perSecondByResolution: { "720p": 0.10, "1080p": 0.15 } },
70
404
  },
71
405
  // --- Wan 2.6 i2v --- image-to-video with audio
72
406
  "alibaba-wan-2.6-i2v": {
@@ -75,17 +409,23 @@ exports.alibabaConfigs = {
75
409
  tier: "T3",
76
410
  fields: {
77
411
  ...wanCommonFields,
412
+ aspectRatio: {}, // output follows the image
78
413
  resolution: { allowedValues: ["720p", "1080p"] },
79
- duration: { allowedValues: [5, 10] },
414
+ // duration: { allowedValues: [5, 10] }, // REMOVED FOR v2 — docs allow 2–15
415
+ duration: { allowedValues: WAN_2_15_DURATIONS },
80
416
  inputImageUrl: { required: true },
417
+ inputAudioUrl: {}, // input.audio_url
81
418
  },
82
- cost: {
83
- // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
84
- table: {
85
- "1280x720": { 5: 0.50, 10: 1.00 },
86
- "1920x1080": { 5: 0.75, 10: 1.50 },
87
- },
88
- },
419
+ // REMOVED FOR v2 — kept for reference: a 5/10s table keyed by pixel size,
420
+ // which couldn't price the 2–15s range these models accept.
421
+ // cost: {
422
+ // table: {
423
+ // "1280x720": { 5: 0.50, 10: 1.00 },
424
+ // "1920x1080": { 5: 0.75, 10: 1.50 },
425
+ // },
426
+ // },
427
+ // Alibaba intl: 720p $0.10/s, 1080p $0.15/s.
428
+ cost: { perSecondByResolution: { "720p": 0.10, "1080p": 0.15 } },
89
429
  },
90
430
  // --- Wan 2.6 i2v flash --- ~50% cheaper i2v variant (audio optional)
91
431
  "alibaba-wan-2.6-i2v-flash": {
@@ -94,16 +434,25 @@ exports.alibabaConfigs = {
94
434
  tier: "T2",
95
435
  fields: {
96
436
  ...wanCommonFields,
437
+ aspectRatio: {}, // output follows the image
97
438
  resolution: { allowedValues: ["720p", "1080p"] },
98
- duration: { allowedValues: [5, 10] },
439
+ // duration: { allowedValues: [5, 10] }, // REMOVED FOR v2 — docs allow 2–15
440
+ duration: { allowedValues: WAN_2_15_DURATIONS },
99
441
  inputImageUrl: { required: true },
442
+ inputAudioUrl: {}, // input.audio_url
443
+ audio: {}, // false = silent video at half price
100
444
  },
445
+ // REMOVED FOR v2 — kept for reference (5/10s table, audio price only):
446
+ // cost: {
447
+ // table: {
448
+ // "1280x720": { 5: 0.25, 10: 0.50 },
449
+ // "1920x1080": { 5: 0.38, 10: 0.75 },
450
+ // },
451
+ // },
452
+ // Alibaba intl: audio 720p $0.05/s, 1080p $0.075/s; silent is half that.
101
453
  cost: {
102
- // Alibaba intl (with audio): 720p $0.05/s, 1080p $0.075/s.
103
- table: {
104
- "1280x720": { 5: 0.25, 10: 0.50 },
105
- "1920x1080": { 5: 0.38, 10: 0.75 },
106
- },
454
+ perSecondByResolution: { "720p": 0.05, "1080p": 0.075 },
455
+ silentPerSecondByResolution: { "720p": 0.025, "1080p": 0.0375 },
107
456
  },
108
457
  },
109
458
  // --- Wan 2.5 t2v --- preview tier
@@ -111,15 +460,19 @@ exports.alibabaConfigs = {
111
460
  modelId: "wan2.5-t2v-preview",
112
461
  type: ["text-to-video"],
113
462
  tier: "T2",
114
- fields: { ...wanCommonFields },
115
- cost: {
116
- // Alibaba intl: 480p $0.05/s, 720p $0.10/s, 1080p $0.15/s.
117
- table: {
118
- "832x480": { 5: 0.25, 10: 0.50 },
119
- "1280x720": { 5: 0.50, 10: 1.00 },
120
- "1920x1080": { 5: 0.75, 10: 1.50 },
121
- },
122
- },
463
+ fields: { ...wanCommonFields, inputAudioUrl: {} }, // input.audio_url
464
+ // REMOVED FOR v2 — kept for reference. Keyed "832x480" while
465
+ // getAlibabaDimensions returns "832*480" (since 2026-08-16), so every
466
+ // lookup missed and billed the $1.00 fallback.
467
+ // cost: {
468
+ // table: {
469
+ // "832x480": { 5: 0.25, 10: 0.50 },
470
+ // "1280x720": { 5: 0.50, 10: 1.00 },
471
+ // "1920x1080": { 5: 0.75, 10: 1.50 },
472
+ // },
473
+ // },
474
+ // Alibaba intl: 480p $0.05/s, 720p $0.10/s, 1080p $0.15/s.
475
+ cost: { perSecondByResolution: { "480p": 0.05, "720p": 0.10, "1080p": 0.15 } },
123
476
  },
124
477
  // --- Wan 2.2 t2v --- 480p + 1080p only (no 720p tier officially priced)
125
478
  "alibaba-wan-2.2-t2v": {
@@ -129,14 +482,18 @@ exports.alibabaConfigs = {
129
482
  fields: {
130
483
  ...wanCommonFields,
131
484
  resolution: { allowedValues: ["480p", "1080p"] },
485
+ duration: { allowedValues: [5] }, // fixed at 5s per the docs; 10 was rejected
132
486
  },
133
- cost: {
134
- // Alibaba intl (matches i2v-plus tier): 480p $0.02/s, 1080p $0.10/s.
135
- table: {
136
- "832x480": { 5: 0.10, 10: 0.20 },
137
- "1920x1080": { 5: 0.50, 10: 1.00 },
138
- },
139
- },
487
+ // REMOVED FOR v2 — kept for reference. Same "x" vs "*" key mismatch as
488
+ // wan 2.5 (always billed the fallback), and 10s isn't offered.
489
+ // cost: {
490
+ // table: {
491
+ // "832x480": { 5: 0.10, 10: 0.20 },
492
+ // "1920x1080": { 5: 0.50, 10: 1.00 },
493
+ // },
494
+ // },
495
+ // Alibaba intl: 480p $0.02/s, 1080p $0.10/s.
496
+ cost: { perSecondByResolution: { "480p": 0.02, "1080p": 0.10 } },
140
497
  },
141
498
  // --- Wan 2.2 s2v --- REMOVED FOR v1 — China-region only, intl key cannot reach
142
499
  //
@@ -177,6 +534,56 @@ exports.alibabaConfigs = {
177
534
  // ───────────────────────────────────────────────────────────────────────
178
535
  // Image-gen — Qwen-Image + Kolors (both via DashScope text2image / image2image)
179
536
  // ───────────────────────────────────────────────────────────────────────
537
+ // --- Qwen-Image 3.0 --- one model id for text-to-image AND editing (1–3
538
+ // input images), up to 6 outputs, strong layout/small-text rendering.
539
+ // Sync multimodal endpoint, same message format as 2.0. Priced by output
540
+ // tier (our aspect presets are 2k-class) plus $0.003 per input image.
541
+ // Source: qwen-image-generation-and-editing-api-reference + model-pricing,
542
+ // read 2026-09-29.
543
+ "alibaba-qwen-image-3.0-pro": {
544
+ modelId: "qwen-image-3.0-pro",
545
+ type: ["text-to-image", "image-to-image"],
546
+ tier: "T2",
547
+ fields: {
548
+ prompt: { required: true },
549
+ aspectRatio: { allowedValues: ["1:1", "9:16", "16:9", "3:4", "4:3", "2:3", "3:2"] },
550
+ numImages: { default: 1 }, // 1–6
551
+ inputImageUrls: { max: 3 },
552
+ seed: {},
553
+ watermark: {},
554
+ promptOptimizer: {},
555
+ negativePrompt: {},
556
+ },
557
+ cost: { fixed: 0.075, perInputImage: 0.003 }, // 2k; 1k is $0.04
558
+ guidance: {
559
+ quality: 5,
560
+ speed: 3,
561
+ bestFor: "Dense layouts and legible small text (posters, menus, storyboards, infographics) in many languages; also multi-image edits.",
562
+ notes: "$0.075 per 2k image. Up to 6 images per call.",
563
+ },
564
+ },
565
+ "alibaba-qwen-image-3.0": {
566
+ modelId: "qwen-image-3.0",
567
+ type: ["text-to-image", "image-to-image"],
568
+ tier: "T1",
569
+ fields: {
570
+ prompt: { required: true },
571
+ aspectRatio: { allowedValues: ["1:1", "9:16", "16:9", "3:4", "4:3", "2:3", "3:2"] },
572
+ numImages: { default: 1 },
573
+ inputImageUrls: { max: 3 },
574
+ seed: {},
575
+ watermark: {},
576
+ promptOptimizer: {},
577
+ negativePrompt: {},
578
+ },
579
+ cost: { fixed: 0.03, perInputImage: 0.003 }, // same price at 1k and 2k
580
+ guidance: {
581
+ quality: 4,
582
+ speed: 4,
583
+ bestFor: "Faster, cheaper Qwen-Image 3.0 for text-heavy images and edits.",
584
+ notes: "$0.03 per image at 1k or 2k.",
585
+ },
586
+ },
180
587
  "alibaba-qwen-image-2.0-pro": {
181
588
  modelId: "qwen-image-2.0-pro",
182
589
  type: ["text-to-image"],
@@ -1 +1 @@
1
- {"version":3,"file":"bytedance.d.ts","sourceRoot":"","sources":["../../../../src/globals/aiModels/providers/bytedance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CA4OvE,CAAC"}
1
+ {"version":3,"file":"bytedance.d.ts","sourceRoot":"","sources":["../../../../src/globals/aiModels/providers/bytedance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAWxC,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CA+ZvE,CAAC"}