Skip to main content

Understanding pipeline architecture

Pipelines are the core abstraction for handling streaming video in Scope. A pipeline encapsulates model loading, inference logic, configuration schemas, and metadata.

Pipeline Definition

The Pipeline Base Class

All pipelines inherit from the abstract Pipeline class:

Configuration Schema

Every pipeline defines a Pydantic configuration class that inherits from BasePipelineConfig. This class serves as the single source of truth for:
  1. Pipeline metadata (ID, name, description, version)
  2. Feature flags (LoRA support, VACE support, quantization)
  3. Parameter definitions with validation constraints
  4. UI rendering hints for the frontend

Example Configuration


Pipeline Metadata

Configuration classes declare metadata as class variables:

Feature Flags

Feature flags control which UI controls are shown:

Artifacts

Artifacts declare model files and resources that a pipeline requires. The system downloads these automatically before the pipeline loads.

Available Artifact Types

Example

Common artifacts shared across pipelines can be reused:

Input Requirements

The prepare() method declares input frame requirements before processing. Pipelines that accept video input must implement it.

Example

Multi-mode Pipeline Example

Pipelines that support both text-to-video and video-to-video modes use the prepare_for_mode() helper from defaults.py:
The helper returns Requirements when video mode is active (indicated by video=True in kwargs) and None for text mode. The input_size is calculated from the pipeline’s configuration. Why implement prepare():
  • Without it, the frame processor cannot know how many frames to buffer before calling __call__()
  • Enables efficient queue management - the processor sizes queues based on requirements
  • Allows multi-mode pipelines to dynamically switch between text and video input modes

Mode System

Pipelines can support multiple input modes with different default parameters:
The default=True flag marks which mode is selected initially.

Preprocessors and Postprocessors

Pipelines can be declared as preprocessors or postprocessors using the usage class variable:

Dynamic UI Rendering

JSON Schema Generation

Pydantic models automatically generate JSON Schema via model_json_schema(). The backend exposes this schema through the /pipelines endpoint, which the frontend consumes for dynamic UI rendering. The schema includes:
  • Field types and validation constraints (minimum, maximum, enum)
  • Default values
  • Descriptions (used as tooltips)
  • Custom UI metadata (via json_schema_extra)

Schema-to-UI Flow

Field Type Inference

For fields without a component specified, the frontend automatically renders an appropriate widget based on the JSON Schema type. The frontend (schemaSettings.ts) infers widget types from schema properties:

Two-Tier Component System

The UI uses a two-tier approach: primitive fields render as individual widgets based on inferred type, while complex components group related fields into unified UI blocks.

UI Metadata

The ui_field_config() helper attaches rendering hints to schema fields:

Complex Components

Fields with the same component value are grouped and rendered together: Fields with the same component value are grouped and rendered once.

Mode-Aware Filtering

Fields specify which modes they appear in via modes:
The frontend filters fields based on the current input mode, hiding irrelevant controls.

Load-time vs Runtime Parameters

Load parameters are passed when the pipeline loads and require a restart to change. Runtime parameters can be adjusted while streaming.

Pipeline Registry

Pipelines register with the central PipelineRegistry at startup:

Built-in vs Node Pipelines

Built-in pipelines are registered automatically when the registry module is imported. Node pipelines register through the pluggy hook system:

GPU-Based Filtering

Pipelines with estimated_vram_gb set are only registered if a compatible GPU is detected. This prevents showing pipelines that cannot run on the current hardware.

See Also

Developing Nodes

Create your own custom pipelines

Node Architecture

Technical details of the node system