Skip to content

Unrestricted Open-source alternative to AI video platforms — Free AI image & video generation studio with 600+ models (Flux, Midjourney, Kling, Sora, Veo). No content filters. Self-hosted, MIT licensed.

fix(studio): align Seedance inputs and reuse Veo registry

antilyaac2dcf680e10
diff --git a/packages/studio/src/models.js b/packages/studio/src/models.js
index 58a3b1cb..f8e63bfd 100644
--- a/packages/studio/src/models.js
+++ b/packages/studio/src/models.js
@@ -34,13 +34,28 @@ const SEEDANCE_HIGH_BITRATE_INPUT = Object.freeze({
description: "Enable high bitrate mode for better visual fidelity. Produces larger files.",
default: false,
});
-const SEEDANCE_25_GENERATE_AUDIO_INPUT = Object.freeze({
+const SEEDANCE_GENERATE_AUDIO_INPUT = Object.freeze({
type: "boolean",
title: "Generate Audio",
name: "generate_audio",
description: "Whether to generate audio for the video.",
default: true,
});
+const SEEDANCE_15_EXTEND_INPUTS = Object.freeze({
+ resolution: {
+ type: "string", title: "Resolution", name: "resolution",
+ enum: ["480p", "720p"], default: "720p",
+ },
+ duration: {
+ type: "int", title: "Duration", name: "duration",
+ default: 5, minValue: 4, maxValue: 12, step: 1,
+ },
+ generate_audio: SEEDANCE_GENERATE_AUDIO_INPUT,
+ camera_fixed: {
+ type: "boolean", title: "Camera Fixed", name: "camera_fixed",
+ description: "Keep the camera still.", default: false,
+ },
+});
const SEEDANCE_25_SEED_INPUT = Object.freeze({
type: "int",
title: "Seed",
@@ -4051,7 +4066,6 @@ export const t2vModels = [
"1:1",
"4:3",
"3:4",
- "21:9",
"9:21"
],
"title": "Aspect Ratio",
@@ -4103,8 +4117,7 @@ export const t2vModels = [
"1:1",
"4:3",
"3:4",
- "21:9",
- "9:21"
+ "21:9"
],
"title": "Aspect Ratio",
"name": "aspect_ratio",
@@ -8027,7 +8040,7 @@ export const t2vModels = [
"endpoint": "seedance-2.5-spicy-text-to-video",
"inputs": {
"resolution": SEEDANCE_25_RESOLUTION_INPUT,
- "generate_audio": SEEDANCE_25_GENERATE_AUDIO_INPUT,
+ "generate_audio": SEEDANCE_GENERATE_AUDIO_INPUT,
"prompt": {
"examples": [
"A high-contrast, adrenaline-fueled chase through a rain-soaked neon megacity at night, sparks and shattering glass in slow motion, aggressive handheld camera energy, exaggerated color grading, 4K cinematic quality."
@@ -14044,6 +14057,7 @@ export const i2vModels = [
"family": "bytedance",
"imageField": "image_url",
"hasPrompt": true,
+ "promptRequired": true,
"inputs": {
"prompt": {
"type": "string",
@@ -14754,6 +14768,7 @@ export const i2vModels = [
"family": "bytedance",
"imageField": "image_url",
"hasPrompt": true,
+ "promptRequired": true,
"inputs": {
"prompt": {
"type": "string",
@@ -16103,6 +16118,7 @@ export const i2vModels = [
"family": "seedance-v2.0",
"imageField": "images_list",
"hasPrompt": true,
+ "promptRequired": true,
"maxImages": 5,
"inputs": {
"prompt": {
@@ -19884,7 +19900,7 @@ export const i2vModels = [
"promptRequired": true,
"inputs": {
"resolution": SEEDANCE_25_RESOLUTION_INPUT,
- "generate_audio": SEEDANCE_25_GENERATE_AUDIO_INPUT,
+ "generate_audio": SEEDANCE_GENERATE_AUDIO_INPUT,
"prompt": {
"examples": [
"Bold, high-energy dolly forward through a neon-drenched alley at night, sparks flying off a passing train, exaggerated lighting contrast, dramatic camera shake, photorealistic 4K quality."
@@ -24868,6 +24884,7 @@ export const v2vModels = [
"videoField": "video_url",
"hasPrompt": true,
"promptRequired": true,
+ "inputs": SEEDANCE_15_EXTEND_INPUTS,
"description": "Seedance v1.5 Pro Video Extend continues an existing video by generating additional frames that match the original scene’s style, lighting, motion, and mood.",
"provider": "bytedance",
"provider_name": "ByteDance"
@@ -24880,6 +24897,10 @@ export const v2vModels = [
"videoField": "video_url",
"hasPrompt": true,
"promptRequired": true,
+ "inputs": {
+ ...SEEDANCE_15_EXTEND_INPUTS,
+ "resolution": { ...SEEDANCE_15_EXTEND_INPUTS.resolution, "enum": ["720p", "1080p"] }
+ },
"description": "Seedance v1.5 Pro Video Extend Fast quickly extends an existing video by generating a short continuation that matches the original style, motion, and lighting.",
"provider": "bytedance",
"provider_name": "ByteDance"
diff --git a/packages/studio/src/veoModels.js b/packages/studio/src/veoModels.js
index 9dbfcc6e..819f07e1 100644
--- a/packages/studio/src/veoModels.js
+++ b/packages/studio/src/veoModels.js
@@ -1,4 +1,4 @@
-import { i2vModels, t2vModels } from "./models.js";
+import { createGroupedVideoRegistry } from "./groupedVideoRegistry.js";
export const VEO_FAMILY_NAMES = Object.freeze({
"veo-4": "Veo 4",
@@ -6,45 +6,33 @@ export const VEO_FAMILY_NAMES = Object.freeze({
"veo-3": "Veo 3",
});
-const SPEED_OPTIONS = Object.freeze([
- { value: "standard", label: "Standard" },
- { value: "fast", label: "Fast" },
- { value: "lite", label: "Lite" },
-]);
-const EMPTY_OPTIONS = Object.freeze([]);
-const modelIds = new Set([...t2vModels, ...i2vModels].map((model) => model.id));
-const configurations = new Map();
-const selectionIndex = new Map();
-
-function register(modelId, familyId, speed, workflowIds) {
- if (!modelIds.has(modelId)) return;
- configurations.set(modelId, Object.freeze({
- familyId, speed, workflowIds: Object.freeze(workflowIds),
- }));
- let workflows = selectionIndex.get(familyId);
- if (!workflows) selectionIndex.set(familyId, workflows = new Map());
- for (const workflowId of workflowIds) {
- let variants = workflows.get(workflowId);
- if (!variants) workflows.set(workflowId, variants = new Map());
- variants.set(speed, modelId);
- }
-}
-
-// Generation variants only. Extension and 4K upscaling require a previous
-// request ID and remain separate tools in the model menu.
-for (const [familyId, prefix, speeds] of [
- ["veo-3", "veo3", ["standard", "fast"]],
- ["veo-3.1", "veo3.1", ["standard", "fast", "lite"]],
- ["veo-4", "veo-4", ["standard"]],
-]) {
- for (const speed of speeds) {
- const stem = `${prefix}${speed === "standard" ? "" : `-${speed}`}`;
- register(`${stem}-text-to-video`, familyId, speed, [null]);
- register(`${stem}-image-to-video`, familyId, speed,
- familyId === "veo-3.1" ? ["animate_image", "keyframes"] : ["animate_image"]);
- }
-}
-register("veo3.1-reference-to-video", "veo-3.1", "standard", ["references"]);
+const registry = createGroupedVideoRegistry({
+ facetOptions: {
+ speed: [
+ { value: "standard", label: "Standard" },
+ { value: "fast", label: "Fast" },
+ { value: "lite", label: "Lite" },
+ ],
+ },
+ facetLabels: { speed: "Speed" },
+ registerVariants(register) {
+ // Generation variants only. Extension and 4K upscaling require a previous
+ // request ID and remain separate tools in the model menu.
+ for (const [familyId, prefix, speeds] of [
+ ["veo-3", "veo3", ["standard", "fast"]],
+ ["veo-3.1", "veo3.1", ["standard", "fast", "lite"]],
+ ["veo-4", "veo-4", ["standard"]],
+ ]) {
+ for (const speed of speeds) {
+ const stem = `${prefix}${speed === "standard" ? "" : `-${speed}`}`;
+ register(`${stem}-text-to-video`, familyId, [null], { speed });
+ register(`${stem}-image-to-video`, familyId,
+ familyId === "veo-3.1" ? ["animate_image", "keyframes"] : ["animate_image"], { speed });
+ }
+ }
+ register("veo3.1-reference-to-video", "veo-3.1", ["references"]);
+ },
+});
const tools = new Map([
["veo3.1-extend-video", { key: "continueGenerated", order: 0 }],
@@ -55,44 +43,22 @@ export function getVeoToolConfiguration(modelId) {
return tools.get(modelId);
}
-export const VEO_WORKFLOW_VARIANTS = Object.freeze(Object.fromEntries(
- [...selectionIndex].map(([familyId, workflows]) => [familyId, Object.freeze(Object.fromEntries(
- [...workflows].filter(([workflowId]) => workflowId !== null)
- .map(([workflowId, variants]) => [workflowId, Object.freeze([...variants.values()])]),
- ))]),
-));
-
-export function getVeoConfiguration(modelId) {
- return configurations.get(modelId) || null;
-}
+export const {
+ workflowVariants: VEO_WORKFLOW_VARIANTS,
+ getConfiguration: getVeoConfiguration,
+ getVariantOptions: getVeoVariantOptions,
+} = registry;
-export function resolveVeoVariant({
- familyId, workflowId = null, currentModelId = null, changes = {},
-}) {
+export function resolveVeoVariant(options) {
+ const { changes = {} } = options;
if (Object.keys(changes).some((key) => key !== "speed")) return null;
- const variants = selectionIndex.get(familyId)?.get(workflowId);
- if (!variants) return null;
- const current = getVeoConfiguration(currentModelId);
- const speed = changes.speed ?? (current?.familyId === familyId ? current.speed : "standard");
- return variants.get(speed) || null;
-}
-
-export function getVeoVariantOptions(familyId, workflowId = null, currentModelId = null) {
- const variants = selectionIndex.get(familyId)?.get(workflowId);
- if (!variants || variants.size < 2) return EMPTY_OPTIONS;
- const current = getVeoConfiguration(currentModelId);
- return [{
- key: "speed",
- label: "Speed",
- value: current?.familyId === familyId ? current.speed : "standard",
- options: SPEED_OPTIONS.filter((option) => variants.has(option.value)),
- }];
+ return registry.resolveVariant({ ...options, changes: changes.speed == null ? {} : changes });
}
export const VEO_MODEL_GROUP = Object.freeze({
copyKey: "veo",
familyNames: VEO_FAMILY_NAMES,
- configurations,
+ configurations: registry.configurations,
workflowVariants: VEO_WORKFLOW_VARIANTS,
resolveVariant: resolveVeoVariant,
getVariantOptions: getVeoVariantOptions,
diff --git a/packages/studio/src/videoToolCapabilities.js b/packages/studio/src/videoToolCapabilities.js
index 0869d99b..c45b7f5a 100644
--- a/packages/studio/src/videoToolCapabilities.js
+++ b/packages/studio/src/videoToolCapabilities.js
@@ -420,16 +420,18 @@ Object.assign(VIDEO_TOOL_OVERRIDES, {
},
});
-VIDEO_TOOL_OVERRIDES["seedance-v1.5-pro-video-extend"] = {
- ...VIDEO_TOOL_OVERRIDES["seedance-v1.5-pro-video-extend"],
- estimateCost: true,
- payloadDefaults: {
- resolution: "720p",
- duration: 5,
- generate_audio: true,
- camera_fixed: false,
- },
-};
+for (const id of ["seedance-v1.5-pro-video-extend", "seedance-v1.5-pro-video-extend-fast"]) {
+ VIDEO_TOOL_OVERRIDES[id] = {
+ ...VIDEO_TOOL_OVERRIDES[id],
+ estimateCost: id === "seedance-v1.5-pro-video-extend",
+ inputs: {
+ resolution: { configurable: true },
+ duration: { configurable: true },
+ generate_audio: { configurable: true },
+ camera_fixed: { configurable: true },
+ },
+ };
+}
for (const id of HAPPY_HORSE_EDIT_TOOL_IDS) {
VIDEO_TOOL_OVERRIDES[id] = {