diff --git a/custom-nodes/workflow_templates.mdx b/custom-nodes/workflow_templates.mdx index 77d96c701..7998b19d3 100644 --- a/custom-nodes/workflow_templates.mdx +++ b/custom-nodes/workflow_templates.mdx @@ -28,6 +28,49 @@ Under `ComfyUI-MyCustomNodeModule/example_workflows/` directory: - `My_example_workflow_1.jpg` - `My_example_workflow_2.json` -In this example ComfyUI's template browser shows a category called `ComfyUI-MyCustomNodeModule` with two items, one of which has a thumbnail. - +In this example ComfyUI's template browser shows a category called `ComfyUI-MyCustomNodeModule` with two items, one of which has a thumbnail. + For a real-world example, see [ComfyUI-Impact-Pack's example_workflows folder](https://github.com/ltdrdata/ComfyUI-Impact-Pack/tree/Main/example_workflows). + +## Customization +More extensive configuration can be done by adding an `index.json` to the example workflow folder. +This index should follow the core workflows standard and optionaly contain: +* `description` the custom node description +* `templates` A list of The customized templates + +Each template can contain the following keys: +* `name`: needs to match the template file name. Mandatory +* `title`: The template title. Optional, default to workflow name +* `description`: The title description. Optional, default to workflow name +* `mediaSubtype`: the workflow thumbnail file(s) extenstion (`jpg`, `png`, `webp`, ...), default to `jpg`. Optional. +* `thumbnailVariant`: custom thumbnail variant, either `compareSlider` or `hoverDissolve` for now. Requires a `mediaSubtype` to be set and the thumbnails files suffixed with `-1` and `-2`. Optional + +### Example +This example `index.json` +```json +{ + "description": "An awesome CustomNode module.", + "templates": [ + { + "name": "My_example_workflow_1", + "title": "My First Workflow", + "description": "A workflow generating an awesome Image.", + }, + { + "name": "My_example_workflow_2", + "title": "My Second Workflow", + "description": "A workflow upscaling an image with more details.", + "mediaSubtype": "webp", + "thumbnailVariant": "compareSlider" + } + ] +} +``` + +Will work with the following structure under `ComfyUI-MyCustomNodeModule/example_workflows/` directory: + - `index.json` + - `My_example_workflow_1.json` + - `My_example_workflow_1.jpg` + - `My_example_workflow_2.json` + - `My_example_workflow_2-1.webp` + - `My_example_workflow_2-2.webp`