feat(text_input): add text input tool for ComfyUI

This commit is contained in:
Vito Sansevero
2025-10-05 05:39:09 -07:00
parent 27431b3a92
commit af1bc6845a
2 changed files with 64 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
"""Text Input tool for ComfyUI."""
from .node import TextInputNode, NODE_DISPLAY_NAME
__all__ = ["TextInputNode", "NODE_DISPLAY_NAME"]
+59
View File
@@ -0,0 +1,59 @@
"""Text Input node implementation."""
from ...base import ComfyAssetsBaseNode
class TextInputNode(ComfyAssetsBaseNode):
"""Provides a text input field for manual text entry in ComfyUI workflows."""
@classmethod
def INPUT_TYPES(cls):
"""Define input types for the node."""
return {
"required": {
"text": (
"STRING",
{
"multiline": True,
"default": "",
"dynamicPrompts": True,
},
),
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("text",)
FUNCTION = "execute"
CATEGORY = "🫶 ComfyAssets/📝 Text"
DESCRIPTION = """
Simple text input field for entering text manually.
Features:
- Multiline text editing
- Supports wildcards and dynamic prompts
- Direct connection to CLIP text encoders
- Unicode and special character support
Use Cases:
- Positive/negative prompts
- Custom text for workflows
- Manual text editing
- Prompt templates
"""
def execute(self, text):
"""Process the input text and return it.
Args:
text: Input text from the widget
Returns:
Tuple containing the text
"""
return (text,)
# Node display name
NODE_DISPLAY_NAME = "Text Input"