mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:10:45 +00:00
feat(fal): support Seedance reference video
Adds fal Seedance 2.0 reference-to-video support with model-aware reference input limits.
This commit is contained in:
@@ -6,6 +6,18 @@ import type {
|
||||
} from "../../../src/plugins/types.js";
|
||||
import { listSupportedVideoGenerationModes } from "../../../src/video-generation/capabilities.js";
|
||||
|
||||
function hasPositiveModeLimit(
|
||||
value: number | undefined,
|
||||
valuesByModel: Readonly<Record<string, number>> | undefined,
|
||||
): boolean {
|
||||
return (
|
||||
(value ?? 0) > 0 ||
|
||||
Object.values(valuesByModel ?? {}).some(
|
||||
(modelValue) => Number.isFinite(modelValue) && modelValue > 0,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function expectExplicitVideoGenerationCapabilities(
|
||||
provider: VideoGenerationProviderPlugin,
|
||||
): void {
|
||||
@@ -28,16 +40,16 @@ export function expectExplicitVideoGenerationCapabilities(
|
||||
|
||||
if (imageToVideo?.enabled) {
|
||||
expect(
|
||||
imageToVideo.maxInputImages ?? 0,
|
||||
`${provider.id} imageToVideo.enabled requires maxInputImages`,
|
||||
).toBeGreaterThan(0);
|
||||
hasPositiveModeLimit(imageToVideo.maxInputImages, imageToVideo.maxInputImagesByModel),
|
||||
`${provider.id} imageToVideo.enabled requires maxInputImages or maxInputImagesByModel`,
|
||||
).toBe(true);
|
||||
expect(supportedModes).toContain("imageToVideo");
|
||||
}
|
||||
if (videoToVideo?.enabled) {
|
||||
expect(
|
||||
videoToVideo.maxInputVideos ?? 0,
|
||||
`${provider.id} videoToVideo.enabled requires maxInputVideos`,
|
||||
).toBeGreaterThan(0);
|
||||
hasPositiveModeLimit(videoToVideo.maxInputVideos, videoToVideo.maxInputVideosByModel),
|
||||
`${provider.id} videoToVideo.enabled requires maxInputVideos or maxInputVideosByModel`,
|
||||
).toBe(true);
|
||||
expect(supportedModes).toContain("videoToVideo");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user