Compare commits

...

3 Commits

Author SHA1 Message Date
filtered
db11580668 Create native reroutes from node search menu 2025-03-22 10:09:55 +11:00
Comfy Org PR Bot
22a1200bdf [chore] Update litegraph to 0.11.0-0 (#3183)
Co-authored-by: webfiltered <176114999+webfiltered@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
2025-03-22 10:08:41 +11:00
Chenlei Hu
ee20b63bc1 Remove unused plugin vite-plugin-static-copy (#3182) 2025-03-21 14:11:01 -04:00
4 changed files with 32 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 103 KiB

27
package-lock.json generated
View File

@@ -12,7 +12,7 @@
"@alloc/quick-lru": "^5.2.0",
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.31",
"@comfyorg/litegraph": "^0.10.9",
"@comfyorg/litegraph": "^0.11.0-0",
"@primevue/forms": "^4.2.5",
"@primevue/themes": "^4.2.5",
"@sentry/vue": "^8.48.0",
@@ -79,7 +79,6 @@
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.14",
"vite-plugin-dts": "^4.3.0",
"vite-plugin-static-copy": "^1.0.5",
"vitest": "^2.0.0",
"vue-tsc": "^2.1.10",
"zip-dir": "^2.0.0",
@@ -479,9 +478,9 @@
"license": "GPL-3.0-only"
},
"node_modules/@comfyorg/litegraph": {
"version": "0.10.9",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.10.9.tgz",
"integrity": "sha512-ubGozxdDIVNL/MYvfCAXgiaqBfIODtp0jZeN9uzWrdHwqUy9ZkLt/7/q7G4nGpNcEoShbMu7EK4VPH3WRmNQ7A==",
"version": "0.11.0-0",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.11.0-0.tgz",
"integrity": "sha512-FFQevL2EyMSfnhfYeDX4iyd9tze54VPEpa2H8KbSfDnXNvrwdeEvvARr4OXVcp3aoO8gdbahdRVdv0LpLGGwnA==",
"license": "MIT"
},
"node_modules/@cspotcode/source-map-support": {
@@ -12723,24 +12722,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/vite-plugin-static-copy": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-1.0.6.tgz",
"integrity": "sha512-3uSvsMwDVFZRitqoWHj0t4137Kz7UynnJeq1EZlRW7e25h2068fyIZX4ORCCOAkfp1FklGxJNVJBkBOD+PZIew==",
"dev": true,
"dependencies": {
"chokidar": "^3.5.3",
"fast-glob": "^3.2.11",
"fs-extra": "^11.1.0",
"picocolors": "^1.0.0"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": "^5.0.0"
}
},
"node_modules/vitest": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.0.tgz",

View File

@@ -62,7 +62,6 @@
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.14",
"vite-plugin-dts": "^4.3.0",
"vite-plugin-static-copy": "^1.0.5",
"vitest": "^2.0.0",
"vue-tsc": "^2.1.10",
"zip-dir": "^2.0.0",
@@ -72,7 +71,7 @@
"@alloc/quick-lru": "^5.2.0",
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.31",
"@comfyorg/litegraph": "^0.10.9",
"@comfyorg/litegraph": "^0.11.0-0",
"@primevue/forms": "^4.2.5",
"@primevue/themes": "^4.2.5",
"@sentry/vue": "^8.48.0",

View File

@@ -35,7 +35,8 @@
<script setup lang="ts">
import { LiteGraph } from '@comfyorg/litegraph'
import type {
ConnectingLink,
INodeInputSlot,
INodeOutputSlot,
LiteGraphCanvasEvent,
Vector2
} from '@comfyorg/litegraph'
@@ -88,16 +89,33 @@ const closeDialog = () => {
}
const addNode = (nodeDef: ComfyNodeDefImpl) => {
const node = litegraphService.addNodeOnGraph(nodeDef, {
pos: getNewNodeLocation()
})
type InputOrOutputSlot = INodeInputSlot | INodeOutputSlot | undefined
const eventDetail = triggerEvent.value?.detail
if (eventDetail && eventDetail.subType === 'empty-release') {
// @ts-expect-error fixme ts strict error
eventDetail.linkReleaseContext.links.forEach((link: ConnectingLink) => {
ConnectingLinkImpl.createFromPlainObject(link).connectTo(node)
if (nodeDef.name === 'Reroute') {
if (eventDetail && eventDetail.subType === 'empty-release') {
for (const link of eventDetail.linkReleaseContext.links) {
const slot = (link.output ?? link.input) as InputOrOutputSlot
if (!slot) continue
link.node.connectFloatingReroute(getNewNodeLocation(), slot)
link.node.setDirtyCanvas(false, true)
}
} else {
// TODO: Should hide the reroute from the search menu, if it's not an "empty release" (dragging new link)
}
} else {
const node = litegraphService.addNodeOnGraph(nodeDef, {
pos: getNewNodeLocation()
})
const eventDetail = triggerEvent.value?.detail
if (eventDetail && eventDetail.subType === 'empty-release') {
eventDetail.linkReleaseContext.links.forEach((link) => {
// @ts-expect-error Type overwritten by computed public interface
ConnectingLinkImpl.createFromPlainObject(link).connectTo(node)
})
}
}
// TODO: This is not robust timing-wise.