import{s as pn,o as fn,n as V}from"../chunks/scheduler.8c3d61f6.js";import{S as un,i as hn,g as i,s as a,r as f,m as ln,H as gn,A as bn,h as l,f as m,c as r,j as U,u,n as dn,E as yn,x as _,k as j,y as o,a as w,v as h,d as g,t as b,w as y}from"../chunks/index.da70eac4.js";import{T as mn}from"../chunks/Tip.1d9b8c37.js";import{D as J}from"../chunks/Docstring.6b390b9a.js";import{C as Y}from"../chunks/CodeBlock.00a903b3.js";import{E as H}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as io,E as Mn}from"../chunks/EditOnGithub.1e64e623.js";function _n(T){let s,v='Using <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin.enable_layerwise_casting">enable_layerwise_casting()</a>:',d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMENvZ1ZpZGVvWFRyYW5zZm9ybWVyM0RNb2RlbCUwQSUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwQ29nVmlkZW9YVHJhbnNmb3JtZXIzRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJUSFVETSUyRkNvZ1ZpZGVvWC01YiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSklMEElMEElMjMlMjBFbmFibGUlMjBsYXllcndpc2UlMjBjYXN0aW5nJTIwdmlhJTIwdGhlJTIwbW9kZWwlMkMlMjB3aGljaCUyMGlnbm9yZXMlMjBjZXJ0YWluJTIwbW9kdWxlcyUyMGJ5JTIwZGVmYXVsdCUwQXRyYW5zZm9ybWVyLmVuYWJsZV9sYXllcndpc2VfY2FzdGluZyhzdG9yYWdlX2R0eXBlJTNEdG9yY2guZmxvYXQ4X2U0bTNmbiUyQyUyMGNvbXB1dGVfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> CogVideoXTransformer3DModel

<span class="hljs-meta">&gt;&gt;&gt; </span>transformer = CogVideoXTransformer3DModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;THUDM/CogVideoX-5b&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable layerwise casting via the model, which ignores certain modules by default</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transformer.enable_layerwise_casting(storage_dtype=torch.float8_e4m3fn, compute_dtype=torch.bfloat16)`,wrap:!1}}),{c(){s=i("p"),s.innerHTML=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-1anawjo"&&(s.innerHTML=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function vn(T){let s,v=`⚠️ When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`;return{c(){s=i("p"),s.textContent=v},l(d){s=l(d,"P",{"data-svelte-h":!0}),_(s)!=="svelte-17p1lpg"&&(s.textContent=v)},m(d,n){w(d,s,n)},p:V,d(d){d&&m(s)}}}function xn(T){let s,v="Examples:",d,n,c;return n=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwVU5ldDJEQ29uZGl0aW9uTW9kZWwlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQW1vZGVsJTIwJTNEJTIwVU5ldDJEQ29uZGl0aW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yLTElMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ1bmV0JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQW1vZGVsJTIwJTNEJTIwbW9kZWwudG8oJTIyY3VkYSUyMiklMEFtb2RlbC5lbmFibGVfeGZvcm1lcnNfbWVtb3J5X2VmZmljaWVudF9hdHRlbnRpb24oYXR0ZW50aW9uX29wJTNETWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>model = UNet2DConditionModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = model.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-kvfsh7"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function wn(T){let s,v=`To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated models</a>, log-in with
<code>huggingface-cli login</code>. You can also activate the special
<a href="https://huggingface.co/diffusers/installation.html#offline-mode" rel="nofollow">“offline-mode”</a> to use this method in a
firewalled environment.`;return{c(){s=i("p"),s.innerHTML=v},l(d){s=l(d,"P",{"data-svelte-h":!0}),_(s)!=="svelte-19a77yg"&&(s.innerHTML=v)},m(d,n){w(d,s,n)},p:V,d(d){d&&m(s)}}}function $n(T){let s,v="Example:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

unet = UNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-11lpom8"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function Tn(T){let s,v="If you get the error message below, you need to finetune the weights for your downstream task:",d,n,c;return n=new Y({props:{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwcnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjBhbmQlMjBhcmUlMjBuZXdseSUyMGluaXRpYWxpemVkJTIwYmVjYXVzZSUyMHRoZSUyMHNoYXBlcyUyMGRpZCUyMG5vdCUyMG1hdGNoJTNBJTBBLSUyMGNvbnZfaW4ud2VpZ2h0JTNBJTIwZm91bmQlMjBzaGFwZSUyMHRvcmNoLlNpemUoJTVCMzIwJTJDJTIwNCUyQyUyMDMlMkMlMjAzJTVEKSUyMGluJTIwdGhlJTIwY2hlY2twb2ludCUyMGFuZCUyMHRvcmNoLlNpemUoJTVCMzIwJTJDJTIwOSUyQyUyMDMlMkMlMjAzJTVEKSUyMGluJTIwdGhlJTIwbW9kZWwlMjBpbnN0YW50aWF0ZWQlMEFZb3UlMjBzaG91bGQlMjBwcm9iYWJseSUyMFRSQUlOJTIwdGhpcyUyMG1vZGVsJTIwb24lMjBhJTIwZG93bi1zdHJlYW0lMjB0YXNrJTIwdG8lMjBiZSUyMGFibGUlMjB0byUyMHVzZSUyMGl0JTIwZm9yJTIwcHJlZGljdGlvbnMlMjBhbmQlMjBpbmZlcmVuY2Uu",highlighted:`Some weights of UNet2DConditionModel were not initialized from the model checkpoint at runwayml/stable-diffusion-v1-5 and are newly initialized because the shapes did not match:
- conv_in.weight: found shape torch.Size([320, 4, 3, 3]) <span class="hljs-keyword">in</span> the checkpoint and torch.Size([320, 9, 3, 3]) <span class="hljs-keyword">in</span> the model instantiated
You should probably TRAIN this model on a down-stream task to be able to use it <span class="hljs-keyword">for</span> predictions and inference.`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-xueb0m"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function Un(T){let s,v="Example:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQXVuZXQlMjAlM0QlMjBVTmV0MkRDb25kaXRpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjBzdWJmb2xkZXIlM0QlMjJ1bmV0JTIyKSUwQXVuZXQubnVtX3BhcmFtZXRlcnMob25seV90cmFpbmFibGUlM0RUcnVlKSUwQTg1OTUyMDk2NA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
unet = UNet2DConditionModel.from_pretrained(model_id, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)
unet.num_parameters(only_trainable=<span class="hljs-literal">True</span>)
<span class="hljs-number">859520964</span>`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-11lpom8"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function jn(T){let s,v="Examples:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhVTmV0MkRDb25kaXRpb25Nb2RlbCUwQSUwQSUyMyUyMERvd25sb2FkJTIwbW9kZWwlMjBhbmQlMjBjb25maWd1cmF0aW9uJTIwZnJvbSUyMGh1Z2dpbmdmYWNlLmNvJTIwYW5kJTIwY2FjaGUuJTBBbW9kZWwlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4VU5ldDJEQ29uZGl0aW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyKSUwQSUyMyUyME1vZGVsJTIwd2FzJTIwc2F2ZWQlMjB1c2luZyUyMCpzYXZlX3ByZXRyYWluZWQoJy4lMkZ0ZXN0JTJGc2F2ZWRfbW9kZWwlMkYnKSolMjAoZm9yJTIwZXhhbXBsZSUyMHB1cnBvc2VzJTJDJTIwbm90JTIwcnVubmFibGUpLiUwQW1vZGVsJTJDJTIwcGFyYW1zJTIwJTNEJTIwRmxheFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjIuJTJGdGVzdCUyRnNhdmVkX21vZGVsJTJGJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxUNet2DConditionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Model was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)* (for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/&quot;</span>)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-kvfsh7"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function Jn(T){let s,v="If you get the error message below, you need to finetune the weights for your downstream task:",d,n,c;return n=new Y({props:{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwcnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjBhbmQlMjBhcmUlMjBuZXdseSUyMGluaXRpYWxpemVkJTIwYmVjYXVzZSUyMHRoZSUyMHNoYXBlcyUyMGRpZCUyMG5vdCUyMG1hdGNoJTNBJTBBLSUyMGNvbnZfaW4ud2VpZ2h0JTNBJTIwZm91bmQlMjBzaGFwZSUyMHRvcmNoLlNpemUoJTVCMzIwJTJDJTIwNCUyQyUyMDMlMkMlMjAzJTVEKSUyMGluJTIwdGhlJTIwY2hlY2twb2ludCUyMGFuZCUyMHRvcmNoLlNpemUoJTVCMzIwJTJDJTIwOSUyQyUyMDMlMkMlMjAzJTVEKSUyMGluJTIwdGhlJTIwbW9kZWwlMjBpbnN0YW50aWF0ZWQlMEFZb3UlMjBzaG91bGQlMjBwcm9iYWJseSUyMFRSQUlOJTIwdGhpcyUyMG1vZGVsJTIwb24lMjBhJTIwZG93bi1zdHJlYW0lMjB0YXNrJTIwdG8lMjBiZSUyMGFibGUlMjB0byUyMHVzZSUyMGl0JTIwZm9yJTIwcHJlZGljdGlvbnMlMjBhbmQlMjBpbmZlcmVuY2Uu",highlighted:`Some weights of UNet2DConditionModel were not initialized from the model checkpoint at runwayml/stable-diffusion-v1-5 and are newly initialized because the shapes did not match:
- conv_in.weight: found shape torch.Size([320, 4, 3, 3]) <span class="hljs-keyword">in</span> the checkpoint and torch.Size([320, 9, 3, 3]) <span class="hljs-keyword">in</span> the model instantiated
You should probably TRAIN this model on a down-stream task to be able to use it <span class="hljs-keyword">for</span> predictions and inference.`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-xueb0m"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function kn(T){let s,v="Examples:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhVTmV0MkRDb25kaXRpb25Nb2RlbCUwQSUwQSUyMyUyMGxvYWQlMjBtb2RlbCUwQW1vZGVsJTJDJTIwcGFyYW1zJTIwJTNEJTIwRmxheFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiklMEElMjMlMjBCeSUyMGRlZmF1bHQlMkMlMjB0aGUlMjBtb2RlbCUyMHBhcmFtZXRlcnMlMjB3aWxsJTIwYmUlMjBpbiUyMGZwMzIlMjBwcmVjaXNpb24lMkMlMjB0byUyMGNhc3QlMjB0aGVzZSUyMHRvJTIwYmZsb2F0MTYlMjBwcmVjaXNpb24lMEFwYXJhbXMlMjAlM0QlMjBtb2RlbC50b19iZjE2KHBhcmFtcyklMEElMjMlMjBJZiUyMHlvdSUyMGRvbid0JTIwd2FudCUyMHRvJTIwY2FzdCUyMGNlcnRhaW4lMjBwYXJhbWV0ZXJzJTIwKGZvciUyMGV4YW1wbGUlMjBsYXllciUyMG5vcm0lMjBiaWFzJTIwYW5kJTIwc2NhbGUpJTBBJTIzJTIwdGhlbiUyMHBhc3MlMjB0aGUlMjBtYXNrJTIwYXMlMjBmb2xsb3dzJTBBZnJvbSUyMGZsYXglMjBpbXBvcnQlMjB0cmF2ZXJzZV91dGlsJTBBJTBBbW9kZWwlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4VU5ldDJEQ29uZGl0aW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyKSUwQWZsYXRfcGFyYW1zJTIwJTNEJTIwdHJhdmVyc2VfdXRpbC5mbGF0dGVuX2RpY3QocGFyYW1zKSUwQW1hc2slMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjBwYXRoJTNBJTIwKHBhdGglNUItMiU1RCUyMCElM0QlMjAoJTIyTGF5ZXJOb3JtJTIyJTJDJTIwJTIyYmlhcyUyMiklMjBhbmQlMjBwYXRoJTVCLTIlM0ElNUQlMjAhJTNEJTIwKCUyMkxheWVyTm9ybSUyMiUyQyUyMCUyMnNjYWxlJTIyKSklMEElMjAlMjAlMjAlMjBmb3IlMjBwYXRoJTIwaW4lMjBmbGF0X3BhcmFtcyUwQSU3RCUwQW1hc2slMjAlM0QlMjB0cmF2ZXJzZV91dGlsLnVuZmxhdHRlbl9kaWN0KG1hc2spJTBBcGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fYmYxNihwYXJhbXMlMkMlMjBtYXNrKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxUNet2DConditionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># By default, the model parameters will be in fp32 precision, to cast these to bfloat16 precision</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>params = model.to_bf16(params)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If you don&#x27;t want to cast certain parameters (for example layer norm bias and scale)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># then pass the mask as follows</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax <span class="hljs-keyword">import</span> traverse_util

<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>flat_params = traverse_util.flatten_dict(params)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = {
<span class="hljs-meta">... </span>    path: (path[-<span class="hljs-number">2</span>] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;bias&quot;</span>) <span class="hljs-keyword">and</span> path[-<span class="hljs-number">2</span>:] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;scale&quot;</span>))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> path <span class="hljs-keyword">in</span> flat_params
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = traverse_util.unflatten_dict(mask)
<span class="hljs-meta">&gt;&gt;&gt; </span>params = model.to_bf16(params, mask)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-kvfsh7"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function Zn(T){let s,v="Examples:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhVTmV0MkRDb25kaXRpb25Nb2RlbCUwQSUwQSUyMyUyMGxvYWQlMjBtb2RlbCUwQW1vZGVsJTJDJTIwcGFyYW1zJTIwJTNEJTIwRmxheFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiklMEElMjMlMjBCeSUyMGRlZmF1bHQlMkMlMjB0aGUlMjBtb2RlbCUyMHBhcmFtcyUyMHdpbGwlMjBiZSUyMGluJTIwZnAzMiUyQyUyMHRvJTIwY2FzdCUyMHRoZXNlJTIwdG8lMjBmbG9hdDE2JTBBcGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fZnAxNihwYXJhbXMpJTBBJTIzJTIwSWYlMjB5b3UlMjB3YW50JTIwZG9uJ3QlMjB3YW50JTIwdG8lMjBjYXN0JTIwY2VydGFpbiUyMHBhcmFtZXRlcnMlMjAoZm9yJTIwZXhhbXBsZSUyMGxheWVyJTIwbm9ybSUyMGJpYXMlMjBhbmQlMjBzY2FsZSklMEElMjMlMjB0aGVuJTIwcGFzcyUyMHRoZSUyMG1hc2slMjBhcyUyMGZvbGxvd3MlMEFmcm9tJTIwZmxheCUyMGltcG9ydCUyMHRyYXZlcnNlX3V0aWwlMEElMEFtb2RlbCUyQyUyMHBhcmFtcyUyMCUzRCUyMEZsYXhVTmV0MkRDb25kaXRpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIpJTBBZmxhdF9wYXJhbXMlMjAlM0QlMjB0cmF2ZXJzZV91dGlsLmZsYXR0ZW5fZGljdChwYXJhbXMpJTBBbWFzayUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMHBhdGglM0ElMjAocGF0aCU1Qi0yJTVEJTIwISUzRCUyMCglMjJMYXllck5vcm0lMjIlMkMlMjAlMjJiaWFzJTIyKSUyMGFuZCUyMHBhdGglNUItMiUzQSU1RCUyMCElM0QlMjAoJTIyTGF5ZXJOb3JtJTIyJTJDJTIwJTIyc2NhbGUlMjIpKSUwQSUyMCUyMCUyMCUyMGZvciUyMHBhdGglMjBpbiUyMGZsYXRfcGFyYW1zJTBBJTdEJTBBbWFzayUyMCUzRCUyMHRyYXZlcnNlX3V0aWwudW5mbGF0dGVuX2RpY3QobWFzayklMEFwYXJhbXMlMjAlM0QlMjBtb2RlbC50b19mcDE2KHBhcmFtcyUyQyUyMG1hc2sp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxUNet2DConditionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># By default, the model params will be in fp32, to cast these to float16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>params = model.to_fp16(params)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># If you want don&#x27;t want to cast certain parameters (for example layer norm bias and scale)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># then pass the mask as follows</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax <span class="hljs-keyword">import</span> traverse_util

<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>flat_params = traverse_util.flatten_dict(params)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = {
<span class="hljs-meta">... </span>    path: (path[-<span class="hljs-number">2</span>] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;bias&quot;</span>) <span class="hljs-keyword">and</span> path[-<span class="hljs-number">2</span>:] != (<span class="hljs-string">&quot;LayerNorm&quot;</span>, <span class="hljs-string">&quot;scale&quot;</span>))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> path <span class="hljs-keyword">in</span> flat_params
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>mask = traverse_util.unflatten_dict(mask)
<span class="hljs-meta">&gt;&gt;&gt; </span>params = model.to_fp16(params, mask)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-kvfsh7"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function Cn(T){let s,v="Examples:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhVTmV0MkRDb25kaXRpb25Nb2RlbCUwQSUwQSUyMyUyMERvd25sb2FkJTIwbW9kZWwlMjBhbmQlMjBjb25maWd1cmF0aW9uJTIwZnJvbSUyMGh1Z2dpbmdmYWNlLmNvJTBBbW9kZWwlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4VU5ldDJEQ29uZGl0aW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyKSUwQSUyMyUyMEJ5JTIwZGVmYXVsdCUyQyUyMHRoZSUyMG1vZGVsJTIwcGFyYW1zJTIwd2lsbCUyMGJlJTIwaW4lMjBmcDMyJTJDJTIwdG8lMjBpbGx1c3RyYXRlJTIwdGhlJTIwdXNlJTIwb2YlMjB0aGlzJTIwbWV0aG9kJTJDJTBBJTIzJTIwd2UnbGwlMjBmaXJzdCUyMGNhc3QlMjB0byUyMGZwMTYlMjBhbmQlMjBiYWNrJTIwdG8lMjBmcDMyJTBBcGFyYW1zJTIwJTNEJTIwbW9kZWwudG9fZjE2KHBhcmFtcyklMEElMjMlMjBub3clMjBjYXN0JTIwYmFjayUyMHRvJTIwZnAzMiUwQXBhcmFtcyUyMCUzRCUyMG1vZGVsLnRvX2ZwMzIocGFyYW1zKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxUNet2DConditionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># By default, the model params will be in fp32, to illustrate the use of this method,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># we&#x27;ll first cast to fp16 and back to fp32</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>params = model.to_f16(params)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># now cast back to fp32</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>params = model.to_fp32(params)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-kvfsh7"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function Gn(T){let s,v="Examples:",d,n,c;return n=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC11bmV0JTIyLiUwQXVuZXQucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLXVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtdW5ldCUyMi4lMEF1bmV0LnB1c2hfdG9faHViKCUyMnlvdXItb3JnJTJGbXktZmluZXR1bmVkLXVuZXQlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

unet = UNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)

<span class="hljs-comment"># Push the \`unet\` to your namespace with the name &quot;my-finetuned-unet&quot;.</span>
unet.push_to_hub(<span class="hljs-string">&quot;my-finetuned-unet&quot;</span>)

<span class="hljs-comment"># Push the \`unet\` to an organization with the name &quot;my-finetuned-unet&quot;.</span>
unet.push_to_hub(<span class="hljs-string">&quot;your-org/my-finetuned-unet&quot;</span>)`,wrap:!1}}),{c(){s=i("p"),s.textContent=v,d=a(),f(n.$$.fragment)},l(e){s=l(e,"P",{"data-svelte-h":!0}),_(s)!=="svelte-kvfsh7"&&(s.textContent=v),d=r(e),u(n.$$.fragment,e)},m(e,M){w(e,s,M),w(e,d,M),h(n,e,M),c=!0},p:V,i(e){c||(g(n.$$.fragment,e),c=!0)},o(e){b(n.$$.fragment,e),c=!1},d(e){e&&(m(s),m(d)),y(n,e)}}}function In(T){let s,v,d,n,c,e,M,lo,Dt,cn='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>p</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><msub><mi>x</mi><mrow><mi>t</mi><mo>−</mo><mn>1</mn></mrow></msub><mi mathvariant="normal">∣</mi><msub><mi>x</mi><mi>t</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">p_{\\theta}(x_{t-1}|x_{t})</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.02778em;">θ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span><span class="mord">∣</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2806em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span>',Qt,St,ve,Ts='All models are built from the base <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a> class which is a <a href="https://pytorch.org/docs/stable/generated/torch.nn.Module.html" rel="nofollow"><code>torch.nn.Module</code></a> providing basic functionality for saving and loading models, locally and from the Hugging Face Hub.',Pt,xe,Lt,x,we,mo,at,Us="Base class for all models.",co,rt,js=`<a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a> takes care of storing the model configuration and provides methods for loading, downloading and
saving models.`,po,it,Js='<li><strong>config_name</strong> (<code>str</code>) — Filename to save a model to when calling <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin.save_pretrained">save_pretrained()</a>.</li>',fo,S,$e,uo,lt,ks=`Potentially dequantize the model in case it has been quantized by a quantization method that support
dequantization.`,ho,P,Te,go,dt,Zs=`Deactivates gradient checkpointing for the current model (may be referred to as <em>activation checkpointing</em> or
<em>checkpoint activations</em> in other frameworks).`,bo,L,Ue,yo,mt,Cs="disable npu flash attention from torch_npu",Mo,q,je,_o,ct,Gs='Disable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',vo,A,Je,xo,pt,Is="Disable the flash attention pallals kernel for torch_xla.",wo,O,ke,$o,ft,Ws=`Activates gradient checkpointing for the current model (may be referred to as <em>activation checkpointing</em> or
<em>checkpoint activations</em> in other frameworks).`,To,C,Ze,Uo,ut,Fs="Activates layerwise casting for the current model.",jo,ht,Bs=`Layerwise casting is a technique that casts the model weights to a lower precision dtype for storage but
upcasts them on-the-fly to a higher precision dtype for computation. This process can significantly reduce the
memory footprint from model weights, but may lead to some quality degradation in the outputs. Most degradations
are negligible, mostly stemming from weight casting in normalization and modulation layers.`,Jo,gt,Vs=`By default, most models in diffusers set the <code>_skip_layerwise_casting_patterns</code> attribute to ignore patch
embedding, positional embedding and normalization layers. This is because these layers are most likely
precision-critical for quality. If you wish to change this behavior, you can set the
<code>_skip_layerwise_casting_patterns</code> attribute to <code>None</code>, or call
<a href="/docs/diffusers/main/en/api/utilities#diffusers.hooks.apply_layerwise_casting">apply_layerwise_casting()</a> with custom arguments.`,ko,bt,Rs="Example:",Zo,K,Co,ee,Ce,Go,yt,Ns="Enable npu flash attention from torch_npu",Io,F,Ge,Wo,Mt,Xs='Enable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',Fo,_t,zs=`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`,Bo,te,Vo,oe,Ro,se,Ie,No,vt,Hs="Enable the flash attention pallals kernel for torch_xla.",Xo,G,We,zo,xt,Ys="Instantiate a pretrained PyTorch model from a pretrained model configuration.",Ho,wt,Es=`The model is set in evaluation mode - <code>model.eval()</code> - by default, and dropout modules are deactivated. To
train the model, set it back in training mode with <code>model.train()</code>.`,Yo,ne,Eo,ae,Do,re,Qo,ie,Fe,So,$t,Ds=`Get the memory footprint of a model. This will return the memory footprint of the current model in bytes.
Useful to benchmark the memory footprint of the current model and design some tests. Solution inspired from the
PyTorch discussions: <a href="https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2" rel="nofollow">https://discuss.pytorch.org/t/gpu-memory-that-model-uses/56822/2</a>`,Po,E,Be,Lo,Tt,Qs="Get number of (trainable or non-embedding) parameters in the module.",qo,le,Ao,de,Ve,Oo,Ut,Ss=`Save a model and its configuration file to a directory so that it can be reloaded using the
<a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin.from_pretrained">from_pretrained()</a> class method.`,Ko,me,Re,es,jt,Ps="Set the switch for the npu flash attention.",qt,Ne,At,k,Xe,ts,Jt,Ls="Base class for all Flax models.",os,kt,qs=`<a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin">FlaxModelMixin</a> takes care of storing the model configuration and provides methods for loading, downloading and
saving models.`,ss,Zt,As='<li><strong>config_name</strong> (<code>str</code>) — Filename to save a model to when calling <a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin.save_pretrained">save_pretrained()</a>.</li>',ns,R,ze,as,Ct,Os="Instantiate a pretrained Flax model from a pretrained model configuration.",rs,ce,is,pe,ls,fe,He,ds,Gt,Ks=`Save a model and its configuration file to a directory so that it can be reloaded using the
<a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin.from_pretrained">from_pretrained()</a> class method.`,ms,N,Ye,cs,It,en=`Cast the floating-point <code>params</code> to <code>jax.numpy.bfloat16</code>. This returns a new <code>params</code> tree and does not cast
the <code>params</code> in place.`,ps,Wt,tn=`This method can be used on a TPU to explicitly convert the model parameters to bfloat16 precision to do full
half-precision training or to save weights in bfloat16 for inference in order to save memory and improve speed.`,fs,ue,us,X,Ee,hs,Ft,on=`Cast the floating-point <code>params</code> to <code>jax.numpy.float16</code>. This returns a new <code>params</code> tree and does not cast the
<code>params</code> in place.`,gs,Bt,sn=`This method can be used on a GPU to explicitly convert the model parameters to float16 precision to do full
half-precision training or to save weights in float16 for inference in order to save memory and improve speed.`,bs,he,ys,D,De,Ms,Vt,nn=`Cast the floating-point <code>params</code> to <code>jax.numpy.float32</code>. This method can be used to explicitly convert the
model parameters to fp32 precision. This returns a new <code>params</code> tree and does not cast the <code>params</code> in place.`,_s,ge,Ot,Qe,Kt,z,Se,vs,Rt,an="A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub.",xs,Q,Pe,ws,Nt,rn="Upload model, scheduler, or pipeline files to the 🤗 Hugging Face Hub.",$s,be,eo,Le,to,Et,oo;return c=new io({props:{title:"Models",local:"models",headingTag:"h1"}}),xe=new io({props:{title:"ModelMixin",local:"diffusers.ModelMixin",headingTag:"h2"}}),we=new J({props:{name:"class diffusers.ModelMixin",anchor:"diffusers.ModelMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L151"}}),$e=new J({props:{name:"dequantize",anchor:"diffusers.ModelMixin.dequantize",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L594"}}),Te=new J({props:{name:"disable_gradient_checkpointing",anchor:"diffusers.ModelMixin.disable_gradient_checkpointing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L229"}}),Ue=new J({props:{name:"disable_npu_flash_attention",anchor:"diffusers.ModelMixin.disable_npu_flash_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L260"}}),je=new J({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.ModelMixin.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L349"}}),Je=new J({props:{name:"disable_xla_flash_attention",anchor:"diffusers.ModelMixin.disable_xla_flash_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L290"}}),ke=new J({props:{name:"enable_gradient_checkpointing",anchor:"diffusers.ModelMixin.enable_gradient_checkpointing",parameters:[{name:"gradient_checkpointing_func",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.ModelMixin.enable_gradient_checkpointing.gradient_checkpointing_func",description:`<strong>gradient_checkpointing_func</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
The function to use for gradient checkpointing. If <code>None</code>, the default PyTorch checkpointing function
is used (<code>torch.utils.checkpoint.checkpoint</code>).`,name:"gradient_checkpointing_func"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L199"}}),Ze=new J({props:{name:"enable_layerwise_casting",anchor:"diffusers.ModelMixin.enable_layerwise_casting",parameters:[{name:"storage_dtype",val:": dtype = torch.float8_e4m3fn"},{name:"compute_dtype",val:": typing.Optional[torch.dtype] = None"},{name:"skip_modules_pattern",val:": typing.Optional[typing.Tuple[str, ...]] = None"},{name:"skip_modules_classes",val:": typing.Optional[typing.Tuple[typing.Type[torch.nn.modules.module.Module], ...]] = None"},{name:"non_blocking",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.ModelMixin.enable_layerwise_casting.storage_dtype",description:`<strong>storage_dtype</strong> (<code>torch.dtype</code>) &#x2014;
The dtype to which the model should be cast for storage.`,name:"storage_dtype"},{anchor:"diffusers.ModelMixin.enable_layerwise_casting.compute_dtype",description:`<strong>compute_dtype</strong> (<code>torch.dtype</code>) &#x2014;
The dtype to which the model weights should be cast during the forward pass.`,name:"compute_dtype"},{anchor:"diffusers.ModelMixin.enable_layerwise_casting.skip_modules_pattern",description:`<strong>skip_modules_pattern</strong> (<code>Tuple[str, ...]</code>, <em>optional</em>) &#x2014;
A list of patterns to match the names of the modules to skip during the layerwise casting process. If
set to <code>None</code>, default skip patterns are used to ignore certain internal layers of modules and PEFT
layers.`,name:"skip_modules_pattern"},{anchor:"diffusers.ModelMixin.enable_layerwise_casting.skip_modules_classes",description:`<strong>skip_modules_classes</strong> (<code>Tuple[Type[torch.nn.Module], ...]</code>, <em>optional</em>) &#x2014;
A list of module classes to skip during the layerwise casting process.`,name:"skip_modules_classes"},{anchor:"diffusers.ModelMixin.enable_layerwise_casting.non_blocking",description:`<strong>non_blocking</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, the weight casting operations are non-blocking.`,name:"non_blocking"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L355"}}),K=new H({props:{anchor:"diffusers.ModelMixin.enable_layerwise_casting.example",$$slots:{default:[_n]},$$scope:{ctx:T}}}),Ce=new J({props:{name:"enable_npu_flash_attention",anchor:"diffusers.ModelMixin.enable_npu_flash_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L253"}}),Ge=new J({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.ModelMixin.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.ModelMixin.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L313"}}),te=new mn({props:{warning:!0,$$slots:{default:[vn]},$$scope:{ctx:T}}}),oe=new H({props:{anchor:"diffusers.ModelMixin.enable_xformers_memory_efficient_attention.example",$$slots:{default:[xn]},$$scope:{ctx:T}}}),Ie=new J({props:{name:"enable_xla_flash_attention",anchor:"diffusers.ModelMixin.enable_xla_flash_attention",parameters:[{name:"partition_spec",val:": typing.Optional[typing.Callable] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L284"}}),We=new J({props:{name:"from_pretrained",anchor:"diffusers.ModelMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ModelMixin.from_pretrained.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 the model weights saved
with <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin.save_pretrained">save_pretrained()</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.ModelMixin.from_pretrained.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.ModelMixin.from_pretrained.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.ModelMixin.from_pretrained.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.ModelMixin.from_pretrained.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.ModelMixin.from_pretrained.output_loading_info",description:`<strong>output_loading_info</strong> (<code>bool</code>, <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"},{anchor:"diffusers.ModelMixin.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <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(bool,"},{anchor:"diffusers.ModelMixin.from_pretrained.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.ModelMixin.from_pretrained.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.ModelMixin.from_pretrained.from_flax",description:`<strong>from_flax</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a Flax checkpoint save file.`,name:"from_flax"},{anchor:"diffusers.ModelMixin.from_pretrained.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.ModelMixin.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"},{anchor:"diffusers.ModelMixin.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>Dict[str, Union[int, str, torch.device]]</code>, <em>optional</em>) &#x2014;
A map that specifies where each submodule should go. It doesn&#x2019;t need to be defined for each
parameter/buffer name; once a given module name is inside, every submodule of it will be sent to the
same device. Defaults to <code>None</code>, meaning that the model will be loaded on CPU.</p>
<p>Set <code>device_map=&quot;auto&quot;</code> to have &#x1F917; Accelerate automatically compute the most optimized <code>device_map</code>. For
more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device
map</a>.`,name:"device_map"},{anchor:"diffusers.ModelMixin.from_pretrained.max_memory",description:`<strong>max_memory</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
A dictionary device identifier for the maximum memory. Will default to the maximum memory available for
each GPU and the available CPU RAM if unset.`,name:"max_memory"},{anchor:"diffusers.ModelMixin.from_pretrained.offload_folder",description:`<strong>offload_folder</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
The path to offload weights if <code>device_map</code> contains the value <code>&quot;disk&quot;</code>.`,name:"offload_folder"},{anchor:"diffusers.ModelMixin.from_pretrained.offload_state_dict",description:`<strong>offload_state_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, temporarily offloads the CPU state dict to the hard drive to avoid running out of CPU RAM if
the weight of the CPU state dict + the biggest shard of the checkpoint does not fit. Defaults to <code>True</code>
when there is some disk offload.`,name:"offload_state_dict"},{anchor:"diffusers.ModelMixin.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.ModelMixin.from_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Load weights from a specified <code>variant</code> filename such as <code>&quot;fp16&quot;</code> or <code>&quot;ema&quot;</code>. This is ignored when
loading <code>from_flax</code>.`,name:"variant"},{anchor:"diffusers.ModelMixin.from_pretrained.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the <code>safetensors</code> weights are downloaded if they&#x2019;re available <strong>and</strong> if the
<code>safetensors</code> library is installed. If set to <code>True</code>, the model is forcibly loaded from <code>safetensors</code>
weights. If set to <code>False</code>, <code>safetensors</code> weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.ModelMixin.from_pretrained.disable_mmap",description:`<strong>disable_mmap</strong> (&#x2018;bool&#x2019;, <em>optional</em>, defaults to &#x2018;False&#x2019;) &#x2014;
Whether to disable mmap when loading a Safetensors model. This option can perform better when the model
is on a network mount or hard drive, which may not handle the seeky-ness of mmap very well.`,name:"disable_mmap"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L606"}}),ne=new mn({props:{$$slots:{default:[wn]},$$scope:{ctx:T}}}),ae=new H({props:{anchor:"diffusers.ModelMixin.from_pretrained.example",$$slots:{default:[$n]},$$scope:{ctx:T}}}),re=new H({props:{anchor:"diffusers.ModelMixin.from_pretrained.example-2",$$slots:{default:[Tn]},$$scope:{ctx:T}}}),Fe=new J({props:{name:"get_memory_footprint",anchor:"diffusers.ModelMixin.get_memory_footprint",parameters:[{name:"return_buffers",val:" = True"}],parametersDescription:[{anchor:"diffusers.ModelMixin.get_memory_footprint.return_buffers",description:`<strong>return_buffers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return the size of the buffer tensors in the computation of the memory footprint. Buffers
are tensors that do not require gradients and not registered as parameters. E.g. mean and std in batch
norm layers. Please see: <a href="https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266/2" rel="nofollow">https://discuss.pytorch.org/t/what-pytorch-means-by-buffers/120266/2</a>`,name:"return_buffers"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L1461"}}),Be=new J({props:{name:"num_parameters",anchor:"diffusers.ModelMixin.num_parameters",parameters:[{name:"only_trainable",val:": bool = False"},{name:"exclude_embeddings",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.ModelMixin.num_parameters.only_trainable",description:`<strong>only_trainable</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return only the number of trainable parameters.`,name:"only_trainable"},{anchor:"diffusers.ModelMixin.num_parameters.exclude_embeddings",description:`<strong>exclude_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return only the number of non-embedding parameters.`,name:"exclude_embeddings"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L1397",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The number of parameters.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),le=new H({props:{anchor:"diffusers.ModelMixin.num_parameters.example",$$slots:{default:[Un]},$$scope:{ctx:T}}}),Ve=new J({props:{name:"save_pretrained",anchor:"diffusers.ModelMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"is_main_process",val:": bool = True"},{name:"save_function",val:": typing.Optional[typing.Callable] = None"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": typing.Optional[str] = None"},{name:"max_shard_size",val:": typing.Union[int, str] = '10GB'"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ModelMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save a model and its configuration file to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.ModelMixin.save_pretrained.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.ModelMixin.save_pretrained.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"},{anchor:"diffusers.ModelMixin.save_pretrained.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"},{anchor:"diffusers.ModelMixin.save_pretrained.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified, weights are saved in the format <code>pytorch_model.&lt;variant&gt;.bin</code>.`,name:"variant"},{anchor:"diffusers.ModelMixin.save_pretrained.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size
lower than this size. If expressed as a string, needs to be digits followed by a unit (like <code>&quot;5GB&quot;</code>).
If expressed as an integer, the unit is bytes. Note that this limit will be decreased after a certain
period of time (starting from Oct 2024) to allow users to upgrade to the latest version of <code>diffusers</code>.
This is to establish a common default size for this argument across different libraries in the Hugging
Face ecosystem (<code>transformers</code>, and <code>accelerate</code>, for example).`,name:"max_shard_size"},{anchor:"diffusers.ModelMixin.save_pretrained.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.ModelMixin.save_pretrained.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/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/models/modeling_utils.py#L439"}}),Re=new J({props:{name:"set_use_npu_flash_attention",anchor:"diffusers.ModelMixin.set_use_npu_flash_attention",parameters:[{name:"valid",val:": bool"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L237"}}),Ne=new io({props:{title:"FlaxModelMixin",local:"diffusers.FlaxModelMixin",headingTag:"h2"}}),Xe=new J({props:{name:"class diffusers.FlaxModelMixin",anchor:"diffusers.FlaxModelMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_flax_utils.py#L50"}}),ze=new J({props:{name:"from_pretrained",anchor:"diffusers.FlaxModelMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"*model_args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>runwayml/stable-diffusion-v1-5</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 the model weights saved
using <a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin.save_pretrained">save_pretrained()</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified, all the computation will be performed with the given <code>dtype</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>This only specifies the dtype of the <em>computation</em> and does not influence the dtype of model
parameters.</p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin.to_fp16">to_fp16()</a> and
<a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin.to_bf16">to_bf16()</a>.</p>

					</div>`,name:"dtype"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.model_args",description:`<strong>model_args</strong> (sequence of positional arguments, <em>optional</em>) &#x2014;
All remaining positional arguments are passed to the underlying model&#x2019;s <code>__init__</code> method.`,name:"model_args"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.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.FlaxModelMixin.from_pretrained.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.FlaxModelMixin.from_pretrained.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.FlaxModelMixin.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <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(bool,"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.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.FlaxModelMixin.from_pretrained.from_pt",description:`<strong>from_pt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a PyTorch checkpoint save file.`,name:"from_pt"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.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 model (for
example, <code>output_attentions=True</code>). Behaves differently depending on whether a <code>config</code> is provided or
automatically loaded:</p>
<ul>
<li>If a configuration is provided with <code>config</code>, <code>kwargs</code> are directly passed to the underlying
model&#x2019;s <code>__init__</code> method (we assume all relevant updates to the configuration have already been
done).</li>
<li>If a configuration is not provided, <code>kwargs</code> are first passed to the configuration class
initialization function <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.from_config">from_config()</a>. Each key of the <code>kwargs</code> that corresponds
to a configuration attribute is used to override said attribute with the supplied <code>kwargs</code> value.
Remaining keys that do not correspond to any configuration attribute are passed to the underlying
model&#x2019;s <code>__init__</code> function.</li>
</ul>`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_flax_utils.py#L203"}}),ce=new H({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example",$$slots:{default:[jn]},$$scope:{ctx:T}}}),pe=new H({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example-2",$$slots:{default:[Jn]},$$scope:{ctx:T}}}),He=new J({props:{name:"save_pretrained",anchor:"diffusers.FlaxModelMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"is_main_process",val:": bool = True"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save a model and its configuration file to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.FlaxModelMixin.save_pretrained.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"diffusers.FlaxModelMixin.save_pretrained.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.FlaxModelMixin.save_pretrained.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 model 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.FlaxModelMixin.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word 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/models/modeling_flax_utils.py#L497"}}),Ye=new J({props:{name:"to_bf16",anchor:"diffusers.FlaxModelMixin.to_bf16",parameters:[{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"mask",val:": typing.Any = None"}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.to_bf16.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"diffusers.FlaxModelMixin.to_bf16.mask",description:`<strong>mask</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> with same structure as the <code>params</code> tree. The leaves should be booleans. It should be <code>True</code>
for params you want to cast, and <code>False</code> for those you want to skip.`,name:"mask"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_flax_utils.py#L95"}}),ue=new H({props:{anchor:"diffusers.FlaxModelMixin.to_bf16.example",$$slots:{default:[kn]},$$scope:{ctx:T}}}),Ee=new J({props:{name:"to_fp16",anchor:"diffusers.FlaxModelMixin.to_fp16",parameters:[{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"mask",val:": typing.Any = None"}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.to_fp16.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"diffusers.FlaxModelMixin.to_fp16.mask",description:`<strong>mask</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> with same structure as the <code>params</code> tree. The leaves should be booleans. It should be <code>True</code>
for params you want to cast, and <code>False</code> for those you want to skip.`,name:"mask"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_flax_utils.py#L161"}}),he=new H({props:{anchor:"diffusers.FlaxModelMixin.to_fp16.example",$$slots:{default:[Zn]},$$scope:{ctx:T}}}),De=new J({props:{name:"to_fp32",anchor:"diffusers.FlaxModelMixin.to_fp32",parameters:[{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"mask",val:": typing.Any = None"}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.to_fp32.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"diffusers.FlaxModelMixin.to_fp32.mask",description:`<strong>mask</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> with same structure as the <code>params</code> tree. The leaves should be booleans. It should be <code>True</code>
for params you want to cast, and <code>False</code> for those you want to skip.`,name:"mask"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_flax_utils.py#L134"}}),ge=new H({props:{anchor:"diffusers.FlaxModelMixin.to_fp32.example",$$slots:{default:[Cn]},$$scope:{ctx:T}}}),Qe=new io({props:{title:"PushToHubMixin",local:"diffusers.utils.PushToHubMixin",headingTag:"h2"}}),Se=new J({props:{name:"class diffusers.utils.PushToHubMixin",anchor:"diffusers.utils.PushToHubMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/hub_utils.py#L463"}}),Pe=new J({props:{name:"push_to_hub",anchor:"diffusers.utils.PushToHubMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your model, scheduler, or pipeline files to. It should
contain your organization name when pushing to an organization. <code>repo_id</code> can also be a path to a local
directory.`,name:"repo_id"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Default to <code>&quot;Upload {object}&quot;</code>.`,name:"commit_message"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the
organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. The token generated when running
<code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to convert the model weights to the <code>safetensors</code> format.`,name:"safe_serialization"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If specified, weights are saved in the format <code>pytorch_model.&lt;variant&gt;.bin</code>.`,name:"variant"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/hub_utils.py#L492"}}),be=new H({props:{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[Gn]},$$scope:{ctx:T}}}),Le=new Mn({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/overview.md"}}),{c(){s=i("meta"),v=a(),d=i("p"),n=a(),f(c.$$.fragment),e=a(),M=i("p"),lo=ln("🤗 Diffusers provides pretrained models for popular algorithms and modules to create custom diffusion systems. The primary function of models is to denoise an input sample as modeled by the distribution "),Dt=new gn(!1),Qt=ln("."),St=a(),ve=i("p"),ve.innerHTML=Ts,Pt=a(),f(xe.$$.fragment),Lt=a(),x=i("div"),f(we.$$.fragment),mo=a(),at=i("p"),at.textContent=Us,co=a(),rt=i("p"),rt.innerHTML=js,po=a(),it=i("ul"),it.innerHTML=Js,fo=a(),S=i("div"),f($e.$$.fragment),uo=a(),lt=i("p"),lt.textContent=ks,ho=a(),P=i("div"),f(Te.$$.fragment),go=a(),dt=i("p"),dt.innerHTML=Zs,bo=a(),L=i("div"),f(Ue.$$.fragment),yo=a(),mt=i("p"),mt.textContent=Cs,Mo=a(),q=i("div"),f(je.$$.fragment),_o=a(),ct=i("p"),ct.innerHTML=Gs,vo=a(),A=i("div"),f(Je.$$.fragment),xo=a(),pt=i("p"),pt.textContent=Is,wo=a(),O=i("div"),f(ke.$$.fragment),$o=a(),ft=i("p"),ft.innerHTML=Ws,To=a(),C=i("div"),f(Ze.$$.fragment),Uo=a(),ut=i("p"),ut.textContent=Fs,jo=a(),ht=i("p"),ht.textContent=Bs,Jo=a(),gt=i("p"),gt.innerHTML=Vs,ko=a(),bt=i("p"),bt.textContent=Rs,Zo=a(),f(K.$$.fragment),Co=a(),ee=i("div"),f(Ce.$$.fragment),Go=a(),yt=i("p"),yt.textContent=Ns,Io=a(),F=i("div"),f(Ge.$$.fragment),Wo=a(),Mt=i("p"),Mt.innerHTML=Xs,Fo=a(),_t=i("p"),_t.textContent=zs,Bo=a(),f(te.$$.fragment),Vo=a(),f(oe.$$.fragment),Ro=a(),se=i("div"),f(Ie.$$.fragment),No=a(),vt=i("p"),vt.textContent=Hs,Xo=a(),G=i("div"),f(We.$$.fragment),zo=a(),xt=i("p"),xt.textContent=Ys,Ho=a(),wt=i("p"),wt.innerHTML=Es,Yo=a(),f(ne.$$.fragment),Eo=a(),f(ae.$$.fragment),Do=a(),f(re.$$.fragment),Qo=a(),ie=i("div"),f(Fe.$$.fragment),So=a(),$t=i("p"),$t.innerHTML=Ds,Po=a(),E=i("div"),f(Be.$$.fragment),Lo=a(),Tt=i("p"),Tt.textContent=Qs,qo=a(),f(le.$$.fragment),Ao=a(),de=i("div"),f(Ve.$$.fragment),Oo=a(),Ut=i("p"),Ut.innerHTML=Ss,Ko=a(),me=i("div"),f(Re.$$.fragment),es=a(),jt=i("p"),jt.textContent=Ps,qt=a(),f(Ne.$$.fragment),At=a(),k=i("div"),f(Xe.$$.fragment),ts=a(),Jt=i("p"),Jt.textContent=Ls,os=a(),kt=i("p"),kt.innerHTML=qs,ss=a(),Zt=i("ul"),Zt.innerHTML=As,ns=a(),R=i("div"),f(ze.$$.fragment),as=a(),Ct=i("p"),Ct.textContent=Os,rs=a(),f(ce.$$.fragment),is=a(),f(pe.$$.fragment),ls=a(),fe=i("div"),f(He.$$.fragment),ds=a(),Gt=i("p"),Gt.innerHTML=Ks,ms=a(),N=i("div"),f(Ye.$$.fragment),cs=a(),It=i("p"),It.innerHTML=en,ps=a(),Wt=i("p"),Wt.textContent=tn,fs=a(),f(ue.$$.fragment),us=a(),X=i("div"),f(Ee.$$.fragment),hs=a(),Ft=i("p"),Ft.innerHTML=on,gs=a(),Bt=i("p"),Bt.textContent=sn,bs=a(),f(he.$$.fragment),ys=a(),D=i("div"),f(De.$$.fragment),Ms=a(),Vt=i("p"),Vt.innerHTML=nn,_s=a(),f(ge.$$.fragment),Ot=a(),f(Qe.$$.fragment),Kt=a(),z=i("div"),f(Se.$$.fragment),vs=a(),Rt=i("p"),Rt.textContent=an,xs=a(),Q=i("div"),f(Pe.$$.fragment),ws=a(),Nt=i("p"),Nt.textContent=rn,$s=a(),f(be.$$.fragment),eo=a(),f(Le.$$.fragment),to=a(),Et=i("p"),this.h()},l(t){const p=bn("svelte-u9bgzb",document.head);s=l(p,"META",{name:!0,content:!0}),p.forEach(m),v=r(t),d=l(t,"P",{}),U(d).forEach(m),n=r(t),u(c.$$.fragment,t),e=r(t),M=l(t,"P",{});var qe=U(M);lo=dn(qe,"🤗 Diffusers provides pretrained models for popular algorithms and modules to create custom diffusion systems. The primary function of models is to denoise an input sample as modeled by the distribution "),Dt=yn(qe,!1),Qt=dn(qe,"."),qe.forEach(m),St=r(t),ve=l(t,"P",{"data-svelte-h":!0}),_(ve)!=="svelte-1elbdrk"&&(ve.innerHTML=Ts),Pt=r(t),u(xe.$$.fragment,t),Lt=r(t),x=l(t,"DIV",{class:!0});var $=U(x);u(we.$$.fragment,$),mo=r($),at=l($,"P",{"data-svelte-h":!0}),_(at)!=="svelte-12nk4t7"&&(at.textContent=Us),co=r($),rt=l($,"P",{"data-svelte-h":!0}),_(rt)!=="svelte-ku6myw"&&(rt.innerHTML=js),po=r($),it=l($,"UL",{"data-svelte-h":!0}),_(it)!=="svelte-kvpw1l"&&(it.innerHTML=Js),fo=r($),S=l($,"DIV",{class:!0});var Ae=U(S);u($e.$$.fragment,Ae),uo=r(Ae),lt=l(Ae,"P",{"data-svelte-h":!0}),_(lt)!=="svelte-on69a4"&&(lt.textContent=ks),Ae.forEach(m),ho=r($),P=l($,"DIV",{class:!0});var Oe=U(P);u(Te.$$.fragment,Oe),go=r(Oe),dt=l(Oe,"P",{"data-svelte-h":!0}),_(dt)!=="svelte-jedy0o"&&(dt.innerHTML=Zs),Oe.forEach(m),bo=r($),L=l($,"DIV",{class:!0});var Ke=U(L);u(Ue.$$.fragment,Ke),yo=r(Ke),mt=l(Ke,"P",{"data-svelte-h":!0}),_(mt)!=="svelte-advgdt"&&(mt.textContent=Cs),Ke.forEach(m),Mo=r($),q=l($,"DIV",{class:!0});var et=U(q);u(je.$$.fragment,et),_o=r(et),ct=l(et,"P",{"data-svelte-h":!0}),_(ct)!=="svelte-1vfte1e"&&(ct.innerHTML=Gs),et.forEach(m),vo=r($),A=l($,"DIV",{class:!0});var tt=U(A);u(Je.$$.fragment,tt),xo=r(tt),pt=l(tt,"P",{"data-svelte-h":!0}),_(pt)!=="svelte-l9u3py"&&(pt.textContent=Is),tt.forEach(m),wo=r($),O=l($,"DIV",{class:!0});var ot=U(O);u(ke.$$.fragment,ot),$o=r(ot),ft=l(ot,"P",{"data-svelte-h":!0}),_(ft)!=="svelte-1rv66k9"&&(ft.innerHTML=Ws),ot.forEach(m),To=r($),C=l($,"DIV",{class:!0});var I=U(C);u(Ze.$$.fragment,I),Uo=r(I),ut=l(I,"P",{"data-svelte-h":!0}),_(ut)!=="svelte-1iclqp4"&&(ut.textContent=Fs),jo=r(I),ht=l(I,"P",{"data-svelte-h":!0}),_(ht)!=="svelte-1qne8y2"&&(ht.textContent=Bs),Jo=r(I),gt=l(I,"P",{"data-svelte-h":!0}),_(gt)!=="svelte-ss6or"&&(gt.innerHTML=Vs),ko=r(I),bt=l(I,"P",{"data-svelte-h":!0}),_(bt)!=="svelte-11lpom8"&&(bt.textContent=Rs),Zo=r(I),u(K.$$.fragment,I),I.forEach(m),Co=r($),ee=l($,"DIV",{class:!0});var st=U(ee);u(Ce.$$.fragment,st),Go=r(st),yt=l(st,"P",{"data-svelte-h":!0}),_(yt)!=="svelte-10xtjge"&&(yt.textContent=Ns),st.forEach(m),Io=r($),F=l($,"DIV",{class:!0});var B=U(F);u(Ge.$$.fragment,B),Wo=r(B),Mt=l(B,"P",{"data-svelte-h":!0}),_(Mt)!=="svelte-yfpdyb"&&(Mt.innerHTML=Xs),Fo=r(B),_t=l(B,"P",{"data-svelte-h":!0}),_(_t)!=="svelte-z1uct7"&&(_t.textContent=zs),Bo=r(B),u(te.$$.fragment,B),Vo=r(B),u(oe.$$.fragment,B),B.forEach(m),Ro=r($),se=l($,"DIV",{class:!0});var nt=U(se);u(Ie.$$.fragment,nt),No=r(nt),vt=l(nt,"P",{"data-svelte-h":!0}),_(vt)!=="svelte-17oym6v"&&(vt.textContent=Hs),nt.forEach(m),Xo=r($),G=l($,"DIV",{class:!0});var W=U(G);u(We.$$.fragment,W),zo=r(W),xt=l(W,"P",{"data-svelte-h":!0}),_(xt)!=="svelte-1lisopl"&&(xt.textContent=Ys),Ho=r(W),wt=l(W,"P",{"data-svelte-h":!0}),_(wt)!=="svelte-1fnd9e6"&&(wt.innerHTML=Es),Yo=r(W),u(ne.$$.fragment,W),Eo=r(W),u(ae.$$.fragment,W),Do=r(W),u(re.$$.fragment,W),W.forEach(m),Qo=r($),ie=l($,"DIV",{class:!0});var so=U(ie);u(Fe.$$.fragment,so),So=r(so),$t=l(so,"P",{"data-svelte-h":!0}),_($t)!=="svelte-1o6lvix"&&($t.innerHTML=Ds),so.forEach(m),Po=r($),E=l($,"DIV",{class:!0});var Xt=U(E);u(Be.$$.fragment,Xt),Lo=r(Xt),Tt=l(Xt,"P",{"data-svelte-h":!0}),_(Tt)!=="svelte-1jxmzhx"&&(Tt.textContent=Qs),qo=r(Xt),u(le.$$.fragment,Xt),Xt.forEach(m),Ao=r($),de=l($,"DIV",{class:!0});var no=U(de);u(Ve.$$.fragment,no),Oo=r(no),Ut=l(no,"P",{"data-svelte-h":!0}),_(Ut)!=="svelte-1y16a8m"&&(Ut.innerHTML=Ss),no.forEach(m),Ko=r($),me=l($,"DIV",{class:!0});var ao=U(me);u(Re.$$.fragment,ao),es=r(ao),jt=l(ao,"P",{"data-svelte-h":!0}),_(jt)!=="svelte-qmktby"&&(jt.textContent=Ps),ao.forEach(m),$.forEach(m),qt=r(t),u(Ne.$$.fragment,t),At=r(t),k=l(t,"DIV",{class:!0});var Z=U(k);u(Xe.$$.fragment,Z),ts=r(Z),Jt=l(Z,"P",{"data-svelte-h":!0}),_(Jt)!=="svelte-1kw8rks"&&(Jt.textContent=Ls),os=r(Z),kt=l(Z,"P",{"data-svelte-h":!0}),_(kt)!=="svelte-ltxz86"&&(kt.innerHTML=qs),ss=r(Z),Zt=l(Z,"UL",{"data-svelte-h":!0}),_(Zt)!=="svelte-5tww1s"&&(Zt.innerHTML=As),ns=r(Z),R=l(Z,"DIV",{class:!0});var ye=U(R);u(ze.$$.fragment,ye),as=r(ye),Ct=l(ye,"P",{"data-svelte-h":!0}),_(Ct)!=="svelte-72pb05"&&(Ct.textContent=Os),rs=r(ye),u(ce.$$.fragment,ye),is=r(ye),u(pe.$$.fragment,ye),ye.forEach(m),ls=r(Z),fe=l(Z,"DIV",{class:!0});var ro=U(fe);u(He.$$.fragment,ro),ds=r(ro),Gt=l(ro,"P",{"data-svelte-h":!0}),_(Gt)!=="svelte-9z80ed"&&(Gt.innerHTML=Ks),ro.forEach(m),ms=r(Z),N=l(Z,"DIV",{class:!0});var Me=U(N);u(Ye.$$.fragment,Me),cs=r(Me),It=l(Me,"P",{"data-svelte-h":!0}),_(It)!=="svelte-16uni9u"&&(It.innerHTML=en),ps=r(Me),Wt=l(Me,"P",{"data-svelte-h":!0}),_(Wt)!=="svelte-1y9zqww"&&(Wt.textContent=tn),fs=r(Me),u(ue.$$.fragment,Me),Me.forEach(m),us=r(Z),X=l(Z,"DIV",{class:!0});var _e=U(X);u(Ee.$$.fragment,_e),hs=r(_e),Ft=l(_e,"P",{"data-svelte-h":!0}),_(Ft)!=="svelte-ifz6ak"&&(Ft.innerHTML=on),gs=r(_e),Bt=l(_e,"P",{"data-svelte-h":!0}),_(Bt)!=="svelte-yfkr09"&&(Bt.textContent=sn),bs=r(_e),u(he.$$.fragment,_e),_e.forEach(m),ys=r(Z),D=l(Z,"DIV",{class:!0});var zt=U(D);u(De.$$.fragment,zt),Ms=r(zt),Vt=l(zt,"P",{"data-svelte-h":!0}),_(Vt)!=="svelte-j66hh4"&&(Vt.innerHTML=nn),_s=r(zt),u(ge.$$.fragment,zt),zt.forEach(m),Z.forEach(m),Ot=r(t),u(Qe.$$.fragment,t),Kt=r(t),z=l(t,"DIV",{class:!0});var Ht=U(z);u(Se.$$.fragment,Ht),vs=r(Ht),Rt=l(Ht,"P",{"data-svelte-h":!0}),_(Rt)!=="svelte-7y8zei"&&(Rt.textContent=an),xs=r(Ht),Q=l(Ht,"DIV",{class:!0});var Yt=U(Q);u(Pe.$$.fragment,Yt),ws=r(Yt),Nt=l(Yt,"P",{"data-svelte-h":!0}),_(Nt)!=="svelte-5nfhmh"&&(Nt.textContent=rn),$s=r(Yt),u(be.$$.fragment,Yt),Yt.forEach(m),Ht.forEach(m),eo=r(t),u(Le.$$.fragment,t),to=r(t),Et=l(t,"P",{}),U(Et).forEach(m),this.h()},h(){j(s,"name","hf:doc:metadata"),j(s,"content",Wn),Dt.a=Qt,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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(O,"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(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(X,"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(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(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(z,"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,p){o(document.head,s),w(t,v,p),w(t,d,p),w(t,n,p),h(c,t,p),w(t,e,p),w(t,M,p),o(M,lo),Dt.m(cn,M),o(M,Qt),w(t,St,p),w(t,ve,p),w(t,Pt,p),h(xe,t,p),w(t,Lt,p),w(t,x,p),h(we,x,null),o(x,mo),o(x,at),o(x,co),o(x,rt),o(x,po),o(x,it),o(x,fo),o(x,S),h($e,S,null),o(S,uo),o(S,lt),o(x,ho),o(x,P),h(Te,P,null),o(P,go),o(P,dt),o(x,bo),o(x,L),h(Ue,L,null),o(L,yo),o(L,mt),o(x,Mo),o(x,q),h(je,q,null),o(q,_o),o(q,ct),o(x,vo),o(x,A),h(Je,A,null),o(A,xo),o(A,pt),o(x,wo),o(x,O),h(ke,O,null),o(O,$o),o(O,ft),o(x,To),o(x,C),h(Ze,C,null),o(C,Uo),o(C,ut),o(C,jo),o(C,ht),o(C,Jo),o(C,gt),o(C,ko),o(C,bt),o(C,Zo),h(K,C,null),o(x,Co),o(x,ee),h(Ce,ee,null),o(ee,Go),o(ee,yt),o(x,Io),o(x,F),h(Ge,F,null),o(F,Wo),o(F,Mt),o(F,Fo),o(F,_t),o(F,Bo),h(te,F,null),o(F,Vo),h(oe,F,null),o(x,Ro),o(x,se),h(Ie,se,null),o(se,No),o(se,vt),o(x,Xo),o(x,G),h(We,G,null),o(G,zo),o(G,xt),o(G,Ho),o(G,wt),o(G,Yo),h(ne,G,null),o(G,Eo),h(ae,G,null),o(G,Do),h(re,G,null),o(x,Qo),o(x,ie),h(Fe,ie,null),o(ie,So),o(ie,$t),o(x,Po),o(x,E),h(Be,E,null),o(E,Lo),o(E,Tt),o(E,qo),h(le,E,null),o(x,Ao),o(x,de),h(Ve,de,null),o(de,Oo),o(de,Ut),o(x,Ko),o(x,me),h(Re,me,null),o(me,es),o(me,jt),w(t,qt,p),h(Ne,t,p),w(t,At,p),w(t,k,p),h(Xe,k,null),o(k,ts),o(k,Jt),o(k,os),o(k,kt),o(k,ss),o(k,Zt),o(k,ns),o(k,R),h(ze,R,null),o(R,as),o(R,Ct),o(R,rs),h(ce,R,null),o(R,is),h(pe,R,null),o(k,ls),o(k,fe),h(He,fe,null),o(fe,ds),o(fe,Gt),o(k,ms),o(k,N),h(Ye,N,null),o(N,cs),o(N,It),o(N,ps),o(N,Wt),o(N,fs),h(ue,N,null),o(k,us),o(k,X),h(Ee,X,null),o(X,hs),o(X,Ft),o(X,gs),o(X,Bt),o(X,bs),h(he,X,null),o(k,ys),o(k,D),h(De,D,null),o(D,Ms),o(D,Vt),o(D,_s),h(ge,D,null),w(t,Ot,p),h(Qe,t,p),w(t,Kt,p),w(t,z,p),h(Se,z,null),o(z,vs),o(z,Rt),o(z,xs),o(z,Q),h(Pe,Q,null),o(Q,ws),o(Q,Nt),o(Q,$s),h(be,Q,null),w(t,eo,p),h(Le,t,p),w(t,to,p),w(t,Et,p),oo=!0},p(t,[p]){const qe={};p&2&&(qe.$$scope={dirty:p,ctx:t}),K.$set(qe);const $={};p&2&&($.$$scope={dirty:p,ctx:t}),te.$set($);const Ae={};p&2&&(Ae.$$scope={dirty:p,ctx:t}),oe.$set(Ae);const Oe={};p&2&&(Oe.$$scope={dirty:p,ctx:t}),ne.$set(Oe);const Ke={};p&2&&(Ke.$$scope={dirty:p,ctx:t}),ae.$set(Ke);const et={};p&2&&(et.$$scope={dirty:p,ctx:t}),re.$set(et);const tt={};p&2&&(tt.$$scope={dirty:p,ctx:t}),le.$set(tt);const ot={};p&2&&(ot.$$scope={dirty:p,ctx:t}),ce.$set(ot);const I={};p&2&&(I.$$scope={dirty:p,ctx:t}),pe.$set(I);const st={};p&2&&(st.$$scope={dirty:p,ctx:t}),ue.$set(st);const B={};p&2&&(B.$$scope={dirty:p,ctx:t}),he.$set(B);const nt={};p&2&&(nt.$$scope={dirty:p,ctx:t}),ge.$set(nt);const W={};p&2&&(W.$$scope={dirty:p,ctx:t}),be.$set(W)},i(t){oo||(g(c.$$.fragment,t),g(xe.$$.fragment,t),g(we.$$.fragment,t),g($e.$$.fragment,t),g(Te.$$.fragment,t),g(Ue.$$.fragment,t),g(je.$$.fragment,t),g(Je.$$.fragment,t),g(ke.$$.fragment,t),g(Ze.$$.fragment,t),g(K.$$.fragment,t),g(Ce.$$.fragment,t),g(Ge.$$.fragment,t),g(te.$$.fragment,t),g(oe.$$.fragment,t),g(Ie.$$.fragment,t),g(We.$$.fragment,t),g(ne.$$.fragment,t),g(ae.$$.fragment,t),g(re.$$.fragment,t),g(Fe.$$.fragment,t),g(Be.$$.fragment,t),g(le.$$.fragment,t),g(Ve.$$.fragment,t),g(Re.$$.fragment,t),g(Ne.$$.fragment,t),g(Xe.$$.fragment,t),g(ze.$$.fragment,t),g(ce.$$.fragment,t),g(pe.$$.fragment,t),g(He.$$.fragment,t),g(Ye.$$.fragment,t),g(ue.$$.fragment,t),g(Ee.$$.fragment,t),g(he.$$.fragment,t),g(De.$$.fragment,t),g(ge.$$.fragment,t),g(Qe.$$.fragment,t),g(Se.$$.fragment,t),g(Pe.$$.fragment,t),g(be.$$.fragment,t),g(Le.$$.fragment,t),oo=!0)},o(t){b(c.$$.fragment,t),b(xe.$$.fragment,t),b(we.$$.fragment,t),b($e.$$.fragment,t),b(Te.$$.fragment,t),b(Ue.$$.fragment,t),b(je.$$.fragment,t),b(Je.$$.fragment,t),b(ke.$$.fragment,t),b(Ze.$$.fragment,t),b(K.$$.fragment,t),b(Ce.$$.fragment,t),b(Ge.$$.fragment,t),b(te.$$.fragment,t),b(oe.$$.fragment,t),b(Ie.$$.fragment,t),b(We.$$.fragment,t),b(ne.$$.fragment,t),b(ae.$$.fragment,t),b(re.$$.fragment,t),b(Fe.$$.fragment,t),b(Be.$$.fragment,t),b(le.$$.fragment,t),b(Ve.$$.fragment,t),b(Re.$$.fragment,t),b(Ne.$$.fragment,t),b(Xe.$$.fragment,t),b(ze.$$.fragment,t),b(ce.$$.fragment,t),b(pe.$$.fragment,t),b(He.$$.fragment,t),b(Ye.$$.fragment,t),b(ue.$$.fragment,t),b(Ee.$$.fragment,t),b(he.$$.fragment,t),b(De.$$.fragment,t),b(ge.$$.fragment,t),b(Qe.$$.fragment,t),b(Se.$$.fragment,t),b(Pe.$$.fragment,t),b(be.$$.fragment,t),b(Le.$$.fragment,t),oo=!1},d(t){t&&(m(v),m(d),m(n),m(e),m(M),m(St),m(ve),m(Pt),m(Lt),m(x),m(qt),m(At),m(k),m(Ot),m(Kt),m(z),m(eo),m(to),m(Et)),m(s),y(c,t),y(xe,t),y(we),y($e),y(Te),y(Ue),y(je),y(Je),y(ke),y(Ze),y(K),y(Ce),y(Ge),y(te),y(oe),y(Ie),y(We),y(ne),y(ae),y(re),y(Fe),y(Be),y(le),y(Ve),y(Re),y(Ne,t),y(Xe),y(ze),y(ce),y(pe),y(He),y(Ye),y(ue),y(Ee),y(he),y(De),y(ge),y(Qe,t),y(Se),y(Pe),y(be),y(Le,t)}}}const Wn='{"title":"Models","local":"models","sections":[{"title":"ModelMixin","local":"diffusers.ModelMixin","sections":[],"depth":2},{"title":"FlaxModelMixin","local":"diffusers.FlaxModelMixin","sections":[],"depth":2},{"title":"PushToHubMixin","local":"diffusers.utils.PushToHubMixin","sections":[],"depth":2}],"depth":1}';function Fn(T){return fn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yn extends un{constructor(s){super(),hn(this,s,Fn,In,pn,{})}}export{Yn as component};
