e1467bda8e6ed2fadb17d21bc217f7dcefbf5345
ComfyUI - RE-CustomUtils
A collection of custom nodes for ComfyUI.
Note
This project was inspired by the cookiecutter template, though the full architecture is a bit different.
Quickstart
- Install ComfyUI.
- Install ComfyUI-Manager
- Look up this extension in ComfyUI-Manager. If you are installing manually, clone this repository under
ComfyUI/custom_nodes. - Restart ComfyUI.
Features
PromptPresetSelector node
Input:
separator(str), default to |preset_index(int) in range 1 to 50, default to 1text(str), a multiline textarea
Output:
prompt(str), the formatted promptpreset_index(int), the selected index
This node helps introducing variations to a text, usually a prompt, by supporting templates. Basically, you can include a template like this {% %} in your text, that will hold various options, separated by the separator.
Depending on the chosen preset_index, the correct preset option will be parsed and add to the text.
Example:
This is {% an example | a text | a text %} for {% the PromptPresetSelector | the README | %}
- With
preset_index== 1: This is an example for the PromptPresetSelector - With
preset_index== 2: This is an text for the README - With
preset_index== 3: This is an text for
The node validates that the separator is filled, that you registered the same amount of options in all of the templates, and that you selected a preset_index within the length of the configured presets.
Example:
If we fix preset_index to 3:
- This is {% a text | a message %} for {% the PromptPresetSelector %} => Error, first template with 2 presets while the second only got 1
- This is {% a text | a message %} for {% the PromptPresetSelector | the README %} => Error, only 2 presets were configured
TODO
- Add JS to transform the preset_index in a dynamic dropdown, based on the configured presets
- Add field to name the different presets
Languages
JavaScript
51.9%
Python
48.1%
