import{s as Zt,o as Wt,n as Re}from"../chunks/scheduler.182ea377.js";import{S as Ct,i as Bt,g as d,s as a,r as g,A as Gt,h as p,f as r,c as o,j as k,u,x as w,k as D,y as t,a as f,v as h,d as _,t as b,w as v}from"../chunks/index.abf12888.js";import{T as Nt}from"../chunks/Tip.230e2334.js";import{D as E}from"../chunks/Docstring.93f6f462.js";import{C as ut}from"../chunks/CodeBlock.57fe6e13.js";import{E as gt}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as Le}from"../chunks/Heading.16916d63.js";function Lt(x){let n,m="This is an experimental feature!";return{c(){n=d("p"),n.textContent=m},l(i){n=p(i,"P",{"data-svelte-h":!0}),w(n)!=="svelte-dru17w"&&(n.textContent=m)},m(i,y){f(i,n,y)},p:Re,d(i){i&&r(n)}}}function Rt(x){let n,m;return n=new ut({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlhpYW5nLWNkJTJGRGlmZkVkaXQtc3RhYmxlLWRpZmZ1c2lvbiUyRnJhdyUyRm1haW4lMkZhc3NldHMlMkZvcmlnaW4ucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNzY4JTJDJTIwNzY4KSklMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMERESU1TY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlbGluZS5pbnZlcnNlX3NjaGVkdWxlciUyMCUzRCUyMERESU1JbnZlcnNlU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZWxpbmUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFtYXNrX3Byb21wdCUyMCUzRCUyMCUyMkElMjBib3dsJTIwb2YlMjBmcnVpdHMlMjIlMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwYm93bCUyMG9mJTIwcGVhcnMlMjIlMEElMEFtYXNrX2ltYWdlJTIwJTNEJTIwcGlwZS5nZW5lcmF0ZV9tYXNrKGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHNvdXJjZV9wcm9tcHQlM0Rwcm9tcHQlMkMlMjB0YXJnZXRfcHJvbXB0JTNEbWFza19wcm9tcHQpJTBBaW1hZ2VfbGF0ZW50cyUyMCUzRCUyMHBpcGUuaW52ZXJ0KGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHByb21wdCUzRG1hc2tfcHJvbXB0KS5sYXRlbnRzJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlJTJDJTIwaW1hZ2VfbGF0ZW50cyUzRGltYWdlX2xhdGVudHMpLmltYWdlcyU1QjAlNUQ=",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> StableDiffusionDiffEditPipeline


<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://github.com/Xiang-cd/DiffEdit-stable-diffusion/raw/main/assets/origin.png&quot;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionDiffEditPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&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>pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.inverse_scheduler = DDIMInverseScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>mask_prompt = <span class="hljs-string">&quot;A bowl of fruits&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A bowl of pears&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = pipe.generate_mask(image=init_image, source_prompt=prompt, target_prompt=mask_prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_latents = pipe.invert(image=init_image, prompt=mask_prompt).latents
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt=prompt, mask_image=mask_image, image_latents=image_latents).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){u(n.$$.fragment,i)},m(i,y){h(n,i,y),m=!0},p:Re,i(i){m||(_(n.$$.fragment,i),m=!0)},o(i){b(n.$$.fragment,i),m=!1},d(i){v(n,i)}}}function Xt(x){let n,m;return n=new ut({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlhpYW5nLWNkJTJGRGlmZkVkaXQtc3RhYmxlLWRpZmZ1c2lvbiUyRnJhdyUyRm1haW4lMkZhc3NldHMlMkZvcmlnaW4ucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNzY4JTJDJTIwNzY4KSklMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMERESU1TY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlbGluZS5pbnZlcnNlX3NjaGVkdWxlciUyMCUzRCUyMERESU1JbnZlcnNlU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZWxpbmUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwYm93bCUyMG9mJTIwZnJ1aXRzJTIyJTBBJTBBaW52ZXJ0ZWRfbGF0ZW50cyUyMCUzRCUyMHBpcGUuaW52ZXJ0KGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHByb21wdCUzRHByb21wdCkubGF0ZW50cw==",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> StableDiffusionDiffEditPipeline


<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://github.com/Xiang-cd/DiffEdit-stable-diffusion/raw/main/assets/origin.png&quot;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionDiffEditPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&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>pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.inverse_scheduler = DDIMInverseScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A bowl of fruits&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inverted_latents = pipe.invert(image=init_image, prompt=prompt).latents`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){u(n.$$.fragment,i)},m(i,y){h(n,i,y),m=!0},p:Re,i(i){m||(_(n.$$.fragment,i),m=!0)},o(i){b(n.$$.fragment,i),m=!1},d(i){v(n,i)}}}function Vt(x){let n,m;return n=new ut({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlhpYW5nLWNkJTJGRGlmZkVkaXQtc3RhYmxlLWRpZmZ1c2lvbiUyRnJhdyUyRm1haW4lMkZhc3NldHMlMkZvcmlnaW4ucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNzY4JTJDJTIwNzY4KSklMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMERESU1TY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlbGluZS5pbnZlcnNlX3NjaGVkdWxlciUyMCUzRCUyMERESU1JbnZlcnNlU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZWxpbmUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFtYXNrX3Byb21wdCUyMCUzRCUyMCUyMkElMjBib3dsJTIwb2YlMjBmcnVpdHMlMjIlMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwYm93bCUyMG9mJTIwcGVhcnMlMjIlMEElMEFtYXNrX2ltYWdlJTIwJTNEJTIwcGlwZS5nZW5lcmF0ZV9tYXNrKGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHNvdXJjZV9wcm9tcHQlM0Rwcm9tcHQlMkMlMjB0YXJnZXRfcHJvbXB0JTNEbWFza19wcm9tcHQpJTBBaW1hZ2VfbGF0ZW50cyUyMCUzRCUyMHBpcGUuaW52ZXJ0KGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHByb21wdCUzRG1hc2tfcHJvbXB0KS5sYXRlbnRzJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlJTJDJTIwaW1hZ2VfbGF0ZW50cyUzRGltYWdlX2xhdGVudHMpLmltYWdlcyU1QjAlNUQ=",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> StableDiffusionDiffEditPipeline


<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://github.com/Xiang-cd/DiffEdit-stable-diffusion/raw/main/assets/origin.png&quot;</span>

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

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionDiffEditPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&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>pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.inverse_scheduler = DDIMInverseScheduler.from_config(pipeline.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>mask_prompt = <span class="hljs-string">&quot;A bowl of fruits&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A bowl of pears&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = pipe.generate_mask(image=init_image, source_prompt=prompt, target_prompt=mask_prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_latents = pipe.invert(image=init_image, prompt=mask_prompt).latents
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt=prompt, mask_image=mask_image, image_latents=image_latents).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){u(n.$$.fragment,i)},m(i,y){h(n,i,y),m=!0},p:Re,i(i){m||(_(n.$$.fragment,i),m=!0)},o(i){b(n.$$.fragment,i),m=!1},d(i){v(n,i)}}}function zt(x){let n,m,i,y,R,ke,X,ht='<a href="https://huggingface.co/papers/2210.11427" rel="nofollow">DiffEdit: Diffusion-based semantic image editing with mask guidance</a> is by Guillaume Couairon, Jakob Verbeek, Holger Schwenk, and Matthieu Cord.',De,V,_t="The abstract from the paper is:",xe,z,bt="<em>Image generation has recently seen tremendous advances, with diffusion models allowing to synthesize convincing images for a large variety of text prompts. In this article, we propose DiffEdit, a method to take advantage of text-conditioned diffusion models for the task of semantic image editing, where the goal is to edit an image based on a text query. Semantic image editing is an extension of image generation, with the additional constraint that the generated image should be as similar as possible to a given input image. Current editing methods based on diffusion models usually require to provide a mask, making the task much easier by treating it as a conditional inpainting task. In contrast, our main contribution is able to automatically generate a mask highlighting regions of the input image that need to be edited, by contrasting predictions of a diffusion model conditioned on different text prompts. Moreover, we rely on latent inference to preserve content in those regions of interest and show excellent synergies with mask-based diffusion. DiffEdit achieves state-of-the-art editing performance on ImageNet. In addition, we evaluate semantic image editing in more challenging settings, using images from the COCO dataset as well as text-based generated images.</em>",Te,Y,vt='The original codebase can be found at <a href="https://github.com/Xiang-cd/DiffEdit-stable-diffusion" rel="nofollow">Xiang-cd/DiffEdit-stable-diffusion</a>, and you can try it out in this <a href="https://blog.problemsolversguild.com/technical/research/2022/11/02/DiffEdit-Implementation.html" rel="nofollow">demo</a>.',Me,H,wt='This pipeline was contributed by <a href="https://github.com/clarencechen" rel="nofollow">clarencechen</a>. ❤️',Ie,F,Ee,Q,yt=`<li>The pipeline can generate masks that can be fed into other inpainting pipelines.</li> <li>In order to generate an image using this pipeline, both an image mask (source and target prompts can be manually specified or generated, and passed to <a href="/docs/diffusers/v0.26.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.generate_mask">generate_mask()</a>)
and a set of partially inverted latents (generated using <a href="/docs/diffusers/v0.26.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.invert">invert()</a>) <em>must</em> be provided as arguments when calling the pipeline to generate the final edited image.</li> <li>The function <a href="/docs/diffusers/v0.26.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.generate_mask">generate_mask()</a> exposes two prompt arguments, <code>source_prompt</code> and <code>target_prompt</code>
that let you control the locations of the semantic edits in the final image to be generated. Let’s say,
you wanted to translate from “cat” to “dog”. In this case, the edit direction will be “cat -&gt; dog”. To reflect
this in the generated mask, you simply have to set the embeddings related to the phrases including “cat” to
<code>source_prompt</code> and “dog” to <code>target_prompt</code>.</li> <li>When generating partially inverted latents using <code>invert</code>, assign a caption or text embedding describing the
overall image to the <code>prompt</code> argument to help guide the inverse latent sampling process. In most cases, the
source concept is sufficiently descriptive to yield good results, but feel free to explore alternatives.</li> <li>When calling the pipeline to generate the final edited image, assign the source concept to <code>negative_prompt</code>
and the target concept to <code>prompt</code>. Taking the above example, you simply have to set the embeddings related to
the phrases including “cat” to <code>negative_prompt</code> and “dog” to <code>prompt</code>.</li> <li>If you wanted to reverse the direction in the example above, i.e., “dog -&gt; cat”, then it’s recommended to:<ul><li>Swap the <code>source_prompt</code> and <code>target_prompt</code> in the arguments to <code>generate_mask</code>.</li> <li>Change the input prompt in <a href="/docs/diffusers/v0.26.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.invert">invert()</a> to include “dog”.</li> <li>Swap the <code>prompt</code> and <code>negative_prompt</code> in the arguments to call the pipeline to generate the final edited image.</li></ul></li> <li>The source and target prompts, or their corresponding embeddings, can also be automatically generated. Please refer to the <a href="../../using-diffusers/diffedit">DiffEdit</a> guide for more details.</li>`,Je,A,Se,l,q,Xe,$,Ve,le,kt="Pipeline for text-guided image inpainting using Stable Diffusion and DiffEdit.",ze,de,Dt=`This model inherits from <a href="/docs/diffusers/v0.26.0/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,Ye,pe,xt="The pipeline also inherits the following loading and saving methods:",He,ce,Tt='<li><a href="/docs/diffusers/v0.26.0/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/v0.26.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/v0.26.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li>',Fe,T,O,Qe,fe,Mt="Generate a latent mask given a mask prompt, a target prompt, and an image.",Ae,P,qe,M,K,Oe,me,It="Generate inverted latents given a prompt and image.",Ke,Z,et,I,ee,tt,ge,Et="The call function to the pipeline for generation.",nt,W,it,C,te,st,ue,Jt=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,at,B,ne,ot,he,St=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,rt,G,ie,lt,_e,jt=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,dt,N,se,pt,be,Ut=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,ct,L,ae,ft,ve,$t="Encodes the prompt into text encoder hidden states.",je,oe,Ue,J,re,mt,we,Pt="Output class for Stable Diffusion pipelines.",$e,ye,Pe;return R=new Le({props:{title:"DiffEdit",local:"diffedit",headingTag:"h1"}}),F=new Le({props:{title:"Tips",local:"tips",headingTag:"h2"}}),A=new Le({props:{title:"StableDiffusionDiffEditPipeline",local:"diffusers.StableDiffusionDiffEditPipeline",headingTag:"h2"}}),q=new E({props:{name:"class diffusers.StableDiffusionDiffEditPipeline",anchor:"diffusers.StableDiffusionDiffEditPipeline",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:"inverse_scheduler",val:": DDIMInverseScheduler"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionDiffEditPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.26.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.StableDiffusionDiffEditPipeline.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/v4.38.1/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</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.StableDiffusionDiffEditPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.38.1/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.26.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.StableDiffusionDiffEditPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.26.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.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.inverse_scheduler",description:`<strong>inverse_scheduler</strong> (<a href="/docs/diffusers/v0.26.0/en/api/schedulers/ddim_inverse#diffusers.DDIMInverseScheduler">DDIMInverseScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to fill in the unmasked part of the input latents.`,name:"inverse_scheduler"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.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.StableDiffusionDiffEditPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/v4.38.1/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.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L238"}}),$=new Nt({props:{warning:!0,$$slots:{default:[Lt]},$$scope:{ctx:x}}}),O=new E({props:{name:"generate_mask",anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask",parameters:[{name:"image",val:": Union = None"},{name:"target_prompt",val:": Union = None"},{name:"target_negative_prompt",val:": Union = None"},{name:"target_prompt_embeds",val:": Optional = None"},{name:"target_negative_prompt_embeds",val:": Optional = None"},{name:"source_prompt",val:": Union = None"},{name:"source_negative_prompt",val:": Union = None"},{name:"source_prompt_embeds",val:": Optional = None"},{name:"source_negative_prompt_embeds",val:": Optional = None"},{name:"num_maps_per_mask",val:": Optional = 10"},{name:"mask_encode_strength",val:": Optional = 0.5"},{name:"mask_thresholding_ratio",val:": Optional = 3.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"generator",val:": Union = None"},{name:"output_type",val:": Optional = 'np'"},{name:"cross_attention_kwargs",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to be used for computing the mask.`,name:"image"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.target_prompt",description:`<strong>target_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide semantic mask generation. If not defined, you need to pass
<code>prompt_embeds</code>.`,name:"target_prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.target_negative_prompt",description:`<strong>target_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:"target_negative_prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.target_prompt_embeds",description:`<strong>target_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:"target_prompt_embeds"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.target_negative_prompt_embeds",description:`<strong>target_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:"target_negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.source_prompt",description:`<strong>source_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide semantic mask generation using DiffEdit. If not defined, you need to
pass <code>source_prompt_embeds</code> or <code>source_image</code> instead.`,name:"source_prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.source_negative_prompt",description:`<strong>source_negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide semantic mask generation away from using DiffEdit. If not defined, you
need to pass <code>source_negative_prompt_embeds</code> or <code>source_image</code> instead.`,name:"source_negative_prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.source_prompt_embeds",description:`<strong>source_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings to guide the semantic mask generation. Can be used to easily tweak text
inputs (prompt weighting). If not provided, text embeddings are generated from <code>source_prompt</code> input
argument.`,name:"source_prompt_embeds"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.source_negative_prompt_embeds",description:`<strong>source_negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings to negatively guide the semantic mask generation. Can be used to easily
tweak text inputs (prompt weighting). If not provided, text embeddings are generated from
<code>source_negative_prompt</code> input argument.`,name:"source_negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.num_maps_per_mask",description:`<strong>num_maps_per_mask</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
The number of noise maps sampled to generate the semantic mask using DiffEdit.`,name:"num_maps_per_mask"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.mask_encode_strength",description:`<strong>mask_encode_strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The strength of the noise maps sampled to generate the semantic mask using DiffEdit. Must be between 0
and 1.`,name:"mask_encode_strength"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.mask_thresholding_ratio",description:`<strong>mask_thresholding_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 3.0) &#x2014;
The maximum multiple of the mean absolute difference used to clamp the semantic guidance map before
mask binarization.`,name:"mask_thresholding_ratio"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.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.StableDiffusionDiffEditPipeline.generate_mask.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.StableDiffusionDiffEditPipeline.generate_mask.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.StableDiffusionDiffEditPipeline.generate_mask.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.StableDiffusionDiffEditPipeline.generate_mask.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
<a href="/docs/diffusers/v0.26.0/en/api/attnprocessor#diffusers.models.attention_processor.AttnProcessor">AttnProcessor</a> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L857",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>When returning a <code>List[PIL.Image.Image]</code>, the list consists of a batch of single-channel binary images
with dimensions <code>(height // self.vae_scale_factor, width // self.vae_scale_factor)</code>. If it’s
<code>np.array</code>, the shape is <code>(batch_size, height // self.vae_scale_factor, width // self.vae_scale_factor)</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[PIL.Image.Image]</code> or <code>np.array</code></p>
`}}),P=new gt({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.example",$$slots:{default:[Rt]},$$scope:{ctx:x}}}),K=new E({props:{name:"invert",anchor:"diffusers.StableDiffusionDiffEditPipeline.invert",parameters:[{name:"prompt",val:": Union = None"},{name:"image",val:": Union = None"},{name:"num_inference_steps",val:": int = 50"},{name:"inpaint_strength",val:": float = 0.8"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": Union = None"},{name:"generator",val:": Union = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"decode_latents",val:": bool = False"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": Optional = None"},{name:"callback_steps",val:": Optional = 1"},{name:"cross_attention_kwargs",val:": Optional = None"},{name:"lambda_auto_corr",val:": float = 20.0"},{name:"lambda_kl",val:": float = 20.0"},{name:"num_reg_steps",val:": int = 0"},{name:"num_auto_corr_rolls",val:": int = 5"}],parametersDescription:[{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to produce the inverted latents guided by <code>prompt</code>.`,name:"image"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.inpaint_strength",description:`<strong>inpaint_strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Indicates extent of the noising process to run latent inversion. Must be between 0 and 1. When
<code>inpaint_strength</code> is 1, the inversion process is run for the full number of iterations specified in
<code>num_inference_steps</code>. <code>image</code> is used as a reference for the inversion process, and adding more noise
increases <code>inpaint_strength</code>. If <code>inpaint_strength</code> is 0, no inpainting occurs.`,name:"inpaint_strength"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.generator",description:`<strong>generator</strong> (<code>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.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.decode_latents",description:`<strong>decode_latents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to decode the inverted latents into a generated image. Setting this argument to <code>True</code>
decodes all inverted latents for each timestep into a list of generated images.`,name:"decode_latents"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.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>~pipelines.stable_diffusion.DiffEditInversionPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.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.StableDiffusionDiffEditPipeline.invert.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
<a href="/docs/diffusers/v0.26.0/en/api/attnprocessor#diffusers.models.attention_processor.AttnProcessor">AttnProcessor</a> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.lambda_auto_corr",description:`<strong>lambda_auto_corr</strong> (<code>float</code>, <em>optional</em>, defaults to 20.0) &#x2014;
Lambda parameter to control auto correction.`,name:"lambda_auto_corr"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.lambda_kl",description:`<strong>lambda_kl</strong> (<code>float</code>, <em>optional</em>, defaults to 20.0) &#x2014;
Lambda parameter to control Kullback-Leibler divergence output.`,name:"lambda_kl"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.num_reg_steps",description:`<strong>num_reg_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of regularization loss steps.`,name:"num_reg_steps"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.num_auto_corr_rolls",description:`<strong>num_auto_corr_rolls</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Number of auto correction roll steps.`,name:"num_auto_corr_rolls"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L1076",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~pipelines.stable_diffusion.pipeline_stable_diffusion_diffedit.DiffEditInversionPipelineOutput</code> or
<code>tuple</code>:
If <code>return_dict</code> is <code>True</code>,
<code>~pipelines.stable_diffusion.pipeline_stable_diffusion_diffedit.DiffEditInversionPipelineOutput</code> is
returned, otherwise a <code>tuple</code> is returned where the first element is the inverted latents tensors
ordered by increasing noise, and the second is the corresponding decoded images if <code>decode_latents</code> is
<code>True</code>, otherwise <code>None</code>.</p>
`}}),Z=new gt({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.example",$$slots:{default:[Xt]},$$scope:{ctx:x}}}),ee=new E({props:{name:"__call__",anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__",parameters:[{name:"prompt",val:": Union = None"},{name:"mask_image",val:": Union = None"},{name:"image_latents",val:": Union = None"},{name:"inpaint_strength",val:": Optional = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": Union = None"},{name:"num_images_per_prompt",val:": Optional = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": Optional = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": Optional = None"},{name:"clip_ckip",val:": int = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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 the generated image. 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, 1, H, W)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.image_latents",description:`<strong>image_latents</strong> (<code>PIL.Image.Image</code> or <code>torch.FloatTensor</code>) &#x2014;
Partially noised image latents from the inversion process to be used as inputs for image generation.`,name:"image_latents"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.inpaint_strength",description:`<strong>inpaint_strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Indicates extent to inpaint the masked area. Must be between 0 and 1. When <code>inpaint_strength</code> is 1, the
denoising process is run on the masked area for the full number of iterations specified in
<code>num_inference_steps</code>. <code>image_latents</code> is used as a reference for the masked area, and adding more
noise to a region increases <code>inpaint_strength</code>. If <code>inpaint_strength</code> is 0, no inpainting occurs.`,name:"inpaint_strength"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.26.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.generator",description:`<strong>generator</strong> (<code>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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.26.0/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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.StableDiffusionDiffEditPipeline.__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/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L1314",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.26.0/en/api/pipelines/stable_diffusion/upscale#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
“not-safe-for-work” (nsfw) content.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/v0.26.0/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),W=new gt({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.example",$$slots:{default:[Vt]},$$scope:{ctx:x}}}),te=new E({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionDiffEditPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L383"}}),ne=new E({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionDiffEditPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L400"}}),ie=new E({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionDiffEditPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L375"}}),se=new E({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionDiffEditPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L391"}}),ae=new E({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"lora_scale",val:": Optional = None"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt.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.StableDiffusionDiffEditPipeline.encode_prompt.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.StableDiffusionDiffEditPipeline.encode_prompt.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.StableDiffusionDiffEditPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A LoRA scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.0/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L441"}}),oe=new Le({props:{title:"StableDiffusionPipelineOutput",local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",headingTag:"h2"}}),re=new E({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": Union"},{name:"nsfw_content_detected",val:": Optional"}],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.26.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L10"}}),{c(){n=d("meta"),m=a(),i=d("p"),y=a(),g(R.$$.fragment),ke=a(),X=d("p"),X.innerHTML=ht,De=a(),V=d("p"),V.textContent=_t,xe=a(),z=d("p"),z.innerHTML=bt,Te=a(),Y=d("p"),Y.innerHTML=vt,Me=a(),H=d("p"),H.innerHTML=wt,Ie=a(),g(F.$$.fragment),Ee=a(),Q=d("ul"),Q.innerHTML=yt,Je=a(),g(A.$$.fragment),Se=a(),l=d("div"),g(q.$$.fragment),Xe=a(),g($.$$.fragment),Ve=a(),le=d("p"),le.textContent=kt,ze=a(),de=d("p"),de.innerHTML=Dt,Ye=a(),pe=d("p"),pe.textContent=xt,He=a(),ce=d("ul"),ce.innerHTML=Tt,Fe=a(),T=d("div"),g(O.$$.fragment),Qe=a(),fe=d("p"),fe.textContent=Mt,Ae=a(),g(P.$$.fragment),qe=a(),M=d("div"),g(K.$$.fragment),Oe=a(),me=d("p"),me.textContent=It,Ke=a(),g(Z.$$.fragment),et=a(),I=d("div"),g(ee.$$.fragment),tt=a(),ge=d("p"),ge.textContent=Et,nt=a(),g(W.$$.fragment),it=a(),C=d("div"),g(te.$$.fragment),st=a(),ue=d("p"),ue.innerHTML=Jt,at=a(),B=d("div"),g(ne.$$.fragment),ot=a(),he=d("p"),he.innerHTML=St,rt=a(),G=d("div"),g(ie.$$.fragment),lt=a(),_e=d("p"),_e.textContent=jt,dt=a(),N=d("div"),g(se.$$.fragment),pt=a(),be=d("p"),be.textContent=Ut,ct=a(),L=d("div"),g(ae.$$.fragment),ft=a(),ve=d("p"),ve.textContent=$t,je=a(),g(oe.$$.fragment),Ue=a(),J=d("div"),g(re.$$.fragment),mt=a(),we=d("p"),we.textContent=Pt,$e=a(),ye=d("p"),this.h()},l(e){const s=Gt("svelte-u9bgzb",document.head);n=p(s,"META",{name:!0,content:!0}),s.forEach(r),m=o(e),i=p(e,"P",{}),k(i).forEach(r),y=o(e),u(R.$$.fragment,e),ke=o(e),X=p(e,"P",{"data-svelte-h":!0}),w(X)!=="svelte-1d7l3jz"&&(X.innerHTML=ht),De=o(e),V=p(e,"P",{"data-svelte-h":!0}),w(V)!=="svelte-1cwsb16"&&(V.textContent=_t),xe=o(e),z=p(e,"P",{"data-svelte-h":!0}),w(z)!=="svelte-5qswic"&&(z.innerHTML=bt),Te=o(e),Y=p(e,"P",{"data-svelte-h":!0}),w(Y)!=="svelte-9tfjar"&&(Y.innerHTML=vt),Me=o(e),H=p(e,"P",{"data-svelte-h":!0}),w(H)!=="svelte-1yyqs9v"&&(H.innerHTML=wt),Ie=o(e),u(F.$$.fragment,e),Ee=o(e),Q=p(e,"UL",{"data-svelte-h":!0}),w(Q)!=="svelte-13rcwx0"&&(Q.innerHTML=yt),Je=o(e),u(A.$$.fragment,e),Se=o(e),l=p(e,"DIV",{class:!0});var c=k(l);u(q.$$.fragment,c),Xe=o(c),u($.$$.fragment,c),Ve=o(c),le=p(c,"P",{"data-svelte-h":!0}),w(le)!=="svelte-1odvtwz"&&(le.textContent=kt),ze=o(c),de=p(c,"P",{"data-svelte-h":!0}),w(de)!=="svelte-13tknt9"&&(de.innerHTML=Dt),Ye=o(c),pe=p(c,"P",{"data-svelte-h":!0}),w(pe)!=="svelte-145c10v"&&(pe.textContent=xt),He=o(c),ce=p(c,"UL",{"data-svelte-h":!0}),w(ce)!=="svelte-yg37rt"&&(ce.innerHTML=Tt),Fe=o(c),T=p(c,"DIV",{class:!0});var S=k(T);u(O.$$.fragment,S),Qe=o(S),fe=p(S,"P",{"data-svelte-h":!0}),w(fe)!=="svelte-e123jz"&&(fe.textContent=Mt),Ae=o(S),u(P.$$.fragment,S),S.forEach(r),qe=o(c),M=p(c,"DIV",{class:!0});var j=k(M);u(K.$$.fragment,j),Oe=o(j),me=p(j,"P",{"data-svelte-h":!0}),w(me)!=="svelte-1grehch"&&(me.textContent=It),Ke=o(j),u(Z.$$.fragment,j),j.forEach(r),et=o(c),I=p(c,"DIV",{class:!0});var U=k(I);u(ee.$$.fragment,U),tt=o(U),ge=p(U,"P",{"data-svelte-h":!0}),w(ge)!=="svelte-50j04k"&&(ge.textContent=Et),nt=o(U),u(W.$$.fragment,U),U.forEach(r),it=o(c),C=p(c,"DIV",{class:!0});var Ze=k(C);u(te.$$.fragment,Ze),st=o(Ze),ue=p(Ze,"P",{"data-svelte-h":!0}),w(ue)!=="svelte-1s3c06i"&&(ue.innerHTML=Jt),Ze.forEach(r),at=o(c),B=p(c,"DIV",{class:!0});var We=k(B);u(ne.$$.fragment,We),ot=o(We),he=p(We,"P",{"data-svelte-h":!0}),w(he)!=="svelte-pkn4ui"&&(he.innerHTML=St),We.forEach(r),rt=o(c),G=p(c,"DIV",{class:!0});var Ce=k(G);u(ie.$$.fragment,Ce),lt=o(Ce),_e=p(Ce,"P",{"data-svelte-h":!0}),w(_e)!=="svelte-14bnrb6"&&(_e.textContent=jt),Ce.forEach(r),dt=o(c),N=p(c,"DIV",{class:!0});var Be=k(N);u(se.$$.fragment,Be),pt=o(Be),be=p(Be,"P",{"data-svelte-h":!0}),w(be)!=="svelte-1xwrf7t"&&(be.textContent=Ut),Be.forEach(r),ct=o(c),L=p(c,"DIV",{class:!0});var Ge=k(L);u(ae.$$.fragment,Ge),ft=o(Ge),ve=p(Ge,"P",{"data-svelte-h":!0}),w(ve)!=="svelte-16q0ax1"&&(ve.textContent=$t),Ge.forEach(r),c.forEach(r),je=o(e),u(oe.$$.fragment,e),Ue=o(e),J=p(e,"DIV",{class:!0});var Ne=k(J);u(re.$$.fragment,Ne),mt=o(Ne),we=p(Ne,"P",{"data-svelte-h":!0}),w(we)!=="svelte-1qpjiuf"&&(we.textContent=Pt),Ne.forEach(r),$e=o(e),ye=p(e,"P",{}),k(ye).forEach(r),this.h()},h(){D(n,"name","hf:doc:metadata"),D(n,"content",Yt),D(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){t(document.head,n),f(e,m,s),f(e,i,s),f(e,y,s),h(R,e,s),f(e,ke,s),f(e,X,s),f(e,De,s),f(e,V,s),f(e,xe,s),f(e,z,s),f(e,Te,s),f(e,Y,s),f(e,Me,s),f(e,H,s),f(e,Ie,s),h(F,e,s),f(e,Ee,s),f(e,Q,s),f(e,Je,s),h(A,e,s),f(e,Se,s),f(e,l,s),h(q,l,null),t(l,Xe),h($,l,null),t(l,Ve),t(l,le),t(l,ze),t(l,de),t(l,Ye),t(l,pe),t(l,He),t(l,ce),t(l,Fe),t(l,T),h(O,T,null),t(T,Qe),t(T,fe),t(T,Ae),h(P,T,null),t(l,qe),t(l,M),h(K,M,null),t(M,Oe),t(M,me),t(M,Ke),h(Z,M,null),t(l,et),t(l,I),h(ee,I,null),t(I,tt),t(I,ge),t(I,nt),h(W,I,null),t(l,it),t(l,C),h(te,C,null),t(C,st),t(C,ue),t(l,at),t(l,B),h(ne,B,null),t(B,ot),t(B,he),t(l,rt),t(l,G),h(ie,G,null),t(G,lt),t(G,_e),t(l,dt),t(l,N),h(se,N,null),t(N,pt),t(N,be),t(l,ct),t(l,L),h(ae,L,null),t(L,ft),t(L,ve),f(e,je,s),h(oe,e,s),f(e,Ue,s),f(e,J,s),h(re,J,null),t(J,mt),t(J,we),f(e,$e,s),f(e,ye,s),Pe=!0},p(e,[s]){const c={};s&2&&(c.$$scope={dirty:s,ctx:e}),$.$set(c);const S={};s&2&&(S.$$scope={dirty:s,ctx:e}),P.$set(S);const j={};s&2&&(j.$$scope={dirty:s,ctx:e}),Z.$set(j);const U={};s&2&&(U.$$scope={dirty:s,ctx:e}),W.$set(U)},i(e){Pe||(_(R.$$.fragment,e),_(F.$$.fragment,e),_(A.$$.fragment,e),_(q.$$.fragment,e),_($.$$.fragment,e),_(O.$$.fragment,e),_(P.$$.fragment,e),_(K.$$.fragment,e),_(Z.$$.fragment,e),_(ee.$$.fragment,e),_(W.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(ie.$$.fragment,e),_(se.$$.fragment,e),_(ae.$$.fragment,e),_(oe.$$.fragment,e),_(re.$$.fragment,e),Pe=!0)},o(e){b(R.$$.fragment,e),b(F.$$.fragment,e),b(A.$$.fragment,e),b(q.$$.fragment,e),b($.$$.fragment,e),b(O.$$.fragment,e),b(P.$$.fragment,e),b(K.$$.fragment,e),b(Z.$$.fragment,e),b(ee.$$.fragment,e),b(W.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(ie.$$.fragment,e),b(se.$$.fragment,e),b(ae.$$.fragment,e),b(oe.$$.fragment,e),b(re.$$.fragment,e),Pe=!1},d(e){e&&(r(m),r(i),r(y),r(ke),r(X),r(De),r(V),r(xe),r(z),r(Te),r(Y),r(Me),r(H),r(Ie),r(Ee),r(Q),r(Je),r(Se),r(l),r(je),r(Ue),r(J),r($e),r(ye)),r(n),v(R,e),v(F,e),v(A,e),v(q),v($),v(O),v(P),v(K),v(Z),v(ee),v(W),v(te),v(ne),v(ie),v(se),v(ae),v(oe,e),v(re)}}}const Yt='{"title":"DiffEdit","local":"diffedit","sections":[{"title":"Tips","local":"tips","sections":[],"depth":2},{"title":"StableDiffusionDiffEditPipeline","local":"diffusers.StableDiffusionDiffEditPipeline","sections":[],"depth":2},{"title":"StableDiffusionPipelineOutput","local":"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput","sections":[],"depth":2}],"depth":1}';function Ht(x){return Wt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tn extends Ct{constructor(n){super(),Bt(this,n,Ht,zt,Zt,{})}}export{tn as component};
