Skip to content

Commit

Permalink
moving animation nodes and workflows to legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Suzie1 committed Jan 1, 2024
1 parent a34c57c commit 8e16140
Show file tree
Hide file tree
Showing 8 changed files with 645 additions and 31 deletions.
5 changes: 5 additions & 0 deletions Patch_Notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 🧩 Comfyroll Studio - Patch Notes

## v1.57 Jan 1, 2024
- added CR Prompt List
- moved animation prompt nodes to legacy
- reanmed CR Binary To List to CR Binary To Bit List

## v1.56 Dec 30, 2023
- updated CR Float Range List, added operation, decimal_places, ignore_first_value, and max_value_per_loop parameter
- updated CR Text List to String, changed inputs to list
Expand Down
3 changes: 2 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.56
Current version: 1.57

# Wiki

Expand Down Expand Up @@ -35,6 +35,7 @@ __🔳 Aspect Ratio__
__📜 List Nodes__
* CR Font File List (new 18/12/2023)
* CR Text List (new 19/12/2023)
* CR Prompt List (new 1/1/2024)
* CR Load Image List (new 23/12/2023)
* CR Load Image List Plus (new 23/12/2023)
* CR Float Range List (new 25/12/2023)
Expand Down
9 changes: 6 additions & 3 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: 165 custom nodes for Graphics, Animation, IO, Aspect Ratio, Model Merge, ControlNet, LoRA, XY Grid, and Utilities.
@description: 150 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,8 +36,11 @@
NODE_DISPLAY_NAME_MAPPINGS = LIVE_NODE_DISPLAY_NAME_MAPPINGS

print("------------------------------------------")
print("\033[34mComfyroll Studio v1.56 : \033[92m 165 Nodes Loaded\033[0m")
print("------------------------------------------")
print("\033[34mComfyroll Studio v1.57 : \033[92m 150 Nodes Loaded\033[0m")
print("------------------------------------------")
print("** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md")
print("** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki")
print("------------------------------------------")

import shutil
import folder_paths
Expand Down
17 changes: 9 additions & 8 deletions animation_nodes/nodes_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def INPUT_TYPES(cls):
RETURN_TYPES = ("SIMPLE_PROMPT_LIST", "STRING", )
RETURN_NAMES = ("SIMPLE_PROMPT_LIST", "show_help", )
FUNCTION = "prompt_stacker"
CATEGORY = icons.get("Comfyroll/Animation/Prompt")
CATEGORY = icons.get("Comfyroll/Animation/Legacy")

def prompt_stacker(self, prompt_1, prompt_2, prompt_3, prompt_4, prompt_5, simple_prompt_list=None):

Expand Down Expand Up @@ -104,7 +104,7 @@ def INPUT_TYPES(s):
RETURN_NAMES = ("keyframe_list", "show_help", )
FUNCTION = "make_keyframes"

CATEGORY = icons.get("Comfyroll/Animation/Prompt")
CATEGORY = icons.get("Comfyroll/Animation/Legacy")

def make_keyframes(self, simple_prompt_list, keyframe_interval, loops, transition_type, transition_speed, transition_profile, keyframe_format, ):

Expand Down Expand Up @@ -136,6 +136,8 @@ def make_keyframes(self, simple_prompt_list, keyframe_interval, loops, transitio
return (keyframes_out, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
'''
# Legacy node, node and class name reused
class CR_PromptList:
@classmethod
Expand Down Expand Up @@ -179,7 +181,7 @@ def INPUT_TYPES(cls):
RETURN_TYPES = ("PROMPT_LIST", "STRING", )
RETURN_NAMES = ("PROMPT_LIST", "show_help", )
FUNCTION = "animation_stacker"
CATEGORY = icons.get("Comfyroll/Animation/Prompt")
CATEGORY = icons.get("Comfyroll/Animation/Legacy")
def animation_stacker(self, keyframe_interval, loops,
prompt_1, transition_type1, transition_speed1, transition_profile1,
Expand Down Expand Up @@ -222,7 +224,7 @@ def animation_stacker(self, keyframe_interval, loops,
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Prompt-Nodes#cr-prompt-list"
return (keyframe_list, show_help, )

'''
#---------------------------------------------------------------------------------------------------------------------#
class CR_PromptListKeyframes:
@classmethod
Expand All @@ -235,7 +237,7 @@ def INPUT_TYPES(s):
RETURN_TYPES = ("STRING", "STRING", )
RETURN_NAMES = ("keyframe_list", "show_help", )
FUNCTION = "make_keyframes"
CATEGORY = icons.get("Comfyroll/Animation/Prompt")
CATEGORY = icons.get("Comfyroll/Animation/Legacy")

def make_keyframes(self, prompt_list, keyframe_format):

Expand Down Expand Up @@ -289,7 +291,6 @@ def keyframelist(self, keyframe_list, keyframe_format):
return (keyframe_list, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
'''
class CR_LoadPromptStyle:

def __init__(self):
Expand Down Expand Up @@ -343,7 +344,7 @@ def prompt_styler(self, style, file_type):
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Prompt-Nodes#cr-load-prompt-style"

return (prepend_text, append_text, negative_text, show_help, )
'''

#---------------------------------------------------------------------------------------------------------------------#
class CR_EncodeScheduledPrompts:

Expand Down Expand Up @@ -415,7 +416,7 @@ def condition(self, clip, current_prompt, next_prompt, weight):
"CR Simple Prompt List":CR_SimplePromptList,
"CR Simple Prompt List Keyframes":CR_SimplePromptListKeyframes,
"CR Keyframe List":CR_KeyframeList,
#"CR Load Prompt Style":CR_LoadPromptStyle,
"CR Load Prompt Style":CR_LoadPromptStyle,
"CR Encode Scheduled Prompts":CR_EncodeScheduledPrompts,
}
'''
28 changes: 15 additions & 13 deletions live_node_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@
"CR Multiline Text": CR_MultilineText,
"CR Save Text To File": CR_SaveTextToFile,
### List Nodes
"CR Font File List": CR_FontFileList,
"CR Text List": CR_TextList,
"CR Prompt List": CR_PromptList,
"CR Load Image List": CR_LoadImageList,
"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 Intertwine Lists" : CR_IntertwineLists,
"CR Binary To List": CR_BinaryToList,
"CR Batch Images From List": CR_BatchImagesFromList,
"CR Text List To String": CR_TextListToString,
"CR Text List To String": CR_TextListToString,
"CR Font File List": CR_FontFileList,
"CR Binary To Bit List": CR_BinaryToBitList,
### Aspect Ratio Nodes
"CR SD1.5 Aspect Ratio": CR_AspectRatioSD15,
"CR SDXL Aspect Ratio": CR_SDXLAspectRatio,
Expand Down Expand Up @@ -207,10 +208,6 @@
"CR Prompt Scheduler": CR_PromptScheduler,
"CR Simple Prompt Scheduler": CR_SimplePromptScheduler,
# Prompt
"CR Prompt List": CR_PromptList,
"CR Prompt List Keyframes": CR_PromptListKeyframes,
"CR Simple Prompt List": CR_SimplePromptList,
"CR Simple Prompt List Keyframes": CR_SimplePromptListKeyframes,
"CR Keyframe List": CR_KeyframeList,
#"CR Load Prompt Style": CR_LoadPromptStyle,
"CR Encode Scheduled Prompts": CR_EncodeScheduledPrompts,
Expand All @@ -229,6 +226,11 @@
"CR Load Flow Frames": CR_LoadFlowFrames,
"CR Output Flow Frames": CR_OutputFlowFrames,
### Legacy
# Note: CR Prompt List and CR Text List names have been reused,
# so the old versions of these nodes are no longer available
"CR Prompt List Keyframes": CR_PromptListKeyframes,
"CR Simple Prompt List": CR_SimplePromptList,
"CR Simple Prompt List Keyframes": CR_SimplePromptListKeyframes,
"CR Cycle Models": CR_CycleModels,
"CR Cycle LoRAs": CR_CycleLoRAs,
"CR Cycle Text": CR_CycleText,
Expand Down Expand Up @@ -259,16 +261,17 @@
### List Nodes
"CR Font File List": "📜 CR Font File List",
"CR Text List": "📜 CR Text List",
"CR Prompt List": "📜 CR Prompt List",
"CR Load Image List": "📜 CR Load Image List",
"CR Load Image List Plus": "📜 CR Load Image List Plus",
"CR Float Range List": "📜 CR Float Range List",
"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",
"CR Binary To Bit List": "📜 CR Binary To Bit List",
"CR Batch Images From List": "📜 CR Batch Images From List",
"CR Text List To String": "📜 CR Text List To String",
"CR Text List To String": "📜 CR Text List To String",
### Aspect Ratio Nodes
"CR SD1.5 Aspect Ratio": "🔳 CR SD1.5 Aspect Ratio",
"CR SDXL Aspect Ratio": "🔳 CR SDXL Aspect Ratio",
Expand Down Expand Up @@ -418,10 +421,6 @@
"CR Prompt Scheduler": "📑 CR Prompt Scheduler",
"CR Simple Prompt Scheduler": "📑 CR Simple Prompt Scheduler",
# Prompt
"CR Prompt List": "📝 CR Prompt List",
"CR Prompt List Keyframes": "📝 CR Prompt List Keyframes",
"CR Simple Prompt List": "📝 CR Simple Prompt List",
"CR Simple Prompt List Keyframes": "📝 CR Simple Prompt List Keyframes",
"CR Keyframe List": "📝 CR Keyframe List",
#"CR Load Prompt Style": "📝 CR Load Prompt Style",
"CR Encode Scheduled Prompts": "📝 CR Encode Scheduled Prompts",
Expand All @@ -439,6 +438,9 @@
"CR Load Flow Frames": "⌨️ CR Load Flow Frames",
"CR Output Flow Frames": "⌨️ CR Output Flow Frames",
### Legacy
"CR Prompt List Keyframes": "CR Prompt List Keyframes (Legacy)",
"CR Simple Prompt List": "CR Simple Prompt List (Legacy)",
"CR Simple Prompt List Keyframes": "CR Simple Prompt List Keyframes (Legacy)",
"CR Cycle Models": "CR Cycle Models (Legacy)",
"CR Cycle LoRAs": "CR Cycle LoRAs (Legacy)",
"CR Cycle Text": "CR Cycle Text (Legacy)",
Expand Down
2 changes: 1 addition & 1 deletion nodes/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class CR_LatentBatchSize:
@classmethod
def INPUT_TYPES(s):
return {"required": {"latent": ("LATENT", ),
"batch_size": ("INT", {"default": 2, "min": 1, "max": 16, "step": 1}),
"batch_size": ("INT", {"default": 2, "min": 1, "max": 999, "step": 1}),
}
}

Expand Down
51 changes: 46 additions & 5 deletions nodes/nodes_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import comfy.sd
import csv
import math
import random
from PIL import Image
from pathlib import Path
from ..categories import icons
Expand Down Expand Up @@ -139,6 +140,45 @@ def make_list(self, multiline_text, start_index, max_rows):

return (selected_rows, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
class CR_PromptList:

@classmethod
def INPUT_TYPES(s):

return {"required": {"prepend_text": ("STRING", {"multiline": False, "default": ""}),
"multiline_text": ("STRING", {"multiline": True, "default": "body_text"}),
"append_text": ("STRING", {"multiline": False, "default": ""}),
"start_index": ("INT", {"default": 0, "min": 0, "max": 9999}),
"max_rows": ("INT", {"default": 1000, "min": 1, "max": 9999}),
}
}

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

def make_list(self, multiline_text, prepend_text="", append_text="", start_index=0, max_rows=9999):

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

lines = multiline_text.split('\n')

# Ensure start_index is within the bounds of the list
start_index = max(0, min(start_index, len(lines) - 1))

# Calculate the end index based on max_rows
end_index = min(start_index + max_rows, len(lines))

# Extract the desired portion of the list
selected_rows = lines[start_index:end_index]
prompt_list_out = [prepend_text + line + append_text for line in selected_rows]
body_list_out = selected_rows

return (prompt_list_out, body_list_out, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
class CR_LoadImageList:

Expand Down Expand Up @@ -569,7 +609,7 @@ def make_list(self, list1, list2):
return(combined_list, show_help, )

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

@classmethod
def INPUT_TYPES(s):
Expand Down Expand Up @@ -647,17 +687,18 @@ def joinlist(self, text_list):
'''
NODE_CLASS_MAPPINGS = {
### List nodes
"CR Font File List": CR_FontFileList,
"CR Text List": CR_TextList,
"CR Text List": CR_TextList,
"CR Prompt List": CR_PromptList,
"CR Load Image List": CR_LoadImageList,
"CR Load Image List Plus": CR_LoadImageListPlus,
"CR List Schedule": CR_ListSchedule,
"CR Float Range List": CR_FloatRangeList,
"CR Load Text List": CR_LoadTextList,
#"CR Save Text To File": CR_SaveTextToFile,
"CR Intertwine Lists" : CR_IntertwineLists,
"CR Binary To List": CR_BinaryToList,
"CR Batch Images From List": CR_BatchImagesFromList,
"CR Text List To String":CR_TextListToString,
"CR Text List To String":CR_TextListToString,
"CR Font File List": CR_FontFileList,
"CR Binary To Bit List": CR_BinaryToBitList,
}
'''
Loading

0 comments on commit 8e16140

Please sign in to comment.