Buckets:
| import"../chunks/DsnmJJEf.js";import{i as u,h as b,C as x,H as d,a as g,E as w,s as _}from"../chunks/CUHxB6mI.js";import{p as y,o as J,s as t,f as v,a as h,b as T,c as f,n as U}from"../chunks/3au1YFcm.js";const B='{"title":"概述","local":"概述","sections":[{"title":"安装","local":"安装","sections":[],"depth":2}],"depth":1}';var C=f('<meta name="hf:doc:metadata"/>'),M=f('<p></p> <!> <!> <p>🤗 Diffusers 提供了一系列训练脚本供您训练自己的diffusion模型。您可以在 <a href="https://github.com/huggingface/diffusers/tree/main/examples" rel="nofollow">diffusers/examples</a> 找到所有训练脚本。</p> <p>每个训练脚本具有以下特点:</p> <ul><li><strong>独立完整</strong>:训练脚本不依赖任何本地文件,所有运行所需的包都通过 <code>requirements.txt</code> 文件安装</li> <li><strong>易于调整</strong>:这些脚本是针对特定任务的训练示例,并不能开箱即用地适用于所有训练场景。您可能需要根据具体用例调整脚本。为此,我们完全公开了数据预处理代码和训练循环,方便您进行修改</li> <li><strong>新手友好</strong>:脚本设计注重易懂性和入门友好性,而非包含最新最优方法以获得最具竞争力的结果。我们有意省略了过于复杂的训练方法</li> <li><strong>单一用途</strong>:每个脚本仅针对一个任务设计,确保代码可读性和可理解性</li></ul> <p>当前提供的训练脚本包括:</p> <table><thead><tr><th>训练类型</th><th>支持SDXL</th><th>支持LoRA</th></tr></thead><tbody><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/unconditional_image_generation" rel="nofollow">unconditional image generation</a> <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a></td><td></td><td></td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/text_to_image" rel="nofollow">text-to-image</a></td><td>👍</td><td>👍</td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion" rel="nofollow">textual inversion</a> <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_textual_inversion_training.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a></td><td></td><td></td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/dreambooth" rel="nofollow">DreamBooth</a> <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_dreambooth_training.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a></td><td>👍</td><td>👍</td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/controlnet" rel="nofollow">ControlNet</a></td><td>👍</td><td></td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/instruct_pix2pix" rel="nofollow">InstructPix2Pix</a></td><td>👍</td><td></td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/custom_diffusion" rel="nofollow">Custom Diffusion</a></td><td></td><td></td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/t2i_adapter" rel="nofollow">T2I-Adapters</a></td><td>👍</td><td></td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/kandinsky2_2/text_to_image" rel="nofollow">Kandinsky 2.2</a></td><td></td><td>👍</td></tr><tr><td><a href="https://github.com/huggingface/diffusers/tree/main/examples/wuerstchen/text_to_image" rel="nofollow">Wuerstchen</a></td><td></td><td>👍</td></tr></tbody></table> <p>这些示例处于<strong>积极维护</strong>状态,如果遇到问题请随时提交issue。如果您认为应该添加其他训练示例,欢迎创建<a href="https://github.com/huggingface/diffusers/issues/new?assignees=&labels=&template=feature_request.md&title=" rel="nofollow">功能请求</a>与我们讨论,我们将评估其是否符合独立完整、易于调整、新手友好和单一用途的标准。</p> <!> <p>请按照以下步骤在新虚拟环境中从源码安装库,确保能成功运行最新版本的示例脚本:</p> <!> <p>然后进入具体训练脚本目录(例如<a href="https://github.com/huggingface/diffusers/tree/main/examples/dreambooth" rel="nofollow">DreamBooth</a>),安装对应的<code>requirements.txt</code>文件。部分脚本针对SDXL或LoRA有特定要求文件,使用时请确保安装对应文件。</p> <!> <p>为加速训练并降低内存消耗,我们建议:</p> <ul><li>使用PyTorch 2.0或更高版本,自动启用<a href="../optimization/fp16#scaled-dot-product-attention">缩放点积注意力</a>(无需修改训练代码)</li> <li>安装<a href="../optimization/xformers">xFormers</a>以启用内存高效注意力机制</li></ul> <!> <p></p>',1);function W(m,c){y(c,!1),J(()=>{new URLSearchParams(window.location.search).get("fw")}),u();var e=M();b("1yxd7n",l=>{var n=C();_(n,"content",B),h(l,n)});var a=t(v(e),2);x(a,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var o=t(a,2);d(o,{title:"概述",local:"概述",headingTag:"h1"});var s=t(o,14);d(s,{title:"安装",local:"安装",headingTag:"h2"});var i=t(s,4);g(i,{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUwQWNkJTIwZGlmZnVzZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers | |
| <span class="hljs-built_in">cd</span> diffusers | |
| pip install .`,lang:"bash",wrap:!1});var r=t(i,4);g(r,{code:"Y2QlMjBleGFtcGxlcyUyRmRyZWFtYm9vdGglMEFwaXAlMjBpbnN0YWxsJTIwLXIlMjByZXF1aXJlbWVudHMudHh0JTBBJTIzJTIwJUU1JUE2JTgyJUU5JTlDJTgwJUU3JTk0JUE4RHJlYW1Cb290aCVFOCVBRSVBRCVFNyVCQiU4M1NEWEwlMEFwaXAlMjBpbnN0YWxsJTIwLXIlMjByZXF1aXJlbWVudHNfc2R4bC50eHQ=",highlighted:`<span class="hljs-built_in">cd</span> examples/dreambooth | |
| pip install -r requirements.txt | |
| <span class="hljs-comment"># 如需用DreamBooth训练SDXL</span> | |
| pip install -r requirements_sdxl.txt`,lang:"bash",wrap:!1});var p=t(r,6);w(p,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/zh/training/overview.md"}),U(2),h(m,e),T()}export{W as component}; | |
Xet Storage Details
- Size:
- 6.59 kB
- Xet hash:
- 6ea843a0e50fe16cdc549c9cce80bafa84861c0cb53add0b9a8a3b550f79795a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.