import{s as Jl,o as al,n as nl}from"../chunks/scheduler.e3739aa0.js";import{S as Tl,i as Ml,g as J,s as p,r as c,E as cl,h as a,f as t,c as i,j as sl,u as f,x as T,k as pl,y as fl,a as s,v as m,d as o,t as d,w}from"../chunks/index.13f5b837.js";import{T as il}from"../chunks/Tip.51dedfeb.js";import{C as U}from"../chunks/CodeBlock.de02009a.js";import{H as te,E as ml}from"../chunks/EditOnGithub.72bac8d8.js";function ol(ee){let n,u='💡 모든 사람이 속도 저하 없이 쉽게 작업을 공유할 수 있도록 커뮤니티 파이프라인을 추가하는 이유에 대한 자세한 내용은 GitHub 이슈 <a href="https://github.com/huggingface/diffusers/issues/841" rel="nofollow">#841</a>를 참조하세요.';return{c(){n=J("p"),n.innerHTML=u},l(M){n=a(M,"P",{"data-svelte-h":!0}),T(n)!=="svelte-12wo01e"&&(n.innerHTML=u)},m(M,r){s(M,n,r)},p:nl,d(M){M&&t(n)}}}function dl(ee){let n,u="💡 커뮤니티 파이프라인 파일에 원하는 패키지를 사용할 수 있습니다. 사용자가 패키지를 설치하기만 하면 모든 것이 정상적으로 작동합니다. 파이프라인이 자동으로 감지되므로 <code>DiffusionPipeline</code>에서 상속하는 파이프라인 클래스가 하나만 있는지 확인하세요.";return{c(){n=J("p"),n.innerHTML=u},l(M){n=a(M,"P",{"data-svelte-h":!0}),T(n)!=="svelte-hoabvs"&&(n.innerHTML=u)},m(M,r){s(M,n,r)},p:nl,d(M){M&&t(n)}}}function wl(ee){let n,u,M,r,Z,se,y,pe,b,Qe="커뮤니티 파이프라인을 사용하면 <code>DiffusionPipeline</code> 위에 원하는 추가 기능을 추가할 수 있습니다. <code>DiffusionPipeline</code> 위에 구축할 때의 가장 큰 장점은 누구나 인수를 하나만 추가하면 파이프라인을 로드하고 사용할 수 있어 커뮤니티가 매우 쉽게 접근할 수 있다는 것입니다.",ie,V,He=`이번 가이드에서는 커뮤니티 파이프라인을 생성하는 방법과 작동 원리를 설명합니다.
간단하게 설명하기 위해 <code>UNet</code>이 단일 forward pass를 수행하고 스케줄러를 한 번 호출하는 “one-step” 파이프라인을 만들겠습니다.`,ne,j,Je,_,xe="커뮤니티 파이프라인을 위한 <code>one_step_unet.py</code> 파일을 생성하는 것으로 시작합니다. 이 파일에서, Hub에서 모델 가중치와 스케줄러 구성을 로드할 수 있도록 <code>DiffusionPipeline</code>을 상속하는 파이프라인 클래스를 생성합니다. one-step 파이프라인에는 <code>UNet</code>과 스케줄러가 필요하므로 이를 <code>__init__</code> 함수에 인수로 추가해야합니다:",ae,B,Te,h,ve="파이프라인과 그 구성요소(<code>unet</code> and <code>scheduler</code>)를 <code>save_pretrained()</code>으로 저장할 수 있도록 하려면 <code>register_modules</code> 함수에 추가하세요:",Me,$,ce,G,Ne="이제 ‘초기화’ 단계가 완료되었으니 forward pass로 이동할 수 있습니다! 🔥",fe,C,me,E,De="Forward pass 에서는(<code>__call__</code>로 정의하는 것이 좋습니다) 원하는 기능을 추가할 수 있는 완전한 창작 자유가 있습니다. 우리의 놀라운 one-step 파이프라인의 경우, 임의의 이미지를 생성하고 <code>timestep=1</code>을 설정하여 <code>unet</code>과 <code>scheduler</code>를 한 번만 호출합니다:",oe,R,de,g,Ae="끝났습니다! 🚀 이제 이 파이프라인에 <code>unet</code>과 <code>scheduler</code>를 전달하여 실행할 수 있습니다:",we,W,ue,X,Pe='하지만 파이프라인 구조가 동일한 경우 기존 가중치를 파이프라인에 로드할 수 있다는 장점이 있습니다. 예를 들어 one-step 파이프라인에 <a href="https://huggingface.co/google/ddpm-cifar10-32" rel="nofollow"><code>google/ddpm-cifar10-32</code></a> 가중치를 로드할 수 있습니다:',Ue,k,re,Q,ye,H,Se='🧨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>의 멋진 파이프라인을 추가하세요.',Ie,x,Fe="병합이 되면, <code>diffusers &gt;= 0.4.0</code>이 설치된 사용자라면 누구나 <code>custom_pipeline</code> 인수에 지정하여 이 파이프라인을 마술처럼 🪄 사용할 수 있습니다:",Ze,v,be,N,Le='커뮤니티 파이프라인을 공유하는 또 다른 방법은 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> 인수에 전달하세요:',Ve,D,je,A,ze="다음 표에서 두 가지 공유 워크플로우를 비교하여 자신에게 가장 적합한 옵션을 결정하는 데 도움이 되는 정보를 확인하세요:",_e,P,Ye="<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>",Be,I,he,S,$e,F,qe="커뮤니티 파이프라인은 <code>DiffusionPipeline</code>을 상속하는 클래스입니다:",Ge,L,Oe="<li><code>custom_pipeline</code> 인수로 로드할 수 있습니다.</li> <li>모델 가중치 및 스케줄러 구성은 <code>pretrained_model_name_or_path</code>에서 로드됩니다.</li> <li>커뮤니티 파이프라인에서 기능을 구현하는 코드는 <code>pipeline.py</code> 파일에 정의되어 있습니다.</li>",Ce,z,Ke="공식 저장소에서 모든 파이프라인 구성 요소 가중치를 로드할 수 없는 경우가 있습니다. 이 경우 다른 구성 요소는 파이프라인에 직접 전달해야 합니다:",Ee,Y,Re,q,el="커뮤니티 파이프라인의 마법은 다음 코드에 담겨 있습니다. 이 코드를 통해 커뮤니티 파이프라인을 GitHub 또는 Hub에서 로드할 수 있으며, 모든 🧨 Diffusers 패키지에서 사용할 수 있습니다.",ge,O,We,K,Xe,le,ke;return Z=new te({props:{title:"커뮤니티 파이프라인에 기여하는 방법",local:"커뮤니티-파이프라인에-기여하는-방법",headingTag:"h1"}}),y=new il({props:{$$slots:{default:[ol]},$$scope:{ctx:ee}}}),j=new te({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 te({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 te({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 il({props:{$$slots:{default:[dl]},$$scope:{ctx:ee}}}),S=new te({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}}),K=new ml({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/contribute_pipeline.md"}}),{c(){n=J("meta"),u=p(),M=J("p"),r=p(),c(Z.$$.fragment),se=p(),c(y.$$.fragment),pe=p(),b=J("p"),b.innerHTML=Qe,ie=p(),V=J("p"),V.innerHTML=He,ne=p(),c(j.$$.fragment),Je=p(),_=J("p"),_.innerHTML=xe,ae=p(),c(B.$$.fragment),Te=p(),h=J("p"),h.innerHTML=ve,Me=p(),c($.$$.fragment),ce=p(),G=J("p"),G.textContent=Ne,fe=p(),c(C.$$.fragment),me=p(),E=J("p"),E.innerHTML=De,oe=p(),c(R.$$.fragment),de=p(),g=J("p"),g.innerHTML=Ae,we=p(),c(W.$$.fragment),ue=p(),X=J("p"),X.innerHTML=Pe,Ue=p(),c(k.$$.fragment),re=p(),c(Q.$$.fragment),ye=p(),H=J("p"),H.innerHTML=Se,Ie=p(),x=J("p"),x.innerHTML=Fe,Ze=p(),c(v.$$.fragment),be=p(),N=J("p"),N.innerHTML=Le,Ve=p(),c(D.$$.fragment),je=p(),A=J("p"),A.textContent=ze,_e=p(),P=J("table"),P.innerHTML=Ye,Be=p(),c(I.$$.fragment),he=p(),c(S.$$.fragment),$e=p(),F=J("p"),F.innerHTML=qe,Ge=p(),L=J("ul"),L.innerHTML=Oe,Ce=p(),z=J("p"),z.textContent=Ke,Ee=p(),c(Y.$$.fragment),Re=p(),q=J("p"),q.textContent=el,ge=p(),c(O.$$.fragment),We=p(),c(K.$$.fragment),Xe=p(),le=J("p"),this.h()},l(e){const l=cl("svelte-u9bgzb",document.head);n=a(l,"META",{name:!0,content:!0}),l.forEach(t),u=i(e),M=a(e,"P",{}),sl(M).forEach(t),r=i(e),f(Z.$$.fragment,e),se=i(e),f(y.$$.fragment,e),pe=i(e),b=a(e,"P",{"data-svelte-h":!0}),T(b)!=="svelte-1vj2gp1"&&(b.innerHTML=Qe),ie=i(e),V=a(e,"P",{"data-svelte-h":!0}),T(V)!=="svelte-1yqrgfi"&&(V.innerHTML=He),ne=i(e),f(j.$$.fragment,e),Je=i(e),_=a(e,"P",{"data-svelte-h":!0}),T(_)!=="svelte-5fbj1k"&&(_.innerHTML=xe),ae=i(e),f(B.$$.fragment,e),Te=i(e),h=a(e,"P",{"data-svelte-h":!0}),T(h)!=="svelte-12abu6a"&&(h.innerHTML=ve),Me=i(e),f($.$$.fragment,e),ce=i(e),G=a(e,"P",{"data-svelte-h":!0}),T(G)!=="svelte-1oaj76m"&&(G.textContent=Ne),fe=i(e),f(C.$$.fragment,e),me=i(e),E=a(e,"P",{"data-svelte-h":!0}),T(E)!=="svelte-126r1dj"&&(E.innerHTML=De),oe=i(e),f(R.$$.fragment,e),de=i(e),g=a(e,"P",{"data-svelte-h":!0}),T(g)!=="svelte-ljwm15"&&(g.innerHTML=Ae),we=i(e),f(W.$$.fragment,e),ue=i(e),X=a(e,"P",{"data-svelte-h":!0}),T(X)!=="svelte-s49756"&&(X.innerHTML=Pe),Ue=i(e),f(k.$$.fragment,e),re=i(e),f(Q.$$.fragment,e),ye=i(e),H=a(e,"P",{"data-svelte-h":!0}),T(H)!=="svelte-16wqhc8"&&(H.innerHTML=Se),Ie=i(e),x=a(e,"P",{"data-svelte-h":!0}),T(x)!=="svelte-1py46g2"&&(x.innerHTML=Fe),Ze=i(e),f(v.$$.fragment,e),be=i(e),N=a(e,"P",{"data-svelte-h":!0}),T(N)!=="svelte-o4261q"&&(N.innerHTML=Le),Ve=i(e),f(D.$$.fragment,e),je=i(e),A=a(e,"P",{"data-svelte-h":!0}),T(A)!=="svelte-x0kpg4"&&(A.textContent=ze),_e=i(e),P=a(e,"TABLE",{"data-svelte-h":!0}),T(P)!=="svelte-1fa9vk"&&(P.innerHTML=Ye),Be=i(e),f(I.$$.fragment,e),he=i(e),f(S.$$.fragment,e),$e=i(e),F=a(e,"P",{"data-svelte-h":!0}),T(F)!=="svelte-rvbdqb"&&(F.innerHTML=qe),Ge=i(e),L=a(e,"UL",{"data-svelte-h":!0}),T(L)!=="svelte-fb5ppv"&&(L.innerHTML=Oe),Ce=i(e),z=a(e,"P",{"data-svelte-h":!0}),T(z)!=="svelte-bn8d96"&&(z.textContent=Ke),Ee=i(e),f(Y.$$.fragment,e),Re=i(e),q=a(e,"P",{"data-svelte-h":!0}),T(q)!=="svelte-dfuazy"&&(q.textContent=el),ge=i(e),f(O.$$.fragment,e),We=i(e),f(K.$$.fragment,e),Xe=i(e),le=a(e,"P",{}),sl(le).forEach(t),this.h()},h(){pl(n,"name","hf:doc:metadata"),pl(n,"content",ul)},m(e,l){fl(document.head,n),s(e,u,l),s(e,M,l),s(e,r,l),m(Z,e,l),s(e,se,l),m(y,e,l),s(e,pe,l),s(e,b,l),s(e,ie,l),s(e,V,l),s(e,ne,l),m(j,e,l),s(e,Je,l),s(e,_,l),s(e,ae,l),m(B,e,l),s(e,Te,l),s(e,h,l),s(e,Me,l),m($,e,l),s(e,ce,l),s(e,G,l),s(e,fe,l),m(C,e,l),s(e,me,l),s(e,E,l),s(e,oe,l),m(R,e,l),s(e,de,l),s(e,g,l),s(e,we,l),m(W,e,l),s(e,ue,l),s(e,X,l),s(e,Ue,l),m(k,e,l),s(e,re,l),m(Q,e,l),s(e,ye,l),s(e,H,l),s(e,Ie,l),s(e,x,l),s(e,Ze,l),m(v,e,l),s(e,be,l),s(e,N,l),s(e,Ve,l),m(D,e,l),s(e,je,l),s(e,A,l),s(e,_e,l),s(e,P,l),s(e,Be,l),m(I,e,l),s(e,he,l),m(S,e,l),s(e,$e,l),s(e,F,l),s(e,Ge,l),s(e,L,l),s(e,Ce,l),s(e,z,l),s(e,Ee,l),m(Y,e,l),s(e,Re,l),s(e,q,l),s(e,ge,l),m(O,e,l),s(e,We,l),m(K,e,l),s(e,Xe,l),s(e,le,l),ke=!0},p(e,[l]){const ll={};l&2&&(ll.$$scope={dirty:l,ctx:e}),y.$set(ll);const tl={};l&2&&(tl.$$scope={dirty:l,ctx:e}),I.$set(tl)},i(e){ke||(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),o(K.$$.fragment,e),ke=!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),d(K.$$.fragment,e),ke=!1},d(e){e&&(t(u),t(M),t(r),t(se),t(pe),t(b),t(ie),t(V),t(ne),t(Je),t(_),t(ae),t(Te),t(h),t(Me),t(ce),t(G),t(fe),t(me),t(E),t(oe),t(de),t(g),t(we),t(ue),t(X),t(Ue),t(re),t(ye),t(H),t(Ie),t(x),t(Ze),t(be),t(N),t(Ve),t(je),t(A),t(_e),t(P),t(Be),t(he),t($e),t(F),t(Ge),t(L),t(Ce),t(z),t(Ee),t(Re),t(q),t(ge),t(We),t(Xe),t(le)),t(n),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),w(K,e)}}}const ul='{"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 Ul(ee){return al(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vl extends Tl{constructor(n){super(),Ml(this,n,Ul,wl,Jl,{})}}export{Vl as component};
