HEL-892: pin AudioCrop and GuHai split reference contracts

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-30 03:44:25 +08:00
co-authored by multica-agent
parent b30ea8917d
commit 9fb77d5360
23 changed files with 5143 additions and 25 deletions
@@ -0,0 +1,31 @@
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
import { isBooleanInputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
import type { InputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
import type { ComfyWidgetConstructorV2 } from '@/scripts/widgets'
export const useBooleanWidget = () => {
const widgetConstructor: ComfyWidgetConstructorV2 = (
node: LGraphNode,
inputSpec: InputSpec
) => {
if (!isBooleanInputSpec(inputSpec)) {
throw new Error(`Invalid input data: ${inputSpec}`)
}
const defaultVal = inputSpec.default ?? false
const options = {
on: inputSpec.label_on,
off: inputSpec.label_off
}
return node.addWidget(
'toggle',
inputSpec.name,
defaultVal,
() => {},
options
)
}
return widgetConstructor
}