import{S as ci,i as fi,s as ui,e as a,k as d,w as v,t as i,M as mi,c as s,d as n,m as p,a as o,x as w,h as l,b as f,G as e,g as _,y as x,q as M,o as I,B as J,v as hi,L as _n}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as go}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as Z}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as bn}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as jt}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as gn}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function gi(T){let c,b,m,u,y,r,h,K,C,de,Y,R,pe,F,S,ee,L;return{c(){c=a("p"),b=i("Make sure to check out the Stable Diffusion "),m=a("a"),u=i("Tips"),y=i(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),r=d(),h=a("p"),K=i("If you\u2019re interested in using one of the official checkpoints for a task, explore the "),C=a("a"),de=i("CompVis"),Y=i(", "),R=a("a"),pe=i("Runway"),F=i(", and "),S=a("a"),ee=i("Stability AI"),L=i(" Hub organizations!"),this.h()},l(U){c=s(U,"P",{});var E=o(c);b=l(E,"Make sure to check out the Stable Diffusion "),m=s(E,"A",{href:!0});var ft=o(m);u=l(ft,"Tips"),ft.forEach(n),y=l(E," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),E.forEach(n),r=p(U),h=s(U,"P",{});var W=o(h);K=l(W,"If you\u2019re interested in using one of the official checkpoints for a task, explore the "),C=s(W,"A",{href:!0,rel:!0});var G=o(C);de=l(G,"CompVis"),G.forEach(n),Y=l(W,", "),R=s(W,"A",{href:!0,rel:!0});var ut=o(R);pe=l(ut,"Runway"),ut.forEach(n),F=l(W,", and "),S=s(W,"A",{href:!0,rel:!0});var Q=o(S);ee=l(Q,"Stability AI"),Q.forEach(n),L=l(W," Hub organizations!"),W.forEach(n),this.h()},h(){f(m,"href","overview#tips"),f(C,"href","https://huggingface.co/CompVis"),f(C,"rel","nofollow"),f(R,"href","https://huggingface.co/runwayml"),f(R,"rel","nofollow"),f(S,"href","https://huggingface.co/stabilityai"),f(S,"rel","nofollow")},m(U,E){_(U,c,E),e(c,b),e(c,m),e(m,u),e(c,y),_(U,r,E),_(U,h,E),e(h,K),e(h,C),e(C,de),e(h,Y),e(h,R),e(R,pe),e(h,F),e(h,S),e(S,ee),e(h,L)},d(U){U&&n(c),U&&n(r),U&&n(h)}}}function _i(T){let c,b,m,u,y;return u=new bn({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uSW5wYWludFBpcGVsaW5lJTBBJTBBJTBBZGVmJTIwZG93bmxvYWRfaW1hZ2UodXJsKSUzQSUwQSUyMCUyMCUyMCUyMHJlc3BvbnNlJTIwJTNEJTIwcmVxdWVzdHMuZ2V0KHVybCklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBQSUwuSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEElMEElMEFpbWdfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRmxhdGVudC1kaWZmdXNpb24lMkZtYWluJTJGZGF0YSUyRmlucGFpbnRpbmdfZXhhbXBsZXMlMkZvdmVydHVyZS1jcmVhdGlvbnMtNXNJNmZRZ1lJdW8ucG5nJTIyJTBBbWFza191cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZDb21wVmlzJTJGbGF0ZW50LWRpZmZ1c2lvbiUyRm1haW4lMkZkYXRhJTJGaW5wYWludGluZ19leGFtcGxlcyUyRm92ZXJ0dXJlLWNyZWF0aW9ucy01c0k2ZlFnWUl1b19tYXNrLnBuZyUyMiUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBkb3dubG9hZF9pbWFnZShpbWdfdXJsKS5yZXNpemUoKDUxMiUyQyUyMDUxMikpJTBBbWFza19pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKG1hc2tfdXJsKS5yZXNpemUoKDUxMiUyQyUyMDUxMikpJTBBJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbklucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLWlucGFpbnRpbmclMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJGYWNlJTIwb2YlMjBhJTIweWVsbG93JTIwY2F0JTJDJTIwaGlnaCUyMHJlc29sdXRpb24lMkMlMjBzaXR0aW5nJTIwb24lMjBhJTIwcGFyayUyMGJlbmNoJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> PIL
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<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> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionInpaintPipeline


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>):
<span class="hljs-meta">... </span>    response = requests.get(url)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> PIL.Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = download_image(img_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = download_image(mask_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionInpaintPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-inpainting&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Face of a yellow cat, high resolution, sitting on a park bench&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt=prompt, image=init_image, mask_image=mask_image).images[<span class="hljs-number">0</span>]`}}),{c(){c=a("p"),b=i("Examples:"),m=d(),v(u.$$.fragment)},l(r){c=s(r,"P",{});var h=o(c);b=l(h,"Examples:"),h.forEach(n),m=p(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,b),_(r,m,h),x(u,r,h),y=!0},p:_n,i(r){y||(M(u.$$.fragment,r),y=!0)},o(r){I(u.$$.fragment,r),y=!1},d(r){r&&n(c),r&&n(m),J(u,r)}}}function bi(T){let c,b;return{c(){c=a("p"),b=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(m){c=s(m,"P",{});var u=o(c);b=l(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(n)},m(m,u){_(m,c,u),e(c,b)},d(m){m&&n(c)}}}function yi(T){let c,b,m,u,y;return u=new bn({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",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> DiffusionPipeline
<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>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){c=a("p"),b=i("Examples:"),m=d(),v(u.$$.fragment)},l(r){c=s(r,"P",{});var h=o(c);b=l(h,"Examples:"),h.forEach(n),m=p(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,b),_(r,m,h),x(u,r,h),y=!0},p:_n,i(r){y||(M(u.$$.fragment,r),y=!0)},o(r){I(u.$$.fragment,r),y=!1},d(r){r&&n(c),r&&n(m),J(u,r)}}}function vi(T){let c,b,m,u,y;return u=new bn({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){c=a("p"),b=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),m=d(),v(u.$$.fragment)},l(r){c=s(r,"P",{});var h=o(c);b=l(h,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),h.forEach(n),m=p(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,b),_(r,m,h),x(u,r,h),y=!0},p:_n,i(r){y||(M(u.$$.fragment,r),y=!0)},o(r){I(u.$$.fragment,r),y=!1},d(r){r&&n(c),r&&n(m),J(u,r)}}}function wi(T){let c,b,m,u,y;return u=new bn({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){c=a("p"),b=i("locally:"),m=d(),v(u.$$.fragment)},l(r){c=s(r,"P",{});var h=o(c);b=l(h,"locally:"),h.forEach(n),m=p(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,b),_(r,m,h),x(u,r,h),y=!0},p:_n,i(r){y||(M(u.$$.fragment,r),y=!0)},o(r){I(u.$$.fragment,r),y=!1},d(r){r&&n(c),r&&n(m),J(u,r)}}}function xi(T){let c,b;return{c(){c=a("p"),b=i("\u{1F9EA} This is an experimental feature!")},l(m){c=s(m,"P",{});var u=o(c);b=l(u,"\u{1F9EA} This is an experimental feature!"),u.forEach(n)},m(m,u){_(m,c,u),e(c,b)},d(m){m&&n(c)}}}function Mi(T){let c,b,m,u,y;return u=new bn({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMGZsYXguamF4X3V0aWxzJTIwaW1wb3J0JTIwcmVwbGljYXRlJTBBZnJvbSUyMGZsYXgudHJhaW5pbmcuY29tbW9uX3V0aWxzJTIwaW1wb3J0JTIwc2hhcmQlMEFpbXBvcnQlMjBQSUwlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxheFN0YWJsZURpZmZ1c2lvbklucGFpbnRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZsYXRlbnQtZGlmZnVzaW9uJTJGbWFpbiUyRmRhdGElMkZpbnBhaW50aW5nX2V4YW1wbGVzJTJGb3ZlcnR1cmUtY3JlYXRpb25zLTVzSTZmUWdZSXVvLnBuZyUyMiUwQW1hc2tfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRmxhdGVudC1kaWZmdXNpb24lMkZtYWluJTJGZGF0YSUyRmlucGFpbnRpbmdfZXhhbXBsZXMlMkZvdmVydHVyZS1jcmVhdGlvbnMtNXNJNmZRZ1lJdW9fbWFzay5wbmclMjIlMEElMEFpbml0X2ltYWdlJTIwJTNEJTIwZG93bmxvYWRfaW1hZ2UoaW1nX3VybCkucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBkb3dubG9hZF9pbWFnZShtYXNrX3VybCkucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUwQSUwQXBpcGVsaW5lJTJDJTIwcGFyYW1zJTIwJTNEJTIwRmxheFN0YWJsZURpZmZ1c2lvbklucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyeHZqaWFydWklMkZzdGFibGUtZGlmZnVzaW9uLTItaW5wYWludGluZyUyMiUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJGYWNlJTIwb2YlMjBhJTIweWVsbG93JTIwY2F0JTJDJTIwaGlnaCUyMHJlc29sdXRpb24lMkMlMjBzaXR0aW5nJTIwb24lMjBhJTIwcGFyayUyMGJlbmNoJTIyJTBBcHJuZ19zZWVkJTIwJTNEJTIwamF4LnJhbmRvbS5QUk5HS2V5KDApJTBBbnVtX2luZmVyZW5jZV9zdGVwcyUyMCUzRCUyMDUwJTBBJTBBbnVtX3NhbXBsZXMlMjAlM0QlMjBqYXguZGV2aWNlX2NvdW50KCklMEFwcm9tcHQlMjAlM0QlMjBudW1fc2FtcGxlcyUyMColMjAlNUJwcm9tcHQlNUQlMEFpbml0X2ltYWdlJTIwJTNEJTIwbnVtX3NhbXBsZXMlMjAqJTIwJTVCaW5pdF9pbWFnZSU1RCUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBudW1fc2FtcGxlcyUyMColMjAlNUJtYXNrX2ltYWdlJTVEJTBBcHJvbXB0X2lkcyUyQyUyMHByb2Nlc3NlZF9tYXNrZWRfaW1hZ2VzJTJDJTIwcHJvY2Vzc2VkX21hc2tzJTIwJTNEJTIwcGlwZWxpbmUucHJlcGFyZV9pbnB1dHMoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTIwaW5pdF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlMEEpJTBBJTBBcGFyYW1zJTIwJTNEJTIwcmVwbGljYXRlKHBhcmFtcyklMEFwcm5nX3NlZWQlMjAlM0QlMjBqYXgucmFuZG9tLnNwbGl0KHBybmdfc2VlZCUyQyUyMGpheC5kZXZpY2VfY291bnQoKSklMEFwcm9tcHRfaWRzJTIwJTNEJTIwc2hhcmQocHJvbXB0X2lkcyklMEFwcm9jZXNzZWRfbWFza2VkX2ltYWdlcyUyMCUzRCUyMHNoYXJkKHByb2Nlc3NlZF9tYXNrZWRfaW1hZ2VzKSUwQXByb2Nlc3NlZF9tYXNrcyUyMCUzRCUyMHNoYXJkKHByb2Nlc3NlZF9tYXNrcyklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjAlMjAlMjBwcm9tcHRfaWRzJTJDJTIwcHJvY2Vzc2VkX21hc2tzJTJDJTIwcHJvY2Vzc2VkX21hc2tlZF9pbWFnZXMlMkMlMjBwYXJhbXMlMkMlMjBwcm5nX3NlZWQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTJDJTIwaml0JTNEVHJ1ZSUwQSkuaW1hZ2VzJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZWxpbmUubnVtcHlfdG9fcGlsKG5wLmFzYXJyYXkoaW1hZ2VzLnJlc2hhcGUoKG51bV9zYW1wbGVzJTJDKSUyMCUyQiUyMGltYWdlcy5zaGFwZSU1Qi0zJTNBJTVEKSkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> PIL
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionInpaintPipeline


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>):
<span class="hljs-meta">... </span>    response = requests.get(url)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> PIL.Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = download_image(img_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = download_image(mask_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline, params = FlaxStableDiffusionInpaintPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;xvjiarui/stable-diffusion-2-inpainting&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Face of a yellow cat, high resolution, sitting on a park bench&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prng_seed = jax.random.PRNGKey(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>num_inference_steps = <span class="hljs-number">50</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>num_samples = jax.device_count()
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = num_samples * [prompt]
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = num_samples * [init_image]
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = num_samples * [mask_image]
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids, processed_masked_images, processed_masks = pipeline.prepare_inputs(
<span class="hljs-meta">... </span>    prompt, init_image, mask_image
<span class="hljs-meta">... </span>)
<span class="hljs-comment"># shard inputs and rng</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>params = replicate(params)
<span class="hljs-meta">&gt;&gt;&gt; </span>prng_seed = jax.random.split(prng_seed, jax.device_count())
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids = shard(prompt_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>processed_masked_images = shard(processed_masked_images)
<span class="hljs-meta">&gt;&gt;&gt; </span>processed_masks = shard(processed_masks)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipeline(
<span class="hljs-meta">... </span>    prompt_ids, processed_masks, processed_masked_images, params, prng_seed, num_inference_steps, jit=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipeline.numpy_to_pil(np.asarray(images.reshape((num_samples,) + images.shape[-<span class="hljs-number">3</span>:])))`}}),{c(){c=a("p"),b=i("Examples:"),m=d(),v(u.$$.fragment)},l(r){c=s(r,"P",{});var h=o(c);b=l(h,"Examples:"),h.forEach(n),m=p(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,b),_(r,m,h),x(u,r,h),y=!0},p:_n,i(r){y||(M(u.$$.fragment,r),y=!0)},o(r){I(u.$$.fragment,r),y=!1},d(r){r&&n(c),r&&n(m),J(u,r)}}}function Ii(T){let c,b,m,u,y,r,h,K,C,de,Y,R,pe,F,S,ee,L,U,E,ft,W,G,ut,Q,Qn,Hn,Ue,qn,On,yn,ce,vn,te,fe,Zt,je,Kn,Et,ea,wn,$,Ze,ta,Ft,na,aa,Ee,sa,mt,oa,ia,la,Wt,ra,da,ne,ht,gt,pa,ca,fa,_t,bt,ua,ma,ha,yt,vt,ga,_a,ba,H,Fe,ya,Gt,va,wa,ue,xa,me,We,Ma,Nt,Ia,Ja,he,Ge,$a,Ne,ka,Bt,Ta,Sa,Da,N,Be,Pa,Xe,Ua,Ce,ja,Za,Ea,ge,Fa,_e,Wa,be,Re,Ga,Le,Na,Ve,Ba,Xa,Ca,D,Ae,Ra,ze,La,wt,Va,Aa,za,Xt,Ya,Qa,ye,Ha,Ye,qa,Qe,Oa,Ka,es,ve,ts,P,He,ns,V,as,Ct,ss,os,Rt,is,ls,Lt,rs,ds,ps,qe,cs,Vt,fs,us,ms,Oe,hs,xt,gs,_s,bs,ae,ys,Mt,vs,ws,At,xs,Ms,Is,se,Js,It,$s,ks,zt,Ts,Ss,Ds,we,Ke,Ps,Yt,Us,js,xe,et,Zs,A,Es,Qt,Fs,Ws,Ht,Gs,Ns,qt,Bs,Xs,xn,oe,Me,Ot,tt,Cs,Kt,Rs,Mn,ie,nt,Ls,en,Vs,In,le,Ie,tn,at,As,nn,zs,Jn,j,st,Ys,an,Qs,Hs,Je,qs,ot,Os,Jt,Ks,eo,to,q,it,no,sn,ao,so,$e,$n,re,ke,on,lt,oo,ln,io,kn,z,rt,lo,rn,ro,po,Te,dt,co,dn,fo,Tn;return r=new jt({}),L=new jt({}),ce=new go({props:{$$slots:{default:[gi]},$$scope:{ctx:T}}}),je=new jt({}),Ze=new Z({props:{name:"class diffusers.StableDiffusionInpaintPipeline",anchor:"diffusers.StableDiffusionInpaintPipeline",parameters:[{name:"vae",val:": typing.Union[diffusers.models.autoencoder_kl.AutoencoderKL, diffusers.models.autoencoder_asym_kl.AsymmetricAutoencoderKL]"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.vae",description:`<strong>vae</strong> ([<code>AutoencoderKL</code>, <code>AsymmetricAutoencoderKL</code>]) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionInpaintPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L155"}}),Fe=new Z({props:{name:"__call__",anchor:"diffusers.StableDiffusionInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to be inpainted (which parts of the image to be masked
out with <code>mask_image</code> and repainted according to <code>prompt</code>).`,name:"image"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to mask <code>image</code>. White pixels in the mask are repainted
while black pixels are preserved. If <code>mask_image</code> is a PIL image, it is converted to a single channel
(luminance) before use. If it&#x2019;s a tensor, it should contain one color channel (L) instead of 3, so the
expected shape would be <code>(B, H, W, 1)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Indicates extent to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code> is used as a
starting point and more noise is added the higher the <code>strength</code>. The number of denoising steps depends
on the amount of noise initially added. When <code>strength</code> is 1, added noise is maximum and the denoising
process runs for the full number of iterations specified in <code>num_inference_steps</code>. A value of 1
essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference. This parameter is modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L671",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),ue=new gn({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.example",$$slots:{default:[_i]},$$scope:{ctx:T}}}),We=new Z({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionInpaintPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1631"}}),Ge=new Z({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1646"}}),Be=new Z({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionInpaintPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1570"}}),ge=new go({props:{warning:!0,$$slots:{default:[bi]},$$scope:{ctx:T}}}),_e=new gn({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[yi]},$$scope:{ctx:T}}}),Re=new Z({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionInpaintPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1605"}}),Ae=new Z({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.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.StableDiffusionInpaintPipeline.load_textual_inversion.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.StableDiffusionInpaintPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.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.StableDiffusionInpaintPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <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"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_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:"use_auth_token"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.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.StableDiffusionInpaintPipeline.load_textual_inversion.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.StableDiffusionInpaintPipeline.load_textual_inversion.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/loaders.py#L585"}}),ye=new gn({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.example",$$slots:{default:[vi]},$$scope:{ctx:T}}}),ve=new gn({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[wi]},$$scope:{ctx:T}}}),He=new Z({props:{name:"load_lora_weights",anchor:"diffusers.StableDiffusionInpaintPipeline.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_lora_weights.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
See <a href="/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/loaders.py#L862"}}),Ke=new Z({props:{name:"save_lora_weights",anchor:"diffusers.StableDiffusionInpaintPipeline.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.save_lora_weights.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save LoRA parameters to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.StableDiffusionInpaintPipeline.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>unet</code>.`,name:"unet_lora_layers"},{anchor:"diffusers.StableDiffusionInpaintPipeline.save_lora_weights.text_encoder_lora_layers",description:`<strong>text_encoder_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_lora_layers"},{anchor:"diffusers.StableDiffusionInpaintPipeline.save_lora_weights.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.StableDiffusionInpaintPipeline.save_lora_weights.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/loaders.py#L1235"}}),et=new Z({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L286"}}),tt=new jt({}),nt=new Z({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),at=new jt({}),st=new Z({props:{name:"class diffusers.FlaxStableDiffusionInpaintPipeline",anchor:"diffusers.FlaxStableDiffusionInpaintPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">FlaxCLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014;
A <code>FlaxUNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py#L102"}}),Je=new go({props:{warning:!0,$$slots:{default:[xi]},$$scope:{ctx:T}}}),it=new Z({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"mask",val:": array"},{name:"masked_image",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide image generation.`,name:"prompt"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference. This parameter is modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
array is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>This argument exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a
future release.</p>

					</div>`,name:"jit"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py#L394",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated images
and the second element is a list of <code>bool</code>s indicating whether the corresponding generated image
contains \u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),$e=new gn({props:{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.example",$$slots:{default:[Mi]},$$scope:{ctx:T}}}),lt=new jt({}),rt=new Z({props:{name:"class diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",parameters:[{name:"images",val:": ndarray"},{name:"nsfw_content_detected",val:": typing.List[bool]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>np.ndarray</code>) &#x2014;
Denoised images of array shape of <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content
or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L117"}}),dt=new Z({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/flax/struct.py#L111"}}),{c(){c=a("meta"),b=d(),m=a("h1"),u=a("a"),y=a("span"),v(r.$$.fragment),h=d(),K=a("span"),C=i("Inpainting"),de=d(),Y=a("p"),R=i("The Stable Diffusion model can also be applied to inpainting which lets you edit specific parts of an image by providing a mask and a text prompt using Stable Diffusion."),pe=d(),F=a("h2"),S=a("a"),ee=a("span"),v(L.$$.fragment),U=d(),E=a("span"),ft=i("Tips"),W=d(),G=a("p"),ut=i(`It is recommended to use this pipeline with checkpoints that have been specifically fine-tuned for inpainting, such
as `),Q=a("a"),Qn=i("runwayml/stable-diffusion-inpainting"),Hn=i(`. Default
text-to-image Stable Diffusion checkpoints, such as
`),Ue=a("a"),qn=i("runwayml/stable-diffusion-v1-5"),On=i(" are also compatible but they might be less performant."),yn=d(),v(ce.$$.fragment),vn=d(),te=a("h2"),fe=a("a"),Zt=a("span"),v(je.$$.fragment),Kn=d(),Et=a("span"),ea=i("StableDiffusionInpaintPipeline"),wn=d(),$=a("div"),v(Ze.$$.fragment),ta=d(),Ft=a("p"),na=i("Pipeline for text-guided image inpainting using Stable Diffusion."),aa=d(),Ee=a("p"),sa=i("This model inherits from "),mt=a("a"),oa=i("DiffusionPipeline"),ia=i(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),la=d(),Wt=a("p"),ra=i("The pipeline also inherits the following loading methods:"),da=d(),ne=a("ul"),ht=a("li"),gt=a("a"),pa=i("load_textual_inversion()"),ca=i(" for loading textual inversion embeddings"),fa=d(),_t=a("li"),bt=a("a"),ua=i("load_lora_weights()"),ma=i(" for loading LoRA weights"),ha=d(),yt=a("li"),vt=a("a"),ga=i("save_lora_weights()"),_a=i(" for saving LoRA weights"),ba=d(),H=a("div"),v(Fe.$$.fragment),ya=d(),Gt=a("p"),va=i("The call function to the pipeline for generation."),wa=d(),v(ue.$$.fragment),xa=d(),me=a("div"),v(We.$$.fragment),Ma=d(),Nt=a("p"),Ia=i(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. This is useful to save some memory in exchange for a small
speed decrease.`),Ja=d(),he=a("div"),v(Ge.$$.fragment),$a=d(),Ne=a("p"),ka=i("Disable sliced attention computation. If "),Bt=a("code"),Ta=i("enable_attention_slicing"),Sa=i(` was previously called, attention is
computed in one step.`),Da=d(),N=a("div"),v(Be.$$.fragment),Pa=d(),Xe=a("p"),Ua=i("Enable memory efficient attention from "),Ce=a("a"),ja=i("xFormers"),Za=i(`. 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.`),Ea=d(),v(ge.$$.fragment),Fa=d(),v(_e.$$.fragment),Wa=d(),be=a("div"),v(Re.$$.fragment),Ga=d(),Le=a("p"),Na=i("Disable memory efficient attention from "),Ve=a("a"),Ba=i("xFormers"),Xa=i("."),Ca=d(),D=a("div"),v(Ae.$$.fragment),Ra=d(),ze=a("p"),La=i("Load textual inversion embeddings into the text encoder of "),wt=a("a"),Va=i("StableDiffusionPipeline"),Aa=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),za=d(),Xt=a("p"),Ya=i("Example:"),Qa=d(),v(ye.$$.fragment),Ha=d(),Ye=a("p"),qa=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Qe=a("a"),Oa=i("civitAI"),Ka=i(") and then load the vector"),es=d(),v(ve.$$.fragment),ts=d(),P=a("div"),v(He.$$.fragment),ns=d(),V=a("p"),as=i("Load LoRA weights specified in "),Ct=a("code"),ss=i("pretrained_model_name_or_path_or_dict"),os=i(" into "),Rt=a("code"),is=i("self.unet"),ls=i(` and
`),Lt=a("code"),rs=i("self.text_encoder"),ds=i("."),ps=d(),qe=a("p"),cs=i("All kwargs are forwarded to "),Vt=a("code"),fs=i("self.lora_state_dict"),us=i("."),ms=d(),Oe=a("p"),hs=i("See "),xt=a("a"),gs=i("lora_state_dict()"),_s=i(" for more details on how the state dict is loaded."),bs=d(),ae=a("p"),ys=i("See "),Mt=a("a"),vs=i("load_lora_into_unet()"),ws=i(` for more details on how the state dict is loaded into
`),At=a("code"),xs=i("self.unet"),Ms=i("."),Is=d(),se=a("p"),Js=i("See "),It=a("a"),$s=i("load_lora_into_text_encoder()"),ks=i(` for more details on how the state dict is loaded
into `),zt=a("code"),Ts=i("self.text_encoder"),Ss=i("."),Ds=d(),we=a("div"),v(Ke.$$.fragment),Ps=d(),Yt=a("p"),Us=i("Save the LoRA parameters corresponding to the UNet and text encoder."),js=d(),xe=a("div"),v(et.$$.fragment),Zs=d(),A=a("p"),Es=i(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Qt=a("code"),Fs=i("forward"),Ws=i(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Ht=a("code"),Gs=i("enable_sequential_cpu_offload"),Ns=i(`, but performance is much better due to the
iterative execution of the `),qt=a("code"),Bs=i("unet"),Xs=i("."),xn=d(),oe=a("h2"),Me=a("a"),Ot=a("span"),v(tt.$$.fragment),Cs=d(),Kt=a("span"),Rs=i("StableDiffusionPipelineOutput"),Mn=d(),ie=a("div"),v(nt.$$.fragment),Ls=d(),en=a("p"),Vs=i("Output class for Stable Diffusion pipelines."),In=d(),le=a("h2"),Ie=a("a"),tn=a("span"),v(at.$$.fragment),As=d(),nn=a("span"),zs=i("FlaxStableDiffusionInpaintPipeline"),Jn=d(),j=a("div"),v(st.$$.fragment),Ys=d(),an=a("p"),Qs=i("Flax-based pipeline for text-guided image inpainting using Stable Diffusion."),Hs=d(),v(Je.$$.fragment),qs=d(),ot=a("p"),Os=i("This model inherits from "),Jt=a("a"),Ks=i("FlaxDiffusionPipeline"),eo=i(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),to=d(),q=a("div"),v(it.$$.fragment),no=d(),sn=a("p"),ao=i("Function invoked when calling the pipeline for generation."),so=d(),v($e.$$.fragment),$n=d(),re=a("h2"),ke=a("a"),on=a("span"),v(lt.$$.fragment),oo=d(),ln=a("span"),io=i("FlaxStableDiffusionPipelineOutput"),kn=d(),z=a("div"),v(rt.$$.fragment),lo=d(),rn=a("p"),ro=i("Output class for Flax-based Stable Diffusion pipelines."),po=d(),Te=a("div"),v(dt.$$.fragment),co=d(),dn=a("p"),fo=i("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(t){const g=mi('[data-svelte="svelte-1phssyn"]',document.head);c=s(g,"META",{name:!0,content:!0}),g.forEach(n),b=p(t),m=s(t,"H1",{class:!0});var pt=o(m);u=s(pt,"A",{id:!0,class:!0,href:!0});var pn=o(u);y=s(pn,"SPAN",{});var cn=o(y);w(r.$$.fragment,cn),cn.forEach(n),pn.forEach(n),h=p(pt),K=s(pt,"SPAN",{});var fn=o(K);C=l(fn,"Inpainting"),fn.forEach(n),pt.forEach(n),de=p(t),Y=s(t,"P",{});var un=o(Y);R=l(un,"The Stable Diffusion model can also be applied to inpainting which lets you edit specific parts of an image by providing a mask and a text prompt using Stable Diffusion."),un.forEach(n),pe=p(t),F=s(t,"H2",{class:!0});var ct=o(F);S=s(ct,"A",{id:!0,class:!0,href:!0});var mn=o(S);ee=s(mn,"SPAN",{});var hn=o(ee);w(L.$$.fragment,hn),hn.forEach(n),mn.forEach(n),U=p(ct),E=s(ct,"SPAN",{});var _o=o(E);ft=l(_o,"Tips"),_o.forEach(n),ct.forEach(n),W=p(t),G=s(t,"P",{});var $t=o(G);ut=l($t,`It is recommended to use this pipeline with checkpoints that have been specifically fine-tuned for inpainting, such
as `),Q=s($t,"A",{href:!0,rel:!0});var bo=o(Q);Qn=l(bo,"runwayml/stable-diffusion-inpainting"),bo.forEach(n),Hn=l($t,`. Default
text-to-image Stable Diffusion checkpoints, such as
`),Ue=s($t,"A",{href:!0,rel:!0});var yo=o(Ue);qn=l(yo,"runwayml/stable-diffusion-v1-5"),yo.forEach(n),On=l($t," are also compatible but they might be less performant."),$t.forEach(n),yn=p(t),w(ce.$$.fragment,t),vn=p(t),te=s(t,"H2",{class:!0});var Sn=o(te);fe=s(Sn,"A",{id:!0,class:!0,href:!0});var vo=o(fe);Zt=s(vo,"SPAN",{});var wo=o(Zt);w(je.$$.fragment,wo),wo.forEach(n),vo.forEach(n),Kn=p(Sn),Et=s(Sn,"SPAN",{});var xo=o(Et);ea=l(xo,"StableDiffusionInpaintPipeline"),xo.forEach(n),Sn.forEach(n),wn=p(t),$=s(t,"DIV",{class:!0});var k=o($);w(Ze.$$.fragment,k),ta=p(k),Ft=s(k,"P",{});var Mo=o(Ft);na=l(Mo,"Pipeline for text-guided image inpainting using Stable Diffusion."),Mo.forEach(n),aa=p(k),Ee=s(k,"P",{});var Dn=o(Ee);sa=l(Dn,"This model inherits from "),mt=s(Dn,"A",{href:!0});var Io=o(mt);oa=l(Io,"DiffusionPipeline"),Io.forEach(n),ia=l(Dn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Dn.forEach(n),la=p(k),Wt=s(k,"P",{});var Jo=o(Wt);ra=l(Jo,"The pipeline also inherits the following loading methods:"),Jo.forEach(n),da=p(k),ne=s(k,"UL",{});var kt=o(ne);ht=s(kt,"LI",{});var uo=o(ht);gt=s(uo,"A",{href:!0});var $o=o(gt);pa=l($o,"load_textual_inversion()"),$o.forEach(n),ca=l(uo," for loading textual inversion embeddings"),uo.forEach(n),fa=p(kt),_t=s(kt,"LI",{});var mo=o(_t);bt=s(mo,"A",{href:!0});var ko=o(bt);ua=l(ko,"load_lora_weights()"),ko.forEach(n),ma=l(mo," for loading LoRA weights"),mo.forEach(n),ha=p(kt),yt=s(kt,"LI",{});var ho=o(yt);vt=s(ho,"A",{href:!0});var To=o(vt);ga=l(To,"save_lora_weights()"),To.forEach(n),_a=l(ho," for saving LoRA weights"),ho.forEach(n),kt.forEach(n),ba=p(k),H=s(k,"DIV",{class:!0});var Tt=o(H);w(Fe.$$.fragment,Tt),ya=p(Tt),Gt=s(Tt,"P",{});var So=o(Gt);va=l(So,"The call function to the pipeline for generation."),So.forEach(n),wa=p(Tt),w(ue.$$.fragment,Tt),Tt.forEach(n),xa=p(k),me=s(k,"DIV",{class:!0});var Pn=o(me);w(We.$$.fragment,Pn),Ma=p(Pn),Nt=s(Pn,"P",{});var Do=o(Nt);Ia=l(Do,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. This is useful to save some memory in exchange for a small
speed decrease.`),Do.forEach(n),Pn.forEach(n),Ja=p(k),he=s(k,"DIV",{class:!0});var Un=o(he);w(Ge.$$.fragment,Un),$a=p(Un),Ne=s(Un,"P",{});var jn=o(Ne);ka=l(jn,"Disable sliced attention computation. If "),Bt=s(jn,"CODE",{});var Po=o(Bt);Ta=l(Po,"enable_attention_slicing"),Po.forEach(n),Sa=l(jn,` was previously called, attention is
computed in one step.`),jn.forEach(n),Un.forEach(n),Da=p(k),N=s(k,"DIV",{class:!0});var Se=o(N);w(Be.$$.fragment,Se),Pa=p(Se),Xe=s(Se,"P",{});var Zn=o(Xe);Ua=l(Zn,"Enable memory efficient attention from "),Ce=s(Zn,"A",{href:!0,rel:!0});var Uo=o(Ce);ja=l(Uo,"xFormers"),Uo.forEach(n),Za=l(Zn,`. 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.`),Zn.forEach(n),Ea=p(Se),w(ge.$$.fragment,Se),Fa=p(Se),w(_e.$$.fragment,Se),Se.forEach(n),Wa=p(k),be=s(k,"DIV",{class:!0});var En=o(be);w(Re.$$.fragment,En),Ga=p(En),Le=s(En,"P",{});var Fn=o(Le);Na=l(Fn,"Disable memory efficient attention from "),Ve=s(Fn,"A",{href:!0,rel:!0});var jo=o(Ve);Ba=l(jo,"xFormers"),jo.forEach(n),Xa=l(Fn,"."),Fn.forEach(n),En.forEach(n),Ca=p(k),D=s(k,"DIV",{class:!0});var B=o(D);w(Ae.$$.fragment,B),Ra=p(B),ze=s(B,"P",{});var Wn=o(ze);La=l(Wn,"Load textual inversion embeddings into the text encoder of "),wt=s(Wn,"A",{href:!0});var Zo=o(wt);Va=l(Zo,"StableDiffusionPipeline"),Zo.forEach(n),Aa=l(Wn,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Wn.forEach(n),za=p(B),Xt=s(B,"P",{});var Eo=o(Xt);Ya=l(Eo,"Example:"),Eo.forEach(n),Qa=p(B),w(ye.$$.fragment,B),Ha=p(B),Ye=s(B,"P",{});var Gn=o(Ye);qa=l(Gn,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Qe=s(Gn,"A",{href:!0,rel:!0});var Fo=o(Qe);Oa=l(Fo,"civitAI"),Fo.forEach(n),Ka=l(Gn,") and then load the vector"),Gn.forEach(n),es=p(B),w(ve.$$.fragment,B),B.forEach(n),ts=p(k),P=s(k,"DIV",{class:!0});var X=o(P);w(He.$$.fragment,X),ns=p(X),V=s(X,"P",{});var De=o(V);as=l(De,"Load LoRA weights specified in "),Ct=s(De,"CODE",{});var Wo=o(Ct);ss=l(Wo,"pretrained_model_name_or_path_or_dict"),Wo.forEach(n),os=l(De," into "),Rt=s(De,"CODE",{});var Go=o(Rt);is=l(Go,"self.unet"),Go.forEach(n),ls=l(De,` and
`),Lt=s(De,"CODE",{});var No=o(Lt);rs=l(No,"self.text_encoder"),No.forEach(n),ds=l(De,"."),De.forEach(n),ps=p(X),qe=s(X,"P",{});var Nn=o(qe);cs=l(Nn,"All kwargs are forwarded to "),Vt=s(Nn,"CODE",{});var Bo=o(Vt);fs=l(Bo,"self.lora_state_dict"),Bo.forEach(n),us=l(Nn,"."),Nn.forEach(n),ms=p(X),Oe=s(X,"P",{});var Bn=o(Oe);hs=l(Bn,"See "),xt=s(Bn,"A",{href:!0});var Xo=o(xt);gs=l(Xo,"lora_state_dict()"),Xo.forEach(n),_s=l(Bn," for more details on how the state dict is loaded."),Bn.forEach(n),bs=p(X),ae=s(X,"P",{});var St=o(ae);ys=l(St,"See "),Mt=s(St,"A",{href:!0});var Co=o(Mt);vs=l(Co,"load_lora_into_unet()"),Co.forEach(n),ws=l(St,` for more details on how the state dict is loaded into
`),At=s(St,"CODE",{});var Ro=o(At);xs=l(Ro,"self.unet"),Ro.forEach(n),Ms=l(St,"."),St.forEach(n),Is=p(X),se=s(X,"P",{});var Dt=o(se);Js=l(Dt,"See "),It=s(Dt,"A",{href:!0});var Lo=o(It);$s=l(Lo,"load_lora_into_text_encoder()"),Lo.forEach(n),ks=l(Dt,` for more details on how the state dict is loaded
into `),zt=s(Dt,"CODE",{});var Vo=o(zt);Ts=l(Vo,"self.text_encoder"),Vo.forEach(n),Ss=l(Dt,"."),Dt.forEach(n),X.forEach(n),Ds=p(k),we=s(k,"DIV",{class:!0});var Xn=o(we);w(Ke.$$.fragment,Xn),Ps=p(Xn),Yt=s(Xn,"P",{});var Ao=o(Yt);Us=l(Ao,"Save the LoRA parameters corresponding to the UNet and text encoder."),Ao.forEach(n),Xn.forEach(n),js=p(k),xe=s(k,"DIV",{class:!0});var Cn=o(xe);w(et.$$.fragment,Cn),Zs=p(Cn),A=s(Cn,"P",{});var Pe=o(A);Es=l(Pe,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Qt=s(Pe,"CODE",{});var zo=o(Qt);Fs=l(zo,"forward"),zo.forEach(n),Ws=l(Pe,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Ht=s(Pe,"CODE",{});var Yo=o(Ht);Gs=l(Yo,"enable_sequential_cpu_offload"),Yo.forEach(n),Ns=l(Pe,`, but performance is much better due to the
iterative execution of the `),qt=s(Pe,"CODE",{});var Qo=o(qt);Bs=l(Qo,"unet"),Qo.forEach(n),Xs=l(Pe,"."),Pe.forEach(n),Cn.forEach(n),k.forEach(n),xn=p(t),oe=s(t,"H2",{class:!0});var Rn=o(oe);Me=s(Rn,"A",{id:!0,class:!0,href:!0});var Ho=o(Me);Ot=s(Ho,"SPAN",{});var qo=o(Ot);w(tt.$$.fragment,qo),qo.forEach(n),Ho.forEach(n),Cs=p(Rn),Kt=s(Rn,"SPAN",{});var Oo=o(Kt);Rs=l(Oo,"StableDiffusionPipelineOutput"),Oo.forEach(n),Rn.forEach(n),Mn=p(t),ie=s(t,"DIV",{class:!0});var Ln=o(ie);w(nt.$$.fragment,Ln),Ls=p(Ln),en=s(Ln,"P",{});var Ko=o(en);Vs=l(Ko,"Output class for Stable Diffusion pipelines."),Ko.forEach(n),Ln.forEach(n),In=p(t),le=s(t,"H2",{class:!0});var Vn=o(le);Ie=s(Vn,"A",{id:!0,class:!0,href:!0});var ei=o(Ie);tn=s(ei,"SPAN",{});var ti=o(tn);w(at.$$.fragment,ti),ti.forEach(n),ei.forEach(n),As=p(Vn),nn=s(Vn,"SPAN",{});var ni=o(nn);zs=l(ni,"FlaxStableDiffusionInpaintPipeline"),ni.forEach(n),Vn.forEach(n),Jn=p(t),j=s(t,"DIV",{class:!0});var O=o(j);w(st.$$.fragment,O),Ys=p(O),an=s(O,"P",{});var ai=o(an);Qs=l(ai,"Flax-based pipeline for text-guided image inpainting using Stable Diffusion."),ai.forEach(n),Hs=p(O),w(Je.$$.fragment,O),qs=p(O),ot=s(O,"P",{});var An=o(ot);Os=l(An,"This model inherits from "),Jt=s(An,"A",{href:!0});var si=o(Jt);Ks=l(si,"FlaxDiffusionPipeline"),si.forEach(n),eo=l(An,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),An.forEach(n),to=p(O),q=s(O,"DIV",{class:!0});var Pt=o(q);w(it.$$.fragment,Pt),no=p(Pt),sn=s(Pt,"P",{});var oi=o(sn);ao=l(oi,"Function invoked when calling the pipeline for generation."),oi.forEach(n),so=p(Pt),w($e.$$.fragment,Pt),Pt.forEach(n),O.forEach(n),$n=p(t),re=s(t,"H2",{class:!0});var zn=o(re);ke=s(zn,"A",{id:!0,class:!0,href:!0});var ii=o(ke);on=s(ii,"SPAN",{});var li=o(on);w(lt.$$.fragment,li),li.forEach(n),ii.forEach(n),oo=p(zn),ln=s(zn,"SPAN",{});var ri=o(ln);io=l(ri,"FlaxStableDiffusionPipelineOutput"),ri.forEach(n),zn.forEach(n),kn=p(t),z=s(t,"DIV",{class:!0});var Ut=o(z);w(rt.$$.fragment,Ut),lo=p(Ut),rn=s(Ut,"P",{});var di=o(rn);ro=l(di,"Output class for Flax-based Stable Diffusion pipelines."),di.forEach(n),po=p(Ut),Te=s(Ut,"DIV",{class:!0});var Yn=o(Te);w(dt.$$.fragment,Yn),co=p(Yn),dn=s(Yn,"P",{});var pi=o(dn);fo=l(pi,"\u201CReturns a new object replacing the specified fields with new values."),pi.forEach(n),Yn.forEach(n),Ut.forEach(n),this.h()},h(){f(c,"name","hf:doc:metadata"),f(c,"content",JSON.stringify(Ji)),f(u,"id","inpainting"),f(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(u,"href","#inpainting"),f(m,"class","relative group"),f(S,"id","tips"),f(S,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(S,"href","#tips"),f(F,"class","relative group"),f(Q,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),f(Q,"rel","nofollow"),f(Ue,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),f(Ue,"rel","nofollow"),f(fe,"id","diffusers.StableDiffusionInpaintPipeline"),f(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(fe,"href","#diffusers.StableDiffusionInpaintPipeline"),f(te,"class","relative group"),f(mt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f(gt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),f(bt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),f(vt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ce,"href","https://facebookresearch.github.io/xformers/"),f(Ce,"rel","nofollow"),f(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ve,"href","https://facebookresearch.github.io/xformers/"),f(Ve,"rel","nofollow"),f(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(wt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),f(Qe,"href","https://civitai.com/models/3036?modelVersionId=9857"),f(Qe,"rel","nofollow"),f(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(xt,"href","/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),f(Mt,"href","/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),f(It,"href","/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),f(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Me,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),f(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Me,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),f(oe,"class","relative group"),f(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ie,"id","diffusers.FlaxStableDiffusionInpaintPipeline"),f(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ie,"href","#diffusers.FlaxStableDiffusionInpaintPipeline"),f(le,"class","relative group"),f(Jt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),f(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ke,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),f(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(ke,"href","#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),f(re,"class","relative group"),f(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,c),_(t,b,g),_(t,m,g),e(m,u),e(u,y),x(r,y,null),e(m,h),e(m,K),e(K,C),_(t,de,g),_(t,Y,g),e(Y,R),_(t,pe,g),_(t,F,g),e(F,S),e(S,ee),x(L,ee,null),e(F,U),e(F,E),e(E,ft),_(t,W,g),_(t,G,g),e(G,ut),e(G,Q),e(Q,Qn),e(G,Hn),e(G,Ue),e(Ue,qn),e(G,On),_(t,yn,g),x(ce,t,g),_(t,vn,g),_(t,te,g),e(te,fe),e(fe,Zt),x(je,Zt,null),e(te,Kn),e(te,Et),e(Et,ea),_(t,wn,g),_(t,$,g),x(Ze,$,null),e($,ta),e($,Ft),e(Ft,na),e($,aa),e($,Ee),e(Ee,sa),e(Ee,mt),e(mt,oa),e(Ee,ia),e($,la),e($,Wt),e(Wt,ra),e($,da),e($,ne),e(ne,ht),e(ht,gt),e(gt,pa),e(ht,ca),e(ne,fa),e(ne,_t),e(_t,bt),e(bt,ua),e(_t,ma),e(ne,ha),e(ne,yt),e(yt,vt),e(vt,ga),e(yt,_a),e($,ba),e($,H),x(Fe,H,null),e(H,ya),e(H,Gt),e(Gt,va),e(H,wa),x(ue,H,null),e($,xa),e($,me),x(We,me,null),e(me,Ma),e(me,Nt),e(Nt,Ia),e($,Ja),e($,he),x(Ge,he,null),e(he,$a),e(he,Ne),e(Ne,ka),e(Ne,Bt),e(Bt,Ta),e(Ne,Sa),e($,Da),e($,N),x(Be,N,null),e(N,Pa),e(N,Xe),e(Xe,Ua),e(Xe,Ce),e(Ce,ja),e(Xe,Za),e(N,Ea),x(ge,N,null),e(N,Fa),x(_e,N,null),e($,Wa),e($,be),x(Re,be,null),e(be,Ga),e(be,Le),e(Le,Na),e(Le,Ve),e(Ve,Ba),e(Le,Xa),e($,Ca),e($,D),x(Ae,D,null),e(D,Ra),e(D,ze),e(ze,La),e(ze,wt),e(wt,Va),e(ze,Aa),e(D,za),e(D,Xt),e(Xt,Ya),e(D,Qa),x(ye,D,null),e(D,Ha),e(D,Ye),e(Ye,qa),e(Ye,Qe),e(Qe,Oa),e(Ye,Ka),e(D,es),x(ve,D,null),e($,ts),e($,P),x(He,P,null),e(P,ns),e(P,V),e(V,as),e(V,Ct),e(Ct,ss),e(V,os),e(V,Rt),e(Rt,is),e(V,ls),e(V,Lt),e(Lt,rs),e(V,ds),e(P,ps),e(P,qe),e(qe,cs),e(qe,Vt),e(Vt,fs),e(qe,us),e(P,ms),e(P,Oe),e(Oe,hs),e(Oe,xt),e(xt,gs),e(Oe,_s),e(P,bs),e(P,ae),e(ae,ys),e(ae,Mt),e(Mt,vs),e(ae,ws),e(ae,At),e(At,xs),e(ae,Ms),e(P,Is),e(P,se),e(se,Js),e(se,It),e(It,$s),e(se,ks),e(se,zt),e(zt,Ts),e(se,Ss),e($,Ds),e($,we),x(Ke,we,null),e(we,Ps),e(we,Yt),e(Yt,Us),e($,js),e($,xe),x(et,xe,null),e(xe,Zs),e(xe,A),e(A,Es),e(A,Qt),e(Qt,Fs),e(A,Ws),e(A,Ht),e(Ht,Gs),e(A,Ns),e(A,qt),e(qt,Bs),e(A,Xs),_(t,xn,g),_(t,oe,g),e(oe,Me),e(Me,Ot),x(tt,Ot,null),e(oe,Cs),e(oe,Kt),e(Kt,Rs),_(t,Mn,g),_(t,ie,g),x(nt,ie,null),e(ie,Ls),e(ie,en),e(en,Vs),_(t,In,g),_(t,le,g),e(le,Ie),e(Ie,tn),x(at,tn,null),e(le,As),e(le,nn),e(nn,zs),_(t,Jn,g),_(t,j,g),x(st,j,null),e(j,Ys),e(j,an),e(an,Qs),e(j,Hs),x(Je,j,null),e(j,qs),e(j,ot),e(ot,Os),e(ot,Jt),e(Jt,Ks),e(ot,eo),e(j,to),e(j,q),x(it,q,null),e(q,no),e(q,sn),e(sn,ao),e(q,so),x($e,q,null),_(t,$n,g),_(t,re,g),e(re,ke),e(ke,on),x(lt,on,null),e(re,oo),e(re,ln),e(ln,io),_(t,kn,g),_(t,z,g),x(rt,z,null),e(z,lo),e(z,rn),e(rn,ro),e(z,po),e(z,Te),x(dt,Te,null),e(Te,co),e(Te,dn),e(dn,fo),Tn=!0},p(t,[g]){const pt={};g&2&&(pt.$$scope={dirty:g,ctx:t}),ce.$set(pt);const pn={};g&2&&(pn.$$scope={dirty:g,ctx:t}),ue.$set(pn);const cn={};g&2&&(cn.$$scope={dirty:g,ctx:t}),ge.$set(cn);const fn={};g&2&&(fn.$$scope={dirty:g,ctx:t}),_e.$set(fn);const un={};g&2&&(un.$$scope={dirty:g,ctx:t}),ye.$set(un);const ct={};g&2&&(ct.$$scope={dirty:g,ctx:t}),ve.$set(ct);const mn={};g&2&&(mn.$$scope={dirty:g,ctx:t}),Je.$set(mn);const hn={};g&2&&(hn.$$scope={dirty:g,ctx:t}),$e.$set(hn)},i(t){Tn||(M(r.$$.fragment,t),M(L.$$.fragment,t),M(ce.$$.fragment,t),M(je.$$.fragment,t),M(Ze.$$.fragment,t),M(Fe.$$.fragment,t),M(ue.$$.fragment,t),M(We.$$.fragment,t),M(Ge.$$.fragment,t),M(Be.$$.fragment,t),M(ge.$$.fragment,t),M(_e.$$.fragment,t),M(Re.$$.fragment,t),M(Ae.$$.fragment,t),M(ye.$$.fragment,t),M(ve.$$.fragment,t),M(He.$$.fragment,t),M(Ke.$$.fragment,t),M(et.$$.fragment,t),M(tt.$$.fragment,t),M(nt.$$.fragment,t),M(at.$$.fragment,t),M(st.$$.fragment,t),M(Je.$$.fragment,t),M(it.$$.fragment,t),M($e.$$.fragment,t),M(lt.$$.fragment,t),M(rt.$$.fragment,t),M(dt.$$.fragment,t),Tn=!0)},o(t){I(r.$$.fragment,t),I(L.$$.fragment,t),I(ce.$$.fragment,t),I(je.$$.fragment,t),I(Ze.$$.fragment,t),I(Fe.$$.fragment,t),I(ue.$$.fragment,t),I(We.$$.fragment,t),I(Ge.$$.fragment,t),I(Be.$$.fragment,t),I(ge.$$.fragment,t),I(_e.$$.fragment,t),I(Re.$$.fragment,t),I(Ae.$$.fragment,t),I(ye.$$.fragment,t),I(ve.$$.fragment,t),I(He.$$.fragment,t),I(Ke.$$.fragment,t),I(et.$$.fragment,t),I(tt.$$.fragment,t),I(nt.$$.fragment,t),I(at.$$.fragment,t),I(st.$$.fragment,t),I(Je.$$.fragment,t),I(it.$$.fragment,t),I($e.$$.fragment,t),I(lt.$$.fragment,t),I(rt.$$.fragment,t),I(dt.$$.fragment,t),Tn=!1},d(t){n(c),t&&n(b),t&&n(m),J(r),t&&n(de),t&&n(Y),t&&n(pe),t&&n(F),J(L),t&&n(W),t&&n(G),t&&n(yn),J(ce,t),t&&n(vn),t&&n(te),J(je),t&&n(wn),t&&n($),J(Ze),J(Fe),J(ue),J(We),J(Ge),J(Be),J(ge),J(_e),J(Re),J(Ae),J(ye),J(ve),J(He),J(Ke),J(et),t&&n(xn),t&&n(oe),J(tt),t&&n(Mn),t&&n(ie),J(nt),t&&n(In),t&&n(le),J(at),t&&n(Jn),t&&n(j),J(st),J(Je),J(it),J($e),t&&n($n),t&&n(re),J(lt),t&&n(kn),t&&n(z),J(rt),J(dt)}}}const Ji={local:"inpainting",sections:[{local:"tips",title:"Tips"},{local:"diffusers.StableDiffusionInpaintPipeline",title:"StableDiffusionInpaintPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"},{local:"diffusers.FlaxStableDiffusionInpaintPipeline",title:"FlaxStableDiffusionInpaintPipeline"},{local:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",title:"FlaxStableDiffusionPipelineOutput"}],title:"Inpainting"};function $i(T){return hi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ji extends ci{constructor(c){super();fi(this,c,$i,Ii,ui,{})}}export{ji as default,Ji as metadata};
