mirror of
https://github.com/justUmen/Bjornulf_custom_nodes.git
synced 2026-03-21 12:42:11 -03:00
v0.10
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# 🔗 Comfyui : Bjornulf_custom_nodes v0.9 🔗
|
||||
# 🔗 Comfyui : Bjornulf_custom_nodes v0.10 🔗
|
||||
|
||||
# Dependencies
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
- **v0.8**: Combine images : add an option to put image top, bottom or center.
|
||||
- **v0.8**: Combine texts : add option for slashes /
|
||||
- **v0.8**: Add basic node to transform greenscreen in to transparency.
|
||||
- **v0.9**: Add a new node : Return one random line from input.
|
||||
- **v0.10**: Add a new node : Loop (All Lines from input) - Iterate over all lines from an input text.
|
||||
|
||||
# 📝 Nodes descriptions
|
||||
|
||||
@@ -187,3 +187,8 @@ Need clean greenscreen ofc. (Can adjust threshold but very basic node.)
|
||||
**Description:**
|
||||
Take a random line from an input text. (When using multiple "Write Text" nodes is annoying for example, you can use that and just copy/paste a list from outside.)
|
||||
|
||||
## 27 - ♻ Loop (All Lines from input)
|
||||

|
||||
|
||||
**Description:**
|
||||
Iterate over all lines from an input text. (Good for testing multiple lines of text.)
|
||||
|
||||
@@ -31,6 +31,7 @@ from .combine_background_overlay import CombineBackgroundOverlay
|
||||
from .save_bjornulf_lobechat import SaveBjornulfLobeChat
|
||||
from .green_to_transparency import GreenScreenToTransparency
|
||||
from .random_line_from_input import RandomLineFromInput
|
||||
from .loop_lines import LoopAllLines
|
||||
# from .check_black_image import CheckBlackImage
|
||||
# from .clear_vram import ClearVRAM
|
||||
|
||||
@@ -39,6 +40,7 @@ from .random_line_from_input import RandomLineFromInput
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
# "Bjornulf_CustomStringType": CustomStringType,
|
||||
"Bjornulf_ollamaLoader": ollamaLoader,
|
||||
"Bjornulf_LoopAllLines": LoopAllLines,
|
||||
"Bjornulf_GreenScreenToTransparency": GreenScreenToTransparency,
|
||||
"Bjornulf_RandomLineFromInput": RandomLineFromInput,
|
||||
# "Bjornulf_CheckBlackImage": CheckBlackImage,
|
||||
@@ -111,6 +113,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Bjornulf_LoopFloat": "♻ Loop (Float)",
|
||||
"Bjornulf_LoopInteger": "♻ Loop (Integer)",
|
||||
"Bjornulf_LoopBasicBatch": "♻ Loop",
|
||||
"Bjornulf_LoopAllLines": "♻ Loop (All Lines from input)",
|
||||
"Bjornulf_LoopSamplers": "♻ Loop (All Samplers)",
|
||||
"Bjornulf_LoopSchedulers": "♻ Loop (All Schedulers)",
|
||||
"Bjornulf_LoopCombosSamplersSchedulers": "♻ Loop (My combos Sampler⚔Scheduler)",
|
||||
|
||||
26
loop_lines.py
Normal file
26
loop_lines.py
Normal file
@@ -0,0 +1,26 @@
|
||||
class LoopAllLines:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"text": ("STRING", {"forceInput": True}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
FUNCTION = "all_lines"
|
||||
OUTPUT_IS_LIST = (True,)
|
||||
CATEGORY = "Bjornulf"
|
||||
|
||||
def all_lines(self, text):
|
||||
# Split the input text into lines
|
||||
lines = text.split('\n')
|
||||
|
||||
# Remove empty lines and strip whitespace
|
||||
lines = [line.strip() for line in lines if line.strip()]
|
||||
|
||||
if not lines:
|
||||
return ([],)
|
||||
|
||||
# Return all non-empty lines
|
||||
return (lines,)
|
||||
BIN
screenshots/loop_all_lines.png
Normal file
BIN
screenshots/loop_all_lines.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
Reference in New Issue
Block a user