Skip to content

Commit

Permalink
Intertwine Lists and Binary to List
Browse files Browse the repository at this point in the history
  • Loading branch information
Suzie1 committed Dec 28, 2023
1 parent cf7cc04 commit e3be14f
Show file tree
Hide file tree
Showing 6 changed files with 408 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Patch_Notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 🧩 Comfyroll Custom Nodes - Patch Notes

## v1.54 Dec 29, 2023
- added CR Intertwine_Lists
- added CR Binary To List

## v1.53 Dec 28, 2023
- added CR Random Multiline Colors
- updated CR Random Multiline Values, removed hex color option
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Co-authored by Suzie1 and RockOfFire

Current version: 1.53
Current version: 1.54

# Wiki

Expand Down Expand Up @@ -40,6 +40,8 @@ __📜 List Nodes__
* CR Float Range List (new 25/12/2023)
* CR Integer Range List (new 25/12/2023)
* CR Load Text List (new 27/12/2023)
* Intertwine_Lists (new 29/12/2023)
* Binary To List (new 29/12/2023)

__🌟 SDXL__
* CR SDXL Prompt Mix Presets
Expand Down Expand Up @@ -171,6 +173,7 @@ __🎲 Random__
* CR Random Hex Color
* CR Random RGB
* CR Random Multiline Values (updated 28/12/2023)
* CR Random Multiline Colors (added 28/12/2023)
* CR Random RGB Gradient (new 8/12/2023)
* CR Random Panel Code (new 26/12/2023)

Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@author: Suzie1
@title: Comfyroll Studio
@nickname: Comfyroll Studio
@description: 160 custom nodes for Graphics, Animation, IO, Aspect Ratio, Model Merge, ControlNet, LoRA, XY Grid, and Utilities.
@description: 162 custom nodes for Graphics, Animation, IO, Aspect Ratio, Model Merge, ControlNet, LoRA, XY Grid, and Utilities.
"""

from .live_node_mappings import LIVE_NODE_CLASS_MAPPINGS, LIVE_NODE_DISPLAY_NAME_MAPPINGS
Expand All @@ -36,7 +36,7 @@
NODE_DISPLAY_NAME_MAPPINGS = LIVE_NODE_DISPLAY_NAME_MAPPINGS

print("------------------------------------------------")
print("\033[34mComfyroll Custom Nodes v1.53 : \033[92m 160 Nodes Loaded\033[0m")
print("\033[34mComfyroll Custom Nodes v1.54 : \033[92m 162 Nodes Loaded\033[0m")
print("------------------------------------------------")

import shutil
Expand Down
8 changes: 6 additions & 2 deletions live_node_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .animation_nodes.utils import *
from .animation_nodes.cyclers import *

LIVE_NODE_CLASS_MAPPINGS = {
LIVE_NODE_CLASS_MAPPINGS = {
### Other Nodes
"CR Image Output": CR_ImageOutput,
"CR Integer Multiple": CR_IntegerMultipleOf,
Expand All @@ -50,7 +50,9 @@
"CR Load Image List Plus": CR_LoadImageListPlus,
"CR Float Range List": CR_FloatRangeList,
"CR Integer Range List": CR_IntegerRangeList,
"CR Load Text List": CR_LoadTextList,
"CR Load Text List": CR_LoadTextList,
"CR Intertwine Lists" : CR_IntertwineLists,
"CR Binary To List": CR_BinaryToList,
### Aspect Ratio Nodes
"CR SD1.5 Aspect Ratio": CR_AspectRatioSD15,
"CR SDXL Aspect Ratio": CR_SDXLAspectRatio,
Expand Down Expand Up @@ -255,6 +257,8 @@
"CR Integer Range List": "📜 CR Integer Range List",
"CR Load Value List": "📜 CR Load Value List",
"CR Load Text List": "📜 CR Load Text List",
"CR Intertwine Lists" : "📜 CR Intertwine Lists",
"CR Binary To List": "📜 CR Binary To List",
### Aspect Ratio Nodes
"CR SD1.5 Aspect Ratio": "🔳 CR SD1.5 Aspect Ratio",
"CR SDXL Aspect Ratio": "🔳 CR SDXL Aspect Ratio",
Expand Down
65 changes: 62 additions & 3 deletions nodes/nodes_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ def make_range(self, start, end, step, loops, ping_pong):

return (range_values, show_help, )


#---------------------------------------------------------------------------------------------------------------------#
class CR_LoadTextList:

Expand Down Expand Up @@ -503,7 +502,65 @@ def save_list(self, multiline_text, output_file_path, file_name, file_extension)
for line in multiline_text:
text_file.write(line)

return (show_help, )
return (show_help, )

#---------------------------------------------------------------------------------------------------------------------#
class CR_IntertwineLists:

@classmethod
def INPUT_TYPES(s):
return {"required": {
"list1": ("STRING", {"multiline": True, "default": ""}),
"list2": ("STRING", {"multiline": True, "default": ""}),
}
}

RETURN_TYPES = ("STRING", "STRING",)
RETURN_NAMES = ("STRING", "show_help", )
OUTPUT_IS_LIST = (True, False)
FUNCTION = 'make_list'
CATEGORY = icons.get("Comfyroll/List")

def make_list(self, list1, list2):

show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/List-Nodes#cr-intertwine-list"

# Ensure both lists have the same length
min_length = min(len(list1), len(list2))

# Initialize an empty list to store the combined elements
combined_lists = []

# Use a loop to combine elements from both lists
for i in range(min_length):
combined_element = str(list1) + ", " + str(list2)
combined_lists.append(combined_element)

return(combined_lists, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
class CR_BinaryToList:

@classmethod
def INPUT_TYPES(s):
return {"required": {
"bit_string": ("STRING", {"multiline": True, "default": ""}),
}
}

RETURN_TYPES = ("STRING", "STRING",)
RETURN_NAMES = ("STRING", "show_help", )
OUTPUT_IS_LIST = (True, False)
FUNCTION = 'make_list'
CATEGORY = icons.get("Comfyroll/List")

def make_list(self, bit_string):

show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/List-Nodes#cr-binary-to-list"

list_out = [str(bit) for bit in bit_string]

return(list_out, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
# MAPPINGS
Expand All @@ -519,6 +576,8 @@ def save_list(self, multiline_text, output_file_path, file_name, file_extension)
"CR List Schedule": CR_ListSchedule,
"CR Float Range List": CR_FloatRangeList,
"CR Load Text List": CR_LoadTextList,
You will need at least v1.53. CR_SaveTextToFile,
#"CR Save Text To File": CR_SaveTextToFile,
"CR Intertwine Lists" : CR_IntertwineLists,
"CR Binary To List": CR_BinaryToList,
}
'''
Loading

0 comments on commit e3be14f

Please sign in to comment.