Buckets:
| import{s as Pe,o as Ne,n as Ie}from"../chunks/scheduler.8c3d61f6.js";import{S as Ze,i as Le,g as c,s as r,r as h,A as We,h as l,f as n,c as a,j as E,u as _,x as M,k as J,y as t,a as g,v as x,d as b,t as v,w as y}from"../chunks/index.da70eac4.js";import{T as Re}from"../chunks/Tip.1d9b8c37.js";import{D as K}from"../chunks/Docstring.ee4b6913.js";import{C as Ge}from"../chunks/CodeBlock.00a903b3.js";import{E as He}from"../chunks/ExampleCodeBlock.f7bd2c1f.js";import{H as Je,E as Ve}from"../chunks/EditOnGithub.1e64e623.js";function Fe(V){let o,w='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(){o=c("p"),o.innerHTML=w},l(u){o=l(u,"P",{"data-svelte-h":!0}),M(o)!=="svelte-i4hp16"&&(o.innerHTML=w)},m(u,m){g(u,o,m)},p:Ie,d(u){u&&n(o)}}}function Be(V){let o,w="Examples:",u,m,p;return m=new Ge({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEREUE1TY2hlZHVsZXIlMkMlMjBERElNU2NoZWR1bGVyJTJDJTIwUE5ETVNjaGVkdWxlciUwQSUwQSUyMyUyMERvd25sb2FkJTIwc2NoZWR1bGVyJTIwZnJvbSUyMGh1Z2dpbmdmYWNlLmNvJTIwYW5kJTIwY2FjaGUuJTBBc2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyKSUwQSUwQSUyMyUyMEluc3RhbnRpYXRlJTIwRERJTSUyMHNjaGVkdWxlciUyMGNsYXNzJTIwd2l0aCUyMHNhbWUlMjBjb25maWclMjBhcyUyMEREUE0lMEFzY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGVyLmZyb21fY29uZmlnKHNjaGVkdWxlci5jb25maWcpJTBBJTBBJTIzJTIwSW5zdGFudGlhdGUlMjBQTkRNJTIwc2NoZWR1bGVyJTIwY2xhc3MlMjB3aXRoJTIwc2FtZSUyMGNvbmZpZyUyMGFzJTIwRERQTSUwQXNjaGVkdWxlciUyMCUzRCUyMFBORE1TY2hlZHVsZXIuZnJvbV9jb25maWcoc2NoZWR1bGVyLmNvbmZpZyk=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDPMScheduler, DDIMScheduler, PNDMScheduler | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Download scheduler from huggingface.co and cache.</span> | |
| <span class="hljs-meta">>>> </span>scheduler = DDPMScheduler.from_pretrained(<span class="hljs-string">"google/ddpm-cifar10-32"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Instantiate DDIM scheduler class with same config as DDPM</span> | |
| <span class="hljs-meta">>>> </span>scheduler = DDIMScheduler.from_config(scheduler.config) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Instantiate PNDM scheduler class with same config as DDPM</span> | |
| <span class="hljs-meta">>>> </span>scheduler = PNDMScheduler.from_config(scheduler.config)`,wrap:!1}}),{c(){o=c("p"),o.textContent=w,u=r(),h(m.$$.fragment)},l(f){o=l(f,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=w),u=a(f),_(m.$$.fragment,f)},m(f,$){g(f,o,$),g(f,u,$),x(m,f,$),p=!0},p:Ie,i(f){p||(b(m.$$.fragment,f),p=!0)},o(f){v(m.$$.fragment,f),p=!1},d(f){f&&(n(o),n(u)),y(m,f)}}}function Ae(V){let o,w,u,m,p,f,$,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.',te,T,oe,I,ne,s,P,le,F,Ce=`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>.`,fe,B,Te="Class attributes:",ue,A,ke=`<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>`,ge,k,N,me,Y,je="Load a model or scheduler configuration.",pe,C,Z,he,q,De="Instantiate a Python class from a config dictionary.",_e,j,xe,D,L,be,z,Se=`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.`,ve,S,W,ye,Q,Ue="Save the configuration instance’s parameters to a JSON file.",$e,U,R,Me,O,Ee="Serializes the configuration instance to a JSON string.",ie,G,se,ee,re;return p=new Je({props:{title:"Configuration",local:"configuration",headingTag:"h1"}}),T=new Re({props:{$$slots:{default:[Fe]},$$scope:{ctx:V}}}),I=new Je({props:{title:"ConfigMixin",local:"diffusers.ConfigMixin",headingTag:"h2"}}),P=new K({props:{name:"class diffusers.ConfigMixin",anchor:"diffusers.ConfigMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L87"}}),N=new K({props:{name:"load_config",anchor:"diffusers.ConfigMixin.load_config",parameters:[{name:"pretrained_model_name_or_path",val:": Union"},{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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</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>) — | |
| 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>) — | |
| Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model | |
| won’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>) — | |
| 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>"main"</code>) — | |
| 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>""</code>) — | |
| 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) —\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#L286",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 K({props:{name:"from_config",anchor:"diffusers.ConfigMixin.from_config",parameters:[{name:"config",val:": Union = 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>) — | |
| 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>) — | |
| 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>) — | |
| 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’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#L187",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 He({props:{anchor:"diffusers.ConfigMixin.from_config.example",$$slots:{default:[Be]},$$scope:{ctx:V}}}),L=new K({props:{name:"save_config",anchor:"diffusers.ConfigMixin.save_config",parameters:[{name:"save_directory",val:": Union"},{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>) — | |
| 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>) — | |
| 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>) — | |
| Additional keyword arguments passed along to the <a href="/docs/diffusers/main/en/api/pipelines/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#L145"}}),W=new K({props:{name:"to_json_file",anchor:"diffusers.ConfigMixin.to_json_file",parameters:[{name:"json_file_path",val:": Union"}],parametersDescription:[{anchor:"diffusers.ConfigMixin.to_json_file.json_file_path",description:`<strong>json_file_path</strong> (<code>str</code> or <code>os.PathLike</code>) — | |
| Path to the JSON file to save a configuration instance’s parameters.`,name:"json_file_path"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/configuration_utils.py#L596"}}),R=new K({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#L570",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> | |
| `}}),G=new Ve({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/configuration.md"}}),{c(){o=c("meta"),w=r(),u=c("p"),m=r(),h(p.$$.fragment),f=r(),$=c("p"),$.innerHTML=we,te=r(),h(T.$$.fragment),oe=r(),h(I.$$.fragment),ne=r(),s=c("div"),h(P.$$.fragment),le=r(),F=c("p"),F.innerHTML=Ce,fe=r(),B=c("p"),B.textContent=Te,ue=r(),A=c("ul"),A.innerHTML=ke,ge=r(),k=c("div"),h(N.$$.fragment),me=r(),Y=c("p"),Y.textContent=je,pe=r(),C=c("div"),h(Z.$$.fragment),he=r(),q=c("p"),q.textContent=De,_e=r(),h(j.$$.fragment),xe=r(),D=c("div"),h(L.$$.fragment),be=r(),z=c("p"),z.innerHTML=Se,ve=r(),S=c("div"),h(W.$$.fragment),ye=r(),Q=c("p"),Q.textContent=Ue,$e=r(),U=c("div"),h(R.$$.fragment),Me=r(),O=c("p"),O.textContent=Ee,ie=r(),h(G.$$.fragment),se=r(),ee=c("p"),this.h()},l(e){const i=We("svelte-u9bgzb",document.head);o=l(i,"META",{name:!0,content:!0}),i.forEach(n),w=a(e),u=l(e,"P",{}),E(u).forEach(n),m=a(e),_(p.$$.fragment,e),f=a(e),$=l(e,"P",{"data-svelte-h":!0}),M($)!=="svelte-12f24yg"&&($.innerHTML=we),te=a(e),_(T.$$.fragment,e),oe=a(e),_(I.$$.fragment,e),ne=a(e),s=l(e,"DIV",{class:!0});var d=E(s);_(P.$$.fragment,d),le=a(d),F=l(d,"P",{"data-svelte-h":!0}),M(F)!=="svelte-h1555c"&&(F.innerHTML=Ce),fe=a(d),B=l(d,"P",{"data-svelte-h":!0}),M(B)!=="svelte-wz8va1"&&(B.textContent=Te),ue=a(d),A=l(d,"UL",{"data-svelte-h":!0}),M(A)!=="svelte-x900lx"&&(A.innerHTML=ke),ge=a(d),k=l(d,"DIV",{class:!0});var H=E(k);_(N.$$.fragment,H),me=a(H),Y=l(H,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-k51ly"&&(Y.textContent=je),H.forEach(n),pe=a(d),C=l(d,"DIV",{class:!0});var X=E(C);_(Z.$$.fragment,X),he=a(X),q=l(X,"P",{"data-svelte-h":!0}),M(q)!=="svelte-1vaeeyi"&&(q.textContent=De),_e=a(X),_(j.$$.fragment,X),X.forEach(n),xe=a(d),D=l(d,"DIV",{class:!0});var ae=E(D);_(L.$$.fragment,ae),be=a(ae),z=l(ae,"P",{"data-svelte-h":!0}),M(z)!=="svelte-mq6b1r"&&(z.innerHTML=Se),ae.forEach(n),ve=a(d),S=l(d,"DIV",{class:!0});var de=E(S);_(W.$$.fragment,de),ye=a(de),Q=l(de,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-if97l3"&&(Q.textContent=Ue),de.forEach(n),$e=a(d),U=l(d,"DIV",{class:!0});var ce=E(U);_(R.$$.fragment,ce),Me=a(ce),O=l(ce,"P",{"data-svelte-h":!0}),M(O)!=="svelte-tueex0"&&(O.textContent=Ee),ce.forEach(n),d.forEach(n),ie=a(e),_(G.$$.fragment,e),se=a(e),ee=l(e,"P",{}),E(ee).forEach(n),this.h()},h(){J(o,"name","hf:doc:metadata"),J(o,"content",Ye),J(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(s,"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,i){t(document.head,o),g(e,w,i),g(e,u,i),g(e,m,i),x(p,e,i),g(e,f,i),g(e,$,i),g(e,te,i),x(T,e,i),g(e,oe,i),x(I,e,i),g(e,ne,i),g(e,s,i),x(P,s,null),t(s,le),t(s,F),t(s,fe),t(s,B),t(s,ue),t(s,A),t(s,ge),t(s,k),x(N,k,null),t(k,me),t(k,Y),t(s,pe),t(s,C),x(Z,C,null),t(C,he),t(C,q),t(C,_e),x(j,C,null),t(s,xe),t(s,D),x(L,D,null),t(D,be),t(D,z),t(s,ve),t(s,S),x(W,S,null),t(S,ye),t(S,Q),t(s,$e),t(s,U),x(R,U,null),t(U,Me),t(U,O),g(e,ie,i),x(G,e,i),g(e,se,i),g(e,ee,i),re=!0},p(e,[i]){const d={};i&2&&(d.$$scope={dirty:i,ctx:e}),T.$set(d);const H={};i&2&&(H.$$scope={dirty:i,ctx:e}),j.$set(H)},i(e){re||(b(p.$$.fragment,e),b(T.$$.fragment,e),b(I.$$.fragment,e),b(P.$$.fragment,e),b(N.$$.fragment,e),b(Z.$$.fragment,e),b(j.$$.fragment,e),b(L.$$.fragment,e),b(W.$$.fragment,e),b(R.$$.fragment,e),b(G.$$.fragment,e),re=!0)},o(e){v(p.$$.fragment,e),v(T.$$.fragment,e),v(I.$$.fragment,e),v(P.$$.fragment,e),v(N.$$.fragment,e),v(Z.$$.fragment,e),v(j.$$.fragment,e),v(L.$$.fragment,e),v(W.$$.fragment,e),v(R.$$.fragment,e),v(G.$$.fragment,e),re=!1},d(e){e&&(n(w),n(u),n(m),n(f),n($),n(te),n(oe),n(ne),n(s),n(ie),n(se),n(ee)),n(o),y(p,e),y(T,e),y(I,e),y(P),y(N),y(Z),y(j),y(L),y(W),y(R),y(G,e)}}}const Ye='{"title":"Configuration","local":"configuration","sections":[{"title":"ConfigMixin","local":"diffusers.ConfigMixin","sections":[],"depth":2}],"depth":1}';function qe(V){return Ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ot extends Ze{constructor(o){super(),Le(this,o,qe,Ae,Pe,{})}}export{ot as component}; | |
Xet Storage Details
- Size:
- 19.2 kB
- Xet hash:
- adca63f4da61b988d35cc44ed8f94c8107fd68e88db49fe5699f352b20475e0d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.