import{s as mt,o as ft,n as fe}from"../chunks/scheduler.8c3d61f6.js";import{S as gt,i as ut,g as p,s as o,r as g,A as ht,h as d,f as s,c as a,j as C,u,x as v,k as W,y as r,a as l,v as h,d as _,t as b,w as y}from"../chunks/index.da70eac4.js";import{T as ct}from"../chunks/Tip.1d9b8c37.js";import{D as ce}from"../chunks/Docstring.c021b19a.js";import{C as Qe}from"../chunks/CodeBlock.a9c4becf.js";import{E as Ye}from"../chunks/ExampleCodeBlock.56b4589c.js";import{H as Ee,E as _t}from"../chunks/getInferenceSnippets.725ed3d4.js";function bt(k){let t,c="This pipeline is deprecated but it can still be used. However, we won’t test the pipeline anymore and won’t accept any changes to it. If you run into any issues, reinstall the last Diffusers version that supported this model.";return{c(){t=p("p"),t.textContent=c},l(n){t=d(n,"P",{"data-svelte-h":!0}),v(t)!=="svelte-ic4u42"&&(t.textContent=c)},m(n,w){l(n,t,w)},p:fe,d(n){n&&s(t)}}}function yt(k){let t,c="This is an experimental feature!";return{c(){t=p("p"),t.textContent=c},l(n){t=d(n,"P",{"data-svelte-h":!0}),v(t)!=="svelte-dru17w"&&(t.textContent=c)},m(n,w){l(n,t,w)},p:fe,d(n){n&&s(t)}}}function vt(k){let t,c;return t=new Qe({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlhpYW5nLWNkJTJGRGlmZkVkaXQtc3RhYmxlLWRpZmZ1c2lvbiUyRnJhdyUyRm1haW4lMkZhc3NldHMlMkZvcmlnaW4ucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNzY4JTJDJTIwNzY4KSklMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkRpZmZFZGl0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBJTBBcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlbGluZS5zY2hlZHVsZXIuY29uZmlnKSUwQXBpcGVsaW5lLmludmVyc2Vfc2NoZWR1bGVyJTIwJTNEJTIwRERJTUludmVyc2VTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQW1hc2tfcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGJvd2wlMjBvZiUyMGZydWl0cyUyMiUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBib3dsJTIwb2YlMjBwZWFycyUyMiUwQSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBwaXBlbGluZS5nZW5lcmF0ZV9tYXNrKGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHNvdXJjZV9wcm9tcHQlM0Rwcm9tcHQlMkMlMjB0YXJnZXRfcHJvbXB0JTNEbWFza19wcm9tcHQpJTBBaW1hZ2VfbGF0ZW50cyUyMCUzRCUyMHBpcGVsaW5lLmludmVydChpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBwcm9tcHQlM0RtYXNrX3Byb21wdCkubGF0ZW50cyUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMjBpbWFnZV9sYXRlbnRzJTNEaW1hZ2VfbGF0ZW50cykuaW1hZ2VzJTVCMCU1RA==",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>pipeline = 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>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 = pipeline.generate_mask(image=init_image, source_prompt=prompt, target_prompt=mask_prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_latents = pipeline.invert(image=init_image, prompt=mask_prompt).latents
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipeline(prompt=prompt, mask_image=mask_image, image_latents=image_latents).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){g(t.$$.fragment)},l(n){u(t.$$.fragment,n)},m(n,w){h(t,n,w),c=!0},p:fe,i(n){c||(_(t.$$.fragment,n),c=!0)},o(n){b(t.$$.fragment,n),c=!1},d(n){y(t,n)}}}function wt(k){let t,c;return t=new Qe({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlhpYW5nLWNkJTJGRGlmZkVkaXQtc3RhYmxlLWRpZmZ1c2lvbiUyRnJhdyUyRm1haW4lMkZhc3NldHMlMkZvcmlnaW4ucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNzY4JTJDJTIwNzY4KSklMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkRpZmZFZGl0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBJTBBcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlbGluZS5zY2hlZHVsZXIuY29uZmlnKSUwQXBpcGVsaW5lLmludmVyc2Vfc2NoZWR1bGVyJTIwJTNEJTIwRERJTUludmVyc2VTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBib3dsJTIwb2YlMjBmcnVpdHMlMjIlMEElMEFpbnZlcnRlZF9sYXRlbnRzJTIwJTNEJTIwcGlwZWxpbmUuaW52ZXJ0KGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHByb21wdCUzRHByb21wdCkubGF0ZW50cw==",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>pipeline = 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>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 = pipeline.invert(image=init_image, prompt=prompt).latents`,wrap:!1}}),{c(){g(t.$$.fragment)},l(n){u(t.$$.fragment,n)},m(n,w){h(t,n,w),c=!0},p:fe,i(n){c||(_(t.$$.fragment,n),c=!0)},o(n){b(t.$$.fragment,n),c=!1},d(n){y(t,n)}}}function kt(k){let t,c;return t=new Qe({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uRGlmZkVkaXRQaXBlbGluZSUwQSUwQSUwQWRlZiUyMGRvd25sb2FkX2ltYWdlKHVybCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwUElMLkltYWdlLm9wZW4oQnl0ZXNJTyhyZXNwb25zZS5jb250ZW50KSkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlhpYW5nLWNkJTJGRGlmZkVkaXQtc3RhYmxlLWRpZmZ1c2lvbiUyRnJhdyUyRm1haW4lMkZhc3NldHMlMkZvcmlnaW4ucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKGltZ191cmwpLnJlc2l6ZSgoNzY4JTJDJTIwNzY4KSklMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkRpZmZFZGl0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBJTBBcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlbGluZS5zY2hlZHVsZXIuY29uZmlnKSUwQXBpcGVsaW5lLmludmVyc2Vfc2NoZWR1bGVyJTIwJTNEJTIwRERJTUludmVyc2VTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQW1hc2tfcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGJvd2wlMjBvZiUyMGZydWl0cyUyMiUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBib3dsJTIwb2YlMjBwZWFycyUyMiUwQSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBwaXBlbGluZS5nZW5lcmF0ZV9tYXNrKGltYWdlJTNEaW5pdF9pbWFnZSUyQyUyMHNvdXJjZV9wcm9tcHQlM0Rwcm9tcHQlMkMlMjB0YXJnZXRfcHJvbXB0JTNEbWFza19wcm9tcHQpJTBBaW1hZ2VfbGF0ZW50cyUyMCUzRCUyMHBpcGVsaW5lLmludmVydChpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBwcm9tcHQlM0RtYXNrX3Byb21wdCkubGF0ZW50cyUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMjBpbWFnZV9sYXRlbnRzJTNEaW1hZ2VfbGF0ZW50cykuaW1hZ2VzJTVCMCU1RA==",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>pipeline = 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>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 = pipeline.generate_mask(image=init_image, source_prompt=prompt, target_prompt=mask_prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_latents = pipeline.invert(image=init_image, prompt=mask_prompt).latents
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipeline(prompt=prompt, mask_image=mask_image, image_latents=image_latents).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){g(t.$$.fragment)},l(n){u(t.$$.fragment,n)},m(n,w){h(t,n,w),c=!0},p:fe,i(n){c||(_(t.$$.fragment,n),c=!0)},o(n){b(t.$$.fragment,n),c=!1},d(n){y(t,n)}}}function Dt(k){let t,c,n,w,E,ge,B,ue,L,Ae='<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.',he,G,qe="The abstract from the paper is:",_e,N,Oe="<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>",be,R,Ke='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>.',ye,V,et='This pipeline was contributed by <a href="https://github.com/clarencechen" rel="nofollow">clarencechen</a>. ❤️',ve,X,we,z,tt=`<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/main/en/api/pipelines/diffedit#diffusers.StableDiffusionDiffEditPipeline.generate_mask">generate_mask()</a>)
and a set of partially inverted latents (generated using <a href="/docs/diffusers/main/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/main/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/main/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>`,ke,F,De,m,H,Se,S,Ue,ne,nt="Pipeline for text-guided image inpainting using Stable Diffusion and DiffEdit.",Pe,ie,it=`This model inherits from <a href="/docs/diffusers/main/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.).`,je,se,st="The pipeline also inherits the following loading and saving methods:",$e,oe,ot='<li><a href="/docs/diffusers/main/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/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li>',Ce,D,Y,We,ae,at="Generate a latent mask given a mask prompt, a target prompt, and an image.",Be,U,Le,T,Q,Ge,re,rt="Generate inverted latents given a prompt and image.",Ne,P,Re,x,A,Ve,le,lt="The call function to the pipeline for generation.",Xe,j,ze,$,q,Fe,pe,pt="Encodes the prompt into text encoder hidden states.",Te,O,xe,M,K,He,de,dt="Output class for Stable Diffusion pipelines.",Me,ee,Ie,me,Je;return E=new ct({props:{warning:!0,$$slots:{default:[bt]},$$scope:{ctx:k}}}),B=new Ee({props:{title:"DiffEdit",local:"diffedit",headingTag:"h1"}}),X=new Ee({props:{title:"Tips",local:"tips",headingTag:"h2"}}),F=new Ee({props:{title:"StableDiffusionDiffEditPipeline",local:"diffusers.StableDiffusionDiffEditPipeline",headingTag:"h2"}}),H=new ce({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/main/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/main/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/main/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/main/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/main/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/main/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/stable-diffusion-v1-5/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/main/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/main/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L244"}}),S=new ct({props:{warning:!0,$$slots:{default:[yt]},$$scope:{ctx:k}}}),Y=new ce({props:{name:"generate_mask",anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask",parameters:[{name:"image",val:": typing.Union[torch.Tensor, 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.Tensor] = None"},{name:"target_negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = 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.Tensor] = None"},{name:"source_negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = 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.Optional[typing.Dict[str, typing.Any]] = 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.Tensor</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.Tensor</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.Tensor</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.Tensor</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/main/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/main/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L847",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>
`}}),U=new Ye({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.example",$$slots:{default:[vt]},$$scope:{ctx:k}}}),Q=new ce({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.Tensor, 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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = 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.Optional[typing.Callable[[int, int, torch.Tensor], NoneType]] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = 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.Tensor</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.Tensor</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.Tensor)</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/main/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/main/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L1066",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>
`}}),P=new Ye({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.example",$$slots:{default:[wt]},$$scope:{ctx:k}}}),A=new ce({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.Tensor, PIL.Image.Image] = None"},{name:"image_latents",val:": typing.Union[torch.Tensor, 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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Optional[typing.Callable[[int, int, torch.Tensor], NoneType]] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"clip_skip",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.Tensor</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://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/main/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.Tensor</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.Tensor</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.Tensor</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/main/en/api/pipelines/stable_diffusion/text2img#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.Tensor)</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/main/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L1304",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#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/main/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),j=new Ye({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.example",$$slots:{default:[kt]},$$scope:{ctx:k}}}),q=new ce({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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = 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`,name:"prompt"},{anchor:"diffusers.StableDiffusionDiffEditPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{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.Tensor</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.Tensor</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/main/src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py#L426"}}),O=new Ee({props:{title:"StableDiffusionPipelineOutput",local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",headingTag:"h2"}}),K=new ce({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/main/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L10"}}),ee=new _t({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/diffedit.md"}}),{c(){t=p("meta"),c=o(),n=p("p"),w=o(),g(E.$$.fragment),ge=o(),g(B.$$.fragment),ue=o(),L=p("p"),L.innerHTML=Ae,he=o(),G=p("p"),G.textContent=qe,_e=o(),N=p("p"),N.innerHTML=Oe,be=o(),R=p("p"),R.innerHTML=Ke,ye=o(),V=p("p"),V.innerHTML=et,ve=o(),g(X.$$.fragment),we=o(),z=p("ul"),z.innerHTML=tt,ke=o(),g(F.$$.fragment),De=o(),m=p("div"),g(H.$$.fragment),Se=o(),g(S.$$.fragment),Ue=o(),ne=p("p"),ne.textContent=nt,Pe=o(),ie=p("p"),ie.innerHTML=it,je=o(),se=p("p"),se.textContent=st,$e=o(),oe=p("ul"),oe.innerHTML=ot,Ce=o(),D=p("div"),g(Y.$$.fragment),We=o(),ae=p("p"),ae.textContent=at,Be=o(),g(U.$$.fragment),Le=o(),T=p("div"),g(Q.$$.fragment),Ge=o(),re=p("p"),re.textContent=rt,Ne=o(),g(P.$$.fragment),Re=o(),x=p("div"),g(A.$$.fragment),Ve=o(),le=p("p"),le.textContent=lt,Xe=o(),g(j.$$.fragment),ze=o(),$=p("div"),g(q.$$.fragment),Fe=o(),pe=p("p"),pe.textContent=pt,Te=o(),g(O.$$.fragment),xe=o(),M=p("div"),g(K.$$.fragment),He=o(),de=p("p"),de.textContent=dt,Me=o(),g(ee.$$.fragment),Ie=o(),me=p("p"),this.h()},l(e){const i=ht("svelte-u9bgzb",document.head);t=d(i,"META",{name:!0,content:!0}),i.forEach(s),c=a(e),n=d(e,"P",{}),C(n).forEach(s),w=a(e),u(E.$$.fragment,e),ge=a(e),u(B.$$.fragment,e),ue=a(e),L=d(e,"P",{"data-svelte-h":!0}),v(L)!=="svelte-1d7l3jz"&&(L.innerHTML=Ae),he=a(e),G=d(e,"P",{"data-svelte-h":!0}),v(G)!=="svelte-1cwsb16"&&(G.textContent=qe),_e=a(e),N=d(e,"P",{"data-svelte-h":!0}),v(N)!=="svelte-5qswic"&&(N.innerHTML=Oe),be=a(e),R=d(e,"P",{"data-svelte-h":!0}),v(R)!=="svelte-9tfjar"&&(R.innerHTML=Ke),ye=a(e),V=d(e,"P",{"data-svelte-h":!0}),v(V)!=="svelte-1yyqs9v"&&(V.innerHTML=et),ve=a(e),u(X.$$.fragment,e),we=a(e),z=d(e,"UL",{"data-svelte-h":!0}),v(z)!=="svelte-13sp9ii"&&(z.innerHTML=tt),ke=a(e),u(F.$$.fragment,e),De=a(e),m=d(e,"DIV",{class:!0});var f=C(m);u(H.$$.fragment,f),Se=a(f),u(S.$$.fragment,f),Ue=a(f),ne=d(f,"P",{"data-svelte-h":!0}),v(ne)!=="svelte-1odvtwz"&&(ne.textContent=nt),Pe=a(f),ie=d(f,"P",{"data-svelte-h":!0}),v(ie)!=="svelte-496sm0"&&(ie.innerHTML=it),je=a(f),se=d(f,"P",{"data-svelte-h":!0}),v(se)!=="svelte-145c10v"&&(se.textContent=st),$e=a(f),oe=d(f,"UL",{"data-svelte-h":!0}),v(oe)!=="svelte-txtwv6"&&(oe.innerHTML=ot),Ce=a(f),D=d(f,"DIV",{class:!0});var I=C(D);u(Y.$$.fragment,I),We=a(I),ae=d(I,"P",{"data-svelte-h":!0}),v(ae)!=="svelte-e123jz"&&(ae.textContent=at),Be=a(I),u(U.$$.fragment,I),I.forEach(s),Le=a(f),T=d(f,"DIV",{class:!0});var J=C(T);u(Q.$$.fragment,J),Ge=a(J),re=d(J,"P",{"data-svelte-h":!0}),v(re)!=="svelte-1grehch"&&(re.textContent=rt),Ne=a(J),u(P.$$.fragment,J),J.forEach(s),Re=a(f),x=d(f,"DIV",{class:!0});var Z=C(x);u(A.$$.fragment,Z),Ve=a(Z),le=d(Z,"P",{"data-svelte-h":!0}),v(le)!=="svelte-50j04k"&&(le.textContent=lt),Xe=a(Z),u(j.$$.fragment,Z),Z.forEach(s),ze=a(f),$=d(f,"DIV",{class:!0});var te=C($);u(q.$$.fragment,te),Fe=a(te),pe=d(te,"P",{"data-svelte-h":!0}),v(pe)!=="svelte-16q0ax1"&&(pe.textContent=pt),te.forEach(s),f.forEach(s),Te=a(e),u(O.$$.fragment,e),xe=a(e),M=d(e,"DIV",{class:!0});var Ze=C(M);u(K.$$.fragment,Ze),He=a(Ze),de=d(Ze,"P",{"data-svelte-h":!0}),v(de)!=="svelte-1qpjiuf"&&(de.textContent=dt),Ze.forEach(s),Me=a(e),u(ee.$$.fragment,e),Ie=a(e),me=d(e,"P",{}),C(me).forEach(s),this.h()},h(){W(t,"name","hf:doc:metadata"),W(t,"content",Tt),W(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(M,"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,i){r(document.head,t),l(e,c,i),l(e,n,i),l(e,w,i),h(E,e,i),l(e,ge,i),h(B,e,i),l(e,ue,i),l(e,L,i),l(e,he,i),l(e,G,i),l(e,_e,i),l(e,N,i),l(e,be,i),l(e,R,i),l(e,ye,i),l(e,V,i),l(e,ve,i),h(X,e,i),l(e,we,i),l(e,z,i),l(e,ke,i),h(F,e,i),l(e,De,i),l(e,m,i),h(H,m,null),r(m,Se),h(S,m,null),r(m,Ue),r(m,ne),r(m,Pe),r(m,ie),r(m,je),r(m,se),r(m,$e),r(m,oe),r(m,Ce),r(m,D),h(Y,D,null),r(D,We),r(D,ae),r(D,Be),h(U,D,null),r(m,Le),r(m,T),h(Q,T,null),r(T,Ge),r(T,re),r(T,Ne),h(P,T,null),r(m,Re),r(m,x),h(A,x,null),r(x,Ve),r(x,le),r(x,Xe),h(j,x,null),r(m,ze),r(m,$),h(q,$,null),r($,Fe),r($,pe),l(e,Te,i),h(O,e,i),l(e,xe,i),l(e,M,i),h(K,M,null),r(M,He),r(M,de),l(e,Me,i),h(ee,e,i),l(e,Ie,i),l(e,me,i),Je=!0},p(e,[i]){const f={};i&2&&(f.$$scope={dirty:i,ctx:e}),E.$set(f);const I={};i&2&&(I.$$scope={dirty:i,ctx:e}),S.$set(I);const J={};i&2&&(J.$$scope={dirty:i,ctx:e}),U.$set(J);const Z={};i&2&&(Z.$$scope={dirty:i,ctx:e}),P.$set(Z);const te={};i&2&&(te.$$scope={dirty:i,ctx:e}),j.$set(te)},i(e){Je||(_(E.$$.fragment,e),_(B.$$.fragment,e),_(X.$$.fragment,e),_(F.$$.fragment,e),_(H.$$.fragment,e),_(S.$$.fragment,e),_(Y.$$.fragment,e),_(U.$$.fragment,e),_(Q.$$.fragment,e),_(P.$$.fragment,e),_(A.$$.fragment,e),_(j.$$.fragment,e),_(q.$$.fragment,e),_(O.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),Je=!0)},o(e){b(E.$$.fragment,e),b(B.$$.fragment,e),b(X.$$.fragment,e),b(F.$$.fragment,e),b(H.$$.fragment,e),b(S.$$.fragment,e),b(Y.$$.fragment,e),b(U.$$.fragment,e),b(Q.$$.fragment,e),b(P.$$.fragment,e),b(A.$$.fragment,e),b(j.$$.fragment,e),b(q.$$.fragment,e),b(O.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),Je=!1},d(e){e&&(s(c),s(n),s(w),s(ge),s(ue),s(L),s(he),s(G),s(_e),s(N),s(be),s(R),s(ye),s(V),s(ve),s(we),s(z),s(ke),s(De),s(m),s(Te),s(xe),s(M),s(Me),s(Ie),s(me)),s(t),y(E,e),y(B,e),y(X,e),y(F,e),y(H),y(S),y(Y),y(U),y(Q),y(P),y(A),y(j),y(q),y(O,e),y(K),y(ee,e)}}}const Tt='{"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 xt(k){return ft(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pt extends gt{constructor(t){super(),ut(this,t,xt,Dt,mt,{})}}export{Pt as component};
