import{s as Pe,n as Ce,o as De}from"../chunks/scheduler.182ea377.js";import{S as Te,i as Ee,g as n,s as r,r as o,A as ke,h as l,f as i,c as a,j as b,u as m,x as F,k as x,y as h,a as s,v as f,d,t as p,w as u}from"../chunks/index.abf12888.js";import{D as B}from"../chunks/Docstring.93f6f462.js";import{H as z}from"../chunks/Heading.16916d63.js";function Ue(ve){let g,J,G,K,y,O,I,he="Utility and helper functions for working with 🤗 Diffusers.",Q,w,X,_,L,ge,S,be="Convert a numpy image or a batch of images to a PIL image.",Y,P,Z,$,C,_e,j,xe="Convert a torch image to a PIL image.",ee,D,te,c,T,$e,R,ye="Loads <code>image</code> to a PIL Image.",ie,E,se,k,U,re,V,ae,N,A,ne,H,le,v,M,ce,q,Ie="Prepares a single grid of images. Useful for visualization purposes.",oe,W,me;return y=new z({props:{title:"Utilities",local:"utilities",headingTag:"h1"}}),w=new z({props:{title:"numpy_to_pil",local:"diffusers.utils.numpy_to_pil",headingTag:"h2"}}),L=new B({props:{name:"diffusers.utils.numpy_to_pil",anchor:"diffusers.utils.numpy_to_pil",parameters:[{name:"images",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/pil_utils.py#L37"}}),P=new z({props:{title:"pt_to_pil",local:"diffusers.utils.pt_to_pil",headingTag:"h2"}}),C=new B({props:{name:"diffusers.utils.pt_to_pil",anchor:"diffusers.utils.pt_to_pil",parameters:[{name:"images",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/pil_utils.py#L27"}}),D=new z({props:{title:"load_image",local:"diffusers.utils.load_image",headingTag:"h2"}}),T=new B({props:{name:"diffusers.utils.load_image",anchor:"diffusers.utils.load_image",parameters:[{name:"image",val:": Union"},{name:"convert_method",val:": Callable = None"}],parametersDescription:[{anchor:"diffusers.utils.load_image.image",description:`<strong>image</strong> (<code>str</code> or <code>PIL.Image.Image</code>) &#x2014;
The image to convert to the PIL Image format.`,name:"image"},{anchor:"diffusers.utils.load_image.convert_method",description:`<strong>convert_method</strong> (Callable[[PIL.Image.Image], PIL.Image.Image], optional) &#x2014;
A conversion method to apply to the image after loading it.
When set to <code>None</code> the image will be converted &#x201C;RGB&#x201D;.`,name:"convert_method"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/loading_utils.py#L9",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A PIL Image.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>PIL.Image.Image</code></p>
`}}),E=new z({props:{title:"export_to_gif",local:"diffusers.utils.export_to_gif",headingTag:"h2"}}),U=new B({props:{name:"diffusers.utils.export_to_gif",anchor:"diffusers.utils.export_to_gif",parameters:[{name:"image",val:": List"},{name:"output_gif_path",val:": str = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/export_utils.py#L31"}}),V=new z({props:{title:"export_to_video",local:"diffusers.utils.export_to_video",headingTag:"h2"}}),A=new B({props:{name:"diffusers.utils.export_to_video",anchor:"diffusers.utils.export_to_video",parameters:[{name:"video_frames",val:": Union"},{name:"output_video_path",val:": str = None"},{name:"fps",val:": int = 8"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/export_utils.py#L118"}}),H=new z({props:{title:"make_image_grid",local:"diffusers.utils.make_image_grid",headingTag:"h2"}}),M=new B({props:{name:"diffusers.utils.make_image_grid",anchor:"diffusers.utils.make_image_grid",parameters:[{name:"images",val:": List"},{name:"rows",val:": int"},{name:"cols",val:": int"},{name:"resize",val:": int = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/pil_utils.py#L53"}}),{c(){g=n("meta"),J=r(),G=n("p"),K=r(),o(y.$$.fragment),O=r(),I=n("p"),I.textContent=he,Q=r(),o(w.$$.fragment),X=r(),_=n("div"),o(L.$$.fragment),ge=r(),S=n("p"),S.textContent=be,Y=r(),o(P.$$.fragment),Z=r(),$=n("div"),o(C.$$.fragment),_e=r(),j=n("p"),j.textContent=xe,ee=r(),o(D.$$.fragment),te=r(),c=n("div"),o(T.$$.fragment),$e=r(),R=n("p"),R.innerHTML=ye,ie=r(),o(E.$$.fragment),se=r(),k=n("div"),o(U.$$.fragment),re=r(),o(V.$$.fragment),ae=r(),N=n("div"),o(A.$$.fragment),ne=r(),o(H.$$.fragment),le=r(),v=n("div"),o(M.$$.fragment),ce=r(),q=n("p"),q.textContent=Ie,oe=r(),W=n("p"),this.h()},l(e){const t=ke("svelte-u9bgzb",document.head);g=l(t,"META",{name:!0,content:!0}),t.forEach(i),J=a(e),G=l(e,"P",{}),b(G).forEach(i),K=a(e),m(y.$$.fragment,e),O=a(e),I=l(e,"P",{"data-svelte-h":!0}),F(I)!=="svelte-sj662i"&&(I.textContent=he),Q=a(e),m(w.$$.fragment,e),X=a(e),_=l(e,"DIV",{class:!0});var fe=b(_);m(L.$$.fragment,fe),ge=a(fe),S=l(fe,"P",{"data-svelte-h":!0}),F(S)!=="svelte-49eriv"&&(S.textContent=be),fe.forEach(i),Y=a(e),m(P.$$.fragment,e),Z=a(e),$=l(e,"DIV",{class:!0});var de=b($);m(C.$$.fragment,de),_e=a(de),j=l(de,"P",{"data-svelte-h":!0}),F(j)!=="svelte-haxfgr"&&(j.textContent=xe),de.forEach(i),ee=a(e),m(D.$$.fragment,e),te=a(e),c=l(e,"DIV",{class:!0});var pe=b(c);m(T.$$.fragment,pe),$e=a(pe),R=l(pe,"P",{"data-svelte-h":!0}),F(R)!=="svelte-suegrh"&&(R.innerHTML=ye),pe.forEach(i),ie=a(e),m(E.$$.fragment,e),se=a(e),k=l(e,"DIV",{class:!0});var we=b(k);m(U.$$.fragment,we),we.forEach(i),re=a(e),m(V.$$.fragment,e),ae=a(e),N=l(e,"DIV",{class:!0});var Le=b(N);m(A.$$.fragment,Le),Le.forEach(i),ne=a(e),m(H.$$.fragment,e),le=a(e),v=l(e,"DIV",{class:!0});var ue=b(v);m(M.$$.fragment,ue),ce=a(ue),q=l(ue,"P",{"data-svelte-h":!0}),F(q)!=="svelte-rk2372"&&(q.textContent=Ie),ue.forEach(i),oe=a(e),W=l(e,"P",{}),b(W).forEach(i),this.h()},h(){x(g,"name","hf:doc:metadata"),x(g,"content",Ve),x(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){h(document.head,g),s(e,J,t),s(e,G,t),s(e,K,t),f(y,e,t),s(e,O,t),s(e,I,t),s(e,Q,t),f(w,e,t),s(e,X,t),s(e,_,t),f(L,_,null),h(_,ge),h(_,S),s(e,Y,t),f(P,e,t),s(e,Z,t),s(e,$,t),f(C,$,null),h($,_e),h($,j),s(e,ee,t),f(D,e,t),s(e,te,t),s(e,c,t),f(T,c,null),h(c,$e),h(c,R),s(e,ie,t),f(E,e,t),s(e,se,t),s(e,k,t),f(U,k,null),s(e,re,t),f(V,e,t),s(e,ae,t),s(e,N,t),f(A,N,null),s(e,ne,t),f(H,e,t),s(e,le,t),s(e,v,t),f(M,v,null),h(v,ce),h(v,q),s(e,oe,t),s(e,W,t),me=!0},p:Ce,i(e){me||(d(y.$$.fragment,e),d(w.$$.fragment,e),d(L.$$.fragment,e),d(P.$$.fragment,e),d(C.$$.fragment,e),d(D.$$.fragment,e),d(T.$$.fragment,e),d(E.$$.fragment,e),d(U.$$.fragment,e),d(V.$$.fragment,e),d(A.$$.fragment,e),d(H.$$.fragment,e),d(M.$$.fragment,e),me=!0)},o(e){p(y.$$.fragment,e),p(w.$$.fragment,e),p(L.$$.fragment,e),p(P.$$.fragment,e),p(C.$$.fragment,e),p(D.$$.fragment,e),p(T.$$.fragment,e),p(E.$$.fragment,e),p(U.$$.fragment,e),p(V.$$.fragment,e),p(A.$$.fragment,e),p(H.$$.fragment,e),p(M.$$.fragment,e),me=!1},d(e){e&&(i(J),i(G),i(K),i(O),i(I),i(Q),i(X),i(_),i(Y),i(Z),i($),i(ee),i(te),i(c),i(ie),i(se),i(k),i(re),i(ae),i(N),i(ne),i(le),i(v),i(oe),i(W)),i(g),u(y,e),u(w,e),u(L),u(P,e),u(C),u(D,e),u(T),u(E,e),u(U),u(V,e),u(A),u(H,e),u(M)}}}const Ve='{"title":"Utilities","local":"utilities","sections":[{"title":"numpy_to_pil","local":"diffusers.utils.numpy_to_pil","sections":[],"depth":2},{"title":"pt_to_pil","local":"diffusers.utils.pt_to_pil","sections":[],"depth":2},{"title":"load_image","local":"diffusers.utils.load_image","sections":[],"depth":2},{"title":"export_to_gif","local":"diffusers.utils.export_to_gif","sections":[],"depth":2},{"title":"export_to_video","local":"diffusers.utils.export_to_video","sections":[],"depth":2},{"title":"make_image_grid","local":"diffusers.utils.make_image_grid","sections":[],"depth":2}],"depth":1}';function Ne(ve){return De(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Se extends Te{constructor(g){super(),Ee(this,g,Ne,Ue,Pe,{})}}export{Se as component};
