ugcinc 4.5.15 → 4.5.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  import type { TextValue, ImageValue, VideoValue } from '../types';
2
2
  import { type OutputMode, type SelectionMode } from './types';
3
3
  export interface GenerateVideoNodeInputs {
4
- prompt: TextValue;
5
- /** Only present when using an image-to-video model */
4
+ /** Only present when promptIsVariable is true */
5
+ prompt?: TextValue;
6
+ /** Only present when using an image-to-video model with imageIsVariable true */
6
7
  image?: ImageValue;
7
8
  }
8
9
  export interface GenerateVideoNodeOutputs {
@@ -22,22 +23,33 @@ interface VideoDurationOption {
22
23
  name: string;
23
24
  }
24
25
  interface VideoModelOption {
25
- id: VideoGenerationModel;
26
+ id: VideoGenerationTextToVideoModel;
26
27
  name: string;
27
28
  provider: VideoModelProvider;
28
- isImageToVideo: boolean;
29
29
  tier: VideoModelTier;
30
30
  aspectRatios: VideoAspectRatioOption[];
31
31
  durations: VideoDurationOption[];
32
+ /** Image-to-video variant of this model, if one exists */
33
+ i2vId?: VideoGenerationImageToVideoModel;
32
34
  }
33
35
  declare const ALL_VIDEO_MODELS: VideoModelOption[];
34
- declare function isImageToVideoModel(model: VideoGenerationModel): model is VideoGenerationImageToVideoModel;
36
+ /** @deprecated Use getImageToVideoModelId instead — I2V mode is auto-detected from image input */
37
+ declare function isImageToVideoModel(model: string): boolean;
38
+ /** Get the image-to-video model ID for a base model */
39
+ declare function getImageToVideoModelId(model: string): VideoGenerationImageToVideoModel | null;
40
+ /** Check if a model has an image-to-video variant */
41
+ declare function hasImageToVideoVariant(model: string): boolean;
35
42
  declare function getModelAspectRatios(modelId: string): VideoAspectRatioOption[];
36
43
  declare function getModelDurations(modelId: string): VideoDurationOption[];
37
44
  declare const definition: import("./types").NodeDefinition<"generate-video", "generator", {
38
45
  model: VideoGenerationModel;
39
46
  aspectRatio: string;
40
47
  duration: number;
48
+ prompt: string;
49
+ promptIsVariable: boolean;
50
+ imageIsVariable: boolean;
51
+ imageMediaId: string | null;
52
+ imageMediaUrl: string | null;
41
53
  outputMode: OutputMode;
42
54
  selectionMode: SelectionMode | null;
43
55
  }, GenerateVideoNodeInputs, GenerateVideoNodeOutputs, false>;
@@ -46,6 +58,6 @@ declare const _default: typeof definition & {
46
58
  __TOutputs: GenerateVideoNodeOutputs;
47
59
  };
48
60
  export default _default;
49
- export { isImageToVideoModel, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDurations };
61
+ export { isImageToVideoModel, getImageToVideoModelId, hasImageToVideoVariant, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDurations };
50
62
  export type { VideoGenerationTextToVideoModel, VideoGenerationImageToVideoModel, VideoGenerationModel, VideoModelProvider, VideoModelTier, VideoAspectRatioOption, VideoDurationOption, VideoModelOption, };
51
63
  export type GenerateVideoNodeConfig = typeof definition.defaults;
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ALL_VIDEO_MODELS = void 0;
4
4
  exports.isImageToVideoModel = isImageToVideoModel;
5
+ exports.getImageToVideoModelId = getImageToVideoModelId;
6
+ exports.hasImageToVideoVariant = hasImageToVideoVariant;
5
7
  exports.getModelAspectRatios = getModelAspectRatios;
6
8
  exports.getModelDurations = getModelDurations;
7
9
  const types_1 = require("./types");
@@ -28,32 +30,42 @@ const DURATIONS_8 = [
28
30
  ];
29
31
  const ALL_VIDEO_MODELS = [
30
32
  // Google Veo 3.1
31
- { id: 'fal-ai/veo3.1', name: 'Veo 3.1', provider: 'google', isImageToVideo: false, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8 },
32
- { id: 'fal-ai/veo3.1/image-to-video', name: 'Veo 3.1 Image', provider: 'google', isImageToVideo: true, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8 },
33
+ { id: 'fal-ai/veo3.1', name: 'Veo 3.1', provider: 'google', tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8, i2vId: 'fal-ai/veo3.1/image-to-video' },
33
34
  // Google Veo 3
34
- { id: 'fal-ai/veo3', name: 'Veo 3', provider: 'google', isImageToVideo: false, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8 },
35
- { id: 'fal-ai/veo3/fast', name: 'Veo 3 Fast', provider: 'google', isImageToVideo: false, tier: 'fast', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8 },
36
- { id: 'fal-ai/veo3/image-to-video', name: 'Veo 3 Image', provider: 'google', isImageToVideo: true, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8 },
35
+ { id: 'fal-ai/veo3', name: 'Veo 3', provider: 'google', tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8, i2vId: 'fal-ai/veo3/image-to-video' },
36
+ { id: 'fal-ai/veo3/fast', name: 'Veo 3 Fast', provider: 'google', tier: 'fast', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_8 },
37
37
  // Kling 2.6
38
- { id: 'fal-ai/kling-video/v2.6/pro/text-to-video', name: 'Kling 2.6 Pro', provider: 'kling', isImageToVideo: false, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10 },
39
- { id: 'fal-ai/kling-video/v2.6/pro/image-to-video', name: 'Kling 2.6 Pro Image', provider: 'kling', isImageToVideo: true, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10 },
38
+ { id: 'fal-ai/kling-video/v2.6/pro/text-to-video', name: 'Kling 2.6 Pro', provider: 'kling', tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10, i2vId: 'fal-ai/kling-video/v2.6/pro/image-to-video' },
40
39
  // Kling 2.5
41
- { id: 'fal-ai/kling-video/v2.5/pro/text-to-video', name: 'Kling 2.5 Pro', provider: 'kling', isImageToVideo: false, tier: 'standard', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10 },
42
- { id: 'fal-ai/kling-video/v2.5/pro/image-to-video', name: 'Kling 2.5 Pro Image', provider: 'kling', isImageToVideo: true, tier: 'standard', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10 },
40
+ { id: 'fal-ai/kling-video/v2.5/pro/text-to-video', name: 'Kling 2.5 Pro', provider: 'kling', tier: 'standard', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10, i2vId: 'fal-ai/kling-video/v2.5/pro/image-to-video' },
43
41
  // MiniMax Hailuo
44
- { id: 'fal-ai/minimax/hailuo-2.3/pro/text-to-video', name: 'Hailuo 2.3 Pro', provider: 'minimax', isImageToVideo: false, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT, durations: DURATIONS_5 },
45
- { id: 'fal-ai/minimax/hailuo-2.3/pro/image-to-video', name: 'Hailuo 2.3 Pro Image', provider: 'minimax', isImageToVideo: true, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT, durations: DURATIONS_5 },
42
+ { id: 'fal-ai/minimax/hailuo-2.3/pro/text-to-video', name: 'Hailuo 2.3 Pro', provider: 'minimax', tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT, durations: DURATIONS_5, i2vId: 'fal-ai/minimax/hailuo-2.3/pro/image-to-video' },
46
43
  // Wan 2.6
47
- { id: 'wan/v2.6/text-to-video', name: 'Wan 2.6', provider: 'wan', isImageToVideo: false, tier: 'standard', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5 },
48
- { id: 'wan/v2.6/image-to-video', name: 'Wan 2.6 Image', provider: 'wan', isImageToVideo: true, tier: 'standard', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5 },
44
+ { id: 'wan/v2.6/text-to-video', name: 'Wan 2.6', provider: 'wan', tier: 'standard', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5, i2vId: 'wan/v2.6/image-to-video' },
49
45
  // Sora
50
- { id: 'fal-ai/sora-2/text-to-video', name: 'Sora 2', provider: 'openai', isImageToVideo: false, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10 },
51
- { id: 'fal-ai/sora-2/image-to-video/pro', name: 'Sora 2 Pro Image', provider: 'openai', isImageToVideo: true, tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10 },
46
+ { id: 'fal-ai/sora-2/text-to-video', name: 'Sora 2', provider: 'openai', tier: 'premium', aspectRatios: LANDSCAPE_PORTRAIT_SQUARE, durations: DURATIONS_5_10, i2vId: 'fal-ai/sora-2/image-to-video/pro' },
52
47
  ];
53
48
  exports.ALL_VIDEO_MODELS = ALL_VIDEO_MODELS;
49
+ /** @deprecated Use getImageToVideoModelId instead — I2V mode is auto-detected from image input */
54
50
  function isImageToVideoModel(model) {
55
51
  return model.includes('/image-to-video');
56
52
  }
53
+ /** Get the image-to-video model ID for a base model */
54
+ function getImageToVideoModelId(model) {
55
+ // If already an I2V model (legacy config), return as-is
56
+ if (isImageToVideoModel(model))
57
+ return model;
58
+ const entry = ALL_VIDEO_MODELS.find(m => m.id === model);
59
+ return entry?.i2vId ?? null;
60
+ }
61
+ /** Check if a model has an image-to-video variant */
62
+ function hasImageToVideoVariant(model) {
63
+ // If already an I2V model (legacy config), yes
64
+ if (isImageToVideoModel(model))
65
+ return true;
66
+ const entry = ALL_VIDEO_MODELS.find(m => m.id === model);
67
+ return !!entry?.i2vId;
68
+ }
57
69
  function getModelAspectRatios(modelId) {
58
70
  const model = ALL_VIDEO_MODELS.find(m => m.id === modelId);
59
71
  return model?.aspectRatios ?? LANDSCAPE_PORTRAIT_SQUARE;
@@ -77,15 +89,22 @@ const definition = (0, types_1.defineNode)({
77
89
  model: 'fal-ai/kling-video/v2.6/pro/text-to-video',
78
90
  aspectRatio: '16:9',
79
91
  duration: 5,
92
+ prompt: '',
93
+ promptIsVariable: false,
94
+ imageIsVariable: false,
95
+ imageMediaId: null,
96
+ imageMediaUrl: null,
80
97
  outputMode: 'per-input',
81
98
  selectionMode: null,
82
99
  },
83
100
  computePorts: ({ config }) => {
84
- const model = (config?.model ?? 'fal-ai/kling-video/v2.6/pro/text-to-video');
85
- const inputs = [
86
- { id: 'prompt', type: 'text', isArray: false, required: true },
87
- ];
88
- if (isImageToVideoModel(model)) {
101
+ const promptIsVariable = config?.promptIsVariable ?? true;
102
+ const imageIsVariable = config?.imageIsVariable ?? true;
103
+ const inputs = [];
104
+ if (promptIsVariable) {
105
+ inputs.push({ id: 'prompt', type: 'text', isArray: false, required: true });
106
+ }
107
+ if (imageIsVariable) {
89
108
  inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
90
109
  }
91
110
  return {
@@ -173,6 +173,11 @@ export declare const nodeDefinitions: {
173
173
  model: import("./generate-video").VideoGenerationModel;
174
174
  aspectRatio: string;
175
175
  duration: number;
176
+ prompt: string;
177
+ promptIsVariable: boolean;
178
+ imageIsVariable: boolean;
179
+ imageMediaId: string | null;
180
+ imageMediaUrl: string | null;
176
181
  outputMode: import("./types").OutputMode;
177
182
  selectionMode: import("./types").SelectionMode | null;
178
183
  }, import("./generate-video").GenerateVideoNodeInputs, import("./generate-video").GenerateVideoNodeOutputs, false> & {
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ export { areTypesCompatible, computePortsForNode, computePortsWithPreviews, comp
18
18
  export { nodeDefinitions, internalNodeTypes, isAsyncExecutor, formatPortType, isPortType } from './automations/types';
19
19
  export { getNodeDefinition, getAllNodeDefinitions, getFlowControlNodeTypes, getCapturedSourceNodeTypes } from './automations/nodes';
20
20
  export { isEditModel, getEditModelId, ALL_IMAGE_MODELS, IMAGE_ASPECT_RATIOS } from './automations/nodes/generate-image';
21
- export { isImageToVideoModel, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDurations } from './automations/nodes/generate-video';
21
+ export { isImageToVideoModel, getImageToVideoModelId, hasImageToVideoVariant, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDurations } from './automations/nodes/generate-video';
22
22
  export { selectFromPool } from './automations/selection';
23
23
  export { portId, isValidPortId, portIdToTitle, normalizeToPortId, PortIdSchema } from './port-id';
24
24
  export type { PortId } from './port-id';
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.removePreviewForConnection = exports.updatePreviewMapForConnection = exports.computePreviewMap = exports.computeAllNodePreviews = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.getCapturedNodes = exports.getNodesDownstreamOfSet = exports.getDownstreamNodes = exports.checkCrossContextViolation = exports.getForEachContext = exports.getConnectedSource = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.getInputPreviewValue = exports.computeAllNodePortsWithPreviews = exports.computeAllNodePorts = exports.computePortsWithPreviews = exports.computePortsForNode = exports.areTypesCompatible = exports.submitIMessageDmRenderJob = exports.submitInstagramDmRenderJob = exports.submitAutoCaptionRenderJob = exports.submitScreenshotAnimationRenderJob = exports.submitDeduplicationJob = exports.getRenderJobStatus = exports.submitVideoRenderJob = exports.submitImageRenderJob = exports.BillingClient = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
9
- exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle = exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.getEditModelId = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getAllNodeDefinitions = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = void 0;
9
+ exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle = exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.hasImageToVideoVariant = exports.getImageToVideoModelId = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.getEditModelId = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getAllNodeDefinitions = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = void 0;
10
10
  // =============================================================================
11
11
  // Client Exports
12
12
  // =============================================================================
@@ -116,6 +116,8 @@ Object.defineProperty(exports, "ALL_IMAGE_MODELS", { enumerable: true, get: func
116
116
  Object.defineProperty(exports, "IMAGE_ASPECT_RATIOS", { enumerable: true, get: function () { return generate_image_1.IMAGE_ASPECT_RATIOS; } });
117
117
  var generate_video_1 = require("./automations/nodes/generate-video");
118
118
  Object.defineProperty(exports, "isImageToVideoModel", { enumerable: true, get: function () { return generate_video_1.isImageToVideoModel; } });
119
+ Object.defineProperty(exports, "getImageToVideoModelId", { enumerable: true, get: function () { return generate_video_1.getImageToVideoModelId; } });
120
+ Object.defineProperty(exports, "hasImageToVideoVariant", { enumerable: true, get: function () { return generate_video_1.hasImageToVideoVariant; } });
119
121
  Object.defineProperty(exports, "ALL_VIDEO_MODELS", { enumerable: true, get: function () { return generate_video_1.ALL_VIDEO_MODELS; } });
120
122
  Object.defineProperty(exports, "getModelAspectRatios", { enumerable: true, get: function () { return generate_video_1.getModelAspectRatios; } });
121
123
  Object.defineProperty(exports, "getModelDurations", { enumerable: true, get: function () { return generate_video_1.getModelDurations; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.5.15",
3
+ "version": "4.5.17",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",