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