import{S as tt,i as nt,s as rt,e as n,k as u,w as H,t as i,M as it,c as r,d as o,m as g,a,x as R,h as s,b as l,G as e,g as C,y as j,q as K,o as Q,B as X,v as st}from"../../chunks/vendor-hf-doc-builder.js";import{T as et}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ao}from"../../chunks/Docstring-hf-doc-builder.js";import{I as ot}from"../../chunks/IconCopyLink-hf-doc-builder.js";function at(Y){let f,w,d,_,x,c,v,y;return{c(){f=n("p"),w=i("It is required to be logged in ("),d=n("code"),_=i("huggingface-cli login"),x=i(") when you want to use private or "),c=n("a"),v=i(`gated
models`),y=i("."),this.h()},l(A){f=r(A,"P",{});var $=a(f);w=s($,"It is required to be logged in ("),d=r($,"CODE",{});var p=a(d);_=s(p,"huggingface-cli login"),p.forEach(o),x=s($,") when you want to use private or "),c=r($,"A",{href:!0,rel:!0});var Z=a(c);v=s(Z,`gated
models`),Z.forEach(o),y=s($,"."),$.forEach(o),this.h()},h(){l(c,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),l(c,"rel","nofollow")},m(A,$){C(A,f,$),e(f,w),e(f,d),e(d,_),e(f,x),e(f,c),e(c,v),e(f,y)},d(A){A&&o(f)}}}function ft(Y){let f,w,d,_,x;return{c(){f=n("p"),w=i("Activate the special "),d=n("a"),_=i("\u201Coffline-mode\u201D"),x=i(` to
use this method in a firewalled environment.`),this.h()},l(c){f=r(c,"P",{});var v=a(f);w=s(v,"Activate the special "),d=r(v,"A",{href:!0,rel:!0});var y=a(d);_=s(y,"\u201Coffline-mode\u201D"),y.forEach(o),x=s(v,` to
use this method in a firewalled environment.`),v.forEach(o),this.h()},h(){l(d,"href","https://huggingface.co/transformers/installation.html#offline-mode"),l(d,"rel","nofollow")},m(c,v){C(c,f,v),e(f,w),e(f,d),e(d,_),e(f,x)},d(c){c&&o(f)}}}function lt(Y){let f,w,d,_,x,c,v,y,A,$,p,Z,ee,Oe,Te,oe,Ne,qe,te,Fe,ze,ce,Je,Ue,Me,ne,Ve,ke,P,I,he,F,We,ue,Be,Ae,h,z,Ge,S,He,ge,Re,je,re,Ke,Qe,Xe,J,me,ie,Ye,Ze,pe,se,eo,oo,_e,to,no,U,M,ve,ro,io,be,so,ao,ae,fo,lo,co,L,xe,ho,uo,$e,go,mo,po,E,V,_o,we,vo,bo,O,xo,T,$o,N,W,wo,D,yo,ye,Eo,Co,fe,Mo,ko,Pe;return c=new ot({}),F=new ot({}),z=new Ao({props:{name:"class diffusers.ConfigMixin",anchor:"diffusers.ConfigMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_1045/src/diffusers/configuration_utils.py#L39"}}),V=new Ao({props:{name:"from_config",anchor:"diffusers.ConfigMixin.from_config",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"return_unused_kwargs",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ConfigMixin.from_config.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a model repo on huggingface.co. Valid model ids should have an
organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <a href="/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config">save_config()</a>, e.g.,
<code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.ConfigMixin.from_config.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.ConfigMixin.from_config.ignore_mismatched_sizes",description:`<strong>ignore_mismatched_sizes</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to raise an error if some of the weights from the checkpoint do not have the same size
as the weights of the model (if for instance, you are instantiating a model with 10 labels from a
checkpoint with 3 labels).`,name:"ignore_mismatched_sizes"},{anchor:"diffusers.ConfigMixin.from_config.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.ConfigMixin.from_config.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.ConfigMixin.from_config.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.ConfigMixin.from_config.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.ConfigMixin.from_config.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.ConfigMixin.from_config.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>transformers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.ConfigMixin.from_config.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.ConfigMixin.from_config.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"}],source:"https://github.com/huggingface/diffusers/blob/vr_1045/src/diffusers/configuration_utils.py#L101"}}),O=new et({props:{$$slots:{default:[at]},$$scope:{ctx:Y}}}),T=new et({props:{$$slots:{default:[ft]},$$scope:{ctx:Y}}}),W=new Ao({props:{name:"save_config",anchor:"diffusers.ConfigMixin.save_config",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ConfigMixin.save_config.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the configuration JSON file will be saved (will be created if it does not exist).`,name:"save_directory"}],source:"https://github.com/huggingface/diffusers/blob/vr_1045/src/diffusers/configuration_utils.py#L81"}}),{c(){f=n("meta"),w=u(),d=n("h1"),_=n("a"),x=n("span"),H(c.$$.fragment),v=u(),y=n("span"),A=i("Configuration"),$=u(),p=n("p"),Z=i("In Diffusers, schedulers of type "),ee=n("a"),Oe=i("schedulers.scheduling_utils.SchedulerMixin"),Te=i(", and models of type "),oe=n("a"),Ne=i("ModelMixin"),qe=i(" inherit from "),te=n("a"),Fe=i("ConfigMixin"),ze=i(` which conveniently takes care of storing all parameters that are
passed to the respective `),ce=n("code"),Je=i("__init__"),Ue=i(" methods in a JSON-configuration file."),Me=u(),ne=n("p"),Ve=i("TODO(PVP) - add example and better info here"),ke=u(),P=n("h2"),I=n("a"),he=n("span"),H(F.$$.fragment),We=u(),ue=n("span"),Be=i("ConfigMixin"),Ae=u(),h=n("div"),H(z.$$.fragment),Ge=u(),S=n("p"),He=i("Base class for all configuration classes. Stores all configuration parameters under "),ge=n("code"),Re=i("self.config"),je=i(` Also handles all
methods for loading/downloading/saving classes inheriting from `),re=n("a"),Ke=i("ConfigMixin"),Qe=i(" with"),Xe=u(),J=n("ul"),me=n("li"),ie=n("a"),Ye=i("from_config()"),Ze=u(),pe=n("li"),se=n("a"),eo=i("save_config()"),oo=u(),_e=n("p"),to=i("Class attributes:"),no=u(),U=n("ul"),M=n("li"),ve=n("strong"),ro=i("config_name"),io=i(" ("),be=n("code"),so=i("str"),ao=i(`) \u2014 A filename under which the config should stored when calling
`),ae=n("a"),fo=i("save_config()"),lo=i(" (should be overridden by parent class)."),co=u(),L=n("li"),xe=n("strong"),ho=i("ignore_for_config"),uo=i(" ("),$e=n("code"),go=i("List[str]"),mo=i(`) \u2014 A list of attributes that should not be saved in the config (should be
overridden by parent class).`),po=u(),E=n("div"),H(V.$$.fragment),_o=u(),we=n("p"),vo=i("Instantiate a Python class from a pre-defined JSON-file."),bo=u(),H(O.$$.fragment),xo=u(),H(T.$$.fragment),$o=u(),N=n("div"),H(W.$$.fragment),wo=u(),D=n("p"),yo=i("Save a configuration object to the directory "),ye=n("code"),Eo=i("save_directory"),Co=i(`, so that it can be re-loaded using the
`),fe=n("a"),Mo=i("from_config()"),ko=i(" class method."),this.h()},l(t){const m=it('[data-svelte="svelte-1phssyn"]',document.head);f=r(m,"META",{name:!0,content:!0}),m.forEach(o),w=g(t),d=r(t,"H1",{class:!0});var B=a(d);_=r(B,"A",{id:!0,class:!0,href:!0});var Ee=a(_);x=r(Ee,"SPAN",{});var Po=a(x);R(c.$$.fragment,Po),Po.forEach(o),Ee.forEach(o),v=g(B),y=r(B,"SPAN",{});var So=a(y);A=s(So,"Configuration"),So.forEach(o),B.forEach(o),$=g(t),p=r(t,"P",{});var k=a(p);Z=s(k,"In Diffusers, schedulers of type "),ee=r(k,"A",{href:!0});var Do=a(ee);Oe=s(Do,"schedulers.scheduling_utils.SchedulerMixin"),Do.forEach(o),Te=s(k,", and models of type "),oe=r(k,"A",{href:!0});var Io=a(oe);Ne=s(Io,"ModelMixin"),Io.forEach(o),qe=s(k," inherit from "),te=r(k,"A",{href:!0});var Lo=a(te);Fe=s(Lo,"ConfigMixin"),Lo.forEach(o),ze=s(k,` which conveniently takes care of storing all parameters that are
passed to the respective `),ce=r(k,"CODE",{});var Oo=a(ce);Je=s(Oo,"__init__"),Oo.forEach(o),Ue=s(k," methods in a JSON-configuration file."),k.forEach(o),Me=g(t),ne=r(t,"P",{});var To=a(ne);Ve=s(To,"TODO(PVP) - add example and better info here"),To.forEach(o),ke=g(t),P=r(t,"H2",{class:!0});var Se=a(P);I=r(Se,"A",{id:!0,class:!0,href:!0});var No=a(I);he=r(No,"SPAN",{});var qo=a(he);R(F.$$.fragment,qo),qo.forEach(o),No.forEach(o),We=g(Se),ue=r(Se,"SPAN",{});var Fo=a(ue);Be=s(Fo,"ConfigMixin"),Fo.forEach(o),Se.forEach(o),Ae=g(t),h=r(t,"DIV",{class:!0});var b=a(h);R(z.$$.fragment,b),Ge=g(b),S=r(b,"P",{});var le=a(S);He=s(le,"Base class for all configuration classes. Stores all configuration parameters under "),ge=r(le,"CODE",{});var zo=a(ge);Re=s(zo,"self.config"),zo.forEach(o),je=s(le,` Also handles all
methods for loading/downloading/saving classes inheriting from `),re=r(le,"A",{href:!0});var Jo=a(re);Ke=s(Jo,"ConfigMixin"),Jo.forEach(o),Qe=s(le," with"),le.forEach(o),Xe=g(b),J=r(b,"UL",{});var De=a(J);me=r(De,"LI",{});var Uo=a(me);ie=r(Uo,"A",{href:!0});var Vo=a(ie);Ye=s(Vo,"from_config()"),Vo.forEach(o),Uo.forEach(o),Ze=g(De),pe=r(De,"LI",{});var Wo=a(pe);se=r(Wo,"A",{href:!0});var Bo=a(se);eo=s(Bo,"save_config()"),Bo.forEach(o),Wo.forEach(o),De.forEach(o),oo=g(b),_e=r(b,"P",{});var Go=a(_e);to=s(Go,"Class attributes:"),Go.forEach(o),no=g(b),U=r(b,"UL",{});var Ie=a(U);M=r(Ie,"LI",{});var G=a(M);ve=r(G,"STRONG",{});var Ho=a(ve);ro=s(Ho,"config_name"),Ho.forEach(o),io=s(G," ("),be=r(G,"CODE",{});var Ro=a(be);so=s(Ro,"str"),Ro.forEach(o),ao=s(G,`) \u2014 A filename under which the config should stored when calling
`),ae=r(G,"A",{href:!0});var jo=a(ae);fo=s(jo,"save_config()"),jo.forEach(o),lo=s(G," (should be overridden by parent class)."),G.forEach(o),co=g(Ie),L=r(Ie,"LI",{});var Ce=a(L);xe=r(Ce,"STRONG",{});var Ko=a(xe);ho=s(Ko,"ignore_for_config"),Ko.forEach(o),uo=s(Ce," ("),$e=r(Ce,"CODE",{});var Qo=a($e);go=s(Qo,"List[str]"),Qo.forEach(o),mo=s(Ce,`) \u2014 A list of attributes that should not be saved in the config (should be
overridden by parent class).`),Ce.forEach(o),Ie.forEach(o),po=g(b),E=r(b,"DIV",{class:!0});var q=a(E);R(V.$$.fragment,q),_o=g(q),we=r(q,"P",{});var Xo=a(we);vo=s(Xo,"Instantiate a Python class from a pre-defined JSON-file."),Xo.forEach(o),bo=g(q),R(O.$$.fragment,q),xo=g(q),R(T.$$.fragment,q),q.forEach(o),$o=g(b),N=r(b,"DIV",{class:!0});var Le=a(N);R(W.$$.fragment,Le),wo=g(Le),D=r(Le,"P",{});var de=a(D);yo=s(de,"Save a configuration object to the directory "),ye=r(de,"CODE",{});var Yo=a(ye);Eo=s(Yo,"save_directory"),Yo.forEach(o),Co=s(de,`, so that it can be re-loaded using the
`),fe=r(de,"A",{href:!0});var Zo=a(fe);Mo=s(Zo,"from_config()"),Zo.forEach(o),ko=s(de," class method."),de.forEach(o),Le.forEach(o),b.forEach(o),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(dt)),l(_,"id","configuration"),l(_,"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"),l(_,"href","#configuration"),l(d,"class","relative group"),l(ee,"href","/docs/diffusers/pr_1045/en/api/schedulers#diffusers.SchedulerMixin"),l(oe,"href","/docs/diffusers/pr_1045/en/using-diffusers/loading#diffusers.ModelMixin"),l(te,"href","/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin"),l(I,"id","diffusers.ConfigMixin"),l(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"),l(I,"href","#diffusers.ConfigMixin"),l(P,"class","relative group"),l(re,"href","/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin"),l(ie,"href","/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),l(se,"href","/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config"),l(ae,"href","/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(fe,"href","/docs/diffusers/pr_1045/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),l(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,m){e(document.head,f),C(t,w,m),C(t,d,m),e(d,_),e(_,x),j(c,x,null),e(d,v),e(d,y),e(y,A),C(t,$,m),C(t,p,m),e(p,Z),e(p,ee),e(ee,Oe),e(p,Te),e(p,oe),e(oe,Ne),e(p,qe),e(p,te),e(te,Fe),e(p,ze),e(p,ce),e(ce,Je),e(p,Ue),C(t,Me,m),C(t,ne,m),e(ne,Ve),C(t,ke,m),C(t,P,m),e(P,I),e(I,he),j(F,he,null),e(P,We),e(P,ue),e(ue,Be),C(t,Ae,m),C(t,h,m),j(z,h,null),e(h,Ge),e(h,S),e(S,He),e(S,ge),e(ge,Re),e(S,je),e(S,re),e(re,Ke),e(S,Qe),e(h,Xe),e(h,J),e(J,me),e(me,ie),e(ie,Ye),e(J,Ze),e(J,pe),e(pe,se),e(se,eo),e(h,oo),e(h,_e),e(_e,to),e(h,no),e(h,U),e(U,M),e(M,ve),e(ve,ro),e(M,io),e(M,be),e(be,so),e(M,ao),e(M,ae),e(ae,fo),e(M,lo),e(U,co),e(U,L),e(L,xe),e(xe,ho),e(L,uo),e(L,$e),e($e,go),e(L,mo),e(h,po),e(h,E),j(V,E,null),e(E,_o),e(E,we),e(we,vo),e(E,bo),j(O,E,null),e(E,xo),j(T,E,null),e(h,$o),e(h,N),j(W,N,null),e(N,wo),e(N,D),e(D,yo),e(D,ye),e(ye,Eo),e(D,Co),e(D,fe),e(fe,Mo),e(D,ko),Pe=!0},p(t,[m]){const B={};m&2&&(B.$$scope={dirty:m,ctx:t}),O.$set(B);const Ee={};m&2&&(Ee.$$scope={dirty:m,ctx:t}),T.$set(Ee)},i(t){Pe||(K(c.$$.fragment,t),K(F.$$.fragment,t),K(z.$$.fragment,t),K(V.$$.fragment,t),K(O.$$.fragment,t),K(T.$$.fragment,t),K(W.$$.fragment,t),Pe=!0)},o(t){Q(c.$$.fragment,t),Q(F.$$.fragment,t),Q(z.$$.fragment,t),Q(V.$$.fragment,t),Q(O.$$.fragment,t),Q(T.$$.fragment,t),Q(W.$$.fragment,t),Pe=!1},d(t){o(f),t&&o(w),t&&o(d),X(c),t&&o($),t&&o(p),t&&o(Me),t&&o(ne),t&&o(ke),t&&o(P),X(F),t&&o(Ae),t&&o(h),X(z),X(V),X(O),X(T),X(W)}}}const dt={local:"configuration",sections:[{local:"diffusers.ConfigMixin",title:"ConfigMixin"}],title:"Configuration"};function ct(Y){return st(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pt extends tt{constructor(f){super();nt(this,f,ct,lt,rt,{})}}export{pt as default,dt as metadata};
