import{s as $n,o as Tn,n as V}from"../chunks/scheduler.8c3d61f6.js";import{S as Un,i as jn,g as l,s as a,r as u,m as _n,H as Jn,A as kn,h as i,f as m,c as r,j as U,u as h,n as vn,E as Zn,x as _,k as j,y as s,a as w,v as g,d as b,t as y,w as M}from"../chunks/index.da70eac4.js";import{T as xn}from"../chunks/Tip.1d9b8c37.js";import{D as J}from"../chunks/Docstring.6b390b9a.js";import{C as H}from"../chunks/CodeBlock.00a903b3.js";import{E as Y}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as fs,E as Cn}from"../chunks/EditOnGithub.1e64e623.js";function Gn(T){let o,v="Example:",d,n,c;return n=new H({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMENvZ1ZpZGVvWFRyYW5zZm9ybWVyM0RNb2RlbCUwQSUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwQ29nVmlkZW9YVHJhbnNmb3JtZXIzRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJUSFVETSUyRkNvZ1ZpZGVvWC01YiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSklMEElMEF0cmFuc2Zvcm1lci5lbmFibGVfZ3JvdXBfb2ZmbG9hZCglMEElMjAlMjAlMjAlMjBvbmxvYWRfZGV2aWNlJTNEdG9yY2guZGV2aWNlKCUyMmN1ZGElMjIpJTJDJTBBJTIwJTIwJTIwJTIwb2ZmbG9hZF9kZXZpY2UlM0R0b3JjaC5kZXZpY2UoJTIyY3B1JTIyKSUyQyUwQSUyMCUyMCUyMCUyMG9mZmxvYWRfdHlwZSUzRCUyMmxlYWZfbGV2ZWwlMjIlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc3RyZWFtJTNEVHJ1ZSUyQyUwQSk=",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>transformer.enable_group_offload(
<span class="hljs-meta">... </span>    onload_device=torch.device(<span class="hljs-string">&quot;cuda&quot;</span>),
<span class="hljs-meta">... </span>    offload_device=torch.device(<span class="hljs-string">&quot;cpu&quot;</span>),
<span class="hljs-meta">... </span>    offload_type=<span class="hljs-string">&quot;leaf_level&quot;</span>,
<span class="hljs-meta">... </span>    use_stream=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-11lpom8"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function In(T){let o,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 H({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(){o=l("p"),o.innerHTML=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-1anawjo"&&(o.innerHTML=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Wn(T){let o,v=`⚠️ When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`;return{c(){o=l("p"),o.textContent=v},l(d){o=i(d,"P",{"data-svelte-h":!0}),_(o)!=="svelte-17p1lpg"&&(o.textContent=v)},m(d,n){w(d,o,n)},p:V,d(d){d&&m(o)}}}function Fn(T){let o,v="Examples:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-kvfsh7"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Vn(T){let o,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(){o=l("p"),o.innerHTML=v},l(d){o=i(d,"P",{"data-svelte-h":!0}),_(o)!=="svelte-19a77yg"&&(o.innerHTML=v)},m(d,n){w(d,o,n)},p:V,d(d){d&&m(o)}}}function Bn(T){let o,v="Example:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-11lpom8"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Rn(T){let o,v="If you get the error message below, you need to finetune the weights for your downstream task:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-xueb0m"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Nn(T){let o,v="Example:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-11lpom8"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Xn(T){let o,v="Examples:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-kvfsh7"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function zn(T){let o,v="If you get the error message below, you need to finetune the weights for your downstream task:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-xueb0m"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Yn(T){let o,v="Examples:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-kvfsh7"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Hn(T){let o,v="Examples:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-kvfsh7"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function En(T){let o,v="Examples:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-kvfsh7"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Dn(T){let o,v="Examples:",d,n,c;return n=new H({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(){o=l("p"),o.textContent=v,d=a(),u(n.$$.fragment)},l(e){o=i(e,"P",{"data-svelte-h":!0}),_(o)!=="svelte-kvfsh7"&&(o.textContent=v),d=r(e),h(n.$$.fragment,e)},m(e,p){w(e,o,p),w(e,d,p),g(n,e,p),c=!0},p:V,i(e){c||(b(n.$$.fragment,e),c=!0)},o(e){y(n.$$.fragment,e),c=!1},d(e){e&&(m(o),m(d)),M(n,e)}}}function Qn(T){let o,v,d,n,c,e,p,us,At,wn='<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>',Ot,Kt,$e,Fo='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.',es,Te,ts,x,Ue,hs,dt,Vo="Base class for all models.",gs,mt,Bo=`<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.`,bs,ct,Ro='<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>',ys,P,je,Ms,pt,No=`Potentially dequantize the model in case it has been quantized by a quantization method that support
dequantization.`,_s,q,Je,vs,ft,Xo=`Deactivates gradient checkpointing for the current model (may be referred to as <em>activation checkpointing</em> or
<em>checkpoint activations</em> in other frameworks).`,xs,A,ke,ws,ut,zo="disable npu flash attention from torch_npu",$s,O,Ze,Ts,ht,Yo='Disable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',Us,K,Ce,js,gt,Ho="Disable the flash attention pallals kernel for torch_xla.",Js,ee,Ge,ks,bt,Eo=`Activates gradient checkpointing for the current model (may be referred to as <em>activation checkpointing</em> or
<em>checkpoint activations</em> in other frameworks).`,Zs,R,Ie,Cs,yt,Do="Activates group offloading for the current model.",Gs,Mt,Qo='See <a href="/docs/diffusers/main/en/api/utilities#diffusers.hooks.apply_group_offloading">apply_group_offloading()</a> for more information.',Is,te,Ws,C,We,Fs,_t,So="Activates layerwise casting for the current model.",Vs,vt,Lo=`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.`,Bs,xt,Po=`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.`,Rs,wt,qo="Example:",Ns,se,Xs,oe,Fe,zs,$t,Ao="Enable npu flash attention from torch_npu",Ys,F,Ve,Hs,Tt,Oo='Enable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',Es,Ut,Ko=`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.`,Ds,ne,Qs,ae,Ss,re,Be,Ls,jt,en="Enable the flash attention pallals kernel for torch_xla.",Ps,G,Re,qs,Jt,tn="Instantiate a pretrained PyTorch model from a pretrained model configuration.",As,kt,sn=`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>.`,Os,le,Ks,ie,eo,de,to,me,Ne,so,Zt,on=`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>`,oo,Q,Xe,no,Ct,nn="Get number of (trainable or non-embedding) parameters in the module.",ao,ce,ro,pe,ze,lo,Gt,an=`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.`,io,fe,Ye,mo,It,rn="Set the switch for the npu flash attention.",ss,He,os,k,Ee,co,Wt,ln="Base class for all Flax models.",po,Ft,dn=`<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.`,fo,Vt,mn='<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>',uo,N,De,ho,Bt,cn="Instantiate a pretrained Flax model from a pretrained model configuration.",go,ue,bo,he,yo,ge,Qe,Mo,Rt,pn=`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.`,_o,X,Se,vo,Nt,fn=`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.`,xo,Xt,un=`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.`,wo,be,$o,z,Le,To,zt,hn=`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.`,Uo,Yt,gn=`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.`,jo,ye,Jo,S,Pe,ko,Ht,bn=`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.`,Zo,Me,ns,qe,as,E,Ae,Co,Et,yn="A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub.",Go,L,Oe,Io,Dt,Mn="Upload model, scheduler, or pipeline files to the 🤗 Hugging Face Hub.",Wo,_e,rs,Ke,ls,qt,is;return c=new fs({props:{title:"Models",local:"models",headingTag:"h1"}}),Te=new fs({props:{title:"ModelMixin",local:"diffusers.ModelMixin",headingTag:"h2"}}),Ue=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#L252"}}),je=new J({props:{name:"dequantize",anchor:"diffusers.ModelMixin.dequantize",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L745"}}),Je=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#L331"}}),ke=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#L362"}}),Ze=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#L451"}}),Ce=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#L392"}}),Ge=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#L301"}}),Ie=new J({props:{name:"enable_group_offload",anchor:"diffusers.ModelMixin.enable_group_offload",parameters:[{name:"onload_device",val:": device"},{name:"offload_device",val:": device = device(type='cpu')"},{name:"offload_type",val:": str = 'block_level'"},{name:"num_blocks_per_group",val:": typing.Optional[int] = None"},{name:"non_blocking",val:": bool = False"},{name:"use_stream",val:": bool = False"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L541"}}),te=new Y({props:{anchor:"diffusers.ModelMixin.enable_group_offload.example",$$slots:{default:[Gn]},$$scope:{ctx:T}}}),We=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#L457"}}),se=new Y({props:{anchor:"diffusers.ModelMixin.enable_layerwise_casting.example",$$slots:{default:[In]},$$scope:{ctx:T}}}),Fe=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#L355"}}),Ve=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#L415"}}),ne=new xn({props:{warning:!0,$$slots:{default:[Wn]},$$scope:{ctx:T}}}),ae=new Y({props:{anchor:"diffusers.ModelMixin.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Fn]},$$scope:{ctx:T}}}),Be=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#L386"}}),Re=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#L757"}}),le=new xn({props:{$$slots:{default:[Vn]},$$scope:{ctx:T}}}),ie=new Y({props:{anchor:"diffusers.ModelMixin.from_pretrained.example",$$slots:{default:[Bn]},$$scope:{ctx:T}}}),de=new Y({props:{anchor:"diffusers.ModelMixin.from_pretrained.example-2",$$slots:{default:[Rn]},$$scope:{ctx:T}}}),Ne=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#L1681"}}),Xe=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#L1617",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>
`}}),ce=new Y({props:{anchor:"diffusers.ModelMixin.num_parameters.example",$$slots:{default:[Nn]},$$scope:{ctx:T}}}),ze=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#L590"}}),Ye=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#L339"}}),He=new fs({props:{title:"FlaxModelMixin",local:"diffusers.FlaxModelMixin",headingTag:"h2"}}),Ee=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"}}),De=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"}}),ue=new Y({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example",$$slots:{default:[Xn]},$$scope:{ctx:T}}}),he=new Y({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example-2",$$slots:{default:[zn]},$$scope:{ctx:T}}}),Qe=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"}}),Se=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"}}),be=new Y({props:{anchor:"diffusers.FlaxModelMixin.to_bf16.example",$$slots:{default:[Yn]},$$scope:{ctx:T}}}),Le=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"}}),ye=new Y({props:{anchor:"diffusers.FlaxModelMixin.to_fp16.example",$$slots:{default:[Hn]},$$scope:{ctx:T}}}),Pe=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"}}),Me=new Y({props:{anchor:"diffusers.FlaxModelMixin.to_fp32.example",$$slots:{default:[En]},$$scope:{ctx:T}}}),qe=new fs({props:{title:"PushToHubMixin",local:"diffusers.utils.PushToHubMixin",headingTag:"h2"}}),Ae=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#L458"}}),Oe=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#L487"}}),_e=new Y({props:{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[Dn]},$$scope:{ctx:T}}}),Ke=new Cn({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/overview.md"}}),{c(){o=l("meta"),v=a(),d=l("p"),n=a(),u(c.$$.fragment),e=a(),p=l("p"),us=_n("🤗 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 "),At=new Jn(!1),Ot=_n("."),Kt=a(),$e=l("p"),$e.innerHTML=Fo,es=a(),u(Te.$$.fragment),ts=a(),x=l("div"),u(Ue.$$.fragment),hs=a(),dt=l("p"),dt.textContent=Vo,gs=a(),mt=l("p"),mt.innerHTML=Bo,bs=a(),ct=l("ul"),ct.innerHTML=Ro,ys=a(),P=l("div"),u(je.$$.fragment),Ms=a(),pt=l("p"),pt.textContent=No,_s=a(),q=l("div"),u(Je.$$.fragment),vs=a(),ft=l("p"),ft.innerHTML=Xo,xs=a(),A=l("div"),u(ke.$$.fragment),ws=a(),ut=l("p"),ut.textContent=zo,$s=a(),O=l("div"),u(Ze.$$.fragment),Ts=a(),ht=l("p"),ht.innerHTML=Yo,Us=a(),K=l("div"),u(Ce.$$.fragment),js=a(),gt=l("p"),gt.textContent=Ho,Js=a(),ee=l("div"),u(Ge.$$.fragment),ks=a(),bt=l("p"),bt.innerHTML=Eo,Zs=a(),R=l("div"),u(Ie.$$.fragment),Cs=a(),yt=l("p"),yt.textContent=Do,Gs=a(),Mt=l("p"),Mt.innerHTML=Qo,Is=a(),u(te.$$.fragment),Ws=a(),C=l("div"),u(We.$$.fragment),Fs=a(),_t=l("p"),_t.textContent=So,Vs=a(),vt=l("p"),vt.textContent=Lo,Bs=a(),xt=l("p"),xt.innerHTML=Po,Rs=a(),wt=l("p"),wt.textContent=qo,Ns=a(),u(se.$$.fragment),Xs=a(),oe=l("div"),u(Fe.$$.fragment),zs=a(),$t=l("p"),$t.textContent=Ao,Ys=a(),F=l("div"),u(Ve.$$.fragment),Hs=a(),Tt=l("p"),Tt.innerHTML=Oo,Es=a(),Ut=l("p"),Ut.textContent=Ko,Ds=a(),u(ne.$$.fragment),Qs=a(),u(ae.$$.fragment),Ss=a(),re=l("div"),u(Be.$$.fragment),Ls=a(),jt=l("p"),jt.textContent=en,Ps=a(),G=l("div"),u(Re.$$.fragment),qs=a(),Jt=l("p"),Jt.textContent=tn,As=a(),kt=l("p"),kt.innerHTML=sn,Os=a(),u(le.$$.fragment),Ks=a(),u(ie.$$.fragment),eo=a(),u(de.$$.fragment),to=a(),me=l("div"),u(Ne.$$.fragment),so=a(),Zt=l("p"),Zt.innerHTML=on,oo=a(),Q=l("div"),u(Xe.$$.fragment),no=a(),Ct=l("p"),Ct.textContent=nn,ao=a(),u(ce.$$.fragment),ro=a(),pe=l("div"),u(ze.$$.fragment),lo=a(),Gt=l("p"),Gt.innerHTML=an,io=a(),fe=l("div"),u(Ye.$$.fragment),mo=a(),It=l("p"),It.textContent=rn,ss=a(),u(He.$$.fragment),os=a(),k=l("div"),u(Ee.$$.fragment),co=a(),Wt=l("p"),Wt.textContent=ln,po=a(),Ft=l("p"),Ft.innerHTML=dn,fo=a(),Vt=l("ul"),Vt.innerHTML=mn,uo=a(),N=l("div"),u(De.$$.fragment),ho=a(),Bt=l("p"),Bt.textContent=cn,go=a(),u(ue.$$.fragment),bo=a(),u(he.$$.fragment),yo=a(),ge=l("div"),u(Qe.$$.fragment),Mo=a(),Rt=l("p"),Rt.innerHTML=pn,_o=a(),X=l("div"),u(Se.$$.fragment),vo=a(),Nt=l("p"),Nt.innerHTML=fn,xo=a(),Xt=l("p"),Xt.textContent=un,wo=a(),u(be.$$.fragment),$o=a(),z=l("div"),u(Le.$$.fragment),To=a(),zt=l("p"),zt.innerHTML=hn,Uo=a(),Yt=l("p"),Yt.textContent=gn,jo=a(),u(ye.$$.fragment),Jo=a(),S=l("div"),u(Pe.$$.fragment),ko=a(),Ht=l("p"),Ht.innerHTML=bn,Zo=a(),u(Me.$$.fragment),ns=a(),u(qe.$$.fragment),as=a(),E=l("div"),u(Ae.$$.fragment),Co=a(),Et=l("p"),Et.textContent=yn,Go=a(),L=l("div"),u(Oe.$$.fragment),Io=a(),Dt=l("p"),Dt.textContent=Mn,Wo=a(),u(_e.$$.fragment),rs=a(),u(Ke.$$.fragment),ls=a(),qt=l("p"),this.h()},l(t){const f=kn("svelte-u9bgzb",document.head);o=i(f,"META",{name:!0,content:!0}),f.forEach(m),v=r(t),d=i(t,"P",{}),U(d).forEach(m),n=r(t),h(c.$$.fragment,t),e=r(t),p=i(t,"P",{});var et=U(p);us=vn(et,"🤗 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 "),At=Zn(et,!1),Ot=vn(et,"."),et.forEach(m),Kt=r(t),$e=i(t,"P",{"data-svelte-h":!0}),_($e)!=="svelte-1elbdrk"&&($e.innerHTML=Fo),es=r(t),h(Te.$$.fragment,t),ts=r(t),x=i(t,"DIV",{class:!0});var $=U(x);h(Ue.$$.fragment,$),hs=r($),dt=i($,"P",{"data-svelte-h":!0}),_(dt)!=="svelte-12nk4t7"&&(dt.textContent=Vo),gs=r($),mt=i($,"P",{"data-svelte-h":!0}),_(mt)!=="svelte-ku6myw"&&(mt.innerHTML=Bo),bs=r($),ct=i($,"UL",{"data-svelte-h":!0}),_(ct)!=="svelte-kvpw1l"&&(ct.innerHTML=Ro),ys=r($),P=i($,"DIV",{class:!0});var tt=U(P);h(je.$$.fragment,tt),Ms=r(tt),pt=i(tt,"P",{"data-svelte-h":!0}),_(pt)!=="svelte-on69a4"&&(pt.textContent=No),tt.forEach(m),_s=r($),q=i($,"DIV",{class:!0});var st=U(q);h(Je.$$.fragment,st),vs=r(st),ft=i(st,"P",{"data-svelte-h":!0}),_(ft)!=="svelte-jedy0o"&&(ft.innerHTML=Xo),st.forEach(m),xs=r($),A=i($,"DIV",{class:!0});var ot=U(A);h(ke.$$.fragment,ot),ws=r(ot),ut=i(ot,"P",{"data-svelte-h":!0}),_(ut)!=="svelte-advgdt"&&(ut.textContent=zo),ot.forEach(m),$s=r($),O=i($,"DIV",{class:!0});var nt=U(O);h(Ze.$$.fragment,nt),Ts=r(nt),ht=i(nt,"P",{"data-svelte-h":!0}),_(ht)!=="svelte-1vfte1e"&&(ht.innerHTML=Yo),nt.forEach(m),Us=r($),K=i($,"DIV",{class:!0});var at=U(K);h(Ce.$$.fragment,at),js=r(at),gt=i(at,"P",{"data-svelte-h":!0}),_(gt)!=="svelte-l9u3py"&&(gt.textContent=Ho),at.forEach(m),Js=r($),ee=i($,"DIV",{class:!0});var rt=U(ee);h(Ge.$$.fragment,rt),ks=r(rt),bt=i(rt,"P",{"data-svelte-h":!0}),_(bt)!=="svelte-1rv66k9"&&(bt.innerHTML=Eo),rt.forEach(m),Zs=r($),R=i($,"DIV",{class:!0});var D=U(R);h(Ie.$$.fragment,D),Cs=r(D),yt=i(D,"P",{"data-svelte-h":!0}),_(yt)!=="svelte-h27n1e"&&(yt.textContent=Do),Gs=r(D),Mt=i(D,"P",{"data-svelte-h":!0}),_(Mt)!=="svelte-l2yd37"&&(Mt.innerHTML=Qo),Is=r(D),h(te.$$.fragment,D),D.forEach(m),Ws=r($),C=i($,"DIV",{class:!0});var I=U(C);h(We.$$.fragment,I),Fs=r(I),_t=i(I,"P",{"data-svelte-h":!0}),_(_t)!=="svelte-1iclqp4"&&(_t.textContent=So),Vs=r(I),vt=i(I,"P",{"data-svelte-h":!0}),_(vt)!=="svelte-1qne8y2"&&(vt.textContent=Lo),Bs=r(I),xt=i(I,"P",{"data-svelte-h":!0}),_(xt)!=="svelte-ss6or"&&(xt.innerHTML=Po),Rs=r(I),wt=i(I,"P",{"data-svelte-h":!0}),_(wt)!=="svelte-11lpom8"&&(wt.textContent=qo),Ns=r(I),h(se.$$.fragment,I),I.forEach(m),Xs=r($),oe=i($,"DIV",{class:!0});var lt=U(oe);h(Fe.$$.fragment,lt),zs=r(lt),$t=i(lt,"P",{"data-svelte-h":!0}),_($t)!=="svelte-10xtjge"&&($t.textContent=Ao),lt.forEach(m),Ys=r($),F=i($,"DIV",{class:!0});var B=U(F);h(Ve.$$.fragment,B),Hs=r(B),Tt=i(B,"P",{"data-svelte-h":!0}),_(Tt)!=="svelte-yfpdyb"&&(Tt.innerHTML=Oo),Es=r(B),Ut=i(B,"P",{"data-svelte-h":!0}),_(Ut)!=="svelte-z1uct7"&&(Ut.textContent=Ko),Ds=r(B),h(ne.$$.fragment,B),Qs=r(B),h(ae.$$.fragment,B),B.forEach(m),Ss=r($),re=i($,"DIV",{class:!0});var it=U(re);h(Be.$$.fragment,it),Ls=r(it),jt=i(it,"P",{"data-svelte-h":!0}),_(jt)!=="svelte-17oym6v"&&(jt.textContent=en),it.forEach(m),Ps=r($),G=i($,"DIV",{class:!0});var W=U(G);h(Re.$$.fragment,W),qs=r(W),Jt=i(W,"P",{"data-svelte-h":!0}),_(Jt)!=="svelte-1lisopl"&&(Jt.textContent=tn),As=r(W),kt=i(W,"P",{"data-svelte-h":!0}),_(kt)!=="svelte-1fnd9e6"&&(kt.innerHTML=sn),Os=r(W),h(le.$$.fragment,W),Ks=r(W),h(ie.$$.fragment,W),eo=r(W),h(de.$$.fragment,W),W.forEach(m),to=r($),me=i($,"DIV",{class:!0});var ds=U(me);h(Ne.$$.fragment,ds),so=r(ds),Zt=i(ds,"P",{"data-svelte-h":!0}),_(Zt)!=="svelte-1o6lvix"&&(Zt.innerHTML=on),ds.forEach(m),oo=r($),Q=i($,"DIV",{class:!0});var Qt=U(Q);h(Xe.$$.fragment,Qt),no=r(Qt),Ct=i(Qt,"P",{"data-svelte-h":!0}),_(Ct)!=="svelte-1jxmzhx"&&(Ct.textContent=nn),ao=r(Qt),h(ce.$$.fragment,Qt),Qt.forEach(m),ro=r($),pe=i($,"DIV",{class:!0});var ms=U(pe);h(ze.$$.fragment,ms),lo=r(ms),Gt=i(ms,"P",{"data-svelte-h":!0}),_(Gt)!=="svelte-1y16a8m"&&(Gt.innerHTML=an),ms.forEach(m),io=r($),fe=i($,"DIV",{class:!0});var cs=U(fe);h(Ye.$$.fragment,cs),mo=r(cs),It=i(cs,"P",{"data-svelte-h":!0}),_(It)!=="svelte-qmktby"&&(It.textContent=rn),cs.forEach(m),$.forEach(m),ss=r(t),h(He.$$.fragment,t),os=r(t),k=i(t,"DIV",{class:!0});var Z=U(k);h(Ee.$$.fragment,Z),co=r(Z),Wt=i(Z,"P",{"data-svelte-h":!0}),_(Wt)!=="svelte-1kw8rks"&&(Wt.textContent=ln),po=r(Z),Ft=i(Z,"P",{"data-svelte-h":!0}),_(Ft)!=="svelte-ltxz86"&&(Ft.innerHTML=dn),fo=r(Z),Vt=i(Z,"UL",{"data-svelte-h":!0}),_(Vt)!=="svelte-5tww1s"&&(Vt.innerHTML=mn),uo=r(Z),N=i(Z,"DIV",{class:!0});var ve=U(N);h(De.$$.fragment,ve),ho=r(ve),Bt=i(ve,"P",{"data-svelte-h":!0}),_(Bt)!=="svelte-72pb05"&&(Bt.textContent=cn),go=r(ve),h(ue.$$.fragment,ve),bo=r(ve),h(he.$$.fragment,ve),ve.forEach(m),yo=r(Z),ge=i(Z,"DIV",{class:!0});var ps=U(ge);h(Qe.$$.fragment,ps),Mo=r(ps),Rt=i(ps,"P",{"data-svelte-h":!0}),_(Rt)!=="svelte-9z80ed"&&(Rt.innerHTML=pn),ps.forEach(m),_o=r(Z),X=i(Z,"DIV",{class:!0});var xe=U(X);h(Se.$$.fragment,xe),vo=r(xe),Nt=i(xe,"P",{"data-svelte-h":!0}),_(Nt)!=="svelte-16uni9u"&&(Nt.innerHTML=fn),xo=r(xe),Xt=i(xe,"P",{"data-svelte-h":!0}),_(Xt)!=="svelte-1y9zqww"&&(Xt.textContent=un),wo=r(xe),h(be.$$.fragment,xe),xe.forEach(m),$o=r(Z),z=i(Z,"DIV",{class:!0});var we=U(z);h(Le.$$.fragment,we),To=r(we),zt=i(we,"P",{"data-svelte-h":!0}),_(zt)!=="svelte-ifz6ak"&&(zt.innerHTML=hn),Uo=r(we),Yt=i(we,"P",{"data-svelte-h":!0}),_(Yt)!=="svelte-yfkr09"&&(Yt.textContent=gn),jo=r(we),h(ye.$$.fragment,we),we.forEach(m),Jo=r(Z),S=i(Z,"DIV",{class:!0});var St=U(S);h(Pe.$$.fragment,St),ko=r(St),Ht=i(St,"P",{"data-svelte-h":!0}),_(Ht)!=="svelte-j66hh4"&&(Ht.innerHTML=bn),Zo=r(St),h(Me.$$.fragment,St),St.forEach(m),Z.forEach(m),ns=r(t),h(qe.$$.fragment,t),as=r(t),E=i(t,"DIV",{class:!0});var Lt=U(E);h(Ae.$$.fragment,Lt),Co=r(Lt),Et=i(Lt,"P",{"data-svelte-h":!0}),_(Et)!=="svelte-7y8zei"&&(Et.textContent=yn),Go=r(Lt),L=i(Lt,"DIV",{class:!0});var Pt=U(L);h(Oe.$$.fragment,Pt),Io=r(Pt),Dt=i(Pt,"P",{"data-svelte-h":!0}),_(Dt)!=="svelte-5nfhmh"&&(Dt.textContent=Mn),Wo=r(Pt),h(_e.$$.fragment,Pt),Pt.forEach(m),Lt.forEach(m),rs=r(t),h(Ke.$$.fragment,t),ls=r(t),qt=i(t,"P",{}),U(qt).forEach(m),this.h()},h(){j(o,"name","hf:doc:metadata"),j(o,"content",Sn),At.a=Ot,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(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(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(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(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(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(oe,"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(re,"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(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(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(pe,"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(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(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(ge,"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(z,"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(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(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(E,"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,f){s(document.head,o),w(t,v,f),w(t,d,f),w(t,n,f),g(c,t,f),w(t,e,f),w(t,p,f),s(p,us),At.m(wn,p),s(p,Ot),w(t,Kt,f),w(t,$e,f),w(t,es,f),g(Te,t,f),w(t,ts,f),w(t,x,f),g(Ue,x,null),s(x,hs),s(x,dt),s(x,gs),s(x,mt),s(x,bs),s(x,ct),s(x,ys),s(x,P),g(je,P,null),s(P,Ms),s(P,pt),s(x,_s),s(x,q),g(Je,q,null),s(q,vs),s(q,ft),s(x,xs),s(x,A),g(ke,A,null),s(A,ws),s(A,ut),s(x,$s),s(x,O),g(Ze,O,null),s(O,Ts),s(O,ht),s(x,Us),s(x,K),g(Ce,K,null),s(K,js),s(K,gt),s(x,Js),s(x,ee),g(Ge,ee,null),s(ee,ks),s(ee,bt),s(x,Zs),s(x,R),g(Ie,R,null),s(R,Cs),s(R,yt),s(R,Gs),s(R,Mt),s(R,Is),g(te,R,null),s(x,Ws),s(x,C),g(We,C,null),s(C,Fs),s(C,_t),s(C,Vs),s(C,vt),s(C,Bs),s(C,xt),s(C,Rs),s(C,wt),s(C,Ns),g(se,C,null),s(x,Xs),s(x,oe),g(Fe,oe,null),s(oe,zs),s(oe,$t),s(x,Ys),s(x,F),g(Ve,F,null),s(F,Hs),s(F,Tt),s(F,Es),s(F,Ut),s(F,Ds),g(ne,F,null),s(F,Qs),g(ae,F,null),s(x,Ss),s(x,re),g(Be,re,null),s(re,Ls),s(re,jt),s(x,Ps),s(x,G),g(Re,G,null),s(G,qs),s(G,Jt),s(G,As),s(G,kt),s(G,Os),g(le,G,null),s(G,Ks),g(ie,G,null),s(G,eo),g(de,G,null),s(x,to),s(x,me),g(Ne,me,null),s(me,so),s(me,Zt),s(x,oo),s(x,Q),g(Xe,Q,null),s(Q,no),s(Q,Ct),s(Q,ao),g(ce,Q,null),s(x,ro),s(x,pe),g(ze,pe,null),s(pe,lo),s(pe,Gt),s(x,io),s(x,fe),g(Ye,fe,null),s(fe,mo),s(fe,It),w(t,ss,f),g(He,t,f),w(t,os,f),w(t,k,f),g(Ee,k,null),s(k,co),s(k,Wt),s(k,po),s(k,Ft),s(k,fo),s(k,Vt),s(k,uo),s(k,N),g(De,N,null),s(N,ho),s(N,Bt),s(N,go),g(ue,N,null),s(N,bo),g(he,N,null),s(k,yo),s(k,ge),g(Qe,ge,null),s(ge,Mo),s(ge,Rt),s(k,_o),s(k,X),g(Se,X,null),s(X,vo),s(X,Nt),s(X,xo),s(X,Xt),s(X,wo),g(be,X,null),s(k,$o),s(k,z),g(Le,z,null),s(z,To),s(z,zt),s(z,Uo),s(z,Yt),s(z,jo),g(ye,z,null),s(k,Jo),s(k,S),g(Pe,S,null),s(S,ko),s(S,Ht),s(S,Zo),g(Me,S,null),w(t,ns,f),g(qe,t,f),w(t,as,f),w(t,E,f),g(Ae,E,null),s(E,Co),s(E,Et),s(E,Go),s(E,L),g(Oe,L,null),s(L,Io),s(L,Dt),s(L,Wo),g(_e,L,null),w(t,rs,f),g(Ke,t,f),w(t,ls,f),w(t,qt,f),is=!0},p(t,[f]){const et={};f&2&&(et.$$scope={dirty:f,ctx:t}),te.$set(et);const $={};f&2&&($.$$scope={dirty:f,ctx:t}),se.$set($);const tt={};f&2&&(tt.$$scope={dirty:f,ctx:t}),ne.$set(tt);const st={};f&2&&(st.$$scope={dirty:f,ctx:t}),ae.$set(st);const ot={};f&2&&(ot.$$scope={dirty:f,ctx:t}),le.$set(ot);const nt={};f&2&&(nt.$$scope={dirty:f,ctx:t}),ie.$set(nt);const at={};f&2&&(at.$$scope={dirty:f,ctx:t}),de.$set(at);const rt={};f&2&&(rt.$$scope={dirty:f,ctx:t}),ce.$set(rt);const D={};f&2&&(D.$$scope={dirty:f,ctx:t}),ue.$set(D);const I={};f&2&&(I.$$scope={dirty:f,ctx:t}),he.$set(I);const lt={};f&2&&(lt.$$scope={dirty:f,ctx:t}),be.$set(lt);const B={};f&2&&(B.$$scope={dirty:f,ctx:t}),ye.$set(B);const it={};f&2&&(it.$$scope={dirty:f,ctx:t}),Me.$set(it);const W={};f&2&&(W.$$scope={dirty:f,ctx:t}),_e.$set(W)},i(t){is||(b(c.$$.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(Ce.$$.fragment,t),b(Ge.$$.fragment,t),b(Ie.$$.fragment,t),b(te.$$.fragment,t),b(We.$$.fragment,t),b(se.$$.fragment,t),b(Fe.$$.fragment,t),b(Ve.$$.fragment,t),b(ne.$$.fragment,t),b(ae.$$.fragment,t),b(Be.$$.fragment,t),b(Re.$$.fragment,t),b(le.$$.fragment,t),b(ie.$$.fragment,t),b(de.$$.fragment,t),b(Ne.$$.fragment,t),b(Xe.$$.fragment,t),b(ce.$$.fragment,t),b(ze.$$.fragment,t),b(Ye.$$.fragment,t),b(He.$$.fragment,t),b(Ee.$$.fragment,t),b(De.$$.fragment,t),b(ue.$$.fragment,t),b(he.$$.fragment,t),b(Qe.$$.fragment,t),b(Se.$$.fragment,t),b(be.$$.fragment,t),b(Le.$$.fragment,t),b(ye.$$.fragment,t),b(Pe.$$.fragment,t),b(Me.$$.fragment,t),b(qe.$$.fragment,t),b(Ae.$$.fragment,t),b(Oe.$$.fragment,t),b(_e.$$.fragment,t),b(Ke.$$.fragment,t),is=!0)},o(t){y(c.$$.fragment,t),y(Te.$$.fragment,t),y(Ue.$$.fragment,t),y(je.$$.fragment,t),y(Je.$$.fragment,t),y(ke.$$.fragment,t),y(Ze.$$.fragment,t),y(Ce.$$.fragment,t),y(Ge.$$.fragment,t),y(Ie.$$.fragment,t),y(te.$$.fragment,t),y(We.$$.fragment,t),y(se.$$.fragment,t),y(Fe.$$.fragment,t),y(Ve.$$.fragment,t),y(ne.$$.fragment,t),y(ae.$$.fragment,t),y(Be.$$.fragment,t),y(Re.$$.fragment,t),y(le.$$.fragment,t),y(ie.$$.fragment,t),y(de.$$.fragment,t),y(Ne.$$.fragment,t),y(Xe.$$.fragment,t),y(ce.$$.fragment,t),y(ze.$$.fragment,t),y(Ye.$$.fragment,t),y(He.$$.fragment,t),y(Ee.$$.fragment,t),y(De.$$.fragment,t),y(ue.$$.fragment,t),y(he.$$.fragment,t),y(Qe.$$.fragment,t),y(Se.$$.fragment,t),y(be.$$.fragment,t),y(Le.$$.fragment,t),y(ye.$$.fragment,t),y(Pe.$$.fragment,t),y(Me.$$.fragment,t),y(qe.$$.fragment,t),y(Ae.$$.fragment,t),y(Oe.$$.fragment,t),y(_e.$$.fragment,t),y(Ke.$$.fragment,t),is=!1},d(t){t&&(m(v),m(d),m(n),m(e),m(p),m(Kt),m($e),m(es),m(ts),m(x),m(ss),m(os),m(k),m(ns),m(as),m(E),m(rs),m(ls),m(qt)),m(o),M(c,t),M(Te,t),M(Ue),M(je),M(Je),M(ke),M(Ze),M(Ce),M(Ge),M(Ie),M(te),M(We),M(se),M(Fe),M(Ve),M(ne),M(ae),M(Be),M(Re),M(le),M(ie),M(de),M(Ne),M(Xe),M(ce),M(ze),M(Ye),M(He,t),M(Ee),M(De),M(ue),M(he),M(Qe),M(Se),M(be),M(Le),M(ye),M(Pe),M(Me),M(qe,t),M(Ae),M(Oe),M(_e),M(Ke,t)}}}const Sn='{"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 Ln(T){return Tn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sa extends Un{constructor(o){super(),jn(this,o,Ln,Qn,$n,{})}}export{sa as component};
