import{S as Ks,i as ei,s as ti,e as i,k as p,w as x,t as a,M as oi,c as l,d as t,m,a as r,x as T,h as s,b as g,G as e,g as M,y as J,q as j,o as k,B as S,v as ni,L as gt}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as ko}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as ht}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Os}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ut}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ai(D){let d,b,f,c,_;return c=new ht({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUwQW1vZGVsX2lkX29yX3BhdGglMjAlM0QlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbWcySW1nUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkX29yX3BhdGglMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oZGV2aWNlKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBpbml0X2ltYWdlLnJlc2l6ZSgoNzY4JTJDJTIwNTEyKSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmFudGFzeSUyMGxhbmRzY2FwZSUyQyUyMHRyZW5kaW5nJTIwb24lMjBhcnRzdGF0aW9uJTIyJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBzdHJlbmd0aCUzRDAuNzUlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDcuNSkuaW1hZ2VzJTBBaW1hZ2VzJTVCMCU1RC5zYXZlKCUyMmZhbnRhc3lfbGFuZHNjYXBlLnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionImg2ImgPipeline

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = init_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

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

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt=prompt, image=init_image, strength=<span class="hljs-number">0.75</span>, guidance_scale=<span class="hljs-number">7.5</span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_landscape.png&quot;</span>)`}}),{c(){d=i("p"),b=a("Examples:"),f=p(),x(c.$$.fragment)},l(n){d=l(n,"P",{});var u=r(d);b=s(u,"Examples:"),u.forEach(t),f=m(n),T(c.$$.fragment,n)},m(n,u){M(n,d,u),e(d,b),M(n,f,u),J(c,n,u),_=!0},p:gt,i(n){_||(j(c.$$.fragment,n),_=!0)},o(n){k(c.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),S(c,n)}}}function si(D){let d,b,f,c,_;return c=new ht({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){d=i("p"),b=a("Examples:"),f=p(),x(c.$$.fragment)},l(n){d=l(n,"P",{});var u=r(d);b=s(u,"Examples:"),u.forEach(t),f=m(n),T(c.$$.fragment,n)},m(n,u){M(n,d,u),e(d,b),M(n,f,u),J(c,n,u),_=!0},p:gt,i(n){_||(j(c.$$.fragment,n),_=!0)},o(n){k(c.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),S(c,n)}}}function ii(D){let d,b;return{c(){d=i("p"),b=a("This function is experimental and might change in the future.")},l(f){d=l(f,"P",{});var c=r(d);b=s(c,"This function is experimental and might change in the future."),c.forEach(t)},m(f,c){M(f,d,c),e(d,b)},d(f){f&&t(d)}}}function li(D){let d,b,f,c,_,n,u,$;return{c(){d=i("p"),b=a("It is required to be logged in ("),f=i("code"),c=a("huggingface-cli login"),_=a(") when you want to use private or "),n=i("a"),u=a(`gated
models`),$=a("."),this.h()},l(h){d=l(h,"P",{});var v=r(d);b=s(v,"It is required to be logged in ("),f=l(v,"CODE",{});var U=r(f);c=s(U,"huggingface-cli login"),U.forEach(t),_=s(v,") when you want to use private or "),n=l(v,"A",{href:!0,rel:!0});var B=r(n);u=s(B,`gated
models`),B.forEach(t),$=s(v,"."),v.forEach(t),this.h()},h(){g(n,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),g(n,"rel","nofollow")},m(h,v){M(h,d,v),e(d,b),e(d,f),e(f,c),e(d,_),e(d,n),e(n,u),e(d,$)},d(h){h&&t(d)}}}function ri(D){let d,b,f,c,_,n,u,$;return u=new ht({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){d=i("p"),b=a("e.g. from "),f=i("a"),c=a("civitAI"),_=a(" and then load the vector locally:"),n=p(),x(u.$$.fragment),this.h()},l(h){d=l(h,"P",{});var v=r(d);b=s(v,"e.g. from "),f=l(v,"A",{href:!0,rel:!0});var U=r(f);c=s(U,"civitAI"),U.forEach(t),_=s(v," and then load the vector locally:"),v.forEach(t),n=m(h),T(u.$$.fragment,h),this.h()},h(){g(f,"href","https://civitai.com/models/3036?modelVersionId=9857"),g(f,"rel","nofollow")},m(h,v){M(h,d,v),e(d,b),e(d,f),e(f,c),e(d,_),M(h,n,v),J(u,h,v),$=!0},p:gt,i(h){$||(j(u.$$.fragment,h),$=!0)},o(h){k(u.$$.fragment,h),$=!1},d(h){h&&t(d),h&&t(n),S(u,h)}}}function ci(D){let d,b,f,c,_;return c=new ht({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9ja3B0KCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZXYXJyaW9yTWFtYTc3NyUyRk9yYW5nZU1peHMlMkZibG9iJTJGbWFpbiUyRk1vZGVscyUyRkFieXNzT3JhbmdlTWl4JTJGQWJ5c3NPcmFuZ2VNaXguc2FmZXRlbnNvcnMlMjIlMEEpJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBsb2NhbCUyMGZpbGUlMEElMjMlMjBmaWxlJTIwaXMlMjBkb3dubG9hZGVkJTIwdW5kZXIlMjAuJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX2NrcHQoJTIyLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHklMjIpJTBBJTBBJTIzJTIwRW5hYmxlJTIwZmxvYXQxNiUyMGFuZCUyMG1vdmUlMjB0byUyMEdQVSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9ja3B0KCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",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_ckpt(
<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_ckpt(<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_ckpt(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){d=i("p"),b=a("Examples:"),f=p(),x(c.$$.fragment)},l(n){d=l(n,"P",{});var u=r(d);b=s(u,"Examples:"),u.forEach(t),f=m(n),T(c.$$.fragment,n)},m(n,u){M(n,d,u),e(d,b),M(n,f,u),J(c,n,u),_=!0},p:gt,i(n){_||(j(c.$$.fragment,n),_=!0)},o(n){k(c.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),S(c,n)}}}function pi(D){let d,b,f,c,_;return{c(){d=i("p"),b=a("We support loading A1111 formatted LoRA checkpoints in a limited capacity."),f=p(),c=i("p"),_=a("This function is experimental and might change in the future.")},l(n){d=l(n,"P",{});var u=r(d);b=s(u,"We support loading A1111 formatted LoRA checkpoints in a limited capacity."),u.forEach(t),f=m(n),c=l(n,"P",{});var $=r(c);_=s($,"This function is experimental and might change in the future."),$.forEach(t)},m(n,u){M(n,d,u),e(d,b),M(n,f,u),M(n,c,u),e(c,_)},d(n){n&&t(d),n&&t(f),n&&t(c)}}}function mi(D){let d,b,f,c,_,n,u,$;return{c(){d=i("p"),b=a("It is required to be logged in ("),f=i("code"),c=a("huggingface-cli login"),_=a(") when you want to use private or "),n=i("a"),u=a(`gated
models`),$=a("."),this.h()},l(h){d=l(h,"P",{});var v=r(d);b=s(v,"It is required to be logged in ("),f=l(v,"CODE",{});var U=r(f);c=s(U,"huggingface-cli login"),U.forEach(t),_=s(v,") when you want to use private or "),n=l(v,"A",{href:!0,rel:!0});var B=r(n);u=s(B,`gated
models`),B.forEach(t),$=s(v,"."),v.forEach(t),this.h()},h(){g(n,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),g(n,"rel","nofollow")},m(h,v){M(h,d,v),e(d,b),e(d,f),e(f,c),e(d,_),e(d,n),e(n,u),e(d,$)},d(h){h&&t(d)}}}function fi(D){let d,b,f,c,_;return c=new ht({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMGlvJTIwaW1wb3J0JTIwQnl0ZXNJTyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBGbGF4U3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lJTBBJTBBJTBBZGVmJTIwY3JlYXRlX2tleShzZWVkJTNEMCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBqYXgucmFuZG9tLlBSTkdLZXkoc2VlZCklMEElMEElMEFybmclMjAlM0QlMjBjcmVhdGVfa2V5KDApJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24lMkZtYWluJTJGYXNzZXRzJTJGc3RhYmxlLXNhbXBsZXMlMkZpbWcyaW1nJTJGc2tldGNoLW1vdW50YWlucy1pbnB1dC5qcGclMjIlMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBaW5pdF9pbWclMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWluaXRfaW1nJTIwJTNEJTIwaW5pdF9pbWcucmVzaXplKCg3NjglMkMlMjA1MTIpKSUwQSUwQXByb21wdHMlMjAlM0QlMjAlMjJBJTIwZmFudGFzeSUyMGxhbmRzY2FwZSUyQyUyMHRyZW5kaW5nJTIwb24lMjBhcnRzdGF0aW9uJTIyJTBBJTBBcGlwZWxpbmUlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4U3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTJDJTBBJTIwJTIwJTIwJTIwcmV2aXNpb24lM0QlMjJmbGF4JTIyJTJDJTBBJTIwJTIwJTIwJTIwZHR5cGUlM0RqbnAuYmZsb2F0MTYlMkMlMEEpJTBBJTBBbnVtX3NhbXBsZXMlMjAlM0QlMjBqYXguZGV2aWNlX2NvdW50KCklMEFybmclMjAlM0QlMjBqYXgucmFuZG9tLnNwbGl0KHJuZyUyQyUyMGpheC5kZXZpY2VfY291bnQoKSklMEFwcm9tcHRfaWRzJTJDJTIwcHJvY2Vzc2VkX2ltYWdlJTIwJTNEJTIwcGlwZWxpbmUucHJlcGFyZV9pbnB1dHMoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTVCcHJvbXB0cyU1RCUyMColMjBudW1fc2FtcGxlcyUyQyUyMGltYWdlJTNEJTVCaW5pdF9pbWclNUQlMjAqJTIwbnVtX3NhbXBsZXMlMEEpJTBBcF9wYXJhbXMlMjAlM0QlMjByZXBsaWNhdGUocGFyYW1zKSUwQXByb21wdF9pZHMlMjAlM0QlMjBzaGFyZChwcm9tcHRfaWRzKSUwQXByb2Nlc3NlZF9pbWFnZSUyMCUzRCUyMHNoYXJkKHByb2Nlc3NlZF9pbWFnZSklMEElMEFvdXRwdXQlMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjAlMjAlMjBwcm9tcHRfaWRzJTNEcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEcHJvY2Vzc2VkX2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwcGFyYW1zJTNEcF9wYXJhbXMlMkMlMEElMjAlMjAlMjAlMjBwcm5nX3NlZWQlM0RybmclMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuNzUlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBqaXQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEEpLmltYWdlcyUwQSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBwaXBlbGluZS5udW1weV90b19waWwobnAuYXNhcnJheShvdXRwdXQucmVzaGFwZSgobnVtX3NhbXBsZXMlMkMpJTIwJTJCJTIwb3V0cHV0LnNoYXBlJTVCLTMlM0ElNUQpKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionImg2ImgPipeline


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


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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_img = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_img = init_img.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipeline.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))`}}),{c(){d=i("p"),b=a("Examples:"),f=p(),x(c.$$.fragment)},l(n){d=l(n,"P",{});var u=r(d);b=s(u,"Examples:"),u.forEach(t),f=m(n),T(c.$$.fragment,n)},m(n,u){M(n,d,u),e(d,b),M(n,f,u),J(c,n,u),_=!0},p:gt,i(n){_||(j(c.$$.fragment,n),_=!0)},o(n){k(c.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(f),S(c,n)}}}function ui(D){let d,b,f,c,_,n,u,$,h,v,U,B,_t,ye,So,bt,$o,so,E,Do,ve,Uo,Po,we,Eo,Zo,Ie,Wo,Bo,Me,Go,Co,Oe,Fo,No,io,xe,Xo,Te,Ao,lo,K,Ke,Vo,Lo,et,Ro,ro,ee,qo,Je,zo,Yo,co,y,je,Qo,yt,Ho,Oo,ke,Ko,tt,en,tn,on,vt,nn,an,Y,Se,wt,sn,ln,ot,rn,dn,$e,It,cn,pn,nt,mn,fn,De,Mt,un,gn,at,hn,_n,xt,bn,yn,Tt,Ue,Jt,vn,wn,st,In,Mn,V,Pe,xn,jt,Tn,Jn,te,jn,L,Ee,kn,kt,Sn,$n,St,Dn,Un,oe,Ze,Pn,We,En,$t,Zn,Wn,Bn,G,Be,Gn,Dt,Cn,Fn,Ut,Nn,Xn,Pt,An,Vn,ne,Ln,ae,Ge,Rn,Et,qn,zn,P,Ce,Yn,Q,Qn,Zt,Hn,On,Wt,Kn,ea,ta,se,oa,ie,na,Bt,aa,sa,le,ia,Gt,la,ra,re,da,X,Fe,ca,Ct,pa,ma,Ne,fa,Ft,ua,ga,ha,de,_a,A,Xe,ba,H,ya,it,va,wa,Ae,Nt,Ia,Ma,xa,ce,Ta,pe,Ja,me,Ve,ja,Xt,ka,Sa,fe,Le,$a,F,Da,At,Ua,Pa,Vt,Ea,Za,Lt,Wa,Ba,Rt,Ga,Ca,Fa,ue,Re,Na,O,Xa,qt,Aa,Va,zt,La,Ra,po,N,qe,qa,Yt,za,Ya,ze,Qa,Qt,Ha,Oa,Ka,R,Ye,es,Ht,ts,os,ge,mo;return n=new Os({}),ye=new Os({}),je=new C({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.17.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.0/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.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.17.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.17.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.17.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 details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L101"}}),Pe=new C({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[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,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, that will be used as the starting point for the
process. Can also accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger 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 will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, 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 will be 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;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,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 not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code>. instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code>
is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</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, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__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 generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.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.17.0/en/api/pipelines/stable_diffusion/overview#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 will be called every <code>callback_steps</code> steps during inference. The function will be
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 will be called. If not specified, the callback will be
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 under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L610",returnDescription:`
<p><a
  href="/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),te=new ut({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[ai]},$$scope:{ctx:D}}}),Ee=new C({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.17.0/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),Ze=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),Be=new C({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.17.0/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),ne=new ut({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[si]},$$scope:{ctx:D}}}),Ge=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),Ce=new C({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:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
<li>A path to a <em>file</em> containing textual inversion weights, e.g. <code>./my_text_inversions.pt</code>.</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>
<p>Or a list of those elements.`,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 in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> 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 &#x201C;Automatic1111&#x201D; form.</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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <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(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be 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;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/loaders.py#L482"}}),se=new ko({props:{warning:!0,$$slots:{default:[ii]},$$scope:{ctx:D}}}),ie=new ko({props:{$$slots:{default:[li]},$$scope:{ctx:D}}}),le=new ut({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[ri]},$$scope:{ctx:D}}}),re=new ut({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[di]},$$scope:{ctx:D}}}),Fe=new C({props:{name:"from_ckpt",anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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 .ckpt file on the Hub. Should be in the format
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;&quot;</code></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_ckpt.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 under this dtype. If <code>&quot;auto&quot;</code> is passed the dtype
will be automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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_ckpt.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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, e.g., <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_ckpt.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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 pipeline will load the <code>safetensors</code> weights if they&#x2019;re available <strong>and</strong> if the
<code>safetensors</code> library is installed. If set to <code>True</code>, the pipeline will forcibly load the models from
<code>safetensors</code> weights. If set to <code>False</code> the pipeline will <em>not</em> use <code>safetensors</code>.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Only relevant for
checkpoints that have both EMA and non-EMA weights. Whether to extract the EMA weights or not. Defaults
to <code>False</code>. Pass <code>True</code> to extract the EMA weights. EMA weights usually yield higher quality images for
inference. Non-EMA weights are usually better to continue fine-tuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.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. This is necessary when running stable`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size that the model was trained on. Use 512 for Stable Diffusion v1.X and Stable Diffusion v2
Base. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type that the model was trained on. Use <code>&apos;epsilon&apos;</code> for Stable Diffusion v1.X and Stable
Diffusion v2 Base. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to None) &#x2014;
The number of input channels. If <code>None</code>, it will be automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to &#x2018;pndm&#x2019;) &#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_ckpt.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. Defaults to <code>True</code>.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load - and saveable variables - <em>i.e.</em> the pipeline components - of the
specific pipeline class. The overwritten components are then 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.17.0/src/diffusers/loaders.py#L1337"}}),de=new ut({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_ckpt.example",$$slots:{default:[ci]},$$scope:{ctx:D}}}),Xe=new C({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;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <code>~ModelMixin.save_config</code>, e.g.,
<code>./my_model_directory/</code>.</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_or_dict"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.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_lora_weights.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.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, e.g., <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_lora_weights.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/loaders.py#L781"}}),ce=new ko({props:{warning:!0,$$slots:{default:[pi]},$$scope:{ctx:D}}}),pe=new ko({props:{$$slots:{default:[mi]},$$scope:{ctx:D}}}),Ve=new C({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 which to save. 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 UNet. Specifying this helps to make the
serialization process easier and cleaner. Values can be both LoRA torch.nn.Modules layers or torch
weights.`,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] or </code>Dict[str, torch.Tensor]<code>) -- State dict of the LoRA layers corresponding to the </code>text_encoder<code>. Since the </code>text_encoder<code>comes from</code>transformers`, we cannot rejig it. That is why we have to explicitly pass the text encoder LoRA state\ndict. Values can be both LoRA torch.nn.Modules layers or torch weights.",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 when in distributed training like
TPUs and 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 on distributed training like TPUs when one
need to replace <code>torch.save</code> by 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.17.0/src/diffusers/loaders.py#L1201"}}),Le=new C({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.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L255"}}),Re=new C({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L229"}}),qe=new C({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.17.0/en/api/models#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.0/en/api/models#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.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 details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L105"}}),Ye=new C({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 the image generation.`,name:"prompt_ids"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>jnp.array</code>) &#x2014;
Array representing an image batch, that will be used as the starting point for the process.`,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;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger 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 will
be maximum and the denoising process will run for the full number of iterations specified in`,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.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#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 self.unet.config.sample_size * self.vae_scale_factor) &#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;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,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. tensor will ge 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 <code>FlaxStableDiffusionPipelineOutput</code> 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. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L338",returnDescription:`
<p><code>FlaxStableDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>FlaxStableDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),ge=new ut({props:{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[fi]},$$scope:{ctx:D}}}),{c(){d=i("meta"),b=p(),f=i("h1"),c=i("a"),_=i("span"),x(n.$$.fragment),u=p(),$=i("span"),h=a("Image-to-Image Generation"),v=p(),U=i("h2"),B=i("a"),_t=i("span"),x(ye.$$.fragment),So=p(),bt=i("span"),$o=a("StableDiffusionImg2ImgPipeline"),so=p(),E=i("p"),Do=a("The Stable Diffusion model was created by the researchers and engineers from "),ve=i("a"),Uo=a("CompVis"),Po=a(", "),we=i("a"),Eo=a("Stability AI"),Zo=a(", "),Ie=i("a"),Wo=a("runway"),Bo=a(", and "),Me=i("a"),Go=a("LAION"),Co=a(". The "),Oe=i("a"),Fo=a("StableDiffusionImg2ImgPipeline"),No=a(" lets you pass a text prompt and an initial image to condition the generation of new images using Stable Diffusion."),io=p(),xe=i("p"),Xo=a("The original codebase can be found here: "),Te=i("a"),Ao=a("CampVis/stable-diffusion"),lo=p(),K=i("p"),Ke=i("a"),Vo=a("StableDiffusionImg2ImgPipeline"),Lo=a(" is compatible with all Stable Diffusion checkpoints for "),et=i("a"),Ro=a("Text-to-Image"),ro=p(),ee=i("p"),qo=a("The pipeline uses the diffusion-denoising mechanism proposed by SDEdit ("),Je=i("a"),zo=a("SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),Yo=a(`
proposed by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon).`),co=p(),y=i("div"),x(je.$$.fragment),Qo=p(),yt=i("p"),Ho=a("Pipeline for text-guided image to image generation using Stable Diffusion."),Oo=p(),ke=i("p"),Ko=a("This model inherits from "),tt=i("a"),en=a("DiffusionPipeline"),tn=a(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),on=p(),vt=i("p"),nn=a("In addition the pipeline inherits the following loading methods:"),an=p(),Y=i("ul"),Se=i("li"),wt=i("em"),sn=a("Textual-Inversion"),ln=a(": "),ot=i("a"),rn=a("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),dn=p(),$e=i("li"),It=i("em"),cn=a("LoRA"),pn=a(": "),nt=i("a"),mn=a("loaders.LoraLoaderMixin.load_lora_weights()"),fn=p(),De=i("li"),Mt=i("em"),un=a("Ckpt"),gn=a(": "),at=i("a"),hn=a("loaders.FromCkptMixin.from_ckpt()"),_n=p(),xt=i("p"),bn=a("as well as the following saving methods:"),yn=p(),Tt=i("ul"),Ue=i("li"),Jt=i("em"),vn=a("LoRA"),wn=a(": "),st=i("a"),In=a("loaders.LoraLoaderMixin.save_lora_weights()"),Mn=p(),V=i("div"),x(Pe.$$.fragment),xn=p(),jt=i("p"),Tn=a("Function invoked when calling the pipeline for generation."),Jn=p(),x(te.$$.fragment),jn=p(),L=i("div"),x(Ee.$$.fragment),kn=p(),kt=i("p"),Sn=a("Enable sliced attention computation."),$n=p(),St=i("p"),Dn=a(`When this option is enabled, the attention module will split 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.`),Un=p(),oe=i("div"),x(Ze.$$.fragment),Pn=p(),We=i("p"),En=a("Disable sliced attention computation. If "),$t=i("code"),Zn=a("enable_attention_slicing"),Wn=a(` was previously invoked, this method will go
back to computing attention in one step.`),Bn=p(),G=i("div"),x(Be.$$.fragment),Gn=p(),Dt=i("p"),Cn=a("Enable memory efficient attention as implemented in xformers."),Fn=p(),Ut=i("p"),Nn=a(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),Xn=p(),Pt=i("p"),An=a(`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Vn=p(),x(ne.$$.fragment),Ln=p(),ae=i("div"),x(Ge.$$.fragment),Rn=p(),Et=i("p"),qn=a("Disable memory efficient attention as implemented in xformers."),zn=p(),P=i("div"),x(Ce.$$.fragment),Yn=p(),Q=i("p"),Qn=a("Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Zt=i("code"),Hn=a("diffusers"),On=a(` and
`),Wt=i("code"),Kn=a("Automatic1111"),ea=a(" formats are supported (see example below)."),ta=p(),x(se.$$.fragment),oa=p(),x(ie.$$.fragment),na=p(),Bt=i("p"),aa=a("Example:"),sa=p(),x(le.$$.fragment),ia=p(),Gt=i("p"),la=a("To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),ra=p(),x(re.$$.fragment),da=p(),X=i("div"),x(Fe.$$.fragment),ca=p(),Ct=i("p"),pa=a("Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights saved in the original .ckpt format."),ma=p(),Ne=i("p"),fa=a("The pipeline is set in evaluation mode by default using "),Ft=i("code"),ua=a("model.eval()"),ga=a(" (Dropout modules are deactivated)."),ha=p(),x(de.$$.fragment),_a=p(),A=i("div"),x(Xe.$$.fragment),ba=p(),H=i("p"),ya=a("Load pretrained attention processor layers (such as LoRA) into "),it=i("a"),va=a("UNet2DConditionModel"),wa=a(` and
`),Ae=i("a"),Nt=i("code"),Ia=a("CLIPTextModel"),Ma=a(")."),xa=p(),x(ce.$$.fragment),Ta=p(),x(pe.$$.fragment),Ja=p(),me=i("div"),x(Ve.$$.fragment),ja=p(),Xt=i("p"),ka=a("Save the LoRA parameters corresponding to the UNet and the text encoder."),Sa=p(),fe=i("div"),x(Le.$$.fragment),$a=p(),F=i("p"),Da=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),At=i("code"),Ua=a("enable_sequential_cpu_offload"),Pa=a(", this method moves one whole model at a time to the GPU when its "),Vt=i("code"),Ea=a("forward"),Za=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Lt=i("code"),Wa=a("enable_sequential_cpu_offload"),Ba=a(", but performance is much better due to the iterative execution of the "),Rt=i("code"),Ga=a("unet"),Ca=a("."),Fa=p(),ue=i("div"),x(Re.$$.fragment),Na=p(),O=i("p"),Xa=a(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),qt=i("code"),Aa=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Va=a("forward"),zt=i("code"),La=a("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Ra=a("enable_model_cpu_offload`, but performance is lower."),po=p(),N=i("div"),x(qe.$$.fragment),qa=p(),Yt=i("p"),za=a("Pipeline for image-to-image generation using Stable Diffusion."),Ya=p(),ze=i("p"),Qa=a("This model inherits from "),Qt=i("code"),Ha=a("FlaxDiffusionPipeline"),Oa=a(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ka=p(),R=i("div"),x(Ye.$$.fragment),es=p(),Ht=i("p"),ts=a("Function invoked when calling the pipeline for generation."),os=p(),x(ge.$$.fragment),this.h()},l(o){const w=oi('[data-svelte="svelte-1phssyn"]',document.head);d=l(w,"META",{name:!0,content:!0}),w.forEach(t),b=m(o),f=l(o,"H1",{class:!0});var Qe=r(f);c=l(Qe,"A",{id:!0,class:!0,href:!0});var Ot=r(c);_=l(Ot,"SPAN",{});var Kt=r(_);T(n.$$.fragment,Kt),Kt.forEach(t),Ot.forEach(t),u=m(Qe),$=l(Qe,"SPAN",{});var eo=r($);h=s(eo,"Image-to-Image Generation"),eo.forEach(t),Qe.forEach(t),v=m(o),U=l(o,"H2",{class:!0});var He=r(U);B=l(He,"A",{id:!0,class:!0,href:!0});var to=r(B);_t=l(to,"SPAN",{});var oo=r(_t);T(ye.$$.fragment,oo),oo.forEach(t),to.forEach(t),So=m(He),bt=l(He,"SPAN",{});var no=r(bt);$o=s(no,"StableDiffusionImg2ImgPipeline"),no.forEach(t),He.forEach(t),so=m(o),E=l(o,"P",{});var W=r(E);Do=s(W,"The Stable Diffusion model was created by the researchers and engineers from "),ve=l(W,"A",{href:!0,rel:!0});var ao=r(ve);Uo=s(ao,"CompVis"),ao.forEach(t),Po=s(W,", "),we=l(W,"A",{href:!0,rel:!0});var as=r(we);Eo=s(as,"Stability AI"),as.forEach(t),Zo=s(W,", "),Ie=l(W,"A",{href:!0,rel:!0});var ss=r(Ie);Wo=s(ss,"runway"),ss.forEach(t),Bo=s(W,", and "),Me=l(W,"A",{href:!0,rel:!0});var is=r(Me);Go=s(is,"LAION"),is.forEach(t),Co=s(W,". The "),Oe=l(W,"A",{href:!0});var ls=r(Oe);Fo=s(ls,"StableDiffusionImg2ImgPipeline"),ls.forEach(t),No=s(W," lets you pass a text prompt and an initial image to condition the generation of new images using Stable Diffusion."),W.forEach(t),io=m(o),xe=l(o,"P",{});var ns=r(xe);Xo=s(ns,"The original codebase can be found here: "),Te=l(ns,"A",{href:!0,rel:!0});var rs=r(Te);Ao=s(rs,"CampVis/stable-diffusion"),rs.forEach(t),ns.forEach(t),lo=m(o),K=l(o,"P",{});var fo=r(K);Ke=l(fo,"A",{href:!0});var ds=r(Ke);Vo=s(ds,"StableDiffusionImg2ImgPipeline"),ds.forEach(t),Lo=s(fo," is compatible with all Stable Diffusion checkpoints for "),et=l(fo,"A",{href:!0});var cs=r(et);Ro=s(cs,"Text-to-Image"),cs.forEach(t),fo.forEach(t),ro=m(o),ee=l(o,"P",{});var uo=r(ee);qo=s(uo,"The pipeline uses the diffusion-denoising mechanism proposed by SDEdit ("),Je=l(uo,"A",{href:!0,rel:!0});var ps=r(Je);zo=s(ps,"SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),ps.forEach(t),Yo=s(uo,`
proposed by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon).`),uo.forEach(t),co=m(o),y=l(o,"DIV",{class:!0});var I=r(y);T(je.$$.fragment,I),Qo=m(I),yt=l(I,"P",{});var ms=r(yt);Ho=s(ms,"Pipeline for text-guided image to image generation using Stable Diffusion."),ms.forEach(t),Oo=m(I),ke=l(I,"P",{});var go=r(ke);Ko=s(go,"This model inherits from "),tt=l(go,"A",{href:!0});var fs=r(tt);en=s(fs,"DiffusionPipeline"),fs.forEach(t),tn=s(go,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),go.forEach(t),on=m(I),vt=l(I,"P",{});var us=r(vt);nn=s(us,"In addition the pipeline inherits the following loading methods:"),us.forEach(t),an=m(I),Y=l(I,"UL",{});var lt=r(Y);Se=l(lt,"LI",{});var ho=r(Se);wt=l(ho,"EM",{});var gs=r(wt);sn=s(gs,"Textual-Inversion"),gs.forEach(t),ln=s(ho,": "),ot=l(ho,"A",{href:!0});var hs=r(ot);rn=s(hs,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),hs.forEach(t),ho.forEach(t),dn=m(lt),$e=l(lt,"LI",{});var _o=r($e);It=l(_o,"EM",{});var _s=r(It);cn=s(_s,"LoRA"),_s.forEach(t),pn=s(_o,": "),nt=l(_o,"A",{href:!0});var bs=r(nt);mn=s(bs,"loaders.LoraLoaderMixin.load_lora_weights()"),bs.forEach(t),_o.forEach(t),fn=m(lt),De=l(lt,"LI",{});var bo=r(De);Mt=l(bo,"EM",{});var ys=r(Mt);un=s(ys,"Ckpt"),ys.forEach(t),gn=s(bo,": "),at=l(bo,"A",{href:!0});var vs=r(at);hn=s(vs,"loaders.FromCkptMixin.from_ckpt()"),vs.forEach(t),bo.forEach(t),lt.forEach(t),_n=m(I),xt=l(I,"P",{});var ws=r(xt);bn=s(ws,"as well as the following saving methods:"),ws.forEach(t),yn=m(I),Tt=l(I,"UL",{});var Is=r(Tt);Ue=l(Is,"LI",{});var yo=r(Ue);Jt=l(yo,"EM",{});var Ms=r(Jt);vn=s(Ms,"LoRA"),Ms.forEach(t),wn=s(yo,": "),st=l(yo,"A",{href:!0});var xs=r(st);In=s(xs,"loaders.LoraLoaderMixin.save_lora_weights()"),xs.forEach(t),yo.forEach(t),Is.forEach(t),Mn=m(I),V=l(I,"DIV",{class:!0});var rt=r(V);T(Pe.$$.fragment,rt),xn=m(rt),jt=l(rt,"P",{});var Ts=r(jt);Tn=s(Ts,"Function invoked when calling the pipeline for generation."),Ts.forEach(t),Jn=m(rt),T(te.$$.fragment,rt),rt.forEach(t),jn=m(I),L=l(I,"DIV",{class:!0});var dt=r(L);T(Ee.$$.fragment,dt),kn=m(dt),kt=l(dt,"P",{});var Js=r(kt);Sn=s(Js,"Enable sliced attention computation."),Js.forEach(t),$n=m(dt),St=l(dt,"P",{});var js=r(St);Dn=s(js,`When this option is enabled, the attention module will split 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.`),js.forEach(t),dt.forEach(t),Un=m(I),oe=l(I,"DIV",{class:!0});var vo=r(oe);T(Ze.$$.fragment,vo),Pn=m(vo),We=l(vo,"P",{});var wo=r(We);En=s(wo,"Disable sliced attention computation. If "),$t=l(wo,"CODE",{});var ks=r($t);Zn=s(ks,"enable_attention_slicing"),ks.forEach(t),Wn=s(wo,` was previously invoked, this method will go
back to computing attention in one step.`),wo.forEach(t),vo.forEach(t),Bn=m(I),G=l(I,"DIV",{class:!0});var q=r(G);T(Be.$$.fragment,q),Gn=m(q),Dt=l(q,"P",{});var Ss=r(Dt);Cn=s(Ss,"Enable memory efficient attention as implemented in xformers."),Ss.forEach(t),Fn=m(q),Ut=l(q,"P",{});var $s=r(Ut);Nn=s($s,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),$s.forEach(t),Xn=m(q),Pt=l(q,"P",{});var Ds=r(Pt);An=s(Ds,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Ds.forEach(t),Vn=m(q),T(ne.$$.fragment,q),q.forEach(t),Ln=m(I),ae=l(I,"DIV",{class:!0});var Io=r(ae);T(Ge.$$.fragment,Io),Rn=m(Io),Et=l(Io,"P",{});var Us=r(Et);qn=s(Us,"Disable memory efficient attention as implemented in xformers."),Us.forEach(t),Io.forEach(t),zn=m(I),P=l(I,"DIV",{class:!0});var Z=r(P);T(Ce.$$.fragment,Z),Yn=m(Z),Q=l(Z,"P",{});var ct=r(Q);Qn=s(ct,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Zt=l(ct,"CODE",{});var Ps=r(Zt);Hn=s(Ps,"diffusers"),Ps.forEach(t),On=s(ct,` and
`),Wt=l(ct,"CODE",{});var Es=r(Wt);Kn=s(Es,"Automatic1111"),Es.forEach(t),ea=s(ct," formats are supported (see example below)."),ct.forEach(t),ta=m(Z),T(se.$$.fragment,Z),oa=m(Z),T(ie.$$.fragment,Z),na=m(Z),Bt=l(Z,"P",{});var Zs=r(Bt);aa=s(Zs,"Example:"),Zs.forEach(t),sa=m(Z),T(le.$$.fragment,Z),ia=m(Z),Gt=l(Z,"P",{});var Ws=r(Gt);la=s(Ws,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),Ws.forEach(t),ra=m(Z),T(re.$$.fragment,Z),Z.forEach(t),da=m(I),X=l(I,"DIV",{class:!0});var he=r(X);T(Fe.$$.fragment,he),ca=m(he),Ct=l(he,"P",{});var Bs=r(Ct);pa=s(Bs,"Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights saved in the original .ckpt format."),Bs.forEach(t),ma=m(he),Ne=l(he,"P",{});var Mo=r(Ne);fa=s(Mo,"The pipeline is set in evaluation mode by default using "),Ft=l(Mo,"CODE",{});var Gs=r(Ft);ua=s(Gs,"model.eval()"),Gs.forEach(t),ga=s(Mo," (Dropout modules are deactivated)."),Mo.forEach(t),ha=m(he),T(de.$$.fragment,he),he.forEach(t),_a=m(I),A=l(I,"DIV",{class:!0});var _e=r(A);T(Xe.$$.fragment,_e),ba=m(_e),H=l(_e,"P",{});var pt=r(H);ya=s(pt,"Load pretrained attention processor layers (such as LoRA) into "),it=l(pt,"A",{href:!0});var Cs=r(it);va=s(Cs,"UNet2DConditionModel"),Cs.forEach(t),wa=s(pt,` and
`),Ae=l(pt,"A",{href:!0,rel:!0});var Fs=r(Ae);Nt=l(Fs,"CODE",{});var Ns=r(Nt);Ia=s(Ns,"CLIPTextModel"),Ns.forEach(t),Fs.forEach(t),Ma=s(pt,")."),pt.forEach(t),xa=m(_e),T(ce.$$.fragment,_e),Ta=m(_e),T(pe.$$.fragment,_e),_e.forEach(t),Ja=m(I),me=l(I,"DIV",{class:!0});var xo=r(me);T(Ve.$$.fragment,xo),ja=m(xo),Xt=l(xo,"P",{});var Xs=r(Xt);ka=s(Xs,"Save the LoRA parameters corresponding to the UNet and the text encoder."),Xs.forEach(t),xo.forEach(t),Sa=m(I),fe=l(I,"DIV",{class:!0});var To=r(fe);T(Le.$$.fragment,To),$a=m(To),F=l(To,"P",{});var z=r(F);Da=s(z,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),At=l(z,"CODE",{});var As=r(At);Ua=s(As,"enable_sequential_cpu_offload"),As.forEach(t),Pa=s(z,", this method moves one whole model at a time to the GPU when its "),Vt=l(z,"CODE",{});var Vs=r(Vt);Ea=s(Vs,"forward"),Vs.forEach(t),Za=s(z,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Lt=l(z,"CODE",{});var Ls=r(Lt);Wa=s(Ls,"enable_sequential_cpu_offload"),Ls.forEach(t),Ba=s(z,", but performance is much better due to the iterative execution of the "),Rt=l(z,"CODE",{});var Rs=r(Rt);Ga=s(Rs,"unet"),Rs.forEach(t),Ca=s(z,"."),z.forEach(t),To.forEach(t),Fa=m(I),ue=l(I,"DIV",{class:!0});var Jo=r(ue);T(Re.$$.fragment,Jo),Na=m(Jo),O=l(Jo,"P",{});var mt=r(O);Xa=s(mt,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),qt=l(mt,"CODE",{});var qs=r(qt);Aa=s(qs,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),qs.forEach(t),Va=s(mt,"forward"),zt=l(mt,"CODE",{});var zs=r(zt);La=s(zs,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),zs.forEach(t),Ra=s(mt,"enable_model_cpu_offload`, but performance is lower."),mt.forEach(t),Jo.forEach(t),I.forEach(t),po=m(o),N=l(o,"DIV",{class:!0});var be=r(N);T(qe.$$.fragment,be),qa=m(be),Yt=l(be,"P",{});var Ys=r(Yt);za=s(Ys,"Pipeline for image-to-image generation using Stable Diffusion."),Ys.forEach(t),Ya=m(be),ze=l(be,"P",{});var jo=r(ze);Qa=s(jo,"This model inherits from "),Qt=l(jo,"CODE",{});var Qs=r(Qt);Ha=s(Qs,"FlaxDiffusionPipeline"),Qs.forEach(t),Oa=s(jo,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),jo.forEach(t),Ka=m(be),R=l(be,"DIV",{class:!0});var ft=r(R);T(Ye.$$.fragment,ft),es=m(ft),Ht=l(ft,"P",{});var Hs=r(Ht);ts=s(Hs,"Function invoked when calling the pipeline for generation."),Hs.forEach(t),os=m(ft),T(ge.$$.fragment,ft),ft.forEach(t),be.forEach(t),this.h()},h(){g(d,"name","hf:doc:metadata"),g(d,"content",JSON.stringify(gi)),g(c,"id","imagetoimage-generation"),g(c,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(c,"href","#imagetoimage-generation"),g(f,"class","relative group"),g(B,"id","diffusers.StableDiffusionImg2ImgPipeline"),g(B,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(B,"href","#diffusers.StableDiffusionImg2ImgPipeline"),g(U,"class","relative group"),g(ve,"href","https://github.com/CompVis"),g(ve,"rel","nofollow"),g(we,"href","https://stability.ai/"),g(we,"rel","nofollow"),g(Ie,"href","https://github.com/runwayml"),g(Ie,"rel","nofollow"),g(Me,"href","https://laion.ai/"),g(Me,"rel","nofollow"),g(Oe,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),g(Te,"href","https://github.com/CompVis/stable-diffusion/blob/main/scripts/img2img.py"),g(Te,"rel","nofollow"),g(Ke,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),g(et,"href","./text2img"),g(Je,"href","https://arxiv.org/abs/2108.01073"),g(Je,"rel","nofollow"),g(tt,"href","/docs/diffusers/v0.17.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),g(ot,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_textual_inversion"),g(nt,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_lora_weights"),g(at,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.from_ckpt"),g(st,"href","/docs/diffusers/v0.17.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.save_lora_weights"),g(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(it,"href","/docs/diffusers/v0.17.0/en/api/models#diffusers.UNet2DConditionModel"),g(Ae,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),g(Ae,"rel","nofollow"),g(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(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(o,w){e(document.head,d),M(o,b,w),M(o,f,w),e(f,c),e(c,_),J(n,_,null),e(f,u),e(f,$),e($,h),M(o,v,w),M(o,U,w),e(U,B),e(B,_t),J(ye,_t,null),e(U,So),e(U,bt),e(bt,$o),M(o,so,w),M(o,E,w),e(E,Do),e(E,ve),e(ve,Uo),e(E,Po),e(E,we),e(we,Eo),e(E,Zo),e(E,Ie),e(Ie,Wo),e(E,Bo),e(E,Me),e(Me,Go),e(E,Co),e(E,Oe),e(Oe,Fo),e(E,No),M(o,io,w),M(o,xe,w),e(xe,Xo),e(xe,Te),e(Te,Ao),M(o,lo,w),M(o,K,w),e(K,Ke),e(Ke,Vo),e(K,Lo),e(K,et),e(et,Ro),M(o,ro,w),M(o,ee,w),e(ee,qo),e(ee,Je),e(Je,zo),e(ee,Yo),M(o,co,w),M(o,y,w),J(je,y,null),e(y,Qo),e(y,yt),e(yt,Ho),e(y,Oo),e(y,ke),e(ke,Ko),e(ke,tt),e(tt,en),e(ke,tn),e(y,on),e(y,vt),e(vt,nn),e(y,an),e(y,Y),e(Y,Se),e(Se,wt),e(wt,sn),e(Se,ln),e(Se,ot),e(ot,rn),e(Y,dn),e(Y,$e),e($e,It),e(It,cn),e($e,pn),e($e,nt),e(nt,mn),e(Y,fn),e(Y,De),e(De,Mt),e(Mt,un),e(De,gn),e(De,at),e(at,hn),e(y,_n),e(y,xt),e(xt,bn),e(y,yn),e(y,Tt),e(Tt,Ue),e(Ue,Jt),e(Jt,vn),e(Ue,wn),e(Ue,st),e(st,In),e(y,Mn),e(y,V),J(Pe,V,null),e(V,xn),e(V,jt),e(jt,Tn),e(V,Jn),J(te,V,null),e(y,jn),e(y,L),J(Ee,L,null),e(L,kn),e(L,kt),e(kt,Sn),e(L,$n),e(L,St),e(St,Dn),e(y,Un),e(y,oe),J(Ze,oe,null),e(oe,Pn),e(oe,We),e(We,En),e(We,$t),e($t,Zn),e(We,Wn),e(y,Bn),e(y,G),J(Be,G,null),e(G,Gn),e(G,Dt),e(Dt,Cn),e(G,Fn),e(G,Ut),e(Ut,Nn),e(G,Xn),e(G,Pt),e(Pt,An),e(G,Vn),J(ne,G,null),e(y,Ln),e(y,ae),J(Ge,ae,null),e(ae,Rn),e(ae,Et),e(Et,qn),e(y,zn),e(y,P),J(Ce,P,null),e(P,Yn),e(P,Q),e(Q,Qn),e(Q,Zt),e(Zt,Hn),e(Q,On),e(Q,Wt),e(Wt,Kn),e(Q,ea),e(P,ta),J(se,P,null),e(P,oa),J(ie,P,null),e(P,na),e(P,Bt),e(Bt,aa),e(P,sa),J(le,P,null),e(P,ia),e(P,Gt),e(Gt,la),e(P,ra),J(re,P,null),e(y,da),e(y,X),J(Fe,X,null),e(X,ca),e(X,Ct),e(Ct,pa),e(X,ma),e(X,Ne),e(Ne,fa),e(Ne,Ft),e(Ft,ua),e(Ne,ga),e(X,ha),J(de,X,null),e(y,_a),e(y,A),J(Xe,A,null),e(A,ba),e(A,H),e(H,ya),e(H,it),e(it,va),e(H,wa),e(H,Ae),e(Ae,Nt),e(Nt,Ia),e(H,Ma),e(A,xa),J(ce,A,null),e(A,Ta),J(pe,A,null),e(y,Ja),e(y,me),J(Ve,me,null),e(me,ja),e(me,Xt),e(Xt,ka),e(y,Sa),e(y,fe),J(Le,fe,null),e(fe,$a),e(fe,F),e(F,Da),e(F,At),e(At,Ua),e(F,Pa),e(F,Vt),e(Vt,Ea),e(F,Za),e(F,Lt),e(Lt,Wa),e(F,Ba),e(F,Rt),e(Rt,Ga),e(F,Ca),e(y,Fa),e(y,ue),J(Re,ue,null),e(ue,Na),e(ue,O),e(O,Xa),e(O,qt),e(qt,Aa),e(O,Va),e(O,zt),e(zt,La),e(O,Ra),M(o,po,w),M(o,N,w),J(qe,N,null),e(N,qa),e(N,Yt),e(Yt,za),e(N,Ya),e(N,ze),e(ze,Qa),e(ze,Qt),e(Qt,Ha),e(ze,Oa),e(N,Ka),e(N,R),J(Ye,R,null),e(R,es),e(R,Ht),e(Ht,ts),e(R,os),J(ge,R,null),mo=!0},p(o,[w]){const Qe={};w&2&&(Qe.$$scope={dirty:w,ctx:o}),te.$set(Qe);const Ot={};w&2&&(Ot.$$scope={dirty:w,ctx:o}),ne.$set(Ot);const Kt={};w&2&&(Kt.$$scope={dirty:w,ctx:o}),se.$set(Kt);const eo={};w&2&&(eo.$$scope={dirty:w,ctx:o}),ie.$set(eo);const He={};w&2&&(He.$$scope={dirty:w,ctx:o}),le.$set(He);const to={};w&2&&(to.$$scope={dirty:w,ctx:o}),re.$set(to);const oo={};w&2&&(oo.$$scope={dirty:w,ctx:o}),de.$set(oo);const no={};w&2&&(no.$$scope={dirty:w,ctx:o}),ce.$set(no);const W={};w&2&&(W.$$scope={dirty:w,ctx:o}),pe.$set(W);const ao={};w&2&&(ao.$$scope={dirty:w,ctx:o}),ge.$set(ao)},i(o){mo||(j(n.$$.fragment,o),j(ye.$$.fragment,o),j(je.$$.fragment,o),j(Pe.$$.fragment,o),j(te.$$.fragment,o),j(Ee.$$.fragment,o),j(Ze.$$.fragment,o),j(Be.$$.fragment,o),j(ne.$$.fragment,o),j(Ge.$$.fragment,o),j(Ce.$$.fragment,o),j(se.$$.fragment,o),j(ie.$$.fragment,o),j(le.$$.fragment,o),j(re.$$.fragment,o),j(Fe.$$.fragment,o),j(de.$$.fragment,o),j(Xe.$$.fragment,o),j(ce.$$.fragment,o),j(pe.$$.fragment,o),j(Ve.$$.fragment,o),j(Le.$$.fragment,o),j(Re.$$.fragment,o),j(qe.$$.fragment,o),j(Ye.$$.fragment,o),j(ge.$$.fragment,o),mo=!0)},o(o){k(n.$$.fragment,o),k(ye.$$.fragment,o),k(je.$$.fragment,o),k(Pe.$$.fragment,o),k(te.$$.fragment,o),k(Ee.$$.fragment,o),k(Ze.$$.fragment,o),k(Be.$$.fragment,o),k(ne.$$.fragment,o),k(Ge.$$.fragment,o),k(Ce.$$.fragment,o),k(se.$$.fragment,o),k(ie.$$.fragment,o),k(le.$$.fragment,o),k(re.$$.fragment,o),k(Fe.$$.fragment,o),k(de.$$.fragment,o),k(Xe.$$.fragment,o),k(ce.$$.fragment,o),k(pe.$$.fragment,o),k(Ve.$$.fragment,o),k(Le.$$.fragment,o),k(Re.$$.fragment,o),k(qe.$$.fragment,o),k(Ye.$$.fragment,o),k(ge.$$.fragment,o),mo=!1},d(o){t(d),o&&t(b),o&&t(f),S(n),o&&t(v),o&&t(U),S(ye),o&&t(so),o&&t(E),o&&t(io),o&&t(xe),o&&t(lo),o&&t(K),o&&t(ro),o&&t(ee),o&&t(co),o&&t(y),S(je),S(Pe),S(te),S(Ee),S(Ze),S(Be),S(ne),S(Ge),S(Ce),S(se),S(ie),S(le),S(re),S(Fe),S(de),S(Xe),S(ce),S(pe),S(Ve),S(Le),S(Re),o&&t(po),o&&t(N),S(qe),S(Ye),S(ge)}}}const gi={local:"imagetoimage-generation",sections:[{local:"diffusers.StableDiffusionImg2ImgPipeline",title:"StableDiffusionImg2ImgPipeline"}],title:"Image-to-Image Generation"};function hi(D){return ni(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mi extends Ks{constructor(d){super();ei(this,d,hi,ui,ti,{})}}export{Mi as default,gi as metadata};
