import{s as Bo,o as Ro,n as F}from"../chunks/scheduler.8c3d61f6.js";import{S as No,i as Xo,g as l,s as a,r as c,m as Io,H as Ho,A as Yo,h as i,f as m,c as r,j as U,u as f,n as Wo,E as zo,x as _,k as j,y as s,a as $,v as u,d as h,t as g,w as b}from"../chunks/index.da70eac4.js";import{T as Fo}from"../chunks/Tip.1d9b8c37.js";import{D as J}from"../chunks/Docstring.8332ccfe.js";import{C as E}from"../chunks/CodeBlock.a9c4becf.js";import{E as z}from"../chunks/ExampleCodeBlock.cacf0f06.js";import{H as Ms,E as Eo}from"../chunks/getInferenceSnippets.4986d68f.js";function Do(T){let n,x="Example:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-11lpom8"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function Qo(T){let n,x='Using <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin.enable_layerwise_casting">enable_layerwise_casting()</a>:',d,o,p;return o=new E({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(){n=l("p"),n.innerHTML=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-1anawjo"&&(n.innerHTML=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function So(T){let n,x=`⚠️ When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`;return{c(){n=l("p"),n.textContent=x},l(d){n=i(d,"P",{"data-svelte-h":!0}),_(n)!=="svelte-17p1lpg"&&(n.textContent=x)},m(d,o){$(d,n,o)},p:F,d(d){d&&m(n)}}}function Lo(T){let n,x="Examples:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-kvfsh7"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function Po(T){let n,x=`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(){n=l("p"),n.innerHTML=x},l(d){n=i(d,"P",{"data-svelte-h":!0}),_(n)!=="svelte-19a77yg"&&(n.innerHTML=x)},m(d,o){$(d,n,o)},p:F,d(d){d&&m(n)}}}function qo(T){let n,x="Example:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-11lpom8"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function Ao(T){let n,x="If you get the error message below, you need to finetune the weights for your downstream task:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-xueb0m"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function Oo(T){let n,x="Example:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-11lpom8"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function Ko(T){let n,x="Examples:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-kvfsh7"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function ea(T){let n,x="If you get the error message below, you need to finetune the weights for your downstream task:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-xueb0m"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function ta(T){let n,x="Examples:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-kvfsh7"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function sa(T){let n,x="Examples:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-kvfsh7"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function na(T){let n,x="Examples:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-kvfsh7"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function oa(T){let n,x="Examples:",d,o,p;return o=new E({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(){n=l("p"),n.textContent=x,d=a(),c(o.$$.fragment)},l(e){n=i(e,"P",{"data-svelte-h":!0}),_(n)!=="svelte-kvfsh7"&&(n.textContent=x),d=r(e),f(o.$$.fragment,e)},m(e,y){$(e,n,y),$(e,d,y),u(o,e,y),p=!0},p:F,i(e){p||(h(o.$$.fragment,e),p=!0)},o(e){g(o.$$.fragment,e),p=!1},d(e){e&&(m(n),m(d)),b(o,e)}}}function aa(T){let n,x,d,o,p,e,y,_s,ns,Vo='<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>',os,as,Ue,Dn='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.',rs,je,ls,v,Je,vs,ct,Qn="Base class for all models.",xs,ft,Sn=`<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.`,ws,ut,Ln='<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>',$s,B,ke,Ts,ht,Pn=`Compiles <em>only</em> the frequently repeated sub-modules of a model (e.g. the Transformer layers) instead of
compiling the entire model. This technique—often called <strong>regional compilation</strong> (see the PyTorch recipe
<a href="https://docs.pytorch.org/tutorials/recipes/regional_compilation.html" rel="nofollow">https://docs.pytorch.org/tutorials/recipes/regional_compilation.html</a>) can reduce end-to-end compile time
substantially, while preserving the runtime speed-ups you would expect from a full <code>torch.compile</code>.`,Us,gt,qn=`The set of sub-modules to compile is discovered by the presence of <strong><code>_repeated_blocks</code></strong> attribute in the
model definition. Define this attribute on your model subclass as a list/tuple of class names (strings). Every
module whose class name matches will be compiled.`,js,bt,An=`Once discovered, each matching sub-module is compiled by calling <code>submodule.compile(*args, **kwargs)</code>. Any
positional or keyword arguments you supply to <code>compile_repeated_blocks</code> are forwarded verbatim to
<code>torch.compile</code>.`,Js,A,Ze,ks,yt,On=`Potentially dequantize the model in case it has been quantized by a quantization method that support
dequantization.`,Zs,O,Ce,Cs,Mt,Kn=`Deactivates gradient checkpointing for the current model (may be referred to as <em>activation checkpointing</em> or
<em>checkpoint activations</em> in other frameworks).`,Gs,K,Ge,Is,_t,eo="disable npu flash attention from torch_npu",Ws,ee,Ie,Fs,vt,to='Disable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',Vs,te,We,Bs,xt,so="Disable the flash attention pallals kernel for torch_xla.",Rs,se,Fe,Ns,wt,no=`Activates gradient checkpointing for the current model (may be referred to as <em>activation checkpointing</em> or
<em>checkpoint activations</em> in other frameworks).`,Xs,R,Ve,Hs,$t,oo="Activates group offloading for the current model.",Ys,Tt,ao='See <a href="/docs/diffusers/main/en/api/utilities#diffusers.hooks.apply_group_offloading">apply_group_offloading()</a> for more information.',zs,ne,Es,C,Be,Ds,Ut,ro="Activates layerwise casting for the current model.",Qs,jt,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.`,Ss,Jt,io=`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.`,Ls,kt,mo="Example:",Ps,oe,qs,ae,Re,As,Zt,po="Enable npu flash attention from torch_npu",Os,W,Ne,Ks,Ct,co='Enable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',en,Gt,fo=`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.`,tn,re,sn,le,nn,ie,Xe,on,It,uo="Enable the flash attention pallals kernel for torch_xla.",an,G,He,rn,Wt,ho="Instantiate a pretrained PyTorch model from a pretrained model configuration.",ln,Ft,go=`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>.`,dn,de,mn,me,pn,pe,cn,ce,Ye,fn,Vt,bo=`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>`,un,L,ze,hn,Bt,yo="Get number of (trainable or non-embedding) parameters in the module.",gn,fe,bn,ue,Ee,yn,Rt,Mo=`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.`,Mn,he,De,_n,Nt,_o="Set the switch for the npu flash attention.",is,Qe,ds,k,Se,vn,Xt,vo="Base class for all Flax models.",xn,Ht,xo=`<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.`,wn,Yt,wo='<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>',$n,N,Le,Tn,zt,$o="Instantiate a pretrained Flax model from a pretrained model configuration.",Un,ge,jn,be,Jn,ye,Pe,kn,Et,To=`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.`,Zn,X,qe,Cn,Dt,Uo=`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.`,Gn,Qt,jo=`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.`,In,Me,Wn,H,Ae,Fn,St,Jo=`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.`,Vn,Lt,ko=`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.`,Bn,_e,Rn,P,Oe,Nn,Pt,Zo=`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.`,Xn,ve,ms,Ke,ps,D,et,Hn,qt,Co="A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub.",Yn,q,tt,zn,At,Go="Upload model, scheduler, or pipeline files to the 🤗 Hugging Face Hub.",En,xe,cs,st,fs,ss,us;return p=new Ms({props:{title:"Models",local:"models",headingTag:"h1"}}),je=new Ms({props:{title:"ModelMixin",local:"diffusers.ModelMixin",headingTag:"h2"}}),Je=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#L251"}}),ke=new J({props:{name:"compile_repeated_blocks",anchor:"diffusers.ModelMixin.compile_repeated_blocks",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L1408"}}),Ze=new J({props:{name:"dequantize",anchor:"diffusers.ModelMixin.dequantize",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L760"}}),Ce=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"}}),Ge=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"}}),Ie=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"}}),We=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"}}),Fe=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"}}),Ve=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"},{name:"record_stream",val:": bool = False"},{name:"low_cpu_mem_usage",val:" = False"},{name:"offload_to_disk_path",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L542"}}),ne=new z({props:{anchor:"diffusers.ModelMixin.enable_group_offload.example",$$slots:{default:[Do]},$$scope:{ctx:T}}}),Be=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"}}),oe=new z({props:{anchor:"diffusers.ModelMixin.enable_layerwise_casting.example",$$slots:{default:[Qo]},$$scope:{ctx:T}}}),Re=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"}}),Ne=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"}}),re=new Fo({props:{warning:!0,$$slots:{default:[So]},$$scope:{ctx:T}}}),le=new z({props:{anchor:"diffusers.ModelMixin.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Lo]},$$scope:{ctx:T}}}),Xe=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"}}),He=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>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype.`,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>Union[int, str, torch.device]</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>Examples:`,name:"device_map"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_utils.py#L772"}}),de=new Fo({props:{$$slots:{default:[Po]},$$scope:{ctx:T}}}),me=new z({props:{anchor:"diffusers.ModelMixin.from_pretrained.example",$$slots:{default:[qo]},$$scope:{ctx:T}}}),pe=new z({props:{anchor:"diffusers.ModelMixin.from_pretrained.example-2",$$slots:{default:[Ao]},$$scope:{ctx:T}}}),Ye=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#L1757"}}),ze=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#L1693",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>
`}}),fe=new z({props:{anchor:"diffusers.ModelMixin.num_parameters.example",$$slots:{default:[Oo]},$$scope:{ctx:T}}}),Ee=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#L605"}}),De=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"}}),Qe=new Ms({props:{title:"FlaxModelMixin",local:"diffusers.FlaxModelMixin",headingTag:"h2"}}),Se=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"}}),Le=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"}}),ge=new z({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example",$$slots:{default:[Ko]},$$scope:{ctx:T}}}),be=new z({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example-2",$$slots:{default:[ea]},$$scope:{ctx:T}}}),Pe=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"}}),qe=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"}}),Me=new z({props:{anchor:"diffusers.FlaxModelMixin.to_bf16.example",$$slots:{default:[ta]},$$scope:{ctx:T}}}),Ae=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"}}),_e=new z({props:{anchor:"diffusers.FlaxModelMixin.to_fp16.example",$$slots:{default:[sa]},$$scope:{ctx:T}}}),Oe=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"}}),ve=new z({props:{anchor:"diffusers.FlaxModelMixin.to_fp32.example",$$slots:{default:[na]},$$scope:{ctx:T}}}),Ke=new Ms({props:{title:"PushToHubMixin",local:"diffusers.utils.PushToHubMixin",headingTag:"h2"}}),et=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"}}),tt=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"}}),xe=new z({props:{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.example",$$slots:{default:[oa]},$$scope:{ctx:T}}}),st=new Eo({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/overview.md"}}),{c(){n=l("meta"),x=a(),d=l("p"),o=a(),c(p.$$.fragment),e=a(),y=l("p"),_s=Io("🤗 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 "),ns=new Ho(!1),os=Io("."),as=a(),Ue=l("p"),Ue.innerHTML=Dn,rs=a(),c(je.$$.fragment),ls=a(),v=l("div"),c(Je.$$.fragment),vs=a(),ct=l("p"),ct.textContent=Qn,xs=a(),ft=l("p"),ft.innerHTML=Sn,ws=a(),ut=l("ul"),ut.innerHTML=Ln,$s=a(),B=l("div"),c(ke.$$.fragment),Ts=a(),ht=l("p"),ht.innerHTML=Pn,Us=a(),gt=l("p"),gt.innerHTML=qn,js=a(),bt=l("p"),bt.innerHTML=An,Js=a(),A=l("div"),c(Ze.$$.fragment),ks=a(),yt=l("p"),yt.textContent=On,Zs=a(),O=l("div"),c(Ce.$$.fragment),Cs=a(),Mt=l("p"),Mt.innerHTML=Kn,Gs=a(),K=l("div"),c(Ge.$$.fragment),Is=a(),_t=l("p"),_t.textContent=eo,Ws=a(),ee=l("div"),c(Ie.$$.fragment),Fs=a(),vt=l("p"),vt.innerHTML=to,Vs=a(),te=l("div"),c(We.$$.fragment),Bs=a(),xt=l("p"),xt.textContent=so,Rs=a(),se=l("div"),c(Fe.$$.fragment),Ns=a(),wt=l("p"),wt.innerHTML=no,Xs=a(),R=l("div"),c(Ve.$$.fragment),Hs=a(),$t=l("p"),$t.textContent=oo,Ys=a(),Tt=l("p"),Tt.innerHTML=ao,zs=a(),c(ne.$$.fragment),Es=a(),C=l("div"),c(Be.$$.fragment),Ds=a(),Ut=l("p"),Ut.textContent=ro,Qs=a(),jt=l("p"),jt.textContent=lo,Ss=a(),Jt=l("p"),Jt.innerHTML=io,Ls=a(),kt=l("p"),kt.textContent=mo,Ps=a(),c(oe.$$.fragment),qs=a(),ae=l("div"),c(Re.$$.fragment),As=a(),Zt=l("p"),Zt.textContent=po,Os=a(),W=l("div"),c(Ne.$$.fragment),Ks=a(),Ct=l("p"),Ct.innerHTML=co,en=a(),Gt=l("p"),Gt.textContent=fo,tn=a(),c(re.$$.fragment),sn=a(),c(le.$$.fragment),nn=a(),ie=l("div"),c(Xe.$$.fragment),on=a(),It=l("p"),It.textContent=uo,an=a(),G=l("div"),c(He.$$.fragment),rn=a(),Wt=l("p"),Wt.textContent=ho,ln=a(),Ft=l("p"),Ft.innerHTML=go,dn=a(),c(de.$$.fragment),mn=a(),c(me.$$.fragment),pn=a(),c(pe.$$.fragment),cn=a(),ce=l("div"),c(Ye.$$.fragment),fn=a(),Vt=l("p"),Vt.innerHTML=bo,un=a(),L=l("div"),c(ze.$$.fragment),hn=a(),Bt=l("p"),Bt.textContent=yo,gn=a(),c(fe.$$.fragment),bn=a(),ue=l("div"),c(Ee.$$.fragment),yn=a(),Rt=l("p"),Rt.innerHTML=Mo,Mn=a(),he=l("div"),c(De.$$.fragment),_n=a(),Nt=l("p"),Nt.textContent=_o,is=a(),c(Qe.$$.fragment),ds=a(),k=l("div"),c(Se.$$.fragment),vn=a(),Xt=l("p"),Xt.textContent=vo,xn=a(),Ht=l("p"),Ht.innerHTML=xo,wn=a(),Yt=l("ul"),Yt.innerHTML=wo,$n=a(),N=l("div"),c(Le.$$.fragment),Tn=a(),zt=l("p"),zt.textContent=$o,Un=a(),c(ge.$$.fragment),jn=a(),c(be.$$.fragment),Jn=a(),ye=l("div"),c(Pe.$$.fragment),kn=a(),Et=l("p"),Et.innerHTML=To,Zn=a(),X=l("div"),c(qe.$$.fragment),Cn=a(),Dt=l("p"),Dt.innerHTML=Uo,Gn=a(),Qt=l("p"),Qt.textContent=jo,In=a(),c(Me.$$.fragment),Wn=a(),H=l("div"),c(Ae.$$.fragment),Fn=a(),St=l("p"),St.innerHTML=Jo,Vn=a(),Lt=l("p"),Lt.textContent=ko,Bn=a(),c(_e.$$.fragment),Rn=a(),P=l("div"),c(Oe.$$.fragment),Nn=a(),Pt=l("p"),Pt.innerHTML=Zo,Xn=a(),c(ve.$$.fragment),ms=a(),c(Ke.$$.fragment),ps=a(),D=l("div"),c(et.$$.fragment),Hn=a(),qt=l("p"),qt.textContent=Co,Yn=a(),q=l("div"),c(tt.$$.fragment),zn=a(),At=l("p"),At.textContent=Go,En=a(),c(xe.$$.fragment),cs=a(),c(st.$$.fragment),fs=a(),ss=l("p"),this.h()},l(t){const M=Yo("svelte-u9bgzb",document.head);n=i(M,"META",{name:!0,content:!0}),M.forEach(m),x=r(t),d=i(t,"P",{}),U(d).forEach(m),o=r(t),f(p.$$.fragment,t),e=r(t),y=i(t,"P",{});var nt=U(y);_s=Wo(nt,"🤗 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 "),ns=zo(nt,!1),os=Wo(nt,"."),nt.forEach(m),as=r(t),Ue=i(t,"P",{"data-svelte-h":!0}),_(Ue)!=="svelte-1elbdrk"&&(Ue.innerHTML=Dn),rs=r(t),f(je.$$.fragment,t),ls=r(t),v=i(t,"DIV",{class:!0});var w=U(v);f(Je.$$.fragment,w),vs=r(w),ct=i(w,"P",{"data-svelte-h":!0}),_(ct)!=="svelte-12nk4t7"&&(ct.textContent=Qn),xs=r(w),ft=i(w,"P",{"data-svelte-h":!0}),_(ft)!=="svelte-ku6myw"&&(ft.innerHTML=Sn),ws=r(w),ut=i(w,"UL",{"data-svelte-h":!0}),_(ut)!=="svelte-kvpw1l"&&(ut.innerHTML=Ln),$s=r(w),B=i(w,"DIV",{class:!0});var Q=U(B);f(ke.$$.fragment,Q),Ts=r(Q),ht=i(Q,"P",{"data-svelte-h":!0}),_(ht)!=="svelte-38nsj2"&&(ht.innerHTML=Pn),Us=r(Q),gt=i(Q,"P",{"data-svelte-h":!0}),_(gt)!=="svelte-1et28mh"&&(gt.innerHTML=qn),js=r(Q),bt=i(Q,"P",{"data-svelte-h":!0}),_(bt)!=="svelte-k8xxs3"&&(bt.innerHTML=An),Q.forEach(m),Js=r(w),A=i(w,"DIV",{class:!0});var ot=U(A);f(Ze.$$.fragment,ot),ks=r(ot),yt=i(ot,"P",{"data-svelte-h":!0}),_(yt)!=="svelte-on69a4"&&(yt.textContent=On),ot.forEach(m),Zs=r(w),O=i(w,"DIV",{class:!0});var at=U(O);f(Ce.$$.fragment,at),Cs=r(at),Mt=i(at,"P",{"data-svelte-h":!0}),_(Mt)!=="svelte-jedy0o"&&(Mt.innerHTML=Kn),at.forEach(m),Gs=r(w),K=i(w,"DIV",{class:!0});var rt=U(K);f(Ge.$$.fragment,rt),Is=r(rt),_t=i(rt,"P",{"data-svelte-h":!0}),_(_t)!=="svelte-advgdt"&&(_t.textContent=eo),rt.forEach(m),Ws=r(w),ee=i(w,"DIV",{class:!0});var lt=U(ee);f(Ie.$$.fragment,lt),Fs=r(lt),vt=i(lt,"P",{"data-svelte-h":!0}),_(vt)!=="svelte-1vfte1e"&&(vt.innerHTML=to),lt.forEach(m),Vs=r(w),te=i(w,"DIV",{class:!0});var it=U(te);f(We.$$.fragment,it),Bs=r(it),xt=i(it,"P",{"data-svelte-h":!0}),_(xt)!=="svelte-l9u3py"&&(xt.textContent=so),it.forEach(m),Rs=r(w),se=i(w,"DIV",{class:!0});var dt=U(se);f(Fe.$$.fragment,dt),Ns=r(dt),wt=i(dt,"P",{"data-svelte-h":!0}),_(wt)!=="svelte-1rv66k9"&&(wt.innerHTML=no),dt.forEach(m),Xs=r(w),R=i(w,"DIV",{class:!0});var S=U(R);f(Ve.$$.fragment,S),Hs=r(S),$t=i(S,"P",{"data-svelte-h":!0}),_($t)!=="svelte-h27n1e"&&($t.textContent=oo),Ys=r(S),Tt=i(S,"P",{"data-svelte-h":!0}),_(Tt)!=="svelte-l2yd37"&&(Tt.innerHTML=ao),zs=r(S),f(ne.$$.fragment,S),S.forEach(m),Es=r(w),C=i(w,"DIV",{class:!0});var I=U(C);f(Be.$$.fragment,I),Ds=r(I),Ut=i(I,"P",{"data-svelte-h":!0}),_(Ut)!=="svelte-1iclqp4"&&(Ut.textContent=ro),Qs=r(I),jt=i(I,"P",{"data-svelte-h":!0}),_(jt)!=="svelte-1qne8y2"&&(jt.textContent=lo),Ss=r(I),Jt=i(I,"P",{"data-svelte-h":!0}),_(Jt)!=="svelte-ss6or"&&(Jt.innerHTML=io),Ls=r(I),kt=i(I,"P",{"data-svelte-h":!0}),_(kt)!=="svelte-11lpom8"&&(kt.textContent=mo),Ps=r(I),f(oe.$$.fragment,I),I.forEach(m),qs=r(w),ae=i(w,"DIV",{class:!0});var mt=U(ae);f(Re.$$.fragment,mt),As=r(mt),Zt=i(mt,"P",{"data-svelte-h":!0}),_(Zt)!=="svelte-10xtjge"&&(Zt.textContent=po),mt.forEach(m),Os=r(w),W=i(w,"DIV",{class:!0});var V=U(W);f(Ne.$$.fragment,V),Ks=r(V),Ct=i(V,"P",{"data-svelte-h":!0}),_(Ct)!=="svelte-yfpdyb"&&(Ct.innerHTML=co),en=r(V),Gt=i(V,"P",{"data-svelte-h":!0}),_(Gt)!=="svelte-z1uct7"&&(Gt.textContent=fo),tn=r(V),f(re.$$.fragment,V),sn=r(V),f(le.$$.fragment,V),V.forEach(m),nn=r(w),ie=i(w,"DIV",{class:!0});var pt=U(ie);f(Xe.$$.fragment,pt),on=r(pt),It=i(pt,"P",{"data-svelte-h":!0}),_(It)!=="svelte-17oym6v"&&(It.textContent=uo),pt.forEach(m),an=r(w),G=i(w,"DIV",{class:!0});var Y=U(G);f(He.$$.fragment,Y),rn=r(Y),Wt=i(Y,"P",{"data-svelte-h":!0}),_(Wt)!=="svelte-1lisopl"&&(Wt.textContent=ho),ln=r(Y),Ft=i(Y,"P",{"data-svelte-h":!0}),_(Ft)!=="svelte-1fnd9e6"&&(Ft.innerHTML=go),dn=r(Y),f(de.$$.fragment,Y),mn=r(Y),f(me.$$.fragment,Y),pn=r(Y),f(pe.$$.fragment,Y),Y.forEach(m),cn=r(w),ce=i(w,"DIV",{class:!0});var hs=U(ce);f(Ye.$$.fragment,hs),fn=r(hs),Vt=i(hs,"P",{"data-svelte-h":!0}),_(Vt)!=="svelte-1o6lvix"&&(Vt.innerHTML=bo),hs.forEach(m),un=r(w),L=i(w,"DIV",{class:!0});var Ot=U(L);f(ze.$$.fragment,Ot),hn=r(Ot),Bt=i(Ot,"P",{"data-svelte-h":!0}),_(Bt)!=="svelte-1jxmzhx"&&(Bt.textContent=yo),gn=r(Ot),f(fe.$$.fragment,Ot),Ot.forEach(m),bn=r(w),ue=i(w,"DIV",{class:!0});var gs=U(ue);f(Ee.$$.fragment,gs),yn=r(gs),Rt=i(gs,"P",{"data-svelte-h":!0}),_(Rt)!=="svelte-1y16a8m"&&(Rt.innerHTML=Mo),gs.forEach(m),Mn=r(w),he=i(w,"DIV",{class:!0});var bs=U(he);f(De.$$.fragment,bs),_n=r(bs),Nt=i(bs,"P",{"data-svelte-h":!0}),_(Nt)!=="svelte-qmktby"&&(Nt.textContent=_o),bs.forEach(m),w.forEach(m),is=r(t),f(Qe.$$.fragment,t),ds=r(t),k=i(t,"DIV",{class:!0});var Z=U(k);f(Se.$$.fragment,Z),vn=r(Z),Xt=i(Z,"P",{"data-svelte-h":!0}),_(Xt)!=="svelte-1kw8rks"&&(Xt.textContent=vo),xn=r(Z),Ht=i(Z,"P",{"data-svelte-h":!0}),_(Ht)!=="svelte-ltxz86"&&(Ht.innerHTML=xo),wn=r(Z),Yt=i(Z,"UL",{"data-svelte-h":!0}),_(Yt)!=="svelte-5tww1s"&&(Yt.innerHTML=wo),$n=r(Z),N=i(Z,"DIV",{class:!0});var we=U(N);f(Le.$$.fragment,we),Tn=r(we),zt=i(we,"P",{"data-svelte-h":!0}),_(zt)!=="svelte-72pb05"&&(zt.textContent=$o),Un=r(we),f(ge.$$.fragment,we),jn=r(we),f(be.$$.fragment,we),we.forEach(m),Jn=r(Z),ye=i(Z,"DIV",{class:!0});var ys=U(ye);f(Pe.$$.fragment,ys),kn=r(ys),Et=i(ys,"P",{"data-svelte-h":!0}),_(Et)!=="svelte-9z80ed"&&(Et.innerHTML=To),ys.forEach(m),Zn=r(Z),X=i(Z,"DIV",{class:!0});var $e=U(X);f(qe.$$.fragment,$e),Cn=r($e),Dt=i($e,"P",{"data-svelte-h":!0}),_(Dt)!=="svelte-16uni9u"&&(Dt.innerHTML=Uo),Gn=r($e),Qt=i($e,"P",{"data-svelte-h":!0}),_(Qt)!=="svelte-1y9zqww"&&(Qt.textContent=jo),In=r($e),f(Me.$$.fragment,$e),$e.forEach(m),Wn=r(Z),H=i(Z,"DIV",{class:!0});var Te=U(H);f(Ae.$$.fragment,Te),Fn=r(Te),St=i(Te,"P",{"data-svelte-h":!0}),_(St)!=="svelte-ifz6ak"&&(St.innerHTML=Jo),Vn=r(Te),Lt=i(Te,"P",{"data-svelte-h":!0}),_(Lt)!=="svelte-yfkr09"&&(Lt.textContent=ko),Bn=r(Te),f(_e.$$.fragment,Te),Te.forEach(m),Rn=r(Z),P=i(Z,"DIV",{class:!0});var Kt=U(P);f(Oe.$$.fragment,Kt),Nn=r(Kt),Pt=i(Kt,"P",{"data-svelte-h":!0}),_(Pt)!=="svelte-j66hh4"&&(Pt.innerHTML=Zo),Xn=r(Kt),f(ve.$$.fragment,Kt),Kt.forEach(m),Z.forEach(m),ms=r(t),f(Ke.$$.fragment,t),ps=r(t),D=i(t,"DIV",{class:!0});var es=U(D);f(et.$$.fragment,es),Hn=r(es),qt=i(es,"P",{"data-svelte-h":!0}),_(qt)!=="svelte-7y8zei"&&(qt.textContent=Co),Yn=r(es),q=i(es,"DIV",{class:!0});var ts=U(q);f(tt.$$.fragment,ts),zn=r(ts),At=i(ts,"P",{"data-svelte-h":!0}),_(At)!=="svelte-5nfhmh"&&(At.textContent=Go),En=r(ts),f(xe.$$.fragment,ts),ts.forEach(m),es.forEach(m),cs=r(t),f(st.$$.fragment,t),fs=r(t),ss=i(t,"P",{}),U(ss).forEach(m),this.h()},h(){j(n,"name","hf:doc:metadata"),j(n,"content",ra),ns.a=os,j(B,"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(te,"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(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(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(W,"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(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(ce,"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(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(v,"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(ye,"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(H,"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(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(D,"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,M){s(document.head,n),$(t,x,M),$(t,d,M),$(t,o,M),u(p,t,M),$(t,e,M),$(t,y,M),s(y,_s),ns.m(Vo,y),s(y,os),$(t,as,M),$(t,Ue,M),$(t,rs,M),u(je,t,M),$(t,ls,M),$(t,v,M),u(Je,v,null),s(v,vs),s(v,ct),s(v,xs),s(v,ft),s(v,ws),s(v,ut),s(v,$s),s(v,B),u(ke,B,null),s(B,Ts),s(B,ht),s(B,Us),s(B,gt),s(B,js),s(B,bt),s(v,Js),s(v,A),u(Ze,A,null),s(A,ks),s(A,yt),s(v,Zs),s(v,O),u(Ce,O,null),s(O,Cs),s(O,Mt),s(v,Gs),s(v,K),u(Ge,K,null),s(K,Is),s(K,_t),s(v,Ws),s(v,ee),u(Ie,ee,null),s(ee,Fs),s(ee,vt),s(v,Vs),s(v,te),u(We,te,null),s(te,Bs),s(te,xt),s(v,Rs),s(v,se),u(Fe,se,null),s(se,Ns),s(se,wt),s(v,Xs),s(v,R),u(Ve,R,null),s(R,Hs),s(R,$t),s(R,Ys),s(R,Tt),s(R,zs),u(ne,R,null),s(v,Es),s(v,C),u(Be,C,null),s(C,Ds),s(C,Ut),s(C,Qs),s(C,jt),s(C,Ss),s(C,Jt),s(C,Ls),s(C,kt),s(C,Ps),u(oe,C,null),s(v,qs),s(v,ae),u(Re,ae,null),s(ae,As),s(ae,Zt),s(v,Os),s(v,W),u(Ne,W,null),s(W,Ks),s(W,Ct),s(W,en),s(W,Gt),s(W,tn),u(re,W,null),s(W,sn),u(le,W,null),s(v,nn),s(v,ie),u(Xe,ie,null),s(ie,on),s(ie,It),s(v,an),s(v,G),u(He,G,null),s(G,rn),s(G,Wt),s(G,ln),s(G,Ft),s(G,dn),u(de,G,null),s(G,mn),u(me,G,null),s(G,pn),u(pe,G,null),s(v,cn),s(v,ce),u(Ye,ce,null),s(ce,fn),s(ce,Vt),s(v,un),s(v,L),u(ze,L,null),s(L,hn),s(L,Bt),s(L,gn),u(fe,L,null),s(v,bn),s(v,ue),u(Ee,ue,null),s(ue,yn),s(ue,Rt),s(v,Mn),s(v,he),u(De,he,null),s(he,_n),s(he,Nt),$(t,is,M),u(Qe,t,M),$(t,ds,M),$(t,k,M),u(Se,k,null),s(k,vn),s(k,Xt),s(k,xn),s(k,Ht),s(k,wn),s(k,Yt),s(k,$n),s(k,N),u(Le,N,null),s(N,Tn),s(N,zt),s(N,Un),u(ge,N,null),s(N,jn),u(be,N,null),s(k,Jn),s(k,ye),u(Pe,ye,null),s(ye,kn),s(ye,Et),s(k,Zn),s(k,X),u(qe,X,null),s(X,Cn),s(X,Dt),s(X,Gn),s(X,Qt),s(X,In),u(Me,X,null),s(k,Wn),s(k,H),u(Ae,H,null),s(H,Fn),s(H,St),s(H,Vn),s(H,Lt),s(H,Bn),u(_e,H,null),s(k,Rn),s(k,P),u(Oe,P,null),s(P,Nn),s(P,Pt),s(P,Xn),u(ve,P,null),$(t,ms,M),u(Ke,t,M),$(t,ps,M),$(t,D,M),u(et,D,null),s(D,Hn),s(D,qt),s(D,Yn),s(D,q),u(tt,q,null),s(q,zn),s(q,At),s(q,En),u(xe,q,null),$(t,cs,M),u(st,t,M),$(t,fs,M),$(t,ss,M),us=!0},p(t,[M]){const nt={};M&2&&(nt.$$scope={dirty:M,ctx:t}),ne.$set(nt);const w={};M&2&&(w.$$scope={dirty:M,ctx:t}),oe.$set(w);const Q={};M&2&&(Q.$$scope={dirty:M,ctx:t}),re.$set(Q);const ot={};M&2&&(ot.$$scope={dirty:M,ctx:t}),le.$set(ot);const at={};M&2&&(at.$$scope={dirty:M,ctx:t}),de.$set(at);const rt={};M&2&&(rt.$$scope={dirty:M,ctx:t}),me.$set(rt);const lt={};M&2&&(lt.$$scope={dirty:M,ctx:t}),pe.$set(lt);const it={};M&2&&(it.$$scope={dirty:M,ctx:t}),fe.$set(it);const dt={};M&2&&(dt.$$scope={dirty:M,ctx:t}),ge.$set(dt);const S={};M&2&&(S.$$scope={dirty:M,ctx:t}),be.$set(S);const I={};M&2&&(I.$$scope={dirty:M,ctx:t}),Me.$set(I);const mt={};M&2&&(mt.$$scope={dirty:M,ctx:t}),_e.$set(mt);const V={};M&2&&(V.$$scope={dirty:M,ctx:t}),ve.$set(V);const pt={};M&2&&(pt.$$scope={dirty:M,ctx:t}),xe.$set(pt)},i(t){us||(h(p.$$.fragment,t),h(je.$$.fragment,t),h(Je.$$.fragment,t),h(ke.$$.fragment,t),h(Ze.$$.fragment,t),h(Ce.$$.fragment,t),h(Ge.$$.fragment,t),h(Ie.$$.fragment,t),h(We.$$.fragment,t),h(Fe.$$.fragment,t),h(Ve.$$.fragment,t),h(ne.$$.fragment,t),h(Be.$$.fragment,t),h(oe.$$.fragment,t),h(Re.$$.fragment,t),h(Ne.$$.fragment,t),h(re.$$.fragment,t),h(le.$$.fragment,t),h(Xe.$$.fragment,t),h(He.$$.fragment,t),h(de.$$.fragment,t),h(me.$$.fragment,t),h(pe.$$.fragment,t),h(Ye.$$.fragment,t),h(ze.$$.fragment,t),h(fe.$$.fragment,t),h(Ee.$$.fragment,t),h(De.$$.fragment,t),h(Qe.$$.fragment,t),h(Se.$$.fragment,t),h(Le.$$.fragment,t),h(ge.$$.fragment,t),h(be.$$.fragment,t),h(Pe.$$.fragment,t),h(qe.$$.fragment,t),h(Me.$$.fragment,t),h(Ae.$$.fragment,t),h(_e.$$.fragment,t),h(Oe.$$.fragment,t),h(ve.$$.fragment,t),h(Ke.$$.fragment,t),h(et.$$.fragment,t),h(tt.$$.fragment,t),h(xe.$$.fragment,t),h(st.$$.fragment,t),us=!0)},o(t){g(p.$$.fragment,t),g(je.$$.fragment,t),g(Je.$$.fragment,t),g(ke.$$.fragment,t),g(Ze.$$.fragment,t),g(Ce.$$.fragment,t),g(Ge.$$.fragment,t),g(Ie.$$.fragment,t),g(We.$$.fragment,t),g(Fe.$$.fragment,t),g(Ve.$$.fragment,t),g(ne.$$.fragment,t),g(Be.$$.fragment,t),g(oe.$$.fragment,t),g(Re.$$.fragment,t),g(Ne.$$.fragment,t),g(re.$$.fragment,t),g(le.$$.fragment,t),g(Xe.$$.fragment,t),g(He.$$.fragment,t),g(de.$$.fragment,t),g(me.$$.fragment,t),g(pe.$$.fragment,t),g(Ye.$$.fragment,t),g(ze.$$.fragment,t),g(fe.$$.fragment,t),g(Ee.$$.fragment,t),g(De.$$.fragment,t),g(Qe.$$.fragment,t),g(Se.$$.fragment,t),g(Le.$$.fragment,t),g(ge.$$.fragment,t),g(be.$$.fragment,t),g(Pe.$$.fragment,t),g(qe.$$.fragment,t),g(Me.$$.fragment,t),g(Ae.$$.fragment,t),g(_e.$$.fragment,t),g(Oe.$$.fragment,t),g(ve.$$.fragment,t),g(Ke.$$.fragment,t),g(et.$$.fragment,t),g(tt.$$.fragment,t),g(xe.$$.fragment,t),g(st.$$.fragment,t),us=!1},d(t){t&&(m(x),m(d),m(o),m(e),m(y),m(as),m(Ue),m(rs),m(ls),m(v),m(is),m(ds),m(k),m(ms),m(ps),m(D),m(cs),m(fs),m(ss)),m(n),b(p,t),b(je,t),b(Je),b(ke),b(Ze),b(Ce),b(Ge),b(Ie),b(We),b(Fe),b(Ve),b(ne),b(Be),b(oe),b(Re),b(Ne),b(re),b(le),b(Xe),b(He),b(de),b(me),b(pe),b(Ye),b(ze),b(fe),b(Ee),b(De),b(Qe,t),b(Se),b(Le),b(ge),b(be),b(Pe),b(qe),b(Me),b(Ae),b(_e),b(Oe),b(ve),b(Ke,t),b(et),b(tt),b(xe),b(st,t)}}}const ra='{"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 la(T){return Ro(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ha extends No{constructor(n){super(),Xo(this,n,la,aa,Bo,{})}}export{ha as component};
