-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement creating inputs by dragging link to widget (#1021)
* Implement creating inputs by dragging link to widget * Update litegraph * Add playwright test * Update test expectations [skip ci] --------- Co-authored-by: huchenlei <huchenlei@proton.me> Co-authored-by: github-actions <github-actions@github.com>
- Loading branch information
1 parent
c42222c
commit a2bd2a9
Showing
9 changed files
with
247 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"last_node_id": 2, | ||
"last_link_id": 1, | ||
"nodes": [ | ||
{ | ||
"id": 2, | ||
"type": "KSampler", | ||
"pos": { | ||
"0": 304.3653259277344, | ||
"1": 42.15586471557617 | ||
}, | ||
"size": [ | ||
315, | ||
262 | ||
], | ||
"flags": {}, | ||
"order": 0, | ||
"mode": 0, | ||
"inputs": [ | ||
{ | ||
"name": "model", | ||
"type": "MODEL", | ||
"link": null | ||
}, | ||
{ | ||
"name": "positive", | ||
"type": "CONDITIONING", | ||
"link": null | ||
}, | ||
{ | ||
"name": "negative", | ||
"type": "CONDITIONING", | ||
"link": null | ||
}, | ||
{ | ||
"name": "latent_image", | ||
"type": "LATENT", | ||
"link": null | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"name": "LATENT", | ||
"type": "LATENT", | ||
"links": null, | ||
"shape": 3 | ||
} | ||
], | ||
"properties": { | ||
"Node name for S&R": "KSampler" | ||
}, | ||
"widgets_values": [ | ||
0, | ||
"randomize", | ||
20, | ||
8, | ||
"euler", | ||
"normal", | ||
1 | ||
] | ||
}, | ||
{ | ||
"id": 1, | ||
"type": "PrimitiveNode", | ||
"pos": { | ||
"0": 14, | ||
"1": 43 | ||
}, | ||
"size": [ | ||
203.1999969482422, | ||
40.368401303242536 | ||
], | ||
"flags": {}, | ||
"order": 1, | ||
"mode": 0, | ||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
"name": "connect to widget input", | ||
"type": "*", | ||
"links": [], | ||
"slot_index": 0 | ||
} | ||
], | ||
"properties": { | ||
"Run widget replace on values": false | ||
}, | ||
"widgets_values": [] | ||
} | ||
], | ||
"links": [], | ||
"groups": [], | ||
"config": {}, | ||
"extra": { | ||
"ds": { | ||
"scale": 1, | ||
"offset": [ | ||
0, | ||
0 | ||
] | ||
} | ||
}, | ||
"version": 0.4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
import { expect } from '@playwright/test' | ||
import { comfyPageFixture as test } from './ComfyPage' | ||
import { type NodeReference, comfyPageFixture as test } from './ComfyPage' | ||
|
||
test.describe('Primitive Node', () => { | ||
test('Can load with correct size', async ({ comfyPage }) => { | ||
await comfyPage.loadWorkflow('primitive_node') | ||
await expect(comfyPage.canvas).toHaveScreenshot('primitive_node.png') | ||
}) | ||
|
||
// When link is dropped on widget, it should automatically convert the widget | ||
// to input. | ||
test('Can connect to widget', async ({ comfyPage }) => { | ||
await comfyPage.loadWorkflow('primitive_node_unconnected') | ||
const primitiveNode: NodeReference = await comfyPage.getNodeRefById(1) | ||
const ksamplerNode: NodeReference = await comfyPage.getNodeRefById(2) | ||
// Connect the output of the primitive node to the input of first widget of the ksampler node | ||
await primitiveNode.connectWidget(0, ksamplerNode, 0) | ||
await expect(comfyPage.canvas).toHaveScreenshot( | ||
'primitive_node_connected.png' | ||
) | ||
}) | ||
}) |
Binary file added
BIN
+62.2 KB
.../primitiveNode.spec.ts-snapshots/primitive-node-connected-chromium-2x-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.4 KB
...sts/primitiveNode.spec.ts-snapshots/primitive-node-connected-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters