Update control_after_generate schema (#8505)

Updates `control_after_generate` in the schema to support specifying the
default control value as a string

See Comfy-Org/ComfyUI#12187

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8505-Update-control_after_generate-schema-2f96d73d365081f9bf73c804072bb415)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2026-01-30 21:34:50 -08:00
committed by GitHub
parent a807986835
commit be7c34e28b
4 changed files with 28 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ import { z } from 'zod'
import { fromZodError } from 'zod-validation-error'
import { resultItemType } from '@/schemas/apiSchema'
import { CONTROL_OPTIONS } from '@/types/simplifiedWidget'
const zComboOption = z.union([z.string(), z.number()])
const zRemoteWidgetConfig = z.object({
@@ -50,7 +51,9 @@ export const zIntInputOptions = zNumericInputOptions.extend({
* If true, a linked widget will be added to the node to select the mode
* of `control_after_generate`.
*/
control_after_generate: z.boolean().optional()
control_after_generate: z
.union([z.boolean(), z.enum(CONTROL_OPTIONS)])
.optional()
})
export const zFloatInputOptions = zNumericInputOptions.extend({
@@ -74,7 +77,9 @@ export const zStringInputOptions = zBaseInputOptions.extend({
})
export const zComboInputOptions = zBaseInputOptions.extend({
control_after_generate: z.boolean().optional(),
control_after_generate: z
.union([z.boolean(), z.enum(CONTROL_OPTIONS)])
.optional(),
image_upload: z.boolean().optional(),
image_folder: resultItemType.optional(),
allow_batch: z.boolean().optional(),