UNPKG

n8n-nodes-comfyui-media

Version:

n8n node to integrate with ComfyUI stable diffusion workflows for image to video conversion

25 lines 910 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WorkflowService = void 0; class WorkflowService { static parse(workflowJson) { try { const workflow = JSON.parse(workflowJson); if (typeof workflow !== 'object' || workflow === null) { throw new Error('Invalid workflow structure'); } return workflow; } catch (err) { throw new Error(`Invalid workflow JSON: ${err.message}`); } } static injectImage(workflow, imageInfo) { const loadImageNode = Object.values(workflow).find((node) => node.class_type === 'LoadImage'); if (!loadImageNode) throw new Error('No LoadImage node found'); loadImageNode.inputs.image = imageInfo.name; } } exports.WorkflowService = WorkflowService; //# sourceMappingURL=workflowService.js.map