-
Notifications
You must be signed in to change notification settings - Fork 587
Fix mask editor sometimes showing wrong image #12413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -301,3 +301,30 @@ test.describe('Mask Editor', { tag: '@vue-nodes' }, () => { | |
| } | ||
| ) | ||
| }) | ||
|
|
||
| test('Will not use stale litegraph previews', async ({ comfyPage }) => { | ||
| await comfyPage.menu.topbar.newWorkflowButton.click() | ||
| await comfyPage.searchBoxV2.addNode('Preview Image') | ||
|
|
||
| async function simulateExecuted(image: object) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe worth adding this to
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like |
||
| await comfyPage.page.evaluate((pageImage) => { | ||
| const output = { images: [pageImage] } | ||
| const detail = { node: '1', output, prompt_id: '', display_node: '1' } | ||
| app!.api.dispatchCustomEvent('executed', detail) | ||
| app!.canvas.setDirty(true) | ||
| }, image) | ||
| } | ||
| async function getNodeOutput() { | ||
| return await comfyPage.page.evaluate( | ||
| () => graph!.getNodeById('1')!.images?.[0]?.filename | ||
| ) | ||
| } | ||
|
|
||
| await simulateExecuted({ filename: 'test1.png' }) | ||
| await expect.poll(getNodeOutput).toBe('test1.png') | ||
|
|
||
| await comfyPage.settings.setSetting('Comfy.VueNodes.Enabled', true) | ||
|
|
||
| await simulateExecuted({ filename: 'example.png', type: 'input' }) | ||
| await expect.poll(getNodeOutput).toBe('example.png') | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test isnt inside a describe and doesn't actually test any mask editor functionality so probably better elsewhere or open the mask editor at the end to validate that it is the correct image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment got eaten 😭
I agree. There's not a (non screenshot/route mock) way to test the image loaded by the mask editor, but the prior structure of the test actually worked out nicely here.
Tragically, the existing mask editor fixture code isn't helpful since it forcibly loads a different workflow.