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.
JavaScript ai-art-generatorai-image-generationai-video-generationfal-ai-alternativegenerative-aiimage-to-videoinvideo-alternativekling-ailipsynclitellm-alternativemidjourney-alternativemuapiopen-sourceopenrouter-alternativeseedance2sora-alternativetext-to-imagetext-to-videouncensoredwan-video
feat(studio): simplify Alibaba model selection
antilya4ec84618074c
diff --git a/packages/studio/src/alibabaModels.js b/packages/studio/src/alibabaModels.jsnew file mode 100644index 00000000..43c5a3b0--- /dev/null+++ b/packages/studio/src/alibabaModels.js@@ -0,0 +1,75 @@+import { createGroupedVideoRegistry } from "./groupedVideoRegistry.js";++export const ALIBABA_FAMILY_NAMES = Object.freeze({+ "wan-3": "Wan 3.0",+ "wan-2.7": "Wan 2.7",+ "wan-2.6": "Wan 2.6",+ "wan-2.5": "Wan 2.5",+ "wan-2.2": "Wan 2.2",+ "wan-2.1": "Wan 2.1",+});++const registry = createGroupedVideoRegistry({+ facetOptions: {+ profile: [+ { value: "standard", label: "Standard" },+ { value: "prime", label: "Prime" },+ { value: "spicy", label: "Spicy" },+ ],+ speed: [+ { value: "standard", label: "Standard" },+ { value: "fast", label: "Fast" },+ ],+ },+ facetLabels: { profile: "Model", speed: "Speed" },+ registerVariants(register) {+ for (const profile of ["standard", "prime", "spicy"]) {+ const stem = `wan3.0${profile === "standard" ? "" : `-${profile}`}`;+ register(`${stem}-text-to-video`, "wan-3", [null], { profile });+ register(`${stem}-image-to-video`, "wan-3", ["animate_image", "keyframes"], { profile });+ register(`${stem}-reference-to-video`, "wan-3", ["references"], { profile });+ }++ for (const version of ["2.7", "2.6", "2.5", "2.2", "2.1"]) {+ const stem = `wan${version}`;+ const familyId = `wan-${version}`;+ register(`${stem}-text-to-video`, familyId, [null]);+ register(`${stem}-image-to-video`, familyId,+ version === "2.7" || version === "2.2" ? ["animate_image", "keyframes"] : ["animate_image"]);+ }++ for (const version of ["2.7", "2.6"]) {+ register(`wan${version}-image-to-video-spicy`, `wan-${version}`, ["animate_image"], { profile: "spicy" });+ }+ for (const mode of ["text", "image"]) {+ register(`wan2.5-${mode}-to-video-fast`, "wan-2.5", mode === "text" ? [null] : ["animate_image"], { speed: "fast" });+ }++ register("wan2.7-reference-to-video", "wan-2.7", ["references"]);+ register("wan2.7-video-edit", "wan-2.7", ["edit_video"]);+ register("wan2.7-video-extend", "wan-2.7", ["extend_uploaded_video"]);+ register("wan2.2-5b-fast-t2v", "wan-2.2", [null], { speed: "fast" });+ register("wan2.2-spicy-image-to-video", "wan-2.2", ["animate_image"], { profile: "spicy" });+ register("wan2.2-edit-video", "wan-2.2", ["edit_video"]);+ register("wan2.2-spicy-video-extend", "wan-2.2", ["extend_uploaded_video"], { profile: "spicy" });+ register("wan2.2-animate", "wan-2.2", ["motion_transfer"]);+ register("wan2.1-reference-video", "wan-2.1", ["references"]);+ },+});++export const {+ workflowVariants: ALIBABA_WORKFLOW_VARIANTS,+ getConfiguration: getAlibabaConfiguration,+ getVariants: getAlibabaVariants,+ resolveVariant: resolveAlibabaVariant,+ getVariantOptions: getAlibabaVariantOptions,+} = registry;++export const ALIBABA_MODEL_GROUP = Object.freeze({+ copyKey: "alibaba",+ familyNames: ALIBABA_FAMILY_NAMES,+ configurations: registry.configurations,+ workflowVariants: ALIBABA_WORKFLOW_VARIANTS,+ resolveVariant: resolveAlibabaVariant,+ getVariantOptions: getAlibabaVariantOptions,+});diff --git a/packages/studio/src/alibabaParameters.js b/packages/studio/src/alibabaParameters.jsnew file mode 100644index 00000000..d04c5df0--- /dev/null+++ b/packages/studio/src/alibabaParameters.js@@ -0,0 +1,7 @@+import { createNativeVideoParameters } from "./nativeVideoParameters.js";+import { getAlibabaConfiguration, resolveAlibabaVariant } from "./alibabaModels.js";++export const alibabaParameters = createNativeVideoParameters({+ getConfiguration: getAlibabaConfiguration,+ resolveVariant: resolveAlibabaVariant,+});diff --git a/packages/studio/src/components/ModelParameterControls.jsx b/packages/studio/src/components/ModelParameterControls.jsxindex bdda7d50..9d8ea7d4 100644--- a/packages/studio/src/components/ModelParameterControls.jsx+++ b/packages/studio/src/components/ModelParameterControls.jsx@@ -60,7 +60,7 @@ function ScalarInput({ schema, value, onChange, label }) {>{schema.enum.map((option) => (<option key={String(option)} value={String(option)}>- {String(option)}+ {schema.optionLabels?.[option] || String(option)}</option>))}</select>diff --git a/packages/studio/src/components/VideoStudio.jsx b/packages/studio/src/components/VideoStudio.jsxindex eeceab5c..498e490f 100644--- a/packages/studio/src/components/VideoStudio.jsx+++ b/packages/studio/src/components/VideoStudio.jsx@@ -42,7 +42,7 @@ import {getGroupedVideoSelectionAdjustments,} from "../groupedVideoParameters.js";import { migrateSeedanceResolutionSelection } from "../seedanceParameters.js";-import { getVideoModeDescription } from "../videoModelCopy.js";+import { getVideoDurationLabel, getVideoModeDescription } from "../videoModelCopy.js";import {buildReferenceParams,getModelMediaCapabilities,@@ -1091,6 +1091,7 @@ export default function VideoStudio({}), [selectedFamilyId, selectedWorkflowId, selectedModel, selectedResolution, selectedAr, selectedDuration, selectedQuality]);const describeSelectionAdjustments = useCallback((adjustments) => {const valueLabel = (key, value) => {+ if (key === "duration") return getVideoDurationLabel(value, groupCopy);if (key === "profile") return groupCopy.profiles[value]?.label || value;if (key === "speed") return groupCopy.speeds[value] || value;if (key === "resolution" && value === "default") return groupCopy.defaultResolution;@@ -2406,7 +2407,9 @@ export default function VideoStudio({: selectedWorkflowId === "extend_uploaded_video"? copy.placeholders.continueVideo: selectedWorkflowId === "motion_transfer"- ? copy.placeholders.motion+ ? currentModelObj?.promptRequired+ ? copy.placeholders.motion+ : copy.placeholders.motionOptional: v2vMode? currentModelObj?.imageField? currentModelObj?.promptRequired@@ -3224,7 +3227,7 @@ export default function VideoStudio({field={{key: "duration",value: selectedDuration,- options: commonOptions.durations.map((value) => ({ value, label: `${value}s` })),+ options: commonOptions.durations.map((value) => ({ value, label: getVideoDurationLabel(value, groupCopy) })),}}icon={<PromptDurationIcon />}open={openDropdown === "duration"}diff --git a/packages/studio/src/groupedVideoModels.js b/packages/studio/src/groupedVideoModels.jsindex 55aa69e0..bf7c25fa 100644--- a/packages/studio/src/groupedVideoModels.js+++ b/packages/studio/src/groupedVideoModels.js@@ -1,8 +1,9 @@import { SEEDANCE_MODEL_GROUP } from "./seedanceModels.js";import { VEO_MODEL_GROUP } from "./veoModels.js";import { MINIMAX_MODEL_GROUP } from "./minimaxModels.js";+import { ALIBABA_MODEL_GROUP } from "./alibabaModels.js";-const groups = [SEEDANCE_MODEL_GROUP, VEO_MODEL_GROUP, MINIMAX_MODEL_GROUP];+const groups = [SEEDANCE_MODEL_GROUP, VEO_MODEL_GROUP, MINIMAX_MODEL_GROUP, ALIBABA_MODEL_GROUP];const groupByFamilyId = new Map();const configurationByModelId = new Map();const familyNames = {};diff --git a/packages/studio/src/groupedVideoParameters.js b/packages/studio/src/groupedVideoParameters.jsindex f8bedbac..60e65ef4 100644--- a/packages/studio/src/groupedVideoParameters.js+++ b/packages/studio/src/groupedVideoParameters.js@@ -6,6 +6,8 @@ import {import { SEEDANCE_MODEL_GROUP } from "./seedanceModels.js";import { VEO_MODEL_GROUP } from "./veoModels.js";import { MINIMAX_MODEL_GROUP } from "./minimaxModels.js";+import { ALIBABA_MODEL_GROUP } from "./alibabaModels.js";+import { alibabaParameters } from "./alibabaParameters.js";import {getMiniMaxResolutionOptions,getMiniMaxSelectionAdjustments,@@ -19,6 +21,7 @@ import {} from "./veoParameters.js";const groups = [+ { familyNames: ALIBABA_MODEL_GROUP.familyNames, ...alibabaParameters },{familyNames: SEEDANCE_MODEL_GROUP.familyNames,plan: planSeedanceSelection,diff --git a/packages/studio/src/groupedVideoRegistry.js b/packages/studio/src/groupedVideoRegistry.jsnew file mode 100644index 00000000..45ebcf29--- /dev/null+++ b/packages/studio/src/groupedVideoRegistry.js@@ -0,0 +1,88 @@+import { i2vModels, t2vModels, v2vModels } from "./models.js";++const MODEL_IDS = new Set([...t2vModels, ...i2vModels, ...v2vModels].map((model) => model.id));+const EMPTY_OPTIONS = Object.freeze([]);++function coordinateKey({ profile, speed }) {+ return `${profile}\u0000${speed}`;+}++export function createGroupedVideoRegistry({ facetOptions, facetLabels, registerVariants }) {+ const configurations = new Map();+ const selectionIndex = new Map();++ registerVariants((modelId, familyId, workflowIds, facets = {}) => {+ if (!MODEL_IDS.has(modelId)) return;+ const config = Object.freeze({+ familyId, profile: "standard", speed: "standard", service: "standard",+ ...facets, workflowIds: Object.freeze(workflowIds),+ });+ configurations.set(modelId, config);+ let workflows = selectionIndex.get(familyId);+ if (!workflows) selectionIndex.set(familyId, workflows = new Map());+ for (const workflowId of workflowIds) {+ let group = workflows.get(workflowId);+ if (!group) {+ group = { modelIds: [], variants: new Map(), defaultConfiguration: config };+ workflows.set(workflowId, group);+ }+ group.modelIds.push(modelId);+ const key = coordinateKey(config);+ let services = group.variants.get(key);+ if (!services) group.variants.set(key, services = new Map());+ services.set(config.service, modelId);+ }+ });++ for (const workflows of selectionIndex.values()) {+ for (const group of workflows.values()) {+ Object.freeze(group.modelIds);+ group.fields = Object.entries(facetOptions).flatMap(([key, options]) => {+ const values = new Set(group.modelIds.map((modelId) => configurations.get(modelId)[key]));+ return values.size > 1 ? [{+ key, label: facetLabels[key],+ options: Object.freeze(options.filter((option) => values.has(option.value))),+ }] : [];+ });+ }+ }++ const workflowVariants = Object.freeze(Object.fromEntries(+ [...selectionIndex].map(([familyId, workflows]) => [familyId, Object.freeze(Object.fromEntries(+ [...workflows].filter(([workflowId]) => workflowId !== null)+ .map(([workflowId, group]) => [workflowId, group.modelIds]),+ ))]),+ ));++ function getConfiguration(modelId) {+ return configurations.get(modelId) || null;+ }++ function getVariants(familyId, workflowId = null) {+ return selectionIndex.get(familyId)?.get(workflowId)?.modelIds || EMPTY_OPTIONS;+ }++ function resolveVariant({ familyId, workflowId = null, currentModelId = null, changes = {} }) {+ if (Object.keys(changes).some((key) => key !== "profile" && key !== "speed")) return null;+ const group = selectionIndex.get(familyId)?.get(workflowId);+ if (!group) return null;+ const current = getConfiguration(currentModelId);+ const selected = current?.familyId === familyId ? current : group.defaultConfiguration;+ const key = coordinateKey({ ...selected, ...changes });+ const services = group.variants.get(key);+ if (!services) return null;+ if (current?.familyId === familyId && current.workflowIds.includes(workflowId) &&+ coordinateKey(current) === key) return currentModelId;+ return services.get(selected.service) || services.values().next().value;+ }++ function getVariantOptions(familyId, workflowId = null, currentModelId = null) {+ const group = selectionIndex.get(familyId)?.get(workflowId);+ if (!group) return EMPTY_OPTIONS;+ const current = getConfiguration(currentModelId);+ const selected = current?.familyId === familyId ? current : group.defaultConfiguration;+ return group.fields.map((field) => ({ ...field, value: selected[field.key] }));+ }++ return { configurations, workflowVariants, getConfiguration, getVariants, resolveVariant, getVariantOptions };+}diff --git a/packages/studio/src/messages/en/videoStudio.json b/packages/studio/src/messages/en/videoStudio.jsonindex e636fc8e..d228cbfc 100644--- a/packages/studio/src/messages/en/videoStudio.json+++ b/packages/studio/src/messages/en/videoStudio.json@@ -97,7 +97,8 @@"keyframes": "Start & end frames","references": "Use references","edit_video": "Edit video",- "extend_uploaded_video": "Extend video"+ "extend_uploaded_video": "Extend video",+ "motion_transfer": "Transfer motion"},"settings": "Settings","quality": "Quality",@@ -113,13 +114,14 @@"keyframes": "Create a video between two images you choose.","references": "Create a video using uploaded files as guides.","edit_video": "Upload a video and describe your changes.",- "extend_uploaded_video": "Add new footage to the end of an uploaded video."+ "extend_uploaded_video": "Add new footage to the end of an uploaded video.",+ "motion_transfer": "Apply motion from a video to a character image."},"defaultVariant": "Default","advanced": "Advanced","adjustments": {"resolution": "Uses {value}",- "duration": "Duration: {value} s",+ "duration": "Duration: {value}","aspectRatio": "Format: {value}","speed": "Speed: {value}","profile": "Service: {value}",@@ -277,5 +279,77 @@"description": "Add up to 3 custom styles or characters."}}+ },+ "alibaba": {+ "speed": "Speed",+ "speeds": {+ "standard": "Standard speed",+ "fast": "Fast"+ },+ "speedDescriptions": {+ "standard": "",+ "fast": "Faster generation."+ },+ "provider": "Generation service",+ "providerHelp": "Use a different service for the same Wan version.",+ "profiles": {+ "standard": {+ "label": "Standard",+ "description": ""+ },+ "prime": {+ "label": "Prime",+ "description": ""+ },+ "spicy": {+ "label": "Spicy",+ "description": ""+ }+ },+ "durationLabels": {+ "0": "Source length (up to 10s)"+ },+ "fields": {+ "enable_audio": {+ "title": "Generate audio",+ "description": ""+ },+ "thinking_mode": {+ "title": "Prompt reasoning",+ "description": "Help the model interpret complex descriptions."+ },+ "negative_prompt": {+ "title": "Avoid",+ "description": "Describe what to leave out."+ },+ "shot_type": {+ "title": "Shots",+ "description": "Use one continuous shot or several shots.",+ "optionLabels": {+ "single": "Single shot",+ "multi": "Multiple shots"+ }+ },+ "enable_prompt_expansion": {+ "title": "Expand prompt",+ "description": "Let the model add detail to your description."+ },+ "audio_setting": {+ "title": "Audio",+ "description": "Follow your description or keep the source audio.",+ "optionLabels": {+ "auto": "Follow prompt",+ "origin": "Keep original"+ }+ },+ "mode": {+ "title": "Character animation",+ "description": "Animate the character or replace the one in the video.",+ "optionLabels": {+ "animate": "Animate character",+ "replace": "Replace character"+ }+ }+ }}}diff --git a/packages/studio/src/messages/zh/videoStudio.json b/packages/studio/src/messages/zh/videoStudio.jsonindex 4dcb4544..37f1dd23 100644--- a/packages/studio/src/messages/zh/videoStudio.json+++ b/packages/studio/src/messages/zh/videoStudio.json@@ -97,7 +97,8 @@"keyframes": "起始与结束帧","references": "使用参考素材","edit_video": "编辑视频",- "extend_uploaded_video": "延长视频"+ "extend_uploaded_video": "延长视频",+ "motion_transfer": "动作迁移"},"settings": "设置","quality": "质量",@@ -113,13 +114,14 @@"keyframes": "用你选定的两张图片作为首尾帧生成视频。","references": "参考上传的素材生成视频。","edit_video": "上传视频并描述你想修改的内容。",- "extend_uploaded_video": "在上传的视频末尾添加新的片段。"+ "extend_uploaded_video": "在上传的视频末尾添加新的片段。",+ "motion_transfer": "将视频中的动作应用到角色图片。"},"defaultVariant": "默认","advanced": "高级","adjustments": {"resolution": "使用 {value}",- "duration": "时长:{value} 秒",+ "duration": "时长:{value}","aspectRatio": "画面比例:{value}","speed": "速度:{value}","profile": "服务:{value}",@@ -277,5 +279,77 @@"description": "最多添加 3 个自定义风格或角色。"}}+ },+ "alibaba": {+ "speed": "速度",+ "speeds": {+ "standard": "标准速度",+ "fast": "快速"+ },+ "speedDescriptions": {+ "standard": "",+ "fast": "更快生成。"+ },+ "provider": "生成服务",+ "providerHelp": "为同一 Wan 版本选择其他生成服务。",+ "profiles": {+ "standard": {+ "label": "Standard",+ "description": ""+ },+ "prime": {+ "label": "Prime",+ "description": ""+ },+ "spicy": {+ "label": "Spicy",+ "description": ""+ }+ },+ "durationLabels": {+ "0": "原视频时长(最多 10 秒)"+ },+ "fields": {+ "enable_audio": {+ "title": "生成音频",+ "description": ""+ },+ "thinking_mode": {+ "title": "提示词推理",+ "description": "帮助模型理解复杂描述。"+ },+ "negative_prompt": {+ "title": "排除内容",+ "description": "描述不希望出现的内容。"+ },+ "shot_type": {+ "title": "镜头",+ "description": "使用一个连续镜头或多个镜头。",+ "optionLabels": {+ "single": "单镜头",+ "multi": "多镜头"+ }+ },+ "enable_prompt_expansion": {+ "title": "扩展提示词",+ "description": "让模型为描述补充细节。"+ },+ "audio_setting": {+ "title": "音频",+ "description": "按描述处理音频,或保留原音频。",+ "optionLabels": {+ "auto": "按提示词处理",+ "origin": "保留原音频"+ }+ },+ "mode": {+ "title": "角色动画",+ "description": "让角色动起来,或替换视频中的角色。",+ "optionLabels": {+ "animate": "生成角色动画",+ "replace": "替换角色"+ }+ }+ }}}diff --git a/packages/studio/src/minimaxModels.js b/packages/studio/src/minimaxModels.jsindex 66674785..015ef6ff 100644--- a/packages/studio/src/minimaxModels.js+++ b/packages/studio/src/minimaxModels.js@@ -1,4 +1,4 @@-import { i2vModels, t2vModels } from "./models.js";+import { createGroupedVideoRegistry } from "./groupedVideoRegistry.js";export const MINIMAX_FAMILY_NAMES = Object.freeze({"minimax-h3": "MiniMax H3",@@ -18,123 +18,53 @@ const FACET_OPTIONS = Object.freeze({],});const FACET_LABELS = Object.freeze({ profile: "Customization", speed: "Speed" });-const EMPTY_OPTIONS = Object.freeze([]);-const modelIds = new Set([...t2vModels, ...i2vModels].map((model) => model.id));-const configurations = new Map();-const selectionIndex = new Map();--function coordinateKey({ profile, speed }) {- return `${profile}\u0000${speed}`;-}--function register(modelId, familyId, workflowIds, facets = {}) {- if (!modelIds.has(modelId)) return;- const config = Object.freeze({- familyId, profile: "standard", speed: "standard", service: "standard",- ...facets, workflowIds: Object.freeze(workflowIds),- });- configurations.set(modelId, config);- let workflows = selectionIndex.get(familyId);- if (!workflows) selectionIndex.set(familyId, workflows = new Map());- for (const workflowId of workflowIds) {- let group = workflows.get(workflowId);- if (!group) {- group = { modelIds: [], variants: new Map(), defaultConfiguration: config };- workflows.set(workflowId, group);+const registry = createGroupedVideoRegistry({+ facetOptions: FACET_OPTIONS,+ facetLabels: FACET_LABELS,+ registerVariants(register) {+ // Standard/Pro and official/Open endpoints are selected by resolution, while+ // speed and optional LoRA/Spicy profiles remain explicit generation choices.+ for (const familyId of ["minimax-hailuo-02", "minimax-hailuo-2.3"]) {+ for (const service of ["standard", "pro"]) {+ register(`${familyId}-${service}-t2v`, familyId, [null], { service });+ register(`${familyId}-${service}-i2v`, familyId,+ familyId === "minimax-hailuo-02" ? ["animate_image", "keyframes"] : ["animate_image"],+ { service });+ }}- group.modelIds.push(modelId);- const key = coordinateKey(config);- let services = group.variants.get(key);- if (!services) group.variants.set(key, services = new Map());- services.set(config.service, modelId);- }-}--// Standard/Pro and official/Open endpoints are selected by resolution, while-// speed and optional LoRA/Spicy profiles remain explicit generation choices.-for (const familyId of ["minimax-hailuo-02", "minimax-hailuo-2.3"]) {- for (const service of ["standard", "pro"]) {- register(`${familyId}-${service}-t2v`, familyId, [null], { service });- register(`${familyId}-${service}-i2v`, familyId,- familyId === "minimax-hailuo-02" ? ["animate_image", "keyframes"] : ["animate_image"],- { service });- }-}-register("minimax-hailuo-2.3-fast", "minimax-hailuo-2.3", ["animate_image"], { speed: "fast" });--for (const service of ["official", "open"]) {- const stem = `minimax-h3${service === "open" ? "-open" : ""}`;- register(`${stem}-text-to-video`, "minimax-h3", [null], { service });- register(`${stem}-image-to-video`, "minimax-h3", ["animate_image", "keyframes"], { service });- register(`${stem}-reference-to-video`, "minimax-h3", ["references"], { service });-}-for (const [stem, workflowIds] of [- ["text-to-video", [null]],- ["image-to-video", ["animate_image", "keyframes"]],- ["reference-to-video", ["references"]],-]) {- register(`minimax-h3-${stem}-lora`, "minimax-h3", workflowIds, { profile: "lora", service: "open" });-}-register("minimax-h3-image-to-video-spicy", "minimax-h3", ["animate_image", "keyframes"], {- profile: "spicy", service: "open",-});+ register("minimax-hailuo-2.3-fast", "minimax-hailuo-2.3", ["animate_image"], { speed: "fast" });-for (const workflows of selectionIndex.values()) {- for (const group of workflows.values()) {- Object.freeze(group.modelIds);- group.fields = Object.entries(FACET_OPTIONS).flatMap(([key, options]) => {- const values = new Set(group.modelIds.map((modelId) => configurations.get(modelId)[key]));- return values.size > 1 ? [{- key, label: FACET_LABELS[key],- options: Object.freeze(options.filter((option) => values.has(option.value))),- }] : [];+ for (const service of ["official", "open"]) {+ const stem = `minimax-h3${service === "open" ? "-open" : ""}`;+ register(`${stem}-text-to-video`, "minimax-h3", [null], { service });+ register(`${stem}-image-to-video`, "minimax-h3", ["animate_image", "keyframes"], { service });+ register(`${stem}-reference-to-video`, "minimax-h3", ["references"], { service });+ }+ for (const [stem, workflowIds] of [+ ["text-to-video", [null]],+ ["image-to-video", ["animate_image", "keyframes"]],+ ["reference-to-video", ["references"]],+ ]) {+ register(`minimax-h3-${stem}-lora`, "minimax-h3", workflowIds, { profile: "lora", service: "open" });+ }+ register("minimax-h3-image-to-video-spicy", "minimax-h3", ["animate_image", "keyframes"], {+ profile: "spicy", service: "open",});- }-}--export const MINIMAX_WORKFLOW_VARIANTS = Object.freeze(Object.fromEntries(- [...selectionIndex].map(([familyId, workflows]) => [familyId, Object.freeze(Object.fromEntries(- [...workflows].filter(([workflowId]) => workflowId !== null)- .map(([workflowId, group]) => [workflowId, group.modelIds]),- ))]),-));--export function getMiniMaxConfiguration(modelId) {- return configurations.get(modelId) || null;-}--export function getMiniMaxVariants(familyId, workflowId = null) {- return selectionIndex.get(familyId)?.get(workflowId)?.modelIds || EMPTY_OPTIONS;-}--export function resolveMiniMaxVariant({- familyId, workflowId = null, currentModelId = null, changes = {},-}) {- if (Object.keys(changes).some((key) => key !== "profile" && key !== "speed")) return null;- const group = selectionIndex.get(familyId)?.get(workflowId);- if (!group) return null;- const current = getMiniMaxConfiguration(currentModelId);- const selected = current?.familyId === familyId ? current : group.defaultConfiguration;- const key = coordinateKey({ ...selected, ...changes });- const services = group.variants.get(key);- if (!services) return null;- if (current?.familyId === familyId && current.workflowIds.includes(workflowId) &&- coordinateKey(current) === key) return currentModelId;- return services.get(selected.service) || services.values().next().value;-}+ },+});-export function getMiniMaxVariantOptions(familyId, workflowId = null, currentModelId = null) {- const group = selectionIndex.get(familyId)?.get(workflowId);- if (!group) return EMPTY_OPTIONS;- const current = getMiniMaxConfiguration(currentModelId);- const selected = current?.familyId === familyId ? current : group.defaultConfiguration;- return group.fields.map((field) => ({ ...field, value: selected[field.key] }));-}+export const {+ workflowVariants: MINIMAX_WORKFLOW_VARIANTS,+ getConfiguration: getMiniMaxConfiguration,+ getVariants: getMiniMaxVariants,+ resolveVariant: resolveMiniMaxVariant,+ getVariantOptions: getMiniMaxVariantOptions,+} = registry;export const MINIMAX_MODEL_GROUP = Object.freeze({copyKey: "minimax",familyNames: MINIMAX_FAMILY_NAMES,- configurations,+ configurations: registry.configurations,workflowVariants: MINIMAX_WORKFLOW_VARIANTS,resolveVariant: resolveMiniMaxVariant,getVariantOptions: getMiniMaxVariantOptions,diff --git a/packages/studio/src/modelFamilies.js b/packages/studio/src/modelFamilies.jsindex 5701a3dd..7bec3d67 100644--- a/packages/studio/src/modelFamilies.js+++ b/packages/studio/src/modelFamilies.js@@ -805,7 +805,7 @@ function buildVideoModelMenuEntries() {for (const [mode, workflowIds] of Object.entries({t2v: [null],i2v: ["animate_image", "keyframes", "references"],- v2v: ["edit_video", "extend_uploaded_video"],+ v2v: ["edit_video", "extend_uploaded_video", "motion_transfer"],})) {for (const workflowId of workflowIds) {const variantId = resolveGroupedVideoVariant({ familyId: config.familyId, workflowId });diff --git a/packages/studio/src/modelParameters.js b/packages/studio/src/modelParameters.jsindex 6978dbf0..1d7f12c1 100644--- a/packages/studio/src/modelParameters.js+++ b/packages/studio/src/modelParameters.js@@ -31,7 +31,7 @@ export function getSupplementalModelInputs(model) {if (!model?.inputs) return [];const mediaKeys = mediaInputKeys(model);return Object.entries(model.inputs)- .filter(([key]) => !COMMON_INPUT_KEYS.has(key) && !mediaKeys.has(key))+ .filter(([key, schema]) => (schema.configurable || !COMMON_INPUT_KEYS.has(key)) && !mediaKeys.has(key)).map(([key, schema]) => ({ key, schema }));}diff --git a/packages/studio/src/models.js b/packages/studio/src/models.jsindex eabdc155..115807c2 100644--- a/packages/studio/src/models.js+++ b/packages/studio/src/models.js@@ -57,6 +57,24 @@ const MINIMAX_H3_OPEN_SEED_INPUT = Object.freeze({default: -1,});+// Wan inputs verified against https://api.muapi.ai/openapi.json on 2026-09-09.+const WAN_AUDIO_INPUT = Object.freeze({+ type: "string", field: "audio", title: "Guiding audio", name: "audio_url",+ description: "Audio to guide the video.",+});+const WAN_NEGATIVE_PROMPT_INPUT = Object.freeze({+ type: "string", title: "Negative prompt", name: "negative_prompt",+ description: "What to leave out of the video.",+});+const WAN_22_RESOLUTION_INPUT = Object.freeze({+ type: "string", title: "Resolution", name: "resolution",+ enum: Object.freeze(["480p", "720p"]), default: "480p",+});+const WAN_27_RESOLUTION_INPUT = Object.freeze({+ type: "string", title: "Resolution", name: "resolution",+ enum: Object.freeze(["720p", "1080p"]), default: "720p",+});+export const t2iModels = [{"id": "nano-banana",@@ -4859,6 +4877,7 @@ export const t2vModels = ["id": "wan2.5-text-to-video","name": "Wan 2.5","inputs": {+ "audio_url": WAN_AUDIO_INPUT,"prompt": {"type": "string","title": "Prompt",@@ -4906,6 +4925,7 @@ export const t2vModels = ["id": "wan2.5-text-to-video-fast","name": "Wan 2.5 Fast","inputs": {+ "audio_url": WAN_AUDIO_INPUT,"prompt": {"type": "string","title": "Prompt",@@ -4952,6 +4972,11 @@ export const t2vModels = ["id": "wan2.6-text-to-video","name": "Wan 2.6","inputs": {+ "shot_type": {+ "type": "string", "title": "Shots", "name": "shot_type",+ "enum": ["single", "multi"], "default": "single"+ },+ "audio_url": WAN_AUDIO_INPUT,"prompt": {"type": "string","title": "Prompt",@@ -14152,7 +14177,10 @@ export const i2vModels = ["family": "wan2.5","imageField": "image_url","hasPrompt": true,+ "promptRequired": true,+ "aspectRatioMode": "inherited","inputs": {+ "audio_url": WAN_AUDIO_INPUT,"prompt": {"type": "string","title": "Prompt",@@ -14195,7 +14223,10 @@ export const i2vModels = ["family": "wan2.5","imageField": "image_url","hasPrompt": true,+ "promptRequired": true,+ "aspectRatioMode": "inherited","inputs": {+ "audio_url": WAN_AUDIO_INPUT,"prompt": {"type": "string","title": "Prompt",@@ -15397,6 +15428,7 @@ export const i2vModels = ["family": "wan2.2","imageField": "image_url","hasPrompt": true,+ "aspectRatioMode": "inherited","promptRequired": true,"inputs": {"prompt": {@@ -15441,7 +15473,10 @@ export const i2vModels = ["family": "wan2.6","imageField": "image_url","hasPrompt": true,+ "promptRequired": true,+ "aspectRatioMode": "inherited","inputs": {+ "audio_url": WAN_AUDIO_INPUT,"prompt": {"type": "string","title": "Prompt",@@ -16583,6 +16618,7 @@ export const i2vModels = ["imageField": "image_url","lastImageField": "last_image","hasPrompt": true,+ "aspectRatioMode": "inherited","promptRequired": true,"inputs": {"prompt": {@@ -16653,6 +16689,7 @@ export const i2vModels = ["endpoint": "wan2.7-reference-to-video","family": "wan2.7","imageField": "images_list",+ "imageOptional": true,"hasPrompt": true,"promptRequired": true,"inputs": {@@ -24716,6 +24753,9 @@ export const v2vModels = ["videoField": "video_url","hasPrompt": true,"promptRequired": true,+ "inputs": {+ "resolution": WAN_22_RESOLUTION_INPUT+ },"description": "Easily modify existing videos using simple text commands.","provider": "alibaba","provider_name": "Alibaba"@@ -24859,6 +24899,13 @@ export const v2vModels = ["videoField": "video_url","hasPrompt": true,"promptRequired": true,+ "inputs": {+ "resolution": WAN_22_RESOLUTION_INPUT,+ "duration": {+ "type": "integer", "title": "Duration", "name": "duration",+ "enum": [5, 8], "default": 5+ }+ },"description": "Wan-2.2-spicy Video Extend continues an existing video by generating new frames that match the original style but add stronger motion, bolder effects, and spicier dramatics.","provider": "alibaba","provider_name": "Alibaba"@@ -24963,6 +25010,15 @@ export const v2vModels = ["audioField": "audio_url","hasPrompt": true,"promptRequired": true,+ "inputs": {+ "audio_url": WAN_AUDIO_INPUT,+ "negative_prompt": WAN_NEGATIVE_PROMPT_INPUT,+ "resolution": WAN_27_RESOLUTION_INPUT,+ "duration": {+ "type": "integer", "title": "Duration", "name": "duration",+ "minValue": 5, "maxValue": 15, "default": 5+ }+ },"description": "Extend existing videos seamlessly with Wan 2.7.","provider": "alibaba","provider_name": "Alibaba"@@ -24978,6 +25034,20 @@ export const v2vModels = ["imageOptional": true,"hasPrompt": true,"promptRequired": true,+ "inputs": {+ "negative_prompt": WAN_NEGATIVE_PROMPT_INPUT,+ "resolution": WAN_27_RESOLUTION_INPUT,+ "duration": {+ "type": "integer", "title": "Duration", "name": "duration",+ "description": "Use 0 to match the source video length, up to 10 seconds.",+ "minValue": 0, "maxValue": 10, "default": 0+ },+ "audio_setting": {+ "type": "string", "title": "Audio", "name": "audio_setting",+ "description": "Follow the prompt or keep the source audio.",+ "enum": ["auto", "origin"], "default": "auto"+ }+ },"description": "Perform prompt-driven video editing with multi-image reference support.","provider": "alibaba","provider_name": "Alibaba"@@ -25171,6 +25241,7 @@ export const v2vModels = ["name": "video_url"},"mode": {+ "configurable": true,"enum": ["animate","replace"diff --git a/packages/studio/src/muapi.js b/packages/studio/src/muapi.jsindex 13855ea9..d398ba5f 100644--- a/packages/studio/src/muapi.js+++ b/packages/studio/src/muapi.js@@ -8,7 +8,7 @@ import { buildImageInputPayload, getImageInputValidationError, normalizePrimaryIimport { pollForGenerationResult } from './utils/generationLifecycle.js';import { getModelMediaCapabilities, mapReferenceParams } from './modelCapabilities.js';import { buildSupplementalInputPayload } from './modelParameters.js';-import { getSeedanceConfiguration } from './seedanceModels.js';+import { getGroupedVideoConfiguration } from './groupedVideoModels.js';// In an http(s) browser we route through the host app's proxy (Next.js routes// under /api/* re-issue the call server-side) so api.muapi.ai CORS is bypassed.@@ -221,7 +221,7 @@ export async function processV2V(apiKey, params) {if (modelInfo?.hasPrompt && params.prompt) {payload.prompt = params.prompt;}- if (getSeedanceConfiguration(modelInfo?.id)) {+ if (getGroupedVideoConfiguration(modelInfo?.id)) {for (const field of ['duration', 'aspect_ratio', 'resolution', 'quality']) {if (modelInfo.inputs?.[field] && params[field] !== undefined) {payload[field] = params[field];diff --git a/packages/studio/src/videoModelCopy.js b/packages/studio/src/videoModelCopy.jsindex fc20084e..a9138150 100644--- a/packages/studio/src/videoModelCopy.js+++ b/packages/studio/src/videoModelCopy.js@@ -1,11 +1,14 @@import { getVideoWorkflowMediaSlots } from "./videoWorkflows.js";+export function getVideoDurationLabel(value, copy) {+ return copy.durationLabels?.[value] || `${value}s`;+}+export function getVideoModeDescription(model, workflowId, copy) {const description = copy.modeDescriptions[workflowId || "text"];if (workflowId !== "references" || !model) return description;- const media = getVideoWorkflowMediaSlots(model, workflowId)- .map((slot) => copy.referenceMediaTypes[slot.mediaType])- .join(" · ");+ const media = [...new Set(getVideoWorkflowMediaSlots(model, workflowId)+ .map((slot) => copy.referenceMediaTypes[slot.mediaType]))].join(" · ");return `${description} ${copy.referenceSupport.replace("{media}", media)}`;}diff --git a/packages/studio/src/videoModelParameters.js b/packages/studio/src/videoModelParameters.jsindex bf8e108a..ae5859e2 100644--- a/packages/studio/src/videoModelParameters.js+++ b/packages/studio/src/videoModelParameters.js@@ -34,6 +34,8 @@ export function matchingVideoParameterValue(options, value) {function nearestDuration(options, value) {if (value === undefined || value === null || value === "" || !Number.isFinite(Number(value))) return undefined;+ // Zero means source length; use the target model's default when unsupported.+ if (Number(value) === 0) return undefined;let nearest;for (const option of options) {if (Number.isFinite(Number(option)) &&diff --git a/packages/studio/src/videoWorkflows.js b/packages/studio/src/videoWorkflows.jsindex eba8d7fb..e98c43db 100644--- a/packages/studio/src/videoWorkflows.js+++ b/packages/studio/src/videoWorkflows.js@@ -85,13 +85,6 @@ export const VIDEO_WORKFLOW_VARIANTS = Object.freeze({animate_image: ["grok-imagine-video-1-5-preview"],references: ["grok-imagine-image-to-video"],},- "wan-2.7": {- animate_image: ["wan2.7-image-to-video"],- keyframes: ["wan2.7-image-to-video"],- references: ["wan2.7-reference-to-video"],- edit_video: ["wan2.7-video-edit"],- extend_uploaded_video: ["wan2.7-video-extend"],- },"vidu-q3": {animate_image: ["vidu-q3-turbo-image-to-video", "vidu-q3-pro-image-to-video"],keyframes: ["vidu-q3-turbo-first-last-frames", "vidu-q3-pro-first-last-frames"],@@ -147,16 +140,6 @@ export const VIDEO_WORKFLOW_VARIANTS = Object.freeze({animate_image: ["ltx-2.3-image-to-video"],extend_uploaded_video: ["ltx-2.3-video-extend"],},- "wan-2.2": {- animate_image: ["wan2.2-spicy-image-to-video", "wan2.2-image-to-video"],- keyframes: ["wan2.2-image-to-video"],- edit_video: ["wan2.2-edit-video"],- extend_uploaded_video: ["wan2.2-spicy-video-extend"],- },- "wan-2.1": {- animate_image: ["wan2.1-image-to-video"],- references: ["wan2.1-reference-video"],- },"kling-v2.1": {animate_image: ["kling-v2.1-pro-i2v",