### EZ_Prompt_Loader Node for ComfyUI (Python) Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt Loads text file contents for prompts with flexible selection modes (single, multiple, random) and optional seed control. It reads from a specified subdirectory within `data/prompts` and returns the prompt text, directory path, and a list of selected contents. ```python from nodes.EZ_Prompt_Loader import EZ_Prompt_Loader # Initialize the node loader = EZ_Prompt_Loader() # Load a prompt in single selection mode result = loader.browse_files( prompt_directory="characters", # Subdirectory within data/prompts selection_mode="single", selected_files="hero_prompt.txt", filter_text="", opt_seed=0 ) prompt_text, directory_path, batch_list = result # Returns: ("Full content of hero_prompt.txt", "/path/to/data/prompts/characters", ["content1", "content2", ...]) # Load multiple prompts concatenated result = loader.browse_files( prompt_directory="styles", selection_mode="multiple", selected_files="cinematic.txt,dramatic.txt,hdr.txt", filter_text="", opt_seed=0 ) # Returns: ("cinematic prompt, dramatic prompt, hdr prompt", directory_path, [selected_contents]) # Random selection with seed for reproducibility result = loader.browse_files( prompt_directory="styles", selection_mode="random", selected_files="style1.txt,style2.txt,style3.txt", filter_text="cinematic", opt_seed=42 # Fixed seed ensures same selection each time ) # Returns: (randomly_selected_prompt, directory_path, [all_selected_contents]) ``` -------------------------------- ### EZ_Input: Handle Multiline String Input with ANY Type Output Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt The EZ_Input node provides a way to input multiline strings and outputs them with an 'ANY' type annotation. This ensures compatibility with combo inputs and allows for flexible connections to various node inputs within ComfyUI workflows. ```python from nodes.EZ_Input import EZ_Input # Initialize the node input_node = EZ_Input() # Pass through multiline string with ANY type result = input_node.doit(String="This is a multiline\nstring input\nfor testing") # Returns: ("This is a multiline\nstring input\nfor testing",) # The output has "ANY" type annotation, allowing it to connect to # inputs that expect specific types or combo selections ``` -------------------------------- ### Python: Select Inputs Dynamically with EZ_Switch Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt The EZ_Switch node allows for dynamic selection of one input from multiple available inputs. It supports selection by a specific index, random selection (with optional seeding for deterministic results), or automatic selection of the first non-None input. This node is versatile and works with any data type. ```python from nodes.EZ_Switch import EZ_Switch # Initialize the node switch = EZ_Switch() # Switch by index result = switch.switch( number_of_inputs=4, selection_mode="by index", selected_index=2, opt_seed=0, input_1="Option A", input_2="Option B", input_3="Option C", input_4="Option D" ) # Returns: ("Option B",) # Index 2 = second input # Random selection with seed result = switch.switch( number_of_inputs=3, selection_mode="by random", selected_index=1, # Ignored in random mode opt_seed=555, input_1="red style", input_2="blue style", input_3="green style" ) # Returns: (randomly_selected_style,) # Deterministic with seed=555 # Automatic mode - returns first non-None input result = switch.switch( number_of_inputs=4, selection_mode="automatic", selected_index=1, opt_seed=0, input_1=None, input_2=None, input_3="first available", input_4="backup option" ) # Returns: ("first available",) # Works with any type - example with hypothetical model objects result = switch.switch( number_of_inputs=2, selection_mode="by index", selected_index=1, opt_seed=0, input_1=model_checkpoint_1, input_2=model_checkpoint_2 ) # Returns: (model_checkpoint_1,) ``` -------------------------------- ### EZ_Tag_Loader Node for ComfyUI (Python) Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt Loads individual lines from text files in `data/tags` as discrete tags. Supports single, multiple, and random selection modes, with options to add suffix text to each tag and apply filtering. ```python from nodes.EZ_Tag_Loader import EZ_Tag_Loader # Initialize the node tag_loader = EZ_Tag_Loader() # Load single tag result = tag_loader.browse_tags( tags_file="camera_angles.txt", selection_mode="single", selected_tags="low angle shot", filter_text="", add_after="", opt_seed=0 ) tag_output, file_path, batch_list = result # Returns: ("low angle shot", "/path/to/tags/camera_angles.txt", ["low angle shot"]) # Load multiple tags with suffix result = tag_loader.browse_tags( tags_file="lighting/mood.txt", selection_mode="multiple", selected_tags="dramatic lighting,golden hour,rim light", filter_text="", add_after="effect", # Appends " effect" to each tag opt_seed=0 ) # Returns: ("dramatic lighting effect, golden hour effect, rim light effect", file_path, [tag_list_with_suffix]) # Using [empty] placeholder for optional tags # If camera_angles.txt contains: # wide shot # [empty] # close up result = tag_loader.browse_tags( tags_file="camera_angles.txt", selection_mode="random", selected_tags="", filter_text="", add_after="camera", opt_seed=789 ) # [empty] tag becomes just "camera" when add_after is specified ``` -------------------------------- ### EZ_CSV_Loader Node for ComfyUI (Python) Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt Processes CSV files from the `data/csv` directory, converting rows into formatted text. Supports single row, multiple row concatenation with separators, and random row selection, with options for filtering and seed-controlled reproducibility. ```python from nodes.EZ_CSV_Loader import EZ_CSV_Loader # Initialize the node csv_loader = EZ_CSV_Loader() # Load a single CSV row result = csv_loader.browse_csv( csv_file="characters.csv", selection_mode="single", selected_row="0", # First row index filter_text="", opt_seed=0 ) output_text, file_path, batch_list = result # Returns formatted text: # """ # Name: # 3D RENDER # # Prompt: # professional 3d render, intricate details... # # Style: # realistic, high quality # """ # Load multiple rows concatenated with separator result = csv_loader.browse_csv( csv_file="presets/lighting.csv", selection_mode="multiple", selected_row="0,2,5", filter_text="outdoor", opt_seed=0 ) # Returns: (row_0_formatted + "\n---\n" + row_2_formatted + "\n---\n" + row_5_formatted, file_path, batch_list) # Random row selection result = csv_loader.browse_csv( csv_file="presets/lighting.csv", selection_mode="random", selected_row="", # Empty means select from all rows filter_text="", opt_seed=12345 ) # Returns: (randomly_selected_row_formatted, file_path, [all_rows]) ``` -------------------------------- ### Python: Extract Prompt Sections with EZ_Extract_Prompt Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt The EZ_Extract_Prompt node is designed to parse structured text, commonly from CSV or prompt loading utilities. It can extract specific content based on a provided header name (case-insensitive) or extract all non-header content if requested. The node also offers an option to pass through the original string if no matching section is found. ```python from nodes.EZ_Text_Utils import EZ_Extract_Prompt # Initialize the node extractor = EZ_Extract_Prompt() # Extract specific section by header structured_text = """ Name: 3D Character Prompt: highly detailed 3d render photorealistic textures Style: cinematic lighting """ result = extractor.extract_prompt( string=structured_text, searchword="prompt", # Case-insensitive extract_all=False, pass_original=False ) # Returns: ("highly detailed 3d render\nphotorealistic textures",) # Extract all content, removing headers result = extractor.extract_prompt( string=structured_text, searchword="", # Ignored when extract_all=True extract_all=True, pass_original=False ) # Returns: ("3D Character\nhighly detailed 3d render\nphotorealistic textures\ncinematic lighting",) # Pass through original if search fails result = extractor.extract_prompt( string="simple prompt without headers", searchword="nonexistent", extract_all=False, pass_original=True ) # Returns: ("simple prompt without headers",) ``` -------------------------------- ### Python: Concatenate Text Dynamically with EZ_Text_Concat Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt The EZ_Text_Concat node dynamically combines multiple text inputs using customizable delimiters and offers options for text beautification (cleaning) before or after concatenation, as well as line break handling. It takes a variable number of text inputs and configuration parameters like delimiter, beautify mode, and line break policy. ```python from nodes.EZ_Text_Concat import EZ_Text_Concat # Initialize the node concat = EZ_Text_Concat() # Concatenate 3 inputs with comma-newline delimiter result = concat.text_concatenate( delimiter=",\\n", # Use \\n for newline in delimiter beautify="after", # Clean text after concatenation line_breaks="keep", number_of_inputs=3, text_1="beautiful landscape", text_2=" cinematic lighting ,", # Extra spaces and commas text_3="high quality" ) # Returns: ("beautiful landscape,\ncinematic lighting,\nhigh quality",) # Concatenate with custom delimiter and pre-cleaning result = concat.text_concatenate( delimiter=" | ", beautify="before", # Clean each input separately line_breaks="delete", # Remove all line breaks number_of_inputs=4, text_1="style: cyberpunk\n\nwith neon", text_2="", # Empty inputs are skipped text_3="mood: dark,,, atmospheric", text_4="quality: 8k , uhd" ) # Returns: ("style: cyberpunk with neon | mood: dark, atmospheric | quality: 8k, uhd",) # Simple concatenation without cleaning result = concat.text_concatenate( delimiter=", ", beautify="never", line_breaks="keep", number_of_inputs=2, text_1="masterpiece", text_2="best quality" ) # Returns: ("masterpiece, best quality",) ``` -------------------------------- ### EZ_Find_Replace: Perform Text Find and Replace Operations Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt The EZ_Find_Replace node facilitates basic find and replace operations on text strings. It can be used for simple substitutions, replacing multiple occurrences, or removing text by replacing it with an empty string. This node is part of the EZ_Text_Utils module. ```python from nodes.EZ_Text_Utils import EZ_Find_Replace # Initialize the node find_replace = EZ_Find_Replace() # Basic replacement result = find_replace.find_replace( string="a photo of a cat in a garden", find="cat", replace="dog" ) # Returns: ("a photo of a dog in a garden",) # Replace multiple occurrences result = find_replace.find_replace( string="red car, red house, red sky", find="red", replace="blue" ) # Returns: ("blue car, blue house, blue sky",) # Remove text by replacing with empty string result = find_replace.find_replace( string="masterpiece, (best quality:1.2), highly detailed", find="(best quality:1.2), ", replace="" ) # Returns: ("masterpiece, highly detailed",) ``` -------------------------------- ### Python: Extract Resolution from Text with EZ_Text_to_Size Source: https://context7.com/ez-af/comfyui-ez-af-nodes/llms.txt The EZ_Text_to_Size node extracts width and height values from input text strings. It identifies the last two numerical values found in the string, making it useful for parsing resolution specifications from various text formats. The node handles different separators like 'x' or 'by' and can extract dimensions even when mixed with other text. ```python from nodes.EZ_Text_Utils import EZ_Text_to_Size # Initialize the node size_extractor = EZ_Text_to_Size() # Extract from standard format result = size_extractor.extract_size(text_input="1024x1024") # Returns: (1024, 1024) # Extract from text with multiple numbers result = size_extractor.extract_size(text_input="image size: 1920x1080 at 60fps") # Returns: (1080, 60) # Last two numbers # Extract from descriptive text result = size_extractor.extract_size(text_input="resolution 2560 by 1440 pixels") # Returns: (2560, 1440) # Handles various formats result = size_extractor.extract_size(text_input="4k (3840 x 2160)") # Returns: (3840, 2160) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.