import{S as zo,i as Ro,s as Ao,e as l,k as h,w as Z,t as o,M as Xo,c as r,d as s,m as d,a as i,x as B,h as a,b as f,G as e,g as c,y as J,L as Vo,q as U,o as G,B as P,v as Yo}from"../../chunks/vendor-hf-doc-builder.js";import{I as Vs}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as he}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as Fo}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function Lo(Ys){let C,Ye,W,N,de,x,yt,ue,bt,Fe,O,Le,m,z,gt,wt,pe,vt,_t,me,Et,Mt,R,ye,kt,$t,be,Tt,Zt,ge,Bt,Jt,Qe,_,Ut,we,Gt,Pt,ve,Ct,Wt,qe,A,He,u,jt,X,_e,Dt,Nt,Ee,St,It,Me,xt,Ot,ke,zt,Rt,$e,At,Xt,Te,Vt,Yt,Ke,E,Ft,Ze,Lt,Qt,Be,qt,Ht,et,V,tt,M,Kt,Je,es,ts,le,ss,os,st,Y,ot,j,S,Ue,F,as,Ge,ls,at,p,rs,Pe,is,ns,Ce,fs,cs,L,hs,ds,We,us,ps,je,ms,ys,Q,bs,gs,lt,y,ws,De,vs,_s,Ne,Es,Ms,q,ks,$s,Se,Ts,Zs,rt,H,it,D,I,Ie,K,Bs,xe,Js,nt,re,Us,ft,k,Oe,ze,Gs,Ps,w,ee,Cs,Re,Ws,js,Ds,Ae,Ns,Ss,te,Is,Xe,xs,Os,se,zs,Ve,oe,Rs,ae,As,Xs,ct;return x=new Vs({}),O=new Fo({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/en/using_safetensors.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/using_safetensors.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/using_safetensors.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/using_safetensors.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/using_safetensors.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/using_safetensors.ipynb"}]}}),A=new he({props:{code:"JTIzJTIwdW5jb21tZW50JTIwdG8lMjBpbnN0YWxsJTIwdGhlJTIwbmVjZXNzYXJ5JTIwbGlicmFyaWVzJTIwaW4lMjBDb2xhYiUwQSUyMyFwaXAlMjBpbnN0YWxsJTIwc2FmZXRlbnNvcnM=",highlighted:`<span class="hljs-comment"># uncomment to install the necessary libraries in Colab</span>
<span class="hljs-comment">#!pip install safetensors</span>`}}),V=new he({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`}}),Y=new he({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZXYXJyaW9yTWFtYTc3NyUyRk9yYW5nZU1peHMlMkZibG9iJTJGbWFpbiUyRk1vZGVscyUyRkFieXNzT3JhbmdlTWl4JTJGQWJ5c3NPcmFuZ2VNaXguc2FmZXRlbnNvcnMlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

pipeline = StableDiffusionPipeline.from_single_file(
    <span class="hljs-string">&quot;https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors&quot;</span>
)`}}),F=new Vs({}),H=new he({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHJldmlzaW9uJTNEJTIycmVmcyUyRnByJTJGMjIlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, revision=<span class="hljs-string">&quot;refs/pr/22&quot;</span>)`}}),K=new Vs({}),te=new he({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiklMEElMjJMb2FkZWQlMjBpbiUyMHNhZmV0ZW5zb3JzJTIwMCUzQTAwJTNBMDIuMDMzNjU4JTIyJTBBJTIyTG9hZGVkJTIwaW4lMjBQeVRvcmNoJTIwMCUzQTAwJTNBMDIuNjYzMzc5JTIy",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>)
<span class="hljs-string">&quot;Loaded in safetensors 0:00:02.033658&quot;</span>
<span class="hljs-string">&quot;Loaded in PyTorch 0:00:02.663379&quot;</span>`}}),se=new he({props:{code:"c2FmZXRlbnNvcnMlM0ElMjAzLjQ4NzNtcyUwQVB5VG9yY2glM0ElMjAxNzIuNzUzN21z",highlighted:`safetensors: 3.4873ms
PyTorch: 172.7537ms`}}),{c(){C=l("meta"),Ye=h(),W=l("h1"),N=l("a"),de=l("span"),Z(x.$$.fragment),yt=h(),ue=l("span"),bt=o("Load safetensors"),Fe=h(),Z(O.$$.fragment),Le=h(),m=l("p"),z=l("a"),gt=o("safetensors"),wt=o(" is a safe and fast file format for storing and loading tensors. Typically, PyTorch model weights are saved or "),pe=l("em"),vt=o("pickled"),_t=o(" into a "),me=l("code"),Et=o(".bin"),Mt=o(" file with Python\u2019s "),R=l("a"),ye=l("code"),kt=o("pickle"),$t=o(" utility. However, "),be=l("code"),Tt=o("pickle"),Zt=o(" is not secure and pickled files may contain malicious code that can be executed. safetensors is a secure alternative to "),ge=l("code"),Bt=o("pickle"),Jt=o(", making it ideal for sharing model weights."),Qe=h(),_=l("p"),Ut=o("This guide will show you how you load "),we=l("code"),Gt=o(".safetensor"),Pt=o(" files, and how to convert Stable Diffusion model weights stored in other formats to "),ve=l("code"),Ct=o(".safetensor"),Wt=o(". Before you start, make sure you have safetensors installed:"),qe=h(),Z(A.$$.fragment),He=h(),u=l("p"),jt=o("If you look at the "),X=l("a"),_e=l("code"),Dt=o("runwayml/stable-diffusion-v1-5"),Nt=o(" repository, you\u2019ll see weights inside the "),Ee=l("code"),St=o("text_encoder"),It=o(", "),Me=l("code"),xt=o("unet"),Ot=o(" and "),ke=l("code"),zt=o("vae"),Rt=o(" subfolders are stored in the "),$e=l("code"),At=o(".safetensors"),Xt=o(" format. By default, \u{1F917} Diffusers automatically loads these "),Te=l("code"),Vt=o(".safetensors"),Yt=o(" files from their subfolders if they\u2019re available in the model repository."),Ke=h(),E=l("p"),Ft=o("For more explicit control, you can optionally set "),Ze=l("code"),Lt=o("use_safetensors=True"),Qt=o(" (if "),Be=l("code"),qt=o("safetensors"),Ht=o(" is not installed, you\u2019ll get an error message asking you to install it):"),et=h(),Z(V.$$.fragment),tt=h(),M=l("p"),Kt=o("However, model weights are not necessarily stored in separate subfolders like in the example above. Sometimes, all the weights are stored in a single "),Je=l("code"),es=o(".safetensors"),ts=o(" file. In this case, if the weights are Stable Diffusion weights, you can load the file directly with the "),le=l("a"),ss=o("from_single_file()"),os=o(" method:"),st=h(),Z(Y.$$.fragment),ot=h(),j=l("h2"),S=l("a"),Ue=l("span"),Z(F.$$.fragment),as=h(),Ge=l("span"),ls=o("Convert to safetensors"),at=h(),p=l("p"),rs=o("Not all weights on the Hub are available in the "),Pe=l("code"),is=o(".safetensors"),ns=o(" format, and you may encounter weights stored as "),Ce=l("code"),fs=o(".bin"),cs=o(". In this case, use the "),L=l("a"),hs=o("Convert Space"),ds=o(" to convert the weights to "),We=l("code"),us=o(".safetensors"),ps=o(". The Convert Space downloads the pickled weights, converts them, and opens a Pull Request to upload the newly converted "),je=l("code"),ms=o(".safetensors"),ys=o(" file on the Hub. This way, if there is any malicious code contained in the pickled files, they\u2019re uploaded to the Hub - which has a "),Q=l("a"),bs=o("security scanner"),gs=o(" to detect unsafe files and suspicious pickle imports - instead of your computer."),lt=h(),y=l("p"),ws=o("You can use the model with the new "),De=l("code"),vs=o(".safetensors"),_s=o(" weights by specifying the reference to the Pull Request in the "),Ne=l("code"),Es=o("revision"),Ms=o(" parameter (you can also test it in this "),q=l("a"),ks=o("Check PR"),$s=o(" Space on the Hub), for example "),Se=l("code"),Ts=o("refs/pr/22"),Zs=o(":"),rt=h(),Z(H.$$.fragment),it=h(),D=l("h2"),I=l("a"),Ie=l("span"),Z(K.$$.fragment),Bs=h(),xe=l("span"),Js=o("Why use safetensors?"),nt=h(),re=l("p"),Us=o("There are several reasons for using safetensors:"),ft=h(),k=l("ul"),Oe=l("li"),ze=l("p"),Gs=o("Safety is the number one reason for using safetensors. As open-source and model distribution grows, it is important to be able to trust the model weights you downloaded don\u2019t contain any malicious code. The current size of the header in safetensors prevents parsing extremely large JSON files."),Ps=h(),w=l("li"),ee=l("p"),Cs=o("Loading speed between switching models is another reason to use safetensors, which performs zero-copy of the tensors. It is especially fast compared to "),Re=l("code"),Ws=o("pickle"),js=o(" if you\u2019re loading the weights to CPU (the default case), and just as fast if not faster when directly loading the weights to GPU. You\u2019ll only notice the performance difference if the model is already loaded, and not if you\u2019re downloading the weights or loading the model for the first time."),Ds=h(),Ae=l("p"),Ns=o("The time it takes to load the entire pipeline:"),Ss=h(),Z(te.$$.fragment),Is=h(),Xe=l("p"),xs=o("But the actual time it takes to load 500MB of the model weights is only:"),Os=h(),Z(se.$$.fragment),zs=h(),Ve=l("li"),oe=l("p"),Rs=o("Lazy loading is also supported in safetensors, which is useful in distributed settings to only load some of the tensors. This format allowed the "),ae=l("a"),As=o("BLOOM"),Xs=o(" model to be loaded in 45 seconds on 8 GPUs instead of 10 minutes with regular PyTorch weights."),this.h()},l(t){const n=Xo('[data-svelte="svelte-1phssyn"]',document.head);C=r(n,"META",{name:!0,content:!0}),n.forEach(s),Ye=d(t),W=r(t,"H1",{class:!0});var ht=i(W);N=r(ht,"A",{id:!0,class:!0,href:!0});var Fs=i(N);de=r(Fs,"SPAN",{});var Ls=i(de);B(x.$$.fragment,Ls),Ls.forEach(s),Fs.forEach(s),yt=d(ht),ue=r(ht,"SPAN",{});var Qs=i(ue);bt=a(Qs,"Load safetensors"),Qs.forEach(s),ht.forEach(s),Fe=d(t),B(O.$$.fragment,t),Le=d(t),m=r(t,"P",{});var v=i(m);z=r(v,"A",{href:!0,rel:!0});var qs=i(z);gt=a(qs,"safetensors"),qs.forEach(s),wt=a(v," is a safe and fast file format for storing and loading tensors. Typically, PyTorch model weights are saved or "),pe=r(v,"EM",{});var Hs=i(pe);vt=a(Hs,"pickled"),Hs.forEach(s),_t=a(v," into a "),me=r(v,"CODE",{});var Ks=i(me);Et=a(Ks,".bin"),Ks.forEach(s),Mt=a(v," file with Python\u2019s "),R=r(v,"A",{href:!0,rel:!0});var eo=i(R);ye=r(eo,"CODE",{});var to=i(ye);kt=a(to,"pickle"),to.forEach(s),eo.forEach(s),$t=a(v," utility. However, "),be=r(v,"CODE",{});var so=i(be);Tt=a(so,"pickle"),so.forEach(s),Zt=a(v," is not secure and pickled files may contain malicious code that can be executed. safetensors is a secure alternative to "),ge=r(v,"CODE",{});var oo=i(ge);Bt=a(oo,"pickle"),oo.forEach(s),Jt=a(v,", making it ideal for sharing model weights."),v.forEach(s),Qe=d(t),_=r(t,"P",{});var ie=i(_);Ut=a(ie,"This guide will show you how you load "),we=r(ie,"CODE",{});var ao=i(we);Gt=a(ao,".safetensor"),ao.forEach(s),Pt=a(ie," files, and how to convert Stable Diffusion model weights stored in other formats to "),ve=r(ie,"CODE",{});var lo=i(ve);Ct=a(lo,".safetensor"),lo.forEach(s),Wt=a(ie,". Before you start, make sure you have safetensors installed:"),ie.forEach(s),qe=d(t),B(A.$$.fragment,t),He=d(t),u=r(t,"P",{});var b=i(u);jt=a(b,"If you look at the "),X=r(b,"A",{href:!0,rel:!0});var ro=i(X);_e=r(ro,"CODE",{});var io=i(_e);Dt=a(io,"runwayml/stable-diffusion-v1-5"),io.forEach(s),ro.forEach(s),Nt=a(b," repository, you\u2019ll see weights inside the "),Ee=r(b,"CODE",{});var no=i(Ee);St=a(no,"text_encoder"),no.forEach(s),It=a(b,", "),Me=r(b,"CODE",{});var fo=i(Me);xt=a(fo,"unet"),fo.forEach(s),Ot=a(b," and "),ke=r(b,"CODE",{});var co=i(ke);zt=a(co,"vae"),co.forEach(s),Rt=a(b," subfolders are stored in the "),$e=r(b,"CODE",{});var ho=i($e);At=a(ho,".safetensors"),ho.forEach(s),Xt=a(b," format. By default, \u{1F917} Diffusers automatically loads these "),Te=r(b,"CODE",{});var uo=i(Te);Vt=a(uo,".safetensors"),uo.forEach(s),Yt=a(b," files from their subfolders if they\u2019re available in the model repository."),b.forEach(s),Ke=d(t),E=r(t,"P",{});var ne=i(E);Ft=a(ne,"For more explicit control, you can optionally set "),Ze=r(ne,"CODE",{});var po=i(Ze);Lt=a(po,"use_safetensors=True"),po.forEach(s),Qt=a(ne," (if "),Be=r(ne,"CODE",{});var mo=i(Be);qt=a(mo,"safetensors"),mo.forEach(s),Ht=a(ne," is not installed, you\u2019ll get an error message asking you to install it):"),ne.forEach(s),et=d(t),B(V.$$.fragment,t),tt=d(t),M=r(t,"P",{});var fe=i(M);Kt=a(fe,"However, model weights are not necessarily stored in separate subfolders like in the example above. Sometimes, all the weights are stored in a single "),Je=r(fe,"CODE",{});var yo=i(Je);es=a(yo,".safetensors"),yo.forEach(s),ts=a(fe," file. In this case, if the weights are Stable Diffusion weights, you can load the file directly with the "),le=r(fe,"A",{href:!0});var bo=i(le);ss=a(bo,"from_single_file()"),bo.forEach(s),os=a(fe," method:"),fe.forEach(s),st=d(t),B(Y.$$.fragment,t),ot=d(t),j=r(t,"H2",{class:!0});var dt=i(j);S=r(dt,"A",{id:!0,class:!0,href:!0});var go=i(S);Ue=r(go,"SPAN",{});var wo=i(Ue);B(F.$$.fragment,wo),wo.forEach(s),go.forEach(s),as=d(dt),Ge=r(dt,"SPAN",{});var vo=i(Ge);ls=a(vo,"Convert to safetensors"),vo.forEach(s),dt.forEach(s),at=d(t),p=r(t,"P",{});var g=i(p);rs=a(g,"Not all weights on the Hub are available in the "),Pe=r(g,"CODE",{});var _o=i(Pe);is=a(_o,".safetensors"),_o.forEach(s),ns=a(g," format, and you may encounter weights stored as "),Ce=r(g,"CODE",{});var Eo=i(Ce);fs=a(Eo,".bin"),Eo.forEach(s),cs=a(g,". In this case, use the "),L=r(g,"A",{href:!0,rel:!0});var Mo=i(L);hs=a(Mo,"Convert Space"),Mo.forEach(s),ds=a(g," to convert the weights to "),We=r(g,"CODE",{});var ko=i(We);us=a(ko,".safetensors"),ko.forEach(s),ps=a(g,". The Convert Space downloads the pickled weights, converts them, and opens a Pull Request to upload the newly converted "),je=r(g,"CODE",{});var $o=i(je);ms=a($o,".safetensors"),$o.forEach(s),ys=a(g," file on the Hub. This way, if there is any malicious code contained in the pickled files, they\u2019re uploaded to the Hub - which has a "),Q=r(g,"A",{href:!0,rel:!0});var To=i(Q);bs=a(To,"security scanner"),To.forEach(s),gs=a(g," to detect unsafe files and suspicious pickle imports - instead of your computer."),g.forEach(s),lt=d(t),y=r(t,"P",{});var $=i(y);ws=a($,"You can use the model with the new "),De=r($,"CODE",{});var Zo=i(De);vs=a(Zo,".safetensors"),Zo.forEach(s),_s=a($," weights by specifying the reference to the Pull Request in the "),Ne=r($,"CODE",{});var Bo=i(Ne);Es=a(Bo,"revision"),Bo.forEach(s),Ms=a($," parameter (you can also test it in this "),q=r($,"A",{href:!0,rel:!0});var Jo=i(q);ks=a(Jo,"Check PR"),Jo.forEach(s),$s=a($," Space on the Hub), for example "),Se=r($,"CODE",{});var Uo=i(Se);Ts=a(Uo,"refs/pr/22"),Uo.forEach(s),Zs=a($,":"),$.forEach(s),rt=d(t),B(H.$$.fragment,t),it=d(t),D=r(t,"H2",{class:!0});var ut=i(D);I=r(ut,"A",{id:!0,class:!0,href:!0});var Go=i(I);Ie=r(Go,"SPAN",{});var Po=i(Ie);B(K.$$.fragment,Po),Po.forEach(s),Go.forEach(s),Bs=d(ut),xe=r(ut,"SPAN",{});var Co=i(xe);Js=a(Co,"Why use safetensors?"),Co.forEach(s),ut.forEach(s),nt=d(t),re=r(t,"P",{});var Wo=i(re);Us=a(Wo,"There are several reasons for using safetensors:"),Wo.forEach(s),ft=d(t),k=r(t,"UL",{});var ce=i(k);Oe=r(ce,"LI",{});var jo=i(Oe);ze=r(jo,"P",{});var Do=i(ze);Gs=a(Do,"Safety is the number one reason for using safetensors. As open-source and model distribution grows, it is important to be able to trust the model weights you downloaded don\u2019t contain any malicious code. The current size of the header in safetensors prevents parsing extremely large JSON files."),Do.forEach(s),jo.forEach(s),Ps=d(ce),w=r(ce,"LI",{});var T=i(w);ee=r(T,"P",{});var pt=i(ee);Cs=a(pt,"Loading speed between switching models is another reason to use safetensors, which performs zero-copy of the tensors. It is especially fast compared to "),Re=r(pt,"CODE",{});var No=i(Re);Ws=a(No,"pickle"),No.forEach(s),js=a(pt," if you\u2019re loading the weights to CPU (the default case), and just as fast if not faster when directly loading the weights to GPU. You\u2019ll only notice the performance difference if the model is already loaded, and not if you\u2019re downloading the weights or loading the model for the first time."),pt.forEach(s),Ds=d(T),Ae=r(T,"P",{});var So=i(Ae);Ns=a(So,"The time it takes to load the entire pipeline:"),So.forEach(s),Ss=d(T),B(te.$$.fragment,T),Is=d(T),Xe=r(T,"P",{});var Io=i(Xe);xs=a(Io,"But the actual time it takes to load 500MB of the model weights is only:"),Io.forEach(s),Os=d(T),B(se.$$.fragment,T),T.forEach(s),zs=d(ce),Ve=r(ce,"LI",{});var xo=i(Ve);oe=r(xo,"P",{});var mt=i(oe);Rs=a(mt,"Lazy loading is also supported in safetensors, which is useful in distributed settings to only load some of the tensors. This format allowed the "),ae=r(mt,"A",{href:!0,rel:!0});var Oo=i(ae);As=a(Oo,"BLOOM"),Oo.forEach(s),Xs=a(mt," model to be loaded in 45 seconds on 8 GPUs instead of 10 minutes with regular PyTorch weights."),mt.forEach(s),xo.forEach(s),ce.forEach(s),this.h()},h(){f(C,"name","hf:doc:metadata"),f(C,"content",JSON.stringify(Qo)),f(N,"id","load-safetensors"),f(N,"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"),f(N,"href","#load-safetensors"),f(W,"class","relative group"),f(z,"href","https://github.com/huggingface/safetensors"),f(z,"rel","nofollow"),f(R,"href","https://docs.python.org/3/library/pickle.html"),f(R,"rel","nofollow"),f(X,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main"),f(X,"rel","nofollow"),f(le,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),f(S,"id","convert-to-safetensors"),f(S,"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"),f(S,"href","#convert-to-safetensors"),f(j,"class","relative group"),f(L,"href","https://huggingface.co/spaces/diffusers/convert"),f(L,"rel","nofollow"),f(Q,"href","https://huggingface.co/docs/hub/security-pickle#hubs-security-scanner"),f(Q,"rel","nofollow"),f(q,"href","https://huggingface.co/spaces/diffusers/check_pr"),f(q,"rel","nofollow"),f(I,"id","why-use-safetensors"),f(I,"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"),f(I,"href","#why-use-safetensors"),f(D,"class","relative group"),f(ae,"href","https://huggingface.co/bigscience/bloom"),f(ae,"rel","nofollow")},m(t,n){e(document.head,C),c(t,Ye,n),c(t,W,n),e(W,N),e(N,de),J(x,de,null),e(W,yt),e(W,ue),e(ue,bt),c(t,Fe,n),J(O,t,n),c(t,Le,n),c(t,m,n),e(m,z),e(z,gt),e(m,wt),e(m,pe),e(pe,vt),e(m,_t),e(m,me),e(me,Et),e(m,Mt),e(m,R),e(R,ye),e(ye,kt),e(m,$t),e(m,be),e(be,Tt),e(m,Zt),e(m,ge),e(ge,Bt),e(m,Jt),c(t,Qe,n),c(t,_,n),e(_,Ut),e(_,we),e(we,Gt),e(_,Pt),e(_,ve),e(ve,Ct),e(_,Wt),c(t,qe,n),J(A,t,n),c(t,He,n),c(t,u,n),e(u,jt),e(u,X),e(X,_e),e(_e,Dt),e(u,Nt),e(u,Ee),e(Ee,St),e(u,It),e(u,Me),e(Me,xt),e(u,Ot),e(u,ke),e(ke,zt),e(u,Rt),e(u,$e),e($e,At),e(u,Xt),e(u,Te),e(Te,Vt),e(u,Yt),c(t,Ke,n),c(t,E,n),e(E,Ft),e(E,Ze),e(Ze,Lt),e(E,Qt),e(E,Be),e(Be,qt),e(E,Ht),c(t,et,n),J(V,t,n),c(t,tt,n),c(t,M,n),e(M,Kt),e(M,Je),e(Je,es),e(M,ts),e(M,le),e(le,ss),e(M,os),c(t,st,n),J(Y,t,n),c(t,ot,n),c(t,j,n),e(j,S),e(S,Ue),J(F,Ue,null),e(j,as),e(j,Ge),e(Ge,ls),c(t,at,n),c(t,p,n),e(p,rs),e(p,Pe),e(Pe,is),e(p,ns),e(p,Ce),e(Ce,fs),e(p,cs),e(p,L),e(L,hs),e(p,ds),e(p,We),e(We,us),e(p,ps),e(p,je),e(je,ms),e(p,ys),e(p,Q),e(Q,bs),e(p,gs),c(t,lt,n),c(t,y,n),e(y,ws),e(y,De),e(De,vs),e(y,_s),e(y,Ne),e(Ne,Es),e(y,Ms),e(y,q),e(q,ks),e(y,$s),e(y,Se),e(Se,Ts),e(y,Zs),c(t,rt,n),J(H,t,n),c(t,it,n),c(t,D,n),e(D,I),e(I,Ie),J(K,Ie,null),e(D,Bs),e(D,xe),e(xe,Js),c(t,nt,n),c(t,re,n),e(re,Us),c(t,ft,n),c(t,k,n),e(k,Oe),e(Oe,ze),e(ze,Gs),e(k,Ps),e(k,w),e(w,ee),e(ee,Cs),e(ee,Re),e(Re,Ws),e(ee,js),e(w,Ds),e(w,Ae),e(Ae,Ns),e(w,Ss),J(te,w,null),e(w,Is),e(w,Xe),e(Xe,xs),e(w,Os),J(se,w,null),e(k,zs),e(k,Ve),e(Ve,oe),e(oe,Rs),e(oe,ae),e(ae,As),e(oe,Xs),ct=!0},p:Vo,i(t){ct||(U(x.$$.fragment,t),U(O.$$.fragment,t),U(A.$$.fragment,t),U(V.$$.fragment,t),U(Y.$$.fragment,t),U(F.$$.fragment,t),U(H.$$.fragment,t),U(K.$$.fragment,t),U(te.$$.fragment,t),U(se.$$.fragment,t),ct=!0)},o(t){G(x.$$.fragment,t),G(O.$$.fragment,t),G(A.$$.fragment,t),G(V.$$.fragment,t),G(Y.$$.fragment,t),G(F.$$.fragment,t),G(H.$$.fragment,t),G(K.$$.fragment,t),G(te.$$.fragment,t),G(se.$$.fragment,t),ct=!1},d(t){s(C),t&&s(Ye),t&&s(W),P(x),t&&s(Fe),P(O,t),t&&s(Le),t&&s(m),t&&s(Qe),t&&s(_),t&&s(qe),P(A,t),t&&s(He),t&&s(u),t&&s(Ke),t&&s(E),t&&s(et),P(V,t),t&&s(tt),t&&s(M),t&&s(st),P(Y,t),t&&s(ot),t&&s(j),P(F),t&&s(at),t&&s(p),t&&s(lt),t&&s(y),t&&s(rt),P(H,t),t&&s(it),t&&s(D),P(K),t&&s(nt),t&&s(re),t&&s(ft),t&&s(k),P(te),P(se)}}}const Qo={local:"load-safetensors",sections:[{local:"convert-to-safetensors",title:"Convert to safetensors"},{local:"why-use-safetensors",title:"Why use safetensors?"}],title:"Load safetensors"};function qo(Ys){return Yo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sa extends zo{constructor(C){super();Ro(this,C,qo,Lo,Ao,{})}}export{sa as default,Qo as metadata};
