import{s as ut,o as ht,n as qe}from"../chunks/scheduler.53228c21.js";import{S as _t,i as bt,e as d,s,c as g,h as yt,a as p,d as n,b as o,f as C,j as v,g as u,k as x,l as r,m as l,n as h,t as _,o as b,p as y}from"../chunks/index.100fac89.js";import{C as vt}from"../chunks/CopyLLMTxtMenu.20a72e0e.js";import{D as ce}from"../chunks/Docstring.49101787.js";import{C as Oe}from"../chunks/CodeBlock.d30a6509.js";import{E as Qe}from"../chunks/ExampleCodeBlock.4a9effb9.js";import{H as Se,E as wt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4d82655d.js";function kt(Z){let a,f;return a=new Oe({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(a.$$.fragment)},l(i){u(a.$$.fragment,i)},m(i,w){h(a,i,w),f=!0},p:qe,i(i){f||(_(a.$$.fragment,i),f=!0)},o(i){b(a.$$.fragment,i),f=!1},d(i){y(a,i)}}}function Dt(Z){let a,f;return a=new Oe({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(a.$$.fragment)},l(i){u(a.$$.fragment,i)},m(i,w){h(a,i,w),f=!0},p:qe,i(i){f||(_(a.$$.fragment,i),f=!0)},o(i){b(a.$$.fragment,i),f=!1},d(i){y(a,i)}}}function Tt(Z){let a,f;return a=new Oe({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(a.$$.fragment)},l(i){u(a.$$.fragment,i)},m(i,w){h(a,i,w),f=!0},p:qe,i(i){f||(_(a.$$.fragment,i),f=!0)},o(i){b(a.$$.fragment,i),f=!1},d(i){y(a,i)}}}function xt(Z){let a,f,i,w,E,Ae="<p>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.</p>",fe,W,ge,$,ue,L,Ke='<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,B,et="The abstract from the paper is:",_e,G,tt="<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,N,nt='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,R,it='This pipeline was contributed by <a href="https://github.com/clarencechen" rel="nofollow">clarencechen</a>. ❤️',ve,V,we,X,st=`<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,z,De,c,F,Ue,H,ot="<p>&gt; This is an experimental feature!</p>",Pe,te,at="Pipeline for text-guided image inpainting using Stable Diffusion and DiffEdit.",je,ne,rt=`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.).`,Ce,ie,lt="The pipeline also inherits the following loading and saving methods:",We,se,dt='<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>',$e,k,Y,Le,oe,pt="Generate a latent mask given a mask prompt, a target prompt, and an image.",Be,S,Ge,D,Q,Ne,ae,ct="Generate inverted latents given a prompt and image.",Re,U,Ve,T,q,Xe,re,mt="The call function to the pipeline for generation.",ze,P,Fe,j,O,He,le,ft="Encodes the prompt into text encoder hidden states.",Te,A,xe,M,K,Ye,de,gt="Output class for Stable Diffusion pipelines.",Me,ee,Ie,me,Je;return W=new vt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new Se({props:{title:"DiffEdit",local:"diffedit",headingTag:"h1"}}),V=new Se({props:{title:"Tips",local:"tips",headingTag:"h2"}}),z=new Se({props:{title:"StableDiffusionDiffEditPipeline",local:"diffusers.StableDiffusionDiffEditPipeline",headingTag:"h2"}}),F=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"}}),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#L843",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>
`}}),S=new Qe({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.generate_mask.example",$$slots:{default:[kt]},$$scope:{ctx:Z}}}),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#L1062",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>
`}}),U=new Qe({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.invert.example",$$slots:{default:[Dt]},$$scope:{ctx:Z}}}),q=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/depth2img#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#L1300",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/depth2img#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/depth2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),P=new Qe({props:{anchor:"diffusers.StableDiffusionDiffEditPipeline.__call__.example",$$slots:{default:[Tt]},$$scope:{ctx:Z}}}),O=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#L422"}}),A=new Se({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#L11"}}),ee=new wt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/diffedit.md"}}),{c(){a=d("meta"),f=s(),i=d("p"),w=s(),E=d("blockquote"),E.innerHTML=Ae,fe=s(),g(W.$$.fragment),ge=s(),g($.$$.fragment),ue=s(),L=d("p"),L.innerHTML=Ke,he=s(),B=d("p"),B.textContent=et,_e=s(),G=d("p"),G.innerHTML=tt,be=s(),N=d("p"),N.innerHTML=nt,ye=s(),R=d("p"),R.innerHTML=it,ve=s(),g(V.$$.fragment),we=s(),X=d("ul"),X.innerHTML=st,ke=s(),g(z.$$.fragment),De=s(),c=d("div"),g(F.$$.fragment),Ue=s(),H=d("blockquote"),H.innerHTML=ot,Pe=s(),te=d("p"),te.textContent=at,je=s(),ne=d("p"),ne.innerHTML=rt,Ce=s(),ie=d("p"),ie.textContent=lt,We=s(),se=d("ul"),se.innerHTML=dt,$e=s(),k=d("div"),g(Y.$$.fragment),Le=s(),oe=d("p"),oe.textContent=pt,Be=s(),g(S.$$.fragment),Ge=s(),D=d("div"),g(Q.$$.fragment),Ne=s(),ae=d("p"),ae.textContent=ct,Re=s(),g(U.$$.fragment),Ve=s(),T=d("div"),g(q.$$.fragment),Xe=s(),re=d("p"),re.textContent=mt,ze=s(),g(P.$$.fragment),Fe=s(),j=d("div"),g(O.$$.fragment),He=s(),le=d("p"),le.textContent=ft,Te=s(),g(A.$$.fragment),xe=s(),M=d("div"),g(K.$$.fragment),Ye=s(),de=d("p"),de.textContent=gt,Me=s(),g(ee.$$.fragment),Ie=s(),me=d("p"),this.h()},l(e){const t=yt("svelte-u9bgzb",document.head);a=p(t,"META",{name:!0,content:!0}),t.forEach(n),f=o(e),i=p(e,"P",{}),C(i).forEach(n),w=o(e),E=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),v(E)!=="svelte-124tjg"&&(E.innerHTML=Ae),fe=o(e),u(W.$$.fragment,e),ge=o(e),u($.$$.fragment,e),ue=o(e),L=p(e,"P",{"data-svelte-h":!0}),v(L)!=="svelte-1d7l3jz"&&(L.innerHTML=Ke),he=o(e),B=p(e,"P",{"data-svelte-h":!0}),v(B)!=="svelte-1cwsb16"&&(B.textContent=et),_e=o(e),G=p(e,"P",{"data-svelte-h":!0}),v(G)!=="svelte-5qswic"&&(G.innerHTML=tt),be=o(e),N=p(e,"P",{"data-svelte-h":!0}),v(N)!=="svelte-9tfjar"&&(N.innerHTML=nt),ye=o(e),R=p(e,"P",{"data-svelte-h":!0}),v(R)!=="svelte-1yyqs9v"&&(R.innerHTML=it),ve=o(e),u(V.$$.fragment,e),we=o(e),X=p(e,"UL",{"data-svelte-h":!0}),v(X)!=="svelte-19uju1s"&&(X.innerHTML=st),ke=o(e),u(z.$$.fragment,e),De=o(e),c=p(e,"DIV",{class:!0});var m=C(c);u(F.$$.fragment,m),Ue=o(m),H=p(m,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),v(H)!=="svelte-5hptwe"&&(H.innerHTML=ot),Pe=o(m),te=p(m,"P",{"data-svelte-h":!0}),v(te)!=="svelte-1odvtwz"&&(te.textContent=at),je=o(m),ne=p(m,"P",{"data-svelte-h":!0}),v(ne)!=="svelte-496sm0"&&(ne.innerHTML=rt),Ce=o(m),ie=p(m,"P",{"data-svelte-h":!0}),v(ie)!=="svelte-145c10v"&&(ie.textContent=lt),We=o(m),se=p(m,"UL",{"data-svelte-h":!0}),v(se)!=="svelte-txtwv6"&&(se.innerHTML=dt),$e=o(m),k=p(m,"DIV",{class:!0});var I=C(k);u(Y.$$.fragment,I),Le=o(I),oe=p(I,"P",{"data-svelte-h":!0}),v(oe)!=="svelte-e123jz"&&(oe.textContent=pt),Be=o(I),u(S.$$.fragment,I),I.forEach(n),Ge=o(m),D=p(m,"DIV",{class:!0});var J=C(D);u(Q.$$.fragment,J),Ne=o(J),ae=p(J,"P",{"data-svelte-h":!0}),v(ae)!=="svelte-1grehch"&&(ae.textContent=ct),Re=o(J),u(U.$$.fragment,J),J.forEach(n),Ve=o(m),T=p(m,"DIV",{class:!0});var pe=C(T);u(q.$$.fragment,pe),Xe=o(pe),re=p(pe,"P",{"data-svelte-h":!0}),v(re)!=="svelte-50j04k"&&(re.textContent=mt),ze=o(pe),u(P.$$.fragment,pe),pe.forEach(n),Fe=o(m),j=p(m,"DIV",{class:!0});var Ze=C(j);u(O.$$.fragment,Ze),He=o(Ze),le=p(Ze,"P",{"data-svelte-h":!0}),v(le)!=="svelte-16q0ax1"&&(le.textContent=ft),Ze.forEach(n),m.forEach(n),Te=o(e),u(A.$$.fragment,e),xe=o(e),M=p(e,"DIV",{class:!0});var Ee=C(M);u(K.$$.fragment,Ee),Ye=o(Ee),de=p(Ee,"P",{"data-svelte-h":!0}),v(de)!=="svelte-1qpjiuf"&&(de.textContent=gt),Ee.forEach(n),Me=o(e),u(ee.$$.fragment,e),Ie=o(e),me=p(e,"P",{}),C(me).forEach(n),this.h()},h(){x(a,"name","hf:doc:metadata"),x(a,"content",Mt),x(E,"class","warning"),x(H,"class","warning"),x(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(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,t){r(document.head,a),l(e,f,t),l(e,i,t),l(e,w,t),l(e,E,t),l(e,fe,t),h(W,e,t),l(e,ge,t),h($,e,t),l(e,ue,t),l(e,L,t),l(e,he,t),l(e,B,t),l(e,_e,t),l(e,G,t),l(e,be,t),l(e,N,t),l(e,ye,t),l(e,R,t),l(e,ve,t),h(V,e,t),l(e,we,t),l(e,X,t),l(e,ke,t),h(z,e,t),l(e,De,t),l(e,c,t),h(F,c,null),r(c,Ue),r(c,H),r(c,Pe),r(c,te),r(c,je),r(c,ne),r(c,Ce),r(c,ie),r(c,We),r(c,se),r(c,$e),r(c,k),h(Y,k,null),r(k,Le),r(k,oe),r(k,Be),h(S,k,null),r(c,Ge),r(c,D),h(Q,D,null),r(D,Ne),r(D,ae),r(D,Re),h(U,D,null),r(c,Ve),r(c,T),h(q,T,null),r(T,Xe),r(T,re),r(T,ze),h(P,T,null),r(c,Fe),r(c,j),h(O,j,null),r(j,He),r(j,le),l(e,Te,t),h(A,e,t),l(e,xe,t),l(e,M,t),h(K,M,null),r(M,Ye),r(M,de),l(e,Me,t),h(ee,e,t),l(e,Ie,t),l(e,me,t),Je=!0},p(e,[t]){const m={};t&2&&(m.$$scope={dirty:t,ctx:e}),S.$set(m);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),U.$set(I);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),P.$set(J)},i(e){Je||(_(W.$$.fragment,e),_($.$$.fragment,e),_(V.$$.fragment,e),_(z.$$.fragment,e),_(F.$$.fragment,e),_(Y.$$.fragment,e),_(S.$$.fragment,e),_(Q.$$.fragment,e),_(U.$$.fragment,e),_(q.$$.fragment,e),_(P.$$.fragment,e),_(O.$$.fragment,e),_(A.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),Je=!0)},o(e){b(W.$$.fragment,e),b($.$$.fragment,e),b(V.$$.fragment,e),b(z.$$.fragment,e),b(F.$$.fragment,e),b(Y.$$.fragment,e),b(S.$$.fragment,e),b(Q.$$.fragment,e),b(U.$$.fragment,e),b(q.$$.fragment,e),b(P.$$.fragment,e),b(O.$$.fragment,e),b(A.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),Je=!1},d(e){e&&(n(f),n(i),n(w),n(E),n(fe),n(ge),n(ue),n(L),n(he),n(B),n(_e),n(G),n(be),n(N),n(ye),n(R),n(ve),n(we),n(X),n(ke),n(De),n(c),n(Te),n(xe),n(M),n(Me),n(Ie),n(me)),n(a),y(W,e),y($,e),y(V,e),y(z,e),y(F),y(Y),y(S),y(Q),y(U),y(q),y(P),y(O),y(A,e),y(K),y(ee,e)}}}const Mt='{"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 It(Z){return ht(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ct extends _t{constructor(a){super(),bt(this,a,It,xt,ut,{})}}export{Ct as component};
