import{s as ht,B as _t,o as wt,n as Tt}from"../chunks/scheduler.e3739aa0.js";import{S as vt,i as Jt,g as s,s as l,r as g,E as xt,h as f,f as n,c as o,j as at,u as c,x as m,k as j,y as kt,a as i,v as b,d as $,t as d,w as h}from"../chunks/index.13f5b837.js";import{T as yt}from"../chunks/Tip.51dedfeb.js";import{C as ot}from"../chunks/CodeBlock.de02009a.js";import{D as Ct}from"../chunks/DocNotebookDropdown.5cbf7847.js";import{H as Pt,E as Mt}from"../chunks/EditOnGithub.72bac8d8.js";function Ft(q){let a,_="💡 나만의 unconditional 이미지 생성 모델을 학습시키고 싶으신가요? 학습 가이드를 살펴보고 나만의 이미지를 생성하는 방법을 알아보세요.";return{c(){a=s("p"),a.textContent=_},l(r){a=f(r,"P",{"data-svelte-h":!0}),m(a)!=="svelte-1rcr7p4"&&(a.textContent=_)},m(r,G){i(r,a,G)},p:Tt,d(r){r&&n(a)}}}function Zt(q){let a,_,r,G,w,L,T,D,v,st="Unconditional 이미지 생성은 비교적 간단한 작업입니다. 모델이 텍스트나 이미지와 같은 추가 조건 없이 이미 학습된 학습 데이터와 유사한 이미지만 생성합니다.",H,J,ft="[‘DiffusionPipeline’]은 추론을 위해 미리 학습된 diffusion 시스템을 사용하는 가장 쉬운 방법입니다.",V,x,rt='먼저 [‘DiffusionPipeline’]의 인스턴스를 생성하고 다운로드할 파이프라인의 <a href="https://huggingface.co/models?library=diffusers&amp;sort=downloads" rel="nofollow">체크포인트</a>를 지정합니다. 허브의 🧨 diffusion 체크포인트 중 하나를 사용할 수 있습니다(사용할 체크포인트는 나비 이미지를 생성합니다).',B,u,R,k,pt='이 가이드에서는 unconditional 이미지 생성에 [‘DiffusionPipeline’]과 <a href="https://arxiv.org/abs/2006.11239" rel="nofollow">DDPM</a>을 사용합니다:',S,y,z,C,mt="[diffusion 파이프라인]은 모든 모델링, 토큰화, 스케줄링 구성 요소를 다운로드하고 캐시합니다. 이 모델은 약 14억 개의 파라미터로 구성되어 있기 때문에 GPU에서 실행할 것을 강력히 권장합니다. PyTorch에서와 마찬가지로 제너레이터 객체를 GPU로 옮길 수 있습니다:",K,P,A,M,ut="이제 제너레이터를 사용하여 이미지를 생성할 수 있습니다:",X,F,O,Z,gt='출력은 기본적으로 <a href="https://pillow.readthedocs.io/en/stable/reference/Image.html?highlight=image#the-image-class" rel="nofollow">PIL.Image</a> 객체로 감싸집니다.',Q,I,ct="다음을 호출하여 이미지를 저장할 수 있습니다:",Y,N,tt,U,bt="아래 스페이스(데모 링크)를 이용해 보고, 추론 단계의 매개변수를 자유롭게 조절하여 이미지 품질에 어떤 영향을 미치는지 확인해 보세요!",et,p,$t,nt,E,it,W,lt;return w=new Pt({props:{title:"Unconditional 이미지 생성",local:"unconditional-이미지-생성",headingTag:"h1"}}),T=new Ct({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/unconditional_image_generation.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/unconditional_image_generation.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/unconditional_image_generation.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/unconditional_image_generation.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/unconditional_image_generation.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/unconditional_image_generation.ipynb"}]}}),u=new yt({props:{$$slots:{default:[Ft]},$$scope:{ctx:q}}}),y=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIwJTNFJTNFJTNFJTIwZ2VuZXJhdG9yJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmFudG9uLWwlMkZkZHBtLWJ1dHRlcmZsaWVzLTEyOCUyMik=",highlighted:` &gt;&gt;&gt; <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

 &gt;&gt;&gt; generator = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;anton-l/ddpm-butterflies-128&quot;</span>)`,wrap:!1}}),P=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwZ2VuZXJhdG9yLnRvKCUyMmN1ZGElMjIp",highlighted:' &gt;&gt;&gt; generator.to(<span class="hljs-string">&quot;cuda&quot;</span>)',wrap:!1}}),F=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwaW1hZ2UlMjAlM0QlMjBnZW5lcmF0b3IoKS5pbWFnZXMlNUIwJTVE",highlighted:' &gt;&gt;&gt; image = generator().images[<span class="hljs-number">0</span>]',wrap:!1}}),N=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwaW1hZ2Uuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",highlighted:' &gt;&gt;&gt; image.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)',wrap:!1}}),E=new Mt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/unconditional_image_generation.md"}}),{c(){a=s("meta"),_=l(),r=s("p"),G=l(),g(w.$$.fragment),L=l(),g(T.$$.fragment),D=l(),v=s("p"),v.textContent=st,H=l(),J=s("p"),J.textContent=ft,V=l(),x=s("p"),x.innerHTML=rt,B=l(),g(u.$$.fragment),R=l(),k=s("p"),k.innerHTML=pt,S=l(),g(y.$$.fragment),z=l(),C=s("p"),C.textContent=mt,K=l(),g(P.$$.fragment),A=l(),M=s("p"),M.textContent=ut,X=l(),g(F.$$.fragment),O=l(),Z=s("p"),Z.innerHTML=gt,Q=l(),I=s("p"),I.textContent=ct,Y=l(),g(N.$$.fragment),tt=l(),U=s("p"),U.textContent=bt,et=l(),p=s("iframe"),nt=l(),g(E.$$.fragment),it=l(),W=s("p"),this.h()},l(t){const e=xt("svelte-u9bgzb",document.head);a=f(e,"META",{name:!0,content:!0}),e.forEach(n),_=o(t),r=f(t,"P",{}),at(r).forEach(n),G=o(t),c(w.$$.fragment,t),L=o(t),c(T.$$.fragment,t),D=o(t),v=f(t,"P",{"data-svelte-h":!0}),m(v)!=="svelte-tfszx0"&&(v.textContent=st),H=o(t),J=f(t,"P",{"data-svelte-h":!0}),m(J)!=="svelte-10qi7c6"&&(J.textContent=ft),V=o(t),x=f(t,"P",{"data-svelte-h":!0}),m(x)!=="svelte-gbmace"&&(x.innerHTML=rt),B=o(t),c(u.$$.fragment,t),R=o(t),k=f(t,"P",{"data-svelte-h":!0}),m(k)!=="svelte-1h0b378"&&(k.innerHTML=pt),S=o(t),c(y.$$.fragment,t),z=o(t),C=f(t,"P",{"data-svelte-h":!0}),m(C)!=="svelte-19iqs64"&&(C.textContent=mt),K=o(t),c(P.$$.fragment,t),A=o(t),M=f(t,"P",{"data-svelte-h":!0}),m(M)!=="svelte-1v4twko"&&(M.textContent=ut),X=o(t),c(F.$$.fragment,t),O=o(t),Z=f(t,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-q9tjpq"&&(Z.innerHTML=gt),Q=o(t),I=f(t,"P",{"data-svelte-h":!0}),m(I)!=="svelte-t33pj2"&&(I.textContent=ct),Y=o(t),c(N.$$.fragment,t),tt=o(t),U=f(t,"P",{"data-svelte-h":!0}),m(U)!=="svelte-ymgaag"&&(U.textContent=bt),et=o(t),p=f(t,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),at(p).forEach(n),nt=o(t),c(E.$$.fragment,t),it=o(t),W=f(t,"P",{}),at(W).forEach(n),this.h()},h(){j(a,"name","hf:doc:metadata"),j(a,"content",It),_t(p.src,$t="https://stevhliu-ddpm-butterflies-128.hf.space")||j(p,"src",$t),j(p,"frameborder","0"),j(p,"width","850"),j(p,"height","500")},m(t,e){kt(document.head,a),i(t,_,e),i(t,r,e),i(t,G,e),b(w,t,e),i(t,L,e),b(T,t,e),i(t,D,e),i(t,v,e),i(t,H,e),i(t,J,e),i(t,V,e),i(t,x,e),i(t,B,e),b(u,t,e),i(t,R,e),i(t,k,e),i(t,S,e),b(y,t,e),i(t,z,e),i(t,C,e),i(t,K,e),b(P,t,e),i(t,A,e),i(t,M,e),i(t,X,e),b(F,t,e),i(t,O,e),i(t,Z,e),i(t,Q,e),i(t,I,e),i(t,Y,e),b(N,t,e),i(t,tt,e),i(t,U,e),i(t,et,e),i(t,p,e),i(t,nt,e),b(E,t,e),i(t,it,e),i(t,W,e),lt=!0},p(t,[e]){const dt={};e&2&&(dt.$$scope={dirty:e,ctx:t}),u.$set(dt)},i(t){lt||($(w.$$.fragment,t),$(T.$$.fragment,t),$(u.$$.fragment,t),$(y.$$.fragment,t),$(P.$$.fragment,t),$(F.$$.fragment,t),$(N.$$.fragment,t),$(E.$$.fragment,t),lt=!0)},o(t){d(w.$$.fragment,t),d(T.$$.fragment,t),d(u.$$.fragment,t),d(y.$$.fragment,t),d(P.$$.fragment,t),d(F.$$.fragment,t),d(N.$$.fragment,t),d(E.$$.fragment,t),lt=!1},d(t){t&&(n(_),n(r),n(G),n(L),n(D),n(v),n(H),n(J),n(V),n(x),n(B),n(R),n(k),n(S),n(z),n(C),n(K),n(A),n(M),n(X),n(O),n(Z),n(Q),n(I),n(Y),n(tt),n(U),n(et),n(p),n(nt),n(it),n(W)),n(a),h(w,t),h(T,t),h(u,t),h(y,t),h(P,t),h(F,t),h(N,t),h(E,t)}}}const It='{"title":"Unconditional 이미지 생성","local":"unconditional-이미지-생성","sections":[],"depth":1}';function Nt(q){return wt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Lt extends vt{constructor(a){super(),Jt(this,a,Nt,Zt,ht,{})}}export{Lt as component};
