1.6 patches (#2141)

This commit is contained in:
Chenlei Hu
2025-01-03 11:20:25 -05:00
committed by GitHub
parent 9d8633aafa
commit 5972a07cfe
6 changed files with 39 additions and 11 deletions

View File

@@ -821,6 +821,11 @@ export class ComfyPage {
async getNodeRefById(id: NodeId) {
return new NodeReference(id, this)
}
async getNodes() {
return await this.page.evaluate(() => {
return window['app'].graph.nodes
})
}
async getNodeRefsByType(type: string): Promise<NodeReference[]> {
return Promise.all(
(

View File

@@ -152,6 +152,13 @@ export class WorkflowsSidebarTab extends SidebarTab {
await this.page.keyboard.press('Enter')
await this.page.waitForTimeout(300)
}
async insertWorkflow(locator: Locator) {
await locator.click({ button: 'right' })
await this.page
.locator('.p-contextmenu-item-content', { hasText: 'Insert' })
.click()
}
}
export class QueueSidebarTab extends SidebarTab {

View File

@@ -429,6 +429,26 @@ test.describe('Menu', () => {
])
})
test('Can open workflow after insert', async ({ comfyPage }) => {
await comfyPage.setupWorkflowsDirectory({
'workflow1.json': 'single_ksampler.json'
})
await comfyPage.setup()
const tab = comfyPage.menu.workflowsTab
await tab.open()
await comfyPage.executeCommand('Comfy.LoadDefaultWorkflow')
const originalNodeCount = (await comfyPage.getNodes()).length
await tab.insertWorkflow(tab.getPersistedItem('workflow1.json'))
await comfyPage.nextFrame()
expect((await comfyPage.getNodes()).length).toEqual(originalNodeCount + 1)
await tab.getPersistedItem('workflow1.json').click()
await comfyPage.nextFrame()
expect((await comfyPage.getNodes()).length).toEqual(1)
})
test('Can rename nested workflow from opened workflow item', async ({
comfyPage
}) => {

8
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.3",
"@comfyorg/litegraph": "^0.8.58",
"@comfyorg/litegraph": "^0.8.59",
"@primevue/themes": "^4.0.5",
"@tiptap/core": "^2.10.4",
"@tiptap/extension-link": "^2.10.4",
@@ -1940,9 +1940,9 @@
"license": "GPL-3.0-only"
},
"node_modules/@comfyorg/litegraph": {
"version": "0.8.58",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.58.tgz",
"integrity": "sha512-V/4yC8i5QOpDV20ZiEMiZP6KnmYD5d15El3V4tmH/MkhjOxjc6owAFMyAVgpxphYdcBF2qj1QTNTrZLgC6x2VQ==",
"version": "0.8.59",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.59.tgz",
"integrity": "sha512-/qyTsI+NIiMU7Ie8kJMvX+TL/axkX7wCurxjxODSdrmh9mb8eq4DfOLqRVbnCsLYEYmRlc5eBhTqp/q8zQRF5Q==",
"license": "MIT"
},
"node_modules/@cspotcode/source-map-support": {

View File

@@ -82,7 +82,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.3",
"@comfyorg/litegraph": "^0.8.58",
"@comfyorg/litegraph": "^0.8.59",
"@primevue/themes": "^4.0.5",
"@tiptap/core": "^2.10.4",
"@tiptap/extension-link": "^2.10.4",

View File

@@ -49,7 +49,7 @@ import {
} from './pnginfo'
import { $el, ComfyUI } from './ui'
import { ComfyAppMenu } from './ui/menu/index'
import { getStorageValue } from './utils'
import { clone, getStorageValue } from './utils'
import { type ComfyWidgetConstructor, ComfyWidgets } from './widgets'
export const ANIM_PREVIEW_WIDGET = '$$comfy_animation_preview'
@@ -1271,11 +1271,7 @@ export class ComfyApp {
reset_invalid_values = true
}
if (typeof structuredClone === 'undefined') {
graphData = JSON.parse(JSON.stringify(graphData))
} else {
graphData = structuredClone(graphData)
}
graphData = clone(graphData)
if (useSettingStore().get('Comfy.Validation.Workflows')) {
// TODO: Show validation error in a dialog.