Browse Source

feat(annotate): 派生节点类型与 annotate operation 基础支持

- createDerivedImageNode 支持可选 size
- derivedImage.operation 增加 annotate
- SMART_IMAGE_AUTO_TASK_OPERATIONS 加入 annotate(仅强制图片源、不进执行器)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feature/handleReconstruction
Luckyu_js 3 days ago
parent
commit
11adf1b972
  1. 2
      src/types/nodes.ts
  2. 4
      src/utils/derivedImageNodes.ts
  3. 4
      src/utils/smartMediaMode.ts

2
src/types/nodes.ts

@ -102,7 +102,7 @@ export interface ImageInputNodeData extends BaseNodeData {
isOptional?: boolean;
derivedImage?: {
sourceNodeId: string;
operation: "crop" | "multiAngle" | "splitGrid" | "highDefinition" | "outpainting" | "inpainting" | "videoFrame";
operation: "crop" | "multiAngle" | "splitGrid" | "highDefinition" | "outpainting" | "inpainting" | "videoFrame" | "annotate";
task?: DerivedImageTask;
};
}

4
src/utils/derivedImageNodes.ts

@ -30,6 +30,7 @@ export interface CreateDerivedImageNodeOptions {
dimensions?: { width: number; height: number } | null;
customTitle: string;
operation: DerivedImageOperation;
size?: DerivedImageNodeSize;
addNode: AddSmartImageNode;
onConnect: (connection: Connection) => void;
selectSingleNode?: (nodeId: string) => void;
@ -59,6 +60,7 @@ export function createDerivedImageNode({
dimensions = null,
customTitle,
operation,
size,
addNode,
onConnect,
selectSingleNode,
@ -75,7 +77,7 @@ export function createDerivedImageNode({
sourceNodeId,
operation,
},
});
}, size);
onConnect({
source: sourceNodeId,

4
src/utils/smartMediaMode.ts

@ -7,8 +7,8 @@ export type SmartImageMode = "neutral" | "image" | "generate";
export type SmartVideoMode = "neutral" | "video" | "generate";
export type SmartAudioMode = "empty" | "audio" | "generate";
export type SmartImageAutoTaskOperation = "crop" | "splitGrid" | "multiAngle" | "highDefinition" | "outpainting" | "inpainting" | "videoFrame";
export const SMART_IMAGE_AUTO_TASK_OPERATIONS: SmartImageAutoTaskOperation[] = ["crop", "splitGrid", "multiAngle", "highDefinition", "outpainting", "inpainting", "videoFrame"];
export type SmartImageAutoTaskOperation = "crop" | "splitGrid" | "multiAngle" | "highDefinition" | "outpainting" | "inpainting" | "videoFrame" | "annotate";
export const SMART_IMAGE_AUTO_TASK_OPERATIONS: SmartImageAutoTaskOperation[] = ["crop", "splitGrid", "multiAngle", "highDefinition", "outpainting", "inpainting", "videoFrame", "annotate"];
export const SMART_IMAGE_LOCAL_DERIVED_TASK_OPERATIONS: SmartImageAutoTaskOperation[] = ["crop", "splitGrid", "videoFrame"];
export const SMART_IMAGE_AI_DERIVED_TASK_OPERATIONS: SmartImageAutoTaskOperation[] = ["multiAngle", "highDefinition", "outpainting", "inpainting"];
export const SMART_IMAGE_AI_STATIC_DERIVED_TASK_OPERATIONS: SmartImageAutoTaskOperation[] = ["multiAngle", "outpainting", "inpainting"];

Loading…
Cancel
Save