diff --git a/nodes.py b/nodes.py index c4b260920..4b6ccb75b 100644 --- a/nodes.py +++ b/nodes.py @@ -1335,7 +1335,7 @@ class KSampler: {"model": ("MODEL", { "label": "model" }), "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "label": "seed"}), "steps": ("INT", {"default": 20, "min": 1, "max": 10000, "label": "steps"}), - "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01, "label": "steps"}), + "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01, "label": "cfg"}), "sampler_name": (comfy.samplers.KSampler.SAMPLERS, { "label": "sampler name" } ), "scheduler": (comfy.samplers.KSampler.SCHEDULERS, { "label": "scheduler" } ), "positive": ("CONDITIONING", { "label": "positive" }), diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index 8db2e4bcb..15a34d0a5 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -4,6 +4,7 @@ import { applyTextReplacements } from "../../scripts/utils.js"; const CONVERTED_TYPE = "converted-widget"; const VALID_TYPES = ["STRING", "combo", "number", "BOOLEAN"]; +const UNVALID_NAMES = ["control_after_generate"]; const CONFIG = Symbol(); const GET_CONFIG = Symbol(); const TARGET = Symbol(); // Used for reroutes to specify the real target widget @@ -18,7 +19,7 @@ function getConfig(widgetName) { } function isConvertableWidget(widget, config) { - return (VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0])) && !widget.options?.forceInput; + return (VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0])) && !UNVALID_NAMES.includes(widget.name) && !widget.options?.forceInput; } function hideWidget(node, widget, suffix = "") { diff --git a/web/lib/litegraph.core.js b/web/lib/litegraph.core.js index ca76a46cf..2b7b069bf 100644 --- a/web/lib/litegraph.core.js +++ b/web/lib/litegraph.core.js @@ -3379,7 +3379,7 @@ * @param {Object} extra_info this can be used to have special properties of an output (label, special color, position, etc) */ LGraphNode.prototype.addOutput = function(name, type, extra_info) { - var output = { name: name, label: extra_info.label, type: type, links: null }; + var output = { name: name, label: extra_info?.label || name, type: type, links: null }; if (extra_info) { for (var i in extra_info) { output[i] = extra_info[i]; diff --git a/web/scripts/widgets.js b/web/scripts/widgets.js index bf9562271..c6a1419f7 100644 --- a/web/scripts/widgets.js +++ b/web/scripts/widgets.js @@ -310,6 +310,8 @@ export const ComfyWidgets = { let disable_rounding = app.ui.settings.getSettingValue("Comfy.DisableFloatRounding") if (precision == 0) precision = undefined; const { val, config } = getNumberDefaults(inputData, 0.5, precision, !disable_rounding); + const inputLabel = inputData[1]?.label || inputName; + Object.assign(config, { label: inputLabel }); return { widget: node.addWidget(widgetType, inputName, val, function (v) { if (config.round) { @@ -335,6 +337,8 @@ export const ComfyWidgets = { if (inputData[1].label_off) options["off"] = inputData[1].label_off; } + const inputLabel = inputData[1]?.label || inputName; + Object.assign(options, { label: inputLabel }); return { widget: node.addWidget( "toggle", @@ -348,13 +352,14 @@ export const ComfyWidgets = { STRING(node, inputName, inputData, app) { const defaultVal = inputData[1].default || ""; const multiline = !!inputData[1].multiline; - inputData[1].placeholder = inputData[1]?.placeholder || inputData[1]?.label || inputName; + const inputLabel = inputData[1]?.label || inputName; + inputData[1].placeholder = inputData[1]?.placeholder || inputLabel; let res; if (multiline) { res = addMultilineWidget(node, inputName, { defaultVal, ...inputData[1] }, app); } else { - res = { widget: node.addWidget("text", inputName, defaultVal, () => {}, {}) }; + res = { widget: node.addWidget("text", inputName, defaultVal, () => {}, { label: inputLabel }) }; } if(inputData[1].dynamicPrompts != undefined) @@ -369,6 +374,7 @@ export const ComfyWidgets = { defaultValue = inputData[1].default; } const inputLabel = inputData[1]?.label || inputName + inputData[1].label = inputLabel; const res = { widget: node.addWidget("combo", inputName, defaultValue, () => {}, { values: type, label: inputLabel }) }; if (inputData[1]?.control_after_generate) { res.widget.linkedWidgets = addValueControlWidgets(node, res.widget, undefined, undefined, inputData);