import{s as Ne,o as Ze,n as We}from"../chunks/scheduler.53228c21.js";import{S as Re,i as Ge,e as d,s as i,c as p,h as He,a as c,d as o,b as s,f as E,g as h,j as M,k as C,l as t,m as u,n as _,t as x,o as b,p as y}from"../chunks/index.100fac89.js";import{C as Ve}from"../chunks/CopyLLMTxtMenu.0ee1b69b.js";import{D as X}from"../chunks/Docstring.db856a1e.js";import{C as Fe}from"../chunks/CodeBlock.d30a6509.js";import{E as Be}from"../chunks/ExampleCodeBlock.3eb26ae1.js";import{H as Le,E as Ae}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.136ef3fd.js";function qe(ee){let f,P="Examples:",$,g,m;return g=new Fe({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(){f=d("p"),f.textContent=P,$=i(),p(g.$$.fragment)},l(l){f=c(l,"P",{"data-svelte-h":!0}),M(f)!=="svelte-kvfsh7"&&(f.textContent=P),$=s(l),h(g.$$.fragment,l)},m(l,v){u(l,f,v),u(l,$,v),_(g,l,v),m=!0},p:We,i(l){m||(x(g.$$.fragment,l),m=!0)},o(l){b(g.$$.fragment,l),m=!1},d(l){l&&(o(f),o($)),y(g,l)}}}function ze(ee){let f,P,$,g,m,l,v,te,J,ke='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.',oe,k,Te='<p>To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated</a> models, log-in with <code>hf auth login</code>.</p>',ne,I,ie,r,L,ue,V,je=`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>.`,ge,F,De="Class attributes:",me,B,Se=`<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>`,pe,T,N,he,A,Ue="Load a model or scheduler configuration.",_e,w,Z,xe,q,Ee="Instantiate a Python class from a config dictionary.",be,j,ye,D,W,ve,z,Pe=`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.`,Me,S,R,$e,Y,Je="Save the configuration instance’s parameters to a JSON file.",we,U,G,Ce,O,Ie="Serializes the configuration instance to a JSON string.",se,H,re,K,ae;return m=new Ve({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),v=new Le({props:{title:"Configuration",local:"configuration",headingTag:"h1"}}),I=new Le({props:{title:"ConfigMixin",local:"diffusers.ConfigMixin",headingTag:"h2"}}),L=new X({props:{name:"class diffusers.ConfigMixin",anchor:"diffusers.ConfigMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L88"}}),N=new X({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.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#L291",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>
`}}),Z=new X({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#L190",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 Be({props:{anchor:"diffusers.ConfigMixin.from_config.example",$$slots:{default:[qe]},$$scope:{ctx:ee}}}),W=new X({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/schedulers/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#L146"}}),R=new X({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#L628"}}),G=new X({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#L589",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>
`}}),H=new Ae({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/configuration.md"}}),{c(){f=d("meta"),P=i(),$=d("p"),g=i(),p(m.$$.fragment),l=i(),p(v.$$.fragment),te=i(),J=d("p"),J.innerHTML=ke,oe=i(),k=d("blockquote"),k.innerHTML=Te,ne=i(),p(I.$$.fragment),ie=i(),r=d("div"),p(L.$$.fragment),ue=i(),V=d("p"),V.innerHTML=je,ge=i(),F=d("p"),F.textContent=De,me=i(),B=d("ul"),B.innerHTML=Se,pe=i(),T=d("div"),p(N.$$.fragment),he=i(),A=d("p"),A.textContent=Ue,_e=i(),w=d("div"),p(Z.$$.fragment),xe=i(),q=d("p"),q.textContent=Ee,be=i(),p(j.$$.fragment),ye=i(),D=d("div"),p(W.$$.fragment),ve=i(),z=d("p"),z.innerHTML=Pe,Me=i(),S=d("div"),p(R.$$.fragment),$e=i(),Y=d("p"),Y.textContent=Je,we=i(),U=d("div"),p(G.$$.fragment),Ce=i(),O=d("p"),O.textContent=Ie,se=i(),p(H.$$.fragment),re=i(),K=d("p"),this.h()},l(e){const n=He("svelte-u9bgzb",document.head);f=c(n,"META",{name:!0,content:!0}),n.forEach(o),P=s(e),$=c(e,"P",{}),E($).forEach(o),g=s(e),h(m.$$.fragment,e),l=s(e),h(v.$$.fragment,e),te=s(e),J=c(e,"P",{"data-svelte-h":!0}),M(J)!=="svelte-12f24yg"&&(J.innerHTML=ke),oe=s(e),k=c(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),M(k)!=="svelte-1xr2hh8"&&(k.innerHTML=Te),ne=s(e),h(I.$$.fragment,e),ie=s(e),r=c(e,"DIV",{class:!0});var a=E(r);h(L.$$.fragment,a),ue=s(a),V=c(a,"P",{"data-svelte-h":!0}),M(V)!=="svelte-h1555c"&&(V.innerHTML=je),ge=s(a),F=c(a,"P",{"data-svelte-h":!0}),M(F)!=="svelte-wz8va1"&&(F.textContent=De),me=s(a),B=c(a,"UL",{"data-svelte-h":!0}),M(B)!=="svelte-x900lx"&&(B.innerHTML=Se),pe=s(a),T=c(a,"DIV",{class:!0});var de=E(T);h(N.$$.fragment,de),he=s(de),A=c(de,"P",{"data-svelte-h":!0}),M(A)!=="svelte-k51ly"&&(A.textContent=Ue),de.forEach(o),_e=s(a),w=c(a,"DIV",{class:!0});var Q=E(w);h(Z.$$.fragment,Q),xe=s(Q),q=c(Q,"P",{"data-svelte-h":!0}),M(q)!=="svelte-1vaeeyi"&&(q.textContent=Ee),be=s(Q),h(j.$$.fragment,Q),Q.forEach(o),ye=s(a),D=c(a,"DIV",{class:!0});var ce=E(D);h(W.$$.fragment,ce),ve=s(ce),z=c(ce,"P",{"data-svelte-h":!0}),M(z)!=="svelte-mq6b1r"&&(z.innerHTML=Pe),ce.forEach(o),Me=s(a),S=c(a,"DIV",{class:!0});var le=E(S);h(R.$$.fragment,le),$e=s(le),Y=c(le,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-if97l3"&&(Y.textContent=Je),le.forEach(o),we=s(a),U=c(a,"DIV",{class:!0});var fe=E(U);h(G.$$.fragment,fe),Ce=s(fe),O=c(fe,"P",{"data-svelte-h":!0}),M(O)!=="svelte-tueex0"&&(O.textContent=Ie),fe.forEach(o),a.forEach(o),se=s(e),h(H.$$.fragment,e),re=s(e),K=c(e,"P",{}),E(K).forEach(o),this.h()},h(){C(f,"name","hf:doc:metadata"),C(f,"content",Ye),C(k,"class","tip"),C(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(w,"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(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(r,"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,n){t(document.head,f),u(e,P,n),u(e,$,n),u(e,g,n),_(m,e,n),u(e,l,n),_(v,e,n),u(e,te,n),u(e,J,n),u(e,oe,n),u(e,k,n),u(e,ne,n),_(I,e,n),u(e,ie,n),u(e,r,n),_(L,r,null),t(r,ue),t(r,V),t(r,ge),t(r,F),t(r,me),t(r,B),t(r,pe),t(r,T),_(N,T,null),t(T,he),t(T,A),t(r,_e),t(r,w),_(Z,w,null),t(w,xe),t(w,q),t(w,be),_(j,w,null),t(r,ye),t(r,D),_(W,D,null),t(D,ve),t(D,z),t(r,Me),t(r,S),_(R,S,null),t(S,$e),t(S,Y),t(r,we),t(r,U),_(G,U,null),t(U,Ce),t(U,O),u(e,se,n),_(H,e,n),u(e,re,n),u(e,K,n),ae=!0},p(e,[n]){const a={};n&2&&(a.$$scope={dirty:n,ctx:e}),j.$set(a)},i(e){ae||(x(m.$$.fragment,e),x(v.$$.fragment,e),x(I.$$.fragment,e),x(L.$$.fragment,e),x(N.$$.fragment,e),x(Z.$$.fragment,e),x(j.$$.fragment,e),x(W.$$.fragment,e),x(R.$$.fragment,e),x(G.$$.fragment,e),x(H.$$.fragment,e),ae=!0)},o(e){b(m.$$.fragment,e),b(v.$$.fragment,e),b(I.$$.fragment,e),b(L.$$.fragment,e),b(N.$$.fragment,e),b(Z.$$.fragment,e),b(j.$$.fragment,e),b(W.$$.fragment,e),b(R.$$.fragment,e),b(G.$$.fragment,e),b(H.$$.fragment,e),ae=!1},d(e){e&&(o(P),o($),o(g),o(l),o(te),o(J),o(oe),o(k),o(ne),o(ie),o(r),o(se),o(re),o(K)),o(f),y(m,e),y(v,e),y(I,e),y(L),y(N),y(Z),y(j),y(W),y(R),y(G),y(H,e)}}}const Ye='{"title":"Configuration","local":"configuration","sections":[{"title":"ConfigMixin","local":"diffusers.ConfigMixin","sections":[],"depth":2}],"depth":1}';function Oe(ee){return Ze(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class it extends Re{constructor(f){super(),Ge(this,f,Oe,ze,Ne,{})}}export{it as component};
