Open MokkaBoss1 opened 6 months ago
Hi,
I have a suggestion to make to improve this node. I tested it and it seems to work fine. Basically it lets you put comments into a text box that do not carry forward to the output. Also I removed line breaks
The code for this is as follows:
import random import re
class HashText:
def __init__(self): pass @classmethod def INPUT_TYPES(s): return {"required": { "prompt": ("STRING", {"default": "prompt", "multiline": True}) }} RETURN_TYPES = ("STRING",) RETURN_NAMES = ("Text",) FUNCTION = "test" CATEGORY = "MokkaBoss1" def test(self, prompt): pattern = r"#(.*?)#" clean_text = re.sub(pattern, '', prompt) clean_text2 = clean_text.replace("\n", "") prompt = clean_text2 return (prompt, )
NODE_CLASS_MAPPINGS = {"HashText": HashText} NODE_DISPLAY_NAME_MAPPINGS = {"HashText": "HashText"}
just realised you don't need the "import random" that was a cut and paste error
Hi,
I have a suggestion to make to improve this node. I tested it and it seems to work fine. Basically it lets you put comments into a text box that do not carry forward to the output. Also I removed line breaks
The code for this is as follows:
import random import re
class HashText:
NODE_CLASS_MAPPINGS = {"HashText": HashText} NODE_DISPLAY_NAME_MAPPINGS = {"HashText": "HashText"}