The Ultimate Image Enhancement Tool: A Deep Dive into LBM Relighting Workflow

CN
ComfyUI.org
2025-05-21 08:39:47

Unlock stunning image relighting with our LBM workflow! Discover how to separate subjects, adjust physics-based lighting, and automate masking & composition. Get started with our easy-to-follow guide and transform your images today!

Models
Flux
VRAM
Low VRAM (≤8GB)
Reading Time
3 min
View Required Models

Workflow Overview

Unlock stunning image relighting with our LBM workflow! Discover how to separate subjects, adjust physics-based lighting, and automate masking & composition. Get started with our easy-to-follow guide and transform your images today!

Content type: Workflow

Primary intent: Download

Required Models

  • Flux

Setup Notes

  • Install the required models before opening the workflow template.
  • Recommended hardware: Low VRAM (≤8GB).

1. Workflow Overview

maxoz2ciiwdeusjun89f814a5f94c5bf37b21abc7e3c7967521bf30050a444045ceb016688f5e318b9.png

This workflow specializes in image relighting using LBM (Lighting Balance Model) to modify illumination conditions. Key features:

  • Subject/background separation

  • Physics-based lighting adjustment

  • Automated masking & composition

2. Core Models

  • LBM_relighting.safetensors: Main model (download from HuggingFace)

  • TransparentBG: Background removal (base version)

  • ImageResizeKJv2: Intelligent resizing algorithm

3. Critical Nodes

Node

Function

Installation

LoadLBMModel

Loads LBM relighting model

Manual plugin install

LBMSampler

Performs lighting sampling

Bundled with LBM plugin

ImageCompositeMasked

Mask-aware composition

Built-in

4. Processing Pipeline

Phase 1: Input Preparation

  • Dual input channels:

    • Subject: image__00038_ (1).png (832x1216)

    • Background: 00141-338031962.png (1024x1024)

  • Resolution normalization via ImageResizeKJv2

Phase 2: Background Processing

  • TransparentBGSession+ creates removal session

  • ImageRemoveBackground+ generates alpha mask

Phase 3: Relighting

  1. Load LBM model (bf16 precision)

  2. 20-step lighting adjustment with LBMSampler

  3. Masked composition (ImageCompositeMasked)

Phase 4: Output

  • Real-time preview (PreviewImage)

  • Auto-saved results (path: LBM%date:yyyy-MM-dd%\Flux-)

5. I/O Specifications

  • Input Requirements:

    • Subject: PNG with alpha channel recommended

    • Background: Resolution ≥1024x1024

  • Output:

    • Relit composite image

    • Metadata preserved

6. Critical Notes

  1. Manual Downloads Required:

  2. VRAM Requirements:

    • Minimum 8GB (for 1024x1024)

    • bf16 precision recommended

  3. Troubleshooting:

    • Check TransparentBG model if background removal fails

    • Adjust mask feathering for edge artifacts

FAQ