diffusers>=0.19.0 accelerate>=0.20.0 torch>=2.0.0 torchvision>=0.15.0 tqdm>=4.65.0 Pillow>=9.0.0 transformers>=4.30.0 safetensors>=0.3.1 requests>=2.25.0


A ComfyUI implementation of Latent Bridge Matching (LBM) for efficient image relighting. This node utilizes the LBM algorithm to perform single-step image-to-image translation specifically for relighting tasks.
Added Depth/Normal map generation support
ComfyUI/custom_nodes directory:cd ComfyUI/custom_nodes
git clone https://github.com/1038lab/ComfyUI-LBM.git
cd ComfyUI/custom_nodes/ComfyUI-LBM
pip install -r requirements.txt
The models will be automatically downloaded and renamed on first use, or you can manually download them:
| Model | Description | Link |
| —– | ———– | —- |
| LBM Relighting | Main model for image relighting | Download |
| LBM Depth | Model for depth map generation | Download |
| LBM Normals | Model for normal map generation | Download |
After downloading, place the model files in your ComfyUI/models/diffusion_models/LBM directory.
🧪AILab/🔆LBM categoryLBM_relighting.safetensors)🧪AILab/🔆LBM category| Parameter | Description | Default | Range |
| ——— | ———– | ——- | —– |
| Model | The LBM model file to use | LBM_relighting.safetensors | – |
| Steps | Number of inference steps | 28 | 1-100 |
| Precision | Inference precision | bf16 | fp32, bf16, fp16 |
| Bridge Noise Sigma | Controls diversity of results | 0.005 | 0.0-0.1 |
| Parameter | Description | Default | Range |
| ——— | ———– | ——- | —– |
| Task | Select task type | depth | depth, normal |
| Steps | Number of inference steps | 28 | 1-100 |
| Precision | Inference precision | bf16 | fp32, bf16, fp16 |
| Bridge Noise Sigma | Controls diversity of results | 0.1 | 0.0-0.1 |
| Mask | Optional mask for selective processing | None | – |
| Setting | Recommendation |
| ——- | ————– |
| Steps | For most images, 20-30 steps provides a good balance between quality and speed |
| Input Resolution | The model works best with images of 512×512 or higher resolution |
| Memory Usage | If you encounter memory issues, try using fp16 precision or processing images at a lower resolution |
| Performance | For batch processing, consider reducing steps to 15-20 for faster throughput |
| Bridge Noise Sigma | Lower values (0.005) for relighting, higher values (0.1) for depth/normal maps |
This implementation uses the Latent Bridge Matching (LBM) method from the paper “LBM: Latent Bridge Matching for Fast Image-to-Image Translation”. The model is designed for fast image relighting, transforming the lighting of objects in an image.
LBM offers:
The model is trained on a diverse dataset of images with different lighting conditions, ensuring:
Future plans for this repository include:
This repository’s code is released under the GNU General Public License v3.0 (GPL-3.0).
The LBM model itself is released under the Creative Commons BY-NC 4.0 license, following the original LBM implementation. Please refer to the original repository for more details on model usage restrictions.