Skip to content

Commit

Permalink
feat: import comfyui
Browse files Browse the repository at this point in the history
  • Loading branch information
ikun97 committed Sep 19, 2024
1 parent 67c273d commit 0e46ccf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web/apps/web/src/stores/workflow/utils/data-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export const genReactFlow: (
},
position: { x, y },
});
x += STEP_SIZE;
// 写入input&context
setNodeData({
id: NodeIdEnum.start,
Expand Down Expand Up @@ -239,6 +238,8 @@ export const genReactFlow: (
if (xScale < 1) {
xScale = 1.3;
}
const currentX = pos?.[0] ? pos[0] * 1.3 + 200 : x;
const currentY = pos?.[1] ? pos[1] * 1.3 : y;
nodes.push({
id,
type,
Expand All @@ -252,11 +253,11 @@ export const genReactFlow: (
name: widgetName,
},
position: {
x: pos?.[0] ? pos[0] * 1.3 + 200 : x,
y: pos?.[1] ? pos[1] * 1.3 : y,
x: currentX,
y: currentY,
},
});
x += STEP_SIZE;
x = Math.max(x, currentX);
const input = block.inputs;
if (block.mode === 'undefined') {
setNodeData({
Expand Down Expand Up @@ -324,9 +325,8 @@ export const genReactFlow: (
type: NodeTypeEnum.end,
name: NodeTypeEnum.end,
},
position: { x, y },
position: { x: x + STEP_SIZE, y },
});
//
setNodeData({
id: NodeIdEnum.end,
data: {
Expand Down

0 comments on commit 0e46ccf

Please sign in to comment.