@blockrun/franklin 3.15.58 → 3.15.59
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/tools/videogen.js +25 -2
- package/package.json +1 -1
package/dist/tools/videogen.js
CHANGED
|
@@ -44,7 +44,7 @@ function estimateVideoCostUsd(durationSeconds = DEFAULT_DURATION) {
|
|
|
44
44
|
function buildExecute(deps) {
|
|
45
45
|
return async function execute(input, ctx) {
|
|
46
46
|
const rawInput = input;
|
|
47
|
-
const { output_path, model, image_url, duration_seconds, contentId } = rawInput;
|
|
47
|
+
const { output_path, model, image_url, duration_seconds, contentId, aspect_ratio } = rawInput;
|
|
48
48
|
if (!rawInput.prompt)
|
|
49
49
|
return { output: 'Error: prompt is required', isError: true };
|
|
50
50
|
// Resolve image_url before sending. The gateway requires a URL (http(s)
|
|
@@ -156,6 +156,12 @@ function buildExecute(deps) {
|
|
|
156
156
|
prompt: chosenPrompt,
|
|
157
157
|
...(resolvedImageUrl ? { image_url: resolvedImageUrl } : {}),
|
|
158
158
|
...(duration_seconds ? { duration_seconds } : {}),
|
|
159
|
+
// aspect_ratio passes through to the gateway. Models that support it
|
|
160
|
+
// (newer Seedance / grok variants) honor it; models that ignore it
|
|
161
|
+
// produce their default size. If the gateway rejects an unknown
|
|
162
|
+
// value, the 400 body surfaces via 3.15.45 diagnostic so the agent
|
|
163
|
+
// can drop the param and retry.
|
|
164
|
+
...(aspect_ratio ? { aspect_ratio } : {}),
|
|
159
165
|
});
|
|
160
166
|
const headers = {
|
|
161
167
|
'Content-Type': 'application/json',
|
|
@@ -456,7 +462,15 @@ export function createVideoGenCapability(deps = {}) {
|
|
|
456
462
|
"xai/grok-imagine-video bills $0.05/s (8s default ≈ $0.42). Generation " +
|
|
457
463
|
"takes ~20–60s. ALWAYS confirm with the user before calling — videos " +
|
|
458
464
|
"are expensive and slow. Pass contentId to attach to a Content piece " +
|
|
459
|
-
"(budget is checked before paying; asset is recorded on success)."
|
|
465
|
+
"(budget is checked before paying; asset is recorded on success). " +
|
|
466
|
+
"PLATFORM TARGETING: when the user says they'll post to X / Twitter, " +
|
|
467
|
+
"set aspect_ratio: '16:9' AND plan a follow-up `ffmpeg -vf scale=1280:720` " +
|
|
468
|
+
"step — X rejects videos under 720p with 'aspect ratio too small'. " +
|
|
469
|
+
"TikTok / Reels / Shorts: aspect_ratio '9:16'. Instagram Square: '1:1'. " +
|
|
470
|
+
"MODERATION: bytedance/seedance-* refuses photorealistic human faces " +
|
|
471
|
+
"(`InputImageSensitiveContentDetected.PrivacyInformation`); when the " +
|
|
472
|
+
"seed image has a real-looking person, use xai/grok-imagine-video " +
|
|
473
|
+
"instead, or regenerate the keyframe in a more stylized style first.",
|
|
460
474
|
input_schema: {
|
|
461
475
|
type: 'object',
|
|
462
476
|
properties: {
|
|
@@ -471,6 +485,15 @@ export function createVideoGenCapability(deps = {}) {
|
|
|
471
485
|
},
|
|
472
486
|
image_url: { type: 'string', description: 'Optional seed image (image-to-video). Accepts http(s) URL, data: URI, or local file path — local paths get inlined as base64 data URIs automatically.' },
|
|
473
487
|
duration_seconds: { type: 'number', description: 'Duration billed for. Default depends on model (8s for grok-imagine-video).' },
|
|
488
|
+
aspect_ratio: {
|
|
489
|
+
type: 'string',
|
|
490
|
+
description: 'Optional aspect ratio hint passed to the model. Common values: ' +
|
|
491
|
+
'"16:9" (landscape — X/Twitter, YouTube, TikTok-landscape), ' +
|
|
492
|
+
'"9:16" (vertical — TikTok, Reels, Shorts), ' +
|
|
493
|
+
'"1:1" (square — Instagram feed). Models that don\'t support the ' +
|
|
494
|
+
'param ignore it; if the gateway 400s on an unknown value, the ' +
|
|
495
|
+
'error body surfaces — drop the param and retry.',
|
|
496
|
+
},
|
|
474
497
|
contentId: { type: 'string', description: 'Optional Content id to attach and budget against.' },
|
|
475
498
|
},
|
|
476
499
|
required: ['prompt'],
|
package/package.json
CHANGED