<div class="page-header with-image bleed">
            <picture>
            <img src="https://moecat.cc/wp-content/uploads/2024/10/1729667465-tmpygxphkns.png" width="1920" height="400" class="feature-image wp-post-image" alt="" decoding="async" fetchpriority="high">
        </picture>
        <header class="post-header">
        <h1 class="post-title" style="">SD webui IC_light（AI打光）使用教程</h1>
        <div class="post-metas">
                            <span>最后更新于 2024-10-23</span>
                                    <a href="https://moecat.cc/author/nicocat/">
                    <span class="meta-author">
                        <img alt='nicocat' src='https://weavatar.com/avatar/1aeca73a20d6fea54d81269e6bc00175745e013f9a221a1ccd9492e2ff726287?s=24&#038;d=mm&#038;r=g' srcset='https://weavatar.com/avatar/1aeca73a20d6fea54d81269e6bc00175745e013f9a221a1ccd9492e2ff726287?s=48&#038;d=mm&#038;r=g 2x' class='avatar avatar-24 photo avatar-small' height='24' width='24' loading='lazy' decoding='async'/>                        nicocat                    </span>
                </a>
                                <span>5955 次阅读</span>
                            </div>
    </header>
</div>

<p class="wp-block-paragraph">Stable Diffusion IC Light 教程，快速入门，使用AI给照片打光</p>



<p class="wp-block-paragraph">Read the English SD webui IC_light official user guide <a href="https://github.com/QodiCat/IC-Light-SD-WebUI" target="_blank" rel="noreferrer noopener nofollow">here</a>.<br>在<a href="https://github.com/QodiCat/IC-Light-SD-WebUI" target="_blank" rel="noreferrer noopener nofollow">这里</a>可以阅读官方说明文档。</p>



<p class="wp-block-paragraph">使用 IC_light 可以很方便地通过简单的提示词给图片打光。</p>



<h2 class="wp-block-heading" id="h-快速安装">快速安装：</h2>



<p class="wp-block-paragraph">从该链接（<a href="https://pan.baidu.com/s/1kb3rBi3MIG2Dl5b-DSiCyg?pwd=1111" target="_blank" rel="noreferrer noopener nofollow">https://pan.baidu.com/s/1kb3rBi3MIG2Dl5b-DSiCyg?pwd=1111</a>）下载整合包将内容粘贴至extensions文件夹内即可直接安装<br>截止2024年10月23日，该插件仍然在webui内核1.10.1，使用秋叶整合包v4.7一路更新过来的仍然正常工作。</p>



<h2 class="wp-block-heading" id="h-手动安装">手动安装：</h2>



<h3 class="wp-block-heading" id="h-安装本体">安装本体：</h3>



<p class="wp-block-paragraph">使用秋叶启动器，在版本管理——安装新拓展的底部粘贴url完成初步安装，<br>可以通过粘贴该链接<a href="https://github.com/QodiCat/IC-Light-SD-WebUI" target="_blank" rel="nofollow noopener noreferrer">https://github.com/QodiCat/IC-Light-SD-WebUI</a>来安装拓展。</p>



<h3 class="wp-block-heading" id="h-安装模型">安装模型：</h3>



<p class="wp-block-paragraph">完整的可用的插件目录大概是这样的：</p>



<pre class="wp-block-code"><code>IC_light_SD_webui
│ iclight_sd15_fbc.safetensors
│ iclight_sd15_fc.safetensors
│ iclight_sd15_fcon.safetensors
│
├─rmbg
│ .gitkeep
│ config.json
│ model.pth
│ model.safetensors
│ pytorch_model.bin
│
├─text_encoder
│ .gitkeep
│ model.safetensors
│ pytorch_model.bin
│ text_encoder_config.json
│
├─tokenizer
│ .gitkeep
│ tokenizer_merges.txt
│ tokenizer_special_tokens_map.json
│ tokenizer_tokenizer_config.json
│ tokenizer_vocab.json
│
├─unet
│ .gitkeep
│ diffusion_pytorch_model.bin
│ diffusion_pytorch_model.safetensors
│ unet_config.json
│
└─vae
.gitkeep
diffusion_pytorch_model.bin
diffusion_pytorch_model.safetensors
vae_config.json</code></pre>



<div class="wp-block-group is-layout-constrained wp-block-group-is-layout-constrained">
<p class="wp-block-paragraph">main models:&nbsp;<a href="https://huggingface.co/lllyasviel/ic-light/tree/main" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/lllyasviel/ic-light/tree/main</a></p>



<p class="wp-block-paragraph">具体的文件链接：<br><a href="https://huggingface.co/lllyasviel/ic-light/blob/main/iclight_sd15_fbc.safetensors" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/lllyasviel/ic-light/blob/main/iclight_sd15_fbc.safetensors</a><br><a href="https://huggingface.co/lllyasviel/ic-light/blob/main/iclight_sd15_fc.safetensors" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/lllyasviel/ic-light/blob/main/iclight_sd15_fc.safetensors</a></p>



<p class="wp-block-paragraph">此处下载的放在models目录</p>
</div>



<div class="wp-block-group is-layout-constrained wp-block-group-is-layout-constrained">
<p class="wp-block-paragraph">rmbg:<br><a href="https://huggingface.co/briaai/RMBG-1.4/tree/main" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/briaai/RMBG-1.4/tree/main</a><br></p>



<p class="wp-block-paragraph">具体的链接：<br><a href="https://huggingface.co/briaai/RMBG-1.4/blob/main/config.json" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/briaai/RMBG-1.4/blob/main/config.json</a><br><a href="https://huggingface.co/briaai/RMBG-1.4/blob/main/model.pth" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/briaai/RMBG-1.4/blob/main/model.pth</a><br><a href="https://huggingface.co/briaai/RMBG-1.4/blob/main/model.safetensors" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/briaai/RMBG-1.4/blob/main/model.safetensors</a><br><a href="https://huggingface.co/briaai/RMBG-1.4/blob/main/pytorch_model.bin" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/briaai/RMBG-1.4/blob/main/pytorch_model.bin</a></p>



<p class="wp-block-paragraph">此处下载的放在/models/rmbg文件夹里</p>
</div>



<p class="wp-block-paragraph">vae,unet,tokenizer,text_encoder:&nbsp;<a href="https://huggingface.co/stablediffusionapi/realistic-vision-v51" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/stablediffusionapi/realistic-vision-v51</a></p>



<p class="wp-block-paragraph">具体的链接：<br><a href="https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/text_encoder" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/text_encoder</a><br>下载此链接文件夹内所有文件放text_encoder文件夹里<br><a href="https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/tokenizer" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/tokenizer</a><br>下载此链接文件夹内所有文件放tokenizer文件夹中<br><a href="https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/unet" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/unet</a><br>unet文件夹需要的文件<br><a href="https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/vae" target="_blank" rel="nofollow noopener noreferrer">https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/vae</a><br>同理，全部下载<a href="https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/unet" target="_blank" rel="nofollow noopener noreferrer"><br></a>大陆用户无法正常访问将huggingface.co替换成hf-mirror.com即可</p>



<p class="wp-block-paragraph">关于安装完成后却没有出现插件选项卡：<br>在启动器-高级选项-环境维护-重新安装Python组件中，输入diffusers==0.27.2，点重新安装，等待完成后重启即可<br></p>



<h2 class="wp-block-heading" id="h-使用">使用：</h2>



<h3 class="wp-block-heading" id="h-fc-使用提示词生成光照">FC（使用提示词生成光照）</h3>



<p class="wp-block-paragraph">勾选Use FC，填写光照提示词并勾选光照方向即可，其他参数可选，使用默认参数即可</p>



<p class="wp-block-paragraph">提示词sunset，选择right light，其他为默认参数</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="225" height="225" data-id="316" src="https://nicocat.cc/wp-content/uploads/2024/10/1729667460-download.jpg" alt="" class="wp-image-316" srcset=" https://moecat.cc/wp-content/uploads/2024/10/1729667460-download.jpg 225w, https://moecat.cc/wp-content/uploads/2024/10/1729667460-download-150x150.jpg 150w" sizes="auto, (max-width: 225px) 100vw, 225px" / title="SD webui IC_light（AI打光）使用教程"></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="768" height="960" data-id="317" src="https://nicocat.cc/wp-content/uploads/2024/10/1729667465-tmpygxphkns.png" alt="" class="wp-image-317" srcset=" https://moecat.cc/wp-content/uploads/2024/10/1729667465-tmpygxphkns.png 768w, https://moecat.cc/wp-content/uploads/2024/10/1729667465-tmpygxphkns-240x300.png 240w" sizes="auto, (max-width: 768px) 100vw, 768px" / title="SD webui IC_light（AI打光）使用教程"></figure>
</figure>



<h3 class="wp-block-heading" id="h-fbc-使用背景板生成光照">FBC（使用背景板生成光照）</h3>



<p class="wp-block-paragraph">提示词dawn，其他均为默认参数</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="720" height="1016" src="https://nicocat.cc/wp-content/uploads/2024/10/1729668095-fang.png" alt="" class="wp-image-322" srcset=" https://moecat.cc/wp-content/uploads/2024/10/1729668095-fang.png 720w, https://moecat.cc/wp-content/uploads/2024/10/1729668095-fang-213x300.png 213w" sizes="auto, (max-width: 720px) 100vw, 720px" / title="SD webui IC_light（AI打光）使用教程"></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="640" src="https://nicocat.cc/wp-content/uploads/2024/10/1729668103-433-1024x640.webp" alt="" class="wp-image-323" srcset=" https://moecat.cc/wp-content/uploads/2024/10/1729668103-433-1024x640.webp 1024w, https://moecat.cc/wp-content/uploads/2024/10/1729668103-433-300x188.webp 300w, https://moecat.cc/wp-content/uploads/2024/10/1729668103-433-768x480.webp 768w, https://moecat.cc/wp-content/uploads/2024/10/1729668103-433-1536x960.webp 1536w, https://moecat.cc/wp-content/uploads/2024/10/1729668103-433.webp 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" / title="SD webui IC_light（AI打光）使用教程"></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="768" height="960" src="https://nicocat.cc/wp-content/uploads/2024/10/1729668106-tmpcvngpiom.png" alt="" class="wp-image-324" srcset=" https://moecat.cc/wp-content/uploads/2024/10/1729668106-tmpcvngpiom.png 768w, https://moecat.cc/wp-content/uploads/2024/10/1729668106-tmpcvngpiom-240x300.png 240w" sizes="auto, (max-width: 768px) 100vw, 768px" / title="SD webui IC_light（AI打光）使用教程"></figure>
</div>
</div>



<p class="wp-block-paragraph">关于报错</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
File "C:\sd-webui\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "C:\sd-webui\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "C:\sd-webui\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\sd-webui\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\sd-webui\python\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\sd-webui\python\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\sd-webui\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "C:\sd-webui\python\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\sd-webui\extensions\IC-Light-SD-WebUI\process_fc.py", line 386, in process_relight
input_fg, matting = run_rmbg(input_fg)
File "C:\sd-webui\python\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\sd-webui\extensions\IC-Light-SD-WebUI\process_fc.py", line 262, in run_rmbg
alpha = rmbg(feed)&#91;0]&#91;0]
TypeError: 'NoneType' object is not callable</code></pre>



<p class="wp-block-paragraph">如果你在启动后初次使用遇到如上类似报错，不必惊慌，可以忽略并多次尝试生成图片，报错五到六次后便可以正常打光，如果仍然无法正常生成图片，建议检查是否某些选项出现错误、没有勾选等，然后自行搜索相关帮助</p>



<p class="wp-block-paragraph">如果没有反应请尝试刷新页面后再试</p>



<p class="wp-block-paragraph">其他错误我目前没有遇到，如果该篇教程浪费了你的时间，对于你没有任何帮助，非常抱歉！</p>
