fix: remove name-based fallback for seed control_after_generate

Remove name-based inference in useIntWidget.ts and groupNode.ts that
auto-added control_after_generate for any INT input named "seed" or
"noise_seed". Now only adds the control widget when control_after_generate
is explicitly set by the backend.

All core backend nodes already set control_after_generate explicitly.
Custom nodes like WAS_Text_Random_Line that use "seed" as a plain INT
were incorrectly getting a randomize control widget that reset on every
tab switch (since the control widget has serialize: false).

Update test fixture and remove stale screenshot expectation for the
DevToolsNodeWithSeedInput test node, which correctly has no
control_after_generate.

Fixes #7468
This commit is contained in:
dante01yoon
2026-04-11 23:41:44 +09:00
parent 30b4e83fcb
commit 4167a25ac8
4 changed files with 9 additions and 10 deletions

View File

@@ -15,7 +15,7 @@
"properties": {
"Node name for S&R": "DevToolsNodeWithSeedInput"
},
"widgets_values": [0, "randomize"]
"widgets_values": [0]
}
],
"links": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -544,15 +544,18 @@ export class GroupNodeConfig {
}
seenInputs[key] = (seenInputs[key] ?? 1) + 1
if (inputName === 'seed' || inputName === 'noise_seed') {
const configOptions =
typeof config[1] === 'object' && config[1] !== null ? config[1] : {}
if (
'control_after_generate' in configOptions &&
configOptions.control_after_generate
) {
if (!extra) extra = {}
extra.control_after_generate = `${prefix}control_after_generate`
}
if (config[0] === 'IMAGEUPLOAD') {
if (!extra) extra = {}
const nodeIndex = node.index ?? -1
const configOptions =
typeof config[1] === 'object' && config[1] !== null ? config[1] : {}
const widgetKey =
'widget' in configOptions && typeof configOptions.widget === 'string'
? configOptions.widget
@@ -561,9 +564,7 @@ export class GroupNodeConfig {
}
if (extra) {
const configObj =
typeof config[1] === 'object' && config[1] ? config[1] : {}
config = [config[0], { ...configObj, ...extra }]
config = [config[0], { ...configOptions, ...extra }]
}
return { name, config, customConfig }

View File

@@ -67,9 +67,7 @@ export const useIntWidget = () => {
}
)
const controlAfterGenerate =
inputSpec.control_after_generate ??
['seed', 'noise_seed'].includes(inputSpec.name)
const controlAfterGenerate = inputSpec.control_after_generate ?? false
if (controlAfterGenerate) {
const defaultType =