import{s as Ie,o as Je,n as Ue}from"../chunks/scheduler.182ea377.js";import{S as Ee,i as Ne,g as c,s as r,r as _,A as Le,h as l,f as n,c as a,j as U,u as x,x as M,k as I,y as o,a as m,v as b,d as v,t as y,w}from"../chunks/index.abf12888.js";import{T as Ze}from"../chunks/Tip.230e2334.js";import{D as O}from"../chunks/Docstring.93f6f462.js";import{C as We}from"../chunks/CodeBlock.57fe6e13.js";import{E as Re}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as Se}from"../chunks/Heading.16916d63.js";function Ge(H){let t,$='To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated</a> models, log-in with <code>huggingface-cli login</code>.';return{c(){t=c("p"),t.innerHTML=$},l(u){t=l(u,"P",{"data-svelte-h":!0}),M(t)!=="svelte-i4hp16"&&(t.innerHTML=$)},m(u,g){m(u,t,g)},p:Ue,d(u){u&&n(t)}}}function He(H){let t,$="Examples:",u,g,p;return g=new We({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEREUE1TY2hlZHVsZXIlMkMlMjBERElNU2NoZWR1bGVyJTJDJTIwUE5ETVNjaGVkdWxlciUwQSUwQSUyMyUyMERvd25sb2FkJTIwc2NoZWR1bGVyJTIwZnJvbSUyMGh1Z2dpbmdmYWNlLmNvJTIwYW5kJTIwY2FjaGUuJTBBc2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyKSUwQSUwQSUyMyUyMEluc3RhbnRpYXRlJTIwRERJTSUyMHNjaGVkdWxlciUyMGNsYXNzJTIwd2l0aCUyMHNhbWUlMjBjb25maWclMjBhcyUyMEREUE0lMEFzY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGVyLmZyb21fY29uZmlnKHNjaGVkdWxlci5jb25maWcpJTBBJTBBJTIzJTIwSW5zdGFudGlhdGUlMjBQTkRNJTIwc2NoZWR1bGVyJTIwY2xhc3MlMjB3aXRoJTIwc2FtZSUyMGNvbmZpZyUyMGFzJTIwRERQTSUwQXNjaGVkdWxlciUyMCUzRCUyMFBORE1TY2hlZHVsZXIuZnJvbV9jb25maWcoc2NoZWR1bGVyLmNvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDPMScheduler, DDIMScheduler, PNDMScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download scheduler from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = DDPMScheduler.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Instantiate DDIM scheduler class with same config as DDPM</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = DDIMScheduler.from_config(scheduler.config)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Instantiate PNDM scheduler class with same config as DDPM</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = PNDMScheduler.from_config(scheduler.config)`,wrap:!1}}),{c(){t=c("p"),t.textContent=$,u=r(),_(g.$$.fragment)},l(f){t=l(f,"P",{"data-svelte-h":!0}),M(t)!=="svelte-kvfsh7"&&(t.textContent=$),u=a(f),x(g.$$.fragment,f)},m(f,h){m(f,t,h),m(f,u,h),b(g,f,h),p=!0},p:Ue,i(f){p||(v(g.$$.fragment,f),p=!0)},o(f){y(g.$$.fragment,f),p=!1},d(f){f&&(n(t),n(u)),w(g,f)}}}function Ve(H){let t,$,u,g,p,f,h,we='Schedulers from <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and models from <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a> inherit from <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a> which stores all the parameters that are passed to their respective <code>__init__</code> methods in a JSON-configuration file.',ee,k,oe,J,te,i,E,de,V,Me=`Base class for all configuration classes. All configuration parameters are stored under <code>self.config</code>. Also
provides the <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.from_config">from_config()</a> and <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.save_config">save_config()</a> methods for loading, downloading, and
saving classes that inherit from <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a>.`,ce,F,$e="Class attributes:",le,A,Ce=`<li><strong>config_name</strong> (<code>str</code>) — A filename under which the config should stored when calling
<a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.save_config">save_config()</a> (should be overridden by parent class).</li> <li><strong>ignore_for_config</strong> (<code>List[str]</code>) — A list of attributes that should not be saved in the config (should be
overridden by subclass).</li> <li><strong>has_compatibles</strong> (<code>bool</code>) — Whether the class has compatible classes (should be overridden by subclass).</li> <li><strong>_deprecated_kwargs</strong> (<code>List[str]</code>) — Keyword arguments that are deprecated. Note that the <code>init</code> function
should only have a <code>kwargs</code> argument if at least one argument is deprecated (should be overridden by
subclass).</li>`,fe,T,N,ue,B,ke="Load a model or scheduler configuration.",ge,C,L,me,Y,Te="Instantiate a Python class from a config dictionary.",pe,j,he,D,Z,_e,z,je=`Save a configuration object to the directory specified in <code>save_directory</code> so that it can be reloaded using the
<a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.from_config">from_config()</a> class method.`,xe,P,W,be,q,De="Save the configuration instance’s parameters to a JSON file.",ve,S,R,ye,Q,Pe="Serializes the configuration instance to a JSON string.",ne,K,ie;return p=new Se({props:{title:"Configuration",local:"configuration",headingTag:"h1"}}),k=new Ze({props:{$$slots:{default:[Ge]},$$scope:{ctx:H}}}),J=new Se({props:{title:"ConfigMixin",local:"diffusers.ConfigMixin",headingTag:"h2"}}),E=new O({props:{name:"class diffusers.ConfigMixin",anchor:"diffusers.ConfigMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L86"}}),N=new O({props:{name:"load_config",anchor:"diffusers.ConfigMixin.load_config",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"return_unused_kwargs",val:" = False"},{name:"return_commit_hash",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ConfigMixin.load_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> (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on
the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing model weights saved with
<a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.save_config">save_config()</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.ConfigMixin.load_config.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.ConfigMixin.load_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.load_config.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.ConfigMixin.load_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, for example, <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.load_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.load_config.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.ConfigMixin.load_config.token",description:`<strong>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>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.ConfigMixin.load_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, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.ConfigMixin.load_config.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.ConfigMixin.load_config.return_unused_kwargs",description:"<strong>return_unused_kwargs</strong> (<code>bool</code>, <em>optional</em>, defaults to `False) &#x2014;\nWhether unused keyword arguments of the config are returned.",name:"return_unused_kwargs"},{anchor:"diffusers.ConfigMixin.load_config.return_commit_hash",description:"<strong>return_commit_hash</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False) -- Whether the </code>commit_hash` of the loaded configuration are returned.",name:"return_commit_hash"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L281",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A dictionary of all the parameters stored in a JSON configuration file.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>dict</code></p>
`}}),L=new O({props:{name:"from_config",anchor:"diffusers.ConfigMixin.from_config",parameters:[{name:"config",val:": typing.Union[diffusers.configuration_utils.FrozenDict, typing.Dict[str, typing.Any]] = None"},{name:"return_unused_kwargs",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ConfigMixin.from_config.config",description:`<strong>config</strong> (<code>Dict[str, Any]</code>) &#x2014;
A config dictionary from which the Python class is instantiated. Make sure to only load configuration
files of compatible classes.`,name:"config"},{anchor:"diffusers.ConfigMixin.from_config.return_unused_kwargs",description:`<strong>return_unused_kwargs</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether kwargs that are not consumed by the Python class should be returned or not.`,name:"return_unused_kwargs"},{anchor:"diffusers.ConfigMixin.from_config.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to update the configuration object (after it is loaded) and initiate the Python class.
<code>**kwargs</code> are passed directly to the underlying scheduler/model&#x2019;s <code>__init__</code> method and eventually
overwrite the same named arguments in <code>config</code>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L186",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A model or scheduler object instantiated from a config dictionary.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin"
>ModelMixin</a> or <a
  href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin"
>SchedulerMixin</a></p>
`}}),j=new Re({props:{anchor:"diffusers.ConfigMixin.from_config.example",$$slots:{default:[He]},$$scope:{ctx:H}}}),Z=new O({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 is saved (will be created if it does not exist).`,name:"save_directory"},{anchor:"diffusers.ConfigMixin.save_config.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face Hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"diffusers.ConfigMixin.save_config.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to the <a href="/docs/diffusers/main/en/api/models/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L144"}}),W=new O({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 to save a configuration instance&#x2019;s parameters.`,name:"json_file_path"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L592"}}),R=new O({props:{name:"to_json_string",anchor:"diffusers.ConfigMixin.to_json_string",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L566",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>String containing all the attributes that make up the configuration instance in JSON format.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code></p>
`}}),{c(){t=c("meta"),$=r(),u=c("p"),g=r(),_(p.$$.fragment),f=r(),h=c("p"),h.innerHTML=we,ee=r(),_(k.$$.fragment),oe=r(),_(J.$$.fragment),te=r(),i=c("div"),_(E.$$.fragment),de=r(),V=c("p"),V.innerHTML=Me,ce=r(),F=c("p"),F.textContent=$e,le=r(),A=c("ul"),A.innerHTML=Ce,fe=r(),T=c("div"),_(N.$$.fragment),ue=r(),B=c("p"),B.textContent=ke,ge=r(),C=c("div"),_(L.$$.fragment),me=r(),Y=c("p"),Y.textContent=Te,pe=r(),_(j.$$.fragment),he=r(),D=c("div"),_(Z.$$.fragment),_e=r(),z=c("p"),z.innerHTML=je,xe=r(),P=c("div"),_(W.$$.fragment),be=r(),q=c("p"),q.textContent=De,ve=r(),S=c("div"),_(R.$$.fragment),ye=r(),Q=c("p"),Q.textContent=Pe,ne=r(),K=c("p"),this.h()},l(e){const s=Le("svelte-u9bgzb",document.head);t=l(s,"META",{name:!0,content:!0}),s.forEach(n),$=a(e),u=l(e,"P",{}),U(u).forEach(n),g=a(e),x(p.$$.fragment,e),f=a(e),h=l(e,"P",{"data-svelte-h":!0}),M(h)!=="svelte-12f24yg"&&(h.innerHTML=we),ee=a(e),x(k.$$.fragment,e),oe=a(e),x(J.$$.fragment,e),te=a(e),i=l(e,"DIV",{class:!0});var d=U(i);x(E.$$.fragment,d),de=a(d),V=l(d,"P",{"data-svelte-h":!0}),M(V)!=="svelte-h1555c"&&(V.innerHTML=Me),ce=a(d),F=l(d,"P",{"data-svelte-h":!0}),M(F)!=="svelte-wz8va1"&&(F.textContent=$e),le=a(d),A=l(d,"UL",{"data-svelte-h":!0}),M(A)!=="svelte-x900lx"&&(A.innerHTML=Ce),fe=a(d),T=l(d,"DIV",{class:!0});var G=U(T);x(N.$$.fragment,G),ue=a(G),B=l(G,"P",{"data-svelte-h":!0}),M(B)!=="svelte-k51ly"&&(B.textContent=ke),G.forEach(n),ge=a(d),C=l(d,"DIV",{class:!0});var X=U(C);x(L.$$.fragment,X),me=a(X),Y=l(X,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-1vaeeyi"&&(Y.textContent=Te),pe=a(X),x(j.$$.fragment,X),X.forEach(n),he=a(d),D=l(d,"DIV",{class:!0});var se=U(D);x(Z.$$.fragment,se),_e=a(se),z=l(se,"P",{"data-svelte-h":!0}),M(z)!=="svelte-mq6b1r"&&(z.innerHTML=je),se.forEach(n),xe=a(d),P=l(d,"DIV",{class:!0});var re=U(P);x(W.$$.fragment,re),be=a(re),q=l(re,"P",{"data-svelte-h":!0}),M(q)!=="svelte-if97l3"&&(q.textContent=De),re.forEach(n),ve=a(d),S=l(d,"DIV",{class:!0});var ae=U(S);x(R.$$.fragment,ae),ye=a(ae),Q=l(ae,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-tueex0"&&(Q.textContent=Pe),ae.forEach(n),d.forEach(n),ne=a(e),K=l(e,"P",{}),U(K).forEach(n),this.h()},h(){I(t,"name","hf:doc:metadata"),I(t,"content",Fe),I(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(i,"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,s){o(document.head,t),m(e,$,s),m(e,u,s),m(e,g,s),b(p,e,s),m(e,f,s),m(e,h,s),m(e,ee,s),b(k,e,s),m(e,oe,s),b(J,e,s),m(e,te,s),m(e,i,s),b(E,i,null),o(i,de),o(i,V),o(i,ce),o(i,F),o(i,le),o(i,A),o(i,fe),o(i,T),b(N,T,null),o(T,ue),o(T,B),o(i,ge),o(i,C),b(L,C,null),o(C,me),o(C,Y),o(C,pe),b(j,C,null),o(i,he),o(i,D),b(Z,D,null),o(D,_e),o(D,z),o(i,xe),o(i,P),b(W,P,null),o(P,be),o(P,q),o(i,ve),o(i,S),b(R,S,null),o(S,ye),o(S,Q),m(e,ne,s),m(e,K,s),ie=!0},p(e,[s]){const d={};s&2&&(d.$$scope={dirty:s,ctx:e}),k.$set(d);const G={};s&2&&(G.$$scope={dirty:s,ctx:e}),j.$set(G)},i(e){ie||(v(p.$$.fragment,e),v(k.$$.fragment,e),v(J.$$.fragment,e),v(E.$$.fragment,e),v(N.$$.fragment,e),v(L.$$.fragment,e),v(j.$$.fragment,e),v(Z.$$.fragment,e),v(W.$$.fragment,e),v(R.$$.fragment,e),ie=!0)},o(e){y(p.$$.fragment,e),y(k.$$.fragment,e),y(J.$$.fragment,e),y(E.$$.fragment,e),y(N.$$.fragment,e),y(L.$$.fragment,e),y(j.$$.fragment,e),y(Z.$$.fragment,e),y(W.$$.fragment,e),y(R.$$.fragment,e),ie=!1},d(e){e&&(n($),n(u),n(g),n(f),n(h),n(ee),n(oe),n(te),n(i),n(ne),n(K)),n(t),w(p,e),w(k,e),w(J,e),w(E),w(N),w(L),w(j),w(Z),w(W),w(R)}}}const Fe='{"title":"Configuration","local":"configuration","sections":[{"title":"ConfigMixin","local":"diffusers.ConfigMixin","sections":[],"depth":2}],"depth":1}';function Ae(H){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ke extends Ee{constructor(t){super(),Ne(this,t,Ae,Ve,Ie,{})}}export{Ke as component};
