import{S as Xo,i as Yo,s as Zo,e as n,k as g,w as q,t as s,M as et,c as r,d as o,m as u,a as i,x as J,h as a,b as c,G as e,g as M,y as U,q as z,o as F,B as V,v as ot}from"../../chunks/vendor-hf-doc-builder.js";import{T as Qo}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ee}from"../../chunks/Docstring-hf-doc-builder.js";import{I as tt}from"../../chunks/IconCopyLink-hf-doc-builder.js";function nt(ee){let f,w,l,p,b,h,v,x;return{c(){f=n("p"),w=s("It is required to be logged in ("),l=n("code"),p=s("huggingface-cli login"),b=s(") when you want to use private or "),h=n("a"),v=s(`gated
models`),x=s("."),this.h()},l(P){f=r(P,"P",{});var $=i(f);w=a($,"It is required to be logged in ("),l=r($,"CODE",{});var E=i(l);p=a(E,"huggingface-cli login"),E.forEach(o),b=a($,") when you want to use private or "),h=r($,"A",{href:!0,rel:!0});var oe=i(h);v=a(oe,`gated
models`),oe.forEach(o),x=a($,"."),$.forEach(o),this.h()},h(){c(h,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),c(h,"rel","nofollow")},m(P,$){M(P,f,$),e(f,w),e(f,l),e(l,p),e(f,b),e(f,h),e(h,v),e(f,x)},d(P){P&&o(f)}}}function rt(ee){let f,w,l,p,b;return{c(){f=n("p"),w=s("Activate the special "),l=n("a"),p=s("\u201Coffline-mode\u201D"),b=s(` to
use this method in a firewalled environment.`),this.h()},l(h){f=r(h,"P",{});var v=i(f);w=a(v,"Activate the special "),l=r(v,"A",{href:!0,rel:!0});var x=i(l);p=a(x,"\u201Coffline-mode\u201D"),x.forEach(o),b=a(v,` to
use this method in a firewalled environment.`),v.forEach(o),this.h()},h(){c(l,"href","https://huggingface.co/transformers/installation.html#offline-mode"),c(l,"rel","nofollow")},m(h,v){M(h,f,v),e(f,w),e(f,l),e(l,p),e(f,b)},d(h){h&&o(f)}}}function it(ee){let f,w,l,p,b,h,v,x,P,$,E,oe,le,Ne,Te,Ce,d,W,je,k,qe,de,Je,Ue,te,ze,Fe,Ve,R,ce,ne,We,Re,he,re,Be,Ge,ge,He,Ke,B,C,ue,Qe,Xe,me,Ye,Ze,ie,eo,oo,to,A,pe,no,ro,_e,io,so,ao,y,G,fo,ve,lo,co,L,ho,D,go,I,H,uo,S,mo,be,po,_o,se,vo,bo,$o,O,K,wo,$e,xo,yo,N,Q,Eo,we,Co,Me,T,Mo,X,Po,ko,Pe;return h=new tt({}),W=new Ee({props:{name:"class diffusers.ConfigMixin",anchor:"diffusers.ConfigMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_849/src/diffusers/configuration_utils.py#L39"}}),G=new Ee({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_849/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_849/src/diffusers/configuration_utils.py#L101"}}),L=new Qo({props:{$$slots:{default:[nt]},$$scope:{ctx:ee}}}),D=new Qo({props:{$$slots:{default:[rt]},$$scope:{ctx:ee}}}),H=new Ee({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_849/src/diffusers/configuration_utils.py#L81"}}),K=new Ee({props:{name:"to_json_file",anchor:"diffusers.ConfigMixin.to_json_file",parameters:[{name:"json_file_path",val:": typing.Union[str, os.PathLike]"}],parametersDescription:[{anchor:"diffusers.ConfigMixin.to_json_file.json_file_path",description:`<strong>json_file_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Path to the JSON file in which this configuration instance&#x2019;s parameters will be saved.`,name:"json_file_path"}],source:"https://github.com/huggingface/diffusers/blob/vr_849/src/diffusers/configuration_utils.py#L349"}}),Q=new Ee({props:{name:"to_json_string",anchor:"diffusers.ConfigMixin.to_json_string",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_849/src/diffusers/configuration_utils.py#L339",returnDescription:`
<p>String containing all the attributes that make up this configuration instance in JSON format.</p>
`,returnType:`
<p><code>str</code></p>
`}}),{c(){f=n("meta"),w=g(),l=n("h1"),p=n("a"),b=n("span"),q(h.$$.fragment),v=g(),x=n("span"),P=s("Configuration"),$=g(),E=n("p"),oe=s("The handling of configurations in Diffusers is with the "),le=n("code"),Ne=s("ConfigMixin"),Te=s(" class."),Ce=g(),d=n("div"),q(W.$$.fragment),je=g(),k=n("p"),qe=s("Base class for all configuration classes. Stores all configuration parameters under "),de=n("code"),Je=s("self.config"),Ue=s(` Also handles all
methods for loading/downloading/saving classes inheriting from `),te=n("a"),ze=s("ConfigMixin"),Fe=s(" with"),Ve=g(),R=n("ul"),ce=n("li"),ne=n("a"),We=s("from_config()"),Re=g(),he=n("li"),re=n("a"),Be=s("save_config()"),Ge=g(),ge=n("p"),He=s("Class attributes:"),Ke=g(),B=n("ul"),C=n("li"),ue=n("strong"),Qe=s("config_name"),Xe=s(" ("),me=n("code"),Ye=s("str"),Ze=s(`) \u2014 A filename under which the config should stored when calling
`),ie=n("a"),eo=s("save_config()"),oo=s(" (should be overridden by parent class)."),to=g(),A=n("li"),pe=n("strong"),no=s("ignore_for_config"),ro=s(" ("),_e=n("code"),io=s("List[str]"),so=s(`) \u2014 A list of attributes that should not be saved in the config (should be
overridden by parent class).`),ao=g(),y=n("div"),q(G.$$.fragment),fo=g(),ve=n("p"),lo=s("Instantiate a Python class from a pre-defined JSON-file."),co=g(),q(L.$$.fragment),ho=g(),q(D.$$.fragment),go=g(),I=n("div"),q(H.$$.fragment),uo=g(),S=n("p"),mo=s("Save a configuration object to the directory "),be=n("code"),po=s("save_directory"),_o=s(`, so that it can be re-loaded using the
`),se=n("a"),vo=s("from_config()"),bo=s(" class method."),$o=g(),O=n("div"),q(K.$$.fragment),wo=g(),$e=n("p"),xo=s("Save this instance to a JSON file."),yo=g(),N=n("div"),q(Q.$$.fragment),Eo=g(),we=n("p"),Co=s("Serializes this instance to a JSON string."),Me=g(),T=n("p"),Mo=s("Under further construction \u{1F6A7}, open a "),X=n("a"),Po=s("PR"),ko=s(" if you want to contribute!"),this.h()},l(t){const _=et('[data-svelte="svelte-1phssyn"]',document.head);f=r(_,"META",{name:!0,content:!0}),_.forEach(o),w=u(t),l=r(t,"H1",{class:!0});var Y=i(l);p=r(Y,"A",{id:!0,class:!0,href:!0});var xe=i(p);b=r(xe,"SPAN",{});var So=i(b);J(h.$$.fragment,So),So.forEach(o),xe.forEach(o),v=u(Y),x=r(Y,"SPAN",{});var Ao=i(x);P=a(Ao,"Configuration"),Ao.forEach(o),Y.forEach(o),$=u(t),E=r(t,"P",{});var ke=i(E);oe=a(ke,"The handling of configurations in Diffusers is with the "),le=r(ke,"CODE",{});var Lo=i(le);Ne=a(Lo,"ConfigMixin"),Lo.forEach(o),Te=a(ke," class."),ke.forEach(o),Ce=u(t),d=r(t,"DIV",{class:!0});var m=i(d);J(W.$$.fragment,m),je=u(m),k=r(m,"P",{});var ae=i(k);qe=a(ae,"Base class for all configuration classes. Stores all configuration parameters under "),de=r(ae,"CODE",{});var Do=i(de);Je=a(Do,"self.config"),Do.forEach(o),Ue=a(ae,` Also handles all
methods for loading/downloading/saving classes inheriting from `),te=r(ae,"A",{href:!0});var Io=i(te);ze=a(Io,"ConfigMixin"),Io.forEach(o),Fe=a(ae," with"),ae.forEach(o),Ve=u(m),R=r(m,"UL",{});var Se=i(R);ce=r(Se,"LI",{});var Oo=i(ce);ne=r(Oo,"A",{href:!0});var No=i(ne);We=a(No,"from_config()"),No.forEach(o),Oo.forEach(o),Re=u(Se),he=r(Se,"LI",{});var To=i(he);re=r(To,"A",{href:!0});var jo=i(re);Be=a(jo,"save_config()"),jo.forEach(o),To.forEach(o),Se.forEach(o),Ge=u(m),ge=r(m,"P",{});var qo=i(ge);He=a(qo,"Class attributes:"),qo.forEach(o),Ke=u(m),B=r(m,"UL",{});var Ae=i(B);C=r(Ae,"LI",{});var Z=i(C);ue=r(Z,"STRONG",{});var Jo=i(ue);Qe=a(Jo,"config_name"),Jo.forEach(o),Xe=a(Z," ("),me=r(Z,"CODE",{});var Uo=i(me);Ye=a(Uo,"str"),Uo.forEach(o),Ze=a(Z,`) \u2014 A filename under which the config should stored when calling
`),ie=r(Z,"A",{href:!0});var zo=i(ie);eo=a(zo,"save_config()"),zo.forEach(o),oo=a(Z," (should be overridden by parent class)."),Z.forEach(o),to=u(Ae),A=r(Ae,"LI",{});var ye=i(A);pe=r(ye,"STRONG",{});var Fo=i(pe);no=a(Fo,"ignore_for_config"),Fo.forEach(o),ro=a(ye," ("),_e=r(ye,"CODE",{});var Vo=i(_e);io=a(Vo,"List[str]"),Vo.forEach(o),so=a(ye,`) \u2014 A list of attributes that should not be saved in the config (should be
overridden by parent class).`),ye.forEach(o),Ae.forEach(o),ao=u(m),y=r(m,"DIV",{class:!0});var j=i(y);J(G.$$.fragment,j),fo=u(j),ve=r(j,"P",{});var Wo=i(ve);lo=a(Wo,"Instantiate a Python class from a pre-defined JSON-file."),Wo.forEach(o),co=u(j),J(L.$$.fragment,j),ho=u(j),J(D.$$.fragment,j),j.forEach(o),go=u(m),I=r(m,"DIV",{class:!0});var Le=i(I);J(H.$$.fragment,Le),uo=u(Le),S=r(Le,"P",{});var fe=i(S);mo=a(fe,"Save a configuration object to the directory "),be=r(fe,"CODE",{});var Ro=i(be);po=a(Ro,"save_directory"),Ro.forEach(o),_o=a(fe,`, so that it can be re-loaded using the
`),se=r(fe,"A",{href:!0});var Bo=i(se);vo=a(Bo,"from_config()"),Bo.forEach(o),bo=a(fe," class method."),fe.forEach(o),Le.forEach(o),$o=u(m),O=r(m,"DIV",{class:!0});var De=i(O);J(K.$$.fragment,De),wo=u(De),$e=r(De,"P",{});var Go=i($e);xo=a(Go,"Save this instance to a JSON file."),Go.forEach(o),De.forEach(o),yo=u(m),N=r(m,"DIV",{class:!0});var Ie=i(N);J(Q.$$.fragment,Ie),Eo=u(Ie),we=r(Ie,"P",{});var Ho=i(we);Co=a(Ho,"Serializes this instance to a JSON string."),Ho.forEach(o),Ie.forEach(o),m.forEach(o),Me=u(t),T=r(t,"P",{});var Oe=i(T);Mo=a(Oe,"Under further construction \u{1F6A7}, open a "),X=r(Oe,"A",{href:!0,rel:!0});var Ko=i(X);Po=a(Ko,"PR"),Ko.forEach(o),ko=a(Oe," if you want to contribute!"),Oe.forEach(o),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(st)),c(p,"id","diffusers.ConfigMixin"),c(p,"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"),c(p,"href","#diffusers.ConfigMixin"),c(l,"class","relative group"),c(te,"href","/docs/diffusers/pr_849/en/using-diffusers/configuration#diffusers.ConfigMixin"),c(ne,"href","/docs/diffusers/pr_849/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),c(re,"href","/docs/diffusers/pr_849/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config"),c(ie,"href","/docs/diffusers/pr_849/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config"),c(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(se,"href","/docs/diffusers/pr_849/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(X,"href","https://github.com/huggingface/diffusers/compare"),c(X,"rel","nofollow")},m(t,_){e(document.head,f),M(t,w,_),M(t,l,_),e(l,p),e(p,b),U(h,b,null),e(l,v),e(l,x),e(x,P),M(t,$,_),M(t,E,_),e(E,oe),e(E,le),e(le,Ne),e(E,Te),M(t,Ce,_),M(t,d,_),U(W,d,null),e(d,je),e(d,k),e(k,qe),e(k,de),e(de,Je),e(k,Ue),e(k,te),e(te,ze),e(k,Fe),e(d,Ve),e(d,R),e(R,ce),e(ce,ne),e(ne,We),e(R,Re),e(R,he),e(he,re),e(re,Be),e(d,Ge),e(d,ge),e(ge,He),e(d,Ke),e(d,B),e(B,C),e(C,ue),e(ue,Qe),e(C,Xe),e(C,me),e(me,Ye),e(C,Ze),e(C,ie),e(ie,eo),e(C,oo),e(B,to),e(B,A),e(A,pe),e(pe,no),e(A,ro),e(A,_e),e(_e,io),e(A,so),e(d,ao),e(d,y),U(G,y,null),e(y,fo),e(y,ve),e(ve,lo),e(y,co),U(L,y,null),e(y,ho),U(D,y,null),e(d,go),e(d,I),U(H,I,null),e(I,uo),e(I,S),e(S,mo),e(S,be),e(be,po),e(S,_o),e(S,se),e(se,vo),e(S,bo),e(d,$o),e(d,O),U(K,O,null),e(O,wo),e(O,$e),e($e,xo),e(d,yo),e(d,N),U(Q,N,null),e(N,Eo),e(N,we),e(we,Co),M(t,Me,_),M(t,T,_),e(T,Mo),e(T,X),e(X,Po),e(T,ko),Pe=!0},p(t,[_]){const Y={};_&2&&(Y.$$scope={dirty:_,ctx:t}),L.$set(Y);const xe={};_&2&&(xe.$$scope={dirty:_,ctx:t}),D.$set(xe)},i(t){Pe||(z(h.$$.fragment,t),z(W.$$.fragment,t),z(G.$$.fragment,t),z(L.$$.fragment,t),z(D.$$.fragment,t),z(H.$$.fragment,t),z(K.$$.fragment,t),z(Q.$$.fragment,t),Pe=!0)},o(t){F(h.$$.fragment,t),F(W.$$.fragment,t),F(G.$$.fragment,t),F(L.$$.fragment,t),F(D.$$.fragment,t),F(H.$$.fragment,t),F(K.$$.fragment,t),F(Q.$$.fragment,t),Pe=!1},d(t){o(f),t&&o(w),t&&o(l),V(h),t&&o($),t&&o(E),t&&o(Ce),t&&o(d),V(W),V(G),V(L),V(D),V(H),V(K),V(Q),t&&o(Me),t&&o(T)}}}const st={local:"diffusers.ConfigMixin",title:"Configuration"};function at(ee){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ht extends Xo{constructor(f){super();Yo(this,f,at,it,Zo,{})}}export{ht as default,st as metadata};
