ugcinc 4.0.2 → 4.1.0
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.
- package/dist/accounts.d.ts +146 -1
- package/dist/automations/index.d.ts +174 -0
- package/dist/automations/index.js +194 -0
- package/dist/automations/nodes/account.d.ts +18 -0
- package/dist/automations/nodes/account.js +29 -0
- package/dist/automations/nodes/auto-caption.d.ts +64 -0
- package/dist/automations/nodes/auto-caption.js +46 -0
- package/dist/automations/nodes/auto-post.d.ts +81 -0
- package/dist/automations/nodes/auto-post.js +54 -0
- package/dist/automations/nodes/branch.d.ts +58 -0
- package/dist/automations/nodes/branch.js +50 -0
- package/dist/automations/nodes/collect.d.ts +16 -0
- package/dist/automations/nodes/collect.js +56 -0
- package/dist/automations/nodes/compose-workflow.d.ts +21 -0
- package/dist/automations/nodes/compose-workflow.js +42 -0
- package/dist/automations/nodes/create-dm.d.ts +96 -0
- package/dist/automations/nodes/create-dm.js +88 -0
- package/dist/automations/nodes/custom-model.d.ts +19 -0
- package/dist/automations/nodes/custom-model.js +52 -0
- package/dist/automations/nodes/deduplicate.d.ts +8 -0
- package/dist/automations/nodes/deduplicate.js +36 -0
- package/dist/automations/nodes/destructure.d.ts +25 -0
- package/dist/automations/nodes/destructure.js +65 -0
- package/dist/automations/nodes/for-each.d.ts +23 -0
- package/dist/automations/nodes/for-each.js +84 -0
- package/dist/automations/nodes/generate-image.d.ts +16 -0
- package/dist/automations/nodes/generate-image.js +45 -0
- package/dist/automations/nodes/generate-video.d.ts +16 -0
- package/dist/automations/nodes/generate-video.js +45 -0
- package/dist/automations/nodes/if.d.ts +22 -0
- package/dist/automations/nodes/if.js +44 -0
- package/dist/automations/nodes/image-composer.d.ts +33 -0
- package/dist/automations/nodes/image-composer.js +95 -0
- package/dist/automations/nodes/index.d.ts +20 -0
- package/dist/automations/nodes/index.js +93 -0
- package/dist/automations/nodes/llm.d.ts +27 -0
- package/dist/automations/nodes/llm.js +85 -0
- package/dist/automations/nodes/manual-trigger.d.ts +34 -0
- package/dist/automations/nodes/manual-trigger.js +32 -0
- package/dist/automations/nodes/media.d.ts +17 -0
- package/dist/automations/nodes/media.js +40 -0
- package/dist/automations/nodes/not.d.ts +6 -0
- package/dist/automations/nodes/not.js +35 -0
- package/dist/automations/nodes/output.d.ts +30 -0
- package/dist/automations/nodes/output.js +32 -0
- package/dist/automations/nodes/random-route.d.ts +52 -0
- package/dist/automations/nodes/random-route.js +53 -0
- package/dist/automations/nodes/random.d.ts +16 -0
- package/dist/automations/nodes/random.js +50 -0
- package/dist/automations/nodes/recurrence.d.ts +69 -0
- package/dist/automations/nodes/recurrence.js +50 -0
- package/dist/automations/nodes/save-to-media.d.ts +32 -0
- package/dist/automations/nodes/save-to-media.js +31 -0
- package/dist/automations/nodes/screenshot-animation.d.ts +7 -0
- package/dist/automations/nodes/screenshot-animation.js +36 -0
- package/dist/automations/nodes/social-audio.d.ts +8 -0
- package/dist/automations/nodes/social-audio.js +30 -0
- package/dist/automations/nodes/text.d.ts +7 -0
- package/dist/automations/nodes/text.js +41 -0
- package/dist/automations/nodes/transcript.d.ts +6 -0
- package/dist/automations/nodes/transcript.js +46 -0
- package/dist/automations/nodes/types.d.ts +178 -0
- package/dist/automations/nodes/types.js +22 -0
- package/dist/automations/nodes/video-composer.d.ts +25 -0
- package/dist/automations/nodes/video-composer.js +71 -0
- package/dist/automations/nodes/video-import.d.ts +27 -0
- package/dist/automations/nodes/video-import.js +37 -0
- package/dist/automations/types.d.ts +544 -0
- package/dist/automations/types.js +101 -0
- package/dist/automations.d.ts +5 -33
- package/dist/automations.js +6 -647
- package/dist/comments.d.ts +26 -1
- package/dist/comments.js +3 -0
- package/dist/graph-controller.d.ts +194 -0
- package/dist/graph-controller.js +623 -0
- package/dist/index.d.ts +38 -9
- package/dist/index.js +43 -23
- package/dist/internal-utils.d.ts +8 -0
- package/dist/internal-utils.js +22 -0
- package/dist/media.d.ts +135 -1
- package/dist/nodes/account.d.ts +7 -0
- package/dist/nodes/account.js +29 -0
- package/dist/nodes/auto-caption.d.ts +17 -0
- package/dist/nodes/auto-caption.js +46 -0
- package/dist/nodes/auto-post.d.ts +21 -0
- package/dist/nodes/auto-post.js +54 -0
- package/dist/nodes/branch.d.ts +12 -0
- package/dist/nodes/branch.js +50 -0
- package/dist/nodes/collect.d.ts +6 -0
- package/dist/nodes/collect.js +56 -0
- package/dist/nodes/compose-workflow.d.ts +21 -0
- package/dist/nodes/compose-workflow.js +42 -0
- package/dist/nodes/create-dm.d.ts +40 -0
- package/dist/nodes/create-dm.js +88 -0
- package/dist/nodes/custom-model.d.ts +19 -0
- package/dist/nodes/custom-model.js +52 -0
- package/dist/nodes/deduplicate.d.ts +8 -0
- package/dist/nodes/deduplicate.js +36 -0
- package/dist/nodes/destructure.d.ts +25 -0
- package/dist/nodes/destructure.js +65 -0
- package/dist/nodes/for-each.d.ts +23 -0
- package/dist/nodes/for-each.js +84 -0
- package/dist/nodes/generate-image.d.ts +16 -0
- package/dist/nodes/generate-image.js +45 -0
- package/dist/nodes/generate-video.d.ts +16 -0
- package/dist/nodes/generate-video.js +45 -0
- package/dist/nodes/if.d.ts +22 -0
- package/dist/nodes/if.js +44 -0
- package/dist/nodes/image-composer.d.ts +14 -0
- package/dist/nodes/image-composer.js +95 -0
- package/dist/nodes/index.d.ts +20 -0
- package/dist/nodes/index.js +93 -0
- package/dist/nodes/llm.d.ts +27 -0
- package/dist/nodes/llm.js +85 -0
- package/dist/nodes/manual-trigger.d.ts +16 -0
- package/dist/nodes/manual-trigger.js +32 -0
- package/dist/nodes/media.d.ts +17 -0
- package/dist/nodes/media.js +40 -0
- package/dist/nodes/not.d.ts +6 -0
- package/dist/nodes/not.js +35 -0
- package/dist/nodes/output.d.ts +9 -0
- package/dist/nodes/output.js +32 -0
- package/dist/nodes/random-route.d.ts +3 -0
- package/dist/nodes/random-route.js +50 -0
- package/dist/nodes/random.d.ts +3 -0
- package/dist/nodes/random.js +48 -0
- package/dist/nodes/recurrence.d.ts +3 -0
- package/dist/nodes/recurrence.js +45 -0
- package/dist/nodes/save-to-media.d.ts +3 -0
- package/dist/nodes/save-to-media.js +26 -0
- package/dist/nodes/screenshot-animation.d.ts +7 -0
- package/dist/nodes/screenshot-animation.js +36 -0
- package/dist/nodes/social-audio.d.ts +3 -0
- package/dist/nodes/social-audio.js +26 -0
- package/dist/nodes/text.d.ts +3 -0
- package/dist/nodes/text.js +38 -0
- package/dist/nodes/transcript.d.ts +3 -0
- package/dist/nodes/transcript.js +42 -0
- package/dist/nodes/types.d.ts +146 -0
- package/dist/nodes/types.js +22 -0
- package/dist/nodes/video-composer.d.ts +3 -0
- package/dist/nodes/video-composer.js +67 -0
- package/dist/nodes/video-import.d.ts +3 -0
- package/dist/nodes/video-import.js +35 -0
- package/dist/org.d.ts +13 -1
- package/dist/ports.js +3 -9
- package/dist/posts.d.ts +88 -1
- package/dist/render/compositions/IMessageDmComposition/types.d.ts +20 -20
- package/dist/render/types/video.d.ts +2 -2
- package/dist/stats.d.ts +128 -1
- package/dist/tasks.d.ts +20 -1
- package/dist/types.d.ts +1 -2216
- package/dist/types.js +2 -124
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { InputType } from './types';
|
|
2
|
+
type DmPlatform = 'imessage' | 'instagram';
|
|
3
|
+
interface DmMessage {
|
|
4
|
+
sender: 'user' | 'recipient';
|
|
5
|
+
text: string;
|
|
6
|
+
hasImage?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
9
|
+
platform: DmPlatform;
|
|
10
|
+
platformIsVariable: boolean;
|
|
11
|
+
lightMode: boolean;
|
|
12
|
+
lightModeIsVariable: boolean;
|
|
13
|
+
username: string;
|
|
14
|
+
usernameIsVariable: boolean;
|
|
15
|
+
time: string;
|
|
16
|
+
timeIsVariable: boolean;
|
|
17
|
+
profilePicUrl: string;
|
|
18
|
+
profilePicIsVariable: boolean;
|
|
19
|
+
messagesInputType: InputType;
|
|
20
|
+
messages: DmMessage[];
|
|
21
|
+
imageAttachmentUrl: string | undefined;
|
|
22
|
+
imageAttachmentIsVariable: boolean;
|
|
23
|
+
imessage: {
|
|
24
|
+
senderBubbleColor: string | undefined;
|
|
25
|
+
showReadReceipt: boolean;
|
|
26
|
+
readReceiptText: string;
|
|
27
|
+
readReceiptTimeIsVariable: boolean;
|
|
28
|
+
unreadBadgeText: string;
|
|
29
|
+
unreadBadgeIsVariable: boolean;
|
|
30
|
+
messageHeaderTimestampText: string;
|
|
31
|
+
messageHeaderTimeIsVariable: boolean;
|
|
32
|
+
};
|
|
33
|
+
instagram: {
|
|
34
|
+
userHasStory: boolean;
|
|
35
|
+
};
|
|
36
|
+
outputMode: "per-input";
|
|
37
|
+
selectionMode: null;
|
|
38
|
+
}>;
|
|
39
|
+
export default definition;
|
|
40
|
+
export type CreateDmConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
const definition = (0, types_1.defineNode)({
|
|
5
|
+
nodeId: 'create-dm',
|
|
6
|
+
label: 'Create DM',
|
|
7
|
+
description: 'Create fake DM screenshots for iMessage or Instagram',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Generation',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
platform: 'instagram',
|
|
14
|
+
platformIsVariable: false,
|
|
15
|
+
lightMode: true,
|
|
16
|
+
lightModeIsVariable: false,
|
|
17
|
+
username: '',
|
|
18
|
+
usernameIsVariable: false,
|
|
19
|
+
time: '9:41',
|
|
20
|
+
timeIsVariable: false,
|
|
21
|
+
profilePicUrl: 'https://ugcinc.co/logo.png',
|
|
22
|
+
profilePicIsVariable: false,
|
|
23
|
+
messagesInputType: 'static',
|
|
24
|
+
messages: [
|
|
25
|
+
{ sender: 'user', text: 'Wow, this dm automation is realistic right 🤯' },
|
|
26
|
+
{ sender: 'recipient', text: "I know, it's like we're really in imessage" },
|
|
27
|
+
{ sender: 'recipient', text: 'Just be thankful we\'re not on android 😭😭😭' },
|
|
28
|
+
],
|
|
29
|
+
imageAttachmentUrl: undefined,
|
|
30
|
+
imageAttachmentIsVariable: false,
|
|
31
|
+
imessage: {
|
|
32
|
+
senderBubbleColor: undefined,
|
|
33
|
+
showReadReceipt: false,
|
|
34
|
+
readReceiptText: 'Read',
|
|
35
|
+
readReceiptTimeIsVariable: false,
|
|
36
|
+
unreadBadgeText: '67',
|
|
37
|
+
unreadBadgeIsVariable: false,
|
|
38
|
+
messageHeaderTimestampText: '',
|
|
39
|
+
messageHeaderTimeIsVariable: false,
|
|
40
|
+
},
|
|
41
|
+
instagram: {
|
|
42
|
+
userHasStory: false,
|
|
43
|
+
},
|
|
44
|
+
outputMode: 'per-input',
|
|
45
|
+
selectionMode: null,
|
|
46
|
+
},
|
|
47
|
+
computePorts: ({ config }) => {
|
|
48
|
+
const inputs = [];
|
|
49
|
+
if (config?.platformIsVariable) {
|
|
50
|
+
inputs.push({ id: 'platform', type: 'text', isArray: false, required: true });
|
|
51
|
+
}
|
|
52
|
+
if (config?.lightModeIsVariable) {
|
|
53
|
+
inputs.push({ id: 'light-mode', type: 'boolean', isArray: false, required: false });
|
|
54
|
+
}
|
|
55
|
+
if (config?.usernameIsVariable) {
|
|
56
|
+
inputs.push({ id: 'username', type: 'text', isArray: false, required: true });
|
|
57
|
+
}
|
|
58
|
+
if (config?.timeIsVariable) {
|
|
59
|
+
inputs.push({ id: 'time', type: 'text', isArray: false, required: false });
|
|
60
|
+
}
|
|
61
|
+
if (config?.profilePicIsVariable) {
|
|
62
|
+
inputs.push({ id: 'profile-pic', type: 'image', isArray: false, required: false });
|
|
63
|
+
}
|
|
64
|
+
if (config?.messagesInputType === 'variable') {
|
|
65
|
+
inputs.push({ id: 'messages', type: 'object', isArray: true, required: true });
|
|
66
|
+
}
|
|
67
|
+
if (config?.imageAttachmentIsVariable) {
|
|
68
|
+
inputs.push({ id: 'image-attachment', type: 'image', isArray: false, required: false });
|
|
69
|
+
}
|
|
70
|
+
// iMessage-specific
|
|
71
|
+
if (config?.platform === 'imessage') {
|
|
72
|
+
if (config.imessage?.showReadReceipt && config.imessage?.readReceiptTimeIsVariable) {
|
|
73
|
+
inputs.push({ id: 'read-receipt-time', type: 'text', isArray: false, required: false });
|
|
74
|
+
}
|
|
75
|
+
if (config.imessage?.unreadBadgeIsVariable) {
|
|
76
|
+
inputs.push({ id: 'unread-badge', type: 'text', isArray: false, required: false });
|
|
77
|
+
}
|
|
78
|
+
if (config.imessage?.messageHeaderTimeIsVariable) {
|
|
79
|
+
inputs.push({ id: 'message-header-time', type: 'text', isArray: false, required: false });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
inputs,
|
|
84
|
+
outputs: [{ id: 'output', type: 'image', isArray: false, required: true }],
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
exports.default = definition;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type CustomModelOutputType = 'image' | 'video' | 'audio';
|
|
2
|
+
interface CustomModelInputParam {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
required: boolean;
|
|
6
|
+
description?: string;
|
|
7
|
+
default?: unknown;
|
|
8
|
+
}
|
|
9
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
10
|
+
modelId: string;
|
|
11
|
+
modelName: string;
|
|
12
|
+
outputType: CustomModelOutputType;
|
|
13
|
+
inputParams: CustomModelInputParam[];
|
|
14
|
+
apiKey: string | undefined;
|
|
15
|
+
outputMode: "per-input";
|
|
16
|
+
selectionMode: null;
|
|
17
|
+
}>;
|
|
18
|
+
export default definition;
|
|
19
|
+
export type CustomModelConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
const definition = (0, types_1.defineNode)({
|
|
5
|
+
nodeId: 'custom-model',
|
|
6
|
+
label: 'Custom Model',
|
|
7
|
+
description: 'Call any fal.ai model',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'AI Generation',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
modelId: '',
|
|
14
|
+
modelName: '',
|
|
15
|
+
outputType: 'image',
|
|
16
|
+
inputParams: [],
|
|
17
|
+
apiKey: undefined,
|
|
18
|
+
outputMode: 'per-input',
|
|
19
|
+
selectionMode: null,
|
|
20
|
+
},
|
|
21
|
+
computePorts: ({ config }) => {
|
|
22
|
+
const inputParams = config?.inputParams ?? [];
|
|
23
|
+
const outputType = config?.outputType ?? 'image';
|
|
24
|
+
// Generate input ports from inputParams
|
|
25
|
+
// Only params with name 'prompt' or type image/video/audio become input ports
|
|
26
|
+
const inputs = inputParams
|
|
27
|
+
.filter(param => param.name === 'prompt' ||
|
|
28
|
+
param.type === 'image' ||
|
|
29
|
+
param.type === 'video' ||
|
|
30
|
+
param.type === 'audio')
|
|
31
|
+
.map(param => ({
|
|
32
|
+
id: param.name,
|
|
33
|
+
type: (param.type === 'image' || param.type === 'video' || param.type === 'audio')
|
|
34
|
+
? param.type
|
|
35
|
+
: 'text',
|
|
36
|
+
isArray: false,
|
|
37
|
+
required: param.required,
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
inputs,
|
|
41
|
+
outputs: [
|
|
42
|
+
{
|
|
43
|
+
id: 'output',
|
|
44
|
+
type: outputType,
|
|
45
|
+
isArray: false,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
exports.default = definition;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DeduplicationLevel } from '../render/types';
|
|
2
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
3
|
+
deduplication: DeduplicationLevel;
|
|
4
|
+
outputMode: "per-input";
|
|
5
|
+
selectionMode: null;
|
|
6
|
+
}>;
|
|
7
|
+
export default definition;
|
|
8
|
+
export type DeduplicateConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
const definition = (0, types_1.defineNode)({
|
|
5
|
+
nodeId: 'deduplicate',
|
|
6
|
+
label: 'Mass Repost',
|
|
7
|
+
description: 'Make videos unique for safe reposting',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Generation',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
deduplication: 'level3',
|
|
14
|
+
outputMode: 'per-input',
|
|
15
|
+
selectionMode: null,
|
|
16
|
+
},
|
|
17
|
+
computePorts: () => ({
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
id: 'video',
|
|
21
|
+
type: 'video',
|
|
22
|
+
isArray: false,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
outputs: [
|
|
27
|
+
{
|
|
28
|
+
id: 'output',
|
|
29
|
+
type: 'video',
|
|
30
|
+
isArray: false,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
exports.default = definition;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type IndexExpression = {
|
|
2
|
+
type: 'single';
|
|
3
|
+
index: number;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'range';
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'list';
|
|
10
|
+
indexes: number[];
|
|
11
|
+
};
|
|
12
|
+
interface DestructureSelection {
|
|
13
|
+
portId: string;
|
|
14
|
+
indexExpr: IndexExpression;
|
|
15
|
+
isVariable?: boolean;
|
|
16
|
+
propertyPath?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
19
|
+
selections: DestructureSelection[];
|
|
20
|
+
outputMode: "per-input";
|
|
21
|
+
selectionMode: null;
|
|
22
|
+
}>;
|
|
23
|
+
export default definition;
|
|
24
|
+
export type { DestructureSelection, IndexExpression };
|
|
25
|
+
export type DestructureConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
const definition = (0, types_1.defineNode)({
|
|
5
|
+
nodeId: 'destructure',
|
|
6
|
+
label: 'Destructure',
|
|
7
|
+
description: 'Extract specific elements from an array by index or range',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Control Flow',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
selections: [],
|
|
14
|
+
outputMode: 'per-input',
|
|
15
|
+
selectionMode: null,
|
|
16
|
+
},
|
|
17
|
+
computePorts: ({ config, getConnectedOutput }) => {
|
|
18
|
+
const selections = config?.selections ?? [];
|
|
19
|
+
// Input accepts any array type
|
|
20
|
+
const inputTypes = ['image', 'video', 'audio', 'text', 'object'];
|
|
21
|
+
const inputs = [
|
|
22
|
+
{
|
|
23
|
+
id: 'array',
|
|
24
|
+
type: inputTypes,
|
|
25
|
+
isArray: true,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
const outputs = [];
|
|
30
|
+
// Determine base type from connected input
|
|
31
|
+
let baseType = 'object';
|
|
32
|
+
if (getConnectedOutput) {
|
|
33
|
+
const connectedOutput = getConnectedOutput('array');
|
|
34
|
+
if (connectedOutput?.type && connectedOutput.isArray) {
|
|
35
|
+
const connType = connectedOutput.type;
|
|
36
|
+
if (!Array.isArray(connType)) {
|
|
37
|
+
baseType = connType;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (const selection of selections) {
|
|
42
|
+
// If variable, add input port for index expression
|
|
43
|
+
if (selection.isVariable) {
|
|
44
|
+
inputs.push({
|
|
45
|
+
id: `idx-${selection.portId}`,
|
|
46
|
+
type: 'text',
|
|
47
|
+
isArray: false,
|
|
48
|
+
required: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Output type depends on index expression:
|
|
52
|
+
// - 'single' -> single item (isArray: false)
|
|
53
|
+
// - 'range' or 'list' -> array of items (isArray: true)
|
|
54
|
+
const outputIsArray = selection.indexExpr.type !== 'single';
|
|
55
|
+
outputs.push({
|
|
56
|
+
id: selection.portId,
|
|
57
|
+
type: baseType,
|
|
58
|
+
isArray: outputIsArray,
|
|
59
|
+
required: true,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return { inputs, outputs };
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
exports.default = definition;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BasePortType } from '../types';
|
|
2
|
+
interface ForEachOutputProperty {
|
|
3
|
+
portId: string;
|
|
4
|
+
propertyPath: string;
|
|
5
|
+
type: BasePortType;
|
|
6
|
+
isArray: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ForEachInputPort {
|
|
9
|
+
id: string;
|
|
10
|
+
type: BasePortType;
|
|
11
|
+
isArray: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
14
|
+
outputProperties: ForEachOutputProperty[];
|
|
15
|
+
inputPorts: ForEachInputPort[];
|
|
16
|
+
exposeItem: boolean;
|
|
17
|
+
exposeIndex: boolean;
|
|
18
|
+
outputMode: "per-input";
|
|
19
|
+
selectionMode: null;
|
|
20
|
+
}>;
|
|
21
|
+
export default definition;
|
|
22
|
+
export type { ForEachOutputProperty, ForEachInputPort };
|
|
23
|
+
export type ForEachConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
const definition = (0, types_1.defineNode)({
|
|
5
|
+
nodeId: 'for-each',
|
|
6
|
+
label: 'For Each',
|
|
7
|
+
description: 'Iterate over an array, executing downstream nodes for each item',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Control Flow',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
outputProperties: [],
|
|
14
|
+
inputPorts: [],
|
|
15
|
+
exposeItem: false,
|
|
16
|
+
exposeIndex: false,
|
|
17
|
+
outputMode: 'per-input',
|
|
18
|
+
selectionMode: null,
|
|
19
|
+
},
|
|
20
|
+
computePorts: ({ config, getConnectedOutput }) => {
|
|
21
|
+
const outputProperties = config?.outputProperties ?? [];
|
|
22
|
+
const inputPorts = config?.inputPorts ?? [];
|
|
23
|
+
const exposeItem = config?.exposeItem ?? false;
|
|
24
|
+
const exposeIndex = config?.exposeIndex ?? false;
|
|
25
|
+
// Inputs: array + passthrough inputs
|
|
26
|
+
const inputs = [
|
|
27
|
+
{ id: 'array', type: 'object', isArray: false, required: true },
|
|
28
|
+
];
|
|
29
|
+
for (const port of inputPorts) {
|
|
30
|
+
inputs.push({
|
|
31
|
+
id: port.id,
|
|
32
|
+
type: port.type,
|
|
33
|
+
isArray: port.isArray,
|
|
34
|
+
required: false,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// Outputs
|
|
38
|
+
const outputs = [];
|
|
39
|
+
// Determine item type from connected array input
|
|
40
|
+
let itemType = 'object';
|
|
41
|
+
if (getConnectedOutput) {
|
|
42
|
+
const connectedOutput = getConnectedOutput('array');
|
|
43
|
+
if (connectedOutput?.objectSchema) {
|
|
44
|
+
// Has objectSchema - it's an object array, use object type
|
|
45
|
+
itemType = 'object';
|
|
46
|
+
}
|
|
47
|
+
else if (connectedOutput?.type && connectedOutput.isArray) {
|
|
48
|
+
// Connected to an array type - extract the base type
|
|
49
|
+
const connType = connectedOutput.type;
|
|
50
|
+
if (!Array.isArray(connType)) {
|
|
51
|
+
itemType = connType;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Add item output if exposed
|
|
56
|
+
if (exposeItem) {
|
|
57
|
+
outputs.push({ id: 'item', type: itemType, isArray: false, required: true });
|
|
58
|
+
}
|
|
59
|
+
// Add index output if exposed
|
|
60
|
+
if (exposeIndex) {
|
|
61
|
+
outputs.push({ id: 'index', type: 'number', isArray: false, required: true });
|
|
62
|
+
}
|
|
63
|
+
// Add configured property outputs
|
|
64
|
+
for (const prop of outputProperties) {
|
|
65
|
+
outputs.push({
|
|
66
|
+
id: prop.portId,
|
|
67
|
+
type: prop.type,
|
|
68
|
+
isArray: prop.isArray,
|
|
69
|
+
required: true,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// Add passthrough outputs (same value for all iterations)
|
|
73
|
+
for (const port of inputPorts) {
|
|
74
|
+
outputs.push({
|
|
75
|
+
id: port.id,
|
|
76
|
+
type: port.type,
|
|
77
|
+
isArray: port.isArray,
|
|
78
|
+
required: true,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return { inputs, outputs };
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
exports.default = definition;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
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';
|
|
2
|
+
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';
|
|
3
|
+
type ImageGenerationModel = ImageGenerationTextModel | ImageGenerationEditModel;
|
|
4
|
+
declare function isEditModel(model: ImageGenerationModel): model is ImageGenerationEditModel;
|
|
5
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
6
|
+
model: ImageGenerationModel;
|
|
7
|
+
aspectRatio: string;
|
|
8
|
+
numImages: number;
|
|
9
|
+
apiKey: string | undefined;
|
|
10
|
+
outputMode: "per-input";
|
|
11
|
+
selectionMode: null;
|
|
12
|
+
}>;
|
|
13
|
+
export default definition;
|
|
14
|
+
export { isEditModel };
|
|
15
|
+
export type { ImageGenerationTextModel, ImageGenerationEditModel, ImageGenerationModel };
|
|
16
|
+
export type GenerateImageConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEditModel = isEditModel;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
function isEditModel(model) {
|
|
6
|
+
return model.includes('/edit') || model.includes('/edit-image');
|
|
7
|
+
}
|
|
8
|
+
const definition = (0, types_1.defineNode)({
|
|
9
|
+
nodeId: 'generate-image',
|
|
10
|
+
label: 'Generate Image',
|
|
11
|
+
description: 'Generate images with AI',
|
|
12
|
+
type: 'generator',
|
|
13
|
+
category: 'AI Generation',
|
|
14
|
+
outputModes: ['per-input', 'single'],
|
|
15
|
+
selectionModes: null,
|
|
16
|
+
defaults: {
|
|
17
|
+
model: 'fal-ai/nano-banana',
|
|
18
|
+
aspectRatio: '1:1',
|
|
19
|
+
numImages: 1,
|
|
20
|
+
apiKey: undefined,
|
|
21
|
+
outputMode: 'per-input',
|
|
22
|
+
selectionMode: null,
|
|
23
|
+
},
|
|
24
|
+
computePorts: ({ config }) => {
|
|
25
|
+
const model = (config?.model ?? 'fal-ai/nano-banana');
|
|
26
|
+
const inputs = [
|
|
27
|
+
{ id: 'prompt', type: 'text', isArray: false, required: true },
|
|
28
|
+
];
|
|
29
|
+
if (isEditModel(model)) {
|
|
30
|
+
inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
inputs,
|
|
34
|
+
outputs: [
|
|
35
|
+
{
|
|
36
|
+
id: 'output',
|
|
37
|
+
type: 'image',
|
|
38
|
+
isArray: false,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
exports.default = definition;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type VideoGenerationTextToVideoModel = 'fal-ai/veo3.1' | 'fal-ai/veo3' | 'fal-ai/veo3/fast' | 'fal-ai/kling-video/v2.6/pro/text-to-video' | 'fal-ai/kling-video/v2.5/pro/text-to-video' | 'fal-ai/luma-dream-machine/ray-2' | 'fal-ai/luma-dream-machine/ray-2-flash' | 'fal-ai/minimax/hailuo-2.3/pro/text-to-video' | 'wan/v2.6/text-to-video' | 'fal-ai/sora-2/text-to-video';
|
|
2
|
+
type VideoGenerationImageToVideoModel = 'fal-ai/veo3.1/image-to-video' | 'fal-ai/veo3/image-to-video' | 'fal-ai/kling-video/v2.6/pro/image-to-video' | 'fal-ai/kling-video/v2.5/pro/image-to-video' | 'fal-ai/luma-dream-machine/ray-2/image-to-video' | 'fal-ai/luma-dream-machine/ray-2-flash/image-to-video' | 'fal-ai/minimax/hailuo-2.3/pro/image-to-video' | 'wan/v2.6/image-to-video' | 'fal-ai/sora-2/image-to-video/pro';
|
|
3
|
+
type VideoGenerationModel = VideoGenerationTextToVideoModel | VideoGenerationImageToVideoModel;
|
|
4
|
+
declare function isImageToVideoModel(model: VideoGenerationModel): model is VideoGenerationImageToVideoModel;
|
|
5
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
6
|
+
model: VideoGenerationModel;
|
|
7
|
+
aspectRatio: string;
|
|
8
|
+
duration: number;
|
|
9
|
+
apiKey: string | undefined;
|
|
10
|
+
outputMode: "per-input";
|
|
11
|
+
selectionMode: null;
|
|
12
|
+
}>;
|
|
13
|
+
export default definition;
|
|
14
|
+
export { isImageToVideoModel };
|
|
15
|
+
export type { VideoGenerationTextToVideoModel, VideoGenerationImageToVideoModel, VideoGenerationModel };
|
|
16
|
+
export type GenerateVideoConfig = typeof definition.defaults;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isImageToVideoModel = isImageToVideoModel;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
function isImageToVideoModel(model) {
|
|
6
|
+
return model.includes('/image-to-video');
|
|
7
|
+
}
|
|
8
|
+
const definition = (0, types_1.defineNode)({
|
|
9
|
+
nodeId: 'generate-video',
|
|
10
|
+
label: 'Generate Video',
|
|
11
|
+
description: 'Generate videos with AI',
|
|
12
|
+
type: 'generator',
|
|
13
|
+
category: 'AI Generation',
|
|
14
|
+
outputModes: ['per-input', 'single'],
|
|
15
|
+
selectionModes: null,
|
|
16
|
+
defaults: {
|
|
17
|
+
model: 'fal-ai/kling-video/v2.6/pro/text-to-video',
|
|
18
|
+
aspectRatio: '16:9',
|
|
19
|
+
duration: 5,
|
|
20
|
+
apiKey: undefined,
|
|
21
|
+
outputMode: 'per-input',
|
|
22
|
+
selectionMode: null,
|
|
23
|
+
},
|
|
24
|
+
computePorts: ({ config }) => {
|
|
25
|
+
const model = (config?.model ?? 'fal-ai/kling-video/v2.6/pro/text-to-video');
|
|
26
|
+
const inputs = [
|
|
27
|
+
{ id: 'prompt', type: 'text', isArray: false, required: true },
|
|
28
|
+
];
|
|
29
|
+
if (isImageToVideoModel(model)) {
|
|
30
|
+
inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
inputs,
|
|
34
|
+
outputs: [
|
|
35
|
+
{
|
|
36
|
+
id: 'output',
|
|
37
|
+
type: 'video',
|
|
38
|
+
isArray: false,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
exports.default = definition;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BasePortType } from '../types';
|
|
2
|
+
declare const IfLogicOperators: readonly ["and", "or", "xor", "nor"];
|
|
3
|
+
type IfLogicOperator = typeof IfLogicOperators[number];
|
|
4
|
+
interface IfBooleanInput {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
interface IfPassthroughInput {
|
|
8
|
+
id: string;
|
|
9
|
+
type: BasePortType;
|
|
10
|
+
isArray: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
13
|
+
logicOperator: IfLogicOperator;
|
|
14
|
+
booleanInputs: IfBooleanInput[];
|
|
15
|
+
passthroughInputs: IfPassthroughInput[];
|
|
16
|
+
outputMode: "per-input";
|
|
17
|
+
selectionMode: null;
|
|
18
|
+
}>;
|
|
19
|
+
export default definition;
|
|
20
|
+
export { IfLogicOperators };
|
|
21
|
+
export type { IfLogicOperator, IfBooleanInput, IfPassthroughInput };
|
|
22
|
+
export type IfConfig = typeof definition.defaults;
|
package/dist/nodes/if.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IfLogicOperators = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
const IfLogicOperators = ['and', 'or', 'xor', 'nor'];
|
|
6
|
+
exports.IfLogicOperators = IfLogicOperators;
|
|
7
|
+
const definition = (0, types_1.defineNode)({
|
|
8
|
+
nodeId: 'if',
|
|
9
|
+
label: 'If',
|
|
10
|
+
description: 'Conditional branching based on boolean logic',
|
|
11
|
+
type: 'generator',
|
|
12
|
+
category: 'Control Flow',
|
|
13
|
+
outputModes: ['per-input', 'single'],
|
|
14
|
+
selectionModes: null,
|
|
15
|
+
defaults: {
|
|
16
|
+
logicOperator: 'and',
|
|
17
|
+
booleanInputs: [{ id: 'condition-1' }],
|
|
18
|
+
passthroughInputs: [{
|
|
19
|
+
id: 'value',
|
|
20
|
+
type: 'image',
|
|
21
|
+
isArray: false,
|
|
22
|
+
}],
|
|
23
|
+
outputMode: 'per-input',
|
|
24
|
+
selectionMode: null,
|
|
25
|
+
},
|
|
26
|
+
computePorts: ({ config }) => {
|
|
27
|
+
const booleanInputs = config?.booleanInputs ?? [];
|
|
28
|
+
const passthroughInputs = config?.passthroughInputs ?? [];
|
|
29
|
+
const inputs = [];
|
|
30
|
+
const outputs = [];
|
|
31
|
+
// Boolean condition inputs
|
|
32
|
+
for (const boolInput of booleanInputs) {
|
|
33
|
+
inputs.push({ id: boolInput.id, type: 'boolean', isArray: false, required: true });
|
|
34
|
+
}
|
|
35
|
+
// Passthrough inputs and true/false outputs
|
|
36
|
+
for (const passthrough of passthroughInputs) {
|
|
37
|
+
inputs.push({ id: passthrough.id, type: passthrough.type, isArray: passthrough.isArray, required: true });
|
|
38
|
+
outputs.push({ id: `true-${passthrough.id}`, type: passthrough.type, isArray: passthrough.isArray, required: true });
|
|
39
|
+
outputs.push({ id: `false-${passthrough.id}`, type: passthrough.type, isArray: passthrough.isArray, required: true });
|
|
40
|
+
}
|
|
41
|
+
return { inputs, outputs };
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
exports.default = definition;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
2
|
+
imageEditor: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
aspectRatio: string;
|
|
6
|
+
dimensionPreset: string;
|
|
7
|
+
backgroundType: string;
|
|
8
|
+
elements: never[];
|
|
9
|
+
};
|
|
10
|
+
outputMode: "per-input";
|
|
11
|
+
selectionMode: null;
|
|
12
|
+
}>;
|
|
13
|
+
export default definition;
|
|
14
|
+
export type ImageComposerConfig = typeof definition.defaults;
|