【光线重塑技术】小姐姐,美得不可方物——lllyasviel/ic-light

658 阅读1分钟

在英伟达自18年宣布光追技术之后,RTX显卡也成了目前Steam游戏的常客。就连 AMD、Intel 和 Apple Silicon 都宣布要在GPU上支持光追算法。这次我要介绍的是huggingface上比较火的relight技术—— ic-light

介绍

IC-Light 是一个操纵图像照明的项目。

IC-Light "是 "Imposing Consistent Light "的缩写(我们将在本页末尾对此进行简要介绍)。

目前,我们发布了两类模型:文本条件重照明模型和背景条件模型。这两种模型都将前景图像作为输入。

github.com/lllyasviel/…

安装

显存大小:能支持 sdxl 就够了

git clone https://github.com/lllyasviel/IC-Light.git
cd IC-Light
conda create -n iclight python=3.10
conda activate iclight
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
python gradio_demo.py

效果

Prompt: beautiful woman, detailed face, warm atmosphere, at home, bedroom

Lighting Preference: Left

328704445-87265483-aa26-4d2e-897d-b58892f5fdd7.png

Prompt: beautiful woman, detailed face, sunshine from window

Lighting Preference: Left

328704373-148c4a6d-82e7-4e3a-bf44-5c9a24538afc.png

Prompt: beautiful woman, detailed face, sunshine, outdoor, warm atmosphere

Lighting Preference: Left

328704235-dd30387b-0490-46ee-b688-2191fb752e68.png

Prompt: beautiful woman, detailed face, shadow from window

Lighting Preference: Left

fsdfasdvwawewsfca.PNG

营造一致的光线

在 HDR 空间中,照明的特性是所有光传输都是独立的。

因此,混合不同光源的外观等同于混合光源的外观:

328712691-27c67787-998e-469f-862f-047344e100cd.jpg

以上述灯光舞台为例,"外观混合物 "和 "光源混合物 "的两幅图像是一致的(理想情况下,在 HDR 空间中数学等价)。

在训练重新照明模型时,我们强加了这种一致性(使用潜空间中的 MLP)。

因此,模型能够产生高度一致的重光效果,其一致性甚至可以将不同的重光效果合并为法线贴图!尽管这些模型都是潜扩散模型。

328714013-25068f6a-f945-4929-a3d6-e8a152472223.jpg

也有网友说希望ComfyUI也能支持就更好了。