mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-11 02:20:08 +00:00
Fix node bypass color (#971)
* Fix node bypass color * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -251,6 +251,18 @@ test.describe('Node Interaction', () => {
|
||||
await comfyPage.nextFrame()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('nodes-unpinned.png')
|
||||
})
|
||||
|
||||
test('Can bypass/unbypass nodes with keyboard shortcut', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
await comfyPage.select2Nodes()
|
||||
await comfyPage.canvas.press('Control+b')
|
||||
await comfyPage.nextFrame()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('nodes-bypassed.png')
|
||||
await comfyPage.canvas.press('Control+b')
|
||||
await comfyPage.nextFrame()
|
||||
await expect(comfyPage.canvas).toHaveScreenshot('nodes-unbypassed.png')
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Group Interaction', () => {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
@@ -1551,9 +1551,9 @@ export class ComfyApp {
|
||||
|
||||
const origDrawNode = LGraphCanvas.prototype.drawNode
|
||||
LGraphCanvas.prototype.drawNode = function (node, ctx) {
|
||||
var editor_alpha = this.editor_alpha
|
||||
var old_color = node.color
|
||||
var old_bgcolor = node.bgcolor
|
||||
const editor_alpha = this.editor_alpha
|
||||
const old_color = node.color
|
||||
const old_bgcolor = node.bgcolor
|
||||
|
||||
if (node.mode === 2) {
|
||||
// never
|
||||
@@ -1561,11 +1561,14 @@ export class ComfyApp {
|
||||
}
|
||||
|
||||
// ComfyUI's custom node mode enum value 4 => bypass/never.
|
||||
let bgColor: string
|
||||
// @ts-expect-error
|
||||
if (node.mode === 4) {
|
||||
// never
|
||||
node.bgcolor = '#FF00FF'
|
||||
bgColor = '#FF00FF'
|
||||
this.editor_alpha = 0.2
|
||||
} else {
|
||||
bgColor = old_bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR
|
||||
}
|
||||
|
||||
const adjustments: ColorAdjustOptions = {}
|
||||
@@ -1582,10 +1585,7 @@ export class ComfyApp {
|
||||
}
|
||||
}
|
||||
|
||||
node.bgcolor = adjustColor(
|
||||
old_bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR,
|
||||
adjustments
|
||||
)
|
||||
node.bgcolor = adjustColor(bgColor, adjustments)
|
||||
|
||||
const res = origDrawNode.apply(this, arguments)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user