import{S as ni,i as ai,s as oi,e as a,k as c,w as x,t as i,M as si,c as o,d as t,m as p,a as s,x as M,h as l,b as f,G as e,g as w,y as I,q as T,o as J,B as k,v as ii,L as Ht}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as ei}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as E}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as Ot}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ti}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as qt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function li(U){let d,v,u,m,y,r,h,L;return{c(){d=a("p"),v=i(`It is recommended to use this pipeline with checkpoints that have been specifically fine-tuned for inpainting, such
as `),u=a("a"),m=i("runwayml/stable-diffusion-inpainting"),y=i(`. Default
text-to-image stable diffusion checkpoints, such as
`),r=a("a"),h=i("runwayml/stable-diffusion-v1-5"),L=i(` are also compatible with
this pipeline, but might be less performant.`),this.h()},l(Y){d=o(Y,"P",{});var $=s(d);v=l($,`It is recommended to use this pipeline with checkpoints that have been specifically fine-tuned for inpainting, such
as `),u=o($,"A",{href:!0,rel:!0});var W=s(u);m=l(W,"runwayml/stable-diffusion-inpainting"),W.forEach(t),y=l($,`. Default
text-to-image stable diffusion checkpoints, such as
`),r=o($,"A",{href:!0,rel:!0});var N=s(r);h=l(N,"runwayml/stable-diffusion-v1-5"),N.forEach(t),L=l($,` are also compatible with
this pipeline, but might be less performant.`),$.forEach(t),this.h()},h(){f(u,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),f(u,"rel","nofollow"),f(r,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),f(r,"rel","nofollow")},m(Y,$){w(Y,d,$),e(d,v),e(d,u),e(u,m),e(d,y),e(d,r),e(r,h),e(d,L)},d(Y){Y&&t(d)}}}function ri(U){let d,v,u,m,y;return m=new Ot({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(){d=a("p"),v=i("Examples:"),u=c(),x(m.$$.fragment)},l(r){d=o(r,"P",{});var h=s(d);v=l(h,"Examples:"),h.forEach(t),u=p(r),M(m.$$.fragment,r)},m(r,h){w(r,d,h),e(d,v),w(r,u,h),I(m,r,h),y=!0},p:Ht,i(r){y||(T(m.$$.fragment,r),y=!0)},o(r){J(m.$$.fragment,r),y=!1},d(r){r&&t(d),r&&t(u),k(m,r)}}}function di(U){let d,v;return{c(){d=a("p"),v=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(u){d=o(u,"P",{});var m=s(d);v=l(m,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),m.forEach(t)},m(u,m){w(u,d,m),e(d,v)},d(u){u&&t(d)}}}function ci(U){let d,v,u,m,y;return m=new Ot({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(){d=a("p"),v=i("Examples:"),u=c(),x(m.$$.fragment)},l(r){d=o(r,"P",{});var h=s(d);v=l(h,"Examples:"),h.forEach(t),u=p(r),M(m.$$.fragment,r)},m(r,h){w(r,d,h),e(d,v),w(r,u,h),I(m,r,h),y=!0},p:Ht,i(r){y||(T(m.$$.fragment,r),y=!0)},o(r){J(m.$$.fragment,r),y=!1},d(r){r&&t(d),r&&t(u),k(m,r)}}}function pi(U){let d,v,u,m,y;return m=new Ot({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(){d=a("p"),v=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=c(),x(m.$$.fragment)},l(r){d=o(r,"P",{});var h=s(d);v=l(h,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),h.forEach(t),u=p(r),M(m.$$.fragment,r)},m(r,h){w(r,d,h),e(d,v),w(r,u,h),I(m,r,h),y=!0},p:Ht,i(r){y||(T(m.$$.fragment,r),y=!0)},o(r){J(m.$$.fragment,r),y=!1},d(r){r&&t(d),r&&t(u),k(m,r)}}}function fi(U){let d,v,u,m,y;return m=new Ot({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(){d=a("p"),v=i("locally:"),u=c(),x(m.$$.fragment)},l(r){d=o(r,"P",{});var h=s(d);v=l(h,"locally:"),h.forEach(t),u=p(r),M(m.$$.fragment,r)},m(r,h){w(r,d,h),e(d,v),w(r,u,h),I(m,r,h),y=!0},p:Ht,i(r){y||(T(m.$$.fragment,r),y=!0)},o(r){J(m.$$.fragment,r),y=!1},d(r){r&&t(d),r&&t(u),k(m,r)}}}function mi(U){let d,v,u,m,y;return m=new Ot({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(){d=a("p"),v=i("Examples:"),u=c(),x(m.$$.fragment)},l(r){d=o(r,"P",{});var h=s(d);v=l(h,"Examples:"),h.forEach(t),u=p(r),M(m.$$.fragment,r)},m(r,h){w(r,d,h),e(d,v),w(r,u,h),I(m,r,h),y=!0},p:Ht,i(r){y||(T(m.$$.fragment,r),y=!0)},o(r){J(m.$$.fragment,r),y=!1},d(r){r&&t(d),r&&t(u),k(m,r)}}}function ui(U){let d,v,u,m,y,r,h,L,Y,$,W,N,ht,pe,$n,gt,Pn,Kt,S,Zn,fe,En,Wn,me,Fn,Gn,ue,Nn,Cn,he,Bn,Xn,tt,Vn,Rn,en,nt,Ln,tn,Q,ge,_t,Yn,zn,_e,An,Qn,be,bt,qn,Hn,ye,On,nn,at,Kn,an,q,ve,yt,ea,ta,we,na,aa,xe,vt,oa,sa,Me,ia,on,g,Ie,la,wt,ra,da,Te,ca,ot,pa,fa,ma,xt,ua,ha,Je,ke,Mt,ga,_a,st,ba,ya,Ue,It,va,wa,it,xa,Ma,Tt,Ia,Ta,Jt,Se,kt,Ja,ka,lt,Ua,Sa,H,Da,C,De,ja,Ut,$a,Pa,O,Za,B,je,Ea,St,Wa,Fa,Dt,Ga,Na,K,$e,Ca,Pe,Ba,jt,Xa,Va,Ra,j,Ze,La,Ee,Ya,We,za,Aa,Qa,$t,qa,Ha,ee,Oa,te,Ka,ne,Fe,eo,Ge,to,Ne,no,ao,oo,D,Ce,so,Be,io,rt,lo,ro,co,Pt,po,fo,ae,mo,Xe,uo,Ve,ho,go,_o,oe,bo,se,Re,yo,z,vo,dt,wo,xo,Le,Zt,Mo,Io,To,ie,Ye,Jo,Et,ko,Uo,le,ze,So,P,Do,Wt,jo,$o,Ft,Po,Zo,Gt,Eo,Wo,Nt,Fo,Go,No,re,Ae,Co,A,Bo,Ct,Xo,Vo,Bt,Ro,Lo,sn,Z,Qe,Yo,qe,zo,Xt,Ao,Qo,qo,He,Ho,Vt,Oo,Ko,es,X,Oe,ts,Rt,ns,as,de,ln;return r=new ti({}),pe=new ti({}),Ie=new E({props:{name:"class diffusers.StableDiffusionInpaintPipeline",anchor:"diffusers.StableDiffusionInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{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> (<a href="/docs/diffusers/v0.18.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#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. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.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.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.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 details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L156"}}),H=new ei({props:{$$slots:{default:[li]},$$scope:{ctx:U}}}),De=new E({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 the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,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 which will be inpainted, <em>i.e.</em> parts of the image will
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 will be
repainted, while black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be 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 self.unet.config.sample_size * self.vae_scale_factor) &#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 self.unet.config.sample_size * self.vae_scale_factor) &#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.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger 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 will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <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.`,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;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,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 not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code>. instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code>
is less than <code>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;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</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 will ge 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, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <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, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <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 generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.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.18.0/en/api/pipelines/stable_diffusion/overview#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 will be called every <code>callback_steps</code> steps during inference. The function will be
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 will be called. If not specified, the callback will be
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 under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L742",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),O=new qt({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.example",$$slots:{default:[ri]},$$scope:{ctx:U}}}),je=new E({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.18.0/src/diffusers/pipelines/pipeline_utils.py#L1461"}}),$e=new E({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/pipeline_utils.py#L1477"}}),Ze=new E({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.18.0/src/diffusers/pipelines/pipeline_utils.py#L1399"}}),ee=new ei({props:{warning:!0,$$slots:{default:[di]},$$scope:{ctx:U}}}),te=new qt({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[ci]},$$scope:{ctx:U}}}),Fe=new E({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionInpaintPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/pipeline_utils.py#L1435"}}),Ce=new E({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.18.0/src/diffusers/loaders.py#L469"}}),ae=new qt({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.example",$$slots:{default:[pi]},$$scope:{ctx:U}}}),oe=new qt({props:{anchor:"diffusers.StableDiffusionInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[fi]},$$scope:{ctx:U}}}),Re=new E({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;
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/v0.18.0/en/api/models/overview#diffusers.ModelMixin.save_pretrained">ModelMixin.save_pretrained()</a>.</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_or_dict"},{anchor:"diffusers.StableDiffusionInpaintPipeline.load_lora_weights.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_lora_weights.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_lora_weights.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_lora_weights.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_lora_weights.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_lora_weights.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_lora_weights.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_lora_weights.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_lora_weights.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.18.0/src/diffusers/loaders.py#L746"}}),Ye=new E({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 UNet.`,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] or </code>Dict[str, torch.Tensor]<code>) -- State dict of the LoRA layers corresponding to the </code>text_encoder`. Must explicitly pass the text\nencoder LoRA state dict because it comes &#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.18.0/src/diffusers/loaders.py#L1150"}}),ze=new E({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.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L324"}}),Ae=new E({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionInpaintPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L298"}}),Qe=new E({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.18.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> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.0/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.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 details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py#L102"}}),Oe=new E({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 the image generation.`,name:"prompt"},{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#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 self.unet.config.sample_size * self.vae_scale_factor) &#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.`,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;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,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. tensor will ge 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. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,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 <code>FlaxStableDiffusionPipelineOutput</code> instead of
a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py#L389",returnDescription:`
<p><code>FlaxStableDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>FlaxStableDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),de=new qt({props:{anchor:"diffusers.FlaxStableDiffusionInpaintPipeline.__call__.example",$$slots:{default:[mi]},$$scope:{ctx:U}}}),{c(){d=a("meta"),v=c(),u=a("h1"),m=a("a"),y=a("span"),x(r.$$.fragment),h=c(),L=a("span"),Y=i("Text-Guided Image Inpainting"),$=c(),W=a("h2"),N=a("a"),ht=a("span"),x(pe.$$.fragment),$n=c(),gt=a("span"),Pn=i("StableDiffusionInpaintPipeline"),Kt=c(),S=a("p"),Zn=i("The Stable Diffusion model was created by the researchers and engineers from "),fe=a("a"),En=i("CompVis"),Wn=i(", "),me=a("a"),Fn=i("Stability AI"),Gn=i(", "),ue=a("a"),Nn=i("runway"),Cn=i(", and "),he=a("a"),Bn=i("LAION"),Xn=i(". The "),tt=a("a"),Vn=i("StableDiffusionInpaintPipeline"),Rn=i(" lets you edit specific parts of an image by providing a mask and a text prompt using Stable Diffusion."),en=c(),nt=a("p"),Ln=i("The original codebase can be found here:"),tn=c(),Q=a("ul"),ge=a("li"),_t=a("em"),Yn=i("Stable Diffusion V1"),zn=i(": "),_e=a("a"),An=i("CampVis/stable-diffusion"),Qn=c(),be=a("li"),bt=a("em"),qn=i("Stable Diffusion V2"),Hn=i(": "),ye=a("a"),On=i("Stability-AI/stablediffusion"),nn=c(),at=a("p"),Kn=i("Available checkpoints are:"),an=c(),q=a("ul"),ve=a("li"),yt=a("em"),ea=i("stable-diffusion-inpainting (512x512 resolution)"),ta=i(": "),we=a("a"),na=i("runwayml/stable-diffusion-inpainting"),aa=c(),xe=a("li"),vt=a("em"),oa=i("stable-diffusion-2-inpainting (512x512 resolution)"),sa=i(": "),Me=a("a"),ia=i("stabilityai/stable-diffusion-2-inpainting"),on=c(),g=a("div"),x(Ie.$$.fragment),la=c(),wt=a("p"),ra=i("Pipeline for text-guided image inpainting using Stable Diffusion."),da=c(),Te=a("p"),ca=i("This model inherits from "),ot=a("a"),pa=i("DiffusionPipeline"),fa=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),ma=c(),xt=a("p"),ua=i("In addition the pipeline inherits the following loading methods:"),ha=c(),Je=a("ul"),ke=a("li"),Mt=a("em"),ga=i("Textual-Inversion"),_a=i(": "),st=a("a"),ba=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),ya=c(),Ue=a("li"),It=a("em"),va=i("LoRA"),wa=i(": "),it=a("a"),xa=i("loaders.LoraLoaderMixin.load_lora_weights()"),Ma=c(),Tt=a("p"),Ia=i("as well as the following saving methods:"),Ta=c(),Jt=a("ul"),Se=a("li"),kt=a("em"),Ja=i("LoRA"),ka=i(": "),lt=a("a"),Ua=i("loaders.LoraLoaderMixin.save_lora_weights()"),Sa=c(),x(H.$$.fragment),Da=c(),C=a("div"),x(De.$$.fragment),ja=c(),Ut=a("p"),$a=i("Function invoked when calling the pipeline for generation."),Pa=c(),x(O.$$.fragment),Za=c(),B=a("div"),x(je.$$.fragment),Ea=c(),St=a("p"),Wa=i("Enable sliced attention computation."),Fa=c(),Dt=a("p"),Ga=i(`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.`),Na=c(),K=a("div"),x($e.$$.fragment),Ca=c(),Pe=a("p"),Ba=i("Disable sliced attention computation. If "),jt=a("code"),Xa=i("enable_attention_slicing"),Va=i(` was previously called, attention is
computed in one step.`),Ra=c(),j=a("div"),x(Ze.$$.fragment),La=c(),Ee=a("p"),Ya=i("Enable memory efficient attention from "),We=a("a"),za=i("xFormers"),Aa=i("."),Qa=c(),$t=a("p"),qa=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.`),Ha=c(),x(ee.$$.fragment),Oa=c(),x(te.$$.fragment),Ka=c(),ne=a("div"),x(Fe.$$.fragment),eo=c(),Ge=a("p"),to=i("Disable memory efficient attention from "),Ne=a("a"),no=i("xFormers"),ao=i("."),oo=c(),D=a("div"),x(Ce.$$.fragment),so=c(),Be=a("p"),io=i("Load textual inversion embeddings into the text encoder of "),rt=a("a"),lo=i("StableDiffusionPipeline"),ro=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),co=c(),Pt=a("p"),po=i("Example:"),fo=c(),x(ae.$$.fragment),mo=c(),Xe=a("p"),uo=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ve=a("a"),ho=i("civitAI"),go=i(") and then load the vector"),_o=c(),x(oe.$$.fragment),bo=c(),se=a("div"),x(Re.$$.fragment),yo=c(),z=a("p"),vo=i("Load pretrained LoRA attention processor layers into "),dt=a("a"),wo=i("UNet2DConditionModel"),xo=i(` and
`),Le=a("a"),Zt=a("code"),Mo=i("CLIPTextModel"),Io=i("."),To=c(),ie=a("div"),x(Ye.$$.fragment),Jo=c(),Et=a("p"),ko=i("Save the LoRA parameters corresponding to the UNet and text encoder."),Uo=c(),le=a("div"),x(ze.$$.fragment),So=c(),P=a("p"),Do=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Wt=a("code"),jo=i("enable_sequential_cpu_offload"),$o=i(", this method moves one whole model at a time to the GPU when its "),Ft=a("code"),Po=i("forward"),Zo=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Gt=a("code"),Eo=i("enable_sequential_cpu_offload"),Wo=i(", but performance is much better due to the iterative execution of the "),Nt=a("code"),Fo=i("unet"),Go=i("."),No=c(),re=a("div"),x(Ae.$$.fragment),Co=c(),A=a("p"),Bo=i(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Ct=a("code"),Xo=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Vo=i("forward"),Bt=a("code"),Ro=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Lo=i("enable_model_cpu_offload`, but performance is lower."),sn=c(),Z=a("div"),x(Qe.$$.fragment),Yo=c(),qe=a("p"),zo=i("Pipeline for text-guided image inpainting using Stable Diffusion. "),Xt=a("em"),Ao=i("This is an experimental feature"),Qo=i("."),qo=c(),He=a("p"),Ho=i("This model inherits from "),Vt=a("code"),Oo=i("FlaxDiffusionPipeline"),Ko=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),es=c(),X=a("div"),x(Oe.$$.fragment),ts=c(),Rt=a("p"),ns=i("Function invoked when calling the pipeline for generation."),as=c(),x(de.$$.fragment),this.h()},l(n){const _=si('[data-svelte="svelte-1phssyn"]',document.head);d=o(_,"META",{name:!0,content:!0}),_.forEach(t),v=p(n),u=o(n,"H1",{class:!0});var Ke=s(u);m=o(Ke,"A",{id:!0,class:!0,href:!0});var Lt=s(m);y=o(Lt,"SPAN",{});var Yt=s(y);M(r.$$.fragment,Yt),Yt.forEach(t),Lt.forEach(t),h=p(Ke),L=o(Ke,"SPAN",{});var zt=s(L);Y=l(zt,"Text-Guided Image Inpainting"),zt.forEach(t),Ke.forEach(t),$=p(n),W=o(n,"H2",{class:!0});var et=s(W);N=o(et,"A",{id:!0,class:!0,href:!0});var At=s(N);ht=o(At,"SPAN",{});var Qt=s(ht);M(pe.$$.fragment,Qt),Qt.forEach(t),At.forEach(t),$n=p(et),gt=o(et,"SPAN",{});var os=s(gt);Pn=l(os,"StableDiffusionInpaintPipeline"),os.forEach(t),et.forEach(t),Kt=p(n),S=o(n,"P",{});var F=s(S);Zn=l(F,"The Stable Diffusion model was created by the researchers and engineers from "),fe=o(F,"A",{href:!0,rel:!0});var ss=s(fe);En=l(ss,"CompVis"),ss.forEach(t),Wn=l(F,", "),me=o(F,"A",{href:!0,rel:!0});var is=s(me);Fn=l(is,"Stability AI"),is.forEach(t),Gn=l(F,", "),ue=o(F,"A",{href:!0,rel:!0});var ls=s(ue);Nn=l(ls,"runway"),ls.forEach(t),Cn=l(F,", and "),he=o(F,"A",{href:!0,rel:!0});var rs=s(he);Bn=l(rs,"LAION"),rs.forEach(t),Xn=l(F,". The "),tt=o(F,"A",{href:!0});var ds=s(tt);Vn=l(ds,"StableDiffusionInpaintPipeline"),ds.forEach(t),Rn=l(F," lets you edit specific parts of an image by providing a mask and a text prompt using Stable Diffusion."),F.forEach(t),en=p(n),nt=o(n,"P",{});var cs=s(nt);Ln=l(cs,"The original codebase can be found here:"),cs.forEach(t),tn=p(n),Q=o(n,"UL",{});var rn=s(Q);ge=o(rn,"LI",{});var dn=s(ge);_t=o(dn,"EM",{});var ps=s(_t);Yn=l(ps,"Stable Diffusion V1"),ps.forEach(t),zn=l(dn,": "),_e=o(dn,"A",{href:!0,rel:!0});var fs=s(_e);An=l(fs,"CampVis/stable-diffusion"),fs.forEach(t),dn.forEach(t),Qn=p(rn),be=o(rn,"LI",{});var cn=s(be);bt=o(cn,"EM",{});var ms=s(bt);qn=l(ms,"Stable Diffusion V2"),ms.forEach(t),Hn=l(cn,": "),ye=o(cn,"A",{href:!0,rel:!0});var us=s(ye);On=l(us,"Stability-AI/stablediffusion"),us.forEach(t),cn.forEach(t),rn.forEach(t),nn=p(n),at=o(n,"P",{});var hs=s(at);Kn=l(hs,"Available checkpoints are:"),hs.forEach(t),an=p(n),q=o(n,"UL",{});var pn=s(q);ve=o(pn,"LI",{});var fn=s(ve);yt=o(fn,"EM",{});var gs=s(yt);ea=l(gs,"stable-diffusion-inpainting (512x512 resolution)"),gs.forEach(t),ta=l(fn,": "),we=o(fn,"A",{href:!0,rel:!0});var _s=s(we);na=l(_s,"runwayml/stable-diffusion-inpainting"),_s.forEach(t),fn.forEach(t),aa=p(pn),xe=o(pn,"LI",{});var mn=s(xe);vt=o(mn,"EM",{});var bs=s(vt);oa=l(bs,"stable-diffusion-2-inpainting (512x512 resolution)"),bs.forEach(t),sa=l(mn,": "),Me=o(mn,"A",{href:!0,rel:!0});var ys=s(Me);ia=l(ys,"stabilityai/stable-diffusion-2-inpainting"),ys.forEach(t),mn.forEach(t),pn.forEach(t),on=p(n),g=o(n,"DIV",{class:!0});var b=s(g);M(Ie.$$.fragment,b),la=p(b),wt=o(b,"P",{});var vs=s(wt);ra=l(vs,"Pipeline for text-guided image inpainting using Stable Diffusion."),vs.forEach(t),da=p(b),Te=o(b,"P",{});var un=s(Te);ca=l(un,"This model inherits from "),ot=o(un,"A",{href:!0});var ws=s(ot);pa=l(ws,"DiffusionPipeline"),ws.forEach(t),fa=l(un,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),un.forEach(t),ma=p(b),xt=o(b,"P",{});var xs=s(xt);ua=l(xs,"In addition the pipeline inherits the following loading methods:"),xs.forEach(t),ha=p(b),Je=o(b,"UL",{});var hn=s(Je);ke=o(hn,"LI",{});var gn=s(ke);Mt=o(gn,"EM",{});var Ms=s(Mt);ga=l(Ms,"Textual-Inversion"),Ms.forEach(t),_a=l(gn,": "),st=o(gn,"A",{href:!0});var Is=s(st);ba=l(Is,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Is.forEach(t),gn.forEach(t),ya=p(hn),Ue=o(hn,"LI",{});var _n=s(Ue);It=o(_n,"EM",{});var Ts=s(It);va=l(Ts,"LoRA"),Ts.forEach(t),wa=l(_n,": "),it=o(_n,"A",{href:!0});var Js=s(it);xa=l(Js,"loaders.LoraLoaderMixin.load_lora_weights()"),Js.forEach(t),_n.forEach(t),hn.forEach(t),Ma=p(b),Tt=o(b,"P",{});var ks=s(Tt);Ia=l(ks,"as well as the following saving methods:"),ks.forEach(t),Ta=p(b),Jt=o(b,"UL",{});var Us=s(Jt);Se=o(Us,"LI",{});var bn=s(Se);kt=o(bn,"EM",{});var Ss=s(kt);Ja=l(Ss,"LoRA"),Ss.forEach(t),ka=l(bn,": "),lt=o(bn,"A",{href:!0});var Ds=s(lt);Ua=l(Ds,"loaders.LoraLoaderMixin.save_lora_weights()"),Ds.forEach(t),bn.forEach(t),Us.forEach(t),Sa=p(b),M(H.$$.fragment,b),Da=p(b),C=o(b,"DIV",{class:!0});var ct=s(C);M(De.$$.fragment,ct),ja=p(ct),Ut=o(ct,"P",{});var js=s(Ut);$a=l(js,"Function invoked when calling the pipeline for generation."),js.forEach(t),Pa=p(ct),M(O.$$.fragment,ct),ct.forEach(t),Za=p(b),B=o(b,"DIV",{class:!0});var pt=s(B);M(je.$$.fragment,pt),Ea=p(pt),St=o(pt,"P",{});var $s=s(St);Wa=l($s,"Enable sliced attention computation."),$s.forEach(t),Fa=p(pt),Dt=o(pt,"P",{});var Ps=s(Dt);Ga=l(Ps,`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.`),Ps.forEach(t),pt.forEach(t),Na=p(b),K=o(b,"DIV",{class:!0});var yn=s(K);M($e.$$.fragment,yn),Ca=p(yn),Pe=o(yn,"P",{});var vn=s(Pe);Ba=l(vn,"Disable sliced attention computation. If "),jt=o(vn,"CODE",{});var Zs=s(jt);Xa=l(Zs,"enable_attention_slicing"),Zs.forEach(t),Va=l(vn,` was previously called, attention is
computed in one step.`),vn.forEach(t),yn.forEach(t),Ra=p(b),j=o(b,"DIV",{class:!0});var V=s(j);M(Ze.$$.fragment,V),La=p(V),Ee=o(V,"P",{});var wn=s(Ee);Ya=l(wn,"Enable memory efficient attention from "),We=o(wn,"A",{href:!0,rel:!0});var Es=s(We);za=l(Es,"xFormers"),Es.forEach(t),Aa=l(wn,"."),wn.forEach(t),Qa=p(V),$t=o(V,"P",{});var Ws=s($t);qa=l(Ws,`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.`),Ws.forEach(t),Ha=p(V),M(ee.$$.fragment,V),Oa=p(V),M(te.$$.fragment,V),V.forEach(t),Ka=p(b),ne=o(b,"DIV",{class:!0});var xn=s(ne);M(Fe.$$.fragment,xn),eo=p(xn),Ge=o(xn,"P",{});var Mn=s(Ge);to=l(Mn,"Disable memory efficient attention from "),Ne=o(Mn,"A",{href:!0,rel:!0});var Fs=s(Ne);no=l(Fs,"xFormers"),Fs.forEach(t),ao=l(Mn,"."),Mn.forEach(t),xn.forEach(t),oo=p(b),D=o(b,"DIV",{class:!0});var G=s(D);M(Ce.$$.fragment,G),so=p(G),Be=o(G,"P",{});var In=s(Be);io=l(In,"Load textual inversion embeddings into the text encoder of "),rt=o(In,"A",{href:!0});var Gs=s(rt);lo=l(Gs,"StableDiffusionPipeline"),Gs.forEach(t),ro=l(In,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),In.forEach(t),co=p(G),Pt=o(G,"P",{});var Ns=s(Pt);po=l(Ns,"Example:"),Ns.forEach(t),fo=p(G),M(ae.$$.fragment,G),mo=p(G),Xe=o(G,"P",{});var Tn=s(Xe);uo=l(Tn,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ve=o(Tn,"A",{href:!0,rel:!0});var Cs=s(Ve);ho=l(Cs,"civitAI"),Cs.forEach(t),go=l(Tn,") and then load the vector"),Tn.forEach(t),_o=p(G),M(oe.$$.fragment,G),G.forEach(t),bo=p(b),se=o(b,"DIV",{class:!0});var Jn=s(se);M(Re.$$.fragment,Jn),yo=p(Jn),z=o(Jn,"P",{});var ft=s(z);vo=l(ft,"Load pretrained LoRA attention processor layers into "),dt=o(ft,"A",{href:!0});var Bs=s(dt);wo=l(Bs,"UNet2DConditionModel"),Bs.forEach(t),xo=l(ft,` and
`),Le=o(ft,"A",{href:!0,rel:!0});var Xs=s(Le);Zt=o(Xs,"CODE",{});var Vs=s(Zt);Mo=l(Vs,"CLIPTextModel"),Vs.forEach(t),Xs.forEach(t),Io=l(ft,"."),ft.forEach(t),Jn.forEach(t),To=p(b),ie=o(b,"DIV",{class:!0});var kn=s(ie);M(Ye.$$.fragment,kn),Jo=p(kn),Et=o(kn,"P",{});var Rs=s(Et);ko=l(Rs,"Save the LoRA parameters corresponding to the UNet and text encoder."),Rs.forEach(t),kn.forEach(t),Uo=p(b),le=o(b,"DIV",{class:!0});var Un=s(le);M(ze.$$.fragment,Un),So=p(Un),P=o(Un,"P",{});var R=s(P);Do=l(R,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Wt=o(R,"CODE",{});var Ls=s(Wt);jo=l(Ls,"enable_sequential_cpu_offload"),Ls.forEach(t),$o=l(R,", this method moves one whole model at a time to the GPU when its "),Ft=o(R,"CODE",{});var Ys=s(Ft);Po=l(Ys,"forward"),Ys.forEach(t),Zo=l(R,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Gt=o(R,"CODE",{});var zs=s(Gt);Eo=l(zs,"enable_sequential_cpu_offload"),zs.forEach(t),Wo=l(R,", but performance is much better due to the iterative execution of the "),Nt=o(R,"CODE",{});var As=s(Nt);Fo=l(As,"unet"),As.forEach(t),Go=l(R,"."),R.forEach(t),Un.forEach(t),No=p(b),re=o(b,"DIV",{class:!0});var Sn=s(re);M(Ae.$$.fragment,Sn),Co=p(Sn),A=o(Sn,"P",{});var mt=s(A);Bo=l(mt,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Ct=o(mt,"CODE",{});var Qs=s(Ct);Xo=l(Qs,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Qs.forEach(t),Vo=l(mt,"forward"),Bt=o(mt,"CODE",{});var qs=s(Bt);Ro=l(qs,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),qs.forEach(t),Lo=l(mt,"enable_model_cpu_offload`, but performance is lower."),mt.forEach(t),Sn.forEach(t),b.forEach(t),sn=p(n),Z=o(n,"DIV",{class:!0});var ce=s(Z);M(Qe.$$.fragment,ce),Yo=p(ce),qe=o(ce,"P",{});var Dn=s(qe);zo=l(Dn,"Pipeline for text-guided image inpainting using Stable Diffusion. "),Xt=o(Dn,"EM",{});var Hs=s(Xt);Ao=l(Hs,"This is an experimental feature"),Hs.forEach(t),Qo=l(Dn,"."),Dn.forEach(t),qo=p(ce),He=o(ce,"P",{});var jn=s(He);Ho=l(jn,"This model inherits from "),Vt=o(jn,"CODE",{});var Os=s(Vt);Oo=l(Os,"FlaxDiffusionPipeline"),Os.forEach(t),Ko=l(jn,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),jn.forEach(t),es=p(ce),X=o(ce,"DIV",{class:!0});var ut=s(X);M(Oe.$$.fragment,ut),ts=p(ut),Rt=o(ut,"P",{});var Ks=s(Rt);ns=l(Ks,"Function invoked when calling the pipeline for generation."),Ks.forEach(t),as=p(ut),M(de.$$.fragment,ut),ut.forEach(t),ce.forEach(t),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(hi)),f(m,"id","textguided-image-inpainting"),f(m,"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(m,"href","#textguided-image-inpainting"),f(u,"class","relative group"),f(N,"id","diffusers.StableDiffusionInpaintPipeline"),f(N,"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(N,"href","#diffusers.StableDiffusionInpaintPipeline"),f(W,"class","relative group"),f(fe,"href","https://github.com/CompVis"),f(fe,"rel","nofollow"),f(me,"href","https://stability.ai/"),f(me,"rel","nofollow"),f(ue,"href","https://github.com/runwayml"),f(ue,"rel","nofollow"),f(he,"href","https://laion.ai/"),f(he,"rel","nofollow"),f(tt,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline"),f(_e,"href","https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion"),f(_e,"rel","nofollow"),f(ye,"href","https://github.com/Stability-AI/stablediffusion#image-inpainting-with-stable-diffusion"),f(ye,"rel","nofollow"),f(we,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),f(we,"rel","nofollow"),f(Me,"href","https://huggingface.co/stabilityai/stable-diffusion-2-inpainting"),f(Me,"rel","nofollow"),f(ot,"href","/docs/diffusers/v0.18.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),f(st,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),f(it,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_lora_weights"),f(lt,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.save_lora_weights"),f(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(K,"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,"href","https://facebookresearch.github.io/xformers/"),f(We,"rel","nofollow"),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(Ne,"href","https://facebookresearch.github.io/xformers/"),f(Ne,"rel","nofollow"),f(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rt,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),f(Ve,"href","https://civitai.com/models/3036?modelVersionId=9857"),f(Ve,"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(dt,"href","/docs/diffusers/v0.18.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel"),f(Le,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),f(Le,"rel","nofollow"),f(se,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(X,"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(n,_){e(document.head,d),w(n,v,_),w(n,u,_),e(u,m),e(m,y),I(r,y,null),e(u,h),e(u,L),e(L,Y),w(n,$,_),w(n,W,_),e(W,N),e(N,ht),I(pe,ht,null),e(W,$n),e(W,gt),e(gt,Pn),w(n,Kt,_),w(n,S,_),e(S,Zn),e(S,fe),e(fe,En),e(S,Wn),e(S,me),e(me,Fn),e(S,Gn),e(S,ue),e(ue,Nn),e(S,Cn),e(S,he),e(he,Bn),e(S,Xn),e(S,tt),e(tt,Vn),e(S,Rn),w(n,en,_),w(n,nt,_),e(nt,Ln),w(n,tn,_),w(n,Q,_),e(Q,ge),e(ge,_t),e(_t,Yn),e(ge,zn),e(ge,_e),e(_e,An),e(Q,Qn),e(Q,be),e(be,bt),e(bt,qn),e(be,Hn),e(be,ye),e(ye,On),w(n,nn,_),w(n,at,_),e(at,Kn),w(n,an,_),w(n,q,_),e(q,ve),e(ve,yt),e(yt,ea),e(ve,ta),e(ve,we),e(we,na),e(q,aa),e(q,xe),e(xe,vt),e(vt,oa),e(xe,sa),e(xe,Me),e(Me,ia),w(n,on,_),w(n,g,_),I(Ie,g,null),e(g,la),e(g,wt),e(wt,ra),e(g,da),e(g,Te),e(Te,ca),e(Te,ot),e(ot,pa),e(Te,fa),e(g,ma),e(g,xt),e(xt,ua),e(g,ha),e(g,Je),e(Je,ke),e(ke,Mt),e(Mt,ga),e(ke,_a),e(ke,st),e(st,ba),e(Je,ya),e(Je,Ue),e(Ue,It),e(It,va),e(Ue,wa),e(Ue,it),e(it,xa),e(g,Ma),e(g,Tt),e(Tt,Ia),e(g,Ta),e(g,Jt),e(Jt,Se),e(Se,kt),e(kt,Ja),e(Se,ka),e(Se,lt),e(lt,Ua),e(g,Sa),I(H,g,null),e(g,Da),e(g,C),I(De,C,null),e(C,ja),e(C,Ut),e(Ut,$a),e(C,Pa),I(O,C,null),e(g,Za),e(g,B),I(je,B,null),e(B,Ea),e(B,St),e(St,Wa),e(B,Fa),e(B,Dt),e(Dt,Ga),e(g,Na),e(g,K),I($e,K,null),e(K,Ca),e(K,Pe),e(Pe,Ba),e(Pe,jt),e(jt,Xa),e(Pe,Va),e(g,Ra),e(g,j),I(Ze,j,null),e(j,La),e(j,Ee),e(Ee,Ya),e(Ee,We),e(We,za),e(Ee,Aa),e(j,Qa),e(j,$t),e($t,qa),e(j,Ha),I(ee,j,null),e(j,Oa),I(te,j,null),e(g,Ka),e(g,ne),I(Fe,ne,null),e(ne,eo),e(ne,Ge),e(Ge,to),e(Ge,Ne),e(Ne,no),e(Ge,ao),e(g,oo),e(g,D),I(Ce,D,null),e(D,so),e(D,Be),e(Be,io),e(Be,rt),e(rt,lo),e(Be,ro),e(D,co),e(D,Pt),e(Pt,po),e(D,fo),I(ae,D,null),e(D,mo),e(D,Xe),e(Xe,uo),e(Xe,Ve),e(Ve,ho),e(Xe,go),e(D,_o),I(oe,D,null),e(g,bo),e(g,se),I(Re,se,null),e(se,yo),e(se,z),e(z,vo),e(z,dt),e(dt,wo),e(z,xo),e(z,Le),e(Le,Zt),e(Zt,Mo),e(z,Io),e(g,To),e(g,ie),I(Ye,ie,null),e(ie,Jo),e(ie,Et),e(Et,ko),e(g,Uo),e(g,le),I(ze,le,null),e(le,So),e(le,P),e(P,Do),e(P,Wt),e(Wt,jo),e(P,$o),e(P,Ft),e(Ft,Po),e(P,Zo),e(P,Gt),e(Gt,Eo),e(P,Wo),e(P,Nt),e(Nt,Fo),e(P,Go),e(g,No),e(g,re),I(Ae,re,null),e(re,Co),e(re,A),e(A,Bo),e(A,Ct),e(Ct,Xo),e(A,Vo),e(A,Bt),e(Bt,Ro),e(A,Lo),w(n,sn,_),w(n,Z,_),I(Qe,Z,null),e(Z,Yo),e(Z,qe),e(qe,zo),e(qe,Xt),e(Xt,Ao),e(qe,Qo),e(Z,qo),e(Z,He),e(He,Ho),e(He,Vt),e(Vt,Oo),e(He,Ko),e(Z,es),e(Z,X),I(Oe,X,null),e(X,ts),e(X,Rt),e(Rt,ns),e(X,as),I(de,X,null),ln=!0},p(n,[_]){const Ke={};_&2&&(Ke.$$scope={dirty:_,ctx:n}),H.$set(Ke);const Lt={};_&2&&(Lt.$$scope={dirty:_,ctx:n}),O.$set(Lt);const Yt={};_&2&&(Yt.$$scope={dirty:_,ctx:n}),ee.$set(Yt);const zt={};_&2&&(zt.$$scope={dirty:_,ctx:n}),te.$set(zt);const et={};_&2&&(et.$$scope={dirty:_,ctx:n}),ae.$set(et);const At={};_&2&&(At.$$scope={dirty:_,ctx:n}),oe.$set(At);const Qt={};_&2&&(Qt.$$scope={dirty:_,ctx:n}),de.$set(Qt)},i(n){ln||(T(r.$$.fragment,n),T(pe.$$.fragment,n),T(Ie.$$.fragment,n),T(H.$$.fragment,n),T(De.$$.fragment,n),T(O.$$.fragment,n),T(je.$$.fragment,n),T($e.$$.fragment,n),T(Ze.$$.fragment,n),T(ee.$$.fragment,n),T(te.$$.fragment,n),T(Fe.$$.fragment,n),T(Ce.$$.fragment,n),T(ae.$$.fragment,n),T(oe.$$.fragment,n),T(Re.$$.fragment,n),T(Ye.$$.fragment,n),T(ze.$$.fragment,n),T(Ae.$$.fragment,n),T(Qe.$$.fragment,n),T(Oe.$$.fragment,n),T(de.$$.fragment,n),ln=!0)},o(n){J(r.$$.fragment,n),J(pe.$$.fragment,n),J(Ie.$$.fragment,n),J(H.$$.fragment,n),J(De.$$.fragment,n),J(O.$$.fragment,n),J(je.$$.fragment,n),J($e.$$.fragment,n),J(Ze.$$.fragment,n),J(ee.$$.fragment,n),J(te.$$.fragment,n),J(Fe.$$.fragment,n),J(Ce.$$.fragment,n),J(ae.$$.fragment,n),J(oe.$$.fragment,n),J(Re.$$.fragment,n),J(Ye.$$.fragment,n),J(ze.$$.fragment,n),J(Ae.$$.fragment,n),J(Qe.$$.fragment,n),J(Oe.$$.fragment,n),J(de.$$.fragment,n),ln=!1},d(n){t(d),n&&t(v),n&&t(u),k(r),n&&t($),n&&t(W),k(pe),n&&t(Kt),n&&t(S),n&&t(en),n&&t(nt),n&&t(tn),n&&t(Q),n&&t(nn),n&&t(at),n&&t(an),n&&t(q),n&&t(on),n&&t(g),k(Ie),k(H),k(De),k(O),k(je),k($e),k(Ze),k(ee),k(te),k(Fe),k(Ce),k(ae),k(oe),k(Re),k(Ye),k(ze),k(Ae),n&&t(sn),n&&t(Z),k(Qe),k(Oe),k(de)}}}const hi={local:"textguided-image-inpainting",sections:[{local:"diffusers.StableDiffusionInpaintPipeline",title:"StableDiffusionInpaintPipeline"}],title:"Text-Guided Image Inpainting"};function gi(U){return ii(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mi extends ni{constructor(d){super();ai(this,d,gi,ui,oi,{})}}export{Mi as default,hi as metadata};
