<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>启程会有时</title>
        <link>https://tangly1024.com/</link>
        <description>——专注于有趣的小玩意</description>
        <lastBuildDate>Sun, 16 Jun 2024 00:53:14 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2024, Yahaha</copyright>
        <item>
            <title><![CDATA[stable diffusion(Lora的训练)]]></title>
            <link>https://tangly1024.com/article/eb0f2b63-7505-45ff-be5f-b0f558fc1770</link>
            <guid>https://tangly1024.com/article/eb0f2b63-7505-45ff-be5f-b0f558fc1770</guid>
            <pubDate>Fri, 02 Jun 2023 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-eb0f2b63750545ffbe5fb0f558fc1770"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-77112a8feea14fd9b847abe2f6df6749">以坤坤为例，上网随便找了几个坤坤的人脸图像，作为训练的数据集</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4fb7230698af4590b4d779d16a2c6636"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/3a99ea4ea3594d2298f9aa4c1d288235.png?t=4fb72306-98af-4590-b4d7-79d16a2c6636" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-b096fa0e02d2417cad92dad049c3affb">建议看一遍<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.bilibili.com/video/BV148411c7U2/?spm_id_from=333.337.search-card.all.click&amp;vd_source=df490c5532bd20bafd8a3af50d51a5de">教程</a>，虽然这个up主好像不是很专业的样子，不过流程差不多是这样的，重点关注一下<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://so.csdn.net/so/search?q=%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83&amp;spm=1001.2101.3001.7020">虚拟环境</a>搭建完之后，在终端选择配置的操作，就是一堆yes no，的选项，跟着视频来就行了。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-a8260fc4799d4012940e1e13ef9097e2" data-id="a8260fc4799d4012940e1e13ef9097e2"><span><div id="a8260fc4799d4012940e1e13ef9097e2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a8260fc4799d4012940e1e13ef9097e2" title="1.1 git clone 项目"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.1 git clone 项目</span></span></h3><div class="notion-text notion-block-7b54ff33f2be42a7b4a2e66d1190713c">本地找个训练环境存放的文件夹，利用git工具拉取训练webui环境</div><div class="notion-text notion-block-820c2fe7350f4853808853493c53168b">拉取后会有这样的目录，执行红框内的setup.bat文件就能安装训练的虚拟环境了（和之前搭建的SD框架虚拟环境类似，但是安装的<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://so.csdn.net/so/search?q=python%E5%BA%93&amp;spm=1001.2101.3001.7020">python库</a>版本会有所出入，如果不想有版本冲突的话，建议直接在这里就不需要操作任何配置了）</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9c62b30d96cd4e8c93f3dc0b14012b2c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/0a4cc089a362493daf2bc07715f912a8.png?t=9c62b30d-96cd-4e8c-93f3-dc0b14012b2c" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-0607693f511141f7b912b446ae789cf2" data-id="0607693f511141f7b912b446ae789cf2"><span><div id="0607693f511141f7b912b446ae789cf2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0607693f511141f7b912b446ae789cf2" title="1.2 cuda加速安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.2 cuda加速安装</span></span></h3><div class="notion-text notion-block-44a5c1c6cb6d47a2a5898f2fbd98d482"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/bmaltais/kohya_ss">项目网站</a>上有安装的教程，用于加速训练过程的，支持30和40系显卡</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-de8fd346e5314f61aa02b2a08f513234" data-id="de8fd346e5314f61aa02b2a08f513234"><span><div id="de8fd346e5314f61aa02b2a08f513234" class="notion-header-anchor"></div><a class="notion-hash-link" href="#de8fd346e5314f61aa02b2a08f513234" title="1.3 打开训练的webui"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.3 打开训练的webui</span></span></h3><div class="notion-text notion-block-f50ae1deaf9849c6acc4971ca48b534e">和打开SD webui类似，直接点击这个目录下的gui.bat文件，看到url网址出现就能打开网站了。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-14ef72ba1af341eba328a54d607ac739"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/9f1f3da67a2f4d94a9a6828ac0f454aa.png?t=14ef72ba-1af3-41eb-a328-a54d607ac739" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-b5025888e1c141c08570a33e7360c880">简单来说训练过程中需要图像和对应的图像描述，类似于其他机器学习中的数据和标签。在stable diffusion的webui里可以找到图像预处理模块。输入到lora训练网络中的数据集应该长这样：</div><div class="notion-text notion-block-cec47b927bb54af8b2a31e76671088eb"><b>结果展示</b></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9e9ac5a05ade42db96e0b440539e8223"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/1edee88746834e0eaed31b03a92ba728.png?t=9e9ac5a0-5ade-42db-96e0-b440539e8223" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4de901bc37b14e9488fcad78d2c86cbf" data-id="4de901bc37b14e9488fcad78d2c86cbf"><span><div id="4de901bc37b14e9488fcad78d2c86cbf" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4de901bc37b14e9488fcad78d2c86cbf" title="2.1 裁剪"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 裁剪</span></span></h3><div class="notion-text notion-block-7a71708e6a1a47b5b3e1a159bf0bf6a5">因为本文一开头搜集到的图像分辨率不一样，训练过程中最好使用同一的分辨率，这里可以通过</div><div class="notion-text notion-block-b5af892656ae4313b4edd06350f37302"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.onlinephotosoft.com/zh-CN/birme/">剪裁网站</a></div><div class="notion-text notion-block-d8721b66219849119011a1759dcb3c91">批量处理人物图像。这里推荐使用512*512的分辨率。这个网站还能同一重命名图片，有强迫症的人很支持。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-46561c3e3a4f4aa0bf1348a5496d9bc9"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/97f3551e67f4408590d162f6fa81f74d.png?t=46561c3e-3a4f-4aa0-bf13-48a5496d9bc9" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-844b84cbd42d4836a7c3f357be97f9f8" data-id="844b84cbd42d4836a7c3f357be97f9f8"><span><div id="844b84cbd42d4836a7c3f357be97f9f8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#844b84cbd42d4836a7c3f357be97f9f8" title="2.2 利用stable diffusion webui预处理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 利用stable diffusion webui预处理</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-292e3e7877964fa38acb339d2dfc9d57"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/6735e0fbb71646969d012436ac5a9335.png?t=292e3e78-7796-4fa3-8acb-339d2dfc9d57" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-5211ead8a16b4c2ca854940b553088de">在ui的这个界面输入刚刚批量裁剪完的图像，和输出的目录。就能得到以下21张512*512并且带有描述文本的训练集了。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8cc94827bca64eb18e25ed9dd8f4081b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/d8c61898ee164d08bc8a390734461e4e.png?t=8cc94827-bca6-4eb1-8e25-ed9dd8f4081b" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f174e6f91eff413081ee654cd5c13a1e">……这里坤坤的被预处理自动标记为1girl了，大家可以手动修改一下这个标签，然后检查其他的描述是否存在不合理的情况，酌情删除和增加即可。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-67ffc040b71445ca8418c8213f3aec48" data-id="67ffc040b71445ca8418c8213f3aec48"><span><div id="67ffc040b71445ca8418c8213f3aec48" class="notion-header-anchor"></div><a class="notion-hash-link" href="#67ffc040b71445ca8418c8213f3aec48" title="3.1 文件路径安排"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 文件路径安排</span></span></h3><div class="notion-text notion-block-8ecadf3d1d7d4d88b5717951501d7a27">回到lora训练的webui上，在dreambooth LoRA栏目下添加源模型，因为本次训练的是真实人物模型，笔者就选择了这个比较合适的大模型。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c56c179092c7406886d608cc17ec7371"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/1af655116bab42c3a119953a5a840190.png?t=c56c1790-92c7-4068-86d6-08cc17ec7371" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-661a0c0317e242cca58f1a010023e438">子栏目Folders按照这个格式放置刚刚处理的图片，这里的文件命名只需要注意10_cxk，前面的数字，是每次训练过程中网络训练单张图片的次数。其余的路径名大家可以自定义。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-fe10ce4cd57d4bd3a61f42299b40df72"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/ca9923e8e3f64d01868eb25ae9ac6589.png?t=fe10ce4c-d57d-4bd3-a61f-42299b40df72" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-edaf2b186fb34f33a2b196bf616e58fc">子栏目training parameter就是训练过程中需要炼丹的参数，大家根据自己电脑的配置来修改，数据量大的，显存足够的情况下，batchsize可以调高。学习率和epoch次数都是比较常见的修改参数。这里用了8个epoch去训练，每次epoch结束后都会保存当前的Lora模型。结果是这样的：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9bc9cea809cb44a4a618b03550d4ba52"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/e54d8458059c499aa2666802e9c35730.png?t=9bc9cea8-09cb-44a4-a618-b03550d4ba52" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-46e8fb9e50cb4aeebde4c0cacda785ce">大家可以根据训练的loss值来选择计算机认为较好的结果，当然loss越小拟合得越好，太小则会过拟合，泛化性能不足。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-a4a8d78b2add403c9f1a1a08aadaf9bd" data-id="a4a8d78b2add403c9f1a1a08aadaf9bd"><span><div id="a4a8d78b2add403c9f1a1a08aadaf9bd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a4a8d78b2add403c9f1a1a08aadaf9bd" title="3.2 lora模型挑选"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 lora模型挑选</span></span></h3><div class="notion-text notion-block-693690e95b414e22bb77475229aa46b1">刚刚一共训练了八个cxk_lora模型，但看loss值不好挑选最佳的模型，这里回到stable diffusion webui里，利用脚本来观察那个lora模型比较好。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-31359c265a9b4bd28817d524329308ab" data-id="31359c265a9b4bd28817d524329308ab"><span><div id="31359c265a9b4bd28817d524329308ab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#31359c265a9b4bd28817d524329308ab" title="3.2.1 插件安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2.1 插件安装</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-d8227919e1b6479fb9d28c45c072c75d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/3f167452433b4b0c99f53f9d96bd962e.png?t=d8227919-e1b6-479f-b9d2-8c45c072c75d" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-af9e42dafbdd481aad07263676b10d12">需要安装红框里的插件，才能利用脚本一次性使用多个lora进行对比，当然，大家可以不用插件，一个一个去生成，但是就是会比较麻烦，有插件就方便一些。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-2a43c52a3fcd4bdc862ed0cc594e0840"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/63a37579bc5b40a28a14bff8adaca7fe.png?t=2a43c52a-3fcd-4bdc-862e-d0cc594e0840" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c3c797f192994a12865b72b6e20559c7" data-id="c3c797f192994a12865b72b6e20559c7"><span><div id="c3c797f192994a12865b72b6e20559c7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c3c797f192994a12865b72b6e20559c7" title="3.2.2 比较模型"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2.2 比较模型</span></span></h4><div class="notion-text notion-block-3a131daa97b74c08bed336e9ce2a21aa">把刚刚整完的lora模型放到这个插件的model/lora目录下，就能在界面看到这样的效果。记得大模型要选择你训练的时候的基底模型。附加网络随机选取，<b>这个插件不用选择开启。但是网络类型和模型是需要选取的，为的是让后面的脚本能识别你要进行对比的lora模型。</b></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-ab9cce4dbadb434caf431e26af636d06"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/10d7b439c72840bd8ad5acc3da8ed538.png?t=ab9cce4d-badb-434c-af43-1e26af636d06" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-133836cb5837413297f484710f608f18">脚本里这样设置，选择XYZ 绘图脚本</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-c35a3d56b3be406191a497d3ac13e054"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/7ffc8b5ab78f47528d95e3258e510ffb.png?t=c35a3d56-b3be-4061-91a4-97d3ac13e054" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-c52f7b3d4637403f8df88a36d4a72be4">X轴类型选择刚刚插件内的额外网络模型（也就是你的Lora模型）</div><div class="notion-text notion-block-95eb8fe5a961463896ab27b054117105">Y轴选择这个模型需要运用的程度，等价于prompt语法中的&lt;lora:cxk_model_xxx:0.5&gt;，因为有些情况下，会出现模型的过拟合，若是应用占比过大，反而效果不好。</div><div class="notion-text notion-block-e86664b239b14b4389c60751e6c8bec3"><b>出图结果：</b></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cec6b83b7c1244ccb366a31a40208250"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/20d92a6496754018a433eccf5bbb6fdc.png?t=cec6b83b-7c12-44cc-b366-a31a40208250" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-fc2368e8bab248bd9fb2894007758b3a">可以看到拉，cxk_lora-7这个模型配合上0.9左右的占比，实现的效果比较好。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-b2d0ecef0dd34c7e8f7f10660f043e1f" data-id="b2d0ecef0dd34c7e8f7f10660f043e1f"><span><div id="b2d0ecef0dd34c7e8f7f10660f043e1f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b2d0ecef0dd34c7e8f7f10660f043e1f" title="3.3 lora应用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.3 lora应用</span></span></h3><div class="notion-text notion-block-6206e33036d448c5a4ae1080c6dedd83">选择刚刚合适的模型，放入到这个目录下（其实应该可以修改代码，这样就不用复制来复制去了。。还占用空间，不过fine拉，看代码也是个很长的过程）</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-64f95432549242ebb742f86617eaa199"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/8565baaad3f64e549df1cc934d85a3da.png?t=64f95432-5492-42eb-b742-f86617eaa199" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f68f8e83011048f696559667858cd0d3">然后就能在stable diffusion webui里愉快地出图啦~</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b1094267e6334414b19e1daf62333a00"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://img-blog.csdnimg.cn/d682edfc7e0b407795d01fe04a2d6a01.png?t=b1094267-e633-4414-b19e-1daf62333a00" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-ba1950a980814458b68654cb2ca2cd36">这里的插件和脚本都不需要开启了。记得关闭。</div><div class="notion-text notion-block-53352dbae93c4d0fa8ff99e0d8a0492c">训练工程——<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/bmaltais/kohya_ss">kohya_ss</a></div><div class="notion-text notion-block-d4bf7a5e10c7427289c4f9d38a17df32">剪裁工具——<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.onlinephotosoft.com/zh-CN/birme/">photosoft</a></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[在网页上免魔法使用chatgpt的部署方式]]></title>
            <link>https://tangly1024.com/article/083eebcf-e731-42d1-8e09-cab73552068c</link>
            <guid>https://tangly1024.com/article/083eebcf-e731-42d1-8e09-cab73552068c</guid>
            <pubDate>Fri, 02 Jul 2021 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-083eebcfe73142d18e09cab73552068c"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-7475ddfaa2f943448b1462cf22b41242"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="😀">😀</span></div><div class="notion-callout-text">国内使用chatgpt的方式我觉得要便捷就要满足：最好免魔法、不限制客户端，所以下面这两个方式目前使用比较稳定</div></div><div class="notion-blank notion-block-af9dd65274ed48939cb37fadf7597202"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-b8e6b73e278e4a20a250ac848f768ac3" data-id="b8e6b73e278e4a20a250ac848f768ac3"><span><div id="b8e6b73e278e4a20a250ac848f768ac3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b8e6b73e278e4a20a250ac848f768ac3" title="📝 部署方式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📝 部署方式</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-8fe10f3648494dfaaf7272f26830bf47" data-id="8fe10f3648494dfaaf7272f26830bf47"><span><div id="8fe10f3648494dfaaf7272f26830bf47" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8fe10f3648494dfaaf7272f26830bf47" title="方式一：gpt3.5 turbo"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">方式一：gpt3.5 turbo</span></span></h3><blockquote class="notion-quote notion-block-852d952c7ea04849b0c81ea5cbfe3440"><div>1、openai的账号（3-5元不等）
2、域名cname
3、github账号
4、vercel部署这个github项目Yidadaa/ChatGPT-Next-Web</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-4cda467ef480434ebb0c88a18a123090" data-id="4cda467ef480434ebb0c88a18a123090"><span><div id="4cda467ef480434ebb0c88a18a123090" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4cda467ef480434ebb0c88a18a123090" title="方式二：new bing"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">方式二：new bing</span></span></h3><blockquote class="notion-quote notion-block-8033177766d744cd8852cf12c58617b2"><div>1、微软账号（bingchat功能已开）</div><div class="notion-text notion-block-d246870f3b85407fbfc8998b88bdb259">2、vercel部署这个github项目go-proxy-bingai
3、cloudflare worker部署 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/adams549659584/go-proxy-bingai#%E9%83%A8%E7%BD%B2%E8%81%8A%E5%A4%A9%E6%9C%8D%E5%8A%A1%E5%99%A8">聊天服务器</a></div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-f38702b5063742c08c051a1136eaba74" data-id="f38702b5063742c08c051a1136eaba74"><span><div id="f38702b5063742c08c051a1136eaba74" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f38702b5063742c08c051a1136eaba74" title="📎 参考链接"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📎 参考链接</span></span></h2><ul class="notion-list notion-list-disc notion-block-1c1d7fc6bf1e49229bb5c4fcf7cbe11d"><li><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/Yidadaa/ChatGPT-Next-Web">chatgpt-next-web</a></li></ul><ul class="notion-list notion-list-disc notion-block-4655e5d3c34d47de9a659d66a736355a"><li><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/adams549659584/go-proxy-bingai">go-proxy-bingai</a></li></ul><div class="notion-blank notion-block-c802e3e211444ac7bdc17c7894b7d52c"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>