import{s as O,o as ee,n as te}from"../chunks/scheduler.6e0d5ff7.js";import{S as se,i as ie,g as p,s as o,r as J,E as le,h as r,f as s,c as n,j as z,u as T,x as k,k as A,y as oe,a as i,v as $,d as Z,t as U,w as I}from"../chunks/index.d7c1b260.js";import{T as ne}from"../chunks/Tip.c000e27b.js";import{C as K}from"../chunks/CodeBlock.09a08494.js";import{D as ae}from"../chunks/DocNotebookDropdown.b1b23d60.js";import{H as pe,E as re}from"../chunks/EditOnGithub.733546da.js";function me(G){let l,f="🔒 허깅 페이스 허브에서 커뮤니티 파이프라인을 불러오는 것은 곧 해당 코드가 안전하다고 신뢰하는 것입니다. 코드를 자동으로 불러오고 실행하기 앞서 반드시 온라인으로 해당 코드의 신뢰성을 검사하세요!";return{c(){l=p("p"),l.textContent=f},l(a){l=r(a,"P",{"data-svelte-h":!0}),k(l)!=="svelte-52untw"&&(l.textContent=f)},m(a,v){i(a,l,v)},p:te,d(a){a&&s(l)}}}function fe(G){let l,f,a,v,c,W,u,x,d,H='커뮤니티 파이프라인은 논문에 명시된 원래의 구현체와 다른 형태로 구현된 모든 <code>DiffusionPipeline</code> 클래스를 의미합니다. (예를 들어, <code>StableDiffusionControlNetPipeline</code>는 <a href="https://arxiv.org/abs/2302.05543" rel="nofollow">“Text-to-Image Generation with ControlNet Conditioning”</a> 해당) 이들은 추가 기능을 제공하거나 파이프라인의 원래 구현을 확장합니다.',B,b,Q='<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> 모든 공식 커뮤니티 파이프라인을 찾을 수 있습니다.',V,g,D="허브에서 커뮤니티 파이프라인을 로드하려면, 커뮤니티 파이프라인의 리포지토리 ID와 (파이프라인 가중치 및 구성 요소를 로드하려는) 모델의 리포지토리 ID를 인자로 전달해야 합니다. 예를 들어, 아래 예시에서는 <code>hf-internal-testing/diffusers-dummy-pipeline</code>에서 더미 파이프라인을 불러오고, <code>google/ddpm-cifar10-32</code>에서 파이프라인의 가중치와 컴포넌트들을 로드합니다.",P,m,R,h,S,y,Y='공식 커뮤니티 파이프라인을 불러오는 것은 비슷하지만, 공식 리포지토리 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> 컴포넌트를 직접 설정하는 것을 확인할 수 있습니다.',j,w,E,_,q='커뮤니티 파이프라인에 대한 자세한 내용은 <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>에 대한 가이드를 확인하세요 !',L,M,X,C,N;return c=new pe({props:{title:"커스텀 파이프라인 불러오기",local:"커스텀-파이프라인-불러오기",headingTag:"h1"}}),u=new ae({props:{classNames:"absolute z-10 right-0 top-0",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"}]}}),m=new ne({props:{warning:!0,$$slots:{default:[me]},$$scope:{ctx:G}}}),h=new K({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}}),w=new K({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBJbWFnZVByb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQWNsaXBfbW9kZWxfaWQlMjAlM0QlMjAlMjJsYWlvbiUyRkNMSVAtVmlULUItMzItbGFpb24yQi1zMzRCLWI3OUslMjIlMEElMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoY2xpcF9tb2RlbF9pZCklMEFjbGlwX21vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZChjbGlwX21vZGVsX2lkKSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIyY2xpcF9ndWlkZWRfc3RhYmxlX2RpZmZ1c2lvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMGNsaXBfbW9kZWwlM0RjbGlwX21vZGVsJTJDJTBBJTIwJTIwJTIwJTIwZmVhdHVyZV9leHRyYWN0b3IlM0RmZWF0dXJlX2V4dHJhY3RvciUyQyUwQSk=",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;runwayml/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}}),M=new re({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/custom_pipeline_overview.md"}}),{c(){l=p("meta"),f=o(),a=p("p"),v=o(),J(c.$$.fragment),W=o(),J(u.$$.fragment),x=o(),d=p("p"),d.innerHTML=H,B=o(),b=p("p"),b.innerHTML=Q,V=o(),g=p("p"),g.innerHTML=D,P=o(),J(m.$$.fragment),R=o(),J(h.$$.fragment),S=o(),y=p("p"),y.innerHTML=Y,j=o(),J(w.$$.fragment),E=o(),_=p("p"),_.innerHTML=q,L=o(),J(M.$$.fragment),X=o(),C=p("p"),this.h()},l(e){const t=le("svelte-u9bgzb",document.head);l=r(t,"META",{name:!0,content:!0}),t.forEach(s),f=n(e),a=r(e,"P",{}),z(a).forEach(s),v=n(e),T(c.$$.fragment,e),W=n(e),T(u.$$.fragment,e),x=n(e),d=r(e,"P",{"data-svelte-h":!0}),k(d)!=="svelte-piihgu"&&(d.innerHTML=H),B=n(e),b=r(e,"P",{"data-svelte-h":!0}),k(b)!=="svelte-18lvwqp"&&(b.innerHTML=Q),V=n(e),g=r(e,"P",{"data-svelte-h":!0}),k(g)!=="svelte-16aji3q"&&(g.innerHTML=D),P=n(e),T(m.$$.fragment,e),R=n(e),T(h.$$.fragment,e),S=n(e),y=r(e,"P",{"data-svelte-h":!0}),k(y)!=="svelte-ntl3n4"&&(y.innerHTML=Y),j=n(e),T(w.$$.fragment,e),E=n(e),_=r(e,"P",{"data-svelte-h":!0}),k(_)!=="svelte-uvoq7s"&&(_.innerHTML=q),L=n(e),T(M.$$.fragment,e),X=n(e),C=r(e,"P",{}),z(C).forEach(s),this.h()},h(){A(l,"name","hf:doc:metadata"),A(l,"content",ce)},m(e,t){oe(document.head,l),i(e,f,t),i(e,a,t),i(e,v,t),$(c,e,t),i(e,W,t),$(u,e,t),i(e,x,t),i(e,d,t),i(e,B,t),i(e,b,t),i(e,V,t),i(e,g,t),i(e,P,t),$(m,e,t),i(e,R,t),$(h,e,t),i(e,S,t),i(e,y,t),i(e,j,t),$(w,e,t),i(e,E,t),i(e,_,t),i(e,L,t),$(M,e,t),i(e,X,t),i(e,C,t),N=!0},p(e,[t]){const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),m.$set(F)},i(e){N||(Z(c.$$.fragment,e),Z(u.$$.fragment,e),Z(m.$$.fragment,e),Z(h.$$.fragment,e),Z(w.$$.fragment,e),Z(M.$$.fragment,e),N=!0)},o(e){U(c.$$.fragment,e),U(u.$$.fragment,e),U(m.$$.fragment,e),U(h.$$.fragment,e),U(w.$$.fragment,e),U(M.$$.fragment,e),N=!1},d(e){e&&(s(f),s(a),s(v),s(W),s(x),s(d),s(B),s(b),s(V),s(g),s(P),s(R),s(S),s(y),s(j),s(E),s(_),s(L),s(X),s(C)),s(l),I(c,e),I(u,e),I(m,e),I(h,e),I(w,e),I(M,e)}}}const ce='{"title":"커스텀 파이프라인 불러오기","local":"커스텀-파이프라인-불러오기","sections":[],"depth":1}';function ue(G){return ee(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _e extends se{constructor(l){super(),ie(this,l,ue,fe,O,{})}}export{_e as component};
