mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 08:30:06 +00:00
[Schema] ComfyNodeDefV2 schema (#2847)
This commit is contained in:
@@ -76,7 +76,7 @@ const onIdle = () => {
|
||||
const inputName = node.inputs[inputSlot].name
|
||||
const translatedTooltip = st(
|
||||
`nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(inputName)}.tooltip`,
|
||||
nodeDef.inputs.getInput(inputName)?.tooltip
|
||||
nodeDef.inputs[inputName]?.tooltip
|
||||
)
|
||||
return showTooltip(translatedTooltip)
|
||||
}
|
||||
@@ -90,7 +90,7 @@ const onIdle = () => {
|
||||
if (outputSlot !== -1) {
|
||||
const translatedTooltip = st(
|
||||
`nodeDefs.${normalizeI18nKey(node.type)}.outputs.${outputSlot}.tooltip`,
|
||||
nodeDef.outputs.all?.[outputSlot]?.tooltip
|
||||
nodeDef.outputs[outputSlot]?.tooltip
|
||||
)
|
||||
return showTooltip(translatedTooltip)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ const onIdle = () => {
|
||||
if (widget && !widget.element) {
|
||||
const translatedTooltip = st(
|
||||
`nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(widget.name)}.tooltip`,
|
||||
nodeDef.inputs.getInput(widget.name)?.tooltip
|
||||
nodeDef.inputs[widget.name]?.tooltip
|
||||
)
|
||||
// Widget tooltip can be set dynamically, current translation collection does not support this.
|
||||
return showTooltip(widget.tooltip ?? translatedTooltip)
|
||||
|
||||
@@ -83,16 +83,13 @@ https://github.com/Nuked88/ComfyUI-N-Sidebar/blob/7ae7da4a9761009fb6629bc04c6830
|
||||
import _ from 'lodash'
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
||||
import type { ComfyNodeDef as ComfyNodeDefV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||
import { useWidgetStore } from '@/stores/widgetStore'
|
||||
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
|
||||
|
||||
const props = defineProps({
|
||||
nodeDef: {
|
||||
type: ComfyNodeDefImpl,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const props = defineProps<{
|
||||
nodeDef: ComfyNodeDefV2
|
||||
}>()
|
||||
|
||||
const colorPaletteStore = useColorPaletteStore()
|
||||
const litegraphColors = computed(
|
||||
@@ -102,8 +99,8 @@ const litegraphColors = computed(
|
||||
const widgetStore = useWidgetStore()
|
||||
|
||||
const nodeDef = props.nodeDef
|
||||
const allInputDefs = nodeDef.inputs.all
|
||||
const allOutputDefs = nodeDef.outputs.all
|
||||
const allInputDefs = Object.values(nodeDef.inputs)
|
||||
const allOutputDefs = nodeDef.outputs
|
||||
const slotInputDefs = allInputDefs.filter(
|
||||
(input) => !widgetStore.inputIsWidget(input)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user