Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(desktop): 支持 Art 插件调用 Seedance 2.5 (#2084)

GaoWei Liu74d049e01a38
diff --git a/apps/desktop/src/main/cindy-proxy-media/types.ts b/apps/desktop/src/main/cindy-proxy-media/types.ts
index e57fa1bab5..c8b9767d3e 100644
--- a/apps/desktop/src/main/cindy-proxy-media/types.ts
+++ b/apps/desktop/src/main/cindy-proxy-media/types.ts
@@ -77,6 +77,7 @@ export type GatewayImageModel = (typeof GATEWAY_IMAGE_MODELS)[number]['id'];
export const GATEWAY_VIDEO_MODELS = [
{ id: 'seedance-fast', label: 'Seedance 快速' },
{ id: 'seedance-pro', label: 'Seedance Pro' },
+ { id: 'bytedance/seedance-2.5', label: 'Seedance 2.5' },
{ id: 'happyhorse', label: 'HappyHorse 1.0' },
] as const;
diff --git a/apps/desktop/src/main/cindy-proxy-media/video/__tests__/seedanceProvider.test.ts b/apps/desktop/src/main/cindy-proxy-media/video/__tests__/seedanceProvider.test.ts
index 4b7977da7c..14c9bfed5f 100644
--- a/apps/desktop/src/main/cindy-proxy-media/video/__tests__/seedanceProvider.test.ts
+++ b/apps/desktop/src/main/cindy-proxy-media/video/__tests__/seedanceProvider.test.ts
@@ -32,6 +32,14 @@ describe('seedance provider · capabilities', () => {
true,
);
});
+ it('exposes the catalog Seedance 2.5 id as an explicit opt-in model', () => {
+ expect(
+ p.capabilities.modelAliases.find((a) => a.alias === 'bytedance/seedance-2.5'),
+ ).toMatchObject({
+ internalModel: 'doubao-seedance-2-5-260628',
+ });
+ expect(p.capabilities.expectedSecondsByAlias['bytedance/seedance-2.5']).toBe(300);
+ });
it('首尾帧模式上限 2 张,参考图模式 9 张(同一个 2.0 模型的两种 role)', () => {
expect(p.capabilities.maxImagesByRefMode).toEqual({
first_and_last_frame: 2,
@@ -153,6 +161,21 @@ describe('seedance provider · submit body shape', () => {
expect(body.content[2].role).toBe('last_frame');
});
+ it('Seedance 2.5: translates the catalog id to the Volcengine model id', async () => {
+ const fetchMock = vi.fn(async () =>
+ new Response(JSON.stringify({ id: 'cgt-FAKE-25' }), { status: 200 }),
+ ) as unknown as typeof fetch;
+ const p = makeProvider(fetchMock);
+ const handle = await p.submit(
+ { prompt: '一只猫在雨里奔跑' },
+ 'bytedance/seedance-2.5',
+ );
+ const init = (fetchMock as unknown as ReturnType<typeof vi.fn>).mock.calls[0][1] as RequestInit;
+ const body = JSON.parse(init.body as string);
+ expect(body.model).toBe('doubao-seedance-2-5-260628');
+ expect(handle.modelUsed).toBe('doubao-seedance-2-5-260628');
+ });
+
it('refMode:reference_image → 每张图都是 role:reference_image,顺序原样保留', async () => {
const fetchMock = vi.fn(async () =>
new Response(JSON.stringify({ id: 'cgt-FAKE-4' }), { status: 200 }),
diff --git a/apps/desktop/src/main/cindy-proxy-media/video/providers/seedance.ts b/apps/desktop/src/main/cindy-proxy-media/video/providers/seedance.ts
index 40e02ce37c..d8ef132128 100644
--- a/apps/desktop/src/main/cindy-proxy-media/video/providers/seedance.ts
+++ b/apps/desktop/src/main/cindy-proxy-media/video/providers/seedance.ts
@@ -1,13 +1,14 @@
/**
* art/video/providers/seedance.ts
* ---------------------------------------------------------------------------
- * VideoProvider implementation for Volcengine ARK doubao-seedance-2-0,
+ * VideoProvider implementation for Volcengine ARK Doubao Seedance 2.x models,
* routed through XD Gateway's `/volcengine/api/v3/contents/generations/tasks`
* passthrough.
*
- * Two model tiers exposed:
+ * Three model choices exposed:
* - 'seedance-fast' → doubao-seedance-2-0-fast-260128 (≈2min, default)
* - 'seedance-pro' → doubao-seedance-2-0-260128 (≈5min, quality tier)
+ * - 'bytedance/seedance-2.5' → doubao-seedance-2-5-260628 (explicit opt-in)
*
* API quirks worth knowing:
* - Submit body uses Volcengine's chat-style `content` array:
@@ -67,6 +68,11 @@ const CAPABILITIES: VideoProviderCapabilities = {
summary: '精(~5min) - 用户显式要"高质量"再选',
internalModel: 'doubao-seedance-2-0-260128',
},
+ {
+ alias: 'bytedance/seedance-2.5',
+ summary: 'Seedance 2.5(~5min) - 用户显式点名 2.5 再选',
+ internalModel: 'doubao-seedance-2-5-260628',
+ },
],
supportedDurations: [4, 6, 8, 10],
supportedResolutions: ['480p', '720p', '1080p'],
@@ -90,6 +96,7 @@ const CAPABILITIES: VideoProviderCapabilities = {
expectedSecondsByAlias: {
'seedance-fast': 120,
'seedance-pro': 300,
+ 'bytedance/seedance-2.5': 300,
},
defaults: {
duration: 4,
diff --git a/apps/desktop/src/main/maker-host/__tests__/providerAccessPolicy.test.ts b/apps/desktop/src/main/maker-host/__tests__/providerAccessPolicy.test.ts
index c27e60cbd0..a82ef8ac89 100644
--- a/apps/desktop/src/main/maker-host/__tests__/providerAccessPolicy.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/providerAccessPolicy.test.ts
@@ -38,6 +38,7 @@ function catalog(): Catalog {
{ ...model('gpt-image-2'), group: 'image' },
{ ...model('seedance-fast'), group: 'video' },
{ ...model('seedance-pro'), group: 'video' },
+ { ...model('bytedance/seedance-2.5'), group: 'video' },
{ ...model('happyhorse'), group: 'video' },
{ ...model('voyage/voyage-4'), group: 'embedding' },
]);
@@ -49,6 +50,7 @@ function catalog(): Catalog {
xd.videoModels = [
{ id: 'seedance-fast', name: 'Seedance Fast' },
{ id: 'seedance-pro', name: 'Seedance Pro' },
+ { id: 'bytedance/seedance-2.5', name: 'Seedance 2.5' },
{ id: 'happyhorse', name: 'HappyHorse' },
];
xd.videoDefaults = {
@@ -114,6 +116,7 @@ describe('provider access policy', () => {
expect(xd?.videoModels?.map((item) => item.id)).toEqual([
'seedance-fast',
'seedance-pro',
+ 'bytedance/seedance-2.5',
]);
expect(xd?.videoDefaults).toEqual({
standard: 'seedance-fast',
@@ -125,6 +128,7 @@ describe('provider access policy', () => {
'xd-only-model',
'seedance-fast',
'seedance-pro',
+ 'bytedance/seedance-2.5',
]);
expect(xd?.models.codex).toEqual([]);
},
@@ -165,7 +169,11 @@ describe('projectProviderCatalogForBuildRegion — 用户自有媒体来源', ()
const xd = projected.providers.find((p) => p.id === 'xd');
expect(xd?.imageModels).toEqual([]);
expect(xd?.imageDefaults).toBeUndefined();
- expect(xd?.videoModels?.map((m) => m.id)).toEqual(['seedance-fast', 'seedance-pro']);
+ expect(xd?.videoModels?.map((m) => m.id)).toEqual([
+ 'seedance-fast',
+ 'seedance-pro',
+ 'bytedance/seedance-2.5',
+ ]);
});
it.each(['cn', 'dev'] as const)(
diff --git a/apps/desktop/src/main/maker-host/provider-access-policy.ts b/apps/desktop/src/main/maker-host/provider-access-policy.ts
index 9a29465bc1..0eca54cabd 100644
--- a/apps/desktop/src/main/maker-host/provider-access-policy.ts
+++ b/apps/desktop/src/main/maker-host/provider-access-policy.ts
@@ -17,6 +17,7 @@ const CINDY_AI_PROVIDER_ID = 'xd';
const MAINLAND_VIDEO_MODEL_IDS: ReadonlySet<string> = new Set([
'seedance-fast',
'seedance-pro',
+ 'bytedance/seedance-2.5',
]);
function projectVideoDefaults(
diff --git a/packages/model-providers/src/builtin.ts b/packages/model-providers/src/builtin.ts
index 760ab9b2d6..b46bea3bfa 100644
--- a/packages/model-providers/src/builtin.ts
+++ b/packages/model-providers/src/builtin.ts
@@ -174,6 +174,7 @@ const XD_PROVIDER: Provider = {
videoModels: [
{ id: 'seedance-fast', name: 'Seedance 快速' },
{ id: 'seedance-pro', name: 'Seedance Pro' },
+ { id: 'bytedance/seedance-2.5', name: 'Seedance 2.5' },
{ id: 'happyhorse', name: 'HappyHorse 1.0' },
],
videoDefaults: {