ugcinc 4.5.10 → 4.5.12

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.
@@ -3,35 +3,44 @@ import { type OutputMode, type SelectionMode } from './types';
3
3
  export interface GenerateImageNodeInputs {
4
4
  /** Only present when promptIsVariable is true */
5
5
  prompt?: TextValue;
6
- /** Only present when using an edit model */
7
- image?: ImageValue;
6
+ /** Dynamic image ports: image_0, image_1, ... */
7
+ [key: string]: TextValue | ImageValue | undefined;
8
8
  }
9
9
  export interface GenerateImageNodeOutputs {
10
10
  output: ImageValue;
11
11
  }
12
- type ImageGenerationTextModel = 'fal-ai/gemini-3-pro-image-preview' | 'fal-ai/nano-banana-pro' | 'fal-ai/nano-banana' | 'fal-ai/gpt-image-1/text-to-image';
12
+ type ImageGenerationModel = 'fal-ai/gemini-3-pro-image-preview' | 'fal-ai/nano-banana-pro' | 'fal-ai/nano-banana' | 'fal-ai/gpt-image-1/text-to-image';
13
13
  type ImageGenerationEditModel = 'fal-ai/gemini-3-pro-image-preview/edit' | 'fal-ai/nano-banana-pro/edit' | 'fal-ai/nano-banana/edit' | 'fal-ai/gpt-image-1/edit-image';
14
- type ImageGenerationModel = ImageGenerationTextModel | ImageGenerationEditModel;
15
14
  type ImageModelProvider = 'google' | 'nano-banana' | 'openai';
16
15
  interface ImageModelOption {
17
16
  id: ImageGenerationModel;
18
17
  name: string;
19
18
  provider: ImageModelProvider;
20
- isEditModel: boolean;
19
+ editId: ImageGenerationEditModel;
21
20
  }
22
21
  interface AspectRatioOption {
23
22
  id: string;
24
23
  name: string;
25
24
  }
25
+ /** Static or variable image input in the node config */
26
+ interface ImageInput {
27
+ isVariable: boolean;
28
+ mediaId: string | null;
29
+ mediaUrl: string | null;
30
+ }
26
31
  declare const ALL_IMAGE_MODELS: ImageModelOption[];
27
32
  declare const IMAGE_ASPECT_RATIOS: AspectRatioOption[];
28
- declare function isEditModel(model: ImageGenerationModel): model is ImageGenerationEditModel;
33
+ /** Get the edit model ID for a base model */
34
+ declare function getEditModelId(model: ImageGenerationModel): ImageGenerationEditModel;
35
+ /** @deprecated Use getEditModelId instead — edit mode is auto-detected from image inputs */
36
+ declare function isEditModel(model: string): boolean;
29
37
  declare const definition: import("./types").NodeDefinition<"generate-image", "generator", {
30
38
  model: ImageGenerationModel;
31
39
  aspectRatio: string;
32
40
  numImages: number;
33
41
  prompt: string;
34
42
  promptIsVariable: boolean;
43
+ imageInputs: ImageInput[];
35
44
  outputMode: OutputMode;
36
45
  selectionMode: SelectionMode | null;
37
46
  }, GenerateImageNodeInputs, GenerateImageNodeOutputs, false>;
@@ -40,6 +49,6 @@ declare const _default: typeof definition & {
40
49
  __TOutputs: GenerateImageNodeOutputs;
41
50
  };
42
51
  export default _default;
43
- export { isEditModel, ALL_IMAGE_MODELS, IMAGE_ASPECT_RATIOS };
44
- export type { ImageGenerationTextModel, ImageGenerationEditModel, ImageGenerationModel, ImageModelProvider, ImageModelOption, AspectRatioOption };
52
+ export { isEditModel, getEditModelId, ALL_IMAGE_MODELS, IMAGE_ASPECT_RATIOS };
53
+ export type { ImageGenerationEditModel, ImageGenerationModel, ImageModelProvider, ImageModelOption, AspectRatioOption, ImageInput };
45
54
  export type GenerateImageNodeConfig = typeof definition.defaults;
@@ -2,20 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = void 0;
4
4
  exports.isEditModel = isEditModel;
5
+ exports.getEditModelId = getEditModelId;
5
6
  const types_1 = require("./types");
6
7
  const ALL_IMAGE_MODELS = [
7
- // Google Gemini
8
- { id: 'fal-ai/gemini-3-pro-image-preview', name: 'Gemini 3 Pro', provider: 'google', isEditModel: false },
9
- { id: 'fal-ai/gemini-3-pro-image-preview/edit', name: 'Gemini 3 Pro Edit', provider: 'google', isEditModel: true },
10
- // Nano Banana Pro
11
- { id: 'fal-ai/nano-banana-pro', name: 'Nano Banana Pro', provider: 'nano-banana', isEditModel: false },
12
- { id: 'fal-ai/nano-banana-pro/edit', name: 'Nano Banana Pro Edit', provider: 'nano-banana', isEditModel: true },
13
- // Nano Banana
14
- { id: 'fal-ai/nano-banana', name: 'Nano Banana', provider: 'nano-banana', isEditModel: false },
15
- { id: 'fal-ai/nano-banana/edit', name: 'Nano Banana Edit', provider: 'nano-banana', isEditModel: true },
16
- // OpenAI GPT Image
17
- { id: 'fal-ai/gpt-image-1/text-to-image', name: 'GPT Image 1', provider: 'openai', isEditModel: false },
18
- { id: 'fal-ai/gpt-image-1/edit-image', name: 'GPT Image 1 Edit', provider: 'openai', isEditModel: true },
8
+ { id: 'fal-ai/gemini-3-pro-image-preview', name: 'Gemini 3 Pro', provider: 'google', editId: 'fal-ai/gemini-3-pro-image-preview/edit' },
9
+ { id: 'fal-ai/nano-banana-pro', name: 'Nano Banana Pro', provider: 'nano-banana', editId: 'fal-ai/nano-banana-pro/edit' },
10
+ { id: 'fal-ai/nano-banana', name: 'Nano Banana', provider: 'nano-banana', editId: 'fal-ai/nano-banana/edit' },
11
+ { id: 'fal-ai/gpt-image-1/text-to-image', name: 'GPT Image 1', provider: 'openai', editId: 'fal-ai/gpt-image-1/edit-image' },
19
12
  ];
20
13
  exports.ALL_IMAGE_MODELS = ALL_IMAGE_MODELS;
21
14
  const IMAGE_ASPECT_RATIOS = [
@@ -29,6 +22,14 @@ const IMAGE_ASPECT_RATIOS = [
29
22
  { id: '2:3', name: '2:3' },
30
23
  ];
31
24
  exports.IMAGE_ASPECT_RATIOS = IMAGE_ASPECT_RATIOS;
25
+ /** Get the edit model ID for a base model */
26
+ function getEditModelId(model) {
27
+ const entry = ALL_IMAGE_MODELS.find(m => m.id === model);
28
+ if (!entry)
29
+ throw new Error(`Unknown image model: ${model}`);
30
+ return entry.editId;
31
+ }
32
+ /** @deprecated Use getEditModelId instead — edit mode is auto-detected from image inputs */
32
33
  function isEditModel(model) {
33
34
  return model.includes('/edit') || model.includes('/edit-image');
34
35
  }
@@ -49,19 +50,23 @@ const definition = (0, types_1.defineNode)({
49
50
  numImages: 1,
50
51
  prompt: '',
51
52
  promptIsVariable: false,
53
+ imageInputs: [],
52
54
  outputMode: 'per-input',
53
55
  selectionMode: null,
54
56
  },
55
57
  computePorts: ({ config }) => {
56
- const model = (config?.model ?? 'fal-ai/nano-banana');
57
58
  const promptIsVariable = config?.promptIsVariable ?? false;
59
+ const imageInputs = (config?.imageInputs ?? []);
58
60
  const inputs = [];
59
61
  if (promptIsVariable) {
60
62
  inputs.push({ id: 'prompt', type: 'text', isArray: false, required: true });
61
63
  }
62
- if (isEditModel(model)) {
63
- inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
64
- }
64
+ // Add image ports for variable image inputs
65
+ imageInputs.forEach((img, i) => {
66
+ if (img.isVariable) {
67
+ inputs.push({ id: `image-${i + 1}`, type: 'image', isArray: false, required: true });
68
+ }
69
+ });
65
70
  return {
66
71
  inputs,
67
72
  outputs: [
@@ -162,6 +162,7 @@ export declare const nodeDefinitions: {
162
162
  numImages: number;
163
163
  prompt: string;
164
164
  promptIsVariable: boolean;
165
+ imageInputs: import("./generate-image").ImageInput[];
165
166
  outputMode: import("./types").OutputMode;
166
167
  selectionMode: import("./types").SelectionMode | null;
167
168
  }, import("./generate-image").GenerateImageNodeInputs, import("./generate-image").GenerateImageNodeOutputs, false> & {
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export { submitImageRenderJob, submitVideoRenderJob, getRenderJobStatus, submitD
17
17
  export { areTypesCompatible, computePortsForNode, computePortsWithPreviews, computeAllNodePorts, computeAllNodePortsWithPreviews, getInputPreviewValue, getAllNodes, getNodeByType, getOutputSchema, createNode, deriveConnections, addConnection, removeConnection, removeNodeConnections, cleanupStaleConnections, getConnectedSource, getForEachContext, checkCrossContextViolation, getDownstreamNodes, getNodesDownstreamOfSet, getCapturedNodes, validateWorkflow, getErrorNodeIds, getPortErrorsForNode, hasMissingTriggerError, hasMissingTerminalError, getWorkflowOutputSchema, resolveNodePreview, computeAllNodePreviews, computePreviewMap, updatePreviewMapForConnection, removePreviewForConnection, getPreviewValue, shuffleNodePreview, type PreviewMap, type NodePreviewOutputs, type Connection, generateNodeName, extractWorkflowConfig, type WorkflowTemplateData, } from './automations/graph-controller';
18
18
  export { nodeDefinitions, internalNodeTypes, isAsyncExecutor, formatPortType, isPortType } from './automations/types';
19
19
  export { getNodeDefinition, getAllNodeDefinitions, getFlowControlNodeTypes, getCapturedSourceNodeTypes } from './automations/nodes';
20
- export { isEditModel, ALL_IMAGE_MODELS, IMAGE_ASPECT_RATIOS } from './automations/nodes/generate-image';
20
+ export { isEditModel, getEditModelId, ALL_IMAGE_MODELS, IMAGE_ASPECT_RATIOS } from './automations/nodes/generate-image';
21
21
  export { isImageToVideoModel, 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';
@@ -51,7 +51,7 @@ export type { DeduplicateNodeConfig } from './automations/nodes/deduplicate';
51
51
  export type { DestructureNodeConfig, DestructureNodeInputs, DestructureNodeOutputs, DestructureSelection, IndexExpression, } from './automations/nodes/destructure';
52
52
  export { indexExpressionToIndexes, indexExpressionToString, resolvePath } from './automations/nodes/destructure';
53
53
  export type { ForEachNodeConfig, ForEachNodeInputs, ForEachNodeOutputs, ForEachOutputProperty, } from './automations/nodes/for-each';
54
- export type { GenerateImageNodeConfig, ImageGenerationTextModel, ImageGenerationEditModel, ImageGenerationModel, ImageModelProvider, ImageModelOption, AspectRatioOption, } from './automations/nodes/generate-image';
54
+ export type { GenerateImageNodeConfig, ImageGenerationEditModel, ImageGenerationModel, ImageModelProvider, ImageModelOption, AspectRatioOption, ImageInput, } from './automations/nodes/generate-image';
55
55
  export type { GenerateVideoNodeConfig, VideoGenerationTextToVideoModel, VideoGenerationImageToVideoModel, VideoGenerationModel, VideoModelProvider, VideoModelTier, VideoAspectRatioOption, VideoDurationOption, VideoModelOption, } from './automations/nodes/generate-video';
56
56
  export type { IfNodeConfig, IfLogicOperator, IfBooleanInput, } from './automations/nodes/if';
57
57
  export { IfLogicOperators, applyLogicOperator } from './automations/nodes/if';
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.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.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
  // =============================================================================
@@ -111,6 +111,7 @@ Object.defineProperty(exports, "getFlowControlNodeTypes", { enumerable: true, ge
111
111
  Object.defineProperty(exports, "getCapturedSourceNodeTypes", { enumerable: true, get: function () { return nodes_1.getCapturedSourceNodeTypes; } });
112
112
  var generate_image_1 = require("./automations/nodes/generate-image");
113
113
  Object.defineProperty(exports, "isEditModel", { enumerable: true, get: function () { return generate_image_1.isEditModel; } });
114
+ Object.defineProperty(exports, "getEditModelId", { enumerable: true, get: function () { return generate_image_1.getEditModelId; } });
114
115
  Object.defineProperty(exports, "ALL_IMAGE_MODELS", { enumerable: true, get: function () { return generate_image_1.ALL_IMAGE_MODELS; } });
115
116
  Object.defineProperty(exports, "IMAGE_ASPECT_RATIOS", { enumerable: true, get: function () { return generate_image_1.IMAGE_ASPECT_RATIOS; } });
116
117
  var generate_video_1 = require("./automations/nodes/generate-video");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.5.10",
3
+ "version": "4.5.12",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",