Skip to main content

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 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.
The API uses Bearer auth. Include an Authorization header on every request:
Authorization: Bearer <YOUR_API_KEY>
Keep your API keys secure. Do not commit them to source control or share them publicly.

API Documentation

The full API reference is available in the sidebar and contains more in-depth descriptions of all parameters.

Creating Your First App

Building on top of our StreamDiffusion pipeline consists of three parts:
  1. Creating a Stream object
  2. Sending in video and playing the output
  3. Setting StreamDiffusion parameters

1. Create a Stream

First, we need to create a ‘Stream’ object. This will provide us with an input URL (to send in video) and an output URL (to play back the modified video). A ‘Stream’ object can be reused as many times as you like, so there’s no need to create one each time you want to send it a new video input.
All examples use Bash so you can copy/paste into a terminal.

Create Stream Request

We’re going to create a stream that uses the SD1.5 pipeline, which is great for cartoon effects.
When specifying the pipeline_id, it also needs to match the right model_id.Ex. pip_SD-turbo corresponds to stabilityai/sd-turbo
# Choose your AI video processing pipeline:
# - pip_SD-turbo: Fast generation with SD-turbo (default)
# - pip_SDXL-turbo: High-quality with SDXL-turbo  
# - pip_SD15: Stable Diffusion 1.5 for more control
# - pip_SDXL-turbo-faceid: SDXL with face identity with ipAdapters
PIPELINE_ID="pip_SD15"

# Change this to the API key you generated
DAYDREAM_API_KEY="<YOUR_API_KEY>"

curl -X POST \
  "https://api.daydream.live/v1/streams" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
  -d "{\"pipeline_id\":\"${PIPELINE_ID}\"}"

Create Stream Response

The response contains a lot of information about the default pipeline parameters, which we’ve omitted here to make the IDs that we care about more obvious
{
  "id": "str_gERGnGZE4331XBxW",
  "output_playback_id": "0d1crgzijlcsxpw4",
  "whip_url": "https://ai.livepeer.com/live/video-to-video/stk_abc123/whip"
}

2. Send video and play the output

Now we’ll start sending in video and view the processed output.
  1. Install OBS.
  2. Copy the whip_url from the Create Stream response.
  3. In OBS → Settings → Stream: choose WHIP as the Service and paste the whip_url as the Server. Leave the Bearer Token blank and save the settings.
  4. Under the Sourcessection, add a video source for the stream.(Ex: Video Capture Device )
  5. Under the Controls section, select Start Streaming to start the stream.
  6. Copy the output_playback_id from the Create Stream response and open: https://lvpr.tv/?v=<your output_playback_id>
  7. You should now see your output video playing! In the next step, we’ll learn how to tweak the model parameters to make it look even better. Streaming into Daydream via OBS
Prefer to use your own player?
  1. Fetch playback URLs from Livepeer Studio’s Playback endpoint: curl "https://livepeer.studio/api/playback/<your playback id>"
  2. Choose either the HLS or WebRTC endpoint.
  3. Configure your chosen player with that URL.
Want to understand the differences between Studio, WHEP, and RTMP output? See Playback Options for guidance on low-latency playback, large-audience distribution, and alternative players (OvenPlayer, Eyevinn, etc.).

3. Set StreamDiffusion parameters

Now that we have our basic AI streaming working, it’s time to tweak the parameters to get the anime effect that we want. We’ve included a suggested set of parameters below, but feel free to browse the Discover page to find more. Once you find one that you like, click to try it out in the Playground and then use the “Inspect Params” button in the bottom right of the screen to copy them. Screenshot2025 12 10at12 23 23 Pn Send a PATCH to https://api.daydream.live/v1/streams/<YOUR_STREAM_ID> to update your video with the new parameters.
Here we’ve included lots of parameters for completeness, but you only need to include the parameters you want to change.

Example PATCH Request

# Update stream parameters
STREAM_ID="<YOUR_STREAM_ID>"
DAYDREAM_API_KEY="<YOUR_API_KEY>"

curl -X PATCH \
  "https://api.daydream.live/v1/streams/${STREAM_ID}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
  -d '{
  "params": {
    "seed": 42,
    "delta": 0.7,
    "width": 512,
    "height": 512,
    "prompt": "anime character",
    "model_id": "Lykon/dreamshaper-8",
    "lora_dict": null,
    "ip_adapter": {
      "type": "regular",
      "scale": 1.3,
      "enabled": true,
      "weight_type": "linear"
    },
    "controlnets": [
      {
        "enabled": true,
        "model_id": "lllyasviel/control_v11f1p_sd15_depth",
        "preprocessor": "depth_tensorrt",
        "conditioning_scale": 0.57,
        "preprocessor_params": {}
      },
      {
        "enabled": true,
        "model_id": "lllyasviel/control_v11f1e_sd15_tile",
        "preprocessor": "feedback",
        "conditioning_scale": 0.1,
        "preprocessor_params": {
          "feedback_strength": 0.5
        }
      },
      {
        "enabled": true,
        "model_id": "lllyasviel/control_v11p_sd15_canny",
        "preprocessor": "canny",
        "conditioning_scale": 0.37,
        "preprocessor_params": {
          "low_threshold": 100,
          "high_threshold": 200
        }
      }
    ],
    "lcm_lora_id": "latent-consistency/lcm-lora-sdv1-5",
    "acceleration": "tensorrt",
    "do_add_noise": true,
    "t_index_list": [
      11,
      17
    ],
    "use_lcm_lora": true,
    "guidance_scale": 1,
    "negative_prompt": "blurry, low quality, flat, 2d",
    "use_safety_checker": true,
    "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://clips.t3.storage.dev/style-images/user_2zRW3v8fIkeaSlyDhmBMgfaDNNf/1764305635434-exv2oc5fcwl.png",
    "enable_similar_image_filter": false,
    "prompt_interpolation_method": "linear",
    "similar_image_filter_threshold": 0.98,
    "similar_image_filter_max_skip_frame": 10
  }
}'
IP Adapter Availability: IP adapters for style conditioning are only available for SD1.5 (prompthero/openjourney-v4), SDXL (stabilityai/sdxl-turbo), and SDXL-faceid models. They are not supported by SD2.1 models like stabilityai/sd-turbo.Base64 for IP Adapter image input is also supported.
If this call is successful, you should see your output update and start looking something like this: Screenshot2025 12 10at12 26 24 Pn

What’s Next?

Now that you have the basic creation, streaming and update flow working, you can begin to experiment with the various parameters and advanced features.

Parameter change examples

Experiment with any of the parameters. A few useful ones:
ParameterDescription
promptGuides the model toward a desired visual style or subject.
negative_promptTells the model what not to produce (e.g., discourages low quality, flat, blurry results).
num_inference_stepsHigher values improve quality at the cost of speed/FPS.
seedEnsures reproducibility across runs. Change it to introduce variation.

ControlNets

ControlNets guide image generation by providing extra structural inputs (poses, edges, depth maps, colors) that help the model interpret the input video. They impact performance differently, so experiment with which ones to enable for your use case.
Don’t toggle the enabled field to turn ControlNets on/off, as it currently triggers a pipeline reload. Set conditioning_scale to 0 to effectively disable a ControlNet, or raise it above 0 to enable its influence.
To enable a ControlNet, increase its conditioning_scale:
{
  "conditioning_scale": 0.22,
  "control_guidance_end": 1,
  "control_guidance_start": 0,
  "enabled": true,
  "model_id": "thibaud/controlnet-sd21-openpose-diffusers",
  "preprocessor": "pose_tensorrt",
  "preprocessor_params": {}
}
Available ControlNets by model type: 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
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
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

What’s Next?

Now that your first stream is running, explore: