Remove old deprecation code.
ComfyUI now has native support for marking nodes as deprecated or experimental, so the much of the code here no longer serves a purpose. Zombie code for hiding nodes has been removed and this code now only exists to display a text label on the node of a specific color. This removes excessive console spam about deprecation in the reading of setting values.
This commit is contained in:
@@ -1,54 +1,7 @@
|
||||
import { app } from '../../../scripts/app.js'
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: "ADE.ShowExperimental",
|
||||
name: "🎭🅐🅓 Show experimental nodes",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
});
|
||||
app.ui.settings.addSetting({
|
||||
id: "ADE.ShowDeprecated",
|
||||
name: "🎭🅐🅓 Show deprecated nodes",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
const deprecate_nodes = {
|
||||
name: 'AnimateDiff.deprecate_nodes',
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
||||
let showDeprecated = app.ui.settings.getSettingValue("ADE.ShowDeprecated", false)
|
||||
let showExperimental = app.ui.settings.getSettingValue("ADE.ShowExperimental", false)
|
||||
let warnWidget = false
|
||||
if (nodeData?.input?.optional) {
|
||||
for (let w in nodeData.input.optional) {
|
||||
if (nodeData.input.optional[w][0] == "ADEWARN") {
|
||||
warnWidget = nodeData.input.optional[w]
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (warnWidget) {
|
||||
if (!((warnWidget[1].warn_type || "deprecated") == "deprecated" && showDeprecated) &&
|
||||
!(warnWidget[1].warn_type == "experimental" && showExperimental)) {
|
||||
nodeType.filter = "hidden"
|
||||
}
|
||||
}
|
||||
if (!nodeType.filter) {
|
||||
nodeType.filter = app.graph.filter
|
||||
}
|
||||
|
||||
},
|
||||
async init() {
|
||||
app.graph.filter = app.graph.filter || "shown"
|
||||
},
|
||||
async setup() {
|
||||
for (let k in LiteGraph.registered_node_types) {
|
||||
let nodeType = LiteGraph.registered_node_types[k]
|
||||
if (!nodeType.filter) {
|
||||
nodeType.filter = app.graph.filter
|
||||
}
|
||||
}
|
||||
},
|
||||
async getCustomWidgets() {
|
||||
return {
|
||||
ADEWARN(node, inputName, inputData) {
|
||||
|
||||
Reference in New Issue
Block a user