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

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

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