import{s as wt,a as Tt,n as vt,o as yt}from"../chunks/scheduler.23542ac5.js";import{S as Jt,i as xt,e as o,s as l,c as u,h as kt,a as s,d as n,b as a,f as st,g,j as p,k as L,l as Ct,m as i,n as c,t as b,o as d,p as h}from"../chunks/index.9b1f405b.js";import{C as Mt,H as Pt,E as Ft}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.cf8449cd.js";import{C as ot}from"../chunks/CodeBlock.6a4e8f39.js";import{D as Zt}from"../chunks/DocNotebookDropdown.68a629d2.js";function It(ft){let m,G,q,j,$,W,_,H,w,D,T,pt="Unconditional 이미지 생성은 비교적 간단한 작업입니다. 모델이 텍스트나 이미지와 같은 추가 조건 없이 이미 학습된 학습 데이터와 유사한 이미지만 생성합니다.",V,v,mt="[‘DiffusionPipeline’]은 추론을 위해 미리 학습된 diffusion 시스템을 사용하는 가장 쉬운 방법입니다.",B,y,rt='먼저 [‘DiffusionPipeline’]의 인스턴스를 생성하고 다운로드할 파이프라인의 <a href="https://huggingface.co/models?library=diffusers&amp;sort=downloads" rel="nofollow">체크포인트</a>를 지정합니다. 허브의 🧨 diffusion 체크포인트 중 하나를 사용할 수 있습니다(사용할 체크포인트는 나비 이미지를 생성합니다).',R,r,ut="<p>💡 나만의 unconditional 이미지 생성 모델을 학습시키고 싶으신가요? 학습 가이드를 살펴보고 나만의 이미지를 생성하는 방법을 알아보세요.</p>",S,J,gt='이 가이드에서는 unconditional 이미지 생성에 [‘DiffusionPipeline’]과 <a href="https://huggingface.co/papers/2006.11239" rel="nofollow">DDPM</a>을 사용합니다:',z,x,K,k,ct="[diffusion 파이프라인]은 모든 모델링, 토큰화, 스케줄링 구성 요소를 다운로드하고 캐시합니다. 이 모델은 약 14억 개의 파라미터로 구성되어 있기 때문에 GPU에서 실행할 것을 강력히 권장합니다. PyTorch에서와 마찬가지로 제너레이터 객체를 GPU로 옮길 수 있습니다:",O,C,A,M,bt="이제 제너레이터를 사용하여 이미지를 생성할 수 있습니다:",Q,P,X,F,dt='출력은 기본적으로 <a href="https://pillow.readthedocs.io/en/stable/reference/Image.html?highlight=image#the-image-class" rel="nofollow">PIL.Image</a> 객체로 감싸집니다.',Y,Z,ht="다음을 호출하여 이미지를 저장할 수 있습니다:",tt,I,et,N,$t="아래 스페이스(데모 링크)를 이용해 보고, 추론 단계의 매개변수를 자유롭게 조절하여 이미지 품질에 어떤 영향을 미치는지 확인해 보세요!",nt,f,_t,it,U,lt,E,at;return $=new Mt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),_=new Zt({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/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"}]}}),w=new Pt({props:{title:"Unconditional 이미지 생성",local:"unconditional-이미지-생성",headingTag:"h1"}}),x=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}}),C=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwZ2VuZXJhdG9yLnRvKCUyMmN1ZGElMjIp",highlighted:' &gt;&gt;&gt; generator.to(<span class="hljs-string">&quot;cuda&quot;</span>)',wrap:!1}}),P=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwaW1hZ2UlMjAlM0QlMjBnZW5lcmF0b3IoKS5pbWFnZXMlNUIwJTVE",highlighted:' &gt;&gt;&gt; image = generator().images[<span class="hljs-number">0</span>]',wrap:!1}}),I=new ot({props:{code:"JTIwJTNFJTNFJTNFJTIwaW1hZ2Uuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",highlighted:' &gt;&gt;&gt; image.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)',wrap:!1}}),U=new Ft({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/unconditional_image_generation.md"}}),{c(){m=o("meta"),G=l(),q=o("p"),j=l(),u($.$$.fragment),W=l(),u(_.$$.fragment),H=l(),u(w.$$.fragment),D=l(),T=o("p"),T.textContent=pt,V=l(),v=o("p"),v.textContent=mt,B=l(),y=o("p"),y.innerHTML=rt,R=l(),r=o("blockquote"),r.innerHTML=ut,S=l(),J=o("p"),J.innerHTML=gt,z=l(),u(x.$$.fragment),K=l(),k=o("p"),k.textContent=ct,O=l(),u(C.$$.fragment),A=l(),M=o("p"),M.textContent=bt,Q=l(),u(P.$$.fragment),X=l(),F=o("p"),F.innerHTML=dt,Y=l(),Z=o("p"),Z.textContent=ht,tt=l(),u(I.$$.fragment),et=l(),N=o("p"),N.textContent=$t,nt=l(),f=o("iframe"),it=l(),u(U.$$.fragment),lt=l(),E=o("p"),this.h()},l(t){const e=kt("svelte-u9bgzb",document.head);m=s(e,"META",{name:!0,content:!0}),e.forEach(n),G=a(t),q=s(t,"P",{}),st(q).forEach(n),j=a(t),g($.$$.fragment,t),W=a(t),g(_.$$.fragment,t),H=a(t),g(w.$$.fragment,t),D=a(t),T=s(t,"P",{"data-svelte-h":!0}),p(T)!=="svelte-tfszx0"&&(T.textContent=pt),V=a(t),v=s(t,"P",{"data-svelte-h":!0}),p(v)!=="svelte-10qi7c6"&&(v.textContent=mt),B=a(t),y=s(t,"P",{"data-svelte-h":!0}),p(y)!=="svelte-gbmace"&&(y.innerHTML=rt),R=a(t),r=s(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(r)!=="svelte-1upvc0t"&&(r.innerHTML=ut),S=a(t),J=s(t,"P",{"data-svelte-h":!0}),p(J)!=="svelte-8y159b"&&(J.innerHTML=gt),z=a(t),g(x.$$.fragment,t),K=a(t),k=s(t,"P",{"data-svelte-h":!0}),p(k)!=="svelte-19iqs64"&&(k.textContent=ct),O=a(t),g(C.$$.fragment,t),A=a(t),M=s(t,"P",{"data-svelte-h":!0}),p(M)!=="svelte-1v4twko"&&(M.textContent=bt),Q=a(t),g(P.$$.fragment,t),X=a(t),F=s(t,"P",{"data-svelte-h":!0}),p(F)!=="svelte-q9tjpq"&&(F.innerHTML=dt),Y=a(t),Z=s(t,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-t33pj2"&&(Z.textContent=ht),tt=a(t),g(I.$$.fragment,t),et=a(t),N=s(t,"P",{"data-svelte-h":!0}),p(N)!=="svelte-ymgaag"&&(N.textContent=$t),nt=a(t),f=s(t,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),st(f).forEach(n),it=a(t),g(U.$$.fragment,t),lt=a(t),E=s(t,"P",{}),st(E).forEach(n),this.h()},h(){L(m,"name","hf:doc:metadata"),L(m,"content",Nt),L(r,"class","tip"),Tt(f.src,_t="https://stevhliu-ddpm-butterflies-128.hf.space")||L(f,"src",_t),L(f,"frameborder","0"),L(f,"width","850"),L(f,"height","500")},m(t,e){Ct(document.head,m),i(t,G,e),i(t,q,e),i(t,j,e),c($,t,e),i(t,W,e),c(_,t,e),i(t,H,e),c(w,t,e),i(t,D,e),i(t,T,e),i(t,V,e),i(t,v,e),i(t,B,e),i(t,y,e),i(t,R,e),i(t,r,e),i(t,S,e),i(t,J,e),i(t,z,e),c(x,t,e),i(t,K,e),i(t,k,e),i(t,O,e),c(C,t,e),i(t,A,e),i(t,M,e),i(t,Q,e),c(P,t,e),i(t,X,e),i(t,F,e),i(t,Y,e),i(t,Z,e),i(t,tt,e),c(I,t,e),i(t,et,e),i(t,N,e),i(t,nt,e),i(t,f,e),i(t,it,e),c(U,t,e),i(t,lt,e),i(t,E,e),at=!0},p:vt,i(t){at||(b($.$$.fragment,t),b(_.$$.fragment,t),b(w.$$.fragment,t),b(x.$$.fragment,t),b(C.$$.fragment,t),b(P.$$.fragment,t),b(I.$$.fragment,t),b(U.$$.fragment,t),at=!0)},o(t){d($.$$.fragment,t),d(_.$$.fragment,t),d(w.$$.fragment,t),d(x.$$.fragment,t),d(C.$$.fragment,t),d(P.$$.fragment,t),d(I.$$.fragment,t),d(U.$$.fragment,t),at=!1},d(t){t&&(n(G),n(q),n(j),n(W),n(H),n(D),n(T),n(V),n(v),n(B),n(y),n(R),n(r),n(S),n(J),n(z),n(K),n(k),n(O),n(A),n(M),n(Q),n(X),n(F),n(Y),n(Z),n(tt),n(et),n(N),n(nt),n(f),n(it),n(lt),n(E)),n(m),h($,t),h(_,t),h(w,t),h(x,t),h(C,t),h(P,t),h(I,t),h(U,t)}}}const Nt='{"title":"Unconditional 이미지 생성","local":"unconditional-이미지-생성","sections":[],"depth":1}';function Ut(ft){return yt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wt extends Jt{constructor(m){super(),xt(this,m,Ut,It,wt,{})}}export{Wt as component};
