import{s as te,n as le,o as ie}from"../chunks/scheduler.23542ac5.js";import{S as se,i as oe,e as a,s,c as _,h as ne,a as p,d as l,b as o,f as O,g as v,j as Z,k as Q,l as ae,m as i,n as U,t as $,o as T,p as C}from"../chunks/index.9b1f405b.js";import{C as pe,H as re,E as me}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.cf8449cd.js";import{C as ee}from"../chunks/CodeBlock.6a4e8f39.js";import{D as fe}from"../chunks/DocNotebookDropdown.68a629d2.js";function ce(q){let n,G,k,x,m,V,f,W,c,j,u,D='커뮤니티 파이프라인은 논문에 명시된 원래의 구현체와 다른 형태로 구현된 모든 <code>DiffusionPipeline</code> 클래스를 의미합니다. (예를 들어, <code>StableDiffusionControlNetPipeline</code>는 <a href="https://huggingface.co/papers/2302.05543" rel="nofollow">“Text-to-Image Generation with ControlNet Conditioning”</a> 해당) 이들은 추가 기능을 제공하거나 파이프라인의 원래 구현을 확장합니다.',S,d,Y='<a href="https://github.com/huggingface/diffusers/tree/main/examples/community#speech-to-image" rel="nofollow">Speech to Image</a> 또는 <a href="https://github.com/huggingface/diffusers/tree/main/examples/community#composable-stable-diffusion" rel="nofollow">Composable Stable Diffusion</a> 과 같은 멋진 커뮤니티 파이프라인이 많이 있으며 <a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">여기에서</a> 모든 공식 커뮤니티 파이프라인을 찾을 수 있습니다.',B,b,F="허브에서 커뮤니티 파이프라인을 로드하려면, 커뮤니티 파이프라인의 리포지토리 ID와 (파이프라인 가중치 및 구성 요소를 로드하려는) 모델의 리포지토리 ID를 인자로 전달해야 합니다. 예를 들어, 아래 예시에서는 <code>hf-internal-testing/diffusers-dummy-pipeline</code>에서 더미 파이프라인을 불러오고, <code>google/ddpm-cifar10-32</code>에서 파이프라인의 가중치와 컴포넌트들을 로드합니다.",I,r,z="<p>🔒 허깅 페이스 허브에서 커뮤니티 파이프라인을 불러오는 것은 곧 해당 코드가 안전하다고 신뢰하는 것입니다. 코드를 자동으로 불러오고 실행하기 앞서 반드시 온라인으로 해당 코드의 신뢰성을 검사하세요!</p>",E,y,N,g,A='공식 커뮤니티 파이프라인을 불러오는 것은 비슷하지만, 공식 리포지토리 ID에서 가중치를 불러오는 것과 더불어 해당 파이프라인 내의 컴포넌트를 직접 지정하는 것 역시 가능합니다. 아래 예제를 보면 커뮤니티 <a href="https://github.com/huggingface/diffusers/tree/main/examples/community#clip-guided-stable-diffusion" rel="nofollow">CLIP Guided Stable Diffusion</a> 파이프라인을 로드할 때, 해당 파이프라인에서 사용할 <code>clip_model</code> 컴포넌트와 <code>feature_extractor</code> 컴포넌트를 직접 설정하는 것을 확인할 수 있습니다.',P,h,L,M,K='커뮤니티 파이프라인에 대한 자세한 내용은 <a href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/custom_pipeline_examples" rel="nofollow">커뮤니티 파이프라인</a> 가이드를 살펴보세요. 커뮤니티 파이프라인 등록에 관심이 있는 경우 <a href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/contribute_pipeline" rel="nofollow">커뮤니티 파이프라인에 기여하는 방법</a>에 대한 가이드를 확인하세요 !',X,w,R,J,H;return m=new pe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new fe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/custom_pipeline_overview.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/custom_pipeline_overview.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/custom_pipeline_overview.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/custom_pipeline_overview.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/custom_pipeline_overview.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/custom_pipeline_overview.ipynb"}]}}),c=new re({props:{title:"커스텀 파이프라인 불러오기",local:"커스텀-파이프라인-불러오기",headingTag:"h1"}}),y=new ee({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyJTJDJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1kdW1teS1waXBlbGluZSUyMiUwQSk=",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;hf-internal-testing/diffusers-dummy-pipeline&quot;</span>
)`,wrap:!1}}),h=new ee({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBJbWFnZVByb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQWNsaXBfbW9kZWxfaWQlMjAlM0QlMjAlMjJsYWlvbiUyRkNMSVAtVmlULUItMzItbGFpb24yQi1zMzRCLWI3OUslMjIlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoY2xpcF9tb2RlbF9pZCklMEFjbGlwX21vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZChjbGlwX21vZGVsX2lkKSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUwQSUyMCUyMCUyMCUyMGN1c3RvbV9waXBlbGluZSUzRCUyMmNsaXBfZ3VpZGVkX3N0YWJsZV9kaWZmdXNpb24lMjIlMkMlMEElMjAlMjAlMjAlMjBjbGlwX21vZGVsJTNEY2xpcF9tb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGZlYXR1cmVfZXh0cmFjdG9yJTNEZmVhdHVyZV9leHRyYWN0b3IlMkMlMEEp",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> CLIPImageProcessor, CLIPModel

clip_model_id = <span class="hljs-string">&quot;laion/CLIP-ViT-B-32-laion2B-s34B-b79K&quot;</span>

feature_extractor = CLIPImageProcessor.from_pretrained(clip_model_id)
clip_model = CLIPModel.from_pretrained(clip_model_id)

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>,
    custom_pipeline=<span class="hljs-string">&quot;clip_guided_stable_diffusion&quot;</span>,
    clip_model=clip_model,
    feature_extractor=feature_extractor,
)`,wrap:!1}}),w=new me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/custom_pipeline_overview.md"}}),{c(){n=a("meta"),G=s(),k=a("p"),x=s(),_(m.$$.fragment),V=s(),_(f.$$.fragment),W=s(),_(c.$$.fragment),j=s(),u=a("p"),u.innerHTML=D,S=s(),d=a("p"),d.innerHTML=Y,B=s(),b=a("p"),b.innerHTML=F,I=s(),r=a("blockquote"),r.innerHTML=z,E=s(),_(y.$$.fragment),N=s(),g=a("p"),g.innerHTML=A,P=s(),_(h.$$.fragment),L=s(),M=a("p"),M.innerHTML=K,X=s(),_(w.$$.fragment),R=s(),J=a("p"),this.h()},l(e){const t=ne("svelte-u9bgzb",document.head);n=p(t,"META",{name:!0,content:!0}),t.forEach(l),G=o(e),k=p(e,"P",{}),O(k).forEach(l),x=o(e),v(m.$$.fragment,e),V=o(e),v(f.$$.fragment,e),W=o(e),v(c.$$.fragment,e),j=o(e),u=p(e,"P",{"data-svelte-h":!0}),Z(u)!=="svelte-1yp19et"&&(u.innerHTML=D),S=o(e),d=p(e,"P",{"data-svelte-h":!0}),Z(d)!=="svelte-18lvwqp"&&(d.innerHTML=Y),B=o(e),b=p(e,"P",{"data-svelte-h":!0}),Z(b)!=="svelte-16aji3q"&&(b.innerHTML=F),I=o(e),r=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),Z(r)!=="svelte-v9c00"&&(r.innerHTML=z),E=o(e),v(y.$$.fragment,e),N=o(e),g=p(e,"P",{"data-svelte-h":!0}),Z(g)!=="svelte-ntl3n4"&&(g.innerHTML=A),P=o(e),v(h.$$.fragment,e),L=o(e),M=p(e,"P",{"data-svelte-h":!0}),Z(M)!=="svelte-uvoq7s"&&(M.innerHTML=K),X=o(e),v(w.$$.fragment,e),R=o(e),J=p(e,"P",{}),O(J).forEach(l),this.h()},h(){Q(n,"name","hf:doc:metadata"),Q(n,"content",ue),Q(r,"class","warning")},m(e,t){ae(document.head,n),i(e,G,t),i(e,k,t),i(e,x,t),U(m,e,t),i(e,V,t),U(f,e,t),i(e,W,t),U(c,e,t),i(e,j,t),i(e,u,t),i(e,S,t),i(e,d,t),i(e,B,t),i(e,b,t),i(e,I,t),i(e,r,t),i(e,E,t),U(y,e,t),i(e,N,t),i(e,g,t),i(e,P,t),U(h,e,t),i(e,L,t),i(e,M,t),i(e,X,t),U(w,e,t),i(e,R,t),i(e,J,t),H=!0},p:le,i(e){H||($(m.$$.fragment,e),$(f.$$.fragment,e),$(c.$$.fragment,e),$(y.$$.fragment,e),$(h.$$.fragment,e),$(w.$$.fragment,e),H=!0)},o(e){T(m.$$.fragment,e),T(f.$$.fragment,e),T(c.$$.fragment,e),T(y.$$.fragment,e),T(h.$$.fragment,e),T(w.$$.fragment,e),H=!1},d(e){e&&(l(G),l(k),l(x),l(V),l(W),l(j),l(u),l(S),l(d),l(B),l(b),l(I),l(r),l(E),l(N),l(g),l(P),l(L),l(M),l(X),l(R),l(J)),l(n),C(m,e),C(f,e),C(c,e),C(y,e),C(h,e),C(w,e)}}}const ue='{"title":"커스텀 파이프라인 불러오기","local":"커스텀-파이프라인-불러오기","sections":[],"depth":1}';function de(q){return ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class we extends se{constructor(n){super(),oe(this,n,de,ce,te,{})}}export{we as component};
