Skip to main content

Documentation Index

Fetch the complete documentation index at: https://na-36-handover-docs-v2-into-docs-v2-dev-20260518.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.


ComfyStream applies ComfyUI workflows to incoming video frames in real time. The workflow runs as-is: any node that works in ComfyUI batch mode works in ComfyStream, provided it accepts a latent or image input representing the current frame and returns a transformed output. This guide covers building a workflow suitable for streaming, installing ComfyStream, and connecting it to a live video source.

Prerequisites

  • ComfyUI installed locally or in a Docker environment
  • An NVIDIA GPU (RTX 3090 or later recommended for StreamDiffusion workflows; lighter models work on lower VRAM)
  • Python 3.10+ with PyTorch installed
  • FFmpeg available on PATH

Installation

Workflow Structure

A streaming workflow differs from a standard batch workflow in one respect: it must accept the current video frame as input and return the processed frame as output on each forward pass. In ComfyUI, build a workflow that includes:
  • A Load Image node (or equivalent) as the entry point for the incoming frame
  • Your processing chain (samplers, ControlNet, LoRA, etc.)
  • A Save Image or Preview Image node as the terminal output node
When ComfyStream runs this workflow, it intercepts the Load Image node to inject each decoded frame and captures the output before it writes to disk. The rest of the workflow is unchanged. Export the workflow in API format from ComfyUI: Workflow > Export (API Format). This produces a JSON file that ComfyStream loads at startup.

Running ComfyStream

Start the ComfyStream server pointing at your ComfyUI workspace and the workflow JSON:
python server/app.py \
  --workspace /path/to/ComfyUI \
  --workflow /path/to/your_workflow.json \
  --port 8188
The server exposes a WebRTC signalling endpoint and a browser UI. Open the UI in a browser, select your webcam or paste an RTMP stream URL, and click Connect. The server negotiates a WebRTC connection, begins decoding incoming frames, runs each frame through the workflow, and streams the output back to the browser. For remote server deployments, allow inbound and outbound UDP traffic on ports 1024-65535 for WebRTC ICE negotiation, or use --media-ports to restrict to a specific range:
python server/app.py --workspace /path/to/ComfyUI --media-ports 10000,10001,10002

Gateway Integration

To route a ComfyStream instance through the Livepeer network, the orchestrator connects to the ComfyStream service over the trickle protocol. The orchestrator discovers the service address and forwards jobs from gateway clients to it. See for how to register a ComfyStream instance as a BYOC container with a Livepeer orchestrator so it appears as a routable live-video-to-video capability on the network. The workflow is ready for live use. Register it as a BYOC container to make it available on the network via ComfyStream as BYOC.

ComfyStream as BYOC

Registering a ComfyStream instance as a BYOC capability on a Livepeer orchestrator.

Real-Time AI Overview

Cascade architecture and how trickle protocol connects the pipeline components.

PyTrickle Overview

Python SDK for custom real-time processing if you need logic beyond ComfyUI workflows.

BYOC Overview

Container interface and registration steps for all BYOC pipeline types.
Last modified on May 19, 2026