Skip to content

Commit 329b330

Browse files
author
ryanontheinstide
committed
Squashed commit of the following:
commit 81a1be6 Author: John | Elite Encoder <john@eliteencoder.net> Date: Fri Feb 21 14:13:34 2025 -0500 update the depthmask background workflow (yondonfu#84) commit 449c391 Author: John | Elite Encoder <john@eliteencoder.net> Date: Fri Feb 21 13:27:06 2025 -0500 bump comfystream version (yondonfu#83) Update ComfyStream version to align with release tagging versioning convention commit 8b54939 Author: John | Elite Encoder <john@eliteencoder.net> Date: Fri Feb 21 13:26:46 2025 -0500 default UI to no audio for UX (yondonfu#82) commit 71c135d Author: John | Elite Encoder <john@eliteencoder.net> Date: Fri Feb 21 13:04:51 2025 -0500 chore(dev): add sample workflow for background fix (yondonfu#81) * add sample workflow for background fix * update workflow commit 45799cc Author: John | Elite Encoder <john@eliteencoder.net> Date: Fri Feb 21 12:17:36 2025 -0500 remove unused code (yondonfu#75) commit 51394af Author: RyanOnTheInside <ryanfosdick287@gmail.com> Date: Fri Feb 21 12:09:10 2025 -0500 fix: patch for multiple controlnets (yondonfu#78) --------- Co-authored-by: ryanontheinstide <ryanfosdick87@gmail.com> Co-authored-by: John Mull <john@eliteencoder.net> commit 44ead39 Author: Rick Staa <rick.staa@outlook.com> Date: Thu Feb 20 06:14:32 2025 +0100 chore(dev): remove nested bash shell (yondonfu#72) This commit ensures that the behavior of the dev container is more consistent with what developers would expect when using the dev container Docker image as a standalone image. commit a93858d Author: Rick Staa <rick.staa@outlook.com> Date: Wed Feb 19 20:07:56 2025 +0100 feat: add JSON and video error toasters (yondonfu#44) * feat: add JSON and video error toasters This commit ensures that users are aware if there has been an error trying to get their camara devices or parsing of the workflow json. * fix setSelectedVideoDevice name from rebase --------- Co-authored-by: Elite <john@eliteencoder.net> commit 125c5d6 Author: RyanOnTheInside <ryanfosdick287@gmail.com> Date: Wed Feb 19 13:36:54 2025 -0500 feat: upgrade hiddenswitch (yondonfu#37) Co-authored-by: RyanOnTheInside <ryanontheinside@users.noreply.github.com> Co-authored-by: ryanontheinstide <ryanfosdick87@gmail.com> Co-authored-by: Rick Staa <rick.staa@outlook.com> Co-authored-by: Elite <john@eliteencoder.net> commit e4ae200 Author: Rick Staa <rick.staa@outlook.com> Date: Wed Feb 19 15:00:45 2025 +0100 fix(ui): ensure proper alignment of output stream video (yondonfu#71) This commit ensures that the output video stream element takes the full height of its parent div, improving layout consistency and visual alignment. commit 450cf40 Author: John | Elite Encoder <john@eliteencoder.net> Date: Wed Feb 19 08:50:15 2025 -0500 fix issues with device selection and UI (yondonfu#69) commit 9837b6c Author: Rick Staa <rick.staa@outlook.com> Date: Wed Feb 19 12:41:08 2025 +0100 feat: add 'health' path (yondonfu#54) This commit ensures that the health endpoint is also found on the `/health` path which is more common than having it under `/`. commit 0119f59 Author: John | Elite Encoder <john@eliteencoder.net> Date: Tue Feb 18 17:03:59 2025 -0500 chore: install dev container comfystream in edit mode (yondonfu#68) commit 7ea9d93 Author: John | Elite Encoder <john@eliteencoder.net> Date: Tue Feb 18 16:21:56 2025 -0500 Revert "chore: install dev container comfystream in edit mode (yondonfu#65)" (yondonfu#67) This reverts commit 62871ae. commit 62871ae Author: Rick Staa <rick.staa@outlook.com> Date: Tue Feb 18 20:33:38 2025 +0100 chore: install dev container comfystream in edit mode (yondonfu#65) This commit ensures that the comfystream package is installed in editable mode so that code changes are directly reflected in the dev environment. Co-authored-by: John | Elite Encoder <john@eliteencoder.net> commit 9045ade Author: Varshith Bathini <varshith15@gmail.com> Date: Tue Feb 18 04:07:22 2025 +0530 feat: audio support (yondonfu#10) * Squashed commit of the following: commit a685e11 Author: Varshith B <varshith15@gmail.com> Date: Mon Feb 17 22:46:25 2025 +0530 feat: add cleanup commit 0e4d8af Author: Varshith B <varshith15@gmail.com> Date: Sun Feb 16 22:52:46 2025 +0530 fix: audio frame skipping commit 44df170 Author: Varshith B <varshith15@gmail.com> Date: Sun Feb 16 22:18:23 2025 +0530 fix: frame skipping commit c3009c6 Author: Varshith B <varshith15@gmail.com> Date: Thu Feb 13 18:49:26 2025 +0530 fix: dynamic prompt change commit 383105b Author: Elite Encoder <john@eliteencoder.net> Date: Wed Feb 12 21:24:34 2025 +0000 fix prompt control panel rendering (wip) commit b372b10 Author: Elite Encoder <john@eliteencoder.net> Date: Wed Feb 12 18:11:50 2025 +0000 add libsndfile1 commit 214cfec Merge: a0ed6f8 6f54863 Author: Varshith Bathini <varshith15@gmail.com> Date: Tue Feb 11 22:43:18 2025 +0530 Merge branch 'main' into feat/audio_support commit a0ed6f8 Author: Varshith Bathini <varshith15@gmail.com> Date: Fri Feb 7 01:54:42 2025 +0530 Apply suggestions from code review Co-authored-by: John | Elite Encoder <john@eliteencoder.net> commit b85d01d Author: Varshith B <varshith15@gmail.com> Date: Tue Feb 4 17:29:17 2025 +0530 fix: update prompts commit aa209f0 Merge: 6e134b7 af132be Author: Varshith B <varshith15@gmail.com> Date: Mon Feb 3 23:01:48 2025 +0530 Merge branch 'feat/audio_support' of https://github.com/varshith15/comfystream into feat/audio_support commit 6e134b7 Author: Varshith B <varshith15@gmail.com> Date: Mon Feb 3 23:00:16 2025 +0530 fix: pitch shift example commit 1c1959e Author: Varshith B <varshith15@gmail.com> Date: Mon Feb 3 21:44:19 2025 +0530 fix: one-to-one mapping commit af132be Merge: 5e9e755 5051688 Author: Varshith Bathini <varshith15@gmail.com> Date: Thu Jan 30 22:23:21 2025 +0530 Merge branch 'main' into feat/audio_support commit 5e9e755 Author: Varshith B <varshith15@gmail.com> Date: Thu Jan 30 22:11:20 2025 +0530 fix: muted functionality commit 06faf49 Author: Varshith B <varshith15@gmail.com> Date: Thu Jan 30 21:39:59 2025 +0530 fix: audio and video muting commit 5897596 Author: Varshith B <varshith15@gmail.com> Date: Thu Jan 30 20:47:44 2025 +0530 fix: warmup issue fix commit 126fb3a Author: Varshith B <varshith15@gmail.com> Date: Thu Jan 30 17:46:41 2025 +0530 fix: cleanup commit 2d04794 Author: Varshith B <varshith15@gmail.com> Date: Thu Jan 30 17:14:19 2025 +0530 fix: audio nodes commit 6c529f5 Merge: b4f871a 9583a28 Author: Varshith B <varshith15@gmail.com> Date: Wed Jan 29 15:13:56 2025 +0530 fix: merge conflicts commit b4f871a Author: Varshith B <varshith15@gmail.com> Date: Mon Jan 27 23:54:10 2025 +0530 fix: load multiple workflows commit eb161c2 Author: Varshith B <varshith15@gmail.com> Date: Mon Jan 27 22:54:32 2025 +0530 fix: combine workflows commit 415c387 Author: Varshith B <varshith15@gmail.com> Date: Fri Jan 24 23:09:21 2025 +0530 feat: combine audio and video streams commit 49deb2f Author: Varshith B <varshith15@gmail.com> Date: Mon Jan 20 13:12:52 2025 +0530 fix: server commit 2a3d086 Author: Varshith B <varshith15@gmail.com> Date: Sun Dec 29 23:35:54 2024 +0530 temp: working state commit 21e4310 Author: Varshith B <varshith15@gmail.com> Date: Sun Dec 29 16:45:45 2024 +0000 feat: streaming whisper commit 29f6bb7 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 28 01:18:51 2024 +0530 feat: audio pipeline commit 960aebe Author: Varshith B <varshith15@gmail.com> Date: Tue Dec 24 23:16:16 2024 +0530 fix: only hear remote audio commit 7035b03 Author: Varshith B <varshith15@gmail.com> Date: Tue Dec 24 01:10:59 2024 +0530 fix: combine tracks commit 6dad03a Author: Varshith B <varshith15@gmail.com> Date: Wed Dec 18 00:50:58 2024 +0530 fix: remove muted commit a484226 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 14 20:25:52 2024 +0000 feat: ui changes to get audio commit f182502 Merge: 8613ea5 8a6b528 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 14 19:08:53 2024 +0000 fix: merge conflicts commit 8613ea5 Merge: 743da71 fe8b261 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 14 18:50:22 2024 +0000 fix: merge conflicts commit 743da71 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 14 18:47:25 2024 +0000 fix: app commit fbe59f4 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 14 18:45:19 2024 +0000 feat: whisper workflow commit fe8b261 Author: Varshith B <varshith15@gmail.com> Date: Sat Dec 7 22:31:07 2024 +0530 feat: init * fix: cleanup * revert unneeded changes to use-peer.ts * default to video only --------- Co-authored-by: Elite <john@eliteencoder.net> commit 497dcb3 Author: John | Elite Encoder <john@eliteencoder.net> Date: Mon Feb 17 10:19:54 2025 -0500 add info for runpod (yondonfu#60) * add info for runpod * Update README.md Co-authored-by: Rick Staa <rick.staa@outlook.com> --------- Co-authored-by: Rick Staa <rick.staa@outlook.com> commit c73fc68 Author: Rick Staa <rick.staa@outlook.com> Date: Fri Feb 14 22:36:32 2025 +0100 refactor: improve the example setup (yondonfu#62) This commit adds a new `prepare_examples` alias to the dev container that users can use to setup all the dependencies for the examples. It also updates the documentation. commit 67d8aab Author: Rick Staa <rick.staa@outlook.com> Date: Fri Feb 14 16:25:14 2025 +0100 docs(dev): fixes an incorrect model download command (yondonfu#61) This commit ensure that the right folder path is used in the model download command.
1 parent b2dcb22 commit 329b330

39 files changed

+5178
-323
lines changed

.devcontainer/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ RUN mkdir -p /etc/supervisor/conf.d
3333
COPY .devcontainer/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
3434

3535
WORKDIR /workspace/comfystream
36-
COPY docker/entrypoint.sh /workspace/comfystream/docker/entrypoint.sh
37-
RUN chmod +x /workspace/comfystream/docker/entrypoint.sh
38-
ENTRYPOINT ["/workspace/comfystream/docker/entrypoint.sh"]
36+
COPY .devcontainer/entrypoint.sh /workspace/comfystream/.devcontainer/entrypoint.sh
37+
RUN chmod +x /workspace/comfystream/.devcontainer/entrypoint.sh
38+
39+
ENTRYPOINT ["/workspace/comfystream/.devcontainer/entrypoint.sh"]
40+
CMD ["/bin/bash"]

.devcontainer/README.md

+49-37
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,68 @@ Replace `/path/to/your/model-files` and `path/to/your/output-files` with the pat
6565
2. From VS Code, reload the folder as a devcontainer:
6666
- Open the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P` on macOS).
6767
- Select `Remote-Containers: Reopen in Container`.
68+
3. Wait for the container to build and start.
6869

69-
### Download models
70+
### Starting ComfyUI
71+
72+
Start ComfyUI:
73+
74+
```sh
75+
cd /workspace/comfystream/ComfyUI
76+
conda activate comfyui
77+
python main.py --listen
78+
```
79+
80+
When using TensorRT engine enabled workflows, you should include the `---disable-cuda-malloc` flag as shown below:
81+
82+
```sh
83+
cd /workspace/comfystream/ComfyUI
84+
conda activate comfyui
85+
python main.py --listen --disable-cuda-malloc
86+
```
87+
88+
### Starting ComfyStream
89+
90+
Start ComfyStream:
91+
92+
```sh
93+
cd /workspace/comfystream
94+
conda activate comfystream
95+
python server/app.py --workspace /workspace/ComfyUI --media-ports=5678 --host=0.0.0.0 --port 8889
96+
```
97+
98+
Optionally, you can also start the [ComfyStream UI](../README.md#run-ui) to view the stream:
99+
100+
```sh
101+
cd /workspace/comfystream/ui
102+
npm run dev:https
103+
```
104+
105+
### Running Example Workflows
106+
107+
To run example workflows, you need to download models and build TensorRT engines. You can do this from within the dev container by running the following command in the terminal:
108+
109+
```sh
110+
prepare_examples
111+
```
112+
113+
Alternatively, you can follow the steps below.
114+
115+
#### Download models
70116

71117
From within the **dev container**, download models to run the example workflows:
72118

73119
```sh
74120
cd /workspace/comfystream
75121
conda activate comfystream
76-
python src/comfystream/scripts/setup_models.py --workspace /ComfyUI
122+
python src/comfystream/scripts/setup_models.py --workspace /workspace/ComfyUI
77123
```
78124

79125
For more info about configuring model downloads, see [src/comfystream/scripts/README.md](../src/comfystream/scripts/README.md)
80126

81127
By following these steps, you should be able to set up and run your development container for ComfyStream efficiently.
82128

83-
### Building the DepthAnything Engine
129+
#### Building the DepthAnything Engine
84130

85131
After downloading models, it is necessary to compile TensorRT engines for the example workflow.
86132

@@ -113,40 +159,6 @@ Alternatively, you may activate an environment manually with `conda activate com
113159

114160
> [!NOTE] For more information, see [Python environments in VS Code](https://code.visualstudio.com/docs/python/environments)
115161

116-
### Starting ComfyUI
117-
118-
Start ComfyUI:
119-
120-
```sh
121-
cd /workspace/comfystream/ComfyUI
122-
conda activate comfyui
123-
python main.py --listen
124-
```
125-
126-
When using TensorRT engine enabled workflows, you should include the `---disable-cuda-malloc` flag as shown below:
127-
128-
```sh
129-
cd /workspace/comfystream/ComfyUI
130-
conda activate comfyui
131-
python main.py --listen --disable-cuda-malloc
132-
```
133-
134-
### Starting ComfyStream
135-
136-
Start ComfyStream:
137-
138-
```sh
139-
cd /workspace/comfystream
140-
conda activate comfystream
141-
python server/app.py --workspace /workspace/ComfyUI --media-ports=5678 --host=0.0.0.0 --port 8889
142-
```
143-
144-
Optionally, you can also start the [ComfyStream UI](../README.md#run-ui) to view the stream:
145-
146-
```sh
147-
cd /workspace/comfystream/ui
148-
npm run dev:https
149-
```
150162

151163
## Additional Resources
152164

docker/entrypoint.sh .devcontainer/entrypoint.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ fi
5252

5353
if [ "$1" = "--server" ]; then
5454
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
55+
shift
5556
fi
5657

5758
cd /workspace/comfystream
58-
/bin/bash
59+
60+
exec "$@"

.devcontainer/post-create.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
#!/bin/bash
22

3+
chmod +x /workspace/comfystream/.devcontainer/entrypoint.sh
34
cd /workspace/comfystream
4-
/bin/bash
5+
6+
# Install Comfystream in editable mode.
7+
echo -e "\e[32mInstalling Comfystream in editable mode...\e[0m"
8+
/workspace/miniconda3/envs/comfystream/bin/python3 -m pip install -e . > /dev/null
9+
10+
# Create a symlink to the entrypoint script.
11+
echo 'alias prepare_examples="/workspace/comfystream/.devcontainer/entrypoint.sh --download-models --build-engines"' >> ~/.bashrc
12+
echo -e "\e[32mContainer ready! Run 'prepare_examples' to download models and build engines for example workflows.\e[0m"
13+
14+
/bin/bash

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This repo also includes a WebRTC server and UI that uses comfystream to support
77
- [comfystream](#comfystream)
88
- [Quick Start](#quick-start)
99
- [Docker DevContainer](#docker-devcontainer)
10+
- [Docker Image](#docker-image)
1011
- [Download Models](#download-models)
1112
- [Install package](#install-package)
1213
- [Custom Nodes](#custom-nodes)
@@ -26,6 +27,16 @@ For other installation options, refer to [Install ComfyUI and ComfyStream](https
2627

2728
For additional information, refer to the remaining sections below.
2829

30+
### Docker Image
31+
32+
You can quickly deploy ComfyStream using the docker image `livepeer/comfystream`
33+
34+
Refer to the documentation at [https://pipelines.livepeer.org/docs/technical/getting-started/install-comfystream](https://pipelines.livepeer.org/docs/technical/getting-started/install-comfystream) for instructions to run locally or on a remote server.
35+
36+
#### RunPod
37+
38+
The RunPod template [livepeer-comfystream](https://runpod.io/console/deploy?template=w01m180vxx&ref=u8tlskew) can be used to deploy to RunPod.
39+
2940
## Download Models
3041

3142
Refer to [src/comfystream/scripts/README.md](src/comfystream/scripts/README.md) for instructions to download commonly used models.

configs/models.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,23 @@ models:
3737
name: "ControlNet Depth"
3838
url: "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors"
3939
path: "controlnet/control_v11f1p_sd15_depth_fp16.safetensors"
40-
type: "controlnet"
40+
type: "controlnet"
41+
42+
controlnet-mediapipe-face:
43+
name: "ControlNet MediaPipe Face"
44+
url: "https://huggingface.co/CrucibleAI/ControlNetMediaPipeFace/resolve/main/control_v2p_sd15_mediapipe_face.safetensors"
45+
path: "controlnet/control_v2p_sd15_mediapipe_face.safetensors"
46+
type: "controlnet"
47+
48+
# Lora models
49+
ral-polygon-sd15:
50+
name: "ral-polygon-sd15"
51+
url: "https://huggingface.co/Livepeer-Studio/comfystream_loras/resolve/main/ral-polygon-sd15.safetensors"
52+
path: "loras/SD1.5/ral-polygon-sd15.safetensors"
53+
type: "lora"
54+
55+
ral-chrome-sdxl:
56+
name: "ral-chrome-sd15"
57+
url: "https://civitai.com/api/download/models/276570?type=Model&format=SafeTensor"
58+
path: "loras/SD1.5/ral-chrome-sd15.safetensors"
59+
type: "lora"

configs/nodes.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ nodes:
22
# Core TensorRT nodes
33
comfyui-tensorrt:
44
name: "ComfyUI TensorRT"
5-
url: "https://github.com/yondonfu/ComfyUI_TensorRT"
6-
branch: "quantization_with_controlnet_fixes"
5+
url: "https://github.com/ryanontheinside/ComfyUI_TensorRT"
6+
branch: "hs-fix"
77
type: "tensorrt"
88

99
comfyui-depthanything-tensorrt:
@@ -61,3 +61,10 @@ nodes:
6161
name: "ComfyUI Background Edit"
6262
url: "https://github.com/yondonfu/ComfyUI-Background-Edit"
6363
type: "utility"
64+
65+
comfyui_controlnet_aux:
66+
name: "ComfyUI ControlNet Auxiliary"
67+
url: "https://github.com/Fannovel16/comfyui_controlnet_aux"
68+
type: "utility"
69+
dependencies:
70+
- "mediapipe==0.10.8"

docker/Dockerfile.base

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -
99
wget \
1010
nano \
1111
socat \
12+
libsndfile1 \
1213
build-essential llvm tk-dev \
1314
&& rm -rf /var/lib/apt/lists/*
1415

nodes/audio_utils/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .load_audio_tensor import LoadAudioTensor
2+
from .save_audio_tensor import SaveAudioTensor
3+
from .pitch_shift import PitchShifter
4+
5+
NODE_CLASS_MAPPINGS = {"LoadAudioTensor": LoadAudioTensor, "SaveAudioTensor": SaveAudioTensor, "PitchShifter": PitchShifter}
6+
7+
__all__ = ["NODE_CLASS_MAPPINGS"]
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import numpy as np
2+
3+
from comfystream import tensor_cache
4+
5+
class LoadAudioTensor:
6+
CATEGORY = "audio_utils"
7+
RETURN_TYPES = ("WAVEFORM", "INT")
8+
FUNCTION = "execute"
9+
10+
def __init__(self):
11+
self.audio_buffer = np.empty(0, dtype=np.int16)
12+
self.buffer_samples = None
13+
self.sample_rate = None
14+
15+
@classmethod
16+
def INPUT_TYPES(s):
17+
return {
18+
"required": {
19+
"buffer_size": ("FLOAT", {"default": 500.0}),
20+
}
21+
}
22+
23+
@classmethod
24+
def IS_CHANGED():
25+
return float("nan")
26+
27+
def execute(self, buffer_size):
28+
if self.sample_rate is None or self.buffer_samples is None:
29+
frame = tensor_cache.audio_inputs.get(block=True)
30+
self.sample_rate = frame.sample_rate
31+
self.buffer_samples = int(self.sample_rate * buffer_size / 1000)
32+
self.leftover = frame.side_data.input
33+
34+
if self.leftover.shape[0] < self.buffer_samples:
35+
chunks = [self.leftover] if self.leftover.size > 0 else []
36+
total_samples = self.leftover.shape[0]
37+
38+
while total_samples < self.buffer_samples:
39+
frame = tensor_cache.audio_inputs.get(block=True)
40+
if frame.sample_rate != self.sample_rate:
41+
raise ValueError("Sample rate mismatch")
42+
chunks.append(frame.side_data.input)
43+
total_samples += frame.side_data.input.shape[0]
44+
45+
merged_audio = np.concatenate(chunks, dtype=np.int16)
46+
buffered_audio = merged_audio[:self.buffer_samples]
47+
self.leftover = merged_audio[self.buffer_samples:]
48+
else:
49+
buffered_audio = self.leftover[:self.buffer_samples]
50+
self.leftover = self.leftover[self.buffer_samples:]
51+
52+
return buffered_audio, self.sample_rate

nodes/audio_utils/pitch_shift.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import numpy as np
2+
import librosa
3+
4+
class PitchShifter:
5+
CATEGORY = "audio_utils"
6+
RETURN_TYPES = ("WAVEFORM", "INT")
7+
FUNCTION = "execute"
8+
9+
@classmethod
10+
def INPUT_TYPES(cls):
11+
return {
12+
"required": {
13+
"audio": ("WAVEFORM",),
14+
"sample_rate": ("INT",),
15+
"pitch_shift": ("FLOAT", {
16+
"default": 4.0,
17+
"min": 0.0,
18+
"max": 12.0,
19+
"step": 0.5
20+
}),
21+
}
22+
}
23+
24+
@classmethod
25+
def IS_CHANGED(cls):
26+
return float("nan")
27+
28+
def execute(self, audio, sample_rate, pitch_shift):
29+
audio_float = audio.astype(np.float32) / 32768.0
30+
shifted_audio = librosa.effects.pitch_shift(y=audio_float, sr=sample_rate, n_steps=pitch_shift)
31+
shifted_int16 = np.clip(shifted_audio * 32768.0, -32768, 32767).astype(np.int16)
32+
return shifted_int16, sample_rate
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from comfystream import tensor_cache
2+
3+
class SaveAudioTensor:
4+
CATEGORY = "audio_utils"
5+
RETURN_TYPES = ()
6+
FUNCTION = "execute"
7+
OUTPUT_NODE = True
8+
9+
10+
@classmethod
11+
def INPUT_TYPES(s):
12+
return {
13+
"required": {
14+
"audio": ("WAVEFORM",)
15+
}
16+
}
17+
18+
@classmethod
19+
def IS_CHANGED(s):
20+
return float("nan")
21+
22+
def execute(self, audio):
23+
tensor_cache.audio_outputs.put_nowait(audio)
24+
return (audio,)
25+

nodes/tensor_utils/load_tensor.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ def IS_CHANGED():
1515
return float("nan")
1616

1717
def execute(self):
18-
input = tensor_cache.inputs.pop()
19-
return (input,)
18+
frame = tensor_cache.image_inputs.get(block=True)
19+
frame.side_data.skipped = False
20+
return (frame.side_data.input,)

0 commit comments

Comments
 (0)