import{S as Xi,i as Vi,s as Ri,e as o,k as d,w,t as l,M as zi,c as s,d as n,m as c,a,x as I,h as r,b as m,G as e,g as _,y as x,q as M,o as S,B as T,v as Yi,L as $t}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Li}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as kt}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as vn}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Dt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function qi(J){let p,y,u,f,b;return{c(){p=o("p"),y=l("Make sure to check out the Stable Diffusion "),u=o("a"),f=l("Tips"),b=l(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),this.h()},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"Make sure to check out the Stable Diffusion "),u=s(g,"A",{href:!0});var ee=a(u);f=r(ee,"Tips"),ee.forEach(n),b=r(g," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),g.forEach(n),this.h()},h(){m(u,"href","overview#tips")},m(i,g){_(i,p,g),e(p,y),e(p,u),e(u,f),e(p,b)},d(i){i&&n(p)}}}function Qi(J){let p,y,u,f,b;return f=new kt({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(){p=o("p"),y=l("Examples:"),u=d(),w(f.$$.fragment)},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"Examples:"),g.forEach(n),u=c(i),I(f.$$.fragment,i)},m(i,g){_(i,p,g),e(p,y),_(i,u,g),x(f,i,g),b=!0},p:$t,i(i){b||(M(f.$$.fragment,i),b=!0)},o(i){S(f.$$.fragment,i),b=!1},d(i){i&&n(p),i&&n(u),T(f,i)}}}function Hi(J){let p,y;return{c(){p=o("p"),y=l(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(u){p=s(u,"P",{});var f=a(p);y=r(f,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),f.forEach(n)},m(u,f){_(u,p,f),e(p,y)},d(u){u&&n(p)}}}function Oi(J){let p,y,u,f,b;return f=new kt({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(){p=o("p"),y=l("Examples:"),u=d(),w(f.$$.fragment)},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"Examples:"),g.forEach(n),u=c(i),I(f.$$.fragment,i)},m(i,g){_(i,p,g),e(p,y),_(i,u,g),x(f,i,g),b=!0},p:$t,i(i){b||(M(f.$$.fragment,i),b=!0)},o(i){S(f.$$.fragment,i),b=!1},d(i){i&&n(p),i&&n(u),T(f,i)}}}function Ki(J){let p,y,u,f,b;return f=new kt({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(){p=o("p"),y=l("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=d(),w(f.$$.fragment)},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(n),u=c(i),I(f.$$.fragment,i)},m(i,g){_(i,p,g),e(p,y),_(i,u,g),x(f,i,g),b=!0},p:$t,i(i){b||(M(f.$$.fragment,i),b=!0)},o(i){S(f.$$.fragment,i),b=!1},d(i){i&&n(p),i&&n(u),T(f,i)}}}function el(J){let p,y,u,f,b;return f=new kt({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(){p=o("p"),y=l("locally:"),u=d(),w(f.$$.fragment)},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"locally:"),g.forEach(n),u=c(i),I(f.$$.fragment,i)},m(i,g){_(i,p,g),e(p,y),_(i,u,g),x(f,i,g),b=!0},p:$t,i(i){b||(M(f.$$.fragment,i),b=!0)},o(i){S(f.$$.fragment,i),b=!1},d(i){i&&n(p),i&&n(u),T(f,i)}}}function tl(J){let p,y,u,f,b;return f=new kt({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(){p=o("p"),y=l("Examples:"),u=d(),w(f.$$.fragment)},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"Examples:"),g.forEach(n),u=c(i),I(f.$$.fragment,i)},m(i,g){_(i,p,g),e(p,y),_(i,u,g),x(f,i,g),b=!0},p:$t,i(i){b||(M(f.$$.fragment,i),b=!0)},o(i){S(f.$$.fragment,i),b=!1},d(i){i&&n(p),i&&n(u),T(f,i)}}}function nl(J){let p,y,u,f,b;return f=new kt({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(){p=o("p"),y=l("Examples:"),u=d(),w(f.$$.fragment)},l(i){p=s(i,"P",{});var g=a(p);y=r(g,"Examples:"),g.forEach(n),u=c(i),I(f.$$.fragment,i)},m(i,g){_(i,p,g),e(p,y),_(i,u,g),x(f,i,g),b=!0},p:$t,i(i){b||(M(f.$$.fragment,i),b=!0)},o(i){S(f.$$.fragment,i),b=!1},d(i){i&&n(p),i&&n(u),T(f,i)}}}function ol(J){let p,y,u,f,b,i,g,ee,to,wn,at,no,In,C,oo,it,so,ao,Se,io,lo,xn,lt,ro,Mn,rt,Pt,co,Sn,te,Tn,R,ne,Et,Te,po,Ut,fo,jn,v,je,mo,Zt,uo,go,Je,ho,dt,_o,bo,yo,Wt,vo,wo,B,ct,pt,Io,xo,Mo,ft,mt,So,To,jo,ut,gt,Jo,Do,$o,oe,ht,ko,Po,Bt,Eo,Uo,Zo,A,De,Wo,Gt,Bo,Go,se,Fo,ae,$e,No,Ft,Co,Ao,ie,ke,Lo,Pe,Xo,Nt,Vo,Ro,zo,U,Ee,Yo,Ue,qo,Ze,Qo,Ho,Oo,le,Ko,re,es,de,We,ts,Be,ns,Ge,os,ss,as,D,Fe,is,Ne,ls,_t,rs,ds,cs,Ct,ps,fs,ce,ms,Ce,us,Ae,gs,hs,_s,pe,bs,L,Le,ys,P,vs,bt,ws,Is,At,xs,Ms,Lt,Ss,Ts,Xt,js,Js,Ds,fe,$s,$,Xe,ks,G,Ps,Vt,Es,Us,Rt,Zs,Ws,zt,Bs,Gs,Fs,Ve,Ns,Yt,Cs,As,Ls,Re,Xs,yt,Vs,Rs,zs,z,Ys,vt,qs,Qs,qt,Hs,Os,Ks,Y,ea,wt,ta,na,Qt,oa,sa,aa,me,ze,ia,Ht,la,ra,ue,Ye,da,F,ca,Ot,pa,fa,Kt,ma,ua,en,ga,ha,Jn,q,ge,tn,qe,_a,nn,ba,Dn,Q,Qe,ya,on,va,$n,H,he,sn,He,wa,an,Ia,kn,E,Oe,xa,ln,Ma,Sa,Ke,Ta,It,ja,Ja,Da,X,et,$a,rn,ka,Pa,_e,Pn,O,be,dn,tt,Ea,cn,Ua,En,N,nt,Za,pn,Wa,Ba,ye,ot,Ga,fn,Fa,Un;return i=new vn({}),te=new Li({props:{$$slots:{default:[qi]},$$scope:{ctx:J}}}),Te=new vn({}),je=new k({props:{name:"class diffusers.StableDiffusionImg2ImgPipeline",anchor:"diffusers.StableDiffusionImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.19.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.19.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.19.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.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.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.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L101"}}),De=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.19.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.19.0/en/api/pipelines/stable_diffusion/inpaint#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/cross_attention.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L564",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#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.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),se=new Dt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[Qi]},$$scope:{ctx:J}}}),$e=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.19.0/src/diffusers/pipelines/pipeline_utils.py#L1631"}}),ke=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1646"}}),Ee=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.19.0/src/diffusers/pipelines/pipeline_utils.py#L1570"}}),le=new Li({props:{warning:!0,$$slots:{default:[Hi]},$$scope:{ctx:J}}}),re=new Dt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Oi]},$$scope:{ctx:J}}}),We=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.19.0/src/diffusers/pipelines/pipeline_utils.py#L1605"}}),Fe=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.19.0/src/diffusers/loaders.py#L585"}}),ce=new Dt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[Ki]},$$scope:{ctx:J}}}),pe=new Dt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[el]},$$scope:{ctx:J}}}),Le=new k({props:{name:"from_single_file",anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better for continuing finetuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it is automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<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.19.0/src/diffusers/loaders.py#L1466"}}),fe=new Dt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.example",$$slots:{default:[tl]},$$scope:{ctx:J}}}),Xe=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.19.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.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/loaders.py#L862"}}),ze=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 = False"}],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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/loaders.py#L1235"}}),Ye=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.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L228"}}),qe=new vn({}),Qe=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.19.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),He=new vn({}),Oe=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.19.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.19.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.19.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.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L105"}}),et=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.19.0/en/api/pipelines/stable_diffusion/inpaint#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.19.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.19.0/en/api/pipelines/stable_diffusion/inpaint#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.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),_e=new Dt({props:{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[nl]},$$scope:{ctx:J}}}),tt=new vn({}),nt=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.19.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L117"}}),ot=new k({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/flax/struct.py#L111"}}),{c(){p=o("meta"),y=d(),u=o("h1"),f=o("a"),b=o("span"),w(i.$$.fragment),g=d(),ee=o("span"),to=l("Image-to-image"),wn=d(),at=o("p"),no=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."),In=d(),C=o("p"),oo=l("The "),it=o("a"),so=l("StableDiffusionImg2ImgPipeline"),ao=l(" uses the diffusion-denoising mechanism proposed in "),Se=o("a"),io=l("SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),lo=l(" by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon."),xn=d(),lt=o("p"),ro=l("The abstract from the paper is:"),Mn=d(),rt=o("p"),Pt=o("em"),co=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."),Sn=d(),w(te.$$.fragment),Tn=d(),R=o("h2"),ne=o("a"),Et=o("span"),w(Te.$$.fragment),po=d(),Ut=o("span"),fo=l("StableDiffusionImg2ImgPipeline"),jn=d(),v=o("div"),w(je.$$.fragment),mo=d(),Zt=o("p"),uo=l("Pipeline for text-guided image-to-image generation using Stable Diffusion."),go=d(),Je=o("p"),ho=l("This model inherits from "),dt=o("a"),_o=l("DiffusionPipeline"),bo=l(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),yo=d(),Wt=o("p"),vo=l("The pipeline also inherits the following loading methods:"),wo=d(),B=o("ul"),ct=o("li"),pt=o("a"),Io=l("load_textual_inversion()"),xo=l(" for loading textual inversion embeddings"),Mo=d(),ft=o("li"),mt=o("a"),So=l("load_lora_weights()"),To=l(" for loading LoRA weights"),jo=d(),ut=o("li"),gt=o("a"),Jo=l("save_lora_weights()"),Do=l(" for saving LoRA weights"),$o=d(),oe=o("li"),ht=o("a"),ko=l("from_single_file()"),Po=l(" for loading "),Bt=o("code"),Eo=l(".ckpt"),Uo=l(" files"),Zo=d(),A=o("div"),w(De.$$.fragment),Wo=d(),Gt=o("p"),Bo=l("The call function to the pipeline for generation."),Go=d(),w(se.$$.fragment),Fo=d(),ae=o("div"),w($e.$$.fragment),No=d(),Ft=o("p"),Co=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. This is useful to save some memory in exchange for a small
speed decrease.`),Ao=d(),ie=o("div"),w(ke.$$.fragment),Lo=d(),Pe=o("p"),Xo=l("Disable sliced attention computation. If "),Nt=o("code"),Vo=l("enable_attention_slicing"),Ro=l(` was previously called, attention is
computed in one step.`),zo=d(),U=o("div"),w(Ee.$$.fragment),Yo=d(),Ue=o("p"),qo=l("Enable memory efficient attention from "),Ze=o("a"),Qo=l("xFormers"),Ho=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.`),Oo=d(),w(le.$$.fragment),Ko=d(),w(re.$$.fragment),es=d(),de=o("div"),w(We.$$.fragment),ts=d(),Be=o("p"),ns=l("Disable memory efficient attention from "),Ge=o("a"),os=l("xFormers"),ss=l("."),as=d(),D=o("div"),w(Fe.$$.fragment),is=d(),Ne=o("p"),ls=l("Load textual inversion embeddings into the text encoder of "),_t=o("a"),rs=l("StableDiffusionPipeline"),ds=l(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),cs=d(),Ct=o("p"),ps=l("Example:"),fs=d(),w(ce.$$.fragment),ms=d(),Ce=o("p"),us=l(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ae=o("a"),gs=l("civitAI"),hs=l(") and then load the vector"),_s=d(),w(pe.$$.fragment),bs=d(),L=o("div"),w(Le.$$.fragment),ys=d(),P=o("p"),vs=l("Instantiate a "),bt=o("a"),ws=l("DiffusionPipeline"),Is=l(" from pretrained pipeline weights saved in the "),At=o("code"),xs=l(".ckpt"),Ms=l(" or "),Lt=o("code"),Ss=l(".safetensors"),Ts=l(`
format. The pipeline is set in evaluation mode (`),Xt=o("code"),js=l("model.eval()"),Js=l(") by default."),Ds=d(),w(fe.$$.fragment),$s=d(),$=o("div"),w(Xe.$$.fragment),ks=d(),G=o("p"),Ps=l("Load LoRA weights specified in "),Vt=o("code"),Es=l("pretrained_model_name_or_path_or_dict"),Us=l(" into "),Rt=o("code"),Zs=l("self.unet"),Ws=l(` and
`),zt=o("code"),Bs=l("self.text_encoder"),Gs=l("."),Fs=d(),Ve=o("p"),Ns=l("All kwargs are forwarded to "),Yt=o("code"),Cs=l("self.lora_state_dict"),As=l("."),Ls=d(),Re=o("p"),Xs=l("See "),yt=o("a"),Vs=l("lora_state_dict()"),Rs=l(" for more details on how the state dict is loaded."),zs=d(),z=o("p"),Ys=l("See "),vt=o("a"),qs=l("load_lora_into_unet()"),Qs=l(` for more details on how the state dict is loaded into
`),qt=o("code"),Hs=l("self.unet"),Os=l("."),Ks=d(),Y=o("p"),ea=l("See "),wt=o("a"),ta=l("load_lora_into_text_encoder()"),na=l(` for more details on how the state dict is loaded
into `),Qt=o("code"),oa=l("self.text_encoder"),sa=l("."),aa=d(),me=o("div"),w(ze.$$.fragment),ia=d(),Ht=o("p"),la=l("Save the LoRA parameters corresponding to the UNet and text encoder."),ra=d(),ue=o("div"),w(Ye.$$.fragment),da=d(),F=o("p"),ca=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 `),Ot=o("code"),pa=l("forward"),fa=l(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Kt=o("code"),ma=l("enable_sequential_cpu_offload"),ua=l(`, but performance is much better due to the
iterative execution of the `),en=o("code"),ga=l("unet"),ha=l("."),Jn=d(),q=o("h2"),ge=o("a"),tn=o("span"),w(qe.$$.fragment),_a=d(),nn=o("span"),ba=l("StableDiffusionPipelineOutput"),Dn=d(),Q=o("div"),w(Qe.$$.fragment),ya=d(),on=o("p"),va=l("Output class for Stable Diffusion pipelines."),$n=d(),H=o("h2"),he=o("a"),sn=o("span"),w(He.$$.fragment),wa=d(),an=o("span"),Ia=l("FlaxStableDiffusionImg2ImgPipeline"),kn=d(),E=o("div"),w(Oe.$$.fragment),xa=d(),ln=o("p"),Ma=l("Flax-based pipeline for text-guided image-to-image generation using Stable Diffusion."),Sa=d(),Ke=o("p"),Ta=l("This model inherits from "),It=o("a"),ja=l("FlaxDiffusionPipeline"),Ja=l(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Da=d(),X=o("div"),w(et.$$.fragment),$a=d(),rn=o("p"),ka=l("The call function to the pipeline for generation."),Pa=d(),w(_e.$$.fragment),Pn=d(),O=o("h2"),be=o("a"),dn=o("span"),w(tt.$$.fragment),Ea=d(),cn=o("span"),Ua=l("FlaxStableDiffusionPipelineOutput"),En=d(),N=o("div"),w(nt.$$.fragment),Za=d(),pn=o("p"),Wa=l("Output class for Flax-based Stable Diffusion pipelines."),Ba=d(),ye=o("div"),w(ot.$$.fragment),Ga=d(),fn=o("p"),Fa=l("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(t){const h=zi('[data-svelte="svelte-1phssyn"]',document.head);p=s(h,"META",{name:!0,content:!0}),h.forEach(n),y=c(t),u=s(t,"H1",{class:!0});var st=a(u);f=s(st,"A",{id:!0,class:!0,href:!0});var mn=a(f);b=s(mn,"SPAN",{});var un=a(b);I(i.$$.fragment,un),un.forEach(n),mn.forEach(n),g=c(st),ee=s(st,"SPAN",{});var gn=a(ee);to=r(gn,"Image-to-image"),gn.forEach(n),st.forEach(n),wn=c(t),at=s(t,"P",{});var hn=a(at);no=r(hn,"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."),hn.forEach(n),In=c(t),C=s(t,"P",{});var K=a(C);oo=r(K,"The "),it=s(K,"A",{href:!0});var _n=a(it);so=r(_n,"StableDiffusionImg2ImgPipeline"),_n.forEach(n),ao=r(K," uses the diffusion-denoising mechanism proposed in "),Se=s(K,"A",{href:!0,rel:!0});var bn=a(Se);io=r(bn,"SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),bn.forEach(n),lo=r(K," by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon."),K.forEach(n),xn=c(t),lt=s(t,"P",{});var La=a(lt);ro=r(La,"The abstract from the paper is:"),La.forEach(n),Mn=c(t),rt=s(t,"P",{});var Xa=a(rt);Pt=s(Xa,"EM",{});var Va=a(Pt);co=r(Va,"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."),Va.forEach(n),Xa.forEach(n),Sn=c(t),I(te.$$.fragment,t),Tn=c(t),R=s(t,"H2",{class:!0});var Zn=a(R);ne=s(Zn,"A",{id:!0,class:!0,href:!0});var Ra=a(ne);Et=s(Ra,"SPAN",{});var za=a(Et);I(Te.$$.fragment,za),za.forEach(n),Ra.forEach(n),po=c(Zn),Ut=s(Zn,"SPAN",{});var Ya=a(Ut);fo=r(Ya,"StableDiffusionImg2ImgPipeline"),Ya.forEach(n),Zn.forEach(n),jn=c(t),v=s(t,"DIV",{class:!0});var j=a(v);I(je.$$.fragment,j),mo=c(j),Zt=s(j,"P",{});var qa=a(Zt);uo=r(qa,"Pipeline for text-guided image-to-image generation using Stable Diffusion."),qa.forEach(n),go=c(j),Je=s(j,"P",{});var Wn=a(Je);ho=r(Wn,"This model inherits from "),dt=s(Wn,"A",{href:!0});var Qa=a(dt);_o=r(Qa,"DiffusionPipeline"),Qa.forEach(n),bo=r(Wn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Wn.forEach(n),yo=c(j),Wt=s(j,"P",{});var Ha=a(Wt);vo=r(Ha,"The pipeline also inherits the following loading methods:"),Ha.forEach(n),wo=c(j),B=s(j,"UL",{});var ve=a(B);ct=s(ve,"LI",{});var Na=a(ct);pt=s(Na,"A",{href:!0});var Oa=a(pt);Io=r(Oa,"load_textual_inversion()"),Oa.forEach(n),xo=r(Na," for loading textual inversion embeddings"),Na.forEach(n),Mo=c(ve),ft=s(ve,"LI",{});var Ca=a(ft);mt=s(Ca,"A",{href:!0});var Ka=a(mt);So=r(Ka,"load_lora_weights()"),Ka.forEach(n),To=r(Ca," for loading LoRA weights"),Ca.forEach(n),jo=c(ve),ut=s(ve,"LI",{});var Aa=a(ut);gt=s(Aa,"A",{href:!0});var ei=a(gt);Jo=r(ei,"save_lora_weights()"),ei.forEach(n),Do=r(Aa," for saving LoRA weights"),Aa.forEach(n),$o=c(ve),oe=s(ve,"LI",{});var yn=a(oe);ht=s(yn,"A",{href:!0});var ti=a(ht);ko=r(ti,"from_single_file()"),ti.forEach(n),Po=r(yn," for loading "),Bt=s(yn,"CODE",{});var ni=a(Bt);Eo=r(ni,".ckpt"),ni.forEach(n),Uo=r(yn," files"),yn.forEach(n),ve.forEach(n),Zo=c(j),A=s(j,"DIV",{class:!0});var xt=a(A);I(De.$$.fragment,xt),Wo=c(xt),Gt=s(xt,"P",{});var oi=a(Gt);Bo=r(oi,"The call function to the pipeline for generation."),oi.forEach(n),Go=c(xt),I(se.$$.fragment,xt),xt.forEach(n),Fo=c(j),ae=s(j,"DIV",{class:!0});var Bn=a(ae);I($e.$$.fragment,Bn),No=c(Bn),Ft=s(Bn,"P",{});var si=a(Ft);Co=r(si,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. This is useful to save some memory in exchange for a small
speed decrease.`),si.forEach(n),Bn.forEach(n),Ao=c(j),ie=s(j,"DIV",{class:!0});var Gn=a(ie);I(ke.$$.fragment,Gn),Lo=c(Gn),Pe=s(Gn,"P",{});var Fn=a(Pe);Xo=r(Fn,"Disable sliced attention computation. If "),Nt=s(Fn,"CODE",{});var ai=a(Nt);Vo=r(ai,"enable_attention_slicing"),ai.forEach(n),Ro=r(Fn,` was previously called, attention is
computed in one step.`),Fn.forEach(n),Gn.forEach(n),zo=c(j),U=s(j,"DIV",{class:!0});var we=a(U);I(Ee.$$.fragment,we),Yo=c(we),Ue=s(we,"P",{});var Nn=a(Ue);qo=r(Nn,"Enable memory efficient attention from "),Ze=s(Nn,"A",{href:!0,rel:!0});var ii=a(Ze);Qo=r(ii,"xFormers"),ii.forEach(n),Ho=r(Nn,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Nn.forEach(n),Oo=c(we),I(le.$$.fragment,we),Ko=c(we),I(re.$$.fragment,we),we.forEach(n),es=c(j),de=s(j,"DIV",{class:!0});var Cn=a(de);I(We.$$.fragment,Cn),ts=c(Cn),Be=s(Cn,"P",{});var An=a(Be);ns=r(An,"Disable memory efficient attention from "),Ge=s(An,"A",{href:!0,rel:!0});var li=a(Ge);os=r(li,"xFormers"),li.forEach(n),ss=r(An,"."),An.forEach(n),Cn.forEach(n),as=c(j),D=s(j,"DIV",{class:!0});var Z=a(D);I(Fe.$$.fragment,Z),is=c(Z),Ne=s(Z,"P",{});var Ln=a(Ne);ls=r(Ln,"Load textual inversion embeddings into the text encoder of "),_t=s(Ln,"A",{href:!0});var ri=a(_t);rs=r(ri,"StableDiffusionPipeline"),ri.forEach(n),ds=r(Ln,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Ln.forEach(n),cs=c(Z),Ct=s(Z,"P",{});var di=a(Ct);ps=r(di,"Example:"),di.forEach(n),fs=c(Z),I(ce.$$.fragment,Z),ms=c(Z),Ce=s(Z,"P",{});var Xn=a(Ce);us=r(Xn,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ae=s(Xn,"A",{href:!0,rel:!0});var ci=a(Ae);gs=r(ci,"civitAI"),ci.forEach(n),hs=r(Xn,") and then load the vector"),Xn.forEach(n),_s=c(Z),I(pe.$$.fragment,Z),Z.forEach(n),bs=c(j),L=s(j,"DIV",{class:!0});var Mt=a(L);I(Le.$$.fragment,Mt),ys=c(Mt),P=s(Mt,"P",{});var V=a(P);vs=r(V,"Instantiate a "),bt=s(V,"A",{href:!0});var pi=a(bt);ws=r(pi,"DiffusionPipeline"),pi.forEach(n),Is=r(V," from pretrained pipeline weights saved in the "),At=s(V,"CODE",{});var fi=a(At);xs=r(fi,".ckpt"),fi.forEach(n),Ms=r(V," or "),Lt=s(V,"CODE",{});var mi=a(Lt);Ss=r(mi,".safetensors"),mi.forEach(n),Ts=r(V,`
format. The pipeline is set in evaluation mode (`),Xt=s(V,"CODE",{});var ui=a(Xt);js=r(ui,"model.eval()"),ui.forEach(n),Js=r(V,") by default."),V.forEach(n),Ds=c(Mt),I(fe.$$.fragment,Mt),Mt.forEach(n),$s=c(j),$=s(j,"DIV",{class:!0});var W=a($);I(Xe.$$.fragment,W),ks=c(W),G=s(W,"P",{});var Ie=a(G);Ps=r(Ie,"Load LoRA weights specified in "),Vt=s(Ie,"CODE",{});var gi=a(Vt);Es=r(gi,"pretrained_model_name_or_path_or_dict"),gi.forEach(n),Us=r(Ie," into "),Rt=s(Ie,"CODE",{});var hi=a(Rt);Zs=r(hi,"self.unet"),hi.forEach(n),Ws=r(Ie,` and
`),zt=s(Ie,"CODE",{});var _i=a(zt);Bs=r(_i,"self.text_encoder"),_i.forEach(n),Gs=r(Ie,"."),Ie.forEach(n),Fs=c(W),Ve=s(W,"P",{});var Vn=a(Ve);Ns=r(Vn,"All kwargs are forwarded to "),Yt=s(Vn,"CODE",{});var bi=a(Yt);Cs=r(bi,"self.lora_state_dict"),bi.forEach(n),As=r(Vn,"."),Vn.forEach(n),Ls=c(W),Re=s(W,"P",{});var Rn=a(Re);Xs=r(Rn,"See "),yt=s(Rn,"A",{href:!0});var yi=a(yt);Vs=r(yi,"lora_state_dict()"),yi.forEach(n),Rs=r(Rn," for more details on how the state dict is loaded."),Rn.forEach(n),zs=c(W),z=s(W,"P",{});var St=a(z);Ys=r(St,"See "),vt=s(St,"A",{href:!0});var vi=a(vt);qs=r(vi,"load_lora_into_unet()"),vi.forEach(n),Qs=r(St,` for more details on how the state dict is loaded into
`),qt=s(St,"CODE",{});var wi=a(qt);Hs=r(wi,"self.unet"),wi.forEach(n),Os=r(St,"."),St.forEach(n),Ks=c(W),Y=s(W,"P",{});var Tt=a(Y);ea=r(Tt,"See "),wt=s(Tt,"A",{href:!0});var Ii=a(wt);ta=r(Ii,"load_lora_into_text_encoder()"),Ii.forEach(n),na=r(Tt,` for more details on how the state dict is loaded
into `),Qt=s(Tt,"CODE",{});var xi=a(Qt);oa=r(xi,"self.text_encoder"),xi.forEach(n),sa=r(Tt,"."),Tt.forEach(n),W.forEach(n),aa=c(j),me=s(j,"DIV",{class:!0});var zn=a(me);I(ze.$$.fragment,zn),ia=c(zn),Ht=s(zn,"P",{});var Mi=a(Ht);la=r(Mi,"Save the LoRA parameters corresponding to the UNet and text encoder."),Mi.forEach(n),zn.forEach(n),ra=c(j),ue=s(j,"DIV",{class:!0});var Yn=a(ue);I(Ye.$$.fragment,Yn),da=c(Yn),F=s(Yn,"P",{});var xe=a(F);ca=r(xe,`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 `),Ot=s(xe,"CODE",{});var Si=a(Ot);pa=r(Si,"forward"),Si.forEach(n),fa=r(xe,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Kt=s(xe,"CODE",{});var Ti=a(Kt);ma=r(Ti,"enable_sequential_cpu_offload"),Ti.forEach(n),ua=r(xe,`, but performance is much better due to the
iterative execution of the `),en=s(xe,"CODE",{});var ji=a(en);ga=r(ji,"unet"),ji.forEach(n),ha=r(xe,"."),xe.forEach(n),Yn.forEach(n),j.forEach(n),Jn=c(t),q=s(t,"H2",{class:!0});var qn=a(q);ge=s(qn,"A",{id:!0,class:!0,href:!0});var Ji=a(ge);tn=s(Ji,"SPAN",{});var Di=a(tn);I(qe.$$.fragment,Di),Di.forEach(n),Ji.forEach(n),_a=c(qn),nn=s(qn,"SPAN",{});var $i=a(nn);ba=r($i,"StableDiffusionPipelineOutput"),$i.forEach(n),qn.forEach(n),Dn=c(t),Q=s(t,"DIV",{class:!0});var Qn=a(Q);I(Qe.$$.fragment,Qn),ya=c(Qn),on=s(Qn,"P",{});var ki=a(on);va=r(ki,"Output class for Stable Diffusion pipelines."),ki.forEach(n),Qn.forEach(n),$n=c(t),H=s(t,"H2",{class:!0});var Hn=a(H);he=s(Hn,"A",{id:!0,class:!0,href:!0});var Pi=a(he);sn=s(Pi,"SPAN",{});var Ei=a(sn);I(He.$$.fragment,Ei),Ei.forEach(n),Pi.forEach(n),wa=c(Hn),an=s(Hn,"SPAN",{});var Ui=a(an);Ia=r(Ui,"FlaxStableDiffusionImg2ImgPipeline"),Ui.forEach(n),Hn.forEach(n),kn=c(t),E=s(t,"DIV",{class:!0});var Me=a(E);I(Oe.$$.fragment,Me),xa=c(Me),ln=s(Me,"P",{});var Zi=a(ln);Ma=r(Zi,"Flax-based pipeline for text-guided image-to-image generation using Stable Diffusion."),Zi.forEach(n),Sa=c(Me),Ke=s(Me,"P",{});var On=a(Ke);Ta=r(On,"This model inherits from "),It=s(On,"A",{href:!0});var Wi=a(It);ja=r(Wi,"FlaxDiffusionPipeline"),Wi.forEach(n),Ja=r(On,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),On.forEach(n),Da=c(Me),X=s(Me,"DIV",{class:!0});var jt=a(X);I(et.$$.fragment,jt),$a=c(jt),rn=s(jt,"P",{});var Bi=a(rn);ka=r(Bi,"The call function to the pipeline for generation."),Bi.forEach(n),Pa=c(jt),I(_e.$$.fragment,jt),jt.forEach(n),Me.forEach(n),Pn=c(t),O=s(t,"H2",{class:!0});var Kn=a(O);be=s(Kn,"A",{id:!0,class:!0,href:!0});var Gi=a(be);dn=s(Gi,"SPAN",{});var Fi=a(dn);I(tt.$$.fragment,Fi),Fi.forEach(n),Gi.forEach(n),Ea=c(Kn),cn=s(Kn,"SPAN",{});var Ni=a(cn);Ua=r(Ni,"FlaxStableDiffusionPipelineOutput"),Ni.forEach(n),Kn.forEach(n),En=c(t),N=s(t,"DIV",{class:!0});var Jt=a(N);I(nt.$$.fragment,Jt),Za=c(Jt),pn=s(Jt,"P",{});var Ci=a(pn);Wa=r(Ci,"Output class for Flax-based Stable Diffusion pipelines."),Ci.forEach(n),Ba=c(Jt),ye=s(Jt,"DIV",{class:!0});var eo=a(ye);I(ot.$$.fragment,eo),Ga=c(eo),fn=s(eo,"P",{});var Ai=a(fn);Fa=r(Ai,"\u201CReturns a new object replacing the specified fields with new values."),Ai.forEach(n),eo.forEach(n),Jt.forEach(n),this.h()},h(){m(p,"name","hf:doc:metadata"),m(p,"content",JSON.stringify(sl)),m(f,"id","imagetoimage"),m(f,"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"),m(f,"href","#imagetoimage"),m(u,"class","relative group"),m(it,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),m(Se,"href","https://huggingface.co/papers/2108.01073"),m(Se,"rel","nofollow"),m(ne,"id","diffusers.StableDiffusionImg2ImgPipeline"),m(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ne,"href","#diffusers.StableDiffusionImg2ImgPipeline"),m(R,"class","relative group"),m(dt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),m(pt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),m(mt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),m(gt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),m(ht,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),m(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(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ze,"href","https://facebookresearch.github.io/xformers/"),m(Ze,"rel","nofollow"),m(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ge,"href","https://facebookresearch.github.io/xformers/"),m(Ge,"rel","nofollow"),m(de,"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,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),m(Ae,"href","https://civitai.com/models/3036?modelVersionId=9857"),m(Ae,"rel","nofollow"),m(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(bt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),m(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(yt,"href","/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),m(vt,"href","/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),m(wt,"href","/docs/diffusers/v0.19.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),m($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ge,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),m(ge,"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"),m(ge,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),m(q,"class","relative group"),m(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(he,"id","diffusers.FlaxStableDiffusionImg2ImgPipeline"),m(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(he,"href","#diffusers.FlaxStableDiffusionImg2ImgPipeline"),m(H,"class","relative group"),m(It,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),m(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(be,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),m(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"),m(be,"href","#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),m(O,"class","relative group"),m(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(N,"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,p),_(t,y,h),_(t,u,h),e(u,f),e(f,b),x(i,b,null),e(u,g),e(u,ee),e(ee,to),_(t,wn,h),_(t,at,h),e(at,no),_(t,In,h),_(t,C,h),e(C,oo),e(C,it),e(it,so),e(C,ao),e(C,Se),e(Se,io),e(C,lo),_(t,xn,h),_(t,lt,h),e(lt,ro),_(t,Mn,h),_(t,rt,h),e(rt,Pt),e(Pt,co),_(t,Sn,h),x(te,t,h),_(t,Tn,h),_(t,R,h),e(R,ne),e(ne,Et),x(Te,Et,null),e(R,po),e(R,Ut),e(Ut,fo),_(t,jn,h),_(t,v,h),x(je,v,null),e(v,mo),e(v,Zt),e(Zt,uo),e(v,go),e(v,Je),e(Je,ho),e(Je,dt),e(dt,_o),e(Je,bo),e(v,yo),e(v,Wt),e(Wt,vo),e(v,wo),e(v,B),e(B,ct),e(ct,pt),e(pt,Io),e(ct,xo),e(B,Mo),e(B,ft),e(ft,mt),e(mt,So),e(ft,To),e(B,jo),e(B,ut),e(ut,gt),e(gt,Jo),e(ut,Do),e(B,$o),e(B,oe),e(oe,ht),e(ht,ko),e(oe,Po),e(oe,Bt),e(Bt,Eo),e(oe,Uo),e(v,Zo),e(v,A),x(De,A,null),e(A,Wo),e(A,Gt),e(Gt,Bo),e(A,Go),x(se,A,null),e(v,Fo),e(v,ae),x($e,ae,null),e(ae,No),e(ae,Ft),e(Ft,Co),e(v,Ao),e(v,ie),x(ke,ie,null),e(ie,Lo),e(ie,Pe),e(Pe,Xo),e(Pe,Nt),e(Nt,Vo),e(Pe,Ro),e(v,zo),e(v,U),x(Ee,U,null),e(U,Yo),e(U,Ue),e(Ue,qo),e(Ue,Ze),e(Ze,Qo),e(Ue,Ho),e(U,Oo),x(le,U,null),e(U,Ko),x(re,U,null),e(v,es),e(v,de),x(We,de,null),e(de,ts),e(de,Be),e(Be,ns),e(Be,Ge),e(Ge,os),e(Be,ss),e(v,as),e(v,D),x(Fe,D,null),e(D,is),e(D,Ne),e(Ne,ls),e(Ne,_t),e(_t,rs),e(Ne,ds),e(D,cs),e(D,Ct),e(Ct,ps),e(D,fs),x(ce,D,null),e(D,ms),e(D,Ce),e(Ce,us),e(Ce,Ae),e(Ae,gs),e(Ce,hs),e(D,_s),x(pe,D,null),e(v,bs),e(v,L),x(Le,L,null),e(L,ys),e(L,P),e(P,vs),e(P,bt),e(bt,ws),e(P,Is),e(P,At),e(At,xs),e(P,Ms),e(P,Lt),e(Lt,Ss),e(P,Ts),e(P,Xt),e(Xt,js),e(P,Js),e(L,Ds),x(fe,L,null),e(v,$s),e(v,$),x(Xe,$,null),e($,ks),e($,G),e(G,Ps),e(G,Vt),e(Vt,Es),e(G,Us),e(G,Rt),e(Rt,Zs),e(G,Ws),e(G,zt),e(zt,Bs),e(G,Gs),e($,Fs),e($,Ve),e(Ve,Ns),e(Ve,Yt),e(Yt,Cs),e(Ve,As),e($,Ls),e($,Re),e(Re,Xs),e(Re,yt),e(yt,Vs),e(Re,Rs),e($,zs),e($,z),e(z,Ys),e(z,vt),e(vt,qs),e(z,Qs),e(z,qt),e(qt,Hs),e(z,Os),e($,Ks),e($,Y),e(Y,ea),e(Y,wt),e(wt,ta),e(Y,na),e(Y,Qt),e(Qt,oa),e(Y,sa),e(v,aa),e(v,me),x(ze,me,null),e(me,ia),e(me,Ht),e(Ht,la),e(v,ra),e(v,ue),x(Ye,ue,null),e(ue,da),e(ue,F),e(F,ca),e(F,Ot),e(Ot,pa),e(F,fa),e(F,Kt),e(Kt,ma),e(F,ua),e(F,en),e(en,ga),e(F,ha),_(t,Jn,h),_(t,q,h),e(q,ge),e(ge,tn),x(qe,tn,null),e(q,_a),e(q,nn),e(nn,ba),_(t,Dn,h),_(t,Q,h),x(Qe,Q,null),e(Q,ya),e(Q,on),e(on,va),_(t,$n,h),_(t,H,h),e(H,he),e(he,sn),x(He,sn,null),e(H,wa),e(H,an),e(an,Ia),_(t,kn,h),_(t,E,h),x(Oe,E,null),e(E,xa),e(E,ln),e(ln,Ma),e(E,Sa),e(E,Ke),e(Ke,Ta),e(Ke,It),e(It,ja),e(Ke,Ja),e(E,Da),e(E,X),x(et,X,null),e(X,$a),e(X,rn),e(rn,ka),e(X,Pa),x(_e,X,null),_(t,Pn,h),_(t,O,h),e(O,be),e(be,dn),x(tt,dn,null),e(O,Ea),e(O,cn),e(cn,Ua),_(t,En,h),_(t,N,h),x(nt,N,null),e(N,Za),e(N,pn),e(pn,Wa),e(N,Ba),e(N,ye),x(ot,ye,null),e(ye,Ga),e(ye,fn),e(fn,Fa),Un=!0},p(t,[h]){const st={};h&2&&(st.$$scope={dirty:h,ctx:t}),te.$set(st);const mn={};h&2&&(mn.$$scope={dirty:h,ctx:t}),se.$set(mn);const un={};h&2&&(un.$$scope={dirty:h,ctx:t}),le.$set(un);const gn={};h&2&&(gn.$$scope={dirty:h,ctx:t}),re.$set(gn);const hn={};h&2&&(hn.$$scope={dirty:h,ctx:t}),ce.$set(hn);const K={};h&2&&(K.$$scope={dirty:h,ctx:t}),pe.$set(K);const _n={};h&2&&(_n.$$scope={dirty:h,ctx:t}),fe.$set(_n);const bn={};h&2&&(bn.$$scope={dirty:h,ctx:t}),_e.$set(bn)},i(t){Un||(M(i.$$.fragment,t),M(te.$$.fragment,t),M(Te.$$.fragment,t),M(je.$$.fragment,t),M(De.$$.fragment,t),M(se.$$.fragment,t),M($e.$$.fragment,t),M(ke.$$.fragment,t),M(Ee.$$.fragment,t),M(le.$$.fragment,t),M(re.$$.fragment,t),M(We.$$.fragment,t),M(Fe.$$.fragment,t),M(ce.$$.fragment,t),M(pe.$$.fragment,t),M(Le.$$.fragment,t),M(fe.$$.fragment,t),M(Xe.$$.fragment,t),M(ze.$$.fragment,t),M(Ye.$$.fragment,t),M(qe.$$.fragment,t),M(Qe.$$.fragment,t),M(He.$$.fragment,t),M(Oe.$$.fragment,t),M(et.$$.fragment,t),M(_e.$$.fragment,t),M(tt.$$.fragment,t),M(nt.$$.fragment,t),M(ot.$$.fragment,t),Un=!0)},o(t){S(i.$$.fragment,t),S(te.$$.fragment,t),S(Te.$$.fragment,t),S(je.$$.fragment,t),S(De.$$.fragment,t),S(se.$$.fragment,t),S($e.$$.fragment,t),S(ke.$$.fragment,t),S(Ee.$$.fragment,t),S(le.$$.fragment,t),S(re.$$.fragment,t),S(We.$$.fragment,t),S(Fe.$$.fragment,t),S(ce.$$.fragment,t),S(pe.$$.fragment,t),S(Le.$$.fragment,t),S(fe.$$.fragment,t),S(Xe.$$.fragment,t),S(ze.$$.fragment,t),S(Ye.$$.fragment,t),S(qe.$$.fragment,t),S(Qe.$$.fragment,t),S(He.$$.fragment,t),S(Oe.$$.fragment,t),S(et.$$.fragment,t),S(_e.$$.fragment,t),S(tt.$$.fragment,t),S(nt.$$.fragment,t),S(ot.$$.fragment,t),Un=!1},d(t){n(p),t&&n(y),t&&n(u),T(i),t&&n(wn),t&&n(at),t&&n(In),t&&n(C),t&&n(xn),t&&n(lt),t&&n(Mn),t&&n(rt),t&&n(Sn),T(te,t),t&&n(Tn),t&&n(R),T(Te),t&&n(jn),t&&n(v),T(je),T(De),T(se),T($e),T(ke),T(Ee),T(le),T(re),T(We),T(Fe),T(ce),T(pe),T(Le),T(fe),T(Xe),T(ze),T(Ye),t&&n(Jn),t&&n(q),T(qe),t&&n(Dn),t&&n(Q),T(Qe),t&&n($n),t&&n(H),T(He),t&&n(kn),t&&n(E),T(Oe),T(et),T(_e),t&&n(Pn),t&&n(O),T(tt),t&&n(En),t&&n(N),T(nt),T(ot)}}}const sl={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 al(J){return Yi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fl extends Xi{constructor(p){super();Vi(this,p,al,ol,Ri,{})}}export{fl as default,sl as metadata};
