Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dist-ssr
*.local
# Claude configuration
.claude/*.local.json
.claude/*.local.md
.claude/*.local.txt
CLAUDE.local.md

# Editor directories and files
Expand Down
24 changes: 14 additions & 10 deletions src/components/graph/GraphCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,20 @@ watch(
const nodeErrors = lastNodeErrors?.[node.id]
if (!nodeErrors) continue

let slotErrorsChanged = false
for (const error of nodeErrors.errors) {
if (!error.extra_info?.input_name) continue

const inputIndex = node.findInputSlot(error.extra_info.input_name)
if (inputIndex === -1) continue

node.inputs[inputIndex].hasErrors = true
slotErrorsChanged = true
}
const validErrors = nodeErrors.errors.filter(
(error) => error.extra_info?.input_name !== undefined
)
const slotErrorsChanged =
validErrors.length > 0 &&
validErrors.some((error) => {
const inputName = error.extra_info!.input_name!
const inputIndex = node.findInputSlot(inputName)
if (inputIndex !== -1) {
node.inputs[inputIndex].hasErrors = true
return true
}
return false
})

// Trigger Vue node data update if slot errors changed
if (slotErrorsChanged && comfyApp.graph.onTrigger) {
Expand Down
20 changes: 6 additions & 14 deletions src/renderer/extensions/vueNodes/components/LGraphNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ import { computed, inject, onErrorCaptured, onMounted, provide, ref } from 'vue'

import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
import { useErrorHandling } from '@/composables/useErrorHandling'
import {
type INodeInputSlot,
type INodeOutputSlot,
LiteGraph
} from '@/lib/litegraph/src/litegraph'
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions'
import { TransformStateKey } from '@/renderer/core/layout/injectionKeys'
Expand Down Expand Up @@ -211,12 +207,8 @@ const hasAnyError = computed((): boolean => {
!!error ||
// Type assertions needed because VueNodeData.inputs/outputs are typed as unknown[]
// but at runtime they contain INodeInputSlot/INodeOutputSlot objects
!!nodeData.inputs?.some(
(slot) => (slot as INodeInputSlot)?.hasErrors ?? false
) ||
!!nodeData.outputs?.some(
(slot) => (slot as INodeOutputSlot)?.hasErrors ?? false
)
!!nodeData.inputs?.some((slot) => slot?.hasErrors ?? false) ||
!!nodeData.outputs?.some((slot) => slot?.hasErrors ?? false)
)
})

Expand Down Expand Up @@ -279,7 +271,7 @@ const { latestPreviewUrl, shouldShowPreviewImg } = useNodePreviewState(

const borderClass = computed(() => {
if (hasAnyError.value) {
return 'border-red-500 dark-theme:border-red-500'
return 'border-error dark-theme:border-error'
}
if (executing.value) {
return 'border-blue-500'
Expand All @@ -292,10 +284,10 @@ const outlineClass = computed(() => {
return undefined
}
if (hasAnyError.value) {
return 'outline-red-500'
return 'outline-error dark-theme:outline-error'
}
if (executing.value) {
return 'outline-blue-500'
return 'outline-blue-500 dark-theme:outline-blue-500'
}
return 'outline-black dark-theme:outline-white'
})
Expand Down
Loading