ComfyStream (API Server)

Before starting ComfyStream UI, we must start the ComfyStream API server on a system with a GPU

  1. Activate the comfystream environment and change to the ComfyStream directory
conda activate comfystream
cd /workspace/comfyRealtime/ComfyStream
  1. Start ComfyStream
python server/app.py --workspace ../ComfyUI --media-ports=5678 --host=0.0.0.0 --port 8889

Run ComfyStream (UI)

ComfyStream UI must be ran on a system with physical or virtual camera. If you are running ComfyStream API locally, you can use the same folder for UI.

  1. Clone ComfyStream UI:
git clone https://github.com/yondonfu/comfystream
  1. Run the following command to install the project’s dependencies using npm:
cd comfystream/ui
npm install --legacy-peer-deps

This will download and set up all required Node.js modules.

If you run encounter packages install errors, check the installed versions of node: node -v && npm -v

Switch to the correct node version if necessary: nvm use 18

  1. From the comfystream/ui directory, start ComfyStream UI:
npm run dev
  1. Open a browser and navigate to http://localhost:3000

Obtaining the Stream URL

The Stream URL in ComfyStream UI should be set to the url and external port for the ComfyStream API environment.

  1. Log into RunPod and go the Pods page.
  2. Click on the Connect button.
  3. Click the TCP Port Mappings tab.
  4. Copy the IP address and external port for 8889, to create the url http://IP:PORT

Customizing the default stream URL

If you are not running ComfyStream UI on the same host as the ComfyStream API, you can customize the default stream URL to ease testing.

Create a new .env file with your running ComfyStream API URL:

cd comfystream/ui
echo "NEXT_PUBLIC_DEFAULT_STREAM_URL=http://127.0.0.1:8889" > .env

Supported workflows

Refer to Available ComfyUI Nodes for sample workflows to import into ComfyStream and ComfyUI

Sample workflows are listed in the examples directory of most node repositories