vidspotai-shared 1.0.107 → 1.0.109
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/services/aiGen/providers/alibaba/helpers.d.ts.map +1 -1
- package/lib/services/aiGen/providers/alibaba/helpers.js +19 -15
- package/lib/services/aiGen/providers/openai/openai.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/openai/openai.service.js +15 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/alibaba/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/alibaba/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,MAAM,GAAG,MAAM,GAAG,OAAO,EACzB,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,MAAM,CAAC,CAuBxD,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAMf"}
|
|
@@ -2,27 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VideoModelsDimensionsMap = void 0;
|
|
4
4
|
exports.getAlibabaDimensions = getAlibabaDimensions;
|
|
5
|
+
// DashScope's video `size` parameter is "WIDTH*HEIGHT" (asterisk separator,
|
|
6
|
+
// matching resolveDashScopeSize below) — NOT "WIDTHxHEIGHT". Sending "x"
|
|
7
|
+
// caused DashScope to reject every T2V request with "Invalid input format"
|
|
8
|
+
// (observed in prod on alibaba-wan-2.5-t2v, 2026-08-16).
|
|
5
9
|
exports.VideoModelsDimensionsMap = {
|
|
6
10
|
"480p": {
|
|
7
|
-
"16:9": "
|
|
8
|
-
"9:16": "
|
|
9
|
-
"1:1": "
|
|
10
|
-
"4:3": "
|
|
11
|
-
"3:4": "
|
|
11
|
+
"16:9": "832*480",
|
|
12
|
+
"9:16": "480*832",
|
|
13
|
+
"1:1": "624*624",
|
|
14
|
+
"4:3": "640*480",
|
|
15
|
+
"3:4": "480*640",
|
|
12
16
|
},
|
|
13
17
|
"720p": {
|
|
14
|
-
"16:9": "
|
|
15
|
-
"9:16": "
|
|
16
|
-
"1:1": "
|
|
17
|
-
"4:3": "
|
|
18
|
-
"3:4": "
|
|
18
|
+
"16:9": "1280*720",
|
|
19
|
+
"9:16": "720*1280",
|
|
20
|
+
"1:1": "960*960",
|
|
21
|
+
"4:3": "1088*832",
|
|
22
|
+
"3:4": "832*1088",
|
|
19
23
|
},
|
|
20
24
|
"1080p": {
|
|
21
|
-
"16:9": "
|
|
22
|
-
"9:16": "
|
|
23
|
-
"1:1": "
|
|
24
|
-
"4:3": "
|
|
25
|
-
"3:4": "
|
|
25
|
+
"16:9": "1920*1080",
|
|
26
|
+
"9:16": "1080*1920",
|
|
27
|
+
"1:1": "1440*1440",
|
|
28
|
+
"4:3": "1632*1248",
|
|
29
|
+
"3:4": "1248*1632",
|
|
26
30
|
},
|
|
27
31
|
};
|
|
28
32
|
function getAlibabaDimensions(resolution, aspectRatio) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/openai/openai.service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"openai.service.d.ts","sourceRoot":"","sources":["../../../../../src/services/aiGen/providers/openai/openai.service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAclB,qBAAa,aAAc,SAAQ,wBAAwB;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,MAAM,CAAS;;IAQjB,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IAwF3B,gBAAgB,CAAC,EACrB,IAAI,EACJ,cAAc,EACd,cAAyB,GAC1B,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAsC3C,YAAY,CAChB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IA2ChC;;;;OAIG;IACG,aAAa,CACjB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IA6HjC,aAAa,CAAC,EACZ,QAAQ,EACR,UAAuB,EACvB,QAAY,EACZ,SAAiB,EACjB,SAAa,EACb,OAAO,EACP,WAAW,GACZ,EAAE,iBAAiB,GAAG,MAAM;CAqB9B"}
|
|
@@ -44,6 +44,19 @@ const logger_1 = require("../../../../utils/logger");
|
|
|
44
44
|
const errors_1 = require("../../../../utils/errors");
|
|
45
45
|
const helpers_1 = require("../../helpers");
|
|
46
46
|
const baseAiGenProvider_service_1 = require("../baseAiGenProvider.service");
|
|
47
|
+
// OpenAI's images.edit endpoint only accepts these three MIME types. `toFile`
|
|
48
|
+
// falls back to the fetched Response's `Content-Type` header when no `type`
|
|
49
|
+
// override is given — some of our own storage objects are served as
|
|
50
|
+
// `application/octet-stream`, which the endpoint then rejects outright. Infer
|
|
51
|
+
// from the extension instead of trusting the upstream header.
|
|
52
|
+
function imageMimeFromUrl(url) {
|
|
53
|
+
const ext = (url.split("?")[0] ?? "").split(".").pop()?.toLowerCase();
|
|
54
|
+
if (ext === "jpg" || ext === "jpeg")
|
|
55
|
+
return "image/jpeg";
|
|
56
|
+
if (ext === "webp")
|
|
57
|
+
return "image/webp";
|
|
58
|
+
return "image/png";
|
|
59
|
+
}
|
|
47
60
|
class OpenaiService extends baseAiGenProvider_service_1.BaseAiGenProviderService {
|
|
48
61
|
constructor() {
|
|
49
62
|
super();
|
|
@@ -240,7 +253,7 @@ class OpenaiService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
240
253
|
throw new Error(`openai ref fetch ${r.status}`);
|
|
241
254
|
}
|
|
242
255
|
const name = (url.split("?")[0] ?? "ref").split("/").pop() || "ref.png";
|
|
243
|
-
return (0, openai_1.toFile)(r, name);
|
|
256
|
+
return (0, openai_1.toFile)(r, name, { type: imageMimeFromUrl(url) });
|
|
244
257
|
}));
|
|
245
258
|
const mask = params.maskImageUrl
|
|
246
259
|
? await (async () => {
|
|
@@ -253,7 +266,7 @@ class OpenaiService extends baseAiGenProvider_service_1.BaseAiGenProviderService
|
|
|
253
266
|
});
|
|
254
267
|
throw new Error(`openai mask fetch ${r.status}`);
|
|
255
268
|
}
|
|
256
|
-
return (0, openai_1.toFile)(r, "mask.png");
|
|
269
|
+
return (0, openai_1.toFile)(r, "mask.png", { type: imageMimeFromUrl(params.maskImageUrl) });
|
|
257
270
|
})()
|
|
258
271
|
: undefined;
|
|
259
272
|
resp = (await this.client.images.edit({
|