Skip to content

Commit 0e9289f

Browse files
committed
On decode, strip section tokens from start and end
1 parent 392c34d commit 0e9289f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

nodes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ def INPUT_TYPES(s):
6363
RETURN_TYPES = "AUDIO",
6464
CATEOGRY = "Orpheus"
6565
def decode(self, tokens, vae):
66+
#trim any section tokens from start or end
67+
start_index = 0
68+
while tokens[start_index] < tokeniser_length + 10:
69+
start_index += 1
70+
end_index = 0
71+
while tokens[end_index - 1] < tokeniser_length + 10:
72+
end_index -= 1
73+
if start_index != 0 or end_index != 0:
74+
tokens = tokens[start_index:end_index]
6675
#assert len(tokens) % 7 == 0
6776
tokens = tokens[:len(tokens)//7*7]
6877
t = torch.tensor(tokens).reshape((-1,7))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-orpheus"
33
description = "Nodes for using Orpheus-TTS in ComfyUI"
4-
version = "0.1.3"
4+
version = "0.1.4"
55
classifiers = [
66
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)"
77
]

0 commit comments

Comments
 (0)