> This page is for NVIDIA Relighting NIM, version 1.2.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 1.2.0 (Latest) (default): https://docs.nvidia.com/nim/maxine/relighting/1.2.0/llms.txt
> - 1.1.0: https://docs.nvidia.com/nim/maxine/relighting/1.1.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nim/maxine/llms.txt.

# Overview

Relighting is an AI-powered service that applies lighting effects to videos using HDR environment maps. The service processes input video and applies AI-based relighting to generate output video with customizable lighting conditions, enabling dynamic lighting changes on video subjects.

## Key Features

- **HDR Environment Lighting:** Supports five built-in HDR presets (Lounge, Cobblestone Street Night, Glasshouse Interior, Little Paris Eiffel Tower, Wooden Studio) and custom HDR environment map files.
- **Background Modes:** Three background compositing options: source video, custom image, and HDR projection.
- **Effect Parameters:** Foreground relighting gain, and background relighting gain when the background is the HDR projection.
- **Streaming and Transactional Modes:** Streaming mode returns a fragmented MP4 (fMP4) for progressive playback; transactional mode, for inputs that are not streamable, returns a regular MP4.
- **Configurable Output:** Customizable video bitrate, IDR interval, and encoding options.

## Architecture

Relighting service is built on NVIDIA's software platform:

- **CUDA** for GPU-accelerated processing.
- **TensorRT** for optimized neural network inference.
- **Triton Inference Server** for efficient model serving and scaling.

The system uses a composite architecture with multiple deep learning models working together:

1. **Frame feature extraction and segmentation** — Convolutional Neural Networks (CNNs) analyze each input video frame.
2. **Foreground/background separation** — AI Green Screen (AIGS) segmentation models isolate the subject from the background.
3. **HDR environment lighting** — Relighting projection models apply the selected HDR environment map to the separated foreground.
4. **Compositing** — The relit foreground is combined with the selected background mode (source video, custom image, or HDR projection).

The service maintains frame-accurate processing, keeps the input's audio track, and re-encodes the video to H.264 at the bitrate you choose, making it ideal for content creation, virtual production, and video post-processing applications.

## Input Modes

Relighting supports two modes of operation:

- Transactional Mode

  In this mode, the whole input video is uploaded to the NIM before the inference begins. The inference is run on the input file to obtain the output video, which is then sent back to the client. Suitable for small files, applications that can wait for complete processing, and non-streamable input videos.

- Streaming Mode

  In this mode, the input video is streamed to the NIM in chunks. As the chunks arrive, NIM runs inference incrementally and streams the output back to client in chunks, even before the whole input file is received by the NIM. The server automatically selects streaming mode when the input video is streamable (indicated by MP4 metadata at the start of the file). Preferred for large files.

For more details, refer to the [Input Modes](/nim/maxine/relighting/basic-inference#input-modes) section of Basic Inference.