Replace the custom mode/value/start/end/counter machinery with ComfyUI's native per-widget control_after_generate on the role combo. Set it to 'increment wrap' to advance one role per generation (wrapping), or 'randomize' for a random role; 'fixed' holds the selection. The frontend steps the combo, so the role visibly updates on the node, and no internal index, seed, modulo, or NaN re-run logic is needed. Outputs unchanged: system_prompt, role_name, resolved_index. Dual-API preserved; V3 passes control_after_generate inside try/except TypeError for older comfy_api.
17 lines
708 B
TOML
17 lines
708 B
TOML
[project]
|
|
name = "comfyui_llmsetrole"
|
|
description = "Pick an LLM role (system prompt) from a dropdown and output it as a STRING for an LLM node's system_prompt. Use the role widget's control_after_generate to step (increment wrap) or randomize roles across a batch. Roles are plain Markdown files in roles/; add a .md file and restart to add a role. Node name: Set Role. Located under Add Node > LLM."
|
|
version = "1.3.2"
|
|
license = { file = "LICENSE" }
|
|
requires-python = ">=3.10"
|
|
dependencies = []
|
|
|
|
[project.urls]
|
|
Repository = "https://github.com/bradsec/ComfyUI_LLMSetRole"
|
|
# Used by Comfy Registry https://comfyregistry.org
|
|
|
|
[tool.comfy]
|
|
PublisherId = "bradsec"
|
|
DisplayName = "ComfyUI_LLMSetRole"
|
|
Icon = ""
|