@genfeedai/workflow-ui 0.1.0 → 0.1.2
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/canvas.js +13 -13
- package/dist/canvas.mjs +7 -7
- package/dist/{chunk-HPQT36RR.js → chunk-3TMV3K34.js} +18 -27
- package/dist/{chunk-Z7PWFZG5.js → chunk-4MZ62VMF.js} +8 -1
- package/dist/{chunk-VOGL2WCE.mjs → chunk-7P2JWDC7.mjs} +9 -18
- package/dist/{chunk-FT64PCUP.mjs → chunk-AOTUCJMA.mjs} +6 -15
- package/dist/{chunk-LAJ34AH2.mjs → chunk-AUZR6REQ.mjs} +4 -7
- package/dist/{chunk-EC2ZIWOK.js → chunk-AXFOCPPP.js} +36 -45
- package/dist/{chunk-CETJJ73S.js → chunk-BMFRA6GK.js} +28 -37
- package/dist/{chunk-XV5Z5XYR.mjs → chunk-E3YBVMYZ.mjs} +403 -59
- package/dist/{chunk-H6LZKSLY.js → chunk-ECD5J2BA.js} +496 -152
- package/dist/{chunk-ADWNF7V3.js → chunk-EMGXUNBL.js} +3 -3
- package/dist/{chunk-22PDGHNQ.mjs → chunk-HCXI63ME.mjs} +2 -2
- package/dist/{chunk-UQQUWGHW.mjs → chunk-IASLG6IA.mjs} +1 -1
- package/dist/chunk-IHF35QZD.js +1095 -0
- package/dist/{chunk-E544XUBL.js → chunk-KDIWRSYV.js} +8 -11
- package/dist/chunk-RIGVIEYB.mjs +1093 -0
- package/dist/{chunk-SW7QNEZU.js → chunk-SEV2DWKF.js} +30 -30
- package/dist/{chunk-CSUBLSKZ.mjs → chunk-SQK4JDYY.mjs} +27 -36
- package/dist/{chunk-AC6TWLRT.mjs → chunk-ZJWP5KGZ.mjs} +8 -2
- package/dist/hooks.js +15 -15
- package/dist/hooks.mjs +5 -5
- package/dist/index.js +42 -42
- package/dist/index.mjs +9 -9
- package/dist/lib.js +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/nodes.js +38 -38
- package/dist/nodes.mjs +5 -5
- package/dist/panels.js +7 -7
- package/dist/panels.mjs +4 -4
- package/dist/provider.js +1 -1
- package/dist/provider.mjs +1 -1
- package/dist/stores.js +8 -8
- package/dist/stores.mjs +3 -3
- package/dist/toolbar.js +10 -10
- package/dist/toolbar.mjs +4 -4
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/dist/workflowStore-7SDJC4UR.mjs +3 -0
- package/dist/workflowStore-LNJQ5RZG.js +12 -0
- package/package.json +1 -1
- package/dist/chunk-BJ3R5R32.mjs +0 -2163
- package/dist/chunk-NSDLGLAQ.js +0 -2166
- package/dist/workflowStore-4EGKJLYK.mjs +0 -3
- package/dist/workflowStore-KM32FDL7.js +0 -12
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk3SPPKCWR_js = require('./chunk-3SPPKCWR.js');
|
|
4
4
|
var chunk3YFFDHC5_js = require('./chunk-3YFFDHC5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunk3TMV3K34_js = require('./chunk-3TMV3K34.js');
|
|
6
6
|
var chunk5HJFQVUR_js = require('./chunk-5HJFQVUR.js');
|
|
7
7
|
var chunkEMUMKW5C_js = require('./chunk-EMUMKW5C.js');
|
|
8
8
|
var chunk6DOEUDD5_js = require('./chunk-6DOEUDD5.js');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkAXFOCPPP_js = require('./chunk-AXFOCPPP.js');
|
|
10
|
+
var chunkIHF35QZD_js = require('./chunk-IHF35QZD.js');
|
|
11
11
|
var chunkRJ262NXS_js = require('./chunk-RJ262NXS.js');
|
|
12
12
|
var chunkRXNEDWK2_js = require('./chunk-RXNEDWK2.js');
|
|
13
|
-
var
|
|
13
|
+
var chunk4MZ62VMF_js = require('./chunk-4MZ62VMF.js');
|
|
14
|
+
var types = require('@genfeedai/types');
|
|
14
15
|
var react$1 = require('@xyflow/react');
|
|
15
16
|
var clsx = require('clsx');
|
|
16
17
|
var lucideReact = require('lucide-react');
|
|
@@ -18,16 +19,290 @@ var react = require('react');
|
|
|
18
19
|
var jsxRuntime = require('react/jsx-runtime');
|
|
19
20
|
var Image4 = require('next/image');
|
|
20
21
|
var reactDom = require('react-dom');
|
|
21
|
-
var reactCompareSlider = require('react-compare-slider');
|
|
22
22
|
var shallow = require('zustand/react/shallow');
|
|
23
|
-
var core = require('@genfeedai/core');
|
|
24
23
|
|
|
25
24
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
25
|
|
|
27
26
|
var Image4__default = /*#__PURE__*/_interopDefault(Image4);
|
|
28
27
|
|
|
29
|
-
//
|
|
30
|
-
var
|
|
28
|
+
// ../core/dist/chunk-OAAW6BNW.js
|
|
29
|
+
var require_chunk_OAAW6BNW = chunk4MZ62VMF_js.__commonJS({
|
|
30
|
+
"../core/dist/chunk-OAAW6BNW.js"(exports$1) {
|
|
31
|
+
function topologicalSort(nodes, edges) {
|
|
32
|
+
const inDegree = /* @__PURE__ */ new Map();
|
|
33
|
+
const adjList = /* @__PURE__ */ new Map();
|
|
34
|
+
for (const node of nodes) {
|
|
35
|
+
inDegree.set(node.id, 0);
|
|
36
|
+
adjList.set(node.id, []);
|
|
37
|
+
}
|
|
38
|
+
for (const edge of edges) {
|
|
39
|
+
adjList.get(edge.source)?.push(edge.target);
|
|
40
|
+
inDegree.set(edge.target, (inDegree.get(edge.target) ?? 0) + 1);
|
|
41
|
+
}
|
|
42
|
+
const queue = [];
|
|
43
|
+
for (const [nodeId, degree] of inDegree) {
|
|
44
|
+
if (degree === 0) {
|
|
45
|
+
queue.push(nodeId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const result = [];
|
|
49
|
+
while (queue.length > 0) {
|
|
50
|
+
const node = queue.shift();
|
|
51
|
+
result.push(node);
|
|
52
|
+
for (const neighbor of adjList.get(node) ?? []) {
|
|
53
|
+
inDegree.set(neighbor, (inDegree.get(neighbor) ?? 1) - 1);
|
|
54
|
+
if (inDegree.get(neighbor) === 0) {
|
|
55
|
+
queue.push(neighbor);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
function buildDependencyMap(nodes, edges) {
|
|
62
|
+
const deps = /* @__PURE__ */ new Map();
|
|
63
|
+
for (const node of nodes) {
|
|
64
|
+
deps.set(node.id, []);
|
|
65
|
+
}
|
|
66
|
+
for (const edge of edges) {
|
|
67
|
+
const existing = deps.get(edge.target) ?? [];
|
|
68
|
+
deps.set(edge.target, [...existing, edge.source]);
|
|
69
|
+
}
|
|
70
|
+
return deps;
|
|
71
|
+
}
|
|
72
|
+
exports$1.buildDependencyMap = buildDependencyMap;
|
|
73
|
+
exports$1.topologicalSort = topologicalSort;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// ../core/dist/chunk-FZCK5A7S.js
|
|
78
|
+
var require_chunk_FZCK5A7S = chunk4MZ62VMF_js.__commonJS({
|
|
79
|
+
"../core/dist/chunk-FZCK5A7S.js"(exports$1) {
|
|
80
|
+
var types = chunk4MZ62VMF_js.__require("@genfeedai/types");
|
|
81
|
+
function detectCycles(nodes, edges) {
|
|
82
|
+
const visited = /* @__PURE__ */ new Set();
|
|
83
|
+
const recStack = /* @__PURE__ */ new Set();
|
|
84
|
+
function hasCycle(nodeId) {
|
|
85
|
+
if (recStack.has(nodeId)) return true;
|
|
86
|
+
if (visited.has(nodeId)) return false;
|
|
87
|
+
visited.add(nodeId);
|
|
88
|
+
recStack.add(nodeId);
|
|
89
|
+
const outgoing = edges.filter((e) => e.source === nodeId);
|
|
90
|
+
for (const edge of outgoing) {
|
|
91
|
+
if (hasCycle(edge.target)) return true;
|
|
92
|
+
}
|
|
93
|
+
recStack.delete(nodeId);
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
for (const node of nodes) {
|
|
97
|
+
if (hasCycle(node.id)) return true;
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
function validateWorkflow(nodes, edges) {
|
|
102
|
+
const errors = [];
|
|
103
|
+
const warnings = [];
|
|
104
|
+
for (const node of nodes) {
|
|
105
|
+
const nodeDef = types.NODE_DEFINITIONS[node.type];
|
|
106
|
+
if (!nodeDef) continue;
|
|
107
|
+
const incomingEdges = edges.filter((e) => e.target === node.id);
|
|
108
|
+
for (const input of nodeDef.inputs) {
|
|
109
|
+
if (input.required) {
|
|
110
|
+
const hasConnection = incomingEdges.some((e) => e.targetHandle === input.id);
|
|
111
|
+
if (!hasConnection) {
|
|
112
|
+
errors.push({
|
|
113
|
+
nodeId: node.id,
|
|
114
|
+
message: `Missing required input: ${input.label}`,
|
|
115
|
+
severity: "error"
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (node.type === "download") {
|
|
121
|
+
const hasMediaInput = incomingEdges.some(
|
|
122
|
+
(e) => e.targetHandle === "image" || e.targetHandle === "video"
|
|
123
|
+
);
|
|
124
|
+
if (!hasMediaInput) {
|
|
125
|
+
errors.push({
|
|
126
|
+
nodeId: node.id,
|
|
127
|
+
message: "Output node requires at least one Media input (image or video)",
|
|
128
|
+
severity: "error"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (detectCycles(nodes, edges)) {
|
|
134
|
+
errors.push({
|
|
135
|
+
nodeId: nodes[0]?.id ?? "unknown",
|
|
136
|
+
message: "Workflow contains a cycle",
|
|
137
|
+
severity: "error"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
isValid: errors.length === 0,
|
|
142
|
+
errors,
|
|
143
|
+
warnings
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function getHandleType(nodeType, handleId, direction) {
|
|
147
|
+
const nodeDef = types.NODE_DEFINITIONS[nodeType];
|
|
148
|
+
if (!nodeDef) return null;
|
|
149
|
+
const handles = direction === "source" ? nodeDef.outputs : nodeDef.inputs;
|
|
150
|
+
const handle = handles.find((h) => h.id === handleId);
|
|
151
|
+
return handle?.type ?? null;
|
|
152
|
+
}
|
|
153
|
+
function isValidConnection(sourceNodeType, sourceHandle, targetNodeType, targetHandle) {
|
|
154
|
+
const sourceType = getHandleType(sourceNodeType, sourceHandle, "source");
|
|
155
|
+
const targetType = getHandleType(targetNodeType, targetHandle, "target");
|
|
156
|
+
if (!sourceType || !targetType) return false;
|
|
157
|
+
return types.CONNECTION_RULES[sourceType]?.includes(targetType) ?? false;
|
|
158
|
+
}
|
|
159
|
+
function getCompatibleHandles(handleType) {
|
|
160
|
+
return types.CONNECTION_RULES[handleType] ?? [];
|
|
161
|
+
}
|
|
162
|
+
exports$1.detectCycles = detectCycles;
|
|
163
|
+
exports$1.getCompatibleHandles = getCompatibleHandles;
|
|
164
|
+
exports$1.getHandleType = getHandleType;
|
|
165
|
+
exports$1.isValidConnection = isValidConnection;
|
|
166
|
+
exports$1.validateWorkflow = validateWorkflow;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// ../core/dist/index.js
|
|
171
|
+
var require_dist = chunk4MZ62VMF_js.__commonJS({
|
|
172
|
+
"../core/dist/index.js"(exports$1) {
|
|
173
|
+
var chunkOAAW6BNW_js = require_chunk_OAAW6BNW();
|
|
174
|
+
var chunkFZCK5A7S_js = require_chunk_FZCK5A7S();
|
|
175
|
+
var PRICING = {
|
|
176
|
+
// Image generation (per image)
|
|
177
|
+
"nano-banana": 0.039,
|
|
178
|
+
"nano-banana-pro": {
|
|
179
|
+
"1K": 0.15,
|
|
180
|
+
"2K": 0.15,
|
|
181
|
+
"4K": 0.3
|
|
182
|
+
},
|
|
183
|
+
// Legacy aliases
|
|
184
|
+
"imagen-4-fast": 0.039,
|
|
185
|
+
"imagen-4": 0.15,
|
|
186
|
+
// Video generation (per second)
|
|
187
|
+
"veo-3.1-fast": { withAudio: 0.15, withoutAudio: 0.1 },
|
|
188
|
+
"veo-3.1": { withAudio: 0.4, withoutAudio: 0.2 },
|
|
189
|
+
// Legacy aliases
|
|
190
|
+
"veo-3-fast": { withAudio: 0.15, withoutAudio: 0.1 },
|
|
191
|
+
"veo-3": { withAudio: 0.4, withoutAudio: 0.2 },
|
|
192
|
+
// LLM (per token, derived from $9.50/million)
|
|
193
|
+
llama: 95e-7,
|
|
194
|
+
// Luma Reframe
|
|
195
|
+
"luma-reframe-image": {
|
|
196
|
+
"photon-flash-1": 0.01,
|
|
197
|
+
"photon-1": 0.03
|
|
198
|
+
},
|
|
199
|
+
"luma-reframe-video": 0.06,
|
|
200
|
+
// per second
|
|
201
|
+
// Topaz Upscale (tiered by megapixels)
|
|
202
|
+
"topaz-image-upscale": [
|
|
203
|
+
{ maxMP: 1, price: 0.05 },
|
|
204
|
+
{ maxMP: 4, price: 0.08 },
|
|
205
|
+
{ maxMP: 9, price: 0.16 },
|
|
206
|
+
{ maxMP: 16, price: 0.27 },
|
|
207
|
+
{ maxMP: 25, price: 0.41 },
|
|
208
|
+
{ maxMP: Infinity, price: 0.82 }
|
|
209
|
+
],
|
|
210
|
+
// Topaz Video (per 5 seconds based on resolution and fps)
|
|
211
|
+
"topaz-video-upscale": {
|
|
212
|
+
"720p-15": 0.014,
|
|
213
|
+
"720p-24": 0.022,
|
|
214
|
+
"720p-30": 0.027,
|
|
215
|
+
"720p-60": 0.054,
|
|
216
|
+
"1080p-15": 0.051,
|
|
217
|
+
"1080p-24": 0.081,
|
|
218
|
+
"1080p-30": 0.101,
|
|
219
|
+
"1080p-60": 0.203,
|
|
220
|
+
"4k-15": 0.187,
|
|
221
|
+
"4k-24": 0.299,
|
|
222
|
+
"4k-30": 0.373,
|
|
223
|
+
"4k-60": 0.747
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
var IMAGE_NODE_TYPES = ["imageGen", "image-gen", "ImageGenNode"];
|
|
227
|
+
var VIDEO_NODE_TYPES = ["videoGen", "video-gen", "VideoGenNode"];
|
|
228
|
+
var LUMA_NODE_TYPES = ["reframe", "lumaReframeImage", "lumaReframeVideo"];
|
|
229
|
+
var TOPAZ_NODE_TYPES = ["upscale", "topazImageUpscale", "topazVideoUpscale"];
|
|
230
|
+
var DEFAULT_VIDEO_DURATION = 8;
|
|
231
|
+
var ASPECT_RATIOS3 = [
|
|
232
|
+
"1:1",
|
|
233
|
+
"16:9",
|
|
234
|
+
"9:16",
|
|
235
|
+
"4:3",
|
|
236
|
+
"3:4",
|
|
237
|
+
"4:5",
|
|
238
|
+
"5:4",
|
|
239
|
+
"2:3",
|
|
240
|
+
"3:2",
|
|
241
|
+
"21:9"
|
|
242
|
+
];
|
|
243
|
+
var VIDEO_ASPECT_RATIOS = ["16:9", "9:16"];
|
|
244
|
+
var RESOLUTIONS2 = ["1K", "2K", "4K"];
|
|
245
|
+
var VIDEO_RESOLUTIONS = ["720p", "1080p"];
|
|
246
|
+
var VIDEO_DURATIONS = [4, 6, 8];
|
|
247
|
+
var OUTPUT_FORMATS2 = ["jpg", "png", "webp"];
|
|
248
|
+
var LUMA_ASPECT_RATIOS2 = ["1:1", "3:4", "4:3", "9:16", "16:9", "9:21", "21:9"];
|
|
249
|
+
Object.defineProperty(exports$1, "buildDependencyMap", {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function() {
|
|
252
|
+
return chunkOAAW6BNW_js.buildDependencyMap;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(exports$1, "topologicalSort", {
|
|
256
|
+
enumerable: true,
|
|
257
|
+
get: function() {
|
|
258
|
+
return chunkOAAW6BNW_js.topologicalSort;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
Object.defineProperty(exports$1, "detectCycles", {
|
|
262
|
+
enumerable: true,
|
|
263
|
+
get: function() {
|
|
264
|
+
return chunkFZCK5A7S_js.detectCycles;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
Object.defineProperty(exports$1, "getCompatibleHandles", {
|
|
268
|
+
enumerable: true,
|
|
269
|
+
get: function() {
|
|
270
|
+
return chunkFZCK5A7S_js.getCompatibleHandles;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
Object.defineProperty(exports$1, "getHandleType", {
|
|
274
|
+
enumerable: true,
|
|
275
|
+
get: function() {
|
|
276
|
+
return chunkFZCK5A7S_js.getHandleType;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
Object.defineProperty(exports$1, "isValidConnection", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function() {
|
|
282
|
+
return chunkFZCK5A7S_js.isValidConnection;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
Object.defineProperty(exports$1, "validateWorkflow", {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: function() {
|
|
288
|
+
return chunkFZCK5A7S_js.validateWorkflow;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
exports$1.ASPECT_RATIOS = ASPECT_RATIOS3;
|
|
292
|
+
exports$1.DEFAULT_VIDEO_DURATION = DEFAULT_VIDEO_DURATION;
|
|
293
|
+
exports$1.IMAGE_NODE_TYPES = IMAGE_NODE_TYPES;
|
|
294
|
+
exports$1.LUMA_ASPECT_RATIOS = LUMA_ASPECT_RATIOS2;
|
|
295
|
+
exports$1.LUMA_NODE_TYPES = LUMA_NODE_TYPES;
|
|
296
|
+
exports$1.OUTPUT_FORMATS = OUTPUT_FORMATS2;
|
|
297
|
+
exports$1.PRICING = PRICING;
|
|
298
|
+
exports$1.RESOLUTIONS = RESOLUTIONS2;
|
|
299
|
+
exports$1.TOPAZ_NODE_TYPES = TOPAZ_NODE_TYPES;
|
|
300
|
+
exports$1.VIDEO_ASPECT_RATIOS = VIDEO_ASPECT_RATIOS;
|
|
301
|
+
exports$1.VIDEO_DURATIONS = VIDEO_DURATIONS;
|
|
302
|
+
exports$1.VIDEO_NODE_TYPES = VIDEO_NODE_TYPES;
|
|
303
|
+
exports$1.VIDEO_RESOLUTIONS = VIDEO_RESOLUTIONS;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
31
306
|
var NodeErrorBoundary = class extends react.Component {
|
|
32
307
|
constructor(props) {
|
|
33
308
|
super(props);
|
|
@@ -204,18 +479,18 @@ function BaseNodeComponent({
|
|
|
204
479
|
disabledInputs
|
|
205
480
|
}) {
|
|
206
481
|
const isResized = width !== void 0 || height !== void 0;
|
|
207
|
-
const selectNode =
|
|
208
|
-
const selectedNodeId =
|
|
209
|
-
const highlightedNodeIds =
|
|
210
|
-
const toggleNodeLock =
|
|
211
|
-
const isNodeLocked =
|
|
212
|
-
const updateNodeData =
|
|
213
|
-
const executeNode =
|
|
214
|
-
const isRunning =
|
|
215
|
-
const stopExecution =
|
|
216
|
-
const stopNodeExecution =
|
|
482
|
+
const selectNode = chunkAXFOCPPP_js.useUIStore((state) => state.selectNode);
|
|
483
|
+
const selectedNodeId = chunkAXFOCPPP_js.useUIStore((state) => state.selectedNodeId);
|
|
484
|
+
const highlightedNodeIds = chunkAXFOCPPP_js.useUIStore((state) => state.highlightedNodeIds);
|
|
485
|
+
const toggleNodeLock = chunkIHF35QZD_js.useWorkflowStore((state) => state.toggleNodeLock);
|
|
486
|
+
const isNodeLocked = chunkIHF35QZD_js.useWorkflowStore((state) => state.isNodeLocked);
|
|
487
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
488
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
489
|
+
const isRunning = chunkAXFOCPPP_js.useExecutionStore((state) => state.isRunning);
|
|
490
|
+
const stopExecution = chunkAXFOCPPP_js.useExecutionStore((state) => state.stopExecution);
|
|
491
|
+
const stopNodeExecution = chunkAXFOCPPP_js.useExecutionStore((state) => state.stopNodeExecution);
|
|
217
492
|
const updateNodeInternals = react$1.useUpdateNodeInternals();
|
|
218
|
-
const nodeDef =
|
|
493
|
+
const nodeDef = types.NODE_DEFINITIONS[type];
|
|
219
494
|
const nodeData = data;
|
|
220
495
|
const nodeRef = react.useRef(null);
|
|
221
496
|
const hoverTimeoutRef = react.useRef(null);
|
|
@@ -240,12 +515,12 @@ function BaseNodeComponent({
|
|
|
240
515
|
return () => cancelAnimationFrame(rafId);
|
|
241
516
|
}, [id, updateNodeInternals, handlesKey]);
|
|
242
517
|
const isHighlighted = highlightedNodeIds.length === 0 || highlightedNodeIds.includes(id);
|
|
243
|
-
const nodeExecuting =
|
|
518
|
+
const nodeExecuting = chunkAXFOCPPP_js.useExecutionStore((state) => state.activeNodeExecutions.has(id));
|
|
244
519
|
const handleRetry = react.useCallback(
|
|
245
520
|
(e) => {
|
|
246
521
|
e.stopPropagation();
|
|
247
522
|
if (!nodeExecuting) {
|
|
248
|
-
updateNodeData(id, { error: void 0, status:
|
|
523
|
+
updateNodeData(id, { error: void 0, status: types.NodeStatusEnum.PROCESSING });
|
|
249
524
|
executeNode(id);
|
|
250
525
|
}
|
|
251
526
|
},
|
|
@@ -259,7 +534,7 @@ function BaseNodeComponent({
|
|
|
259
534
|
} else if (nodeExecuting) {
|
|
260
535
|
stopNodeExecution(id);
|
|
261
536
|
} else {
|
|
262
|
-
updateNodeData(id, { status:
|
|
537
|
+
updateNodeData(id, { status: types.NodeStatusEnum.IDLE, error: void 0 });
|
|
263
538
|
}
|
|
264
539
|
},
|
|
265
540
|
[id, isRunning, nodeExecuting, stopExecution, stopNodeExecution, updateNodeData]
|
|
@@ -948,9 +1223,9 @@ function ImageGenNodeComponent(props) {
|
|
|
948
1223
|
const { id, type, data } = props;
|
|
949
1224
|
const nodeData = data;
|
|
950
1225
|
const { ModelBrowserModal } = chunkRJ262NXS_js.useWorkflowUIConfig();
|
|
951
|
-
const openNodeDetailModal =
|
|
952
|
-
const { handleGenerate, handleStop } =
|
|
953
|
-
const { canGenerate } =
|
|
1226
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
1227
|
+
const { handleGenerate, handleStop } = chunk3TMV3K34_js.useNodeExecution(id);
|
|
1228
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
954
1229
|
nodeId: id,
|
|
955
1230
|
nodeType: type,
|
|
956
1231
|
inputSchema: nodeData.selectedModel?.inputSchema,
|
|
@@ -978,12 +1253,12 @@ function ImageGenNodeComponent(props) {
|
|
|
978
1253
|
setTimeout(() => handleDownload(index), index * 100);
|
|
979
1254
|
});
|
|
980
1255
|
}, [nodeData.outputImages, handleDownload]);
|
|
981
|
-
const { handleModelSelect } =
|
|
1256
|
+
const { handleModelSelect } = chunk3TMV3K34_js.useModelSelection({
|
|
982
1257
|
nodeId: id,
|
|
983
1258
|
modelMap: chunk3YFFDHC5_js.IMAGE_MODEL_MAP,
|
|
984
1259
|
fallbackModel: chunk3YFFDHC5_js.DEFAULT_IMAGE_MODEL
|
|
985
1260
|
});
|
|
986
|
-
|
|
1261
|
+
chunk3TMV3K34_js.useAutoLoadModelSchema({
|
|
987
1262
|
currentModel: nodeData.model,
|
|
988
1263
|
selectedModel: nodeData.selectedModel,
|
|
989
1264
|
modelIdMap: chunk3YFFDHC5_js.IMAGE_MODEL_ID_MAP,
|
|
@@ -995,7 +1270,7 @@ function ImageGenNodeComponent(props) {
|
|
|
995
1270
|
modelSupportsImageInput,
|
|
996
1271
|
handleSchemaParamChange,
|
|
997
1272
|
componentSchemas
|
|
998
|
-
} =
|
|
1273
|
+
} = chunk3TMV3K34_js.useAIGenNode({
|
|
999
1274
|
nodeId: id,
|
|
1000
1275
|
selectedModel: nodeData.selectedModel,
|
|
1001
1276
|
schemaParams: nodeData.schemaParams
|
|
@@ -1009,7 +1284,7 @@ function ImageGenNodeComponent(props) {
|
|
|
1009
1284
|
);
|
|
1010
1285
|
const isProcessing = nodeData.status === "processing";
|
|
1011
1286
|
const handleModelBrowse = react.useCallback(() => setIsModelBrowserOpen(true), []);
|
|
1012
|
-
const { titleElement, headerActions } =
|
|
1287
|
+
const { titleElement, headerActions } = chunk3TMV3K34_js.useAIGenNodeHeader({
|
|
1013
1288
|
modelDisplayName,
|
|
1014
1289
|
isProcessing,
|
|
1015
1290
|
canGenerate,
|
|
@@ -1155,10 +1430,10 @@ var ImageGenNode = react.memo(ImageGenNodeComponent);
|
|
|
1155
1430
|
function LipSyncNodeComponent(props) {
|
|
1156
1431
|
const { id, type, data } = props;
|
|
1157
1432
|
const nodeData = data;
|
|
1158
|
-
const updateNodeData =
|
|
1159
|
-
const openNodeDetailModal =
|
|
1160
|
-
const { handleGenerate } =
|
|
1161
|
-
const { canGenerate } =
|
|
1433
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
1434
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
1435
|
+
const { handleGenerate } = chunk3TMV3K34_js.useNodeExecution(id);
|
|
1436
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
1162
1437
|
nodeId: id,
|
|
1163
1438
|
nodeType: type
|
|
1164
1439
|
});
|
|
@@ -1294,10 +1569,10 @@ function LLMNodeComponent(props) {
|
|
|
1294
1569
|
const { id, type, data } = props;
|
|
1295
1570
|
const nodeData = data;
|
|
1296
1571
|
const { ModelBrowserModal } = chunkRJ262NXS_js.useWorkflowUIConfig();
|
|
1297
|
-
const updateNodeData =
|
|
1298
|
-
const openNodeDetailModal =
|
|
1299
|
-
const { handleGenerate, handleStop } =
|
|
1300
|
-
const { canGenerate: hasRequiredConnections } =
|
|
1572
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
1573
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
1574
|
+
const { handleGenerate, handleStop } = chunk3TMV3K34_js.useNodeExecution(id);
|
|
1575
|
+
const { canGenerate: hasRequiredConnections } = chunk3TMV3K34_js.useCanGenerate({
|
|
1301
1576
|
nodeId: id,
|
|
1302
1577
|
nodeType: type
|
|
1303
1578
|
});
|
|
@@ -1305,12 +1580,12 @@ function LLMNodeComponent(props) {
|
|
|
1305
1580
|
const hasInputPrompt = !!nodeData.inputPrompt?.trim();
|
|
1306
1581
|
const canGenerate = hasRequiredConnections && hasSystemPrompt && hasInputPrompt;
|
|
1307
1582
|
const [isModelBrowserOpen, setIsModelBrowserOpen] = react.useState(false);
|
|
1308
|
-
const { handleModelSelect } =
|
|
1583
|
+
const { handleModelSelect } = chunk3TMV3K34_js.useModelSelection({
|
|
1309
1584
|
nodeId: id,
|
|
1310
1585
|
modelMap: chunk3YFFDHC5_js.LLM_MODEL_MAP,
|
|
1311
1586
|
fallbackModel: chunk3YFFDHC5_js.DEFAULT_LLM_MODEL
|
|
1312
1587
|
});
|
|
1313
|
-
|
|
1588
|
+
chunk3TMV3K34_js.useAutoLoadModelSchema({
|
|
1314
1589
|
currentModel: nodeData.model,
|
|
1315
1590
|
selectedModel: nodeData.selectedModel,
|
|
1316
1591
|
modelIdMap: chunk3YFFDHC5_js.LLM_MODEL_ID_MAP,
|
|
@@ -1343,7 +1618,7 @@ function LLMNodeComponent(props) {
|
|
|
1343
1618
|
);
|
|
1344
1619
|
const isProcessing = nodeData.status === "processing";
|
|
1345
1620
|
const handleModelBrowse = react.useCallback(() => setIsModelBrowserOpen(true), []);
|
|
1346
|
-
const { titleElement, headerActions } =
|
|
1621
|
+
const { titleElement, headerActions } = chunk3TMV3K34_js.useAIGenNodeHeader({
|
|
1347
1622
|
modelDisplayName,
|
|
1348
1623
|
isProcessing,
|
|
1349
1624
|
canGenerate,
|
|
@@ -1499,10 +1774,10 @@ var DURATIONS = [
|
|
|
1499
1774
|
function MotionControlNodeComponent(props) {
|
|
1500
1775
|
const { id, type, data } = props;
|
|
1501
1776
|
const nodeData = data;
|
|
1502
|
-
const updateNodeData =
|
|
1503
|
-
const openNodeDetailModal =
|
|
1504
|
-
const { handleGenerate, handleStop } =
|
|
1505
|
-
const { canGenerate } =
|
|
1777
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
1778
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
1779
|
+
const { handleGenerate, handleStop } = chunk3TMV3K34_js.useNodeExecution(id);
|
|
1780
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
1506
1781
|
nodeId: id,
|
|
1507
1782
|
nodeType: type
|
|
1508
1783
|
});
|
|
@@ -1736,9 +2011,9 @@ var VOICES = [
|
|
|
1736
2011
|
function TextToSpeechNodeComponent(props) {
|
|
1737
2012
|
const { id, type, data } = props;
|
|
1738
2013
|
const nodeData = data;
|
|
1739
|
-
const updateNodeData =
|
|
1740
|
-
const { handleGenerate } =
|
|
1741
|
-
const { canGenerate } =
|
|
2014
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
2015
|
+
const { handleGenerate } = chunk3TMV3K34_js.useNodeExecution(id);
|
|
2016
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
1742
2017
|
nodeId: id,
|
|
1743
2018
|
nodeType: type
|
|
1744
2019
|
});
|
|
@@ -1904,9 +2179,6 @@ function TextToSpeechNodeComponent(props) {
|
|
|
1904
2179
|
] }) });
|
|
1905
2180
|
}
|
|
1906
2181
|
var TextToSpeechNode = react.memo(TextToSpeechNodeComponent);
|
|
1907
|
-
|
|
1908
|
-
// src/nodes/ai/TranscribeNode.tsx
|
|
1909
|
-
var import_types2 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
1910
2182
|
var LANGUAGES = [
|
|
1911
2183
|
{ value: "auto", label: "Auto-detect" },
|
|
1912
2184
|
{ value: "en", label: "English" },
|
|
@@ -1921,10 +2193,10 @@ var LANGUAGES = [
|
|
|
1921
2193
|
function TranscribeNodeComponent(props) {
|
|
1922
2194
|
const { id, type, data } = props;
|
|
1923
2195
|
const nodeData = data;
|
|
1924
|
-
const updateNodeData =
|
|
1925
|
-
const executeNode =
|
|
1926
|
-
const openNodeDetailModal =
|
|
1927
|
-
const { canGenerate } =
|
|
2196
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
2197
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
2198
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
2199
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
1928
2200
|
nodeId: id,
|
|
1929
2201
|
nodeType: type
|
|
1930
2202
|
});
|
|
@@ -1943,7 +2215,7 @@ function TranscribeNodeComponent(props) {
|
|
|
1943
2215
|
[id, updateNodeData]
|
|
1944
2216
|
);
|
|
1945
2217
|
const handleTranscribe = react.useCallback(() => {
|
|
1946
|
-
updateNodeData(id, { status:
|
|
2218
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
1947
2219
|
executeNode(id);
|
|
1948
2220
|
}, [id, executeNode, updateNodeData]);
|
|
1949
2221
|
const handleExpand = react.useCallback(() => {
|
|
@@ -2019,21 +2291,21 @@ function VideoGenNodeComponent(props) {
|
|
|
2019
2291
|
const { id, type, data } = props;
|
|
2020
2292
|
const nodeData = data;
|
|
2021
2293
|
const { ModelBrowserModal } = chunkRJ262NXS_js.useWorkflowUIConfig();
|
|
2022
|
-
const openNodeDetailModal =
|
|
2023
|
-
const { handleGenerate, handleStop } =
|
|
2024
|
-
const { canGenerate } =
|
|
2294
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
2295
|
+
const { handleGenerate, handleStop } = chunk3TMV3K34_js.useNodeExecution(id);
|
|
2296
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
2025
2297
|
nodeId: id,
|
|
2026
2298
|
nodeType: type,
|
|
2027
2299
|
inputSchema: nodeData.selectedModel?.inputSchema,
|
|
2028
2300
|
schemaParams: nodeData.schemaParams
|
|
2029
2301
|
});
|
|
2030
2302
|
const [isModelBrowserOpen, setIsModelBrowserOpen] = react.useState(false);
|
|
2031
|
-
const { handleModelSelect } =
|
|
2303
|
+
const { handleModelSelect } = chunk3TMV3K34_js.useModelSelection({
|
|
2032
2304
|
nodeId: id,
|
|
2033
2305
|
modelMap: chunk3YFFDHC5_js.VIDEO_MODEL_MAP,
|
|
2034
2306
|
fallbackModel: chunk3YFFDHC5_js.DEFAULT_VIDEO_MODEL
|
|
2035
2307
|
});
|
|
2036
|
-
|
|
2308
|
+
chunk3TMV3K34_js.useAutoLoadModelSchema({
|
|
2037
2309
|
currentModel: nodeData.model,
|
|
2038
2310
|
selectedModel: nodeData.selectedModel,
|
|
2039
2311
|
modelIdMap: chunk3YFFDHC5_js.VIDEO_MODEL_ID_MAP,
|
|
@@ -2045,7 +2317,7 @@ function VideoGenNodeComponent(props) {
|
|
|
2045
2317
|
modelSupportsImageInput,
|
|
2046
2318
|
handleSchemaParamChange,
|
|
2047
2319
|
componentSchemas
|
|
2048
|
-
} =
|
|
2320
|
+
} = chunk3TMV3K34_js.useAIGenNode({
|
|
2049
2321
|
nodeId: id,
|
|
2050
2322
|
selectedModel: nodeData.selectedModel,
|
|
2051
2323
|
schemaParams: nodeData.schemaParams
|
|
@@ -2059,7 +2331,7 @@ function VideoGenNodeComponent(props) {
|
|
|
2059
2331
|
);
|
|
2060
2332
|
const isProcessing = nodeData.status === "processing";
|
|
2061
2333
|
const handleModelBrowse = react.useCallback(() => setIsModelBrowserOpen(true), []);
|
|
2062
|
-
const { titleElement, headerActions } =
|
|
2334
|
+
const { titleElement, headerActions } = chunk3TMV3K34_js.useAIGenNodeHeader({
|
|
2063
2335
|
modelDisplayName,
|
|
2064
2336
|
isProcessing,
|
|
2065
2337
|
canGenerate,
|
|
@@ -2132,16 +2404,13 @@ function VideoGenNodeComponent(props) {
|
|
|
2132
2404
|
);
|
|
2133
2405
|
}
|
|
2134
2406
|
var VideoGenNode = react.memo(VideoGenNodeComponent);
|
|
2135
|
-
|
|
2136
|
-
// src/nodes/ai/VoiceChangeNode.tsx
|
|
2137
|
-
var import_types3 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
2138
2407
|
function VoiceChangeNodeComponent(props) {
|
|
2139
2408
|
const { id, type, data } = props;
|
|
2140
2409
|
const nodeData = data;
|
|
2141
|
-
const updateNodeData =
|
|
2142
|
-
const executeNode =
|
|
2143
|
-
const openNodeDetailModal =
|
|
2144
|
-
const { canGenerate } =
|
|
2410
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
2411
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
2412
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
2413
|
+
const { canGenerate } = chunk3TMV3K34_js.useCanGenerate({
|
|
2145
2414
|
nodeId: id,
|
|
2146
2415
|
nodeType: type
|
|
2147
2416
|
});
|
|
@@ -2160,7 +2429,7 @@ function VoiceChangeNodeComponent(props) {
|
|
|
2160
2429
|
[id, updateNodeData]
|
|
2161
2430
|
);
|
|
2162
2431
|
const handleProcess = react.useCallback(() => {
|
|
2163
|
-
updateNodeData(id, { status:
|
|
2432
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
2164
2433
|
executeNode(id);
|
|
2165
2434
|
}, [id, executeNode, updateNodeData]);
|
|
2166
2435
|
const handleExpand = react.useCallback(() => {
|
|
@@ -2263,7 +2532,7 @@ var INPUT_TYPES = [
|
|
|
2263
2532
|
function WorkflowInputNodeComponent(props) {
|
|
2264
2533
|
const { id, data } = props;
|
|
2265
2534
|
const nodeData = data;
|
|
2266
|
-
const updateNodeData =
|
|
2535
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
2267
2536
|
const handleNameChange = react.useCallback(
|
|
2268
2537
|
(e) => {
|
|
2269
2538
|
updateNodeData(id, {
|
|
@@ -2363,7 +2632,7 @@ var OUTPUT_TYPES = [
|
|
|
2363
2632
|
function WorkflowOutputNodeComponent(props) {
|
|
2364
2633
|
const { id, data } = props;
|
|
2365
2634
|
const nodeData = data;
|
|
2366
|
-
const updateNodeData =
|
|
2635
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
2367
2636
|
const videoRef = react.useRef(null);
|
|
2368
2637
|
const [isPlaying, setIsPlaying] = react.useState(false);
|
|
2369
2638
|
const handleNameChange = react.useCallback(
|
|
@@ -2504,7 +2773,7 @@ function setWorkflowRefApi(api) {
|
|
|
2504
2773
|
function WorkflowRefNodeComponent(props) {
|
|
2505
2774
|
const { id, data, selected } = props;
|
|
2506
2775
|
const nodeData = data;
|
|
2507
|
-
const { updateNodeData, workflowId: currentWorkflowId } =
|
|
2776
|
+
const { updateNodeData, workflowId: currentWorkflowId } = chunkIHF35QZD_js.useWorkflowStore();
|
|
2508
2777
|
const [workflows, setWorkflows] = react.useState([]);
|
|
2509
2778
|
const [isLoading, setIsLoading] = react.useState(false);
|
|
2510
2779
|
const [error, setError] = react.useState(null);
|
|
@@ -2760,8 +3029,8 @@ var WorkflowRefNode = react.memo(WorkflowRefNodeComponent);
|
|
|
2760
3029
|
function AudioInputNodeComponent(props) {
|
|
2761
3030
|
const { id, data } = props;
|
|
2762
3031
|
const nodeData = data;
|
|
2763
|
-
const updateNodeData =
|
|
2764
|
-
const openNodeDetailModal =
|
|
3032
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
3033
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
2765
3034
|
const fileInputRef = react.useRef(null);
|
|
2766
3035
|
const [showUrlInput, setShowUrlInput] = react.useState(false);
|
|
2767
3036
|
const [urlValue, setUrlValue] = react.useState(nodeData.url || "");
|
|
@@ -2937,7 +3206,7 @@ var AudioInputNode = react.memo(AudioInputNodeComponent);
|
|
|
2937
3206
|
function ImageInputNodeComponent(props) {
|
|
2938
3207
|
const { id, data } = props;
|
|
2939
3208
|
const nodeData = data;
|
|
2940
|
-
const openNodeDetailModal =
|
|
3209
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
2941
3210
|
const {
|
|
2942
3211
|
fileInputRef,
|
|
2943
3212
|
showUrlInput,
|
|
@@ -2949,7 +3218,7 @@ function ImageInputNodeComponent(props) {
|
|
|
2949
3218
|
handleRemove,
|
|
2950
3219
|
handleUrlSubmit,
|
|
2951
3220
|
handleUrlKeyDown
|
|
2952
|
-
} =
|
|
3221
|
+
} = chunk3TMV3K34_js.useMediaUpload({
|
|
2953
3222
|
nodeId: id,
|
|
2954
3223
|
mediaType: "image",
|
|
2955
3224
|
initialUrl: nodeData.url || "",
|
|
@@ -3089,9 +3358,9 @@ var ImageInputNode = react.memo(ImageInputNodeComponent);
|
|
|
3089
3358
|
function PromptConstructorNodeComponent(props) {
|
|
3090
3359
|
const { id, data } = props;
|
|
3091
3360
|
const nodeData = data;
|
|
3092
|
-
const updateNodeData =
|
|
3093
|
-
const edges =
|
|
3094
|
-
const nodes =
|
|
3361
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
3362
|
+
const edges = chunkIHF35QZD_js.useWorkflowStore((state) => state.edges);
|
|
3363
|
+
const nodes = chunkIHF35QZD_js.useWorkflowStore((state) => state.nodes);
|
|
3095
3364
|
const [localTemplate, setLocalTemplate] = react.useState(nodeData.template);
|
|
3096
3365
|
const [isEditing, setIsEditing] = react.useState(false);
|
|
3097
3366
|
const textareaRef = react.useRef(null);
|
|
@@ -3125,7 +3394,7 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3125
3394
|
handleKeyDown,
|
|
3126
3395
|
handleAutocompleteSelect,
|
|
3127
3396
|
closeAutocomplete
|
|
3128
|
-
} =
|
|
3397
|
+
} = chunk3TMV3K34_js.usePromptAutocomplete({
|
|
3129
3398
|
availableVariables,
|
|
3130
3399
|
textareaRef,
|
|
3131
3400
|
localTemplate,
|
|
@@ -3234,7 +3503,7 @@ function PromptNodeComponent(props) {
|
|
|
3234
3503
|
const { id, data } = props;
|
|
3235
3504
|
const nodeData = data;
|
|
3236
3505
|
const { PromptPicker } = chunkRJ262NXS_js.useWorkflowUIConfig();
|
|
3237
|
-
const updateNodeData =
|
|
3506
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
3238
3507
|
const { openCreateModal } = chunkRXNEDWK2_js.usePromptLibraryStore();
|
|
3239
3508
|
const { openEditor } = chunk6DOEUDD5_js.usePromptEditorStore();
|
|
3240
3509
|
const handlePromptChange = react.useCallback(
|
|
@@ -3299,7 +3568,7 @@ var PromptNode = react.memo(PromptNodeComponent);
|
|
|
3299
3568
|
function VideoInputNodeComponent(props) {
|
|
3300
3569
|
const { id, data } = props;
|
|
3301
3570
|
const nodeData = data;
|
|
3302
|
-
const openNodeDetailModal =
|
|
3571
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
3303
3572
|
const {
|
|
3304
3573
|
fileInputRef,
|
|
3305
3574
|
showUrlInput,
|
|
@@ -3311,7 +3580,7 @@ function VideoInputNodeComponent(props) {
|
|
|
3311
3580
|
handleRemove,
|
|
3312
3581
|
handleUrlSubmit,
|
|
3313
3582
|
handleUrlKeyDown
|
|
3314
|
-
} =
|
|
3583
|
+
} = chunk3TMV3K34_js.useMediaUpload({
|
|
3315
3584
|
nodeId: id,
|
|
3316
3585
|
mediaType: "video",
|
|
3317
3586
|
initialUrl: nodeData.url || "",
|
|
@@ -3489,9 +3758,9 @@ function getExtensionFromUrl(url, inputType) {
|
|
|
3489
3758
|
function DownloadNodeComponent(props) {
|
|
3490
3759
|
const { id, data } = props;
|
|
3491
3760
|
const nodeData = data;
|
|
3492
|
-
const updateNodeData =
|
|
3493
|
-
const edges =
|
|
3494
|
-
const isRunning =
|
|
3761
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
3762
|
+
const edges = chunkIHF35QZD_js.useWorkflowStore((state) => state.edges);
|
|
3763
|
+
const isRunning = chunkAXFOCPPP_js.useExecutionStore((state) => state.isRunning);
|
|
3495
3764
|
const [isDownloading, setIsDownloading] = react.useState(false);
|
|
3496
3765
|
const isConnected = edges.some((edge) => edge.target === id);
|
|
3497
3766
|
const activeMedia = nodeData.inputVideo || nodeData.inputImage;
|
|
@@ -3590,9 +3859,6 @@ function DownloadNodeComponent(props) {
|
|
|
3590
3859
|
}
|
|
3591
3860
|
var DownloadNode = react.memo(DownloadNodeComponent);
|
|
3592
3861
|
var OutputNode = DownloadNode;
|
|
3593
|
-
|
|
3594
|
-
// src/nodes/processing/AnimationNode.tsx
|
|
3595
|
-
var import_types4 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
3596
3862
|
var PRESET_OPTIONS = [
|
|
3597
3863
|
{ value: "linear", label: "Linear" },
|
|
3598
3864
|
{ value: "easeIn", label: "Ease In" },
|
|
@@ -3611,10 +3877,10 @@ var PRESET_OPTIONS = [
|
|
|
3611
3877
|
function AnimationNodeComponent(props) {
|
|
3612
3878
|
const { id, type, data } = props;
|
|
3613
3879
|
const nodeData = data;
|
|
3614
|
-
const updateNodeData =
|
|
3615
|
-
const executeNode =
|
|
3616
|
-
const openNodeDetailModal =
|
|
3617
|
-
const { hasRequiredInputs } =
|
|
3880
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
3881
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
3882
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
3883
|
+
const { hasRequiredInputs } = chunk3TMV3K34_js.useRequiredInputs(id, type);
|
|
3618
3884
|
const handleCurveTypeChange = react.useCallback(
|
|
3619
3885
|
(type2) => {
|
|
3620
3886
|
updateNodeData(id, { curveType: type2 });
|
|
@@ -3640,7 +3906,7 @@ function AnimationNodeComponent(props) {
|
|
|
3640
3906
|
[id, updateNodeData]
|
|
3641
3907
|
);
|
|
3642
3908
|
const handleProcess = react.useCallback(() => {
|
|
3643
|
-
updateNodeData(id, { status:
|
|
3909
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
3644
3910
|
executeNode(id);
|
|
3645
3911
|
}, [id, executeNode, updateNodeData]);
|
|
3646
3912
|
const handleExpand = react.useCallback(() => {
|
|
@@ -3759,8 +4025,8 @@ function AnnotationNodeComponent(props) {
|
|
|
3759
4025
|
const { id, data } = props;
|
|
3760
4026
|
const nodeData = data;
|
|
3761
4027
|
const openAnnotation = chunk6DOEUDD5_js.useAnnotationStore((state) => state.openAnnotation);
|
|
3762
|
-
const openNodeDetailModal =
|
|
3763
|
-
const getConnectedInputs =
|
|
4028
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
4029
|
+
const getConnectedInputs = chunkIHF35QZD_js.useWorkflowStore((state) => state.getConnectedInputs);
|
|
3764
4030
|
const connectedInputs = getConnectedInputs(id);
|
|
3765
4031
|
const inputImage = connectedInputs.get("image") ?? nodeData.inputImage;
|
|
3766
4032
|
const handleEditAnnotations = react.useCallback(() => {
|
|
@@ -3824,11 +4090,110 @@ function AnnotationNodeComponent(props) {
|
|
|
3824
4090
|
] }) });
|
|
3825
4091
|
}
|
|
3826
4092
|
var AnnotationNode = react.memo(AnnotationNodeComponent);
|
|
4093
|
+
var B = react.forwardRef(({ transition: e, ...t }, r) => {
|
|
4094
|
+
let o = { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", transition: e ? `clip-path ${e}` : void 0, userSelect: "none", willChange: "clip-path, transition", KhtmlUserSelect: "none", MozUserSelect: "none", WebkitUserSelect: "none" };
|
|
4095
|
+
return jsxRuntime.jsx("div", { ...t, style: o, "data-rcs": "clip-item", ref: r });
|
|
4096
|
+
});
|
|
4097
|
+
B.displayName = "ContainerClip";
|
|
4098
|
+
var W = react.forwardRef(({ children: e, disabled: t, portrait: r, position: o, transition: i }, m) => {
|
|
4099
|
+
let u = { position: "absolute", top: 0, width: r ? "100%" : void 0, height: r ? void 0 : "100%", background: "none", border: 0, padding: 0, pointerEvents: "all", appearance: "none", WebkitAppearance: "none", MozAppearance: "none", outline: 0, transform: r ? "translate3d(0, -50% ,0)" : "translate3d(-50%, 0, 0)", transition: i ? `${r ? "top" : "left"} ${i}` : void 0 };
|
|
4100
|
+
return jsxRuntime.jsx("button", { ref: m, "aria-label": "Drag to move or focus and use arrow keys", "aria-orientation": r ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": o, "data-rcs": "handle-container", disabled: t, role: "slider", style: u, children: e });
|
|
4101
|
+
});
|
|
4102
|
+
W.displayName = "ThisHandleContainer";
|
|
4103
|
+
var re = ({ flip: e }) => jsxRuntime.jsx("div", { className: "__rcs-handle-arrow", style: { width: 0, height: 0, borderTop: "8px solid transparent", borderRight: "10px solid", borderBottom: "8px solid transparent", transform: e ? "rotate(180deg)" : void 0 } });
|
|
4104
|
+
var F = ({ className: e = "__rcs-handle-root", disabled: t, buttonStyle: r, linesStyle: o, portrait: i, style: m, ...C }) => {
|
|
4105
|
+
let u = { display: "flex", flexDirection: i ? "row" : "column", placeItems: "center", height: "100%", cursor: t ? "not-allowed" : i ? "ns-resize" : "ew-resize", pointerEvents: "none", color: "#fff", ...m }, E = { flexGrow: 1, height: i ? 2 : "100%", width: i ? "100%" : 2, backgroundColor: "currentColor", pointerEvents: "auto", boxShadow: "0 0 4px rgba(0,0,0,.5)", ...o }, y = { display: "grid", gridAutoFlow: "column", gap: 8, placeContent: "center", flexShrink: 0, width: 56, height: 56, borderRadius: "50%", borderStyle: "solid", borderWidth: 2, pointerEvents: "auto", backdropFilter: "blur(7px)", WebkitBackdropFilter: "blur(7px)", backgroundColor: "rgba(0, 0, 0, 0.125)", boxShadow: "0 0 4px rgba(0,0,0,.35)", transform: i ? "rotate(90deg)" : void 0, ...r };
|
|
4106
|
+
return jsxRuntime.jsxs("div", { ...C, className: e, style: u, children: [jsxRuntime.jsx("div", { className: "__rcs-handle-line", style: E }), jsxRuntime.jsxs("div", { className: "__rcs-handle-button", style: y, children: [jsxRuntime.jsx(re, {}), jsxRuntime.jsx(re, { flip: true })] }), jsxRuntime.jsx("div", { className: "__rcs-handle-line", style: E })] });
|
|
4107
|
+
};
|
|
4108
|
+
var $ = ((i) => (i.ARROW_LEFT = "ArrowLeft", i.ARROW_RIGHT = "ArrowRight", i.ARROW_UP = "ArrowUp", i.ARROW_DOWN = "ArrowDown", i))($ || {});
|
|
4109
|
+
var G = ({ boxSizing: e = "border-box", objectFit: t = "cover", objectPosition: r = "center center", ...o } = {}) => ({ display: "block", width: "100%", height: "100%", maxWidth: "100%", boxSizing: e, objectFit: t, objectPosition: r, ...o });
|
|
4110
|
+
var oe = (e) => {
|
|
4111
|
+
let t = react.useRef(e);
|
|
4112
|
+
return react.useEffect(() => {
|
|
4113
|
+
t.current = e;
|
|
4114
|
+
}), t.current;
|
|
4115
|
+
};
|
|
4116
|
+
var U = (e, t, r, o) => {
|
|
4117
|
+
let i = react.useRef();
|
|
4118
|
+
react.useEffect(() => {
|
|
4119
|
+
i.current = t;
|
|
4120
|
+
}, [t]), react.useEffect(() => {
|
|
4121
|
+
if (!(r && r.addEventListener)) return;
|
|
4122
|
+
let m = (C) => i.current && i.current(C);
|
|
4123
|
+
return r.addEventListener(e, m, o), () => {
|
|
4124
|
+
r.removeEventListener(e, m, o);
|
|
4125
|
+
};
|
|
4126
|
+
}, [e, r, o]);
|
|
4127
|
+
};
|
|
4128
|
+
var Te = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? react.useLayoutEffect : react.useEffect;
|
|
4129
|
+
var ie = (e, t) => {
|
|
4130
|
+
let r = react.useRef(), o = react.useCallback(() => {
|
|
4131
|
+
e.current && r.current && r.current.observe(e.current);
|
|
4132
|
+
}, [e]);
|
|
4133
|
+
Te(() => (r.current = new ResizeObserver(([i]) => t(i.contentRect)), o(), () => {
|
|
4134
|
+
r.current && r.current.disconnect();
|
|
4135
|
+
}), [t, o]);
|
|
4136
|
+
};
|
|
4137
|
+
var I = { capture: false, passive: true };
|
|
4138
|
+
var X4 = { capture: true, passive: false };
|
|
4139
|
+
var Me = (e) => {
|
|
4140
|
+
e.preventDefault(), e.currentTarget.focus();
|
|
4141
|
+
};
|
|
4142
|
+
var se = react.forwardRef(({ boundsPadding: e = 0, browsingContext: t = globalThis, changePositionOnHover: r = false, disabled: o = false, handle: i, itemOne: m, itemTwo: C, keyboardIncrement: u = "5%", onlyHandleDraggable: E = false, onPositionChange: y, portrait: a = false, position: g = 50, style: le, transition: ce, ...pe }, de) => {
|
|
4143
|
+
let p = react.useRef(null), j = react.useRef(null), f = react.useRef(null), d = react.useRef(g), [L, q] = react.useState(false), [me, x] = react.useState(true), w = react.useRef(false), [ue, fe] = react.useState(), J = oe(g), l = react.useCallback(function({ x: s, y: c, isOffset: R }) {
|
|
4144
|
+
let b = p.current, A = f.current, D = j.current, { width: h, height: S, left: Pe, top: Ee } = b.getBoundingClientRect();
|
|
4145
|
+
if (h === 0 || S === 0) return;
|
|
4146
|
+
let ye = a ? R ? c - Ee - t.scrollY : c : R ? s - Pe - t.scrollX : s, Q = Math.min(Math.max(ye / (a ? S : h) * 100, 0), 100), z = a ? S / (b.offsetHeight || 1) : h / (b.offsetWidth || 1), Z = e * z / (a ? S : h) * 100, _ = Math.min(Math.max(Q, Z * z), 100 - Z * z);
|
|
4147
|
+
d.current = Q, A.setAttribute("aria-valuenow", `${Math.round(d.current)}`), A.style.top = a ? `${_}%` : "0", A.style.left = a ? "0" : `${_}%`, D.style.clipPath = a ? `inset(${_}% 0 0 0)` : `inset(0 0 0 ${_}%)`, y && y(d.current);
|
|
4148
|
+
}, [e, y, a, t]);
|
|
4149
|
+
react.useEffect(() => {
|
|
4150
|
+
let { width: n, height: s } = p.current.getBoundingClientRect(), c = g === J ? d.current : g;
|
|
4151
|
+
l({ x: n / 100 * c, y: s / 100 * c });
|
|
4152
|
+
}, [e, g, a, J, l]);
|
|
4153
|
+
let Re = react.useCallback((n) => {
|
|
4154
|
+
n.preventDefault(), !(o || n.button !== 0) && (l({ isOffset: true, x: n.pageX, y: n.pageY }), q(true), x(true));
|
|
4155
|
+
}, [o, l]), v = react.useCallback(function(s) {
|
|
4156
|
+
l({ isOffset: true, x: s.pageX, y: s.pageY }), x(false);
|
|
4157
|
+
}, [l]), T = react.useCallback(() => {
|
|
4158
|
+
q(false), x(true);
|
|
4159
|
+
}, []), Se = react.useCallback(({ width: n, height: s }) => {
|
|
4160
|
+
let { width: c, height: R } = p.current.getBoundingClientRect();
|
|
4161
|
+
l({ x: n / 100 * d.current * c / n, y: s / 100 * d.current * R / s });
|
|
4162
|
+
}, [l]), Ce = react.useCallback((n) => {
|
|
4163
|
+
if (!Object.values($).includes(n.key)) return;
|
|
4164
|
+
n.preventDefault(), x(true);
|
|
4165
|
+
let { top: s, left: c } = f.current.getBoundingClientRect(), { width: R, height: b } = p.current.getBoundingClientRect(), D = typeof u == "string" ? parseFloat(u) : u / R * 100, h = a ? n.key === "ArrowLeft" || n.key === "ArrowDown" : n.key === "ArrowRight" || n.key === "ArrowUp", S = Math.min(Math.max(h ? d.current + D : d.current - D, 0), 100);
|
|
4166
|
+
l({ x: a ? c : R * S / 100, y: a ? b * S / 100 : s });
|
|
4167
|
+
}, [u, a, l]);
|
|
4168
|
+
react.useEffect(() => {
|
|
4169
|
+
fe(E ? f.current : p.current);
|
|
4170
|
+
}, [E]), react.useEffect(() => {
|
|
4171
|
+
let n = p.current, s = () => {
|
|
4172
|
+
L || T();
|
|
4173
|
+
};
|
|
4174
|
+
return r && (n.addEventListener("pointermove", v, I), n.addEventListener("pointerleave", s, I)), () => {
|
|
4175
|
+
n.removeEventListener("pointermove", v), n.removeEventListener("pointerleave", s);
|
|
4176
|
+
};
|
|
4177
|
+
}, [r, v, T, L]), react.useEffect(() => (L && !w.current && (t.addEventListener("pointermove", v, I), t.addEventListener("pointerup", T, I), w.current = true), () => {
|
|
4178
|
+
w.current && (t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", T), w.current = false);
|
|
4179
|
+
}), [v, T, L, t]), react.useImperativeHandle(de, () => ({ rootContainer: p.current, handleContainer: f.current, setPosition(n) {
|
|
4180
|
+
let { width: s, height: c } = p.current.getBoundingClientRect();
|
|
4181
|
+
l({ x: s / 100 * n, y: c / 100 * n });
|
|
4182
|
+
} }), [l]), ie(p, Se), U("keydown", Ce, f.current, X4), U("click", Me, f.current, X4), U("pointerdown", Re, ue, X4);
|
|
4183
|
+
let ve = i || jsxRuntime.jsx(F, { disabled: o, portrait: a }), K = me ? ce : void 0, he = { position: "relative", display: "flex", overflow: "hidden", cursor: L ? a ? "ns-resize" : "ew-resize" : void 0, touchAction: "none", userSelect: "none", KhtmlUserSelect: "none", msUserSelect: "none", MozUserSelect: "none", WebkitUserSelect: "none", ...le };
|
|
4184
|
+
return jsxRuntime.jsxs("div", { ...pe, ref: p, style: he, "data-rcs": "root", children: [m, jsxRuntime.jsx(B, { ref: j, transition: K, children: C }), jsxRuntime.jsx(W, { disabled: o, portrait: a, position: Math.round(d.current), ref: f, transition: K, children: ve })] });
|
|
4185
|
+
});
|
|
4186
|
+
se.displayName = "ReactCompareSlider";
|
|
4187
|
+
var ae = react.forwardRef(({ style: e, ...t }, r) => {
|
|
4188
|
+
let o = G(e);
|
|
4189
|
+
return jsxRuntime.jsx("img", { ref: r, ...t, style: o, "data-rcs": "image" });
|
|
4190
|
+
});
|
|
4191
|
+
ae.displayName = "ReactCompareSliderImage";
|
|
3827
4192
|
function ImageCompareNodeComponent(props) {
|
|
3828
4193
|
const { id, data } = props;
|
|
3829
4194
|
const nodeData = data;
|
|
3830
|
-
const edges =
|
|
3831
|
-
const nodes =
|
|
4195
|
+
const edges = chunkIHF35QZD_js.useWorkflowStore((state) => state.edges);
|
|
4196
|
+
const nodes = chunkIHF35QZD_js.useWorkflowStore((state) => state.nodes);
|
|
3832
4197
|
const displayImages = react.useMemo(() => {
|
|
3833
4198
|
const connectedImages = [];
|
|
3834
4199
|
const sortedEdges = edges.filter((edge) => edge.target === id).sort((a, b) => {
|
|
@@ -3858,10 +4223,10 @@ function ImageCompareNodeComponent(props) {
|
|
|
3858
4223
|
const imageB = displayImages[1] || nodeData.imageB || null;
|
|
3859
4224
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseNode, { ...props, children: imageA && imageB ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 relative nodrag nopan nowheel min-h-[200px]", children: [
|
|
3860
4225
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3861
|
-
|
|
4226
|
+
se,
|
|
3862
4227
|
{
|
|
3863
4228
|
itemOne: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3864
|
-
|
|
4229
|
+
ae,
|
|
3865
4230
|
{
|
|
3866
4231
|
src: imageA,
|
|
3867
4232
|
alt: "Image A",
|
|
@@ -3869,7 +4234,7 @@ function ImageCompareNodeComponent(props) {
|
|
|
3869
4234
|
}
|
|
3870
4235
|
),
|
|
3871
4236
|
itemTwo: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3872
|
-
|
|
4237
|
+
ae,
|
|
3873
4238
|
{
|
|
3874
4239
|
src: imageB,
|
|
3875
4240
|
alt: "Image B",
|
|
@@ -3889,9 +4254,6 @@ function ImageCompareNodeComponent(props) {
|
|
|
3889
4254
|
] }) });
|
|
3890
4255
|
}
|
|
3891
4256
|
var ImageCompareNode = react.memo(ImageCompareNodeComponent);
|
|
3892
|
-
|
|
3893
|
-
// src/nodes/processing/ImageGridSplitNode.tsx
|
|
3894
|
-
var import_types5 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
3895
4257
|
var OUTPUT_FORMATS = [
|
|
3896
4258
|
{ value: "jpg", label: "JPEG" },
|
|
3897
4259
|
{ value: "png", label: "PNG" },
|
|
@@ -3900,8 +4262,8 @@ var OUTPUT_FORMATS = [
|
|
|
3900
4262
|
function ImageGridSplitNodeComponent(props) {
|
|
3901
4263
|
const { id, data } = props;
|
|
3902
4264
|
const nodeData = data;
|
|
3903
|
-
const updateNodeData =
|
|
3904
|
-
const executeNode =
|
|
4265
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
4266
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
3905
4267
|
const [selectedPreview, setSelectedPreview] = react.useState(null);
|
|
3906
4268
|
const handleRowsChange = react.useCallback(
|
|
3907
4269
|
(e) => {
|
|
@@ -3942,7 +4304,7 @@ function ImageGridSplitNodeComponent(props) {
|
|
|
3942
4304
|
[id, updateNodeData]
|
|
3943
4305
|
);
|
|
3944
4306
|
const handleProcess = react.useCallback(() => {
|
|
3945
|
-
updateNodeData(id, { status:
|
|
4307
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
3946
4308
|
executeNode(id);
|
|
3947
4309
|
}, [id, executeNode, updateNodeData]);
|
|
3948
4310
|
const handleDownload = react.useCallback(
|
|
@@ -4169,7 +4531,7 @@ var ImageGridSplitNode = react.memo(ImageGridSplitNodeComponent);
|
|
|
4169
4531
|
function OutputGalleryNodeComponent(props) {
|
|
4170
4532
|
const { id, data } = props;
|
|
4171
4533
|
const nodeData = data;
|
|
4172
|
-
const { edges, nodes } =
|
|
4534
|
+
const { edges, nodes } = chunkIHF35QZD_js.useWorkflowStore(
|
|
4173
4535
|
shallow.useShallow((state) => ({ edges: state.edges, nodes: state.nodes }))
|
|
4174
4536
|
);
|
|
4175
4537
|
const [lightboxIndex, setLightboxIndex] = react.useState(null);
|
|
@@ -4357,9 +4719,6 @@ function OutputGalleryNodeComponent(props) {
|
|
|
4357
4719
|
] });
|
|
4358
4720
|
}
|
|
4359
4721
|
var OutputGalleryNode = react.memo(OutputGalleryNodeComponent);
|
|
4360
|
-
|
|
4361
|
-
// src/nodes/processing/ReframeNode.tsx
|
|
4362
|
-
var import_types6 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
4363
4722
|
var MODELS = [
|
|
4364
4723
|
{ value: "photon-flash-1", label: "Photon Flash", price: "$0.01" },
|
|
4365
4724
|
{ value: "photon-1", label: "Photon", price: "$0.03" }
|
|
@@ -4376,8 +4735,8 @@ var ASPECT_RATIOS2 = [
|
|
|
4376
4735
|
function ReframeNodeComponent(props) {
|
|
4377
4736
|
const { id, data } = props;
|
|
4378
4737
|
const nodeData = data;
|
|
4379
|
-
const updateNodeData =
|
|
4380
|
-
const executeNode =
|
|
4738
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
4739
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
4381
4740
|
const videoRef = react.useRef(null);
|
|
4382
4741
|
const [isPlaying, setIsPlaying] = react.useState(false);
|
|
4383
4742
|
const inputType = nodeData.inputType ?? (nodeData.inputImage ? "image" : nodeData.inputVideo ? "video" : null);
|
|
@@ -4412,7 +4771,7 @@ function ReframeNodeComponent(props) {
|
|
|
4412
4771
|
[id, updateNodeData]
|
|
4413
4772
|
);
|
|
4414
4773
|
const handleProcess = react.useCallback(() => {
|
|
4415
|
-
updateNodeData(id, { status:
|
|
4774
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
4416
4775
|
executeNode(id);
|
|
4417
4776
|
}, [id, executeNode, updateNodeData]);
|
|
4418
4777
|
const togglePlayback = react.useCallback(() => {
|
|
@@ -4537,7 +4896,7 @@ function ReframeNodeComponent(props) {
|
|
|
4537
4896
|
var ReframeNode = react.memo(ReframeNodeComponent);
|
|
4538
4897
|
|
|
4539
4898
|
// src/nodes/processing/ResizeNode.tsx
|
|
4540
|
-
var
|
|
4899
|
+
var import_core = chunk4MZ62VMF_js.__toESM(require_dist());
|
|
4541
4900
|
var MODELS2 = {
|
|
4542
4901
|
image: { id: "photon-flash-1", label: "Luma Photon Flash", price: "$0.01" },
|
|
4543
4902
|
video: { id: "luma-reframe", label: "Luma Reframe", price: "$0.05" }
|
|
@@ -4545,8 +4904,8 @@ var MODELS2 = {
|
|
|
4545
4904
|
function ResizeNodeComponent(props) {
|
|
4546
4905
|
const { id, data } = props;
|
|
4547
4906
|
const nodeData = data;
|
|
4548
|
-
const updateNodeData =
|
|
4549
|
-
const executeNode =
|
|
4907
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
4908
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
4550
4909
|
const mediaType = nodeData.inputType ?? "image";
|
|
4551
4910
|
const currentModel = MODELS2[mediaType];
|
|
4552
4911
|
const handleTypeChange = react.useCallback(
|
|
@@ -4578,7 +4937,7 @@ function ResizeNodeComponent(props) {
|
|
|
4578
4937
|
[id, updateNodeData]
|
|
4579
4938
|
);
|
|
4580
4939
|
const handleProcess = react.useCallback(() => {
|
|
4581
|
-
updateNodeData(id, { status:
|
|
4940
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
4582
4941
|
executeNode(id);
|
|
4583
4942
|
}, [id, executeNode, updateNodeData]);
|
|
4584
4943
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseNode, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
@@ -4601,7 +4960,7 @@ function ResizeNodeComponent(props) {
|
|
|
4601
4960
|
/* @__PURE__ */ jsxRuntime.jsx(chunk3SPPKCWR_js.Label, { className: "text-xs", children: "Target Aspect Ratio" }),
|
|
4602
4961
|
/* @__PURE__ */ jsxRuntime.jsxs(chunk3SPPKCWR_js.Select, { value: nodeData.targetAspectRatio, onValueChange: handleAspectRatioChange, children: [
|
|
4603
4962
|
/* @__PURE__ */ jsxRuntime.jsx(chunk3SPPKCWR_js.SelectTrigger, { className: "nodrag h-9 w-full", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3SPPKCWR_js.SelectValue, {}) }),
|
|
4604
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunk3SPPKCWR_js.SelectContent, { children:
|
|
4963
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3SPPKCWR_js.SelectContent, { children: import_core.LUMA_ASPECT_RATIOS.map((ratio) => /* @__PURE__ */ jsxRuntime.jsx(chunk3SPPKCWR_js.SelectItem, { value: ratio, children: ratio }, ratio)) })
|
|
4605
4964
|
] })
|
|
4606
4965
|
] }),
|
|
4607
4966
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4672,9 +5031,6 @@ function ResizeNodeComponent(props) {
|
|
|
4672
5031
|
] }) });
|
|
4673
5032
|
}
|
|
4674
5033
|
var ResizeNode = react.memo(ResizeNodeComponent);
|
|
4675
|
-
|
|
4676
|
-
// src/nodes/processing/SubtitleNode.tsx
|
|
4677
|
-
var import_types8 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
4678
5034
|
var STYLE_OPTIONS = [
|
|
4679
5035
|
{ value: "modern", label: "Modern" },
|
|
4680
5036
|
{ value: "default", label: "Default" },
|
|
@@ -4689,8 +5045,8 @@ var POSITION_OPTIONS = [
|
|
|
4689
5045
|
function SubtitleNodeComponent(props) {
|
|
4690
5046
|
const { id, data } = props;
|
|
4691
5047
|
const nodeData = data;
|
|
4692
|
-
const updateNodeData =
|
|
4693
|
-
const executeNode =
|
|
5048
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
5049
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
4694
5050
|
const handleStyleChange = react.useCallback(
|
|
4695
5051
|
(value) => {
|
|
4696
5052
|
updateNodeData(id, { style: value });
|
|
@@ -4716,7 +5072,7 @@ function SubtitleNodeComponent(props) {
|
|
|
4716
5072
|
[id, updateNodeData]
|
|
4717
5073
|
);
|
|
4718
5074
|
const handleProcess = react.useCallback(() => {
|
|
4719
|
-
updateNodeData(id, { status:
|
|
5075
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
4720
5076
|
executeNode(id);
|
|
4721
5077
|
}, [id, executeNode, updateNodeData]);
|
|
4722
5078
|
const hasRequiredInputs = nodeData.inputVideo && nodeData.inputText;
|
|
@@ -4797,9 +5153,6 @@ function SubtitleNodeComponent(props) {
|
|
|
4797
5153
|
] }) });
|
|
4798
5154
|
}
|
|
4799
5155
|
var SubtitleNode = react.memo(SubtitleNodeComponent);
|
|
4800
|
-
|
|
4801
|
-
// src/nodes/processing/UpscaleNode.tsx
|
|
4802
|
-
var import_types9 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
4803
5156
|
var IMAGE_MODELS2 = [
|
|
4804
5157
|
{ value: "topaz-standard-v2", label: "Standard V2" },
|
|
4805
5158
|
{ value: "topaz-low-res-v2", label: "Low Resolution V2" },
|
|
@@ -4830,9 +5183,9 @@ var FPS_OPTIONS = [
|
|
|
4830
5183
|
function UpscaleNodeComponent(props) {
|
|
4831
5184
|
const { id, data } = props;
|
|
4832
5185
|
const nodeData = data;
|
|
4833
|
-
const updateNodeData =
|
|
4834
|
-
const executeNode =
|
|
4835
|
-
const openNodeDetailModal =
|
|
5186
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
5187
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
5188
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
4836
5189
|
const videoRef = react.useRef(null);
|
|
4837
5190
|
const [isPlaying, setIsPlaying] = react.useState(false);
|
|
4838
5191
|
const inputType = nodeData.inputType ?? (nodeData.inputImage ? "image" : nodeData.inputVideo ? "video" : null);
|
|
@@ -4908,7 +5261,7 @@ function UpscaleNodeComponent(props) {
|
|
|
4908
5261
|
[id, updateNodeData]
|
|
4909
5262
|
);
|
|
4910
5263
|
const handleProcess = react.useCallback(() => {
|
|
4911
|
-
updateNodeData(id, { status:
|
|
5264
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
4912
5265
|
executeNode(id);
|
|
4913
5266
|
}, [id, executeNode, updateNodeData]);
|
|
4914
5267
|
const handleExpand = react.useCallback(() => {
|
|
@@ -5170,9 +5523,6 @@ function UpscaleNodeComponent(props) {
|
|
|
5170
5523
|
] }) });
|
|
5171
5524
|
}
|
|
5172
5525
|
var UpscaleNode = react.memo(UpscaleNodeComponent);
|
|
5173
|
-
|
|
5174
|
-
// src/nodes/processing/VideoFrameExtractNode.tsx
|
|
5175
|
-
var import_types10 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
5176
5526
|
var SELECTION_MODES = [
|
|
5177
5527
|
{ value: "last", label: "Last Frame" },
|
|
5178
5528
|
{ value: "first", label: "First Frame" }
|
|
@@ -5185,8 +5535,8 @@ function formatTime(seconds) {
|
|
|
5185
5535
|
function VideoFrameExtractNodeComponent(props) {
|
|
5186
5536
|
const { id, data } = props;
|
|
5187
5537
|
const nodeData = data;
|
|
5188
|
-
const updateNodeData =
|
|
5189
|
-
const executeNode =
|
|
5538
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
5539
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
5190
5540
|
const handleModeChange = react.useCallback(
|
|
5191
5541
|
(value) => {
|
|
5192
5542
|
updateNodeData(id, { selectionMode: value });
|
|
@@ -5194,7 +5544,7 @@ function VideoFrameExtractNodeComponent(props) {
|
|
|
5194
5544
|
[id, updateNodeData]
|
|
5195
5545
|
);
|
|
5196
5546
|
const handleProcess = react.useCallback(() => {
|
|
5197
|
-
updateNodeData(id, { status:
|
|
5547
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
5198
5548
|
executeNode(id);
|
|
5199
5549
|
}, [id, executeNode, updateNodeData]);
|
|
5200
5550
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseNode, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
@@ -5246,9 +5596,6 @@ function VideoFrameExtractNodeComponent(props) {
|
|
|
5246
5596
|
] }) });
|
|
5247
5597
|
}
|
|
5248
5598
|
var VideoFrameExtractNode = react.memo(VideoFrameExtractNodeComponent);
|
|
5249
|
-
|
|
5250
|
-
// src/nodes/processing/VideoStitchNode.tsx
|
|
5251
|
-
var import_types11 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
5252
5599
|
var TRANSITIONS = [
|
|
5253
5600
|
{ value: "cut", label: "Cut (No transition)" },
|
|
5254
5601
|
{ value: "crossfade", label: "Crossfade" },
|
|
@@ -5263,8 +5610,8 @@ function VideoStitchNodeComponent(props) {
|
|
|
5263
5610
|
const { id, data } = props;
|
|
5264
5611
|
const nodeData = data;
|
|
5265
5612
|
const inputVideos = nodeData.inputVideos ?? [];
|
|
5266
|
-
const updateNodeData =
|
|
5267
|
-
const executeNode =
|
|
5613
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
5614
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
5268
5615
|
const handleTransitionChange = react.useCallback(
|
|
5269
5616
|
(value) => {
|
|
5270
5617
|
updateNodeData(id, {
|
|
@@ -5310,7 +5657,7 @@ function VideoStitchNodeComponent(props) {
|
|
|
5310
5657
|
[id, updateNodeData]
|
|
5311
5658
|
);
|
|
5312
5659
|
const handleProcess = react.useCallback(() => {
|
|
5313
|
-
updateNodeData(id, { status:
|
|
5660
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
5314
5661
|
executeNode(id);
|
|
5315
5662
|
}, [id, executeNode, updateNodeData]);
|
|
5316
5663
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseNode, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
@@ -5444,9 +5791,6 @@ function VideoStitchNodeComponent(props) {
|
|
|
5444
5791
|
] }) });
|
|
5445
5792
|
}
|
|
5446
5793
|
var VideoStitchNode = react.memo(VideoStitchNodeComponent);
|
|
5447
|
-
|
|
5448
|
-
// src/nodes/processing/VideoTrimNode.tsx
|
|
5449
|
-
var import_types12 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
5450
5794
|
function formatTime2(seconds) {
|
|
5451
5795
|
const mins = Math.floor(seconds / 60);
|
|
5452
5796
|
const secs = Math.floor(seconds % 60);
|
|
@@ -5459,9 +5803,9 @@ function parseTime(timeStr) {
|
|
|
5459
5803
|
function VideoTrimNodeComponent(props) {
|
|
5460
5804
|
const { id, data } = props;
|
|
5461
5805
|
const nodeData = data;
|
|
5462
|
-
const updateNodeData =
|
|
5463
|
-
const executeNode =
|
|
5464
|
-
const openNodeDetailModal =
|
|
5806
|
+
const updateNodeData = chunkIHF35QZD_js.useWorkflowStore((state) => state.updateNodeData);
|
|
5807
|
+
const executeNode = chunkAXFOCPPP_js.useExecutionStore((state) => state.executeNode);
|
|
5808
|
+
const openNodeDetailModal = chunkAXFOCPPP_js.useUIStore((state) => state.openNodeDetailModal);
|
|
5465
5809
|
const hasRequiredInputs = !!nodeData.inputVideo;
|
|
5466
5810
|
const handleStartTimeChange = react.useCallback(
|
|
5467
5811
|
(e) => {
|
|
@@ -5490,7 +5834,7 @@ function VideoTrimNodeComponent(props) {
|
|
|
5490
5834
|
[id, updateNodeData]
|
|
5491
5835
|
);
|
|
5492
5836
|
const handleProcess = react.useCallback(() => {
|
|
5493
|
-
updateNodeData(id, { status:
|
|
5837
|
+
updateNodeData(id, { status: types.NodeStatusEnum.PROCESSING });
|
|
5494
5838
|
executeNode(id);
|
|
5495
5839
|
}, [id, executeNode, updateNodeData]);
|
|
5496
5840
|
const handleExpand = react.useCallback(() => {
|