174 lines
3.9 KiB
TypeScript
174 lines
3.9 KiB
TypeScript
// Generated by go generate ./internal/canvas/contract. Do not edit.
|
|
export const GENERATION_CONTRACT_VERSION = 1;
|
|
export const GENERATION_LIMITS = { nodeTitle: 240, prompt: 16000, canvasOperations: 20 } as const;
|
|
|
|
export type ModelSelection = { kind: "logical"; logicalModelId: string; channelId?: never; modelKey?: never } | { kind: "channel"; channelId: string; modelKey: string; logicalModelId?: never };
|
|
|
|
export type Options = {
|
|
size?: string;
|
|
quality?: string;
|
|
count?: number;
|
|
transparentBackground?: boolean;
|
|
durationSeconds?: number;
|
|
resolution?: string;
|
|
generateAudio?: boolean;
|
|
watermark?: boolean;
|
|
audioVoice?: string;
|
|
audioFormat?: string;
|
|
audioSpeed?: string;
|
|
audioLanguage?: string;
|
|
audioDialect?: string;
|
|
audioInstructions?: string;
|
|
};
|
|
|
|
export type ReferenceBinding = {
|
|
id: string;
|
|
nodeId?: string;
|
|
resourceId?: string;
|
|
transientId?: string;
|
|
mediaType: "image" | "video" | "audio" | "text";
|
|
role: "reference" | "source-text" | "first-frame" | "last-frame" | "mask";
|
|
order: number;
|
|
resolution: "latest" | "snapshot";
|
|
};
|
|
|
|
export type GenerationSpec = {
|
|
version: number;
|
|
mode: "image" | "video" | "audio";
|
|
prompt: string;
|
|
modelSelection?: ModelSelection;
|
|
options: Options;
|
|
referenceBindings: ReferenceBinding[];
|
|
textInputMode: "prompt-only" | "append-sources";
|
|
};
|
|
|
|
export const GENERATION_OPTION_FIELDS = [
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"image",
|
|
"video"
|
|
],
|
|
"name": "size",
|
|
"node": "size",
|
|
"task": "size"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"image"
|
|
],
|
|
"name": "quality",
|
|
"node": "quality",
|
|
"task": "quality"
|
|
},
|
|
{
|
|
"kind": "number",
|
|
"modes": [
|
|
"image"
|
|
],
|
|
"name": "count",
|
|
"node": "count",
|
|
"task": "count"
|
|
},
|
|
{
|
|
"kind": "boolean",
|
|
"modes": [
|
|
"image"
|
|
],
|
|
"name": "transparentBackground",
|
|
"node": "transparentBackground",
|
|
"task": "transparentBackground"
|
|
},
|
|
{
|
|
"kind": "number",
|
|
"modes": [
|
|
"video"
|
|
],
|
|
"name": "durationSeconds",
|
|
"node": "seconds",
|
|
"task": "videoSeconds"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"video"
|
|
],
|
|
"name": "resolution",
|
|
"node": "vquality",
|
|
"task": "vquality"
|
|
},
|
|
{
|
|
"kind": "boolean",
|
|
"modes": [
|
|
"video"
|
|
],
|
|
"name": "generateAudio",
|
|
"node": "generateAudio",
|
|
"task": "videoGenerateAudio"
|
|
},
|
|
{
|
|
"kind": "boolean",
|
|
"modes": [
|
|
"video"
|
|
],
|
|
"name": "watermark",
|
|
"node": "watermark",
|
|
"task": "videoWatermark"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"audio"
|
|
],
|
|
"name": "audioVoice",
|
|
"node": "audioVoice",
|
|
"task": "audioVoice"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"audio"
|
|
],
|
|
"name": "audioFormat",
|
|
"node": "audioFormat",
|
|
"task": "audioFormat"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"audio"
|
|
],
|
|
"name": "audioSpeed",
|
|
"node": "audioSpeed",
|
|
"task": "audioSpeed"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"audio"
|
|
],
|
|
"name": "audioLanguage",
|
|
"node": "audioLanguage",
|
|
"task": "audioLanguage"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"audio"
|
|
],
|
|
"name": "audioDialect",
|
|
"node": "audioDialect",
|
|
"task": "audioDialect"
|
|
},
|
|
{
|
|
"kind": "string",
|
|
"modes": [
|
|
"audio"
|
|
],
|
|
"name": "audioInstructions",
|
|
"node": "audioInstructions",
|
|
"task": "audioInstructions"
|
|
}
|
|
] as const;
|