Skip to content

Commit

Permalink
0.68
Browse files Browse the repository at this point in the history
  • Loading branch information
justUmen committed Jan 24, 2025
1 parent 99fa0ff commit 705362d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🔗 Comfyui : Bjornulf_custom_nodes v0.67 🔗
# 🔗 Comfyui : Bjornulf_custom_nodes v0.68 🔗

A list of 120 custom nodes for Comfyui : Display, manipulate, create and edit text, images, videos, loras, generate characters 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.
Expand Down Expand Up @@ -362,6 +362,7 @@ cd /where/you/installed/ComfyUI && python main.py
- **0.65**: ❗Breaking changes : Combine Text inputs are now all optional (PLease remake your nodes, sorry.) Add 6 new nodes : any2int, any2float, load text from folder, load text from path, load lora from path. Also upgraded the Save text node.
- **0.66**: Add lora hunyuan CIVIT ai + download, add TTS configuration node, edit requirements.txt
- **0.67**: Add kokoro TTS node.
- **0.68**: Update kokoro TTS node with connect_to_workflow and same outputs as XTTS.

# 📝 Nodes descriptions

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "bjornulf_custom_nodes"
description = "120 ComfyUI nodes : Display, manipulate, and edit text, images, videos, loras, generate characters and more. Manage looping operations, generate randomized content, use logical conditions and work with external AI tools, like Ollama or Text To Speech Kokoro, etc..."
version = "0.67"
version = "0.68"
license = {file = "LICENSE"}

[project.urls]
Expand Down
Binary file modified screenshots/kokoro_tts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions text_to_speech_kokoro.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import requests
import random

class Everything(str):
def __ne__(self, __value: object) -> bool:
return False

VOICE_OPTIONS = {
"af_bella": "Bella (American Female) - af_bella",
"af_nicole": "Nicole (American Female) - af_nicole",
Expand Down Expand Up @@ -61,16 +65,20 @@ def INPUT_TYPES(cls):
"save_audio": ("BOOLEAN", {"default": True}),
"overwrite": ("BOOLEAN", {"default": False}),
"seed": ("INT", {"default": 0}),
},
"optional": {
"connect_to_workflow": (Everything("*"), {"forceInput": True}),
}
}

RETURN_TYPES = ("AUDIO",)
RETURN_TYPES = ("AUDIO", "STRING", "STRING", "FLOAT")
RETURN_NAMES = ("AUDIO", "audio_path", "audio_full_path", "audio_duration")
FUNCTION = "generate_audio"
CATEGORY = "Bjornulf/Kokoro"

def generate_audio(self, text: str, voice: str, language: str, speed: float,
autoplay: bool, save_audio: bool,
overwrite: bool, seed: int):
overwrite: bool, seed: int, connect_to_workflow: any = None):
random.seed(seed)

config = {
Expand Down Expand Up @@ -138,8 +146,8 @@ def generate_audio(self, text: str, voice: str, language: str, speed: float,

audio_tensor = torch.from_numpy(samples).unsqueeze(0)
audio_output = {"waveform": audio_tensor.unsqueeze(0), "sample_rate": sample_rate}
return (audio_output,)
return (audio_output, save_path, full_path, len(samples) / sample_rate)

except Exception as e:
print(f"Error in Kokoro TTS: {e}")
return ({"waveform": torch.zeros(1, 1, 1), "sample_rate": 22050},)
return ({"waveform": torch.zeros(1, 1, 1), "sample_rate": 22050}, "", "", 0.0)

0 comments on commit 705362d

Please sign in to comment.