@shop-os/modelkit 0.7.4 → 0.7.7
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/catalog.cjs +9 -4
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.js +9 -4
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +22 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.js
CHANGED
|
@@ -6318,14 +6318,14 @@ function xaiReferenceMode(model, req) {
|
|
|
6318
6318
|
const takesLastFrame = (model.constraints.supports ?? []).includes("lastFrame");
|
|
6319
6319
|
return (req.referenceImages ?? []).length > 0 || takesLastFrame && req.lastFrame !== void 0;
|
|
6320
6320
|
}
|
|
6321
|
-
function
|
|
6322
|
-
if (
|
|
6323
|
-
if (!xaiReferenceMode(model, req)) return;
|
|
6321
|
+
function xaiReferenceResolution(model, req, onUnsupported, warnings, provider) {
|
|
6322
|
+
if (req.resolution !== "1080p" || !xaiReferenceMode(model, req)) return void 0;
|
|
6324
6323
|
const message = xaiReferenceResolutionMessage(model.id);
|
|
6325
6324
|
if (onUnsupported === "error") {
|
|
6326
6325
|
throw new ModelKitError({
|
|
6327
6326
|
code: "unsupported_option",
|
|
6328
6327
|
message,
|
|
6328
|
+
...provider === void 0 ? {} : { provider },
|
|
6329
6329
|
model: model.id,
|
|
6330
6330
|
retryable: false
|
|
6331
6331
|
});
|
|
@@ -6337,7 +6337,12 @@ function applyXaiVideoRules(model, req, onUnsupported, warnings) {
|
|
|
6337
6337
|
to: XAI_REFERENCE_MAX_RESOLUTION,
|
|
6338
6338
|
message
|
|
6339
6339
|
});
|
|
6340
|
-
|
|
6340
|
+
return XAI_REFERENCE_MAX_RESOLUTION;
|
|
6341
|
+
}
|
|
6342
|
+
function applyXaiVideoRules(model, req, onUnsupported, warnings) {
|
|
6343
|
+
if (model.adapter !== "xai-video") return;
|
|
6344
|
+
const lowered = xaiReferenceResolution(model, req, onUnsupported, warnings);
|
|
6345
|
+
if (lowered !== void 0) req.resolution = lowered;
|
|
6341
6346
|
}
|
|
6342
6347
|
function takesTargetAspectRatio(model) {
|
|
6343
6348
|
const ratios = model.constraints.aspectRatios ?? [];
|