Skip to content

Commit

Permalink
0.61
Browse files Browse the repository at this point in the history
  • Loading branch information
justUmen committed Nov 27, 2024
1 parent 230ed2c commit 038842e
Show file tree
Hide file tree
Showing 27 changed files with 2,192 additions and 82 deletions.
103 changes: 98 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🔗 Comfyui : Bjornulf_custom_nodes v0.60 🔗
# 🔗 Comfyui : Bjornulf_custom_nodes v0.61 🔗

A list of 68 custom nodes for Comfyui : Display, manipulate, and edit text, images, videos, loras and more.
A list of 79 custom nodes for Comfyui : Display, manipulate, and edit text, images, videos, loras and more.
You can manage looping operations, generate randomized content, trigger logical conditions, pause and manually control your workflows and even work with external AI tools, like Ollama or Text To Speech.

# Coffee : ☕☕☕☕☕ 5/5
Expand All @@ -19,6 +19,10 @@ You can manage looping operations, generate randomized content, trigger logical
`1.` [👁 Show (Text, Int, Float)](#1----show-text-int-float)
`49.` [📹👁 Video Preview](#49----video-preview)
`68.` [🔢 Add line numbers](#68----add-line-numbers)
`71.` [👁 Show (Int)](#)
`72.` [👁 Show (Float)](#)
`73.` [👁 Show (String/Text)](#)
`74.` [👁 Show (JSON)](#)

## ✒ Text ✒
`2.` [✒ Write Text](#2----write-text)
Expand All @@ -29,7 +33,9 @@ You can manage looping operations, generate randomized content, trigger logical
`28.` [🔢🎲 Text with random Seed](#28----text-with-random-seed)
`32.` [🧑📝 Character Description Generator](#32----character-description-generator)
`48.` [🔀🎲 Text scrambler (🧑 Character)](#48----text-scrambler--character)
`67.` [📝➜✨ Text to Anything](67----text-to-anything)
`67.` [📝➜✨ Text to Anything](#)
`68.` [✨➜📝 Anything to Text](#)
`75.` [📝➜📝 Replace text](#)

## ♻ Loop ♻
`6.` [♻ Loop](#6----loop)
Expand Down Expand Up @@ -87,6 +93,7 @@ You can manage looping operations, generate randomized content, trigger logical
`60.` [🖼🖼 Merge Images/Videos 📹📹 (Horizontally)](#60----merge-imagesvideos--horizontally)
`61.` [🖼🖼 Merge Images/Videos 📹📹 (Vertically)](#61----merge-imagesvideos--vertically)
`62.` [🦙👁 Ollama Vision](#62----ollama-vision)
`69.` [📏 Resize Image Percentage](#69)

## 🚀 Load checkpoints 🚀
`40.` [🎲 Random (Model+Clip+Vae) - aka Checkpoint / Model](#40----random-modelclipvae---aka-checkpoint--model)
Expand All @@ -109,6 +116,10 @@ You can manage looping operations, generate randomized content, trigger logical
`59.` [📹🔊 Combine Video + Audio](#59----combine-video--audio)
`60.` [🖼🖼 Merge Images/Videos 📹📹 (Horizontally)](#60----merge-imagesvideos--horizontally)
`61.` [🖼🖼 Merge Images/Videos 📹📹 (Vertically)](#61----merge-imagesvideos--vertically)
`76.` [⚙📹 FFmpeg Configuration 📹⚙](#76)
`77.` [📹🔍 Video details ⚙](#77)
`78.` [📹➜📹 Convert Video](#78)
`79.` [📹🔗 Concat Videos from list](#79)

## 🤖 AI 🤖
`19.` [🦙💬 Ollama Talk](#19----ollama-talk)
Expand Down Expand Up @@ -286,6 +297,7 @@ cd /where/you/installed/ComfyUI && python main.py
- **0.58**: small fix in model selector default value. (Set to None by default)
- **0.59**: A lot of Javascript fixing to avoid resizing and better properties mangement / recoveries
- **0.60**: Revert changes from ollama_talk (implement _user mode later / another node)
- **0.61**: Add/modify a bunch of Ffmpeg / video nodes. With a global configuration system and toggle python-ffmpeg / system.

# 📝 Nodes descriptions

Expand Down Expand Up @@ -1034,6 +1046,7 @@ If you want to be able to predict the next line, you can use node 68, to Add lin

**Description:**
Take two videos and concatenate them. (One after the other in the same video.)
Convert a video, can use FFMPEG_CONFIG_JSON. (From node 76 / 77)

![concat video](screenshots/concat_video.png)

Expand Down Expand Up @@ -1120,11 +1133,91 @@ Below is an example of that with my TTS node.

![text to anything](screenshots/text_to_anything.png)

### 68 - 🔢 Add line numbers
### 68 - ✨➜📝 Anything to Text

**Description:**
Sometimes you want to force something to be a STRING.
Most outputs are indeed text, even though they might be unusable.
This node ignore this fact and simply convert the input to a simple STRING.

### 69 - 🔢 Add line numbers

**Description:**

This node will just add line numbers to text.
Useful when you want to use node 57 that will loop over input lines. (You can read/predict the next line.)

![add line numbers](screenshots/add_line_numbers.png)
![add line numbers](screenshots/add_line_numbers.png)

### 70 - 📏 Resize Image Percentage

**Description:**

Resize an image by percentage.

![resize percentage](screenshots/resize_percentage.png)

### 71 - 👁 Show (Int)

**Description:**
Basic node, show an INT. (You can simply drag any INT node and it will be recommended.)

### 72 - 👁 Show (Float)

**Description:**
Basic node, show a FLOAT. (You can simply drag any FLOAT node and it will be recommended.)

### 73 - 👁 Show (String/Text)

**Description:**
Basic node, show a STRING. (You can simply drag any STRING node and it will be recommended.)

### 74 - 👁 Show (JSON)

**Description:**
This node will take a STRING and format it as a readable JSON. (and pink)

![show json](screenshots/show_json.png)
![show json](screenshots/show_json2.png)

### 75 - 📝➜📝 Replace text

**Description:**
Replace text with another text, allow regex and more options, check examples below :

![text replace](screenshots/text_replace_1.png)
![text replace](screenshots/text_replace_2.png)
![text replace](screenshots/text_replace_3.png)

### 76 - ⚙📹 FFmpeg Configuration 📹⚙

**Description:**
Create a FFMPEG_CONFIG_JSON, it will contains a JSON that can be used by other nodes :
- Convert video
- Concat videos
- Concat video from list

![text replace](screenshots/ffmpeg_conf.png)

### 77 - 📹🔍 Video details ⚙

**Description:**
Extract details from a video_path.
You can use the all-in-one FFMPEG_CONFIG_JSON with other nodes or just use the other variables as your want.

![video details](screenshots/video_details.png)

### 78 - 📹➜📹 Convert Video

**Description:**
Convert a video, can use FFMPEG_CONFIG_JSON.

![convert video](screenshots/convert_video.png)

#### 79 - 📹🔗 Concat Videos from list

**Description:**
Take a list of videos (one per line) and concatenate them. (One after the other in the same video.)
Can use FFMPEG_CONFIG_JSON. (From node 76 / 77)

![concat video list](screenshots/concat_video_list.png)
30 changes: 30 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from .show_stuff import ShowFloat, ShowInt, ShowStringText, ShowJson
from .images_to_video import imagesToVideo
from .write_text import WriteText
from .text_replace import TextReplace
# from .write_image_environment import WriteImageEnvironment
# from .write_image_characters import WriteImageCharacters
# from .write_image_character import WriteImageCharacter
# from .write_image_allinone import WriteImageAllInOne
from .combine_texts import CombineTexts
from .ffmpeg_configuration import FFmpegConfig
from .loop_texts import LoopTexts
from .random_texts import RandomTexts
from .random_model_clip_vae import RandomModelClipVae
Expand All @@ -21,6 +24,7 @@
from .save_image_path import SaveImagePath
from .save_img_to_folder import SaveImageToFolder
from .resize_image import ResizeImage
from .resize_image_percentage import ResizeImagePercentage
from .loop_my_combos_samplers_schedulers import LoopCombosSamplersSchedulers
from .remove_transparency import RemoveTransparency
from .image_to_grayscale import GrayscaleTransform
Expand Down Expand Up @@ -48,6 +52,7 @@
from .random_model_selector import RandomModelSelector
from .if_else import IfElse
from .image_details import ImageDetails
from .video_details import VideoDetails
from .combine_images import CombineImages
# from .pass_preview_image import PassPreviewImage
from .text_scramble_character import ScramblerCharacter
Expand All @@ -61,6 +66,7 @@
from .loop_sequential_integer import LoopIntegerSequential
from .loop_lines_sequential import LoopLinesSequential
from .concat_videos import ConcatVideos
from .concat_videos_from_list import ConcatVideosFromList
from .combine_video_audio import CombineVideoAudio
from .images_merger_horizontal import MergeImagesHorizontally
from .images_merger_vertical import MergeImagesVertically
Expand All @@ -71,12 +77,22 @@
from .ollama_system_job import OllamaSystemJobSelector
from .speech_to_text import SpeechToText
from .text_to_anything import TextToAnything
from .anything_to_text import AnythingToText
from .add_line_numbers import AddLineNumbers
from .ffmpeg_convert import ConvertVideo

NODE_CLASS_MAPPINGS = {
"Bjornulf_ShowInt": ShowInt,
"Bjornulf_TextReplace" : TextReplace,
"Bjornulf_ShowFloat": ShowFloat,
"Bjornulf_ShowJson": ShowJson,
"Bjornulf_ShowStringText": ShowStringText,
"Bjornulf_ollamaLoader": ollamaLoader,
"Bjornulf_FFmpegConfig": FFmpegConfig,
"Bjornulf_ConvertVideo": ConvertVideo,
"Bjornulf_AddLineNumbers": AddLineNumbers,
"Bjornulf_TextToAnything": TextToAnything,
"Bjornulf_AnythingToText": AnythingToText,
"Bjornulf_SpeechToText": SpeechToText,
"Bjornulf_OllamaConfig": OllamaConfig,
"Bjornulf_OllamaSystemPersonaSelector": OllamaSystemPersonaSelector,
Expand All @@ -87,6 +103,7 @@
"Bjornulf_MergeImagesVertically": MergeImagesVertically,
"Bjornulf_CombineVideoAudio": CombineVideoAudio,
"Bjornulf_ConcatVideos": ConcatVideos,
"Bjornulf_ConcatVideosFromList": ConcatVideosFromList,
"Bjornulf_LoopLinesSequential": LoopLinesSequential,
"Bjornulf_LoopIntegerSequential": LoopIntegerSequential,
"Bjornulf_LoopLoraSelector": LoopLoraSelector,
Expand All @@ -99,6 +116,7 @@
"Bjornulf_ScramblerCharacter": ScramblerCharacter,
"Bjornulf_CombineImages": CombineImages,
"Bjornulf_ImageDetails": ImageDetails,
"Bjornulf_VideoDetails": VideoDetails,
"Bjornulf_IfElse": IfElse,
"Bjornulf_RandomModelSelector": RandomModelSelector,
"Bjornulf_SelectImageFromList": SelectImageFromList,
Expand Down Expand Up @@ -129,6 +147,7 @@
"Bjornulf_ShowText": ShowText,
"Bjornulf_SaveText": SaveText,
"Bjornulf_ResizeImage": ResizeImage,
"Bjornulf_ResizeImagePercentage": ResizeImagePercentage,
"Bjornulf_SaveImageToFolder": SaveImageToFolder,
"Bjornulf_SaveTmpImage": SaveTmpImage,
"Bjornulf_SaveImagePath": SaveImagePath,
Expand All @@ -147,6 +166,10 @@
}

NODE_DISPLAY_NAME_MAPPINGS = {
"Bjornulf_ShowInt": "👁 Show (Int)",
"Bjornulf_ShowFloat": "👁 Show (Float)",
"Bjornulf_ShowJson": "👁 Show (JSON)",
"Bjornulf_ShowStringText": "👁 Show (String/Text)",
"Bjornulf_OllamaTalk": "🦙💬 Ollama Talk",
"Bjornulf_OllamaImageVision": "🦙👁 Ollama Vision",
"Bjornulf_OllamaConfig": "🦙 Ollama Configuration ⚙",
Expand All @@ -155,12 +178,18 @@
"Bjornulf_SpeechToText": "🔊➜📝 STT - Speech to Text",
"Bjornulf_TextToSpeech": "📝➜🔊 TTS - Text to Speech",
"Bjornulf_TextToAnything": "📝➜✨ Text to Anything",
"Bjornulf_AnythingToText": "✨➜📝 Anything to Text",
"Bjornulf_TextReplace": "📝➜📝 Replace text",
"Bjornulf_AddLineNumbers": "🔢 Add line numbers",
"Bjornulf_FFmpegConfig": "⚙📹 FFmpeg Configuration 📹⚙",
"Bjornulf_ConvertVideo": "📹➜📹 Convert Video",
"Bjornulf_VideoDetails": "📹🔍 Video details ⚙",
"Bjornulf_WriteText": "✒ Write Text",
"Bjornulf_MergeImagesHorizontally": "🖼🖼 Merge Images/Videos 📹📹 (Horizontally)",
"Bjornulf_MergeImagesVertically": "🖼🖼 Merge Images/Videos 📹📹 (Vertically)",
"Bjornulf_CombineVideoAudio": "📹🔊 Combine Video + Audio",
"Bjornulf_ConcatVideos": "📹🔗 Concat Videos",
"Bjornulf_ConcatVideosFromList": "📹🔗 Concat Videos from list",
"Bjornulf_LoopLinesSequential": "♻📝 Loop Sequential (input Lines)",
"Bjornulf_LoopIntegerSequential": "♻📝 Loop Sequential (Integer)",
"Bjornulf_LoopLoraSelector": "♻ Loop Lora Selector",
Expand Down Expand Up @@ -201,6 +230,7 @@
"Bjornulf_GrayscaleTransform": "🖼➜🔲 Image to grayscale (black & white)",
"Bjornulf_RemoveTransparency": "▢➜⬛ Remove image Transparency (alpha)",
"Bjornulf_ResizeImage": "📏 Resize Image",
"Bjornulf_ResizeImagePercentage": "📏 Resize Image Percentage",
"Bjornulf_SaveImagePath": "💾🖼 Save Image (exact path, exact name) ⚠️💣",
"Bjornulf_SaveImageToFolder": "💾🖼📁 Save Image(s) to a folder",
"Bjornulf_SaveTmpImage": "💾🖼 Save Image (tmp_api.png) ⚠️💣",
Expand Down
26 changes: 26 additions & 0 deletions anything_to_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class AnythingToText:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"anything": (Everything("*"), {"forceInput": True})
},
}

@classmethod
def VALIDATE_INPUTS(s, input_types):
return True

RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("text",)
FUNCTION = "any_to_text"
CATEGORY = "Bjornulf"

def any_to_text(self, anything):
# Convert the input to string representation
return (str(anything),)

# Keep the Everything class definition as it's needed for type handling
class Everything(str):
def __ne__(self, __value: object) -> bool:
return False
Loading

0 comments on commit 038842e

Please sign in to comment.