Daydream Scope is a tool for running real-time, interactive generative AI video pipelines. It uses a Python/FastAPI backend with a React/TypeScript frontend with support for multiple autoregressive video diffusion models with WebRTC streaming. The frontend and backend are also bundled into an Electron desktop app.
uv sync --group dev # Install all dependencies including dev
uv run pre-commit install # Install pre-commit hooks (required)
uv run daydream-scope --reload # Run server with hot reload (localhost:8000)
uv run pytest # Run testsFor all Python related commands use uv run python.
npm install # Install dependencies
npm run dev # Development server with hot reload
npm run build # Build for production
npm run lint:fix # Fix linting issues
npm run format # Format with Prettieruv run build # Build frontend and Python package
PIPELINE=longlive uv run daydream-scope # Run with specific pipeline auto-loaded
uv run -m scope.core.pipelines.longlive.test # Test specific pipelineserver/: FastAPI application, WebRTC streaming, model downloadingcore/: Pipeline definitions, registry, base classes
Key files:
server/app.py: Main FastAPI application entry pointserver/pipeline_manager.py: Manages pipeline lifecycle with lazy loadingserver/webrtc.py: WebRTC streaming implementationcore/pipelines/: Video generation pipelines (each in its own directory)interface.py: AbstractPipelinebase class - all pipelines implement__call__()registry.py: Registry pattern for dynamic pipeline discoverybase_schema.py: Pydantic config base classes (BasePipelineConfig)artifacts.py: Artifact definitions for model dependencies
- React 19 + TypeScript + Vite
- Radix UI components with Tailwind CSS
- Timeline editor for prompt sequencing
main.ts: App lifecycle, IPC handlers, orchestrates servicespythonProcess.ts: Spawns Python backend viauv run daydream-scope --port 52178electronApp.ts: Window management, loads backend's frontend URL when server is readysetup.ts: Downloads/installsuv, runsuv syncon first launch
Electron main process → spawns Python backend → waits for health check → loads http://127.0.0.1:52178 in BrowserWindow. The Electron renderer initially shows setup/loading screens, then switches to the Python-served frontend once the backend is ready.
- Pipeline Registry: Centralized registry eliminates if/elif chains for pipeline selection
- Lazy Loading: Pipelines load on demand via
PipelineManager - Thread Safety: Reentrant locks protect pipeline access
- Pydantic Configs: Type-safe configuration using Pydantic models
This documentation can be used to understand the architecture of the project:
- The
docs/apidirectory contains server API reference - The
docs/architecturecontains architecture documents describing different systems used within the project
- All commits must be signed off (DCO):
git commit -s - Pre-commit hooks run ruff (Python) and prettier/eslint (frontend)
- Models stored in
~/.daydream-scope/models(configurable viaDAYDREAM_SCOPE_MODELS_DIR)
- Use relative imports if it is single or double dot (eg .package or ..package) and otherwise use an absolute import
scope.servercan import fromscope.core, butscope.coremust never import fromscope.server
Follow these guidelines for verifing work when implementation for a task is complete.
- Use
uv run daydream-scopeto confirm that the server starts up without errors.
- Use
npm run buildto confirm that builds work properly.