diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..240a12b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "StreamDiffusion"] + path = StreamDiffusion + url = https://github.com/cumulo-autumn/StreamDiffusion.git diff --git a/README.md b/README.md index 6c227c2..b4aba5e 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,16 @@ The execution looks like this: ![Workflow3demo](img/workflow3demo.gif) - ## Usage Run the following command inside ComfyUI/custom_nodes. ```cmd -git clone https://github.com/Limitex/ComfyUI-Diffusers.git +git clone --recurse-submodules https://github.com/Limitex/ComfyUI-Diffusers.git cd ComfyUI-Diffusers -pip install -r requirements.txt -git clone https://github.com/cumulo-autumn/StreamDiffusion.git -python -m streamdiffusion.tools.install-tensorrt +./install.sh ``` + ## Recommended Custom Nodes https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git @@ -69,6 +67,6 @@ https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git ### StreamDiffusion Fast Sampler (StreamDiffusionFastSampler) -## Reference +## Reference https://github.com/cumulo-autumn/StreamDiffusion diff --git a/StreamDiffusion b/StreamDiffusion new file mode 160000 index 0000000..83eb14e --- /dev/null +++ b/StreamDiffusion @@ -0,0 +1 @@ +Subproject commit 83eb14e8dc7a644f525de836f78332a70d69e48c diff --git a/ignore_cuda_for_mac.patch b/ignore_cuda_for_mac.patch new file mode 100644 index 0000000..dc9697b --- /dev/null +++ b/ignore_cuda_for_mac.patch @@ -0,0 +1,17 @@ +diff --git a/src/streamdiffusion/pipeline.py b/src/streamdiffusion/pipeline.py +index 66c08c8..33df7ea 100644 +--- a/src/streamdiffusion/pipeline.py ++++ b/src/streamdiffusion/pipeline.py +@@ -440,9 +440,9 @@ class StreamDiffusion: + def __call__( + self, x: Union[torch.Tensor, PIL.Image.Image, np.ndarray] = None + ) -> torch.Tensor: +- start = torch.cuda.Event(enable_timing=True) +- end = torch.cuda.Event(enable_timing=True) +- start.record() ++ # start = torch.cuda.Event(enable_timing=True) ++ # end = torch.cuda.Event(enable_timing=True) ++ # start.record() + if x is not None: + x = self.image_processor.preprocess(x, self.height, self.width).to( + device=self.device, dtype=self.dtype diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..e8970a5 --- /dev/null +++ b/install.sh @@ -0,0 +1,16 @@ +#!/bin/bash +source ../../venv/bin/activate + +pip install -r requirements.txt +python python -m streamdiffusion.tools.install-tensorrt + +git clone https://github.com/cumulo-autumn/StreamDiffusion.git +python -m streamdiffusion.tools.install-tensorrt + +if [[ $(uname) == "Darwin" ]]; then # for MacOS / MPS + cd StreamDiffusion + git apply ../ignore_cuda_for_mac.patch + pip install . +else + python -m streamdiffusion.tools.install-tensorrt # for PC / CUDA +fi