Files
PBandDev-comfyui-ping/tests/python/fixtures/example_node.py
T
2026-03-19 13:24:54 -05:00

27 lines
771 B
Python

class ExampleNormalizeTextNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"text": (
"STRING",
{
"default": "",
"multiline": True,
},
)
}
}
RETURN_TYPES = ("STRING",)
FUNCTION = "normalize_text"
CATEGORY = "examples/testing"
def normalize_text(self, text: str):
normalized_parts = [part.strip() for part in text.splitlines() if part.strip()]
return (" ".join(normalized_parts),)
NODE_CLASS_MAPPINGS = {"ExampleNormalizeText": ExampleNormalizeTextNode}
NODE_DISPLAY_NAME_MAPPINGS = {"ExampleNormalizeText": "Example Normalize Text"}