Skip to main content
Turn your camera feed into a watercolor painting or change the scene with a text instruction. In this example, you’ll deploy JoyAI-Video-Edit on one B200 and run a browser client that shows your camera beside the edited video.
Screenshot of the upstream JoyAI demo showing three people on camera beside their cartoon-style edited video.

Source camera and cartoon-style output from the upstream JoyAI-Video-Edit demo.

Demo from JoyAI-Video-Edit.

Key facts

The benchmark measures inference, not camera-to-screen latency. Output playback adapts to inference throughput.

What the app does

The client publishes its camera, sets an instruction, and sends start. The model reads incoming frames in chunks and sends back edited frames without waiting for a complete video. It takes the newest camera frames and drops older queued frames so input does not build up behind inference. Each run keeps one instruction, reference image, and seed. To change the edit, send reset, set the new instruction, and send start again. The camera stays connected throughout.

Requirements

  • A Reactor account with Serve access, remote builds, and capacity for one B200 and a project configured by Reactor with a 128 GiB host-memory limit.
  • The Reactor CLI and Git.
  • A browser with a camera, Node.js 22.12 or later, and pnpm for the client.
  • An API key for the account that owns the deployment.
No local GPU or Docker installation is needed for this remote deployment. The cookbook’s compiled kernels target Blackwell datacenter GPUs; keep the B200 configuration for this example.

1. Prepare the project

Sign in and clone the cookbook:
Terminal
In reactor.yaml, change model.name to your-org/joy-video-edit. Replace your-org with your account or team slug. Keep the rest of the manifest unchanged. Create the project before arranging its host-memory allocation:
Terminal
Ask your Reactor contact to configure a 128 GiB host-memory limit for this project before deploying. Checkpoint loading peaks at about 63 GB in the cookbook’s tests, above the default 32 GiB limit. The projects CLI does not apply the cookbook’s model.resources.memory settings.

2. Deploy the editor

Deploy one B200 instance with enough host memory to load the checkpoint:
Terminal
The CLI builds the image remotely and deploys it to production with the project’s configured resources. Wait for the deployment to become ready. In another terminal, from the same model directory, follow startup:
Terminal
The first start includes checkpoint downloads and warmup. Keep this deployment running while you test the client.

3. Edit your camera stream

Download the browser client and unzip it. In a separate terminal, open the extracted folder:
Terminal
Set your API key and the model name from reactor.yaml in .env:
.env
Start the client:
Terminal
Open the local URL printed in the terminal. Select Connect and edit and allow camera access. Your camera appears on the left; the edited video follows on the right. The local server creates a session token for your model. Your API key stays on the server.

Try a different edit

Move in front of the camera and check that the edited video follows you. Change the instruction to “Make everything sepia” and select Apply new edit. The camera stays connected while the model starts a new run with that instruction. The status line reports chunk_complete messages with the frame count and processing time. A run begins with one frame, then usually produces eight per chunk. Its timing measures model processing, not the full trip from camera to screen.

How the client works

The starter includes the UI, token endpoint, and connection cleanup. These are the SDK calls that connect the camera to the model.

Connect and publish the camera

The local /api/session endpoint returns a model-scoped token and model name. connect() waits until the session is ready before the client publishes its camera:
Connect and publish (selected calls)
For an app you share, put the token endpoint on your server and authenticate its callers. See Authentication.

Start an edit and change the instruction

The model snapshots the instruction when a run starts. The starter checks replies before sending the next command:
Start an edit
Apply new edit ends the current run, updates the instruction, and starts again:
Change the edit
reset has no reply payload. Sending set_prompt alone updates the next run, not the active one.

How the model runs

This recipe includes a custom Dockerfile. It installs CUDA 13.2.1, Python 3.12, PyTorch 2.14.0, and Reactor Runtime 3.6.0, then compiles the model’s CUDA kernels. reactor deploy builds this Dockerfile remotely. The manifest connects the image to the application and its configuration:
reactor.yaml (selected settings)
Keep the cookbook’s Dockerfile, runtime version, and checkpoint pins unchanged. The recipe uses joyai_video_edit_dit_0811.pth. The Dockerfile’s RUNTIME_VERSION must match build.runtime_version. Recording is disabled because encoding a recording on the model’s GPU reduces inference throughput. At startup, the model downloads its pinned checkpoints and runs warmup sessions that capture its CUDA graphs. The CLI waits for the model to finish startup and become ready.

Process camera frames

The application reads camera frames and handles client commands. The model class loads weights and edits each chunk. These excerpts show how the two connect; the full implementation is in the cookbook. The names in these declarations are the names the client publishes and receives:
joy_video_edit_types.py (selected declarations)
process_input() waits for start and enough camera frames, then captures the inputs for one inference call. generate() passes that input to the model:
joy_video_edit.py (generate)
After inference, process_output() reports progress before publishing the frames:
joy_video_edit.py (inside process_output)
The method also updates its counters and returns JoyVideoEditOutput(main_video=result.frames). The runtime streams those frames to the client on main_video.

Add a reference image

To guide the appearance as well as the instruction, add a file input to the client. With the session connected, upload the selected PNG or JPEG before starting a new run:
Apply a reference image
Here, file is the browser File from your input. The reference stays selected across resets until you replace it. The client contract also covers seed controls, progress messages, and command errors.

Stop the deployment

Select Disconnect to end the session and release the camera. Then, from the cookbook model directory, stop the GPU instance:
Terminal
  • Startup takes a while: follow reactor logs production --follow for checkpoint downloads, model loading, and warmup. A CLI wait timeout does not stop startup.
  • Model loading runs out of host memory: contact Reactor to check the host-memory allocation for your B200 deployment.
  • The client cannot connect: check the API key and qualified model name in .env, then restart pnpm dev.
  • The camera works but no edited video appears: check the browser console and model logs. The model needs both a published camera track and start.
  • A command returns already_generating: reset the active run before starting another run or setting a reference image.