ugcinc 4.5.16 → 4.5.18

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.
@@ -23,16 +23,22 @@ interface VideoDurationOption {
23
23
  name: string;
24
24
  }
25
25
  interface VideoModelOption {
26
- id: VideoGenerationModel;
26
+ id: VideoGenerationTextToVideoModel;
27
27
  name: string;
28
28
  provider: VideoModelProvider;
29
- isImageToVideo: boolean;
30
29
  tier: VideoModelTier;
31
30
  aspectRatios: VideoAspectRatioOption[];
32
31
  durations: VideoDurationOption[];
32
+ /** Image-to-video variant of this model, if one exists */
33
+ i2vId?: VideoGenerationImageToVideoModel;
33
34
  }
34
35
  declare const ALL_VIDEO_MODELS: VideoModelOption[];
35
- 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;
36
42
  declare function getModelAspectRatios(modelId: string): VideoAspectRatioOption[];
37
43
  declare function getModelDurations(modelId: string): VideoDurationOption[];
38
44
  declare const definition: import("./types").NodeDefinition<"generate-video", "generator", {
@@ -52,6 +58,6 @@ declare const _default: typeof definition & {
52
58
  __TOutputs: GenerateVideoNodeOutputs;
53
59
  };
54
60
  export default _default;
55
- export { isImageToVideoModel, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDurations };
61
+ export { isImageToVideoModel, getImageToVideoModelId, hasImageToVideoVariant, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDurations };
56
62
  export type { VideoGenerationTextToVideoModel, VideoGenerationImageToVideoModel, VideoGenerationModel, VideoModelProvider, VideoModelTier, VideoAspectRatioOption, VideoDurationOption, VideoModelOption, };
57
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;
@@ -86,14 +98,13 @@ const definition = (0, types_1.defineNode)({
86
98
  selectionMode: null,
87
99
  },
88
100
  computePorts: ({ config }) => {
89
- const model = (config?.model ?? 'fal-ai/kling-video/v2.6/pro/text-to-video');
90
101
  const promptIsVariable = config?.promptIsVariable ?? true;
91
102
  const imageIsVariable = config?.imageIsVariable ?? true;
92
103
  const inputs = [];
93
104
  if (promptIsVariable) {
94
105
  inputs.push({ id: 'prompt', type: 'text', isArray: false, required: true });
95
106
  }
96
- if (isImageToVideoModel(model) && imageIsVariable) {
107
+ if (imageIsVariable) {
97
108
  inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
98
109
  }
99
110
  return {
@@ -49,7 +49,7 @@ const definition = (0, types_1.defineNode)({
49
49
  required: true,
50
50
  });
51
51
  }
52
- else if (elem.type === 'text' && elem.textInputId) {
52
+ else if (elem.type === 'text' && elem.textInputId && elem.textIsVariable !== false) {
53
53
  inputs.push({
54
54
  id: elem.textInputId,
55
55
  type: 'text',
@@ -132,9 +132,14 @@ const definition = (0, types_1.defineNode)({
132
132
  }
133
133
  }
134
134
  else if (elem.type === 'text' && elem.textInputId) {
135
- const text = editorConfig.previewTextValues?.[elem.textInputId];
136
- if (text) {
137
- textContent[elem.id] = text;
135
+ if (elem.textIsVariable === false) {
136
+ if (elem.text)
137
+ textContent[elem.id] = elem.text;
138
+ }
139
+ else {
140
+ const text = editorConfig.previewTextValues?.[elem.textInputId];
141
+ if (text)
142
+ textContent[elem.id] = text;
138
143
  }
139
144
  }
140
145
  }
@@ -212,9 +217,16 @@ function prepareImageComposerInput(editorConfig, inputs) {
212
217
  }
213
218
  }
214
219
  else if (elem.type === 'text' && elem.textInputId) {
215
- const value = inputs[elem.textInputId];
216
- if (typeof value === 'string') {
217
- textValues[elem.textInputId] = value;
220
+ if (elem.textIsVariable === false) {
221
+ if (elem.text) {
222
+ textValues[elem.textInputId] = elem.text;
223
+ }
224
+ }
225
+ else {
226
+ const value = inputs[elem.textInputId];
227
+ if (typeof value === 'string') {
228
+ textValues[elem.textInputId] = value;
229
+ }
218
230
  }
219
231
  }
220
232
  }
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; } });
@@ -67,6 +67,8 @@ export interface ImageEditorElement {
67
67
  text?: string;
68
68
  /** Maps to text input port for variable text (e.g., "text_1") */
69
69
  textInputId?: string;
70
+ /** Whether text comes from a variable input port (default: true for backwards compat) */
71
+ textIsVariable?: boolean;
70
72
  /** Text color (hex) */
71
73
  color?: string;
72
74
  /** Outline width in pixels (0 = no outline) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.5.16",
3
+ "version": "4.5.18",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",