# AI app generation
Source: https://docs.daydream.live/api/ai-oneshot
Learn how to use AI tools to one-shot a StreamDiffusion-powered app
## Overview
This guide shows how to “one shot” an app using an AI coding assistant. You’ll copy a single set of instructions, open your preferred AI tool, and let it scaffold and wire everything up.
You’ll paste a single, comprehensive prompt. We’ve included quick‑launch links that prefill the prompt for tools that support it.
## Prerequisites
* **AI tool account**: Claude, ChatGPT, Gemini, or another assistant.
* **Local dev environment**: Git, Node.js, and your editor of choice.
* **Daydream API key**: See [Authentication](/api/authentication) if your app will call the Daydream API.
## Steps
Select from an example to get started.
Copy the prompt below. Replace the placeholder for the API key.
Use the quick‑launch buttons below to open a new chat with the prompt prefilled (where supported) or paste it manually.
Ask the assistant to execute the steps, generate files, run installs, and fix any issues. Approve tool actions if your assistant supports them.
## Select From the Examples Below
Webcam Livestream with StreamDiffusion
DrawCanvas
FluidCanvas
Audio-Reactive
# Create a New Stream
Source: https://docs.daydream.live/api/api-reference/create-stream
POST /v1/streams
Creates a new video processing stream with the specified configuration
This endpoint creates a new video processing stream using the Daydream StreamDiffusion pipeline. You'll specify the pipeline type and model configuration in the request body.
## Request Body Structure
```json theme={null}
{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sdxl-turbo",
// ... additional parameters
}
}
```
* **`pipeline`**: The processing pipeline to use. Currently `"streamdiffusion"` is the only public option.
* **`params`**: Configuration object containing the model and generation parameters.
* **`params.model_id`**: The specific model to use (see table below).
## Available Models
| model\_id | Family | ControlNets | IP Adapter | Cached Attention |
| --------------------------- | ------ | ----------- | ---------- | ---------------- |
| `stabilityai/sd-turbo` | SD2.1 | 6 types | No | No |
| `stabilityai/sdxl-turbo` | SDXL | 3 types | Yes | Yes |
| `Lykon/dreamshaper-8` | SD1.5 | 4 types | Yes | Yes |
| `prompthero/openjourney-v4` | SD1.5 | 4 types | Yes | Yes |
**Which model should I use?**
* **SD2.1 (`sd-turbo`)**: Fastest, good for real-time effects
* **SDXL (`sdxl-turbo`)**: Highest quality, supports IP Adapter for style transfer
* **SD1.5 (`dreamshaper-8`, `openjourney-v4`)**: Great for stylized/cartoon effects, supports IP Adapter and Cached Attention
## Example: Create an SDXL Turbo Stream
```bash theme={null}
curl -X POST \
"https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "anime character"
}
}'
```
## Example: Create a Stream with ControlNet
```bash theme={null}
curl -X POST \
"https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "oil painting portrait",
"controlnets": [
{
"model_id": "xinsir/controlnet-depth-sdxl-1.0",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0.5,
"enabled": true
}
]
}
}'
```
For full parameter documentation, see the [Parameters](/api/parameters/SD15) section.
## Legacy Support
The `pipeline_id` field (e.g., `"pip_SD15"`) is deprecated but still supported for backward compatibility. New integrations should use `pipeline` + `params.model_id` instead.
# Stream Status
Source: https://docs.daydream.live/api/api-reference/stream-status
GET /v1/streams/{id}/status
Check the status of your stream
The stream status uses the following url, make sure to include your stream Id.
# Update a Stream
Source: https://docs.daydream.live/api/api-reference/update-stream
PATCH /v1/streams/{id}
Updates pipeline parameters for an existing video processing stream
Rate limit: 300 requests per minute.
This endpoint allows you to update pipeline parameters for an existing stream. You can modify prompts, ControlNet settings, IP Adapter configuration, and other generation parameters.
## Request Body Structure
```json theme={null}
{
"pipeline": "streamdiffusion",
"params": {
"model_id": "Lykon/dreamshaper-8",
"prompt": "new prompt",
// ... only include parameters you want to change
}
}
```
The `pipeline` field defaults to `"streamdiffusion"` if omitted, so you can just send `params` for most updates.
## Hot-Swap vs Reload Parameters
The following parameters can be updated dynamically (no reload required):
* `prompt`, `negative_prompt`
* `guidance_scale`, `delta`
* `num_inference_steps`, `t_index_list`
* `seed`
* `controlnets.conditioning_scale`
* `ip_adapter` settings
* `ip_adapter_style_image_url`
All other parameters trigger a full pipeline reload (\~30s).
## Example: Update Prompt
```bash theme={null}
curl -X PATCH \
"https://api.daydream.live/v1/streams/${STREAM_ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"params": {
"model_id": "Lykon/dreamshaper-8",
"prompt": "cyberpunk cityscape, neon lights"
}
}'
```
## Example: Adjust ControlNet Strength
```bash theme={null}
curl -X PATCH \
"https://api.daydream.live/v1/streams/${STREAM_ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"params": {
"model_id": "Lykon/dreamshaper-8",
"controlnets": [
{
"model_id": "lllyasviel/control_v11f1p_sd15_depth",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0.7,
"enabled": true
}
]
}
}'
```
For full parameter documentation, see the [Parameters](/api/parameters/SD15) section.
# API Keys
Source: https://docs.daydream.live/api/api_keys
Guide on generating API
To use the Daydream API, you need to provide an API key. Follow the steps below on how to generate one.
## Steps
Go to Daydream Playground and log in with your credentials. If you do not have an account, sign up for one and sign in.
Click on the button on the top left corner that say `> API Dashboard`.
Click on the `+ New API Key` button on the top right corner of the page
When the `+ New API Key` button is select, you will be prompted to name the API key. Provide the name for the api key and select the `Generate Key` button.
Copy the api key and select the `Done` button
Copy this key now. You will NOT be able to see this API key again.
Once you created the API key, you should see it added to the API Key's dashboard.
# Authentication
Source: https://docs.daydream.live/api/authentication
Authenticating with the Daydream API
The API uses Bearer token authentication. Include your API key in the Authorization header:
```
Authorization: Bearer YOUR_API_KEY
```
# Code Examples
Source: https://docs.daydream.live/api/code-examples
Ideas for using the Daydream API and SDKs
Here are some examples to inspire building your own applications.
## SDKs
Get started quickly with our official SDKs:
Server-side stream management with `@daydreamlive/sdk`
WebRTC broadcasting and playback with `@daydreamlive/browser`
Visual programming and VJ applications
Add AI effects to your OBS streams
## Browser SDK Examples
The Browser SDK includes working examples you can try immediately:
| Example | Description | Demo |
| ---------------------------------------------------------------------------------------------------------- | ------------------ | -------------------------------------------------------------------- |
| [with-react](https://github.com/daydreamlive/daydream-browser/tree/main/examples/with-react) | Basic React hooks | [Live Demo](https://daydream-browser-kohl.preview.livepeer.monster) |
| [with-compositor](https://github.com/daydreamlive/daydream-browser/tree/main/examples/with-compositor) | Canvas composition | [Live Demo](https://daydream-browser-zeta.preview.livepeer.monster) |
| [with-screen-share](https://github.com/daydreamlive/daydream-browser/tree/main/examples/with-screen-share) | Screen capture | [Live Demo](https://with-screen-share-lime.preview.livepeer.monster) |
| [with-three](https://github.com/daydreamlive/daydream-browser/tree/main/examples/with-three) | Three.js streaming | [Live Demo](https://with-three-git-main.preview.livepeer.monster) |
| [with-vanilla](https://github.com/daydreamlive/daydream-browser/tree/main/examples/with-vanilla) | Pure JS (no React) | — |
## Community Examples
An interactive WebGL-based fluid simulation built with React, TypeScript, and Vite. This demo showcases real-time fluid dynamics with customizable parameters and visual effects.
A React drawing canvas example with WebRTC streaming capabilities. This
example demonstrates a feature-rich drawing component with multiple tools,
recording capabilities, and real-time streaming support.
An AudioInput component system that captures microphone or demo audio, analyzes frequency levels in real-time, and renders audio-reactive visualizations to canvas for streaming applications.
## GitHub Repositories
* [daydream-typescript](https://github.com/daydreamlive/daydream-typescript) - TypeScript SDK
* [daydream-browser](https://github.com/daydreamlive/daydream-browser) - Browser SDK with React hooks
* [daydream-touchdesigner](https://github.com/daydreamlive/daydream-touchdesigner) - TouchDesigner plugin
* [daydream-obs](https://github.com/daydreamlive/daydream-obs) - OBS plugin
* [daydream-examples](https://github.com/daydreamlive/daydream-examples) - Community examples
# Introduction
Source: https://docs.daydream.live/api/introduction
Comprehensive API documentation for Daydream
# Daydream API
Get a free API key from the [Daydream Builder Dashboard](https://app.daydream.live/dashboard/api-keys?utm_source=docs\&utm_medium=tip\&utm_campaign=api_key_signup\&utm_content=introduction_tip)
Get an AI video stream up and running
Idea to app in 10 minutes
Welcome to the Daydream API documentation. This API enables seamless interaction, allowing you to create and manipulate live video streams, generate interactive audio experiences, and produce real-time AI-driven visuals. It is designed to give developers powerful tools for building immersive, dynamic, and engaging multimedia applications.
## Base URL
```
https://api.daydream.live
```
## Getting Started
The API is organized around REST principles and returns JSON responses. All endpoints are automatically documented below with interactive examples.
## Support
If you need help or have questions about the API, please:
* Check the [Quickstart](/api/quickstart) or the [API Reference](/api/api-reference/create-stream) section
* Explore our [SDKs](/sdks/overview) for TypeScript, Browser, TouchDesigner, and OBS
* Join our [Discord Community](https://discord.com/invite/5sZu8xmn6U)
# SD1.5
Source: https://docs.daydream.live/api/parameters/SD15
Information of SD15 parameter configuration
These are the parameters available when using the SD1.5 model.
## Available Controlet for only SD1.5
**SD1.5 Models** (`prompthero/openjourney-v4`):
* `lllyasviel/control_v11f1p_sd15_depth`: Depth-based guidance for spatial structure preservation
* `lllyasviel/control_v11f1e_sd15_tile`: Tile-based pattern control for texture preservation
* `lllyasviel/control_v11p_sd15_canny`: Canny edge detection for detailed outline preservation
## Available Parameters for only SD1.5
Parameters are **also** loaded with these values as default when creating a new stream on **this** specific pipeline.
```json theme={null}
{
"params": {
"seed": 789,
"delta": 0.7,
"width": 512,
"height": 512,
"prompt": "blooming flower",
"model_id": "Lykon/dreamshaper-8",
"lora_dict": null,
"ip_adapter": {
"scale": 0.5,
"enabled": true
},
"controlnets": [
{
"enabled": true,
"model_id": "lllyasviel/control_v11f1p_sd15_depth",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0,
"preprocessor_params": {}
},
{
"enabled": true,
"model_id": "lllyasviel/control_v11f1e_sd15_tile",
"preprocessor": "feedback",
"conditioning_scale": 0.1,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
}
],
"lcm_lora_id": "latent-consistency/lcm-lora-sdv1-5",
"acceleration": "tensorrt",
"do_add_noise": true,
"t_index_list": [5, 15, 32],
"use_lcm_lora": true,
"guidance_scale": 1,
"negative_prompt": "blurry, low quality, flat, 2d",
"num_inference_steps": 50,
"use_denoising_batch": true,
"normalize_seed_weights": true,
"normalize_prompt_weights": true,
"seed_interpolation_method": "linear",
"ip_adapter_style_image_url": "https://upload.wikimedia.org/wikipedia/commons/f/f0/Fractal_Xaos_psychedelic.png",
"enable_similar_image_filter": false,
"prompt_interpolation_method": "slerp",
"similar_image_filter_threshold": 0.98,
"similar_image_filter_max_skip_frame": 10
}
}
```
# SDTurbo
Source: https://docs.daydream.live/api/parameters/SDTurbo
Information of SDTurbo parameter configuration
These are the parameters available when using the SDTurbo model.
## Available Controlet for only SDTurbo
**SD2.1 Models** (`stabilityai/sd-turbo`):
* `thibaud/controlnet-sd21-openpose-diffusers`: Body and hand pose tracking to maintain human poses in the output
* `thibaud/controlnet-sd21-hed-diffusers`: Soft edge detection preserving smooth edges and contours
* `thibaud/controlnet-sd21-canny-diffusers`: Sharp edge preservation with crisp outlines and details
* `thibaud/controlnet-sd21-depth-diffusers`: Preserves spatial depth and 3D structure of objects and faces
* `thibaud/controlnet-sd21-color-diffusers`: Color composition passthrough to maintain palette and composition
## Available Parameters for only SDTurbo
Parameters are **also** loaded with these values as default when creating a new stream on **this** specific pipeline.
```json theme={null}
{
"params": {
"seed": 789,
"delta": 0.7,
"width": 512,
"height": 512,
"prompt": "Superman",
"model_id": "stabilityai/sd-turbo",
"lora_dict": null,
"controlnets": [
{
"enabled": true,
"model_id": "thibaud/controlnet-sd21-openpose-diffusers",
"preprocessor": "pose_tensorrt",
"conditioning_scale": 0.711,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "thibaud/controlnet-sd21-hed-diffusers",
"preprocessor": "soft_edge",
"conditioning_scale": 0.2,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "thibaud/controlnet-sd21-canny-diffusers",
"preprocessor": "canny",
"conditioning_scale": 0.2,
"preprocessor_params": {
"low_threshold": 100,
"high_threshold": 200
},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "thibaud/controlnet-sd21-depth-diffusers",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0.5,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "thibaud/controlnet-sd21-color-diffusers",
"preprocessor": "passthrough",
"conditioning_scale": 0.2,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
}
],
"lcm_lora_id": "latent-consistency/lcm-lora-sdv1-5",
"acceleration": "tensorrt",
"do_add_noise": true,
"t_index_list": [12, 20, 24],
"use_lcm_lora": true,
"guidance_scale": 1,
"negative_prompt": "blurry, low quality, flat, 2d",
"num_inference_steps": 25,
"use_denoising_batch": true,
"normalize_seed_weights": true,
"normalize_prompt_weights": true,
"seed_interpolation_method": "linear",
"enable_similar_image_filter": false,
"prompt_interpolation_method": "slerp",
"similar_image_filter_threshold": 0.98,
"similar_image_filter_max_skip_frame": 10
}
}
```
# SDXL
Source: https://docs.daydream.live/api/parameters/SDXL
Information of SDXL parameter configuration
These are the parameters available when using the SDXL model.
## Available Controlet for only SDXL
**SDXL Models** (`stabilityai/sdxl-turbo`):
* `xinsir/controlnet-depth-sdxl-1.0`: High-resolution depth guidance for SDXL models
* `xinsir/controlnet-canny-sdxl-1.0`: SDXL-optimized canny edge detection
* `xinsir/controlnet-tile-sdxl-1.0`: Tile-based control for SDXL texture generation
## Available Parameters for only SDXL
Parameters are **also** loaded with these values as default when creating a new stream on **this** specific pipeline.
```json theme={null}
{
"params": {
"seed": 789,
"delta": 0.7,
"width": 512,
"height": 512,
"prompt": "blooming flower",
"model_id": "stabilityai/sdxl-turbo",
"lora_dict": null,
"ip_adapter": {
"scale": 0.5,
"enabled": true
},
"controlnets": [
{
"enabled": true,
"model_id": "xinsir/controlnet-depth-sdxl-1.0",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0.4,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "xinsir/controlnet-canny-sdxl-1.0",
"preprocessor": "canny",
"conditioning_scale": 0.1,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "xinsir/controlnet-tile-sdxl-1.0",
"preprocessor": "feedback",
"conditioning_scale": 0.1,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
}
],
"acceleration": "tensorrt",
"do_add_noise": true,
"t_index_list": [5, 15, 32],
"use_lcm_lora": true,
"guidance_scale": 1,
"negative_prompt": "blurry, low quality, flat, 2d",
"num_inference_steps": 50,
"use_denoising_batch": true,
"normalize_seed_weights": true,
"normalize_prompt_weights": true,
"seed_interpolation_method": "linear",
"ip_adapter_style_image_url": "https://upload.wikimedia.org/wikipedia/commons/f/f0/Fractal_Xaos_psychedelic.png",
"enable_similar_image_filter": false,
"prompt_interpolation_method": "slerp",
"similar_image_filter_threshold": 0.98,
"similar_image_filter_max_skip_frame": 10
}
}
```
# SDXL FaceID
Source: https://docs.daydream.live/api/parameters/SDXL-turbo-faceid
Information of SDXL FaceID parameter configuration
These are the parameters available when using the SDXL Turbo FaceID model.
## Available Controlet for only SDXL Turbo FaceID
**SDXL Models** (`stabilityai/sdxl-turbo`):
* `xinsir/controlnet-depth-sdxl-1.0`: High-resolution depth guidance for SDXL models
* `xinsir/controlnet-canny-sdxl-1.0`: SDXL-optimized canny edge detection
* `xinsir/controlnet-tile-sdxl-1.0`: Tile-based control for SDXL texture generation
## Available Parameters for only SDXL Turbo FaceID
Parameters are **also** loaded with these values as default when creating a new stream on **this** specific pipeline.
```json theme={null}
{
"params": {
"seed": 789,
"delta": 0.7,
"width": 512,
"height": 512,
"prompt": "mona lisa, face-focused webcam portrait blooming into stained-glass prisms and aurora ribbons, retro studio glow, friendly cardigan vibes, dreamlike, cinematic, ultra-detailed",
"model_id": "stabilityai/sdxl-turbo",
"lora_dict": null,
"ip_adapter": {
"type": "faceid",
"scale": 1,
"enabled": true
},
"controlnets": [
{
"enabled": true,
"model_id": "xinsir/controlnet-depth-sdxl-1.0",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0.4,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "xinsir/controlnet-canny-sdxl-1.0",
"preprocessor": "canny",
"conditioning_scale": 0.1,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
},
{
"enabled": true,
"model_id": "xinsir/controlnet-tile-sdxl-1.0",
"preprocessor": "feedback",
"conditioning_scale": 0.1,
"preprocessor_params": {},
"control_guidance_end": 1,
"control_guidance_start": 0
}
],
"acceleration": "tensorrt",
"do_add_noise": true,
"t_index_list": [36],
"use_lcm_lora": true,
"guidance_scale": 1,
"negative_prompt": "blurry, low quality, flat, 2d",
"num_inference_steps": 50,
"use_denoising_batch": true,
"normalize_seed_weights": true,
"normalize_prompt_weights": true,
"seed_interpolation_method": "linear",
"ip_adapter_style_image_url": "https://ipfs.livepeer.com/ipfs/bafkreifyvsoa6pbt5r5ahedl6ann4nsp7m2vezkjuwn7uvxuqbie2un4wi",
"enable_similar_image_filter": false,
"prompt_interpolation_method": "slerp",
"similar_image_filter_threshold": 0.98,
"similar_image_filter_max_skip_frame": 10
}
}
```
# Quickstart
Source: https://docs.daydream.live/api/quickstart
Learn how to get a video stream up and running and apply some AI on it. New to live video or streaming concepts? Check out our [Streaming Basics](/api/streaming-basics/live-video) guide to learn how ingest, delivery, and playback work behind the scenes.
## Overview
This guide will take you through the process of sending video input to our StreamDiffusion pipeline. You will learn how to adjust parameters to create a variety of visual effects, utilize live streaming and audio interactivity features, generate real-time visuals, and view the resulting output video.
Our goal by the end is to have an effect that will transform a user into an [anime character](https://app.daydream.live/creators/ericxtang/anime-character-transformation) via their webcam.
## API Auth
The use of the API key is currently subsidized for a limited time, and we will provide an update on pricing in the future.
Get your API key from the [Daydream Dashboard](https://app.daydream.live/dashboard/api-keys). Keep it secure and never commit it to source control.
## Creating Your First App
Building on top of our StreamDiffusion pipeline consists of three parts:
1. Creating a `Stream` object (backend)
2. Sending in video and playing the output (frontend)
3. Setting StreamDiffusion parameters
***
## Using the SDKs
The easiest way to integrate Daydream is with our SDKs. Here's a full-stack example using the TypeScript SDK (backend) and Browser SDK (frontend).
### Backend: Create a Stream
Install the TypeScript SDK:
```bash theme={null}
npm install @daydreamlive/sdk
```
Create a stream with your API key:
```typescript theme={null}
// server.ts or Next.js Server Action
import { Daydream } from "@daydreamlive/sdk";
const daydream = new Daydream({
bearer: process.env.DAYDREAM_API_KEY,
});
export async function createStream() {
const stream = await daydream.streams.create({
pipeline: "streamdiffusion",
params: {
modelId: "stabilityai/sdxl-turbo",
prompt: "anime character",
},
});
return {
id: stream.id,
whipUrl: stream.whipUrl,
playbackId: stream.outputPlaybackId,
};
}
```
### Frontend: Broadcast & Play
Install the Browser SDK:
```bash theme={null}
npm install @daydreamlive/browser
```
Broadcast your webcam and play the AI output:
```typescript theme={null}
import { createBroadcast, createPlayer } from "@daydreamlive/browser";
// Get whipUrl from your backend
const { whipUrl } = await createStream();
// Get user's webcam
const stream = await navigator.mediaDevices.getUserMedia({
video: { width: 512, height: 512 },
});
// Start broadcasting
const broadcast = createBroadcast({ whipUrl, stream });
await broadcast.connect();
// The WHEP URL is available from the WHIP response header 'livepeer-playback-url'
// or access it from broadcast.whepUrl after connecting
const player = createPlayer(broadcast.whepUrl);
await player.connect();
player.attachTo(document.querySelector("video#output"));
```
The WHEP playback URL is returned in the WHIP response header `livepeer-playback-url`. The Browser SDK automatically captures this for you in `broadcast.whepUrl`.
For React apps, see the [React Hooks guide](/sdks/browser/react-hooks) for a complete example with `useBroadcast` and `usePlayer`.
***
## Alternative: Using cURL + OBS
If you prefer to use cURL and OBS instead of the SDKs, here's how:
### 1. Create a Stream
Available models:
* `stabilityai/sdxl-turbo` - SDXL, high quality (recommended)
* `stabilityai/sd-turbo` - SD2.1, fastest
* `Lykon/dreamshaper-8` - SD1.5, great for stylized effects
* `prompthero/openjourney-v4` - SD1.5, artistic style
```bash theme={null}
DAYDREAM_API_KEY=""
curl -X POST \
"https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "anime character"
}
}'
```
Response:
```json theme={null}
{
"id": "str_gERGnGZE4331XBxW",
"output_playback_id": "0d1crgzijlcsxpw4",
"whip_url": "https://ai.livepeer.com/live/video-to-video/stk_abc123/whip"
}
```
### 2. Stream with OBS
1. Install [OBS](https://obsproject.com/)
2. Go to **Settings → Stream**
3. Set Service to `WHIP` and paste the `whip_url`
4. Add a video source and click **Start Streaming**
5. Watch at: `https://lvpr.tv/?v=`
Or use the [Daydream OBS Plugin](/sdks/obs/installation) for built-in AI effects without needing to create streams manually.
***
## Update Parameters
Change the prompt or other settings in real-time:
```typescript TypeScript SDK theme={null}
await daydream.streams.update(streamId, {
pipeline: "streamdiffusion",
params: {
modelId: "stabilityai/sdxl-turbo",
prompt: "cyberpunk portrait, neon lights",
guidanceScale: 1.2,
},
});
```
```bash cURL theme={null}
curl -X PATCH \
"https://api.daydream.live/v1/streams/${STREAM_ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "cyberpunk portrait, neon lights",
"guidance_scale": 1.2
}
}'
```
You only need to include the parameters you want to change.
## Add ControlNets
ControlNets preserve structure from your input video:
```json theme={null}
{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "oil painting portrait",
"controlnets": [
{
"enabled": true,
"model_id": "xinsir/controlnet-depth-sdxl-1.0",
"preprocessor": "depth_tensorrt",
"conditioning_scale": 0.5
}
]
}
}
```
Set `conditioning_scale` to `0` to disable a ControlNet without triggering a pipeline reload.
### Available ControlNets
**SDXL Models** (`stabilityai/sdxl-turbo`):
* `xinsir/controlnet-depth-sdxl-1.0` - Depth guidance
* `xinsir/controlnet-canny-sdxl-1.0` - Edge detection
* `xinsir/controlnet-tile-sdxl-1.0` - Texture preservation
**SD1.5 Models** (`Lykon/dreamshaper-8`, `prompthero/openjourney-v4`):
* `lllyasviel/control_v11f1p_sd15_depth` - Depth
* `lllyasviel/control_v11f1e_sd15_tile` - Tile
* `lllyasviel/control_v11p_sd15_canny` - Canny edges
**SD2.1 Models** (`stabilityai/sd-turbo`):
* `thibaud/controlnet-sd21-depth-diffusers` - Depth
* `thibaud/controlnet-sd21-canny-diffusers` - Canny edges
* `thibaud/controlnet-sd21-openpose-diffusers` - Body poses
* `thibaud/controlnet-sd21-hed-diffusers` - Soft edges
* `thibaud/controlnet-sd21-color-diffusers` - Color composition
## What's Next?
* [TypeScript SDK](/sdks/typescript/installation) - Full server-side API
* [Browser SDK](/sdks/browser/installation) - WebRTC broadcasting
* [TouchDesigner Plugin](/sdks/touchdesigner/installation) - For VJ and creative apps
* [OBS Plugin](/sdks/obs/installation) - Add AI to OBS streams
* [Parameters Reference](/api/parameters/SDXL) - All available parameters
* [API Reference](/api/api-reference/create-stream) - Full API documentation
# Capability Map
Source: https://docs.daydream.live/api/reference/capability-map
Technical specifications for the Daydream API
| **StreamDiffusion** | **Aspect Ratio** |
| :-----------------: | :--------------: |
| SD-Turbo | 512x512 |
Using RTX 4090
| **Model** | **Denoising Step** | **FPS on Txt2Img** | **FPS on Img2Img** |
| :-------: | :----------------: | :----------------: | :----------------: |
| SD-Turbo | 1 | 106.16 | 93.897 |
# Glossary
Source: https://docs.daydream.live/api/reference/glossary
List of terms and definitions encountered in the documentation
# Glossary
| Term | Definition |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ControlNet | An enhancement for Stable Diffusion models that allows users to accurately steer image creation by providing extra input maps such as depth, pose, edges, or segmentation. |
| HLS | HLS (HTTP Live Streaming) is a streaming protocol developed by Apple that delivers audio and video over the internet by breaking media into small HTTP-based file segments listed in a playlist. |
| Model | A trained model is a mathematical system that has learned patterns from data, enabling it to make predictions or decisions on new inputs. After training adjusts and fine-tunes its internal settings, it can accurately perform specific tasks such as recognizing images or understanding text |
| Negative Prompt | A content filter is a mechanism that directs the AI model to avoid generating certain types of content. It acts as a safeguard, steering the output away from undesired material, styles, or features to help ensure the results remain appropriate and aligned with the intended goals. |
| Pipeline | A pipeline is a composable workflow that processes live video in real time using AI. Each stage in the pipeline performs a specific AI task—such as style transfer, object detection, or live translation—on the video stream in sequence. |
| Prompt | A prompt is a clear instruction that initiates the AI model’s response. It serves as the starting signal that tells the AI what task to perform or what type of output you want, guiding the direction of everything it generates. |
| Seed | A seed is a special number that determines the starting point for randomness in an AI’s image generation. Using the same seed with identical settings will produce the exact same image each time, ensuring that creative experiments can be repeated with consistent results. |
| StreamDiffusion | StreamDiffusion is a real-time image generation pipeline built for interactive and continuous image creation, especially in contexts where continuous input is expected—such as augmented reality, live streaming, and video game graphics—where maintaining high processing speed and throughput is essential. |
| TouchDesigner | TouchDesigner is a visual programming tool created by Derivative for building real-time, interactive multimedia experiences. It’s widely used by artists and designers to create installations, live performances, generative art, and immersive environments, with support for video, audio, and hardware integration. Its procedural, node-based workflow lets users design complex projects visually and see results instantly. |
| WebRTC | WebRTC (Web Real-Time Communication) is a technology that enables direct, peer-to-peer transmission of audio, video, and data between browsers or devices without requiring a server for the actual media flow. It’s optimized for low-latency, real-time communication such as video calls, live streaming, and interactive apps. |
| WHIP | WHIP (WebRTC-HTTP Ingestion Protocol) is a simple protocol for sending real-time media from a broadcaster to a media server using WebRTC over standard HTTP for signaling. It’s designed to make low-latency live streaming setups easier and more interoperable. |
# FFMpeg Installation
Source: https://docs.daydream.live/api/reference/installing-ffmpeg
How to check if FFMpeg is installed and install it if needed
This guide is ONLY necessary for users of StreamDiffusionTD
**Check if ffmpeg is installed:**
```bash theme={null}
ffmpeg -version
```
**Installation:**
**Windows**
1. Visit the [ffmpeg download page](https://www.gyan.dev/ffmpeg/)
2. Download the latest release build
3. Extract to `C:\ffmpeg`
4. Add `C:\ffmpeg\bin` to your system PATH
**macOS**
```bash theme={null}
# Using Homebrew
brew install ffmpeg
# Using MacPorts
sudo port install ffmpeg
```
**Linux (Ubuntu/Debian)**
```bash theme={null}
sudo apt update
sudo apt install ffmpeg
```
# Delivery and Outputs
Source: https://docs.daydream.live/api/streaming-basics/delivery-outputs
Learn how to deliver and output video from Daydream
# What is Delivery and Outputs?
Delivery is the mechanism that transports your livestream from the server to the viewers watching the stream.
The platform takes the ingested stream and sends it to viewers at scale
using **CDNs** (Content Delivery Networks) with servers around the world
and handles **transcoding** (creating multiple quality versions)
along with optimizing routing to get video to viewers quickly.
### Why This Matters
After you create your AI-generated stream in Daydream, there's one more important decision: how will you get it to your viewers?
Think of it like choosing how to deliver a package. You could use overnight express shipping (fast but expensive) or standard shipping (slower but handles more volume). With streaming, you're choosing between speed and scale.
## WHEP Output (Low Latency)
**WHEP** (WebRTC HTTP Egress Protocol) is designed for ultra-low latency streaming — typically under 1 second of delay.
How it works:
Uses WebRTC technology (the same technology used for video calls)
creates direct peer-to-peer-style connections between your stream and viewers.
Data travels quickly with minimal buffering.
| **Best For** | **Trade-offs** |
| -------------------------------------------------------- | ------------------------------------------------------------------- |
| Live auctions or betting where every second counts | Smaller audience capacity (harder to scale to thousands of viewers) |
| Interactive streams (gaming, live Q\&A, reactions) | Requires more server resources per viewer |
| Video conferencing or webinar-style broadcasts | Less compatible with traditional CDNs |
| Real-time collaboration where immediate feedback matters | May have more connection stability issues on poor networks |
## HLS Output (CDN Distribution)
**HLS** (HTTP Live Streaming) is the industry standard for scalable, reliable delivery to large audiences.
How it works:
Breaks your stream into small video chunks (typically 2-10 seconds each)
Distributes these chunks across CDN (Content Delivery Network) servers worldwide
Viewers download and play chunks sequentially
| **Best For** | **Trade-offs** |
| -------------------------------------------------- | -------------------------------------------------------------------------------- |
| Large-scale events (concerts, conferences, sports) | Higher latency (typically 10-30 seconds delay) |
| On-demand playback and DVR features | Not suitable for real-time interaction |
| Mobile apps and broad device compatibility | The chunked nature means slight quality adjustments as network conditions change |
## Choosing the right output
| **WHEP** | **HLS** |
| --------------------------------------------------------- | --------------------------------------------------------------------- |
| Latency under 2 seconds is critical | You need to reach a large audience (thousands or millions of viewers) |
| You have a smaller, engaged audience (dozens to hundreds) | A few seconds of delay won't impact the experience |
| Interaction is a key part of the experience | You want maximum device/platform compatibility |
| You're okay with higher infrastructure costs per viewer | Reliability and scale matter more than instant feedback |
## API Examples
### Create a Output with WHEP
WHEP output is provided when you create a stream with the Daydream API. The `output_playback_id` provided in the response is used to pull the stream from Daydream.
### How It Works
```mermaid theme={null}
graph LR
OBS[OBS] -->|WHIP| Daydream[Daydream
AI Proc]
Daydream -->|WHEP
Pulling from Daydream| Client[Your Client
Browser/App]
```
Make sure to keep your API Key safe and secure and not exposed to the public
```bash Curl Example theme={null}
# Step 1: Create a Daydream stream
DAYDREAM_API_KEY=""
RESPONSE=$(curl -s -X POST "https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sd-turbo",
"prompt": "a serene mountain landscape at sunset"
}
}')
echo "=== Daydream Response ==="
echo $RESPONSE | jq '.'
PLAYBACK_ID=$(echo $RESPONSE | jq -r '.output_playback_id')
echo "=== Playback ID ==="
echo $PLAYBACK_ID
# Debug: See the full Livepeer response
echo "=== Livepeer Response ==="
LIVEPEER_RESPONSE=$(curl -s "https://livepeer.studio/api/playback/${PLAYBACK_ID}")
echo $LIVEPEER_RESPONSE | jq '.'
# Use the URL for under the WebRTC source
{
"type": "live",
"meta": {
"live": 0,
"source": [
{
"hrn": "WebRTC (H264)",
"type": "html5/video/h264",
"url": "https://livepeercdn.studio/webrtc/8a5eiih6kev07buv"
},
]
}
}
```
```javascript JavaScript Example theme={null}
// Step 1: Create a Daydream stream
const DAYDREAM_API_KEY = "";
async function createDaydreamStream() {
try {
// Create the stream
const response = await fetch("https://api.daydream.live/v1/streams", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${DAYDREAM_API_KEY}`
},
body: JSON.stringify({
pipeline: "streamdiffusion",
params: {
model_id: "stabilityai/sd-turbo",
prompt: "a serene mountain landscape at sunset"
}
})
});
const data = await response.json();
console.log("=== Daydream Response ===");
console.log(JSON.stringify(data, null, 2));
const playbackId = data.output_playback_id;
console.log("=== Playback ID ===");
console.log(playbackId);
// Get Livepeer playback information
console.log("=== Livepeer Response ===");
const livepeerResponse = await fetch(
`https://livepeer.studio/api/playback/${playbackId}`
);
const livepeerData = await livepeerResponse.json();
console.log(JSON.stringify(livepeerData, null, 2));
// Extract WebRTC URL
const webrtcSource = livepeerData.meta?.source?.find(
s => s.hrn === "WebRTC (H264)"
);
if (webrtcSource) {
console.log("=== WebRTC URL ===");
console.log(webrtcSource.url);
return webrtcSource.url;
}
} catch (error) {
console.error("Error:", error);
}
}
// Run the function
createDaydreamStream();
```
### Create a Output with HLS
HLS output is provided when you create a stream with the Daydream API. The `output_playback_id` provided in the response is used to pull the stream from Daydream for scalable CDN distribution.
### How It Works
```mermaid theme={null}
graph LR
OBS[OBS] -->|WHIP| Daydream[Daydream
AI Proc]
Daydream -->|HLS
Pulling from Daydream| Client[Your Client
Browser/App]
```
Make sure to keep your API Key safe and secure and not exposed to the public
```bash Curl Example theme={null}
# Step 1: Create a Daydream stream
DAYDREAM_API_KEY=""
RESPONSE=$(curl -s -X POST "https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sd-turbo",
"prompt": "a serene mountain landscape at sunset"
}
}')
echo "=== Daydream Response ==="
echo $RESPONSE | jq '.'
PLAYBACK_ID=$(echo $RESPONSE | jq -r '.output_playback_id')
echo "=== Playback ID ==="
echo $PLAYBACK_ID
# Debug: See the full Livepeer response
echo "=== Livepeer Response ==="
LIVEPEER_RESPONSE=$(curl -s "https://livepeer.studio/api/playback/${PLAYBACK_ID}")
echo $LIVEPEER_RESPONSE | jq '.'
# Use the URL for under the HLS source
{
"type": "live",
"meta": {
"live": 0,
"source": [
{
"hrn": "HLS (TS)",
"type": "html5/application/vnd.apple.mpegurl",
"url": "https://livepeercdn.studio/hls/8a5eiih6kev07buv/index.m3u8"
},
]
}
}
```
```JavaScript JavaScript Example theme={null}
// Step 1: Create a Daydream stream
const DAYDREAM_API_KEY = "";
async function createDaydreamStream() {
try {
// Create the stream
const response = await fetch("https://api.daydream.live/v1/streams", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${DAYDREAM_API_KEY}`
},
body: JSON.stringify({
pipeline: "streamdiffusion",
params: {
model_id: "stabilityai/sd-turbo",
prompt: "a serene mountain landscape at sunset"
}
})
});
const data = await response.json();
console.log("=== Daydream Response ===");
console.log(JSON.stringify(data, null, 2));
const playbackId = data.output_playback_id;
console.log("=== Playback ID ===");
console.log(playbackId);
// Get Livepeer playback information
console.log("=== Livepeer Response ===");
const livepeerResponse = await fetch(
`https://livepeer.studio/api/playback/${playbackId}`
);
const livepeerData = await livepeerResponse.json();
console.log(JSON.stringify(livepeerData, null, 2));
// Extract HLS URL
const hlsSource = livepeerData.meta?.source?.find(
s => s.hrn === "HLS (TS)"
);
if (hlsSource) {
console.log("=== HLS URL ===");
console.log(hlsSource.url);
return hlsSource.url;
}
} catch (error) {
console.error("Error:", error);
}
}
// Run the function
createDaydreamStream();
```
### Create a Output with RTMP
Using Streaming Platforms to deliver your stream.
You are only able to change the `output_playback_id` when creating a **NEW**
stream. You cannot change it on an existing stream.
Make sure to keep your API Key safe and secure and not exposed to the public
```bash YouTube Example theme={null}
curl -X POST \
"https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer " \
-d '{
"pipeline": "streamdiffusion",
"output_rtmp_url": "rtmp://a.rtmp.youtube.com/live2/",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "a serene mountain landscape at sunset"
}
}'
```
```bash Twitch Example theme={null}
curl -X POST \
"https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer " \
-d '{
"pipeline": "streamdiffusion",
"output_rtmp_url": "rtmp://ingest.global-contribute.live-video.net/app/",
"params": {
"model_id": "stabilityai/sdxl-turbo",
"prompt": "a serene mountain landscape at sunset"
}
}'
```
### How It Works
```mermaid theme={null}
graph LR
OBS[OBS] -->|WHIP| Daydream[Daydream
AI Proc]
Daydream -->|RTMP
Pushing from Daydream| RTMP[RTMP Server
YouTube/etc]
```
# Ingest Guide
Source: https://docs.daydream.live/api/streaming-basics/ingest-guide
Learn how to send video into Daydream
# What is Ingest?
Think of ingest as the pathway that livestreams passes through to reach the internet.
## Why do we need ingest?
Your video needs to get to a platform (like Twitch, YouTube, or Facebook) somehow! The ingest server is the platform's receiving point. It accepts your stream, processes it, and then distributes it to all your viewers.
The key term you'll see:
**Ingest URL** : The specific address where you send your stream.
When you create a stream with the Daydream API, you'll receive an ingest URL in the response that looks like the following.
Example:
```json theme={null}
{
"whip_url": "https://ai.livepeer.com/live/video-to-video//whip"
}
```
## How to Ingest
When you go live, your camera and microphone capture video and audio. Your streaming software (like OBS, Streamlabs, or built-in apps) takes that content and sends it to an ingest server - basically a computer that receives your stream.
### Web Browser Method
Don't forget to replace `` with your own.
Create a stream using the Daydream API.
```bash curl theme={null}
# Available models:
# - stabilityai/sd-turbo: Fast generation with SD-turbo (default)
# - stabilityai/sdxl-turbo: High-quality with SDXL-turbo
# - Lykon/dreamshaper-8: Stable Diffusion 1.5 for more control
# - prompthero/openjourney-v4: SD1.5 with artistic style
curl -X POST \
"https://api.daydream.live/v1/streams" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer " \
-d '{
"pipeline": "streamdiffusion",
"params": {
"model_id": "stabilityai/sd-turbo"
}
}'
```
```javascript JavaScript theme={null}
// Available models:
// - stabilityai/sd-turbo: Fast generation with SD-turbo (default)
// - stabilityai/sdxl-turbo: High-quality with SDXL-turbo
// - Lykon/dreamshaper-8: Stable Diffusion 1.5 for more control
// - prompthero/openjourney-v4: SD1.5 with artistic style
const response = await fetch('https://api.daydream.live/v1/streams', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer '
},
body: JSON.stringify({
pipeline: 'streamdiffusion',
params: {
model_id: 'stabilityai/sd-turbo'
}
})
});
const data = await response.json();
console.log(data);
```
Don't forget to replace `` with your own.
```JavaScript JS Snippet theme={null}