import{S as st,i as ot,s as it,e as l,k as d,w as pe,t as r,M as rt,c as s,d as t,m as c,a as o,x as ne,h as p,b as m,N as Xe,G as a,g as n,y as me,L as pt,q as de,o as ce,B as he,v as nt}from"../../chunks/vendor-hf-doc-builder.js";import{I as mt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as lt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as dt}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function ct(Se){let u,H,b,w,D,v,fe,U,ue,q,E,Y,h,W,be,ge,Q,we,Me,X,ye,_e,T,ve,Ee,x,M,Te,S,je,ke,L,j,z,y,Je,G,Be,Ze,O,k,V,_,A,J,F,Ie,$e,N,De,Ue,R,B,P,Z,Ge,We,C,I,Ae,K,$,Qe,ee,f,Fe,te;return v=new mt({}),E=new dt({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/depth2img.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/depth2img.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/depth2img.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/depth2img.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/depth2img.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/depth2img.ipynb"}]}}),j=new lt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25EZXB0aDJJbWdQaXBlbGluZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25EZXB0aDJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItZGVwdGglMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEEpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionDepth2ImgPipeline

pipe = StableDiffusionDepth2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-depth&quot;</span>,
    torch_dtype=torch.float16,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),k=new lt({props:{code:"dXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWluaXRfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBcHJvbXB0JTIwJTNEJTIwJTIydHdvJTIwdGlnZXJzJTIyJTBBbl9wcm9tcHQlMjAlM0QlMjAlMjJiYWQlMkMlMjBkZWZvcm1lZCUyQyUyMHVnbHklMkMlMjBiYWQlMjBhbmF0b215JTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMG5lZ2F0aXZlX3Byb21wdCUzRG5fcHJvbXB0JTJDJTIwc3RyZW5ndGglM0QwLjcpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
init_image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
prompt = <span class="hljs-string">&quot;two tigers&quot;</span>
n_prompt = <span class="hljs-string">&quot;bad, deformed, ugly, bad anatomy&quot;</span>
image = pipe(prompt=prompt, image=init_image, negative_prompt=n_prompt, strength=<span class="hljs-number">0.7</span>).images[<span class="hljs-number">0</span>]
image`}}),{c(){u=l("meta"),H=d(),b=l("h1"),w=l("a"),D=l("span"),pe(v.$$.fragment),fe=d(),U=l("span"),ue=r("Text-guided depth-to-image \uC0DD\uC131"),q=d(),pe(E.$$.fragment),Y=d(),h=l("p"),W=l("code"),be=r("StableDiffusionDepth2ImgPipeline"),ge=r("\uC744 \uC0AC\uC6A9\uD558\uBA74 \uD14D\uC2A4\uD2B8 \uD504\uB86C\uD504\uD2B8\uC640 \uCD08\uAE30 \uC774\uBBF8\uC9C0\uB97C \uC804\uB2EC\uD558\uC5EC \uC0C8 \uC774\uBBF8\uC9C0\uC758 \uC0DD\uC131\uC744 \uC870\uC808\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uB610\uD55C \uC774\uBBF8\uC9C0 \uAD6C\uC870\uB97C \uBCF4\uC874\uD558\uAE30 \uC704\uD574 "),Q=l("code"),we=r("depth_map"),Me=r("\uC744 \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4. "),X=l("code"),ye=r("depth_map"),_e=r("\uC774 \uC81C\uACF5\uB418\uC9C0 \uC54A\uC73C\uBA74 \uD30C\uC774\uD504\uB77C\uC778\uC740 \uD1B5\uD569\uB41C "),T=l("a"),ve=r("depth-estimation model"),Ee=r("\uC744 \uD1B5\uD574 \uC790\uB3D9\uC73C\uB85C \uAE4A\uC774\uB97C \uC608\uCE21\uD569\uB2C8\uB2E4."),x=d(),M=l("p"),Te=r("\uBA3C\uC800 "),S=l("code"),je=r("StableDiffusionDepth2ImgPipeline"),ke=r("\uC758 \uC778\uC2A4\uD134\uC2A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4:"),L=d(),pe(j.$$.fragment),z=d(),y=l("p"),Je=r("\uC774\uC81C \uD504\uB86C\uD504\uD2B8\uB97C \uD30C\uC774\uD504\uB77C\uC778\uC5D0 \uC804\uB2EC\uD569\uB2C8\uB2E4. \uD2B9\uC815 \uB2E8\uC5B4\uAC00 \uC774\uBBF8\uC9C0 \uC0DD\uC131\uC744 \uAC00\uC774\uB4DC \uD558\uB294\uAC83\uC744 \uBC29\uC9C0\uD558\uAE30 \uC704\uD574 "),G=l("code"),Be=r("negative_prompt"),Ze=r("\uB97C \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4:"),O=d(),pe(k.$$.fragment),V=d(),_=l("table"),A=l("thead"),J=l("tr"),F=l("th"),Ie=r("Input"),$e=d(),N=l("th"),De=r("Output"),Ue=d(),R=l("tbody"),B=l("tr"),P=l("td"),Z=l("img"),We=d(),C=l("td"),I=l("img"),K=d(),$=l("p"),Qe=r("\uC544\uB798\uC758 Spaces\uB97C \uAC00\uC9C0\uACE0 \uB180\uBA70 depth map\uC774 \uC788\uB294 \uC774\uBBF8\uC9C0\uC640 \uC5C6\uB294 \uC774\uBBF8\uC9C0\uC758 \uCC28\uC774\uAC00 \uC788\uB294\uC9C0 \uD655\uC778\uD574 \uBCF4\uC138\uC694!"),ee=d(),f=l("iframe"),this.h()},l(e){const i=rt('[data-svelte="svelte-1phssyn"]',document.head);u=s(i,"META",{name:!0,content:!0}),i.forEach(t),H=c(e),b=s(e,"H1",{class:!0});var ae=o(b);w=s(ae,"A",{id:!0,class:!0,href:!0});var Ne=o(w);D=s(Ne,"SPAN",{});var Re=o(D);ne(v.$$.fragment,Re),Re.forEach(t),Ne.forEach(t),fe=c(ae),U=s(ae,"SPAN",{});var Pe=o(U);ue=p(Pe,"Text-guided depth-to-image \uC0DD\uC131"),Pe.forEach(t),ae.forEach(t),q=c(e),ne(E.$$.fragment,e),Y=c(e),h=s(e,"P",{});var g=o(h);W=s(g,"CODE",{});var Ce=o(W);be=p(Ce,"StableDiffusionDepth2ImgPipeline"),Ce.forEach(t),ge=p(g,"\uC744 \uC0AC\uC6A9\uD558\uBA74 \uD14D\uC2A4\uD2B8 \uD504\uB86C\uD504\uD2B8\uC640 \uCD08\uAE30 \uC774\uBBF8\uC9C0\uB97C \uC804\uB2EC\uD558\uC5EC \uC0C8 \uC774\uBBF8\uC9C0\uC758 \uC0DD\uC131\uC744 \uC870\uC808\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uB610\uD55C \uC774\uBBF8\uC9C0 \uAD6C\uC870\uB97C \uBCF4\uC874\uD558\uAE30 \uC704\uD574 "),Q=s(g,"CODE",{});var He=o(Q);we=p(He,"depth_map"),He.forEach(t),Me=p(g,"\uC744 \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4. "),X=s(g,"CODE",{});var qe=o(X);ye=p(qe,"depth_map"),qe.forEach(t),_e=p(g,"\uC774 \uC81C\uACF5\uB418\uC9C0 \uC54A\uC73C\uBA74 \uD30C\uC774\uD504\uB77C\uC778\uC740 \uD1B5\uD569\uB41C "),T=s(g,"A",{href:!0,rel:!0});var Ye=o(T);ve=p(Ye,"depth-estimation model"),Ye.forEach(t),Ee=p(g,"\uC744 \uD1B5\uD574 \uC790\uB3D9\uC73C\uB85C \uAE4A\uC774\uB97C \uC608\uCE21\uD569\uB2C8\uB2E4."),g.forEach(t),x=c(e),M=s(e,"P",{});var le=o(M);Te=p(le,"\uBA3C\uC800 "),S=s(le,"CODE",{});var xe=o(S);je=p(xe,"StableDiffusionDepth2ImgPipeline"),xe.forEach(t),ke=p(le,"\uC758 \uC778\uC2A4\uD134\uC2A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4:"),le.forEach(t),L=c(e),ne(j.$$.fragment,e),z=c(e),y=s(e,"P",{});var se=o(y);Je=p(se,"\uC774\uC81C \uD504\uB86C\uD504\uD2B8\uB97C \uD30C\uC774\uD504\uB77C\uC778\uC5D0 \uC804\uB2EC\uD569\uB2C8\uB2E4. \uD2B9\uC815 \uB2E8\uC5B4\uAC00 \uC774\uBBF8\uC9C0 \uC0DD\uC131\uC744 \uAC00\uC774\uB4DC \uD558\uB294\uAC83\uC744 \uBC29\uC9C0\uD558\uAE30 \uC704\uD574 "),G=s(se,"CODE",{});var Le=o(G);Be=p(Le,"negative_prompt"),Le.forEach(t),Ze=p(se,"\uB97C \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4:"),se.forEach(t),O=c(e),ne(k.$$.fragment,e),V=c(e),_=s(e,"TABLE",{});var oe=o(_);A=s(oe,"THEAD",{});var ze=o(A);J=s(ze,"TR",{});var ie=o(J);F=s(ie,"TH",{});var Oe=o(F);Ie=p(Oe,"Input"),Oe.forEach(t),$e=c(ie),N=s(ie,"TH",{});var Ve=o(N);De=p(Ve,"Output"),Ve.forEach(t),ie.forEach(t),ze.forEach(t),Ue=c(oe),R=s(oe,"TBODY",{});var Ke=o(R);B=s(Ke,"TR",{});var re=o(B);P=s(re,"TD",{});var et=o(P);Z=s(et,"IMG",{src:!0,width:!0}),et.forEach(t),We=c(re),C=s(re,"TD",{});var tt=o(C);I=s(tt,"IMG",{src:!0,width:!0}),tt.forEach(t),re.forEach(t),Ke.forEach(t),oe.forEach(t),K=c(e),$=s(e,"P",{});var at=o($);Qe=p(at,"\uC544\uB798\uC758 Spaces\uB97C \uAC00\uC9C0\uACE0 \uB180\uBA70 depth map\uC774 \uC788\uB294 \uC774\uBBF8\uC9C0\uC640 \uC5C6\uB294 \uC774\uBBF8\uC9C0\uC758 \uCC28\uC774\uAC00 \uC788\uB294\uC9C0 \uD655\uC778\uD574 \uBCF4\uC138\uC694!"),at.forEach(t),ee=c(e),f=s(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),o(f).forEach(t),this.h()},h(){m(u,"name","hf:doc:metadata"),m(u,"content",JSON.stringify(ht)),m(w,"id","textguided-depthtoimage"),m(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(w,"href","#textguided-depthtoimage"),m(b,"class","relative group"),m(T,"href","https://github.com/isl-org/MiDaS"),m(T,"rel","nofollow"),Xe(Z.src,Ge="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/coco-cats.png")||m(Z,"src",Ge),m(Z,"width","500"),Xe(I.src,Ae="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/depth2img-tigers.png")||m(I,"src",Ae),m(I,"width","500"),Xe(f.src,Fe="https://radames-stable-diffusion-depth2img.hf.space")||m(f,"src",Fe),m(f,"frameborder","0"),m(f,"width","850"),m(f,"height","500")},m(e,i){a(document.head,u),n(e,H,i),n(e,b,i),a(b,w),a(w,D),me(v,D,null),a(b,fe),a(b,U),a(U,ue),n(e,q,i),me(E,e,i),n(e,Y,i),n(e,h,i),a(h,W),a(W,be),a(h,ge),a(h,Q),a(Q,we),a(h,Me),a(h,X),a(X,ye),a(h,_e),a(h,T),a(T,ve),a(h,Ee),n(e,x,i),n(e,M,i),a(M,Te),a(M,S),a(S,je),a(M,ke),n(e,L,i),me(j,e,i),n(e,z,i),n(e,y,i),a(y,Je),a(y,G),a(G,Be),a(y,Ze),n(e,O,i),me(k,e,i),n(e,V,i),n(e,_,i),a(_,A),a(A,J),a(J,F),a(F,Ie),a(J,$e),a(J,N),a(N,De),a(_,Ue),a(_,R),a(R,B),a(B,P),a(P,Z),a(B,We),a(B,C),a(C,I),n(e,K,i),n(e,$,i),a($,Qe),n(e,ee,i),n(e,f,i),te=!0},p:pt,i(e){te||(de(v.$$.fragment,e),de(E.$$.fragment,e),de(j.$$.fragment,e),de(k.$$.fragment,e),te=!0)},o(e){ce(v.$$.fragment,e),ce(E.$$.fragment,e),ce(j.$$.fragment,e),ce(k.$$.fragment,e),te=!1},d(e){t(u),e&&t(H),e&&t(b),he(v),e&&t(q),he(E,e),e&&t(Y),e&&t(h),e&&t(x),e&&t(M),e&&t(L),he(j,e),e&&t(z),e&&t(y),e&&t(O),he(k,e),e&&t(V),e&&t(_),e&&t(K),e&&t($),e&&t(ee),e&&t(f)}}}const ht={local:"textguided-depthtoimage",title:"Text-guided depth-to-image \uC0DD\uC131"};function ft(Se){return nt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mt extends st{constructor(u){super();ot(this,u,ft,ct,it,{})}}export{Mt as default,ht as metadata};
