标签: ai

  • SD webui IC_light(AI打光)使用教程

    SD webui IC_light(AI打光)使用教程

    Stable Diffusion IC Light 教程,快速入门,使用AI给照片打光

    Read the English SD webui IC_light official user guide here.
    这里可以阅读官方说明文档。

    使用 IC_light 可以很方便地通过简单的提示词给图片打光。

    快速安装:

    从该链接(https://pan.baidu.com/s/1kb3rBi3MIG2Dl5b-DSiCyg?pwd=1111)下载整合包将内容粘贴至extensions文件夹内即可直接安装
    截止2024年10月23日,该插件仍然在webui内核1.10.1,使用秋叶整合包v4.7一路更新过来的仍然正常工作。

    手动安装:

    安装本体:

    使用秋叶启动器,在版本管理——安装新拓展的底部粘贴url完成初步安装,
    可以通过粘贴该链接https://github.com/QodiCat/IC-Light-SD-WebUI来安装拓展。

    安装模型:

    完整的可用的插件目录大概是这样的:

    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

    vae,unet,tokenizer,text_encoder: https://huggingface.co/stablediffusionapi/realistic-vision-v51

    具体的链接:
    https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/text_encoder
    下载此链接文件夹内所有文件放text_encoder文件夹里
    https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/tokenizer
    下载此链接文件夹内所有文件放tokenizer文件夹中
    https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/unet
    unet文件夹需要的文件
    https://huggingface.co/stablediffusionapi/realistic-vision-v51/tree/main/vae
    同理,全部下载
    大陆用户无法正常访问将huggingface.co替换成hf-mirror.com即可

    关于安装完成后却没有出现插件选项卡:
    在启动器-高级选项-环境维护-重新安装Python组件中,输入diffusers==0.27.2,点重新安装,等待完成后重启即可

    使用:

    FC(使用提示词生成光照)

    勾选Use FC,填写光照提示词并勾选光照方向即可,其他参数可选,使用默认参数即可

    提示词sunset,选择right light,其他为默认参数

    FBC(使用背景板生成光照)

    提示词dawn,其他均为默认参数

    关于报错

    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)[0][0]
    TypeError: 'NoneType' object is not callable

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

    如果没有反应请尝试刷新页面后再试

    其他错误我目前没有遇到,如果该篇教程浪费了你的时间,对于你没有任何帮助,非常抱歉!

  • SD-webui Animatediff使用(AI生成动画的一种方法)

    Stable Diffusion Animatediff 使用教程,快速入门

    由于作者更新,网上大部分教程已过时失效,所以我决定根据官方说明写一篇简易入门教程

    限于本人水平,如果你有能力,建议自行参阅作者本人的说明,本篇文档仅根据本人使用经验编写

    Read the stable diffusion animatediff official English user turtial guide here.

    下载:

    1.使用绘世启动器,在版本管理——安装新拓展中搜索animatediff安装sd-webui-animatediff即可

    2.通过官方说明安装,在此不做说明

    使用准备:

    作者的模型仓库下载以下模型并按要求操作:

    1.在motion_module下载v3及以后的模型,sd1.5下载含有sd15的模型,sdxl下载sdxl的模型,

    下载完成后放入“\extensions\sd-webui-animatediff\model”文件夹

    2.在lora下载任意lora模型放入“\models\Lora”以备使用

    3.有使用controlnet需求的在controlnet下载相应的controlnet模型放入“\models\ControlNet”以备使用

    开始使用

    以下为基于sd1.5的使用说明,限于本人硬件水平,sdxl的用户请自行结合实际情况和官方说明文档使用

    1.编写标准的提示词

    比如:

    正面提示词

    1girl,(loli:0.8),(solo:1.1),looking at viewer,brown hair,outdoor,depth of field,(((low twintails:1.3))),((hair flower:1.2)),ahoge,(hairband:1.1),hairflower,hairclip,((pleated skirt:1.2)),((layered skirt:1.2)),(dress:1.1),((white shirt:1.2)),petals,flower,sidelocks,short hair,bangs,blush,blue skirt,sleeves past wrists,green eyes,bangs,((light smile:1.1)),long sleeves,hair between eyes,blue skirt,small breasts,open clothes,cardigan,red neckerchief,neckerchief,((white loose socks:1.2)),masterpiece,(official wallpaper:1.1),<lora:mm_sd15_v2_lora_ZoomOut:1>,

    负面提示词

    (worst quality, low quality:1.4),(fuze:1.4),(worst quality:1.1),(low quality:1.4),((grayscale)),badhandv4,(missing fingers:1.1),(more fingers:1.1),EasyNegative,(bad hands:1.1),((poorly drawn hands:1.1)),fused fingers,malformed limbs,too many fingers,mutated hands,extra limb,((mosaic:1.1)),((mosaic_censoring:1.1)),BadDream,lowres,text,error,extra digit,fewer digits,jpeg artifacts,deformed,leg rings,cropped,signature,watermark,username,(fat:1.2),

    注意:在编写完正面提示词后,请添加一个作者提供的镜头Lora,比如示例提示词中的<lora:mm_sd15_v2_lora_ZoomOut:1>,

    2.编辑参数

    根据显卡性能适当调整输出的分辨率和迭代步数,达不到8GB显存的用户强烈建议512*512以下,因为使用共享显存会夸张地延长生成需要的时间

    animatediff参数:

    点击启用

    模型:根据你选用的stablediffusion大模型选择对应的作者提供的动画模型

    闭环(RP选项)

    该选项将决定生成的动画循环的程度,从左到右依次增强,选择A模型将积极使第一帧与最后一帧相同,从而使生成的动画循环播放而不显得突兀

    帧插值(酌情使用,需要安装deform,新手使用该插件容易破坏环境,在此不做说明)

    总帧数:就是总共生成多少帧,如果你使用了视频,则是匹配到视频的第几帧

    帧率:每秒播放多少帧

    循环数量:gif循环播放多少次

    上下文单批数量:依次处理的帧数量,sd1.5建议设置为16,sdxl建议设置为8(作者说明)

    步幅、重叠和帧插值(以下摘自作者原文,我的建议是建议保持默认参数)

    1. Stride — Max motion stride as a power of 2 (default: 1).
      1. Due to the limitation of the infinite context generator, this parameter is effective only when Number of frames > Context batch size, including when ControlNet is enabled and the source video frame number > Context batch size and Number of frames is 0.
      2. “Absolutely no closed loop” is only possible when Stride is 1.
      3. For each 1 <= 2i <= Stride, the infinite context generator will try to make frames 2i apart temporal consistent. For example, if Stride is 4 and Number of frames is 8, it will make the following frames temporal consistent:
        • Stride == 1: [0, 1, 2, 3, 4, 5, 6, 7]
        • Stride == 2: [0, 2, 4, 6], [1, 3, 5, 7]
        • Stride == 4: [0, 4], [1, 5], [2, 6], [3, 7]
    2. Overlap — Number of frames to overlap in context. If overlap is -1 (default): your overlap will be Context batch size // 4.
      1. Due to the limitation of the infinite context generator, this parameter is effective only when Number of frames > Context batch size, including when ControlNet is enabled and the source video frame number > Context batch size and Number of frames is 0.
    3. Interp X — Replace each input frame with X interpolated output frames.

    生成效果: