import{S as Yo,i as Oo,s as Qo,e as i,k as l,w as b,t as a,M as Ho,c as o,d as t,m as d,a as r,x as v,h as s,b as c,G as e,g as h,y,q as w,o as E,B as D,v as qo,L as za}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Ko}from"../../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Fa}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as hn}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Aa}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function es(P){let f,_;return{c(){f=i("p"),_=a("This is an experimental feature!")},l(p){f=o(p,"P",{});var k=r(f);_=s(k,"This is an experimental feature!"),k.forEach(t)},m(p,k){h(p,f,k),e(f,_)},d(p){p&&t(f)}}}function ts(P){let f,_;return f=new Fa({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>]`}}),{c(){b(f.$$.fragment)},l(p){v(f.$$.fragment,p)},m(p,k){y(f,p,k),_=!0},p:za,i(p){_||(w(f.$$.fragment,p),_=!0)},o(p){E(f.$$.fragment,p),_=!1},d(p){D(f,p)}}}function ns(P){let f,_;return f=new Fa({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`}}),{c(){b(f.$$.fragment)},l(p){v(f.$$.fragment,p)},m(p,k){y(f,p,k),_=!0},p:za,i(p){_||(w(f.$$.fragment,p),_=!0)},o(p){E(f.$$.fragment,p),_=!1},d(p){D(f,p)}}}function is(P){let f,_;return f=new Fa({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>]`}}),{c(){b(f.$$.fragment)},l(p){v(f.$$.fragment,p)},m(p,k){y(f,p,k),_=!0},p:za,i(p){_||(w(f.$$.fragment,p),_=!0)},o(p){E(f.$$.fragment,p),_=!1},d(p){D(f,p)}}}function as(P){let f,_,p,k,nt,le,_n,it,bn,Rt,de,pe,vn,yn,Xt,je,wn,Vt,$e,at,En,At,j,Dn,ce,kn,In,fe,Tn,Mn,zt,F,xn,me,Sn,Jn,Ft,C,Y,ot,ge,Un,st,Pn,Yt,I,rt,jn,$n,J,Zn,Ze,Wn,Gn,We,Nn,Cn,lt,Bn,Ln,Rn,T,Xn,Ge,Vn,An,dt,zn,Fn,pt,Yn,On,ct,Qn,Hn,ft,qn,Kn,ei,B,ti,mt,ni,ii,gt,ai,oi,si,x,ri,ut,li,di,ht,pi,ci,_t,fi,mi,bt,gi,ui,hi,Ne,_i,L,U,bi,vt,vi,yi,yt,wi,Ei,wt,Di,ki,Ii,ue,Ti,Ce,Mi,xi,Si,R,Ji,Et,Ui,Pi,Dt,ji,$i,Zi,he,Wi,Be,Gi,Ni,Ot,X,O,kt,_e,Ci,It,Bi,Qt,g,be,Li,Q,Ri,Tt,Xi,Vi,ve,Ai,Le,zi,Fi,Yi,Mt,Oi,Qi,V,Re,Xe,Hi,qi,Ki,Ve,Ae,ea,ta,na,ze,Fe,ia,aa,oa,$,ye,sa,xt,ra,la,H,da,Z,we,pa,St,ca,fa,q,ma,W,Ee,ga,Jt,ua,ha,K,_a,ee,De,ba,ke,va,Ut,ya,wa,Ea,te,Ie,Da,Te,ka,Pt,Ia,Ta,Ma,ne,Me,xa,jt,Sa,Ja,ie,xe,Ua,$t,Pa,ja,ae,Se,$a,Zt,Za,Ht,A,oe,Wt,Je,Wa,Gt,Ga,qt,z,Ue,Na,Nt,Ca,Kt;return le=new hn({}),ge=new hn({}),_e=new hn({}),be=new N({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.21.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> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.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.21.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.21.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> (<code>CLIPImageProcessor</code>) &#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.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L235"}}),Q=new Ko({props:{warning:!0,$$slots:{default:[es]},$$scope:{ctx:P}}}),ye=new N({props:{name:"generate_mask",anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask",parameters:[{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"target_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"target_negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"target_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"target_negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"source_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"source_negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"source_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"source_negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"num_maps_per_mask",val:": typing.Optional[int] = 10"},{name:"mask_encode_strength",val:": typing.Optional[float] = 0.5"},{name:"mask_thresholding_ratio",val:": typing.Optional[float] = 3.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"output_type",val:": typing.Optional[str] = 'np'"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = 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.21.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.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L830",returnDescription:`
<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\u2019s
<code>np.array</code>, the shape is <code>(batch_size, height // self.vae_scale_factor, width // self.vae_scale_factor)</code>.</p>
`,returnType:`
<p><code>List[PIL.Image.Image]</code> or <code>np.array</code></p>
`}}),H=new Aa({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.example",$$slots:{default:[ts]},$$scope:{ctx:P}}}),we=new N({props:{name:"invert",anchor:"diffusers.StableDiffusionDiffEditPipeline.invert",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = 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:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decode_latents",val:": bool = False"},{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:": typing.Optional[int] = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = 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.21.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.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L1049",returnDescription:`
<p><code>DiffEditInversionPipelineOutput</code> or
<code>tuple</code>:
If <code>return_dict</code> is <code>True</code>,
<code>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>
`}}),q=new Aa({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.example",$$slots:{default:[ns]},$$scope:{ctx:P}}}),Ee=new N({props:{name:"__call__",anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"image_latents",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"inpaint_strength",val:": typing.Optional[float] = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[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.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.21.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.21.0/en/api/pipelines/stable_diffusion/img2img#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"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L1286",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),K=new Aa({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.example",$$slots:{default:[is]},$$scope:{ctx:P}}}),De=new N({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionDiffEditPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L379"}}),Ie=new N({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionDiffEditPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L396"}}),Me=new N({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionDiffEditPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L371"}}),xe=new N({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionDiffEditPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L387"}}),Se=new N({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:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = 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"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_diffedit.py#L435"}}),Je=new hn({}),Ue=new N({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),{c(){f=i("meta"),_=l(),p=i("h1"),k=i("a"),nt=i("span"),b(le.$$.fragment),_n=l(),it=i("span"),bn=a("DiffEdit"),Rt=l(),de=i("p"),pe=i("a"),vn=a("DiffEdit: Diffusion-based semantic image editing with mask guidance"),yn=a(" is by Guillaume Couairon, Jakob Verbeek, Holger Schwenk, and Matthieu Cord."),Xt=l(),je=i("p"),wn=a("The abstract from the paper is:"),Vt=l(),$e=i("p"),at=i("em"),En=a("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."),At=l(),j=i("p"),Dn=a("The original codebase can be found at "),ce=i("a"),kn=a("Xiang-cd/DiffEdit-stable-diffusion"),In=a(", and you can try it out in this "),fe=i("a"),Tn=a("demo"),Mn=a("."),zt=l(),F=i("p"),xn=a("This pipeline was contributed by "),me=i("a"),Sn=a("clarencechen"),Jn=a(". \u2764\uFE0F"),Ft=l(),C=i("h2"),Y=i("a"),ot=i("span"),b(ge.$$.fragment),Un=l(),st=i("span"),Pn=a("Tips"),Yt=l(),I=i("ul"),rt=i("li"),jn=a("The pipeline can generate masks that can be fed into other inpainting pipelines."),$n=l(),J=i("li"),Zn=a("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 "),Ze=i("a"),Wn=a("generate_mask()"),Gn=a(`)
and a set of partially inverted latents (generated using `),We=i("a"),Nn=a("invert()"),Cn=a(") "),lt=i("em"),Bn=a("must"),Ln=a(" be provided as arguments when calling the pipeline to generate the final edited image."),Rn=l(),T=i("li"),Xn=a("The function "),Ge=i("a"),Vn=a("generate_mask()"),An=a(" exposes two prompt arguments, "),dt=i("code"),zn=a("source_prompt"),Fn=a(" and "),pt=i("code"),Yn=a("target_prompt"),On=a(`
that let you control the locations of the semantic edits in the final image to be generated. Let\u2019s say,
you wanted to translate from \u201Ccat\u201D to \u201Cdog\u201D. In this case, the edit direction will be \u201Ccat -> dog\u201D. To reflect
this in the generated mask, you simply have to set the embeddings related to the phrases including \u201Ccat\u201D to
`),ct=i("code"),Qn=a("source_prompt"),Hn=a(" and \u201Cdog\u201D to "),ft=i("code"),qn=a("target_prompt"),Kn=a("."),ei=l(),B=i("li"),ti=a("When generating partially inverted latents using "),mt=i("code"),ni=a("invert"),ii=a(`, assign a caption or text embedding describing the
overall image to the `),gt=i("code"),ai=a("prompt"),oi=a(` argument to help guide the inverse latent sampling process. In most cases, the
source concept is sufficently descriptive to yield good results, but feel free to explore alternatives.`),si=l(),x=i("li"),ri=a("When calling the pipeline to generate the final edited image, assign the source concept to "),ut=i("code"),li=a("negative_prompt"),di=a(`
and the target concept to `),ht=i("code"),pi=a("prompt"),ci=a(`. Taking the above example, you simply have to set the embeddings related to
the phrases including \u201Ccat\u201D to `),_t=i("code"),fi=a("negative_prompt"),mi=a(" and \u201Cdog\u201D to "),bt=i("code"),gi=a("prompt"),ui=a("."),hi=l(),Ne=i("li"),_i=a("If you wanted to reverse the direction in the example above, i.e., \u201Cdog -> cat\u201D, then it\u2019s recommended to:"),L=i("ul"),U=i("li"),bi=a("Swap the "),vt=i("code"),vi=a("source_prompt"),yi=a(" and "),yt=i("code"),wi=a("target_prompt"),Ei=a(" in the arguments to "),wt=i("code"),Di=a("generate_mask"),ki=a("."),Ii=l(),ue=i("li"),Ti=a("Change the input prompt in "),Ce=i("a"),Mi=a("invert()"),xi=a(" to include \u201Cdog\u201D."),Si=l(),R=i("li"),Ji=a("Swap the "),Et=i("code"),Ui=a("prompt"),Pi=a(" and "),Dt=i("code"),ji=a("negative_prompt"),$i=a(" in the arguments to call the pipeline to generate the final edited image."),Zi=l(),he=i("li"),Wi=a("The source and target prompts, or their corresponding embeddings, can also be automatically generated. Please refer to the "),Be=i("a"),Gi=a("DiffEdit"),Ni=a(" guide for more details."),Ot=l(),X=i("h2"),O=i("a"),kt=i("span"),b(_e.$$.fragment),Ci=l(),It=i("span"),Bi=a("StableDiffusionDiffEditPipeline"),Qt=l(),g=i("div"),b(be.$$.fragment),Li=l(),b(Q.$$.fragment),Ri=l(),Tt=i("p"),Xi=a("Pipeline for text-guided image inpainting using Stable Diffusion and DiffEdit."),Vi=l(),ve=i("p"),Ai=a("This model inherits from "),Le=i("a"),zi=a("DiffusionPipeline"),Fi=a(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Yi=l(),Mt=i("p"),Oi=a("The pipeline also inherits the following loading and saving methods:"),Qi=l(),V=i("ul"),Re=i("li"),Xe=i("a"),Hi=a("load_textual_inversion()"),qi=a(" for loading textual inversion embeddings"),Ki=l(),Ve=i("li"),Ae=i("a"),ea=a("load_lora_weights()"),ta=a(" for loading LoRA weights"),na=l(),ze=i("li"),Fe=i("a"),ia=a("save_lora_weights()"),aa=a(" for saving LoRA weights"),oa=l(),$=i("div"),b(ye.$$.fragment),sa=l(),xt=i("p"),ra=a("Generate a latent mask given a mask prompt, a target prompt, and an image."),la=l(),b(H.$$.fragment),da=l(),Z=i("div"),b(we.$$.fragment),pa=l(),St=i("p"),ca=a("Generate inverted latents given a prompt and image."),fa=l(),b(q.$$.fragment),ma=l(),W=i("div"),b(Ee.$$.fragment),ga=l(),Jt=i("p"),ua=a("The call function to the pipeline for generation."),ha=l(),b(K.$$.fragment),_a=l(),ee=i("div"),b(De.$$.fragment),ba=l(),ke=i("p"),va=a("Disable sliced VAE decoding. If "),Ut=i("code"),ya=a("enable_vae_slicing"),wa=a(` was previously enabled, this method will go back to
computing decoding in one step.`),Ea=l(),te=i("div"),b(Ie.$$.fragment),Da=l(),Te=i("p"),ka=a("Disable tiled VAE decoding. If "),Pt=i("code"),Ia=a("enable_vae_tiling"),Ta=a(` was previously enabled, this method will go back to
computing decoding in one step.`),Ma=l(),ne=i("div"),b(Me.$$.fragment),xa=l(),jt=i("p"),Sa=a(`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.`),Ja=l(),ie=i("div"),b(xe.$$.fragment),Ua=l(),$t=i("p"),Pa=a(`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.`),ja=l(),ae=i("div"),b(Se.$$.fragment),$a=l(),Zt=i("p"),Za=a("Encodes the prompt into text encoder hidden states."),Ht=l(),A=i("h2"),oe=i("a"),Wt=i("span"),b(Je.$$.fragment),Wa=l(),Gt=i("span"),Ga=a("StableDiffusionPipelineOutput"),qt=l(),z=i("div"),b(Ue.$$.fragment),Na=l(),Nt=i("p"),Ca=a("Output class for Stable Diffusion pipelines."),this.h()},l(n){const m=Ho('[data-svelte="svelte-1phssyn"]',document.head);f=o(m,"META",{name:!0,content:!0}),m.forEach(t),_=d(n),p=o(n,"H1",{class:!0});var Pe=r(p);k=o(Pe,"A",{id:!0,class:!0,href:!0});var Ct=r(k);nt=o(Ct,"SPAN",{});var Bt=r(nt);v(le.$$.fragment,Bt),Bt.forEach(t),Ct.forEach(t),_n=d(Pe),it=o(Pe,"SPAN",{});var Lt=r(it);bn=s(Lt,"DiffEdit"),Lt.forEach(t),Pe.forEach(t),Rt=d(n),de=o(n,"P",{});var Ba=r(de);pe=o(Ba,"A",{href:!0,rel:!0});var Ya=r(pe);vn=s(Ya,"DiffEdit: Diffusion-based semantic image editing with mask guidance"),Ya.forEach(t),yn=s(Ba," is by Guillaume Couairon, Jakob Verbeek, Holger Schwenk, and Matthieu Cord."),Ba.forEach(t),Xt=d(n),je=o(n,"P",{});var Oa=r(je);wn=s(Oa,"The abstract from the paper is:"),Oa.forEach(t),Vt=d(n),$e=o(n,"P",{});var Qa=r($e);at=o(Qa,"EM",{});var Ha=r(at);En=s(Ha,"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."),Ha.forEach(t),Qa.forEach(t),At=d(n),j=o(n,"P",{});var Ye=r(j);Dn=s(Ye,"The original codebase can be found at "),ce=o(Ye,"A",{href:!0,rel:!0});var qa=r(ce);kn=s(qa,"Xiang-cd/DiffEdit-stable-diffusion"),qa.forEach(t),In=s(Ye,", and you can try it out in this "),fe=o(Ye,"A",{href:!0,rel:!0});var Ka=r(fe);Tn=s(Ka,"demo"),Ka.forEach(t),Mn=s(Ye,"."),Ye.forEach(t),zt=d(n),F=o(n,"P",{});var en=r(F);xn=s(en,"This pipeline was contributed by "),me=o(en,"A",{href:!0,rel:!0});var eo=r(me);Sn=s(eo,"clarencechen"),eo.forEach(t),Jn=s(en,". \u2764\uFE0F"),en.forEach(t),Ft=d(n),C=o(n,"H2",{class:!0});var tn=r(C);Y=o(tn,"A",{id:!0,class:!0,href:!0});var to=r(Y);ot=o(to,"SPAN",{});var no=r(ot);v(ge.$$.fragment,no),no.forEach(t),to.forEach(t),Un=d(tn),st=o(tn,"SPAN",{});var io=r(st);Pn=s(io,"Tips"),io.forEach(t),tn.forEach(t),Yt=d(n),I=o(n,"UL",{});var M=r(I);rt=o(M,"LI",{});var ao=r(rt);jn=s(ao,"The pipeline can generate masks that can be fed into other inpainting pipelines."),ao.forEach(t),$n=d(M),J=o(M,"LI",{});var se=r(J);Zn=s(se,"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 "),Ze=o(se,"A",{href:!0});var oo=r(Ze);Wn=s(oo,"generate_mask()"),oo.forEach(t),Gn=s(se,`)
and a set of partially inverted latents (generated using `),We=o(se,"A",{href:!0});var so=r(We);Nn=s(so,"invert()"),so.forEach(t),Cn=s(se,") "),lt=o(se,"EM",{});var ro=r(lt);Bn=s(ro,"must"),ro.forEach(t),Ln=s(se," be provided as arguments when calling the pipeline to generate the final edited image."),se.forEach(t),Rn=d(M),T=o(M,"LI",{});var S=r(T);Xn=s(S,"The function "),Ge=o(S,"A",{href:!0});var lo=r(Ge);Vn=s(lo,"generate_mask()"),lo.forEach(t),An=s(S," exposes two prompt arguments, "),dt=o(S,"CODE",{});var po=r(dt);zn=s(po,"source_prompt"),po.forEach(t),Fn=s(S," and "),pt=o(S,"CODE",{});var co=r(pt);Yn=s(co,"target_prompt"),co.forEach(t),On=s(S,`
that let you control the locations of the semantic edits in the final image to be generated. Let\u2019s say,
you wanted to translate from \u201Ccat\u201D to \u201Cdog\u201D. In this case, the edit direction will be \u201Ccat -> dog\u201D. To reflect
this in the generated mask, you simply have to set the embeddings related to the phrases including \u201Ccat\u201D to
`),ct=o(S,"CODE",{});var fo=r(ct);Qn=s(fo,"source_prompt"),fo.forEach(t),Hn=s(S," and \u201Cdog\u201D to "),ft=o(S,"CODE",{});var mo=r(ft);qn=s(mo,"target_prompt"),mo.forEach(t),Kn=s(S,"."),S.forEach(t),ei=d(M),B=o(M,"LI",{});var Oe=r(B);ti=s(Oe,"When generating partially inverted latents using "),mt=o(Oe,"CODE",{});var go=r(mt);ni=s(go,"invert"),go.forEach(t),ii=s(Oe,`, assign a caption or text embedding describing the
overall image to the `),gt=o(Oe,"CODE",{});var uo=r(gt);ai=s(uo,"prompt"),uo.forEach(t),oi=s(Oe,` argument to help guide the inverse latent sampling process. In most cases, the
source concept is sufficently descriptive to yield good results, but feel free to explore alternatives.`),Oe.forEach(t),si=d(M),x=o(M,"LI",{});var G=r(x);ri=s(G,"When calling the pipeline to generate the final edited image, assign the source concept to "),ut=o(G,"CODE",{});var ho=r(ut);li=s(ho,"negative_prompt"),ho.forEach(t),di=s(G,`
and the target concept to `),ht=o(G,"CODE",{});var _o=r(ht);pi=s(_o,"prompt"),_o.forEach(t),ci=s(G,`. Taking the above example, you simply have to set the embeddings related to
the phrases including \u201Ccat\u201D to `),_t=o(G,"CODE",{});var bo=r(_t);fi=s(bo,"negative_prompt"),bo.forEach(t),mi=s(G," and \u201Cdog\u201D to "),bt=o(G,"CODE",{});var vo=r(bt);gi=s(vo,"prompt"),vo.forEach(t),ui=s(G,"."),G.forEach(t),hi=d(M),Ne=o(M,"LI",{});var La=r(Ne);_i=s(La,"If you wanted to reverse the direction in the example above, i.e., \u201Cdog -> cat\u201D, then it\u2019s recommended to:"),L=o(La,"UL",{});var Qe=r(L);U=o(Qe,"LI",{});var re=r(U);bi=s(re,"Swap the "),vt=o(re,"CODE",{});var yo=r(vt);vi=s(yo,"source_prompt"),yo.forEach(t),yi=s(re," and "),yt=o(re,"CODE",{});var wo=r(yt);wi=s(wo,"target_prompt"),wo.forEach(t),Ei=s(re," in the arguments to "),wt=o(re,"CODE",{});var Eo=r(wt);Di=s(Eo,"generate_mask"),Eo.forEach(t),ki=s(re,"."),re.forEach(t),Ii=d(Qe),ue=o(Qe,"LI",{});var nn=r(ue);Ti=s(nn,"Change the input prompt in "),Ce=o(nn,"A",{href:!0});var Do=r(Ce);Mi=s(Do,"invert()"),Do.forEach(t),xi=s(nn," to include \u201Cdog\u201D."),nn.forEach(t),Si=d(Qe),R=o(Qe,"LI",{});var He=r(R);Ji=s(He,"Swap the "),Et=o(He,"CODE",{});var ko=r(Et);Ui=s(ko,"prompt"),ko.forEach(t),Pi=s(He," and "),Dt=o(He,"CODE",{});var Io=r(Dt);ji=s(Io,"negative_prompt"),Io.forEach(t),$i=s(He," in the arguments to call the pipeline to generate the final edited image."),He.forEach(t),Qe.forEach(t),La.forEach(t),Zi=d(M),he=o(M,"LI",{});var an=r(he);Wi=s(an,"The source and target prompts, or their corresponding embeddings, can also be automatically generated. Please refer to the "),Be=o(an,"A",{href:!0});var To=r(Be);Gi=s(To,"DiffEdit"),To.forEach(t),Ni=s(an," guide for more details."),an.forEach(t),M.forEach(t),Ot=d(n),X=o(n,"H2",{class:!0});var on=r(X);O=o(on,"A",{id:!0,class:!0,href:!0});var Mo=r(O);kt=o(Mo,"SPAN",{});var xo=r(kt);v(_e.$$.fragment,xo),xo.forEach(t),Mo.forEach(t),Ci=d(on),It=o(on,"SPAN",{});var So=r(It);Bi=s(So,"StableDiffusionDiffEditPipeline"),So.forEach(t),on.forEach(t),Qt=d(n),g=o(n,"DIV",{class:!0});var u=r(g);v(be.$$.fragment,u),Li=d(u),v(Q.$$.fragment,u),Ri=d(u),Tt=o(u,"P",{});var Jo=r(Tt);Xi=s(Jo,"Pipeline for text-guided image inpainting using Stable Diffusion and DiffEdit."),Jo.forEach(t),Vi=d(u),ve=o(u,"P",{});var sn=r(ve);Ai=s(sn,"This model inherits from "),Le=o(sn,"A",{href:!0});var Uo=r(Le);zi=s(Uo,"DiffusionPipeline"),Uo.forEach(t),Fi=s(sn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),sn.forEach(t),Yi=d(u),Mt=o(u,"P",{});var Po=r(Mt);Oi=s(Po,"The pipeline also inherits the following loading and saving methods:"),Po.forEach(t),Qi=d(u),V=o(u,"UL",{});var qe=r(V);Re=o(qe,"LI",{});var Ra=r(Re);Xe=o(Ra,"A",{href:!0});var jo=r(Xe);Hi=s(jo,"load_textual_inversion()"),jo.forEach(t),qi=s(Ra," for loading textual inversion embeddings"),Ra.forEach(t),Ki=d(qe),Ve=o(qe,"LI",{});var Xa=r(Ve);Ae=o(Xa,"A",{href:!0});var $o=r(Ae);ea=s($o,"load_lora_weights()"),$o.forEach(t),ta=s(Xa," for loading LoRA weights"),Xa.forEach(t),na=d(qe),ze=o(qe,"LI",{});var Va=r(ze);Fe=o(Va,"A",{href:!0});var Zo=r(Fe);ia=s(Zo,"save_lora_weights()"),Zo.forEach(t),aa=s(Va," for saving LoRA weights"),Va.forEach(t),qe.forEach(t),oa=d(u),$=o(u,"DIV",{class:!0});var Ke=r($);v(ye.$$.fragment,Ke),sa=d(Ke),xt=o(Ke,"P",{});var Wo=r(xt);ra=s(Wo,"Generate a latent mask given a mask prompt, a target prompt, and an image."),Wo.forEach(t),la=d(Ke),v(H.$$.fragment,Ke),Ke.forEach(t),da=d(u),Z=o(u,"DIV",{class:!0});var et=r(Z);v(we.$$.fragment,et),pa=d(et),St=o(et,"P",{});var Go=r(St);ca=s(Go,"Generate inverted latents given a prompt and image."),Go.forEach(t),fa=d(et),v(q.$$.fragment,et),et.forEach(t),ma=d(u),W=o(u,"DIV",{class:!0});var tt=r(W);v(Ee.$$.fragment,tt),ga=d(tt),Jt=o(tt,"P",{});var No=r(Jt);ua=s(No,"The call function to the pipeline for generation."),No.forEach(t),ha=d(tt),v(K.$$.fragment,tt),tt.forEach(t),_a=d(u),ee=o(u,"DIV",{class:!0});var rn=r(ee);v(De.$$.fragment,rn),ba=d(rn),ke=o(rn,"P",{});var ln=r(ke);va=s(ln,"Disable sliced VAE decoding. If "),Ut=o(ln,"CODE",{});var Co=r(Ut);ya=s(Co,"enable_vae_slicing"),Co.forEach(t),wa=s(ln,` was previously enabled, this method will go back to
computing decoding in one step.`),ln.forEach(t),rn.forEach(t),Ea=d(u),te=o(u,"DIV",{class:!0});var dn=r(te);v(Ie.$$.fragment,dn),Da=d(dn),Te=o(dn,"P",{});var pn=r(Te);ka=s(pn,"Disable tiled VAE decoding. If "),Pt=o(pn,"CODE",{});var Bo=r(Pt);Ia=s(Bo,"enable_vae_tiling"),Bo.forEach(t),Ta=s(pn,` was previously enabled, this method will go back to
computing decoding in one step.`),pn.forEach(t),dn.forEach(t),Ma=d(u),ne=o(u,"DIV",{class:!0});var cn=r(ne);v(Me.$$.fragment,cn),xa=d(cn),jt=o(cn,"P",{});var Lo=r(jt);Sa=s(Lo,`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.`),Lo.forEach(t),cn.forEach(t),Ja=d(u),ie=o(u,"DIV",{class:!0});var fn=r(ie);v(xe.$$.fragment,fn),Ua=d(fn),$t=o(fn,"P",{});var Ro=r($t);Pa=s(Ro,`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.`),Ro.forEach(t),fn.forEach(t),ja=d(u),ae=o(u,"DIV",{class:!0});var mn=r(ae);v(Se.$$.fragment,mn),$a=d(mn),Zt=o(mn,"P",{});var Xo=r(Zt);Za=s(Xo,"Encodes the prompt into text encoder hidden states."),Xo.forEach(t),mn.forEach(t),u.forEach(t),Ht=d(n),A=o(n,"H2",{class:!0});var gn=r(A);oe=o(gn,"A",{id:!0,class:!0,href:!0});var Vo=r(oe);Wt=o(Vo,"SPAN",{});var Ao=r(Wt);v(Je.$$.fragment,Ao),Ao.forEach(t),Vo.forEach(t),Wa=d(gn),Gt=o(gn,"SPAN",{});var zo=r(Gt);Ga=s(zo,"StableDiffusionPipelineOutput"),zo.forEach(t),gn.forEach(t),qt=d(n),z=o(n,"DIV",{class:!0});var un=r(z);v(Ue.$$.fragment,un),Na=d(un),Nt=o(un,"P",{});var Fo=r(Nt);Ca=s(Fo,"Output class for Stable Diffusion pipelines."),Fo.forEach(t),un.forEach(t),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(os)),c(k,"id","diffedit"),c(k,"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"),c(k,"href","#diffedit"),c(p,"class","relative group"),c(pe,"href","https://huggingface.co/papers/2210.11427"),c(pe,"rel","nofollow"),c(ce,"href","https://github.com/Xiang-cd/DiffEdit-stable-diffusion"),c(ce,"rel","nofollow"),c(fe,"href","https://blog.problemsolversguild.com/technical/research/2022/11/02/DiffEdit-Implementation.html"),c(fe,"rel","nofollow"),c(me,"href","https://github.com/clarencechen"),c(me,"rel","nofollow"),c(Y,"id","tips"),c(Y,"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"),c(Y,"href","#tips"),c(C,"class","relative group"),c(Ze,"href","/docs/diffusers/v0.21.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.generate_mask"),c(We,"href","/docs/diffusers/v0.21.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.invert"),c(Ge,"href","/docs/diffusers/v0.21.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.generate_mask"),c(Ce,"href","/docs/diffusers/v0.21.0/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.invert"),c(Be,"href","/using-diffusers/diffedit"),c(O,"id","diffusers.StableDiffusionDiffEditPipeline"),c(O,"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"),c(O,"href","#diffusers.StableDiffusionDiffEditPipeline"),c(X,"class","relative group"),c(Le,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),c(Xe,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),c(Ae,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),c(Fe,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),c($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(oe,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),c(oe,"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"),c(oe,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),c(A,"class","relative group"),c(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,m){e(document.head,f),h(n,_,m),h(n,p,m),e(p,k),e(k,nt),y(le,nt,null),e(p,_n),e(p,it),e(it,bn),h(n,Rt,m),h(n,de,m),e(de,pe),e(pe,vn),e(de,yn),h(n,Xt,m),h(n,je,m),e(je,wn),h(n,Vt,m),h(n,$e,m),e($e,at),e(at,En),h(n,At,m),h(n,j,m),e(j,Dn),e(j,ce),e(ce,kn),e(j,In),e(j,fe),e(fe,Tn),e(j,Mn),h(n,zt,m),h(n,F,m),e(F,xn),e(F,me),e(me,Sn),e(F,Jn),h(n,Ft,m),h(n,C,m),e(C,Y),e(Y,ot),y(ge,ot,null),e(C,Un),e(C,st),e(st,Pn),h(n,Yt,m),h(n,I,m),e(I,rt),e(rt,jn),e(I,$n),e(I,J),e(J,Zn),e(J,Ze),e(Ze,Wn),e(J,Gn),e(J,We),e(We,Nn),e(J,Cn),e(J,lt),e(lt,Bn),e(J,Ln),e(I,Rn),e(I,T),e(T,Xn),e(T,Ge),e(Ge,Vn),e(T,An),e(T,dt),e(dt,zn),e(T,Fn),e(T,pt),e(pt,Yn),e(T,On),e(T,ct),e(ct,Qn),e(T,Hn),e(T,ft),e(ft,qn),e(T,Kn),e(I,ei),e(I,B),e(B,ti),e(B,mt),e(mt,ni),e(B,ii),e(B,gt),e(gt,ai),e(B,oi),e(I,si),e(I,x),e(x,ri),e(x,ut),e(ut,li),e(x,di),e(x,ht),e(ht,pi),e(x,ci),e(x,_t),e(_t,fi),e(x,mi),e(x,bt),e(bt,gi),e(x,ui),e(I,hi),e(I,Ne),e(Ne,_i),e(Ne,L),e(L,U),e(U,bi),e(U,vt),e(vt,vi),e(U,yi),e(U,yt),e(yt,wi),e(U,Ei),e(U,wt),e(wt,Di),e(U,ki),e(L,Ii),e(L,ue),e(ue,Ti),e(ue,Ce),e(Ce,Mi),e(ue,xi),e(L,Si),e(L,R),e(R,Ji),e(R,Et),e(Et,Ui),e(R,Pi),e(R,Dt),e(Dt,ji),e(R,$i),e(I,Zi),e(I,he),e(he,Wi),e(he,Be),e(Be,Gi),e(he,Ni),h(n,Ot,m),h(n,X,m),e(X,O),e(O,kt),y(_e,kt,null),e(X,Ci),e(X,It),e(It,Bi),h(n,Qt,m),h(n,g,m),y(be,g,null),e(g,Li),y(Q,g,null),e(g,Ri),e(g,Tt),e(Tt,Xi),e(g,Vi),e(g,ve),e(ve,Ai),e(ve,Le),e(Le,zi),e(ve,Fi),e(g,Yi),e(g,Mt),e(Mt,Oi),e(g,Qi),e(g,V),e(V,Re),e(Re,Xe),e(Xe,Hi),e(Re,qi),e(V,Ki),e(V,Ve),e(Ve,Ae),e(Ae,ea),e(Ve,ta),e(V,na),e(V,ze),e(ze,Fe),e(Fe,ia),e(ze,aa),e(g,oa),e(g,$),y(ye,$,null),e($,sa),e($,xt),e(xt,ra),e($,la),y(H,$,null),e(g,da),e(g,Z),y(we,Z,null),e(Z,pa),e(Z,St),e(St,ca),e(Z,fa),y(q,Z,null),e(g,ma),e(g,W),y(Ee,W,null),e(W,ga),e(W,Jt),e(Jt,ua),e(W,ha),y(K,W,null),e(g,_a),e(g,ee),y(De,ee,null),e(ee,ba),e(ee,ke),e(ke,va),e(ke,Ut),e(Ut,ya),e(ke,wa),e(g,Ea),e(g,te),y(Ie,te,null),e(te,Da),e(te,Te),e(Te,ka),e(Te,Pt),e(Pt,Ia),e(Te,Ta),e(g,Ma),e(g,ne),y(Me,ne,null),e(ne,xa),e(ne,jt),e(jt,Sa),e(g,Ja),e(g,ie),y(xe,ie,null),e(ie,Ua),e(ie,$t),e($t,Pa),e(g,ja),e(g,ae),y(Se,ae,null),e(ae,$a),e(ae,Zt),e(Zt,Za),h(n,Ht,m),h(n,A,m),e(A,oe),e(oe,Wt),y(Je,Wt,null),e(A,Wa),e(A,Gt),e(Gt,Ga),h(n,qt,m),h(n,z,m),y(Ue,z,null),e(z,Na),e(z,Nt),e(Nt,Ca),Kt=!0},p(n,[m]){const Pe={};m&2&&(Pe.$$scope={dirty:m,ctx:n}),Q.$set(Pe);const Ct={};m&2&&(Ct.$$scope={dirty:m,ctx:n}),H.$set(Ct);const Bt={};m&2&&(Bt.$$scope={dirty:m,ctx:n}),q.$set(Bt);const Lt={};m&2&&(Lt.$$scope={dirty:m,ctx:n}),K.$set(Lt)},i(n){Kt||(w(le.$$.fragment,n),w(ge.$$.fragment,n),w(_e.$$.fragment,n),w(be.$$.fragment,n),w(Q.$$.fragment,n),w(ye.$$.fragment,n),w(H.$$.fragment,n),w(we.$$.fragment,n),w(q.$$.fragment,n),w(Ee.$$.fragment,n),w(K.$$.fragment,n),w(De.$$.fragment,n),w(Ie.$$.fragment,n),w(Me.$$.fragment,n),w(xe.$$.fragment,n),w(Se.$$.fragment,n),w(Je.$$.fragment,n),w(Ue.$$.fragment,n),Kt=!0)},o(n){E(le.$$.fragment,n),E(ge.$$.fragment,n),E(_e.$$.fragment,n),E(be.$$.fragment,n),E(Q.$$.fragment,n),E(ye.$$.fragment,n),E(H.$$.fragment,n),E(we.$$.fragment,n),E(q.$$.fragment,n),E(Ee.$$.fragment,n),E(K.$$.fragment,n),E(De.$$.fragment,n),E(Ie.$$.fragment,n),E(Me.$$.fragment,n),E(xe.$$.fragment,n),E(Se.$$.fragment,n),E(Je.$$.fragment,n),E(Ue.$$.fragment,n),Kt=!1},d(n){t(f),n&&t(_),n&&t(p),D(le),n&&t(Rt),n&&t(de),n&&t(Xt),n&&t(je),n&&t(Vt),n&&t($e),n&&t(At),n&&t(j),n&&t(zt),n&&t(F),n&&t(Ft),n&&t(C),D(ge),n&&t(Yt),n&&t(I),n&&t(Ot),n&&t(X),D(_e),n&&t(Qt),n&&t(g),D(be),D(Q),D(ye),D(H),D(we),D(q),D(Ee),D(K),D(De),D(Ie),D(Me),D(xe),D(Se),n&&t(Ht),n&&t(A),D(Je),n&&t(qt),n&&t(z),D(Ue)}}}const os={local:"diffedit",sections:[{local:"tips",title:"Tips "},{local:"diffusers.StableDiffusionDiffEditPipeline",title:"StableDiffusionDiffEditPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"}],title:"DiffEdit"};function ss(P){return qo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ms extends Yo{constructor(f){super();Oo(this,f,ss,as,Qo,{})}}export{ms as default,os as metadata};
