Buckets:
| <meta charset="utf-8" /><meta http-equiv="content-security-policy" content=""><meta name="hf:doc:metadata" content="{"local":"diffusers","sections":[{"local":"","title":"커뮤니티"},{"local":"","title":"주목할 사항들"}],"title":"🧨 Diffusers 학습 예시"}" data-svelte="svelte-1phssyn"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/assets/pages/__layout.svelte-hf-doc-builder.css"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/start-hf-doc-builder.js"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/chunks/vendor-hf-doc-builder.js"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/chunks/paths-hf-doc-builder.js"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/pages/__layout.svelte-hf-doc-builder.js"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/pages/training/overview.mdx-hf-doc-builder.js"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/chunks/IconCopyLink-hf-doc-builder.js"> | |
| <link rel="modulepreload" href="/docs/diffusers/v0.19.2/ko/_app/chunks/CodeBlock-hf-doc-builder.js"> | |
| <h1 class="relative group"><a id="diffusers" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> | |
| <span>🧨 Diffusers 학습 예시 | |
| </span></h1> | |
| <p>이번 챕터에서는 다양한 유즈케이스들에 대한 예제 코드들을 통해 어떻게하면 효과적으로 <code>diffusers</code> 라이브러리를 사용할 수 있을까에 대해 알아보도록 하겠습니다. </p> | |
| <p><strong>Note</strong>: 혹시 오피셜한 예시코드를 찾고 있다면, <a href="https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines" rel="nofollow">여기</a>를 참고해보세요!</p> | |
| <p>여기서 다룰 예시들은 다음을 지향합니다.</p> | |
| <ul><li><strong>손쉬운 디펜던시 설치</strong> (Self-contained) : 여기서 사용될 예시 코드들의 디펜던시 패키지들은 전부 <code>pip install</code> 명령어를 통해 설치 가능한 패키지들입니다. 또한 친절하게 <code>requirements.txt</code> 파일에 해당 패키지들이 명시되어 있어, <code>pip install -r requirements.txt</code>로 간편하게 해당 디펜던시들을 설치할 수 있습니다. 예시: <a href="https://github.com/huggingface/diffusers/blob/main/examples/unconditional_image_generation/train_unconditional.py" rel="nofollow">train_unconditional.py</a>, <a href="https://github.com/huggingface/diffusers/blob/main/examples/unconditional_image_generation/requirements.txt" rel="nofollow">requirements.txt</a></li> | |
| <li><strong>손쉬운 수정</strong> (Easy-to-tweak) : 저희는 가능하면 많은 유즈 케이스들을 제공하고자 합니다. 하지만 예시는 결국 그저 예시라는 점들 기억해주세요. 여기서 제공되는 예시코드들을 그저 단순히 복사-붙혀넣기하는 식으로는 여러분이 마주한 문제들을 손쉽게 해결할 순 없을 것입니다. 다시 말해 어느 정도는 여러분의 상황과 니즈에 맞춰 코드를 일정 부분 고쳐나가야 할 것입니다. 따라서 대부분의 학습 예시들은 데이터의 전처리 과정과 학습 과정에 대한 코드들을 함께 제공함으로써, 사용자가 니즈에 맞게 손쉬운 수정할 수 있도록 돕고 있습니다.</li> | |
| <li><strong>입문자 친화적인</strong> (Beginner-friendly) : 이번 챕터는 diffusion 모델과 <code>diffusers</code> 라이브러리에 대한 전반적인 이해를 돕기 위해 작성되었습니다. 따라서 diffusion 모델에 대한 최신 SOTA (state-of-the-art) 방법론들 가운데서도, 입문자에게는 많이 어려울 수 있다고 판단되면, 해당 방법론들은 여기서 다루지 않으려고 합니다.</li> | |
| <li><strong>하나의 태스크만 포함할 것</strong>(One-purpose-only): 여기서 다룰 예시들은 하나의 태스크만 포함하고 있어야 합니다. 물론 이미지 초해상화(super-resolution)와 이미지 보정(modification)과 같은 유사한 모델링 프로세스를 갖는 태스크들이 존재하겠지만, 하나의 예제에 하나의 태스크만을 담는 것이 더 이해하기 용이하다고 판단했기 때문입니다.</li></ul> | |
| <p>저희는 diffusion 모델의 대표적인 태스크들을 다루는 공식 예제를 제공하고 있습니다. <em>공식</em> 예제는 현재 진행형으로 <code>diffusers</code> 관리자들(maintainers)에 의해 관리되고 있습니다. 또한 저희는 앞서 정의한 저희의 철학을 엄격하게 따르고자 노력하고 있습니다. 혹시 여러분께서 이러한 예시가 반드시 필요하다고 생각되신다면, 언제든지 <a href="https://github.com/huggingface/diffusers/issues/new?assignees=&labels=&template=feature_request.md&title=" rel="nofollow">Feature Request</a> 혹은 직접 <a href="https://github.com/huggingface/diffusers/compare" rel="nofollow">Pull Request</a>를 주시기 바랍니다. 저희는 언제나 환영입니다!</p> | |
| <p>학습 예시들은 다양한 태스크들에 대해 diffusion 모델을 사전학습(pretrain)하거나 파인튜닝(fine-tuning)하는 법을 보여줍니다. 현재 다음과 같은 예제들을 지원하고 있습니다.</p> | |
| <ul><li><a href="./unconditional_training">Unconditional Training</a></li> | |
| <li><a href="./text2image">Text-to-Image Training</a></li> | |
| <li><a href="./text_inversion">Text Inversion</a></li> | |
| <li><a href="./dreambooth">Dreambooth</a></li></ul> | |
| <p>memory-efficient attention 연산을 수행하기 위해, 가능하면 <a href="../optimization/xformers">xFormers</a>를 설치해주시기 바랍니다. 이를 통해 학습 속도를 늘리고 메모리에 대한 부담을 줄일 수 있습니다.</p> | |
| <table><thead><tr><th>Task</th> | |
| <th>🤗 Accelerate</th> | |
| <th align="center">🤗 Datasets</th> | |
| <th align="center">Colab</th></tr></thead> | |
| <tbody><tr><td><a href="./unconditional_training"><strong>Unconditional Image Generation</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">✅</td> | |
| <td align="center"><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></tr> | |
| <tr><td><a href="./text2image"><strong>Text-to-Image fine-tuning</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">✅</td> | |
| <td align="center"></td></tr> | |
| <tr><td><a href="./text_inversion"><strong>Textual Inversion</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">-</td> | |
| <td align="center"><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></tr> | |
| <tr><td><a href="./dreambooth"><strong>Dreambooth</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">-</td> | |
| <td align="center"><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></tr> | |
| <tr><td><a href="./lora"><strong>Training with LoRA</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">-</td> | |
| <td align="center">-</td></tr> | |
| <tr><td><a href="./controlnet"><strong>ControlNet</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">✅</td> | |
| <td align="center">-</td></tr> | |
| <tr><td><a href="./instructpix2pix"><strong>InstructPix2Pix</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">✅</td> | |
| <td align="center">-</td></tr> | |
| <tr><td><a href="./custom_diffusion"><strong>Custom Diffusion</strong></a></td> | |
| <td>✅</td> | |
| <td align="center">✅</td> | |
| <td align="center">-</td></tr></tbody></table> | |
| <h2 id="">커뮤니티</h2> | |
| <p>공식 예제 외에도 <strong>커뮤니티 예제</strong> 역시 제공하고 있습니다. 해당 예제들은 우리의 커뮤니티에 의해 관리됩니다. 커뮤니티 예쩨는 학습 예시나 추론 파이프라인으로 구성될 수 있습니다. 이러한 커뮤니티 예시들의 경우, 앞서 정의했던 철학들을 좀 더 관대하게 적용하고 있습니다. 또한 이러한 커뮤니티 예시들의 경우, 모든 이슈들에 대한 유지보수를 보장할 수는 없습니다.</p> | |
| <p>유용하긴 하지만, 아직은 대중적이지 못하거나 저희의 철학에 부합하지 않는 예제들은 <a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">community examples</a> 폴더에 담기게 됩니다.</p> | |
| <p><strong>Note</strong>: 커뮤니티 예제는 <code>diffusers</code>에 기여(contribution)를 희망하는 분들에게 <a href="https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" rel="nofollow">아주 좋은 기여 수단</a>이 될 수 있습니다.</p> | |
| <h2 id="">주목할 사항들</h2> | |
| <p>최신 버전의 예시 코드들의 성공적인 구동을 보장하기 위해서는, 반드시 <strong>소스코드를 통해 <code>diffusers</code>를 설치해야 하며,</strong> 해당 예시 코드들이 요구하는 디펜던시들 역시 설치해야 합니다. 이를 위해 새로운 가상 환경을 구축하고 다음의 명령어를 실행해야 합니다.</p> | |
| <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> | |
| <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> | |
| Copied</div></button></div> | |
| <pre><!-- HTML_TAG_START -->git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers | |
| <span class="hljs-built_in">cd</span> diffusers | |
| pip install .<!-- HTML_TAG_END --></pre></div> | |
| <p>그 다음 <code>cd</code> 명령어를 통해 해당 예제 디렉토리에 접근해서 다음 명령어를 실행하면 됩니다.</p> | |
| <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> | |
| <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> | |
| Copied</div></button></div> | |
| <pre><!-- HTML_TAG_START -->pip install -r requirements.txt<!-- HTML_TAG_END --></pre></div> | |
| <script type="module" data-hydrate="15zof4t"> | |
| import { start } from "/docs/diffusers/v0.19.2/ko/_app/start-hf-doc-builder.js"; | |
| start({ | |
| target: document.querySelector('[data-hydrate="15zof4t"]').parentNode, | |
| paths: {"base":"/docs/diffusers/v0.19.2/ko","assets":"/docs/diffusers/v0.19.2/ko"}, | |
| session: {}, | |
| route: false, | |
| spa: false, | |
| trailing_slash: "never", | |
| hydrate: { | |
| status: 200, | |
| error: null, | |
| nodes: [ | |
| import("/docs/diffusers/v0.19.2/ko/_app/pages/__layout.svelte-hf-doc-builder.js"), | |
| import("/docs/diffusers/v0.19.2/ko/_app/pages/training/overview.mdx-hf-doc-builder.js") | |
| ], | |
| params: {} | |
| } | |
| }); | |
| </script> | |
Xet Storage Details
- Size:
- 13.9 kB
- Xet hash:
- 055b53295750e9f7917df8c0b35742ef12aa43db723c0a3817f9008deea13058
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.