import{S as Yi,i as qi,s as Qi,e as o,k as p,w as v,t as l,M as Hi,c as a,d as n,m as f,a as i,x as w,h as r,b as g,G as e,g as y,y as I,q as x,o as M,B as T,v as Oi,L as dt}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as qa}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as ct}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Tn}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as rt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ki(j){let d,b,u,c,_;return{c(){d=o("p"),b=l("Make sure to check out the Stable Diffusion "),u=o("a"),c=l("Tips"),_=l(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),this.h()},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"Make sure to check out the Stable Diffusion "),u=a(m,"A",{href:!0});var B=i(u);c=r(B,"Tips"),B.forEach(n),_=r(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(s,m){y(s,d,m),e(d,b),e(d,u),e(u,c),e(d,_)},d(s){s&&n(d)}}}function el(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("Examples:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"Examples:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function tl(j){let d,b,u,c,_;return{c(){d=o("p"),b=l("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=o("code"),c=l("scaled_dot_product_attention"),_=l(` (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(s){d=a(s,"P",{});var m=i(d);b=r(m,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=a(m,"CODE",{});var B=i(u);c=r(B,"scaled_dot_product_attention"),B.forEach(n),_=r(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(s,m){y(s,d,m),e(d,b),e(d,u),e(u,c),e(d,_)},d(s){s&&n(d)}}}function nl(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("Examples:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"Examples:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function sl(j){let d,b;return{c(){d=o("p"),b=l(`\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=r(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 ol(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("Examples:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"Examples:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function al(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function il(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("locally:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"locally:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function ll(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("Examples:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"Examples:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function rl(j){let d,b,u,c,_;return c=new ct({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=o("p"),b=l("Examples:"),u=p(),v(c.$$.fragment)},l(s){d=a(s,"P",{});var m=i(d);b=r(m,"Examples:"),m.forEach(n),u=f(s),w(c.$$.fragment,s)},m(s,m){y(s,d,m),e(d,b),y(s,u,m),I(c,s,m),_=!0},p:dt,i(s){_||(x(c.$$.fragment,s),_=!0)},o(s){M(c.$$.fragment,s),_=!1},d(s){s&&n(d),s&&n(u),T(c,s)}}}function dl(j){let d,b,u,c,_,s,m,B,as,Jn,pt,is,Sn,X,ls,ft,rs,ds,je,cs,ps,jn,mt,fs,$n,ut,Zt,ms,Dn,ne,kn,Y,se,Wt,$e,us,Gt,gs,Pn,J,De,hs,Bt,_s,bs,ke,ys,gt,vs,ws,Is,Ft,xs,Ms,F,ht,_t,Ts,Js,Ss,bt,yt,js,$s,Ds,vt,wt,ks,Ps,Es,oe,It,Us,Zs,Nt,Ws,Gs,Bs,L,Pe,Fs,Ct,Ns,Cs,ae,As,U,Ee,Xs,At,Ls,Vs,ie,Rs,le,zs,re,Ue,Ys,Ze,qs,Xt,Qs,Hs,Os,Z,We,Ks,Ge,eo,Be,to,no,so,de,oo,ce,ao,pe,Fe,io,Ne,lo,Ce,ro,co,po,$,Ae,fo,Xe,mo,xt,uo,go,ho,Lt,_o,bo,fe,yo,Le,vo,Ve,wo,Io,xo,me,Mo,V,Re,To,P,Jo,Mt,So,jo,Vt,$o,Do,Rt,ko,Po,zt,Eo,Uo,Zo,ue,Wo,D,ze,Go,N,Bo,Yt,Fo,No,qt,Co,Ao,Qt,Xo,Lo,Vo,Ye,Ro,Ht,zo,Yo,qo,qe,Qo,Tt,Ho,Oo,Ko,q,ea,Jt,ta,na,Ot,sa,oa,aa,Q,ia,St,la,ra,Kt,da,ca,pa,ge,Qe,fa,en,ma,ua,he,He,ga,C,ha,tn,_a,ba,nn,ya,va,sn,wa,Ia,En,H,_e,on,Oe,xa,an,Ma,Un,O,Ke,Ta,ln,Ja,Zn,K,be,rn,et,Sa,dn,ja,Wn,E,tt,$a,cn,Da,ka,nt,Pa,jt,Ea,Ua,Za,R,st,Wa,pn,Ga,Ba,ye,Gn,ee,ve,fn,ot,Fa,mn,Na,Bn,A,at,Ca,un,Aa,Xa,we,it,La,gn,Va,Fn;return s=new Tn({}),ne=new qa({props:{$$slots:{default:[Ki]},$$scope:{ctx:j}}}),$e=new Tn({}),De=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.20.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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.20.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.20.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.20.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.20.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.20.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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L101"}}),Pe=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[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = 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[typing.List[str], 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> or tensor representing an image batch to be used as the starting point. 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.20.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.20.0/en/api/pipelines/stable_diffusion/upscale#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.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L571",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),ae=new rt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[el]},$$scope:{ctx:j}}}),Ee=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.20.0/src/diffusers/pipelines/pipeline_utils.py#L1688"}}),ie=new qa({props:{warning:!0,$$slots:{default:[tl]},$$scope:{ctx:j}}}),le=new rt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[nl]},$$scope:{ctx:j}}}),Ue=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/pipeline_utils.py#L1728"}}),We=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.20.0/src/diffusers/pipelines/pipeline_utils.py#L1627"}}),de=new qa({props:{warning:!0,$$slots:{default:[sl]},$$scope:{ctx:j}}}),ce=new rt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[ol]},$$scope:{ctx:j}}}),Fe=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.20.0/src/diffusers/pipelines/pipeline_utils.py#L1662"}}),Ae=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:"**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.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.20.0/src/diffusers/loaders.py#L634"}}),fe=new rt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[al]},$$scope:{ctx:j}}}),me=new rt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[il]},$$scope:{ctx:j}}}),Re=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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>, <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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>, <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.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.20.0/src/diffusers/loaders.py#L1725"}}),ue=new rt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.example",$$slots:{default:[ll]},$$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.20.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.20.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/loaders.py#L906"}}),Qe=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.20.0/src/diffusers/loaders.py#L1410"}}),He=new k({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L228"}}),Oe=new Tn({}),Ke=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.20.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),et=new Tn({}),tt=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.20.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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">FlaxCLIPTextModel</a>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.20.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.20.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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L105"}}),st=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.20.0/en/api/pipelines/stable_diffusion/text2img#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.20.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.20.0/en/api/pipelines/stable_diffusion/text2img#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.20.0/en/api/pipelines/stable_diffusion/text2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),ye=new rt({props:{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[rl]},$$scope:{ctx:j}}}),ot=new Tn({}),at=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.20.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L118"}}),it=new k({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/flax/struct.py#L111"}}),{c(){d=o("meta"),b=p(),u=o("h1"),c=o("a"),_=o("span"),v(s.$$.fragment),m=p(),B=o("span"),as=l("Image-to-image"),Jn=p(),pt=o("p"),is=l("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."),Sn=p(),X=o("p"),ls=l("The "),ft=o("a"),rs=l("StableDiffusionImg2ImgPipeline"),ds=l(" uses the diffusion-denoising mechanism proposed in "),je=o("a"),cs=l("SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),ps=l(" by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon."),jn=p(),mt=o("p"),fs=l("The abstract from the paper is:"),$n=p(),ut=o("p"),Zt=o("em"),ms=l("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."),Dn=p(),v(ne.$$.fragment),kn=p(),Y=o("h2"),se=o("a"),Wt=o("span"),v($e.$$.fragment),us=p(),Gt=o("span"),gs=l("StableDiffusionImg2ImgPipeline"),Pn=p(),J=o("div"),v(De.$$.fragment),hs=p(),Bt=o("p"),_s=l("Pipeline for text-guided image-to-image generation using Stable Diffusion."),bs=p(),ke=o("p"),ys=l("This model inherits from "),gt=o("a"),vs=l("DiffusionPipeline"),ws=l(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Is=p(),Ft=o("p"),xs=l("The pipeline also inherits the following loading methods:"),Ms=p(),F=o("ul"),ht=o("li"),_t=o("a"),Ts=l("load_textual_inversion()"),Js=l(" for loading textual inversion embeddings"),Ss=p(),bt=o("li"),yt=o("a"),js=l("load_lora_weights()"),$s=l(" for loading LoRA weights"),Ds=p(),vt=o("li"),wt=o("a"),ks=l("save_lora_weights()"),Ps=l(" for saving LoRA weights"),Es=p(),oe=o("li"),It=o("a"),Us=l("from_single_file()"),Zs=l(" for loading "),Nt=o("code"),Ws=l(".ckpt"),Gs=l(" files"),Bs=p(),L=o("div"),v(Pe.$$.fragment),Fs=p(),Ct=o("p"),Ns=l("The call function to the pipeline for generation."),Cs=p(),v(ae.$$.fragment),As=p(),U=o("div"),v(Ee.$$.fragment),Xs=p(),At=o("p"),Ls=l(`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.`),Vs=p(),v(ie.$$.fragment),Rs=p(),v(le.$$.fragment),zs=p(),re=o("div"),v(Ue.$$.fragment),Ys=p(),Ze=o("p"),qs=l("Disable sliced attention computation. If "),Xt=o("code"),Qs=l("enable_attention_slicing"),Hs=l(` was previously called, attention is
computed in one step.`),Os=p(),Z=o("div"),v(We.$$.fragment),Ks=p(),Ge=o("p"),eo=l("Enable memory efficient attention from "),Be=o("a"),to=l("xFormers"),no=l(`. 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.`),so=p(),v(de.$$.fragment),oo=p(),v(ce.$$.fragment),ao=p(),pe=o("div"),v(Fe.$$.fragment),io=p(),Ne=o("p"),lo=l("Disable memory efficient attention from "),Ce=o("a"),ro=l("xFormers"),co=l("."),po=p(),$=o("div"),v(Ae.$$.fragment),fo=p(),Xe=o("p"),mo=l("Load textual inversion embeddings into the text encoder of "),xt=o("a"),uo=l("StableDiffusionPipeline"),go=l(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),ho=p(),Lt=o("p"),_o=l("Example:"),bo=p(),v(fe.$$.fragment),yo=p(),Le=o("p"),vo=l(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ve=o("a"),wo=l("civitAI"),Io=l(") and then load the vector"),xo=p(),v(me.$$.fragment),Mo=p(),V=o("div"),v(Re.$$.fragment),To=p(),P=o("p"),Jo=l("Instantiate a "),Mt=o("a"),So=l("DiffusionPipeline"),jo=l(" from pretrained pipeline weights saved in the "),Vt=o("code"),$o=l(".ckpt"),Do=l(" or "),Rt=o("code"),ko=l(".safetensors"),Po=l(`
format. The pipeline is set in evaluation mode (`),zt=o("code"),Eo=l("model.eval()"),Uo=l(") by default."),Zo=p(),v(ue.$$.fragment),Wo=p(),D=o("div"),v(ze.$$.fragment),Go=p(),N=o("p"),Bo=l("Load LoRA weights specified in "),Yt=o("code"),Fo=l("pretrained_model_name_or_path_or_dict"),No=l(" into "),qt=o("code"),Co=l("self.unet"),Ao=l(` and
`),Qt=o("code"),Xo=l("self.text_encoder"),Lo=l("."),Vo=p(),Ye=o("p"),Ro=l("All kwargs are forwarded to "),Ht=o("code"),zo=l("self.lora_state_dict"),Yo=l("."),qo=p(),qe=o("p"),Qo=l("See "),Tt=o("a"),Ho=l("lora_state_dict()"),Oo=l(" for more details on how the state dict is loaded."),Ko=p(),q=o("p"),ea=l("See "),Jt=o("a"),ta=l("load_lora_into_unet()"),na=l(` for more details on how the state dict is loaded into
`),Ot=o("code"),sa=l("self.unet"),oa=l("."),aa=p(),Q=o("p"),ia=l("See "),St=o("a"),la=l("load_lora_into_text_encoder()"),ra=l(` for more details on how the state dict is loaded
into `),Kt=o("code"),da=l("self.text_encoder"),ca=l("."),pa=p(),ge=o("div"),v(Qe.$$.fragment),fa=p(),en=o("p"),ma=l("Save the LoRA parameters corresponding to the UNet and text encoder."),ua=p(),he=o("div"),v(He.$$.fragment),ga=p(),C=o("p"),ha=l(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),tn=o("code"),_a=l("forward"),ba=l(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),nn=o("code"),ya=l("enable_sequential_cpu_offload"),va=l(`, but performance is much better due to the
iterative execution of the `),sn=o("code"),wa=l("unet"),Ia=l("."),En=p(),H=o("h2"),_e=o("a"),on=o("span"),v(Oe.$$.fragment),xa=p(),an=o("span"),Ma=l("StableDiffusionPipelineOutput"),Un=p(),O=o("div"),v(Ke.$$.fragment),Ta=p(),ln=o("p"),Ja=l("Output class for Stable Diffusion pipelines."),Zn=p(),K=o("h2"),be=o("a"),rn=o("span"),v(et.$$.fragment),Sa=p(),dn=o("span"),ja=l("FlaxStableDiffusionImg2ImgPipeline"),Wn=p(),E=o("div"),v(tt.$$.fragment),$a=p(),cn=o("p"),Da=l("Flax-based pipeline for text-guided image-to-image generation using Stable Diffusion."),ka=p(),nt=o("p"),Pa=l("This model inherits from "),jt=o("a"),Ea=l("FlaxDiffusionPipeline"),Ua=l(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Za=p(),R=o("div"),v(st.$$.fragment),Wa=p(),pn=o("p"),Ga=l("The call function to the pipeline for generation."),Ba=p(),v(ye.$$.fragment),Gn=p(),ee=o("h2"),ve=o("a"),fn=o("span"),v(ot.$$.fragment),Fa=p(),mn=o("span"),Na=l("FlaxStableDiffusionPipelineOutput"),Bn=p(),A=o("div"),v(at.$$.fragment),Ca=p(),un=o("p"),Aa=l("Output class for Flax-based Stable Diffusion pipelines."),Xa=p(),we=o("div"),v(it.$$.fragment),La=p(),gn=o("p"),Va=l("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(t){const h=Hi('[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 lt=i(u);c=a(lt,"A",{id:!0,class:!0,href:!0});var hn=i(c);_=a(hn,"SPAN",{});var _n=i(_);w(s.$$.fragment,_n),_n.forEach(n),hn.forEach(n),m=f(lt),B=a(lt,"SPAN",{});var bn=i(B);as=r(bn,"Image-to-image"),bn.forEach(n),lt.forEach(n),Jn=f(t),pt=a(t,"P",{});var yn=i(pt);is=r(yn,"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."),yn.forEach(n),Sn=f(t),X=a(t,"P",{});var te=i(X);ls=r(te,"The "),ft=a(te,"A",{href:!0});var vn=i(ft);rs=r(vn,"StableDiffusionImg2ImgPipeline"),vn.forEach(n),ds=r(te," uses the diffusion-denoising mechanism proposed in "),je=a(te,"A",{href:!0,rel:!0});var wn=i(je);cs=r(wn,"SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),wn.forEach(n),ps=r(te," by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon."),te.forEach(n),jn=f(t),mt=a(t,"P",{});var In=i(mt);fs=r(In,"The abstract from the paper is:"),In.forEach(n),$n=f(t),ut=a(t,"P",{});var xn=i(ut);Zt=a(xn,"EM",{});var Qa=i(Zt);ms=r(Qa,"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."),Qa.forEach(n),xn.forEach(n),Dn=f(t),w(ne.$$.fragment,t),kn=f(t),Y=a(t,"H2",{class:!0});var Nn=i(Y);se=a(Nn,"A",{id:!0,class:!0,href:!0});var Ha=i(se);Wt=a(Ha,"SPAN",{});var Oa=i(Wt);w($e.$$.fragment,Oa),Oa.forEach(n),Ha.forEach(n),us=f(Nn),Gt=a(Nn,"SPAN",{});var Ka=i(Gt);gs=r(Ka,"StableDiffusionImg2ImgPipeline"),Ka.forEach(n),Nn.forEach(n),Pn=f(t),J=a(t,"DIV",{class:!0});var S=i(J);w(De.$$.fragment,S),hs=f(S),Bt=a(S,"P",{});var ei=i(Bt);_s=r(ei,"Pipeline for text-guided image-to-image generation using Stable Diffusion."),ei.forEach(n),bs=f(S),ke=a(S,"P",{});var Cn=i(ke);ys=r(Cn,"This model inherits from "),gt=a(Cn,"A",{href:!0});var ti=i(gt);vs=r(ti,"DiffusionPipeline"),ti.forEach(n),ws=r(Cn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Cn.forEach(n),Is=f(S),Ft=a(S,"P",{});var ni=i(Ft);xs=r(ni,"The pipeline also inherits the following loading methods:"),ni.forEach(n),Ms=f(S),F=a(S,"UL",{});var Ie=i(F);ht=a(Ie,"LI",{});var Ra=i(ht);_t=a(Ra,"A",{href:!0});var si=i(_t);Ts=r(si,"load_textual_inversion()"),si.forEach(n),Js=r(Ra," for loading textual inversion embeddings"),Ra.forEach(n),Ss=f(Ie),bt=a(Ie,"LI",{});var za=i(bt);yt=a(za,"A",{href:!0});var oi=i(yt);js=r(oi,"load_lora_weights()"),oi.forEach(n),$s=r(za," for loading LoRA weights"),za.forEach(n),Ds=f(Ie),vt=a(Ie,"LI",{});var Ya=i(vt);wt=a(Ya,"A",{href:!0});var ai=i(wt);ks=r(ai,"save_lora_weights()"),ai.forEach(n),Ps=r(Ya," for saving LoRA weights"),Ya.forEach(n),Es=f(Ie),oe=a(Ie,"LI",{});var Mn=i(oe);It=a(Mn,"A",{href:!0});var ii=i(It);Us=r(ii,"from_single_file()"),ii.forEach(n),Zs=r(Mn," for loading "),Nt=a(Mn,"CODE",{});var li=i(Nt);Ws=r(li,".ckpt"),li.forEach(n),Gs=r(Mn," files"),Mn.forEach(n),Ie.forEach(n),Bs=f(S),L=a(S,"DIV",{class:!0});var $t=i(L);w(Pe.$$.fragment,$t),Fs=f($t),Ct=a($t,"P",{});var ri=i(Ct);Ns=r(ri,"The call function to the pipeline for generation."),ri.forEach(n),Cs=f($t),w(ae.$$.fragment,$t),$t.forEach(n),As=f(S),U=a(S,"DIV",{class:!0});var xe=i(U);w(Ee.$$.fragment,xe),Xs=f(xe),At=a(xe,"P",{});var di=i(At);Ls=r(di,`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.`),di.forEach(n),Vs=f(xe),w(ie.$$.fragment,xe),Rs=f(xe),w(le.$$.fragment,xe),xe.forEach(n),zs=f(S),re=a(S,"DIV",{class:!0});var An=i(re);w(Ue.$$.fragment,An),Ys=f(An),Ze=a(An,"P",{});var Xn=i(Ze);qs=r(Xn,"Disable sliced attention computation. If "),Xt=a(Xn,"CODE",{});var ci=i(Xt);Qs=r(ci,"enable_attention_slicing"),ci.forEach(n),Hs=r(Xn,` was previously called, attention is
computed in one step.`),Xn.forEach(n),An.forEach(n),Os=f(S),Z=a(S,"DIV",{class:!0});var Me=i(Z);w(We.$$.fragment,Me),Ks=f(Me),Ge=a(Me,"P",{});var Ln=i(Ge);eo=r(Ln,"Enable memory efficient attention from "),Be=a(Ln,"A",{href:!0,rel:!0});var pi=i(Be);to=r(pi,"xFormers"),pi.forEach(n),no=r(Ln,`. 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.`),Ln.forEach(n),so=f(Me),w(de.$$.fragment,Me),oo=f(Me),w(ce.$$.fragment,Me),Me.forEach(n),ao=f(S),pe=a(S,"DIV",{class:!0});var Vn=i(pe);w(Fe.$$.fragment,Vn),io=f(Vn),Ne=a(Vn,"P",{});var Rn=i(Ne);lo=r(Rn,"Disable memory efficient attention from "),Ce=a(Rn,"A",{href:!0,rel:!0});var fi=i(Ce);ro=r(fi,"xFormers"),fi.forEach(n),co=r(Rn,"."),Rn.forEach(n),Vn.forEach(n),po=f(S),$=a(S,"DIV",{class:!0});var W=i($);w(Ae.$$.fragment,W),fo=f(W),Xe=a(W,"P",{});var zn=i(Xe);mo=r(zn,"Load textual inversion embeddings into the text encoder of "),xt=a(zn,"A",{href:!0});var mi=i(xt);uo=r(mi,"StableDiffusionPipeline"),mi.forEach(n),go=r(zn,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),zn.forEach(n),ho=f(W),Lt=a(W,"P",{});var ui=i(Lt);_o=r(ui,"Example:"),ui.forEach(n),bo=f(W),w(fe.$$.fragment,W),yo=f(W),Le=a(W,"P",{});var Yn=i(Le);vo=r(Yn,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ve=a(Yn,"A",{href:!0,rel:!0});var gi=i(Ve);wo=r(gi,"civitAI"),gi.forEach(n),Io=r(Yn,") and then load the vector"),Yn.forEach(n),xo=f(W),w(me.$$.fragment,W),W.forEach(n),Mo=f(S),V=a(S,"DIV",{class:!0});var Dt=i(V);w(Re.$$.fragment,Dt),To=f(Dt),P=a(Dt,"P",{});var z=i(P);Jo=r(z,"Instantiate a "),Mt=a(z,"A",{href:!0});var hi=i(Mt);So=r(hi,"DiffusionPipeline"),hi.forEach(n),jo=r(z," from pretrained pipeline weights saved in the "),Vt=a(z,"CODE",{});var _i=i(Vt);$o=r(_i,".ckpt"),_i.forEach(n),Do=r(z," or "),Rt=a(z,"CODE",{});var bi=i(Rt);ko=r(bi,".safetensors"),bi.forEach(n),Po=r(z,`
format. The pipeline is set in evaluation mode (`),zt=a(z,"CODE",{});var yi=i(zt);Eo=r(yi,"model.eval()"),yi.forEach(n),Uo=r(z,") by default."),z.forEach(n),Zo=f(Dt),w(ue.$$.fragment,Dt),Dt.forEach(n),Wo=f(S),D=a(S,"DIV",{class:!0});var G=i(D);w(ze.$$.fragment,G),Go=f(G),N=a(G,"P",{});var Te=i(N);Bo=r(Te,"Load LoRA weights specified in "),Yt=a(Te,"CODE",{});var vi=i(Yt);Fo=r(vi,"pretrained_model_name_or_path_or_dict"),vi.forEach(n),No=r(Te," into "),qt=a(Te,"CODE",{});var wi=i(qt);Co=r(wi,"self.unet"),wi.forEach(n),Ao=r(Te,` and
`),Qt=a(Te,"CODE",{});var Ii=i(Qt);Xo=r(Ii,"self.text_encoder"),Ii.forEach(n),Lo=r(Te,"."),Te.forEach(n),Vo=f(G),Ye=a(G,"P",{});var qn=i(Ye);Ro=r(qn,"All kwargs are forwarded to "),Ht=a(qn,"CODE",{});var xi=i(Ht);zo=r(xi,"self.lora_state_dict"),xi.forEach(n),Yo=r(qn,"."),qn.forEach(n),qo=f(G),qe=a(G,"P",{});var Qn=i(qe);Qo=r(Qn,"See "),Tt=a(Qn,"A",{href:!0});var Mi=i(Tt);Ho=r(Mi,"lora_state_dict()"),Mi.forEach(n),Oo=r(Qn," for more details on how the state dict is loaded."),Qn.forEach(n),Ko=f(G),q=a(G,"P",{});var kt=i(q);ea=r(kt,"See "),Jt=a(kt,"A",{href:!0});var Ti=i(Jt);ta=r(Ti,"load_lora_into_unet()"),Ti.forEach(n),na=r(kt,` for more details on how the state dict is loaded into
`),Ot=a(kt,"CODE",{});var Ji=i(Ot);sa=r(Ji,"self.unet"),Ji.forEach(n),oa=r(kt,"."),kt.forEach(n),aa=f(G),Q=a(G,"P",{});var Pt=i(Q);ia=r(Pt,"See "),St=a(Pt,"A",{href:!0});var Si=i(St);la=r(Si,"load_lora_into_text_encoder()"),Si.forEach(n),ra=r(Pt,` for more details on how the state dict is loaded
into `),Kt=a(Pt,"CODE",{});var ji=i(Kt);da=r(ji,"self.text_encoder"),ji.forEach(n),ca=r(Pt,"."),Pt.forEach(n),G.forEach(n),pa=f(S),ge=a(S,"DIV",{class:!0});var Hn=i(ge);w(Qe.$$.fragment,Hn),fa=f(Hn),en=a(Hn,"P",{});var $i=i(en);ma=r($i,"Save the LoRA parameters corresponding to the UNet and text encoder."),$i.forEach(n),Hn.forEach(n),ua=f(S),he=a(S,"DIV",{class:!0});var On=i(he);w(He.$$.fragment,On),ga=f(On),C=a(On,"P",{});var Je=i(C);ha=r(Je,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),tn=a(Je,"CODE",{});var Di=i(tn);_a=r(Di,"forward"),Di.forEach(n),ba=r(Je,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),nn=a(Je,"CODE",{});var ki=i(nn);ya=r(ki,"enable_sequential_cpu_offload"),ki.forEach(n),va=r(Je,`, but performance is much better due to the
iterative execution of the `),sn=a(Je,"CODE",{});var Pi=i(sn);wa=r(Pi,"unet"),Pi.forEach(n),Ia=r(Je,"."),Je.forEach(n),On.forEach(n),S.forEach(n),En=f(t),H=a(t,"H2",{class:!0});var Kn=i(H);_e=a(Kn,"A",{id:!0,class:!0,href:!0});var Ei=i(_e);on=a(Ei,"SPAN",{});var Ui=i(on);w(Oe.$$.fragment,Ui),Ui.forEach(n),Ei.forEach(n),xa=f(Kn),an=a(Kn,"SPAN",{});var Zi=i(an);Ma=r(Zi,"StableDiffusionPipelineOutput"),Zi.forEach(n),Kn.forEach(n),Un=f(t),O=a(t,"DIV",{class:!0});var es=i(O);w(Ke.$$.fragment,es),Ta=f(es),ln=a(es,"P",{});var Wi=i(ln);Ja=r(Wi,"Output class for Stable Diffusion pipelines."),Wi.forEach(n),es.forEach(n),Zn=f(t),K=a(t,"H2",{class:!0});var ts=i(K);be=a(ts,"A",{id:!0,class:!0,href:!0});var Gi=i(be);rn=a(Gi,"SPAN",{});var Bi=i(rn);w(et.$$.fragment,Bi),Bi.forEach(n),Gi.forEach(n),Sa=f(ts),dn=a(ts,"SPAN",{});var Fi=i(dn);ja=r(Fi,"FlaxStableDiffusionImg2ImgPipeline"),Fi.forEach(n),ts.forEach(n),Wn=f(t),E=a(t,"DIV",{class:!0});var Se=i(E);w(tt.$$.fragment,Se),$a=f(Se),cn=a(Se,"P",{});var Ni=i(cn);Da=r(Ni,"Flax-based pipeline for text-guided image-to-image generation using Stable Diffusion."),Ni.forEach(n),ka=f(Se),nt=a(Se,"P",{});var ns=i(nt);Pa=r(ns,"This model inherits from "),jt=a(ns,"A",{href:!0});var Ci=i(jt);Ea=r(Ci,"FlaxDiffusionPipeline"),Ci.forEach(n),Ua=r(ns,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ns.forEach(n),Za=f(Se),R=a(Se,"DIV",{class:!0});var Et=i(R);w(st.$$.fragment,Et),Wa=f(Et),pn=a(Et,"P",{});var Ai=i(pn);Ga=r(Ai,"The call function to the pipeline for generation."),Ai.forEach(n),Ba=f(Et),w(ye.$$.fragment,Et),Et.forEach(n),Se.forEach(n),Gn=f(t),ee=a(t,"H2",{class:!0});var ss=i(ee);ve=a(ss,"A",{id:!0,class:!0,href:!0});var Xi=i(ve);fn=a(Xi,"SPAN",{});var Li=i(fn);w(ot.$$.fragment,Li),Li.forEach(n),Xi.forEach(n),Fa=f(ss),mn=a(ss,"SPAN",{});var Vi=i(mn);Na=r(Vi,"FlaxStableDiffusionPipelineOutput"),Vi.forEach(n),ss.forEach(n),Bn=f(t),A=a(t,"DIV",{class:!0});var Ut=i(A);w(at.$$.fragment,Ut),Ca=f(Ut),un=a(Ut,"P",{});var Ri=i(un);Aa=r(Ri,"Output class for Flax-based Stable Diffusion pipelines."),Ri.forEach(n),Xa=f(Ut),we=a(Ut,"DIV",{class:!0});var os=i(we);w(it.$$.fragment,os),La=f(os),gn=a(os,"P",{});var zi=i(gn);Va=r(zi,"\u201CReturns a new object replacing the specified fields with new values."),zi.forEach(n),os.forEach(n),Ut.forEach(n),this.h()},h(){g(d,"name","hf:doc:metadata"),g(d,"content",JSON.stringify(cl)),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(ft,"href","/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),g(je,"href","https://huggingface.co/papers/2108.01073"),g(je,"rel","nofollow"),g(se,"id","diffusers.StableDiffusionImg2ImgPipeline"),g(se,"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(se,"href","#diffusers.StableDiffusionImg2ImgPipeline"),g(Y,"class","relative group"),g(gt,"href","/docs/diffusers/v0.20.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(_t,"href","/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),g(yt,"href","/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_lora_weights"),g(wt,"href","/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.save_lora_weights"),g(It,"href","/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.from_single_file"),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(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(Be,"href","https://facebookresearch.github.io/xformers/"),g(Be,"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(Ce,"href","https://facebookresearch.github.io/xformers/"),g(Ce,"rel","nofollow"),g(pe,"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.20.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),g(Ve,"href","https://civitai.com/models/3036?modelVersionId=9857"),g(Ve,"rel","nofollow"),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(Mt,"href","/docs/diffusers/v0.20.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Tt,"href","/docs/diffusers/v0.20.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),g(Jt,"href","/docs/diffusers/v0.20.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),g(St,"href","/docs/diffusers/v0.20.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),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(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(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(J,"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.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),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.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),g(H,"class","relative group"),g(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(be,"id","diffusers.FlaxStableDiffusionImg2ImgPipeline"),g(be,"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(be,"href","#diffusers.FlaxStableDiffusionImg2ImgPipeline"),g(K,"class","relative group"),g(jt,"href","/docs/diffusers/v0.20.0/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),g(R,"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(ve,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),g(ve,"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(ve,"href","#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),g(ee,"class","relative group"),g(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(A,"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(s,_,null),e(u,m),e(u,B),e(B,as),y(t,Jn,h),y(t,pt,h),e(pt,is),y(t,Sn,h),y(t,X,h),e(X,ls),e(X,ft),e(ft,rs),e(X,ds),e(X,je),e(je,cs),e(X,ps),y(t,jn,h),y(t,mt,h),e(mt,fs),y(t,$n,h),y(t,ut,h),e(ut,Zt),e(Zt,ms),y(t,Dn,h),I(ne,t,h),y(t,kn,h),y(t,Y,h),e(Y,se),e(se,Wt),I($e,Wt,null),e(Y,us),e(Y,Gt),e(Gt,gs),y(t,Pn,h),y(t,J,h),I(De,J,null),e(J,hs),e(J,Bt),e(Bt,_s),e(J,bs),e(J,ke),e(ke,ys),e(ke,gt),e(gt,vs),e(ke,ws),e(J,Is),e(J,Ft),e(Ft,xs),e(J,Ms),e(J,F),e(F,ht),e(ht,_t),e(_t,Ts),e(ht,Js),e(F,Ss),e(F,bt),e(bt,yt),e(yt,js),e(bt,$s),e(F,Ds),e(F,vt),e(vt,wt),e(wt,ks),e(vt,Ps),e(F,Es),e(F,oe),e(oe,It),e(It,Us),e(oe,Zs),e(oe,Nt),e(Nt,Ws),e(oe,Gs),e(J,Bs),e(J,L),I(Pe,L,null),e(L,Fs),e(L,Ct),e(Ct,Ns),e(L,Cs),I(ae,L,null),e(J,As),e(J,U),I(Ee,U,null),e(U,Xs),e(U,At),e(At,Ls),e(U,Vs),I(ie,U,null),e(U,Rs),I(le,U,null),e(J,zs),e(J,re),I(Ue,re,null),e(re,Ys),e(re,Ze),e(Ze,qs),e(Ze,Xt),e(Xt,Qs),e(Ze,Hs),e(J,Os),e(J,Z),I(We,Z,null),e(Z,Ks),e(Z,Ge),e(Ge,eo),e(Ge,Be),e(Be,to),e(Ge,no),e(Z,so),I(de,Z,null),e(Z,oo),I(ce,Z,null),e(J,ao),e(J,pe),I(Fe,pe,null),e(pe,io),e(pe,Ne),e(Ne,lo),e(Ne,Ce),e(Ce,ro),e(Ne,co),e(J,po),e(J,$),I(Ae,$,null),e($,fo),e($,Xe),e(Xe,mo),e(Xe,xt),e(xt,uo),e(Xe,go),e($,ho),e($,Lt),e(Lt,_o),e($,bo),I(fe,$,null),e($,yo),e($,Le),e(Le,vo),e(Le,Ve),e(Ve,wo),e(Le,Io),e($,xo),I(me,$,null),e(J,Mo),e(J,V),I(Re,V,null),e(V,To),e(V,P),e(P,Jo),e(P,Mt),e(Mt,So),e(P,jo),e(P,Vt),e(Vt,$o),e(P,Do),e(P,Rt),e(Rt,ko),e(P,Po),e(P,zt),e(zt,Eo),e(P,Uo),e(V,Zo),I(ue,V,null),e(J,Wo),e(J,D),I(ze,D,null),e(D,Go),e(D,N),e(N,Bo),e(N,Yt),e(Yt,Fo),e(N,No),e(N,qt),e(qt,Co),e(N,Ao),e(N,Qt),e(Qt,Xo),e(N,Lo),e(D,Vo),e(D,Ye),e(Ye,Ro),e(Ye,Ht),e(Ht,zo),e(Ye,Yo),e(D,qo),e(D,qe),e(qe,Qo),e(qe,Tt),e(Tt,Ho),e(qe,Oo),e(D,Ko),e(D,q),e(q,ea),e(q,Jt),e(Jt,ta),e(q,na),e(q,Ot),e(Ot,sa),e(q,oa),e(D,aa),e(D,Q),e(Q,ia),e(Q,St),e(St,la),e(Q,ra),e(Q,Kt),e(Kt,da),e(Q,ca),e(J,pa),e(J,ge),I(Qe,ge,null),e(ge,fa),e(ge,en),e(en,ma),e(J,ua),e(J,he),I(He,he,null),e(he,ga),e(he,C),e(C,ha),e(C,tn),e(tn,_a),e(C,ba),e(C,nn),e(nn,ya),e(C,va),e(C,sn),e(sn,wa),e(C,Ia),y(t,En,h),y(t,H,h),e(H,_e),e(_e,on),I(Oe,on,null),e(H,xa),e(H,an),e(an,Ma),y(t,Un,h),y(t,O,h),I(Ke,O,null),e(O,Ta),e(O,ln),e(ln,Ja),y(t,Zn,h),y(t,K,h),e(K,be),e(be,rn),I(et,rn,null),e(K,Sa),e(K,dn),e(dn,ja),y(t,Wn,h),y(t,E,h),I(tt,E,null),e(E,$a),e(E,cn),e(cn,Da),e(E,ka),e(E,nt),e(nt,Pa),e(nt,jt),e(jt,Ea),e(nt,Ua),e(E,Za),e(E,R),I(st,R,null),e(R,Wa),e(R,pn),e(pn,Ga),e(R,Ba),I(ye,R,null),y(t,Gn,h),y(t,ee,h),e(ee,ve),e(ve,fn),I(ot,fn,null),e(ee,Fa),e(ee,mn),e(mn,Na),y(t,Bn,h),y(t,A,h),I(at,A,null),e(A,Ca),e(A,un),e(un,Aa),e(A,Xa),e(A,we),I(it,we,null),e(we,La),e(we,gn),e(gn,Va),Fn=!0},p(t,[h]){const lt={};h&2&&(lt.$$scope={dirty:h,ctx:t}),ne.$set(lt);const hn={};h&2&&(hn.$$scope={dirty:h,ctx:t}),ae.$set(hn);const _n={};h&2&&(_n.$$scope={dirty:h,ctx:t}),ie.$set(_n);const bn={};h&2&&(bn.$$scope={dirty:h,ctx:t}),le.$set(bn);const yn={};h&2&&(yn.$$scope={dirty:h,ctx:t}),de.$set(yn);const te={};h&2&&(te.$$scope={dirty:h,ctx:t}),ce.$set(te);const vn={};h&2&&(vn.$$scope={dirty:h,ctx:t}),fe.$set(vn);const wn={};h&2&&(wn.$$scope={dirty:h,ctx:t}),me.$set(wn);const In={};h&2&&(In.$$scope={dirty:h,ctx:t}),ue.$set(In);const xn={};h&2&&(xn.$$scope={dirty:h,ctx:t}),ye.$set(xn)},i(t){Fn||(x(s.$$.fragment,t),x(ne.$$.fragment,t),x($e.$$.fragment,t),x(De.$$.fragment,t),x(Pe.$$.fragment,t),x(ae.$$.fragment,t),x(Ee.$$.fragment,t),x(ie.$$.fragment,t),x(le.$$.fragment,t),x(Ue.$$.fragment,t),x(We.$$.fragment,t),x(de.$$.fragment,t),x(ce.$$.fragment,t),x(Fe.$$.fragment,t),x(Ae.$$.fragment,t),x(fe.$$.fragment,t),x(me.$$.fragment,t),x(Re.$$.fragment,t),x(ue.$$.fragment,t),x(ze.$$.fragment,t),x(Qe.$$.fragment,t),x(He.$$.fragment,t),x(Oe.$$.fragment,t),x(Ke.$$.fragment,t),x(et.$$.fragment,t),x(tt.$$.fragment,t),x(st.$$.fragment,t),x(ye.$$.fragment,t),x(ot.$$.fragment,t),x(at.$$.fragment,t),x(it.$$.fragment,t),Fn=!0)},o(t){M(s.$$.fragment,t),M(ne.$$.fragment,t),M($e.$$.fragment,t),M(De.$$.fragment,t),M(Pe.$$.fragment,t),M(ae.$$.fragment,t),M(Ee.$$.fragment,t),M(ie.$$.fragment,t),M(le.$$.fragment,t),M(Ue.$$.fragment,t),M(We.$$.fragment,t),M(de.$$.fragment,t),M(ce.$$.fragment,t),M(Fe.$$.fragment,t),M(Ae.$$.fragment,t),M(fe.$$.fragment,t),M(me.$$.fragment,t),M(Re.$$.fragment,t),M(ue.$$.fragment,t),M(ze.$$.fragment,t),M(Qe.$$.fragment,t),M(He.$$.fragment,t),M(Oe.$$.fragment,t),M(Ke.$$.fragment,t),M(et.$$.fragment,t),M(tt.$$.fragment,t),M(st.$$.fragment,t),M(ye.$$.fragment,t),M(ot.$$.fragment,t),M(at.$$.fragment,t),M(it.$$.fragment,t),Fn=!1},d(t){n(d),t&&n(b),t&&n(u),T(s),t&&n(Jn),t&&n(pt),t&&n(Sn),t&&n(X),t&&n(jn),t&&n(mt),t&&n($n),t&&n(ut),t&&n(Dn),T(ne,t),t&&n(kn),t&&n(Y),T($e),t&&n(Pn),t&&n(J),T(De),T(Pe),T(ae),T(Ee),T(ie),T(le),T(Ue),T(We),T(de),T(ce),T(Fe),T(Ae),T(fe),T(me),T(Re),T(ue),T(ze),T(Qe),T(He),t&&n(En),t&&n(H),T(Oe),t&&n(Un),t&&n(O),T(Ke),t&&n(Zn),t&&n(K),T(et),t&&n(Wn),t&&n(E),T(tt),T(st),T(ye),t&&n(Gn),t&&n(ee),T(ot),t&&n(Bn),t&&n(A),T(at),T(it)}}}const cl={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 pl(j){return Oi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bl extends Yi{constructor(d){super();qi(this,d,pl,dl,Qi,{})}}export{bl as default,cl as metadata};
