import{S as Wi,i as Gi,s as Bi,e as s,k as p,w as v,t as r,M as Fi,c as a,d as n,m as f,a as i,x as w,h as l,b as g,G as e,g as y,y as I,q as x,o as M,B as T,v as Ni,L as rt}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Fa}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as lt}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as wn}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as it}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ci(j){let d,b,u,c,_;return{c(){d=s("p"),b=r("Make sure to check out the Stable Diffusion "),u=s("a"),c=r("Tips"),_=r(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),this.h()},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"Make sure to check out the Stable Diffusion "),u=a(m,"A",{href:!0});var B=i(u);c=l(B,"Tips"),B.forEach(n),_=l(m," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),m.forEach(n),this.h()},h(){g(u,"href","overview#tips")},m(o,m){y(o,d,m),e(d,b),e(d,u),e(u,c),e(d,_)},d(o){o&&n(d)}}}function Ai(j){let d,b,u,c,_;return c=new lt({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUwQW1vZGVsX2lkX29yX3BhdGglMjAlM0QlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbWcySW1nUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkX29yX3BhdGglMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oZGV2aWNlKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBpbml0X2ltYWdlLnJlc2l6ZSgoNzY4JTJDJTIwNTEyKSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmFudGFzeSUyMGxhbmRzY2FwZSUyQyUyMHRyZW5kaW5nJTIwb24lMjBhcnRzdGF0aW9uJTIyJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBzdHJlbmd0aCUzRDAuNzUlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDcuNSkuaW1hZ2VzJTBBaW1hZ2VzJTVCMCU1RC5zYXZlKCUyMmZhbnRhc3lfbGFuZHNjYXBlLnBuZyUyMik=",highlighted:`<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> PIL <span class="hljs-keyword">import</span> Image
<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> StableDiffusionImg2ImgPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_id_or_path = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = 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>init_image = init_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt=prompt, image=init_image, strength=<span class="hljs-number">0.75</span>, guidance_scale=<span class="hljs-number">7.5</span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_landscape.png&quot;</span>)`}}),{c(){d=s("p"),b=r("Examples:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"Examples:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function Xi(j){let d,b,u,c,_;return{c(){d=s("p"),b=r("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=s("code"),c=r("scaled_dot_product_attention"),_=r(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=a(m,"CODE",{});var B=i(u);c=l(B,"scaled_dot_product_attention"),B.forEach(n),_=l(m,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),m.forEach(n)},m(o,m){y(o,d,m),e(d,b),e(d,u),e(u,c),e(d,_)},d(o){o&&n(d)}}}function Li(j){let d,b,u,c,_;return c=new lt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){d=s("p"),b=r("Examples:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"Examples:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function zi(j){let d,b;return{c(){d=s("p"),b=r(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(u){d=a(u,"P",{});var c=i(d);b=l(c,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),c.forEach(n)},m(u,c){y(u,d,c),e(d,b)},d(u){u&&n(d)}}}function Ri(j){let d,b,u,c,_;return c=new lt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){d=s("p"),b=r("Examples:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"Examples:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function Vi(j){let d,b,u,c,_;return c=new lt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){d=s("p"),b=r("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function Yi(j){let d,b,u,c,_;return c=new lt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){d=s("p"),b=r("locally:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"locally:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function qi(j){let d,b,u,c,_;return c=new lt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from local file</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># file is downloaded under ./v1-5-pruned-emaonly.ckpt</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(<span class="hljs-string">&quot;./v1-5-pruned-emaonly&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable float16 and move to GPU</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){d=s("p"),b=r("Examples:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"Examples:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function Qi(j){let d,b,u,c,_;return c=new lt({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBGbGF4U3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lJTBBJTBBJTBBZGVmJTIwY3JlYXRlX2tleShzZWVkJTNEMCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBqYXgucmFuZG9tLlBSTkdLZXkoc2VlZCklMEElMEElMEFybmclMjAlM0QlMjBjcmVhdGVfa2V5KDApJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24lMkZtYWluJTJGYXNzZXRzJTJGc3RhYmxlLXNhbXBsZXMlMkZpbWcyaW1nJTJGc2tldGNoLW1vdW50YWlucy1pbnB1dC5qcGclMjIlMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBaW5pdF9pbWclMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWluaXRfaW1nJTIwJTNEJTIwaW5pdF9pbWcucmVzaXplKCg3NjglMkMlMjA1MTIpKSUwQSUwQXByb21wdHMlMjAlM0QlMjAlMjJBJTIwZmFudGFzeSUyMGxhbmRzY2FwZSUyQyUyMHRyZW5kaW5nJTIwb24lMjBhcnRzdGF0aW9uJTIyJTBBJTBBcGlwZWxpbmUlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4U3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTJDJTBBJTIwJTIwJTIwJTIwcmV2aXNpb24lM0QlMjJmbGF4JTIyJTJDJTBBJTIwJTIwJTIwJTIwZHR5cGUlM0RqbnAuYmZsb2F0MTYlMkMlMEEpJTBBJTBBbnVtX3NhbXBsZXMlMjAlM0QlMjBqYXguZGV2aWNlX2NvdW50KCklMEFybmclMjAlM0QlMjBqYXgucmFuZG9tLnNwbGl0KHJuZyUyQyUyMGpheC5kZXZpY2VfY291bnQoKSklMEFwcm9tcHRfaWRzJTJDJTIwcHJvY2Vzc2VkX2ltYWdlJTIwJTNEJTIwcGlwZWxpbmUucHJlcGFyZV9pbnB1dHMoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTVCcHJvbXB0cyU1RCUyMColMjBudW1fc2FtcGxlcyUyQyUyMGltYWdlJTNEJTVCaW5pdF9pbWclNUQlMjAqJTIwbnVtX3NhbXBsZXMlMEEpJTBBcF9wYXJhbXMlMjAlM0QlMjByZXBsaWNhdGUocGFyYW1zKSUwQXByb21wdF9pZHMlMjAlM0QlMjBzaGFyZChwcm9tcHRfaWRzKSUwQXByb2Nlc3NlZF9pbWFnZSUyMCUzRCUyMHNoYXJkKHByb2Nlc3NlZF9pbWFnZSklMEElMEFvdXRwdXQlMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjAlMjAlMjBwcm9tcHRfaWRzJTNEcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEcHJvY2Vzc2VkX2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwcGFyYW1zJTNEcF9wYXJhbXMlMkMlMEElMjAlMjAlMjAlMjBwcm5nX3NlZWQlM0RybmclMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuNzUlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBqaXQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEEpLmltYWdlcyUwQSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBwaXBlbGluZS5udW1weV90b19waWwobnAuYXNhcnJheShvdXRwdXQucmVzaGFwZSgobnVtX3NhbXBsZXMlMkMpJTIwJTJCJTIwb3V0cHV0LnNoYXBlJTVCLTMlM0ElNUQpKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionImg2ImgPipeline


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">create_key</span>(<span class="hljs-params">seed=<span class="hljs-number">0</span></span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> jax.random.PRNGKey(seed)


<span class="hljs-meta">&gt;&gt;&gt; </span>rng = create_key(<span class="hljs-number">0</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_img = 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>init_img = init_img.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>prompts = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline, params = FlaxStableDiffusionImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
<span class="hljs-meta">... </span>    revision=<span class="hljs-string">&quot;flax&quot;</span>,
<span class="hljs-meta">... </span>    dtype=jnp.bfloat16,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>num_samples = jax.device_count()
<span class="hljs-meta">&gt;&gt;&gt; </span>rng = jax.random.split(rng, jax.device_count())
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids, processed_image = pipeline.prepare_inputs(
<span class="hljs-meta">... </span>    prompt=[prompts] * num_samples, image=[init_img] * num_samples
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>p_params = replicate(params)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids = shard(prompt_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>processed_image = shard(processed_image)

<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipeline(
<span class="hljs-meta">... </span>    prompt_ids=prompt_ids,
<span class="hljs-meta">... </span>    image=processed_image,
<span class="hljs-meta">... </span>    params=p_params,
<span class="hljs-meta">... </span>    prng_seed=rng,
<span class="hljs-meta">... </span>    strength=<span class="hljs-number">0.75</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    jit=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipeline.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))`}}),{c(){d=s("p"),b=r("Examples:"),u=p(),v(c.$$.fragment)},l(o){d=a(o,"P",{});var m=i(d);b=l(m,"Examples:"),m.forEach(n),u=f(o),w(c.$$.fragment,o)},m(o,m){y(o,d,m),e(d,b),y(o,u,m),I(c,o,m),_=!0},p:rt,i(o){_||(x(c.$$.fragment,o),_=!0)},o(o){M(c.$$.fragment,o),_=!1},d(o){o&&n(d),o&&n(u),T(c,o)}}}function Hi(j){let d,b,u,c,_,o,m,B,to,In,dt,no,xn,A,oo,ct,so,ao,Se,io,ro,Mn,pt,lo,Tn,ft,Et,co,Sn,te,Jn,V,ne,Ut,Je,po,Zt,fo,jn,S,je,mo,Wt,uo,go,De,ho,mt,_o,bo,yo,Gt,vo,wo,F,ut,gt,Io,xo,Mo,ht,_t,To,So,Jo,bt,yt,jo,Do,$o,oe,vt,ko,Po,Bt,Eo,Uo,Zo,X,$e,Wo,Ft,Go,Bo,se,Fo,U,ke,No,Nt,Co,Ao,ae,Xo,ie,Lo,re,Pe,zo,Ee,Ro,Ct,Vo,Yo,qo,Z,Ue,Qo,Ze,Ho,We,Oo,Ko,es,le,ts,de,ns,ce,Ge,os,Be,ss,Fe,as,is,rs,D,Ne,ls,Ce,ds,wt,cs,ps,fs,At,ms,us,pe,gs,Ae,hs,Xe,_s,bs,ys,fe,vs,L,Le,ws,P,Is,It,xs,Ms,Xt,Ts,Ss,Lt,Js,js,zt,Ds,$s,ks,me,Ps,$,ze,Es,N,Us,Rt,Zs,Ws,Vt,Gs,Bs,Yt,Fs,Ns,Cs,Re,As,qt,Xs,Ls,zs,Ve,Rs,xt,Vs,Ys,qs,Y,Qs,Mt,Hs,Os,Qt,Ks,ea,ta,q,na,Tt,oa,sa,Ht,aa,ia,ra,ue,Ye,la,Ot,da,ca,ge,qe,pa,Kt,fa,Dn,Q,he,en,Qe,ma,tn,ua,$n,H,He,ga,nn,ha,kn,O,_e,on,Oe,_a,sn,ba,Pn,E,Ke,ya,an,va,wa,et,Ia,St,xa,Ma,Ta,z,tt,Sa,rn,Ja,ja,be,En,K,ye,ln,nt,Da,dn,$a,Un,C,ot,ka,cn,Pa,Ea,ve,st,Ua,pn,Za,Zn;return o=new wn({}),te=new Fa({props:{$$slots:{default:[Ci]},$$scope:{ctx:j}}}),Je=new wn({}),je=new k({props:{name:"class diffusers.StableDiffusionImg2ImgPipeline",anchor:"diffusers.StableDiffusionImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L96"}}),$e=new k({props:{name:"__call__",anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": typing.Optional[int] = 50"},{name:"guidance_scale",val:": typing.Optional[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:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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.StableDiffusionImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, numpy array or tensor representing an image batch to be used as the starting point. For both
numpy array and pytorch tensor, the expected value range is between <code>[0, 1]</code> If it&#x2019;s a tensor or a list
or tensors, the expected shape should be <code>(B, C, H, W)</code> or <code>(C, H, W)</code>. If it is a numpy array or a
list of arrays, the expected shape should be <code>(B, H, W, C)</code> or <code>(H, W, C)</code> It can also accept image
latents as <code>image</code>, but if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Indicates extent to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code> is used as a
starting point and more noise is added the higher the <code>strength</code>. The number of denoising steps depends
on the amount of noise initially added. When <code>strength</code> is 1, added noise is maximum and the denoising
process runs for the full number of iterations specified in <code>num_inference_steps</code>. A value of 1
essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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. This parameter is modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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.StableDiffusionImg2ImgPipeline.__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.StableDiffusionImg2ImgPipeline.__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.StableDiffusionImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.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.StableDiffusionImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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.StableDiffusionImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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.StableDiffusionImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L566",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),se=new it({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[Ai]},$$scope:{ctx:j}}}),ke=new k({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),ae=new Fa({props:{warning:!0,$$slots:{default:[Xi]},$$scope:{ctx:j}}}),ie=new it({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[Li]},$$scope:{ctx:j}}}),Pe=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),Ue=new k({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),le=new Fa({props:{warning:!0,$$slots:{default:[zi]},$$scope:{ctx:j}}}),de=new it({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Ri]},$$scope:{ctx:j}}}),Ge=new k({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),Ne=new k({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"text_encoder",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
If not specified, function will take self.tokenizer.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text. If not specified, function will take self.tokenizer.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L687"}}),pe=new it({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[Vi]},$$scope:{ctx:j}}}),fe=new it({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[Yi]},$$scope:{ctx:j}}}),Le=new k({props:{name:"from_single_file",anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better for continuing finetuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it is automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTextModel</code> to use, specifically the
<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant. If this
parameter is <code>None</code>, the function loads a new instance of <code>CLIPTextModel</code> by itself if needed.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.vae",description:`<strong>vae</strong> (<code>AutoencoderKL</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations. If
this parameter is <code>None</code>, the function will load a new instance of [CLIP] by itself, if needed.`,name:"vae"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTokenizer</code> to use. If this parameter is <code>None</code>, the function loads a new instance
of <code>CLIPTokenizer</code> by itself if needed.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.original_config_file",description:`<strong>original_config_file</strong> (<code>str</code>) &#x2014;
Path to <code>.yaml</code> config file corresponding to the original architecture. If <code>None</code>, will be
automatically inferred by looking for a key that only exists in SD2.0 models.`,name:"original_config_file"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L1999"}}),me=new it({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.example",$$slots:{default:[qi]},$$scope:{ctx:j}}}),ze=new k({props:{name:"load_lora_weights",anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
See <a href="/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L991"}}),Ye=new k({props:{name:"save_lora_weights",anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save LoRA parameters to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>unet</code>.`,name:"unet_lora_layers"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.text_encoder_lora_layers",description:`<strong>text_encoder_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_lora_layers"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L1623"}}),qe=new k({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.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.StableDiffusionImg2ImgPipeline.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.StableDiffusionImg2ImgPipeline.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.StableDiffusionImg2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L256"}}),Qe=new wn({}),He=new k({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),Oe=new wn({}),Ke=new k({props:{name:"class diffusers.FlaxStableDiffusionImg2ImgPipeline",anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014;
A <code>FlaxUNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L105"}}),tt=new k({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"image",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"noise",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.prompt_ids",description:`<strong>prompt_ids</strong> (<code>jnp.array</code>) &#x2014;
The prompt or prompts to guide image generation.`,name:"prompt_ids"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>jnp.array</code>) &#x2014;
Array representing an image batch to be used as the starting point.`,name:"image"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.params",description:`<strong>params</strong> (<code>Dict</code> or <code>FrozenDict</code>) &#x2014;
Dictionary containing the model parameters/weights.`,name:"params"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.prng_seed",description:`<strong>prng_seed</strong> (<code>jax.random.KeyArray</code> or <code>jax.Array</code>) &#x2014;
Array containing random number generator key.`,name:"prng_seed"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Indicates extent to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code> is used as a
starting point and more noise is added the higher the <code>strength</code>. The number of denoising steps depends
on the amount of noise initially added. When <code>strength</code> is 1, added noise is maximum and the denoising
process runs for the full number of iterations specified in <code>num_inference_steps</code>. A value of 1
essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__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. This parameter is modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__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.FlaxStableDiffusionImg2ImgPipeline.__call__.noise",description:`<strong>noise</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. The array is generated by
sampling using the supplied random <code>generator</code>.`,name:"noise"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>This argument exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a
future release.</p>

					</div>`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L337",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated images
and the second element is a list of <code>bool</code>s indicating whether the corresponding generated image
contains \u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),be=new it({props:{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[Qi]},$$scope:{ctx:j}}}),nt=new wn({}),ot=new k({props:{name:"class diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",parameters:[{name:"images",val:": ndarray"},{name:"nsfw_content_detected",val:": typing.List[bool]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>np.ndarray</code>) &#x2014;
Denoised images of array shape of <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content
or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L36"}}),st=new k({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/flax/struct.py#L111"}}),{c(){d=s("meta"),b=p(),u=s("h1"),c=s("a"),_=s("span"),v(o.$$.fragment),m=p(),B=s("span"),to=r("Image-to-image"),In=p(),dt=s("p"),no=r("The Stable Diffusion model can also be applied to image-to-image generation by passing a text prompt and an initial image to condition the generation of new images."),xn=p(),A=s("p"),oo=r("The "),ct=s("a"),so=r("StableDiffusionImg2ImgPipeline"),ao=r(" uses the diffusion-denoising mechanism proposed in "),Se=s("a"),io=r("SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),ro=r(" by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon."),Mn=p(),pt=s("p"),lo=r("The abstract from the paper is:"),Tn=p(),ft=s("p"),Et=s("em"),co=r("Guided image synthesis enables everyday users to create and edit photo-realistic images with minimum effort. The key challenge is balancing faithfulness to the user input (e.g., hand-drawn colored strokes) and realism of the synthesized image. Existing GAN-based methods attempt to achieve such balance using either conditional GANs or GAN inversions, which are challenging and often require additional training data or loss functions for individual applications. To address these issues, we introduce a new image synthesis and editing method, Stochastic Differential Editing (SDEdit), based on a diffusion model generative prior, which synthesizes realistic images by iteratively denoising through a stochastic differential equation (SDE). Given an input image with user guide of any type, SDEdit first adds noise to the input, then subsequently denoises the resulting image through the SDE prior to increase its realism. SDEdit does not require task-specific training or inversions and can naturally achieve the balance between realism and faithfulness. SDEdit significantly outperforms state-of-the-art GAN-based methods by up to 98.09% on realism and 91.72% on overall satisfaction scores, according to a human perception study, on multiple tasks, including stroke-based image synthesis and editing as well as image compositing."),Sn=p(),v(te.$$.fragment),Jn=p(),V=s("h2"),ne=s("a"),Ut=s("span"),v(Je.$$.fragment),po=p(),Zt=s("span"),fo=r("StableDiffusionImg2ImgPipeline"),jn=p(),S=s("div"),v(je.$$.fragment),mo=p(),Wt=s("p"),uo=r("Pipeline for text-guided image-to-image generation using Stable Diffusion."),go=p(),De=s("p"),ho=r("This model inherits from "),mt=s("a"),_o=r("DiffusionPipeline"),bo=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),yo=p(),Gt=s("p"),vo=r("The pipeline also inherits the following loading methods:"),wo=p(),F=s("ul"),ut=s("li"),gt=s("a"),Io=r("load_textual_inversion()"),xo=r(" for loading textual inversion embeddings"),Mo=p(),ht=s("li"),_t=s("a"),To=r("load_lora_weights()"),So=r(" for loading LoRA weights"),Jo=p(),bt=s("li"),yt=s("a"),jo=r("save_lora_weights()"),Do=r(" for saving LoRA weights"),$o=p(),oe=s("li"),vt=s("a"),ko=r("from_single_file()"),Po=r(" for loading "),Bt=s("code"),Eo=r(".ckpt"),Uo=r(" files"),Zo=p(),X=s("div"),v($e.$$.fragment),Wo=p(),Ft=s("p"),Go=r("The call function to the pipeline for generation."),Bo=p(),v(se.$$.fragment),Fo=p(),U=s("div"),v(ke.$$.fragment),No=p(),Nt=s("p"),Co=r(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Ao=p(),v(ae.$$.fragment),Xo=p(),v(ie.$$.fragment),Lo=p(),re=s("div"),v(Pe.$$.fragment),zo=p(),Ee=s("p"),Ro=r("Disable sliced attention computation. If "),Ct=s("code"),Vo=r("enable_attention_slicing"),Yo=r(` was previously called, attention is
computed in one step.`),qo=p(),Z=s("div"),v(Ue.$$.fragment),Qo=p(),Ze=s("p"),Ho=r("Enable memory efficient attention from "),We=s("a"),Oo=r("xFormers"),Ko=r(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),es=p(),v(le.$$.fragment),ts=p(),v(de.$$.fragment),ns=p(),ce=s("div"),v(Ge.$$.fragment),os=p(),Be=s("p"),ss=r("Disable memory efficient attention from "),Fe=s("a"),as=r("xFormers"),is=r("."),rs=p(),D=s("div"),v(Ne.$$.fragment),ls=p(),Ce=s("p"),ds=r("Load textual inversion embeddings into the text encoder of "),wt=s("a"),cs=r("StableDiffusionPipeline"),ps=r(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),fs=p(),At=s("p"),ms=r("Example:"),us=p(),v(pe.$$.fragment),gs=p(),Ae=s("p"),hs=r(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Xe=s("a"),_s=r("civitAI"),bs=r(") and then load the vector"),ys=p(),v(fe.$$.fragment),vs=p(),L=s("div"),v(Le.$$.fragment),ws=p(),P=s("p"),Is=r("Instantiate a "),It=s("a"),xs=r("DiffusionPipeline"),Ms=r(" from pretrained pipeline weights saved in the "),Xt=s("code"),Ts=r(".ckpt"),Ss=r(" or "),Lt=s("code"),Js=r(".safetensors"),js=r(`
format. The pipeline is set in evaluation mode (`),zt=s("code"),Ds=r("model.eval()"),$s=r(") by default."),ks=p(),v(me.$$.fragment),Ps=p(),$=s("div"),v(ze.$$.fragment),Es=p(),N=s("p"),Us=r("Load LoRA weights specified in "),Rt=s("code"),Zs=r("pretrained_model_name_or_path_or_dict"),Ws=r(" into "),Vt=s("code"),Gs=r("self.unet"),Bs=r(` and
`),Yt=s("code"),Fs=r("self.text_encoder"),Ns=r("."),Cs=p(),Re=s("p"),As=r("All kwargs are forwarded to "),qt=s("code"),Xs=r("self.lora_state_dict"),Ls=r("."),zs=p(),Ve=s("p"),Rs=r("See "),xt=s("a"),Vs=r("lora_state_dict()"),Ys=r(" for more details on how the state dict is loaded."),qs=p(),Y=s("p"),Qs=r("See "),Mt=s("a"),Hs=r("load_lora_into_unet()"),Os=r(` for more details on how the state dict is loaded into
`),Qt=s("code"),Ks=r("self.unet"),ea=r("."),ta=p(),q=s("p"),na=r("See "),Tt=s("a"),oa=r("load_lora_into_text_encoder()"),sa=r(` for more details on how the state dict is loaded
into `),Ht=s("code"),aa=r("self.text_encoder"),ia=r("."),ra=p(),ue=s("div"),v(Ye.$$.fragment),la=p(),Ot=s("p"),da=r("Save the LoRA parameters corresponding to the UNet and text encoder."),ca=p(),ge=s("div"),v(qe.$$.fragment),pa=p(),Kt=s("p"),fa=r("Encodes the prompt into text encoder hidden states."),Dn=p(),Q=s("h2"),he=s("a"),en=s("span"),v(Qe.$$.fragment),ma=p(),tn=s("span"),ua=r("StableDiffusionPipelineOutput"),$n=p(),H=s("div"),v(He.$$.fragment),ga=p(),nn=s("p"),ha=r("Output class for Stable Diffusion pipelines."),kn=p(),O=s("h2"),_e=s("a"),on=s("span"),v(Oe.$$.fragment),_a=p(),sn=s("span"),ba=r("FlaxStableDiffusionImg2ImgPipeline"),Pn=p(),E=s("div"),v(Ke.$$.fragment),ya=p(),an=s("p"),va=r("Flax-based pipeline for text-guided image-to-image generation using Stable Diffusion."),wa=p(),et=s("p"),Ia=r("This model inherits from "),St=s("a"),xa=r("FlaxDiffusionPipeline"),Ma=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ta=p(),z=s("div"),v(tt.$$.fragment),Sa=p(),rn=s("p"),Ja=r("The call function to the pipeline for generation."),ja=p(),v(be.$$.fragment),En=p(),K=s("h2"),ye=s("a"),ln=s("span"),v(nt.$$.fragment),Da=p(),dn=s("span"),$a=r("FlaxStableDiffusionPipelineOutput"),Un=p(),C=s("div"),v(ot.$$.fragment),ka=p(),cn=s("p"),Pa=r("Output class for Flax-based Stable Diffusion pipelines."),Ea=p(),ve=s("div"),v(st.$$.fragment),Ua=p(),pn=s("p"),Za=r("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(t){const h=Fi('[data-svelte="svelte-1phssyn"]',document.head);d=a(h,"META",{name:!0,content:!0}),h.forEach(n),b=f(t),u=a(t,"H1",{class:!0});var at=i(u);c=a(at,"A",{id:!0,class:!0,href:!0});var fn=i(c);_=a(fn,"SPAN",{});var mn=i(_);w(o.$$.fragment,mn),mn.forEach(n),fn.forEach(n),m=f(at),B=a(at,"SPAN",{});var un=i(B);to=l(un,"Image-to-image"),un.forEach(n),at.forEach(n),In=f(t),dt=a(t,"P",{});var gn=i(dt);no=l(gn,"The Stable Diffusion model can also be applied to image-to-image generation by passing a text prompt and an initial image to condition the generation of new images."),gn.forEach(n),xn=f(t),A=a(t,"P",{});var ee=i(A);oo=l(ee,"The "),ct=a(ee,"A",{href:!0});var hn=i(ct);so=l(hn,"StableDiffusionImg2ImgPipeline"),hn.forEach(n),ao=l(ee," uses the diffusion-denoising mechanism proposed in "),Se=a(ee,"A",{href:!0,rel:!0});var _n=i(Se);io=l(_n,"SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),_n.forEach(n),ro=l(ee," by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon."),ee.forEach(n),Mn=f(t),pt=a(t,"P",{});var bn=i(pt);lo=l(bn,"The abstract from the paper is:"),bn.forEach(n),Tn=f(t),ft=a(t,"P",{});var yn=i(ft);Et=a(yn,"EM",{});var Na=i(Et);co=l(Na,"Guided image synthesis enables everyday users to create and edit photo-realistic images with minimum effort. The key challenge is balancing faithfulness to the user input (e.g., hand-drawn colored strokes) and realism of the synthesized image. Existing GAN-based methods attempt to achieve such balance using either conditional GANs or GAN inversions, which are challenging and often require additional training data or loss functions for individual applications. To address these issues, we introduce a new image synthesis and editing method, Stochastic Differential Editing (SDEdit), based on a diffusion model generative prior, which synthesizes realistic images by iteratively denoising through a stochastic differential equation (SDE). Given an input image with user guide of any type, SDEdit first adds noise to the input, then subsequently denoises the resulting image through the SDE prior to increase its realism. SDEdit does not require task-specific training or inversions and can naturally achieve the balance between realism and faithfulness. SDEdit significantly outperforms state-of-the-art GAN-based methods by up to 98.09% on realism and 91.72% on overall satisfaction scores, according to a human perception study, on multiple tasks, including stroke-based image synthesis and editing as well as image compositing."),Na.forEach(n),yn.forEach(n),Sn=f(t),w(te.$$.fragment,t),Jn=f(t),V=a(t,"H2",{class:!0});var Wn=i(V);ne=a(Wn,"A",{id:!0,class:!0,href:!0});var Ca=i(ne);Ut=a(Ca,"SPAN",{});var Aa=i(Ut);w(Je.$$.fragment,Aa),Aa.forEach(n),Ca.forEach(n),po=f(Wn),Zt=a(Wn,"SPAN",{});var Xa=i(Zt);fo=l(Xa,"StableDiffusionImg2ImgPipeline"),Xa.forEach(n),Wn.forEach(n),jn=f(t),S=a(t,"DIV",{class:!0});var J=i(S);w(je.$$.fragment,J),mo=f(J),Wt=a(J,"P",{});var La=i(Wt);uo=l(La,"Pipeline for text-guided image-to-image generation using Stable Diffusion."),La.forEach(n),go=f(J),De=a(J,"P",{});var Gn=i(De);ho=l(Gn,"This model inherits from "),mt=a(Gn,"A",{href:!0});var za=i(mt);_o=l(za,"DiffusionPipeline"),za.forEach(n),bo=l(Gn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Gn.forEach(n),yo=f(J),Gt=a(J,"P",{});var Ra=i(Gt);vo=l(Ra,"The pipeline also inherits the following loading methods:"),Ra.forEach(n),wo=f(J),F=a(J,"UL",{});var we=i(F);ut=a(we,"LI",{});var Wa=i(ut);gt=a(Wa,"A",{href:!0});var Va=i(gt);Io=l(Va,"load_textual_inversion()"),Va.forEach(n),xo=l(Wa," for loading textual inversion embeddings"),Wa.forEach(n),Mo=f(we),ht=a(we,"LI",{});var Ga=i(ht);_t=a(Ga,"A",{href:!0});var Ya=i(_t);To=l(Ya,"load_lora_weights()"),Ya.forEach(n),So=l(Ga," for loading LoRA weights"),Ga.forEach(n),Jo=f(we),bt=a(we,"LI",{});var Ba=i(bt);yt=a(Ba,"A",{href:!0});var qa=i(yt);jo=l(qa,"save_lora_weights()"),qa.forEach(n),Do=l(Ba," for saving LoRA weights"),Ba.forEach(n),$o=f(we),oe=a(we,"LI",{});var vn=i(oe);vt=a(vn,"A",{href:!0});var Qa=i(vt);ko=l(Qa,"from_single_file()"),Qa.forEach(n),Po=l(vn," for loading "),Bt=a(vn,"CODE",{});var Ha=i(Bt);Eo=l(Ha,".ckpt"),Ha.forEach(n),Uo=l(vn," files"),vn.forEach(n),we.forEach(n),Zo=f(J),X=a(J,"DIV",{class:!0});var Jt=i(X);w($e.$$.fragment,Jt),Wo=f(Jt),Ft=a(Jt,"P",{});var Oa=i(Ft);Go=l(Oa,"The call function to the pipeline for generation."),Oa.forEach(n),Bo=f(Jt),w(se.$$.fragment,Jt),Jt.forEach(n),Fo=f(J),U=a(J,"DIV",{class:!0});var Ie=i(U);w(ke.$$.fragment,Ie),No=f(Ie),Nt=a(Ie,"P",{});var Ka=i(Nt);Co=l(Ka,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Ka.forEach(n),Ao=f(Ie),w(ae.$$.fragment,Ie),Xo=f(Ie),w(ie.$$.fragment,Ie),Ie.forEach(n),Lo=f(J),re=a(J,"DIV",{class:!0});var Bn=i(re);w(Pe.$$.fragment,Bn),zo=f(Bn),Ee=a(Bn,"P",{});var Fn=i(Ee);Ro=l(Fn,"Disable sliced attention computation. If "),Ct=a(Fn,"CODE",{});var ei=i(Ct);Vo=l(ei,"enable_attention_slicing"),ei.forEach(n),Yo=l(Fn,` was previously called, attention is
computed in one step.`),Fn.forEach(n),Bn.forEach(n),qo=f(J),Z=a(J,"DIV",{class:!0});var xe=i(Z);w(Ue.$$.fragment,xe),Qo=f(xe),Ze=a(xe,"P",{});var Nn=i(Ze);Ho=l(Nn,"Enable memory efficient attention from "),We=a(Nn,"A",{href:!0,rel:!0});var ti=i(We);Oo=l(ti,"xFormers"),ti.forEach(n),Ko=l(Nn,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Nn.forEach(n),es=f(xe),w(le.$$.fragment,xe),ts=f(xe),w(de.$$.fragment,xe),xe.forEach(n),ns=f(J),ce=a(J,"DIV",{class:!0});var Cn=i(ce);w(Ge.$$.fragment,Cn),os=f(Cn),Be=a(Cn,"P",{});var An=i(Be);ss=l(An,"Disable memory efficient attention from "),Fe=a(An,"A",{href:!0,rel:!0});var ni=i(Fe);as=l(ni,"xFormers"),ni.forEach(n),is=l(An,"."),An.forEach(n),Cn.forEach(n),rs=f(J),D=a(J,"DIV",{class:!0});var W=i(D);w(Ne.$$.fragment,W),ls=f(W),Ce=a(W,"P",{});var Xn=i(Ce);ds=l(Xn,"Load textual inversion embeddings into the text encoder of "),wt=a(Xn,"A",{href:!0});var oi=i(wt);cs=l(oi,"StableDiffusionPipeline"),oi.forEach(n),ps=l(Xn,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Xn.forEach(n),fs=f(W),At=a(W,"P",{});var si=i(At);ms=l(si,"Example:"),si.forEach(n),us=f(W),w(pe.$$.fragment,W),gs=f(W),Ae=a(W,"P",{});var Ln=i(Ae);hs=l(Ln,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Xe=a(Ln,"A",{href:!0,rel:!0});var ai=i(Xe);_s=l(ai,"civitAI"),ai.forEach(n),bs=l(Ln,") and then load the vector"),Ln.forEach(n),ys=f(W),w(fe.$$.fragment,W),W.forEach(n),vs=f(J),L=a(J,"DIV",{class:!0});var jt=i(L);w(Le.$$.fragment,jt),ws=f(jt),P=a(jt,"P",{});var R=i(P);Is=l(R,"Instantiate a "),It=a(R,"A",{href:!0});var ii=i(It);xs=l(ii,"DiffusionPipeline"),ii.forEach(n),Ms=l(R," from pretrained pipeline weights saved in the "),Xt=a(R,"CODE",{});var ri=i(Xt);Ts=l(ri,".ckpt"),ri.forEach(n),Ss=l(R," or "),Lt=a(R,"CODE",{});var li=i(Lt);Js=l(li,".safetensors"),li.forEach(n),js=l(R,`
format. The pipeline is set in evaluation mode (`),zt=a(R,"CODE",{});var di=i(zt);Ds=l(di,"model.eval()"),di.forEach(n),$s=l(R,") by default."),R.forEach(n),ks=f(jt),w(me.$$.fragment,jt),jt.forEach(n),Ps=f(J),$=a(J,"DIV",{class:!0});var G=i($);w(ze.$$.fragment,G),Es=f(G),N=a(G,"P",{});var Me=i(N);Us=l(Me,"Load LoRA weights specified in "),Rt=a(Me,"CODE",{});var ci=i(Rt);Zs=l(ci,"pretrained_model_name_or_path_or_dict"),ci.forEach(n),Ws=l(Me," into "),Vt=a(Me,"CODE",{});var pi=i(Vt);Gs=l(pi,"self.unet"),pi.forEach(n),Bs=l(Me,` and
`),Yt=a(Me,"CODE",{});var fi=i(Yt);Fs=l(fi,"self.text_encoder"),fi.forEach(n),Ns=l(Me,"."),Me.forEach(n),Cs=f(G),Re=a(G,"P",{});var zn=i(Re);As=l(zn,"All kwargs are forwarded to "),qt=a(zn,"CODE",{});var mi=i(qt);Xs=l(mi,"self.lora_state_dict"),mi.forEach(n),Ls=l(zn,"."),zn.forEach(n),zs=f(G),Ve=a(G,"P",{});var Rn=i(Ve);Rs=l(Rn,"See "),xt=a(Rn,"A",{href:!0});var ui=i(xt);Vs=l(ui,"lora_state_dict()"),ui.forEach(n),Ys=l(Rn," for more details on how the state dict is loaded."),Rn.forEach(n),qs=f(G),Y=a(G,"P",{});var Dt=i(Y);Qs=l(Dt,"See "),Mt=a(Dt,"A",{href:!0});var gi=i(Mt);Hs=l(gi,"load_lora_into_unet()"),gi.forEach(n),Os=l(Dt,` for more details on how the state dict is loaded into
`),Qt=a(Dt,"CODE",{});var hi=i(Qt);Ks=l(hi,"self.unet"),hi.forEach(n),ea=l(Dt,"."),Dt.forEach(n),ta=f(G),q=a(G,"P",{});var $t=i(q);na=l($t,"See "),Tt=a($t,"A",{href:!0});var _i=i(Tt);oa=l(_i,"load_lora_into_text_encoder()"),_i.forEach(n),sa=l($t,` for more details on how the state dict is loaded
into `),Ht=a($t,"CODE",{});var bi=i(Ht);aa=l(bi,"self.text_encoder"),bi.forEach(n),ia=l($t,"."),$t.forEach(n),G.forEach(n),ra=f(J),ue=a(J,"DIV",{class:!0});var Vn=i(ue);w(Ye.$$.fragment,Vn),la=f(Vn),Ot=a(Vn,"P",{});var yi=i(Ot);da=l(yi,"Save the LoRA parameters corresponding to the UNet and text encoder."),yi.forEach(n),Vn.forEach(n),ca=f(J),ge=a(J,"DIV",{class:!0});var Yn=i(ge);w(qe.$$.fragment,Yn),pa=f(Yn),Kt=a(Yn,"P",{});var vi=i(Kt);fa=l(vi,"Encodes the prompt into text encoder hidden states."),vi.forEach(n),Yn.forEach(n),J.forEach(n),Dn=f(t),Q=a(t,"H2",{class:!0});var qn=i(Q);he=a(qn,"A",{id:!0,class:!0,href:!0});var wi=i(he);en=a(wi,"SPAN",{});var Ii=i(en);w(Qe.$$.fragment,Ii),Ii.forEach(n),wi.forEach(n),ma=f(qn),tn=a(qn,"SPAN",{});var xi=i(tn);ua=l(xi,"StableDiffusionPipelineOutput"),xi.forEach(n),qn.forEach(n),$n=f(t),H=a(t,"DIV",{class:!0});var Qn=i(H);w(He.$$.fragment,Qn),ga=f(Qn),nn=a(Qn,"P",{});var Mi=i(nn);ha=l(Mi,"Output class for Stable Diffusion pipelines."),Mi.forEach(n),Qn.forEach(n),kn=f(t),O=a(t,"H2",{class:!0});var Hn=i(O);_e=a(Hn,"A",{id:!0,class:!0,href:!0});var Ti=i(_e);on=a(Ti,"SPAN",{});var Si=i(on);w(Oe.$$.fragment,Si),Si.forEach(n),Ti.forEach(n),_a=f(Hn),sn=a(Hn,"SPAN",{});var Ji=i(sn);ba=l(Ji,"FlaxStableDiffusionImg2ImgPipeline"),Ji.forEach(n),Hn.forEach(n),Pn=f(t),E=a(t,"DIV",{class:!0});var Te=i(E);w(Ke.$$.fragment,Te),ya=f(Te),an=a(Te,"P",{});var ji=i(an);va=l(ji,"Flax-based pipeline for text-guided image-to-image generation using Stable Diffusion."),ji.forEach(n),wa=f(Te),et=a(Te,"P",{});var On=i(et);Ia=l(On,"This model inherits from "),St=a(On,"A",{href:!0});var Di=i(St);xa=l(Di,"FlaxDiffusionPipeline"),Di.forEach(n),Ma=l(On,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),On.forEach(n),Ta=f(Te),z=a(Te,"DIV",{class:!0});var kt=i(z);w(tt.$$.fragment,kt),Sa=f(kt),rn=a(kt,"P",{});var $i=i(rn);Ja=l($i,"The call function to the pipeline for generation."),$i.forEach(n),ja=f(kt),w(be.$$.fragment,kt),kt.forEach(n),Te.forEach(n),En=f(t),K=a(t,"H2",{class:!0});var Kn=i(K);ye=a(Kn,"A",{id:!0,class:!0,href:!0});var ki=i(ye);ln=a(ki,"SPAN",{});var Pi=i(ln);w(nt.$$.fragment,Pi),Pi.forEach(n),ki.forEach(n),Da=f(Kn),dn=a(Kn,"SPAN",{});var Ei=i(dn);$a=l(Ei,"FlaxStableDiffusionPipelineOutput"),Ei.forEach(n),Kn.forEach(n),Un=f(t),C=a(t,"DIV",{class:!0});var Pt=i(C);w(ot.$$.fragment,Pt),ka=f(Pt),cn=a(Pt,"P",{});var Ui=i(cn);Pa=l(Ui,"Output class for Flax-based Stable Diffusion pipelines."),Ui.forEach(n),Ea=f(Pt),ve=a(Pt,"DIV",{class:!0});var eo=i(ve);w(st.$$.fragment,eo),Ua=f(eo),pn=a(eo,"P",{});var Zi=i(pn);Za=l(Zi,"\u201CReturns a new object replacing the specified fields with new values."),Zi.forEach(n),eo.forEach(n),Pt.forEach(n),this.h()},h(){g(d,"name","hf:doc:metadata"),g(d,"content",JSON.stringify(Oi)),g(c,"id","imagetoimage"),g(c,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(c,"href","#imagetoimage"),g(u,"class","relative group"),g(ct,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),g(Se,"href","https://huggingface.co/papers/2108.01073"),g(Se,"rel","nofollow"),g(ne,"id","diffusers.StableDiffusionImg2ImgPipeline"),g(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(ne,"href","#diffusers.StableDiffusionImg2ImgPipeline"),g(V,"class","relative group"),g(mt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(gt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),g(_t,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),g(yt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),g(vt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),g(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(We,"href","https://facebookresearch.github.io/xformers/"),g(We,"rel","nofollow"),g(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Fe,"href","https://facebookresearch.github.io/xformers/"),g(Fe,"rel","nofollow"),g(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(wt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),g(Xe,"href","https://civitai.com/models/3036?modelVersionId=9857"),g(Xe,"rel","nofollow"),g(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(It,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(xt,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),g(Mt,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),g(Tt,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),g($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(he,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),g(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(he,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),g(Q,"class","relative group"),g(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(_e,"id","diffusers.FlaxStableDiffusionImg2ImgPipeline"),g(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(_e,"href","#diffusers.FlaxStableDiffusionImg2ImgPipeline"),g(O,"class","relative group"),g(St,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),g(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ye,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),g(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(ye,"href","#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),g(K,"class","relative group"),g(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,d),y(t,b,h),y(t,u,h),e(u,c),e(c,_),I(o,_,null),e(u,m),e(u,B),e(B,to),y(t,In,h),y(t,dt,h),e(dt,no),y(t,xn,h),y(t,A,h),e(A,oo),e(A,ct),e(ct,so),e(A,ao),e(A,Se),e(Se,io),e(A,ro),y(t,Mn,h),y(t,pt,h),e(pt,lo),y(t,Tn,h),y(t,ft,h),e(ft,Et),e(Et,co),y(t,Sn,h),I(te,t,h),y(t,Jn,h),y(t,V,h),e(V,ne),e(ne,Ut),I(Je,Ut,null),e(V,po),e(V,Zt),e(Zt,fo),y(t,jn,h),y(t,S,h),I(je,S,null),e(S,mo),e(S,Wt),e(Wt,uo),e(S,go),e(S,De),e(De,ho),e(De,mt),e(mt,_o),e(De,bo),e(S,yo),e(S,Gt),e(Gt,vo),e(S,wo),e(S,F),e(F,ut),e(ut,gt),e(gt,Io),e(ut,xo),e(F,Mo),e(F,ht),e(ht,_t),e(_t,To),e(ht,So),e(F,Jo),e(F,bt),e(bt,yt),e(yt,jo),e(bt,Do),e(F,$o),e(F,oe),e(oe,vt),e(vt,ko),e(oe,Po),e(oe,Bt),e(Bt,Eo),e(oe,Uo),e(S,Zo),e(S,X),I($e,X,null),e(X,Wo),e(X,Ft),e(Ft,Go),e(X,Bo),I(se,X,null),e(S,Fo),e(S,U),I(ke,U,null),e(U,No),e(U,Nt),e(Nt,Co),e(U,Ao),I(ae,U,null),e(U,Xo),I(ie,U,null),e(S,Lo),e(S,re),I(Pe,re,null),e(re,zo),e(re,Ee),e(Ee,Ro),e(Ee,Ct),e(Ct,Vo),e(Ee,Yo),e(S,qo),e(S,Z),I(Ue,Z,null),e(Z,Qo),e(Z,Ze),e(Ze,Ho),e(Ze,We),e(We,Oo),e(Ze,Ko),e(Z,es),I(le,Z,null),e(Z,ts),I(de,Z,null),e(S,ns),e(S,ce),I(Ge,ce,null),e(ce,os),e(ce,Be),e(Be,ss),e(Be,Fe),e(Fe,as),e(Be,is),e(S,rs),e(S,D),I(Ne,D,null),e(D,ls),e(D,Ce),e(Ce,ds),e(Ce,wt),e(wt,cs),e(Ce,ps),e(D,fs),e(D,At),e(At,ms),e(D,us),I(pe,D,null),e(D,gs),e(D,Ae),e(Ae,hs),e(Ae,Xe),e(Xe,_s),e(Ae,bs),e(D,ys),I(fe,D,null),e(S,vs),e(S,L),I(Le,L,null),e(L,ws),e(L,P),e(P,Is),e(P,It),e(It,xs),e(P,Ms),e(P,Xt),e(Xt,Ts),e(P,Ss),e(P,Lt),e(Lt,Js),e(P,js),e(P,zt),e(zt,Ds),e(P,$s),e(L,ks),I(me,L,null),e(S,Ps),e(S,$),I(ze,$,null),e($,Es),e($,N),e(N,Us),e(N,Rt),e(Rt,Zs),e(N,Ws),e(N,Vt),e(Vt,Gs),e(N,Bs),e(N,Yt),e(Yt,Fs),e(N,Ns),e($,Cs),e($,Re),e(Re,As),e(Re,qt),e(qt,Xs),e(Re,Ls),e($,zs),e($,Ve),e(Ve,Rs),e(Ve,xt),e(xt,Vs),e(Ve,Ys),e($,qs),e($,Y),e(Y,Qs),e(Y,Mt),e(Mt,Hs),e(Y,Os),e(Y,Qt),e(Qt,Ks),e(Y,ea),e($,ta),e($,q),e(q,na),e(q,Tt),e(Tt,oa),e(q,sa),e(q,Ht),e(Ht,aa),e(q,ia),e(S,ra),e(S,ue),I(Ye,ue,null),e(ue,la),e(ue,Ot),e(Ot,da),e(S,ca),e(S,ge),I(qe,ge,null),e(ge,pa),e(ge,Kt),e(Kt,fa),y(t,Dn,h),y(t,Q,h),e(Q,he),e(he,en),I(Qe,en,null),e(Q,ma),e(Q,tn),e(tn,ua),y(t,$n,h),y(t,H,h),I(He,H,null),e(H,ga),e(H,nn),e(nn,ha),y(t,kn,h),y(t,O,h),e(O,_e),e(_e,on),I(Oe,on,null),e(O,_a),e(O,sn),e(sn,ba),y(t,Pn,h),y(t,E,h),I(Ke,E,null),e(E,ya),e(E,an),e(an,va),e(E,wa),e(E,et),e(et,Ia),e(et,St),e(St,xa),e(et,Ma),e(E,Ta),e(E,z),I(tt,z,null),e(z,Sa),e(z,rn),e(rn,Ja),e(z,ja),I(be,z,null),y(t,En,h),y(t,K,h),e(K,ye),e(ye,ln),I(nt,ln,null),e(K,Da),e(K,dn),e(dn,$a),y(t,Un,h),y(t,C,h),I(ot,C,null),e(C,ka),e(C,cn),e(cn,Pa),e(C,Ea),e(C,ve),I(st,ve,null),e(ve,Ua),e(ve,pn),e(pn,Za),Zn=!0},p(t,[h]){const at={};h&2&&(at.$$scope={dirty:h,ctx:t}),te.$set(at);const fn={};h&2&&(fn.$$scope={dirty:h,ctx:t}),se.$set(fn);const mn={};h&2&&(mn.$$scope={dirty:h,ctx:t}),ae.$set(mn);const un={};h&2&&(un.$$scope={dirty:h,ctx:t}),ie.$set(un);const gn={};h&2&&(gn.$$scope={dirty:h,ctx:t}),le.$set(gn);const ee={};h&2&&(ee.$$scope={dirty:h,ctx:t}),de.$set(ee);const hn={};h&2&&(hn.$$scope={dirty:h,ctx:t}),pe.$set(hn);const _n={};h&2&&(_n.$$scope={dirty:h,ctx:t}),fe.$set(_n);const bn={};h&2&&(bn.$$scope={dirty:h,ctx:t}),me.$set(bn);const yn={};h&2&&(yn.$$scope={dirty:h,ctx:t}),be.$set(yn)},i(t){Zn||(x(o.$$.fragment,t),x(te.$$.fragment,t),x(Je.$$.fragment,t),x(je.$$.fragment,t),x($e.$$.fragment,t),x(se.$$.fragment,t),x(ke.$$.fragment,t),x(ae.$$.fragment,t),x(ie.$$.fragment,t),x(Pe.$$.fragment,t),x(Ue.$$.fragment,t),x(le.$$.fragment,t),x(de.$$.fragment,t),x(Ge.$$.fragment,t),x(Ne.$$.fragment,t),x(pe.$$.fragment,t),x(fe.$$.fragment,t),x(Le.$$.fragment,t),x(me.$$.fragment,t),x(ze.$$.fragment,t),x(Ye.$$.fragment,t),x(qe.$$.fragment,t),x(Qe.$$.fragment,t),x(He.$$.fragment,t),x(Oe.$$.fragment,t),x(Ke.$$.fragment,t),x(tt.$$.fragment,t),x(be.$$.fragment,t),x(nt.$$.fragment,t),x(ot.$$.fragment,t),x(st.$$.fragment,t),Zn=!0)},o(t){M(o.$$.fragment,t),M(te.$$.fragment,t),M(Je.$$.fragment,t),M(je.$$.fragment,t),M($e.$$.fragment,t),M(se.$$.fragment,t),M(ke.$$.fragment,t),M(ae.$$.fragment,t),M(ie.$$.fragment,t),M(Pe.$$.fragment,t),M(Ue.$$.fragment,t),M(le.$$.fragment,t),M(de.$$.fragment,t),M(Ge.$$.fragment,t),M(Ne.$$.fragment,t),M(pe.$$.fragment,t),M(fe.$$.fragment,t),M(Le.$$.fragment,t),M(me.$$.fragment,t),M(ze.$$.fragment,t),M(Ye.$$.fragment,t),M(qe.$$.fragment,t),M(Qe.$$.fragment,t),M(He.$$.fragment,t),M(Oe.$$.fragment,t),M(Ke.$$.fragment,t),M(tt.$$.fragment,t),M(be.$$.fragment,t),M(nt.$$.fragment,t),M(ot.$$.fragment,t),M(st.$$.fragment,t),Zn=!1},d(t){n(d),t&&n(b),t&&n(u),T(o),t&&n(In),t&&n(dt),t&&n(xn),t&&n(A),t&&n(Mn),t&&n(pt),t&&n(Tn),t&&n(ft),t&&n(Sn),T(te,t),t&&n(Jn),t&&n(V),T(Je),t&&n(jn),t&&n(S),T(je),T($e),T(se),T(ke),T(ae),T(ie),T(Pe),T(Ue),T(le),T(de),T(Ge),T(Ne),T(pe),T(fe),T(Le),T(me),T(ze),T(Ye),T(qe),t&&n(Dn),t&&n(Q),T(Qe),t&&n($n),t&&n(H),T(He),t&&n(kn),t&&n(O),T(Oe),t&&n(Pn),t&&n(E),T(Ke),T(tt),T(be),t&&n(En),t&&n(K),T(nt),t&&n(Un),t&&n(C),T(ot),T(st)}}}const Oi={local:"imagetoimage",sections:[{local:"diffusers.StableDiffusionImg2ImgPipeline",title:"StableDiffusionImg2ImgPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"},{local:"diffusers.FlaxStableDiffusionImg2ImgPipeline",title:"FlaxStableDiffusionImg2ImgPipeline"},{local:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",title:"FlaxStableDiffusionPipelineOutput"}],title:"Image-to-image"};function Ki(j){return Ni(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ir extends Wi{constructor(d){super();Gi(this,d,Ki,Hi,Bi,{})}}export{ir as default,Oi as metadata};
