import{s as Jl,o as il,n as pl}from"../chunks/scheduler.6e0d5ff7.js";import{S as nl,i as al,g as n,s as p,r as c,E as Tl,h as a,f as t,c as J,j as ll,u as f,x as T,k as tl,y as Ml,a as s,v as m,d as o,t as d,w}from"../chunks/index.d7c1b260.js";import{T as sl}from"../chunks/Tip.c000e27b.js";import{C as u}from"../chunks/CodeBlock.09a08494.js";import{H as le}from"../chunks/Heading.30a009b0.js";function cl(K){let i,U='💡 모든 사람이 속도 저하 없이 쉽게 작업을 공유할 수 있도록 커뮤니티 파이프라인을 추가하는 이유에 대한 자세한 내용은 GitHub 이슈 <a href="https://github.com/huggingface/diffusers/issues/841" rel="nofollow">#841</a>를 참조하세요.';return{c(){i=n("p"),i.innerHTML=U},l(M){i=a(M,"P",{"data-svelte-h":!0}),T(i)!=="svelte-12wo01e"&&(i.innerHTML=U)},m(M,r){s(M,i,r)},p:pl,d(M){M&&t(i)}}}function fl(K){let i,U="💡 커뮤니티 파이프라인 파일에 원하는 패키지를 사용할 수 있습니다. 사용자가 패키지를 설치하기만 하면 모든 것이 정상적으로 작동합니다. 파이프라인이 자동으로 감지되므로 <code>DiffusionPipeline</code>에서 상속하는 파이프라인 클래스가 하나만 있는지 확인하세요.";return{c(){i=n("p"),i.innerHTML=U},l(M){i=a(M,"P",{"data-svelte-h":!0}),T(i)!=="svelte-hoabvs"&&(i.innerHTML=U)},m(M,r){s(M,i,r)},p:pl,d(M){M&&t(i)}}}function ml(K){let i,U,M,r,Z,te,y,se,b,Xe="커뮤니티 파이프라인을 사용하면 <code>DiffusionPipeline</code> 위에 원하는 추가 기능을 추가할 수 있습니다. <code>DiffusionPipeline</code> 위에 구축할 때의 가장 큰 장점은 누구나 인수를 하나만 추가하면 파이프라인을 로드하고 사용할 수 있어 커뮤니티가 매우 쉽게 접근할 수 있다는 것입니다.",pe,V,ke=`이번 가이드에서는 커뮤니티 파이프라인을 생성하는 방법과 작동 원리를 설명합니다.
간단하게 설명하기 위해 <code>UNet</code>이 단일 forward pass를 수행하고 스케줄러를 한 번 호출하는 “one-step” 파이프라인을 만들겠습니다.`,Je,j,ie,_,Qe="커뮤니티 파이프라인을 위한 <code>one_step_unet.py</code> 파일을 생성하는 것으로 시작합니다. 이 파일에서, Hub에서 모델 가중치와 스케줄러 구성을 로드할 수 있도록 <code>DiffusionPipeline</code>을 상속하는 파이프라인 클래스를 생성합니다. one-step 파이프라인에는 <code>UNet</code>과 스케줄러가 필요하므로 이를 <code>__init__</code> 함수에 인수로 추가해야합니다:",ne,B,ae,h,He="파이프라인과 그 구성요소(<code>unet</code> and <code>scheduler</code>)를 <code>save_pretrained()</code>으로 저장할 수 있도록 하려면 <code>register_modules</code> 함수에 추가하세요:",Te,$,Me,G,xe="이제 ‘초기화’ 단계가 완료되었으니 forward pass로 이동할 수 있습니다! 🔥",ce,C,fe,E,ve="Forward pass 에서는(<code>__call__</code>로 정의하는 것이 좋습니다) 원하는 기능을 추가할 수 있는 완전한 창작 자유가 있습니다. 우리의 놀라운 one-step 파이프라인의 경우, 임의의 이미지를 생성하고 <code>timestep=1</code>을 설정하여 <code>unet</code>과 <code>scheduler</code>를 한 번만 호출합니다:",me,R,oe,g,Ne="끝났습니다! 🚀 이제 이 파이프라인에 <code>unet</code>과 <code>scheduler</code>를 전달하여 실행할 수 있습니다:",de,W,we,X,De='하지만 파이프라인 구조가 동일한 경우 기존 가중치를 파이프라인에 로드할 수 있다는 장점이 있습니다. 예를 들어 one-step 파이프라인에 <a href="https://huggingface.co/google/ddpm-cifar10-32" rel="nofollow"><code>google/ddpm-cifar10-32</code></a> 가중치를 로드할 수 있습니다:',Ue,k,ue,Q,re,H,Ae='🧨Diffusers <a href="https://github.com/huggingface/diffusers" rel="nofollow">리포지토리</a>에서 Pull Request를 열어 <a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">examples/community</a> 하위 폴더에 <code>one_step_unet.py</code>의 멋진 파이프라인을 추가하세요.',ye,x,Pe="병합이 되면, <code>diffusers &gt;= 0.4.0</code>이 설치된 사용자라면 누구나 <code>custom_pipeline</code> 인수에 지정하여 이 파이프라인을 마술처럼 🪄 사용할 수 있습니다:",Ie,v,Ze,N,Se='커뮤니티 파이프라인을 공유하는 또 다른 방법은 Hub 에서 선호하는 <a href="https://huggingface.co/docs/hub/models-uploading" rel="nofollow">모델 리포지토리</a>에 직접  <code>one_step_unet.py</code> 파일을 업로드하는 것입니다. <code>one_step_unet.py</code> 파일을 지정하는 대신 모델 저장소 id를 <code>custom_pipeline</code> 인수에 전달하세요:',be,D,Ve,A,Fe="다음 표에서 두 가지 공유 워크플로우를 비교하여 자신에게 가장 적합한 옵션을 결정하는 데 도움이 되는 정보를 확인하세요:",je,P,Le="<thead><tr><th></th> <th>GitHub 커뮤니티 파이프라인</th> <th>HF Hub 커뮤니티 파이프라인</th></tr></thead> <tbody><tr><td>사용법</td> <td>동일</td> <td>동일</td></tr> <tr><td>리뷰 과정</td> <td>병합하기 전에 GitHub에서 Pull Request를 열고 Diffusers 팀의 검토 과정을 거칩니다. 속도가 느릴 수 있습니다.</td> <td>검토 없이 Hub 저장소에 바로 업로드합니다. 가장 빠른 워크플로우 입니다.</td></tr> <tr><td>가시성</td> <td>공식 Diffusers 저장소 및 문서에 포함되어 있습니다.</td> <td>HF 허브 프로필에 포함되며 가시성을 확보하기 위해 자신의 사용량/프로모션에 의존합니다.</td></tr></tbody>",_e,I,Be,S,he,F,ze="커뮤니티 파이프라인은 <code>DiffusionPipeline</code>을 상속하는 클래스입니다:",$e,L,Ye="<li><code>custom_pipeline</code> 인수로 로드할 수 있습니다.</li> <li>모델 가중치 및 스케줄러 구성은 <code>pretrained_model_name_or_path</code>에서 로드됩니다.</li> <li>커뮤니티 파이프라인에서 기능을 구현하는 코드는 <code>pipeline.py</code> 파일에 정의되어 있습니다.</li>",Ge,z,qe="공식 저장소에서 모든 파이프라인 구성 요소 가중치를 로드할 수 없는 경우가 있습니다. 이 경우 다른 구성 요소는 파이프라인에 직접 전달해야 합니다:",Ce,Y,Ee,q,Oe="커뮤니티 파이프라인의 마법은 다음 코드에 담겨 있습니다. 이 코드를 통해 커뮤니티 파이프라인을 GitHub 또는 Hub에서 로드할 수 있으며, 모든 🧨 Diffusers 패키지에서 사용할 수 있습니다.",Re,O,ge,ee,We;return Z=new le({props:{title:"커뮤니티 파이프라인에 기여하는 방법",local:"커뮤니티-파이프라인에-기여하는-방법",headingTag:"h1"}}),y=new sl({props:{$$slots:{default:[cl]},$$scope:{ctx:K}}}),j=new le({props:{title:"파이프라인 초기화",local:"파이프라인-초기화",headingTag:"h2"}}),B=new u({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEElMEFjbGFzcyUyMFVuZXRTY2hlZHVsZXJPbmVGb3J3YXJkUGlwZWxpbmUoRGlmZnVzaW9uUGlwZWxpbmUpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMHVuZXQlMkMlMjBzY2hlZHVsZXIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch


<span class="hljs-keyword">class</span> <span class="hljs-title class_">UnetSchedulerOneForwardPipeline</span>(<span class="hljs-title class_ inherited__">DiffusionPipeline</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, unet, scheduler</span>):
        <span class="hljs-built_in">super</span>().__init__()`,wrap:!1}}),$=new u({props:{code:"JTIwJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTIwJTIwaW1wb3J0JTIwdG9yY2glMEElMEElMjAlMjBjbGFzcyUyMFVuZXRTY2hlZHVsZXJPbmVGb3J3YXJkUGlwZWxpbmUoRGlmZnVzaW9uUGlwZWxpbmUpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMHVuZXQlMkMlMjBzY2hlZHVsZXIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5yZWdpc3Rlcl9tb2R1bGVzKHVuZXQlM0R1bmV0JTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKQ==",highlighted:`  from diffusers import DiffusionPipeline
  import torch

  class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
      def __init__(self, unet, scheduler):
          super().__init__()

<span class="hljs-addition">+         self.register_modules(unet=unet, scheduler=scheduler)</span>`,wrap:!1}}),C=new le({props:{title:"Forward pass 정의",local:"forward-pass-정의",headingTag:"h2"}}),R=new u({props:{code:"JTIwJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTIwJTIwaW1wb3J0JTIwdG9yY2glMEElMEElMEElMjAlMjBjbGFzcyUyMFVuZXRTY2hlZHVsZXJPbmVGb3J3YXJkUGlwZWxpbmUoRGlmZnVzaW9uUGlwZWxpbmUpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMHVuZXQlMkMlMjBzY2hlZHVsZXIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5yZWdpc3Rlcl9tb2R1bGVzKHVuZXQlM0R1bmV0JTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKSUwQSUwQSUyQiUyMCUyMCUyMCUyMCUyMGRlZiUyMF9fY2FsbF9fKHNlbGYpJTNBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjB0b3JjaC5yYW5kbiglMEElMkIlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAoMSUyQyUyMHNlbGYudW5ldC5jb25maWcuaW5fY2hhbm5lbHMlMkMlMjBzZWxmLnVuZXQuY29uZmlnLnNhbXBsZV9zaXplJTJDJTIwc2VsZi51bmV0LmNvbmZpZy5zYW1wbGVfc2l6ZSklMkMlMEElMkIlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjApJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdGltZXN0ZXAlMjAlM0QlMjAxJTBBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9kZWxfb3V0cHV0JTIwJTNEJTIwc2VsZi51bmV0KGltYWdlJTJDJTIwdGltZXN0ZXApLnNhbXBsZSUwQSUyQiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNjaGVkdWxlcl9vdXRwdXQlMjAlM0QlMjBzZWxmLnNjaGVkdWxlci5zdGVwKG1vZGVsX291dHB1dCUyQyUyMHRpbWVzdGVwJTJDJTIwaW1hZ2UpLnByZXZfc2FtcGxlJTBBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwc2NoZWR1bGVyX291dHB1dA==",highlighted:`  from diffusers import DiffusionPipeline
  import torch


  class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
      def __init__(self, unet, scheduler):
          super().__init__()

          self.register_modules(unet=unet, scheduler=scheduler)

<span class="hljs-addition">+     def __call__(self):</span>
<span class="hljs-addition">+         image = torch.randn(</span>
<span class="hljs-addition">+             (1, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size),</span>
<span class="hljs-addition">+         )</span>
<span class="hljs-addition">+         timestep = 1</span>

<span class="hljs-addition">+         model_output = self.unet(image, timestep).sample</span>
<span class="hljs-addition">+         scheduler_output = self.scheduler.step(model_output, timestep, image).prev_sample</span>

<span class="hljs-addition">+         return scheduler_output</span>`,wrap:!1}}),W=new u({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEREUE1TY2hlZHVsZXIlMkMlMjBVTmV0MkRNb2RlbCUwQSUwQXNjaGVkdWxlciUyMCUzRCUyMEREUE1TY2hlZHVsZXIoKSUwQXVuZXQlMjAlM0QlMjBVTmV0MkRNb2RlbCgpJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBVbmV0U2NoZWR1bGVyT25lRm9yd2FyZFBpcGVsaW5lKHVuZXQlM0R1bmV0JTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKSUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGVsaW5lKCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDPMScheduler, UNet2DModel

scheduler = DDPMScheduler()
unet = UNet2DModel()

pipeline = UnetSchedulerOneForwardPipeline(unet=unet, scheduler=scheduler)

output = pipeline()`,wrap:!1}}),k=new u({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBVbmV0U2NoZWR1bGVyT25lRm9yd2FyZFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIpJTBBJTBBb3V0cHV0JTIwJTNEJTIwcGlwZWxpbmUoKQ==",highlighted:`pipeline = UnetSchedulerOneForwardPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>)

output = pipeline()`,wrap:!1}}),Q=new le({props:{title:"파이프라인 공유",local:"파이프라인-공유",headingTag:"h2"}}),v=new u({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMkMlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJvbmVfc3RlcF91bmV0JTIyKSUwQXBpcGUoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;one_step_unet&quot;</span>)
pipe()`,wrap:!1}}),D=new u({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyJTJDJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIyc3RldmhsaXUlMkZvbmVfc3RlcF91bmV0JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;stevhliu/one_step_unet&quot;</span>)`,wrap:!1}}),I=new sl({props:{$$slots:{default:[fl]},$$scope:{ctx:K}}}),S=new le({props:{title:"커뮤니티 파이프라인은 어떻게 작동하나요?",local:"커뮤니티-파이프라인은-어떻게-작동하나요",headingTag:"h2"}}),Y=new u({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBGZWF0dXJlRXh0cmFjdG9yJTJDJTIwQ0xJUE1vZGVsJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTBBY2xpcF9tb2RlbF9pZCUyMCUzRCUyMCUyMmxhaW9uJTJGQ0xJUC1WaVQtQi0zMi1sYWlvbjJCLXMzNEItYjc5SyUyMiUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwQ0xJUEZlYXR1cmVFeHRyYWN0b3IuZnJvbV9wcmV0cmFpbmVkKGNsaXBfbW9kZWxfaWQpJTBBY2xpcF9tb2RlbCUyMCUzRCUyMENMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoY2xpcF9tb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUwQSUyMCUyMCUyMCUyMGN1c3RvbV9waXBlbGluZSUzRCUyMmNsaXBfZ3VpZGVkX3N0YWJsZV9kaWZmdXNpb24lMjIlMkMlMEElMjAlMjAlMjAlMjBjbGlwX21vZGVsJTNEY2xpcF9tb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGZlYXR1cmVfZXh0cmFjdG9yJTNEZmVhdHVyZV9leHRyYWN0b3IlMkMlMEElMjAlMjAlMjAlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPFeatureExtractor, CLIPModel

model_id = <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>
clip_model_id = <span class="hljs-string">&quot;laion/CLIP-ViT-B-32-laion2B-s34B-b79K&quot;</span>

feature_extractor = CLIPFeatureExtractor.from_pretrained(clip_model_id)
clip_model = CLIPModel.from_pretrained(clip_model_id, torch_dtype=torch.float16)

pipeline = DiffusionPipeline.from_pretrained(
    model_id,
    custom_pipeline=<span class="hljs-string">&quot;clip_guided_stable_diffusion&quot;</span>,
    clip_model=clip_model,
    feature_extractor=feature_extractor,
    scheduler=scheduler,
    torch_dtype=torch.float16,
)`,wrap:!1}}),O=new u({props:{code:"JTIzJTIwMi4lMjAlRUQlOEMlOEMlRUMlOUQlQjQlRUQlOTQlODQlRUIlOUQlQkMlRUMlOUQlQjglMjAlRUQlODElQjQlRUIlOUUlOTglRUMlOEElQTQlRUIlQTUlQkMlMjAlRUIlQTElOUMlRUIlOTMlOUMlRUQlOTUlQTklRUIlOEIlODglRUIlOEIlQTQuJTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVDJTlFJTkwJTIwJUVDJUE3JTgwJUVDJUEwJTk1JTIwJUVCJUFBJUE4JUVCJTkzJTg4JUVDJTlEJTg0JTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVEJTk1JTk4JUVCJThBJTk0JTIwJUVBJUIyJUJEJUVDJTlBJUIwJTIwSHViJUVDJTk3JTkwJUVDJTg0JTlDJTIwJUVCJUExJTlDJUVCJTkzJTlDJUVEJTk1JUE5JUVCJThCJTg4JUVCJThCJUE0JTBBJTIzJTIwJUVCJUFBJTg1JUVDJThCJTlDJUVDJUEwJTgxJTIwJUVEJTgxJUI0JUVCJTlFJTk4JUVDJThBJUE0JUVDJTk3JTkwJUVDJTg0JTlDJTIwJUVCJUExJTlDJUVCJTkzJTlDJUVEJTk1JTk4JUVCJThBJTk0JTIwJUVBJUIyJUJEJUVDJTlBJUIwJTJDJTIwJUVDJTlEJUI0JUVCJUE1JUJDJTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVEJTk1JUI0JTIwJUVCJUIzJUI0JUVBJUIyJUEwJUVDJThBJUI1JUVCJThCJTg4JUVCJThCJUE0LiUwQWlmJTIwY3VzdG9tX3BpcGVsaW5lJTIwaXMlMjBub3QlMjBOb25lJTNBJTBBJTIwJTIwJTIwJTIwcGlwZWxpbmVfY2xhc3MlMjAlM0QlMjBnZXRfY2xhc3NfZnJvbV9keW5hbWljX21vZHVsZSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjdXN0b21fcGlwZWxpbmUlMkMlMjBtb2R1bGVfZmlsZSUzRENVU1RPTV9QSVBFTElORV9GSUxFX05BTUUlMkMlMjBjYWNoZV9kaXIlM0RjdXN0b21fcGlwZWxpbmUlMEElMjAlMjAlMjAlMjApJTBBZWxpZiUyMGNscyUyMCElM0QlMjBEaWZmdXNpb25QaXBlbGluZSUzQSUwQSUyMCUyMCUyMCUyMHBpcGVsaW5lX2NsYXNzJTIwJTNEJTIwY2xzJTBBZWxzZSUzQSUwQSUyMCUyMCUyMCUyMGRpZmZ1c2Vyc19tb2R1bGUlMjAlM0QlMjBpbXBvcnRsaWIuaW1wb3J0X21vZHVsZShjbHMuX19tb2R1bGVfXy5zcGxpdCglMjIuJTIyKSU1QjAlNUQpJTBBJTIwJTIwJTIwJTIwcGlwZWxpbmVfY2xhc3MlMjAlM0QlMjBnZXRhdHRyKGRpZmZ1c2Vyc19tb2R1bGUlMkMlMjBjb25maWdfZGljdCU1QiUyMl9jbGFzc19uYW1lJTIyJTVEKQ==",highlighted:`<span class="hljs-comment"># 2. 파이프라인 클래스를 로드합니다. 사용자 지정 모듈을 사용하는 경우 Hub에서 로드합니다</span>
<span class="hljs-comment"># 명시적 클래스에서 로드하는 경우, 이를 사용해 보겠습니다.</span>
<span class="hljs-keyword">if</span> custom_pipeline <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:
    pipeline_class = get_class_from_dynamic_module(
        custom_pipeline, module_file=CUSTOM_PIPELINE_FILE_NAME, cache_dir=custom_pipeline
    )
<span class="hljs-keyword">elif</span> cls != DiffusionPipeline:
    pipeline_class = cls
<span class="hljs-keyword">else</span>:
    diffusers_module = importlib.import_module(cls.__module__.split(<span class="hljs-string">&quot;.&quot;</span>)[<span class="hljs-number">0</span>])
    pipeline_class = <span class="hljs-built_in">getattr</span>(diffusers_module, config_dict[<span class="hljs-string">&quot;_class_name&quot;</span>])`,wrap:!1}}),{c(){i=n("meta"),U=p(),M=n("p"),r=p(),c(Z.$$.fragment),te=p(),c(y.$$.fragment),se=p(),b=n("p"),b.innerHTML=Xe,pe=p(),V=n("p"),V.innerHTML=ke,Je=p(),c(j.$$.fragment),ie=p(),_=n("p"),_.innerHTML=Qe,ne=p(),c(B.$$.fragment),ae=p(),h=n("p"),h.innerHTML=He,Te=p(),c($.$$.fragment),Me=p(),G=n("p"),G.textContent=xe,ce=p(),c(C.$$.fragment),fe=p(),E=n("p"),E.innerHTML=ve,me=p(),c(R.$$.fragment),oe=p(),g=n("p"),g.innerHTML=Ne,de=p(),c(W.$$.fragment),we=p(),X=n("p"),X.innerHTML=De,Ue=p(),c(k.$$.fragment),ue=p(),c(Q.$$.fragment),re=p(),H=n("p"),H.innerHTML=Ae,ye=p(),x=n("p"),x.innerHTML=Pe,Ie=p(),c(v.$$.fragment),Ze=p(),N=n("p"),N.innerHTML=Se,be=p(),c(D.$$.fragment),Ve=p(),A=n("p"),A.textContent=Fe,je=p(),P=n("table"),P.innerHTML=Le,_e=p(),c(I.$$.fragment),Be=p(),c(S.$$.fragment),he=p(),F=n("p"),F.innerHTML=ze,$e=p(),L=n("ul"),L.innerHTML=Ye,Ge=p(),z=n("p"),z.textContent=qe,Ce=p(),c(Y.$$.fragment),Ee=p(),q=n("p"),q.textContent=Oe,Re=p(),c(O.$$.fragment),ge=p(),ee=n("p"),this.h()},l(e){const l=Tl("svelte-u9bgzb",document.head);i=a(l,"META",{name:!0,content:!0}),l.forEach(t),U=J(e),M=a(e,"P",{}),ll(M).forEach(t),r=J(e),f(Z.$$.fragment,e),te=J(e),f(y.$$.fragment,e),se=J(e),b=a(e,"P",{"data-svelte-h":!0}),T(b)!=="svelte-1vj2gp1"&&(b.innerHTML=Xe),pe=J(e),V=a(e,"P",{"data-svelte-h":!0}),T(V)!=="svelte-1yqrgfi"&&(V.innerHTML=ke),Je=J(e),f(j.$$.fragment,e),ie=J(e),_=a(e,"P",{"data-svelte-h":!0}),T(_)!=="svelte-5fbj1k"&&(_.innerHTML=Qe),ne=J(e),f(B.$$.fragment,e),ae=J(e),h=a(e,"P",{"data-svelte-h":!0}),T(h)!=="svelte-12abu6a"&&(h.innerHTML=He),Te=J(e),f($.$$.fragment,e),Me=J(e),G=a(e,"P",{"data-svelte-h":!0}),T(G)!=="svelte-1oaj76m"&&(G.textContent=xe),ce=J(e),f(C.$$.fragment,e),fe=J(e),E=a(e,"P",{"data-svelte-h":!0}),T(E)!=="svelte-126r1dj"&&(E.innerHTML=ve),me=J(e),f(R.$$.fragment,e),oe=J(e),g=a(e,"P",{"data-svelte-h":!0}),T(g)!=="svelte-ljwm15"&&(g.innerHTML=Ne),de=J(e),f(W.$$.fragment,e),we=J(e),X=a(e,"P",{"data-svelte-h":!0}),T(X)!=="svelte-s49756"&&(X.innerHTML=De),Ue=J(e),f(k.$$.fragment,e),ue=J(e),f(Q.$$.fragment,e),re=J(e),H=a(e,"P",{"data-svelte-h":!0}),T(H)!=="svelte-16wqhc8"&&(H.innerHTML=Ae),ye=J(e),x=a(e,"P",{"data-svelte-h":!0}),T(x)!=="svelte-1py46g2"&&(x.innerHTML=Pe),Ie=J(e),f(v.$$.fragment,e),Ze=J(e),N=a(e,"P",{"data-svelte-h":!0}),T(N)!=="svelte-o4261q"&&(N.innerHTML=Se),be=J(e),f(D.$$.fragment,e),Ve=J(e),A=a(e,"P",{"data-svelte-h":!0}),T(A)!=="svelte-x0kpg4"&&(A.textContent=Fe),je=J(e),P=a(e,"TABLE",{"data-svelte-h":!0}),T(P)!=="svelte-1fa9vk"&&(P.innerHTML=Le),_e=J(e),f(I.$$.fragment,e),Be=J(e),f(S.$$.fragment,e),he=J(e),F=a(e,"P",{"data-svelte-h":!0}),T(F)!=="svelte-rvbdqb"&&(F.innerHTML=ze),$e=J(e),L=a(e,"UL",{"data-svelte-h":!0}),T(L)!=="svelte-fb5ppv"&&(L.innerHTML=Ye),Ge=J(e),z=a(e,"P",{"data-svelte-h":!0}),T(z)!=="svelte-bn8d96"&&(z.textContent=qe),Ce=J(e),f(Y.$$.fragment,e),Ee=J(e),q=a(e,"P",{"data-svelte-h":!0}),T(q)!=="svelte-dfuazy"&&(q.textContent=Oe),Re=J(e),f(O.$$.fragment,e),ge=J(e),ee=a(e,"P",{}),ll(ee).forEach(t),this.h()},h(){tl(i,"name","hf:doc:metadata"),tl(i,"content",ol)},m(e,l){Ml(document.head,i),s(e,U,l),s(e,M,l),s(e,r,l),m(Z,e,l),s(e,te,l),m(y,e,l),s(e,se,l),s(e,b,l),s(e,pe,l),s(e,V,l),s(e,Je,l),m(j,e,l),s(e,ie,l),s(e,_,l),s(e,ne,l),m(B,e,l),s(e,ae,l),s(e,h,l),s(e,Te,l),m($,e,l),s(e,Me,l),s(e,G,l),s(e,ce,l),m(C,e,l),s(e,fe,l),s(e,E,l),s(e,me,l),m(R,e,l),s(e,oe,l),s(e,g,l),s(e,de,l),m(W,e,l),s(e,we,l),s(e,X,l),s(e,Ue,l),m(k,e,l),s(e,ue,l),m(Q,e,l),s(e,re,l),s(e,H,l),s(e,ye,l),s(e,x,l),s(e,Ie,l),m(v,e,l),s(e,Ze,l),s(e,N,l),s(e,be,l),m(D,e,l),s(e,Ve,l),s(e,A,l),s(e,je,l),s(e,P,l),s(e,_e,l),m(I,e,l),s(e,Be,l),m(S,e,l),s(e,he,l),s(e,F,l),s(e,$e,l),s(e,L,l),s(e,Ge,l),s(e,z,l),s(e,Ce,l),m(Y,e,l),s(e,Ee,l),s(e,q,l),s(e,Re,l),m(O,e,l),s(e,ge,l),s(e,ee,l),We=!0},p(e,[l]){const Ke={};l&2&&(Ke.$$scope={dirty:l,ctx:e}),y.$set(Ke);const el={};l&2&&(el.$$scope={dirty:l,ctx:e}),I.$set(el)},i(e){We||(o(Z.$$.fragment,e),o(y.$$.fragment,e),o(j.$$.fragment,e),o(B.$$.fragment,e),o($.$$.fragment,e),o(C.$$.fragment,e),o(R.$$.fragment,e),o(W.$$.fragment,e),o(k.$$.fragment,e),o(Q.$$.fragment,e),o(v.$$.fragment,e),o(D.$$.fragment,e),o(I.$$.fragment,e),o(S.$$.fragment,e),o(Y.$$.fragment,e),o(O.$$.fragment,e),We=!0)},o(e){d(Z.$$.fragment,e),d(y.$$.fragment,e),d(j.$$.fragment,e),d(B.$$.fragment,e),d($.$$.fragment,e),d(C.$$.fragment,e),d(R.$$.fragment,e),d(W.$$.fragment,e),d(k.$$.fragment,e),d(Q.$$.fragment,e),d(v.$$.fragment,e),d(D.$$.fragment,e),d(I.$$.fragment,e),d(S.$$.fragment,e),d(Y.$$.fragment,e),d(O.$$.fragment,e),We=!1},d(e){e&&(t(U),t(M),t(r),t(te),t(se),t(b),t(pe),t(V),t(Je),t(ie),t(_),t(ne),t(ae),t(h),t(Te),t(Me),t(G),t(ce),t(fe),t(E),t(me),t(oe),t(g),t(de),t(we),t(X),t(Ue),t(ue),t(re),t(H),t(ye),t(x),t(Ie),t(Ze),t(N),t(be),t(Ve),t(A),t(je),t(P),t(_e),t(Be),t(he),t(F),t($e),t(L),t(Ge),t(z),t(Ce),t(Ee),t(q),t(Re),t(ge),t(ee)),t(i),w(Z,e),w(y,e),w(j,e),w(B,e),w($,e),w(C,e),w(R,e),w(W,e),w(k,e),w(Q,e),w(v,e),w(D,e),w(I,e),w(S,e),w(Y,e),w(O,e)}}}const ol='{"title":"커뮤니티 파이프라인에 기여하는 방법","local":"커뮤니티-파이프라인에-기여하는-방법","sections":[{"title":"파이프라인 초기화","local":"파이프라인-초기화","sections":[],"depth":2},{"title":"Forward pass 정의","local":"forward-pass-정의","sections":[],"depth":2},{"title":"파이프라인 공유","local":"파이프라인-공유","sections":[],"depth":2},{"title":"커뮤니티 파이프라인은 어떻게 작동하나요?","local":"커뮤니티-파이프라인은-어떻게-작동하나요","sections":[],"depth":2}],"depth":1}';function dl(K){return il(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Il extends nl{constructor(i){super(),al(this,i,dl,ml,Jl,{})}}export{Il as component};
