feat(canvas): add video-prompt node and enhance video generation support

- Introduced a new node type "video-prompt" for AI video generation, including its integration into the canvas command palette and node template picker.
- Updated connection validation to allow connections from text nodes to video-prompt and from video-prompt to ai-video nodes.
- Enhanced error handling and messaging for video generation failures, including specific cases for provider issues.
- Added tests to validate new video-prompt functionality and connection policies.
- Updated localization files to include new labels and prompts for video-prompt and ai-video nodes.
This commit is contained in:
2026-04-07 08:50:59 +02:00
parent 456b910532
commit ed08b976f9
28 changed files with 2899 additions and 9 deletions

View File

@@ -28,6 +28,8 @@ export type CanvasConnectionValidationReason =
| "incomplete"
| "self-loop"
| "unknown-node"
| "ai-video-source-invalid"
| "video-prompt-target-invalid"
| "adjustment-source-invalid"
| "adjustment-incoming-limit"
| "compare-incoming-limit"
@@ -41,7 +43,19 @@ export function validateCanvasConnectionPolicy(args: {
}): CanvasConnectionValidationReason | null {
const { sourceType, targetType, targetIncomingCount } = args;
if (isAdjustmentNodeType(targetType)) {
if (targetType === "ai-video" && sourceType !== "video-prompt") {
return "ai-video-source-invalid";
}
if (sourceType === "video-prompt" && targetType !== "ai-video") {
return "video-prompt-target-invalid";
}
if (targetType === "render" && !RENDER_ALLOWED_SOURCE_TYPES.has(sourceType)) {
return "render-source-invalid";
}
if (isAdjustmentNodeType(targetType) && targetType !== "render") {
if (!ADJUSTMENT_ALLOWED_SOURCE_TYPES.has(sourceType)) {
return "adjustment-source-invalid";
}
@@ -54,10 +68,6 @@ export function validateCanvasConnectionPolicy(args: {
return "compare-incoming-limit";
}
if (targetType === "render" && !RENDER_ALLOWED_SOURCE_TYPES.has(sourceType)) {
return "render-source-invalid";
}
if (
isAdjustmentNodeType(sourceType) &&
ADJUSTMENT_DISALLOWED_TARGET_TYPES.has(targetType)
@@ -78,6 +88,10 @@ export function getCanvasConnectionValidationMessage(
return "Node kann nicht mit sich selbst verbunden werden.";
case "unknown-node":
return "Verbindung enthaelt unbekannte Nodes.";
case "ai-video-source-invalid":
return "KI-Video-Ausgabe akzeptiert nur Eingaben von KI-Video.";
case "video-prompt-target-invalid":
return "KI-Video kann nur mit KI-Video-Ausgabe verbunden werden.";
case "adjustment-source-invalid":
return "Adjustment-Nodes akzeptieren nur Bild-, Asset-, KI-Bild- oder Adjustment-Input.";
case "adjustment-incoming-limit":