import{S as ei,i as ti,s as oi,e as s,k as c,w as v,t as a,M as ni,c as i,d as t,m as p,a as r,x as I,h as l,b as m,G as e,g as J,y as M,q as x,o as T,B as j,v as si,L as ht}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as ai}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as _t}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ka}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as gt}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ii(S){let f,w,u,d,b;return d=new _t({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(){f=s("p"),w=a("Examples:"),u=c(),v(d.$$.fragment)},l(n){f=i(n,"P",{});var g=r(f);w=l(g,"Examples:"),g.forEach(t),u=p(n),I(d.$$.fragment,n)},m(n,g){J(n,f,g),e(f,w),J(n,u,g),M(d,n,g),b=!0},p:ht,i(n){b||(x(d.$$.fragment,n),b=!0)},o(n){T(d.$$.fragment,n),b=!1},d(n){n&&t(f),n&&t(u),j(d,n)}}}function li(S){let f,w;return{c(){f=s("p"),w=a(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(u){f=i(u,"P",{});var d=r(f);w=l(d,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),d.forEach(t)},m(u,d){J(u,f,d),e(f,w)},d(u){u&&t(f)}}}function ri(S){let f,w,u,d,b;return d=new _t({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(){f=s("p"),w=a("Examples:"),u=c(),v(d.$$.fragment)},l(n){f=i(n,"P",{});var g=r(f);w=l(g,"Examples:"),g.forEach(t),u=p(n),I(d.$$.fragment,n)},m(n,g){J(n,f,g),e(f,w),J(n,u,g),M(d,n,g),b=!0},p:ht,i(n){b||(x(d.$$.fragment,n),b=!0)},o(n){T(d.$$.fragment,n),b=!1},d(n){n&&t(f),n&&t(u),j(d,n)}}}function di(S){let f,w,u,d,b;return d=new _t({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(){f=s("p"),w=a("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=c(),v(d.$$.fragment)},l(n){f=i(n,"P",{});var g=r(f);w=l(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),u=p(n),I(d.$$.fragment,n)},m(n,g){J(n,f,g),e(f,w),J(n,u,g),M(d,n,g),b=!0},p:ht,i(n){b||(x(d.$$.fragment,n),b=!0)},o(n){T(d.$$.fragment,n),b=!1},d(n){n&&t(f),n&&t(u),j(d,n)}}}function ci(S){let f,w,u,d,b;return d=new _t({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(){f=s("p"),w=a("locally:"),u=c(),v(d.$$.fragment)},l(n){f=i(n,"P",{});var g=r(f);w=l(g,"locally:"),g.forEach(t),u=p(n),I(d.$$.fragment,n)},m(n,g){J(n,f,g),e(f,w),J(n,u,g),M(d,n,g),b=!0},p:ht,i(n){b||(x(d.$$.fragment,n),b=!0)},o(n){T(d.$$.fragment,n),b=!1},d(n){n&&t(f),n&&t(u),j(d,n)}}}function pi(S){let f,w,u,d,b;return d=new _t({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable float16 and move to GPU</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){f=s("p"),w=a("Examples:"),u=c(),v(d.$$.fragment)},l(n){f=i(n,"P",{});var g=r(f);w=l(g,"Examples:"),g.forEach(t),u=p(n),I(d.$$.fragment,n)},m(n,g){J(n,f,g),e(f,w),J(n,u,g),M(d,n,g),b=!0},p:ht,i(n){b||(x(d.$$.fragment,n),b=!0)},o(n){T(d.$$.fragment,n),b=!1},d(n){n&&t(f),n&&t(u),j(d,n)}}}function fi(S){let f,w,u,d,b;return d=new _t({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(){f=s("p"),w=a("Examples:"),u=c(),v(d.$$.fragment)},l(n){f=i(n,"P",{});var g=r(f);w=l(g,"Examples:"),g.forEach(t),u=p(n),I(d.$$.fragment,n)},m(n,g){J(n,f,g),e(f,w),J(n,u,g),M(d,n,g),b=!0},p:ht,i(n){b||(x(d.$$.fragment,n),b=!0)},o(n){T(d.$$.fragment,n),b=!1},d(n){n&&t(f),n&&t(u),j(d,n)}}}function mi(S){let f,w,u,d,b,n,g,bt,Jo,Kt,L,Y,yt,fe,So,wt,Do,eo,D,ko,me,Uo,Po,ue,$o,Eo,ge,Zo,Wo,he,Bo,Go,He,Fo,Co,to,_e,No,be,Xo,oo,q,Oe,Ao,Lo,Ke,Vo,no,Q,Ro,ye,zo,Yo,so,h,we,qo,vt,Qo,Ho,ve,Oo,et,Ko,en,tn,It,on,nn,V,Ie,Mt,sn,an,tt,ln,rn,Me,xt,dn,cn,ot,pn,fn,xe,Tt,mn,un,nt,gn,hn,jt,_n,bn,Jt,Te,St,yn,wn,st,vn,In,G,je,Mn,Dt,xn,Tn,H,jn,F,Je,Jn,kt,Sn,Dn,Ut,kn,Un,O,Se,Pn,De,$n,Pt,En,Zn,Wn,U,ke,Bn,Ue,Gn,Pe,Fn,Cn,Nn,$t,Xn,An,K,Ln,ee,Vn,te,$e,Rn,Ee,zn,Ze,Yn,qn,Qn,k,We,Hn,Be,On,at,Kn,es,ts,Et,os,ns,oe,ss,Ge,as,Fe,is,ls,rs,ne,ds,C,Ce,cs,B,ps,it,fs,ms,Zt,us,gs,Wt,hs,_s,bs,se,ys,ae,Ne,ws,R,vs,lt,Is,Ms,Xe,Bt,xs,Ts,js,ie,Ae,Js,Gt,Ss,Ds,le,Le,ks,$,Us,Ft,Ps,$s,Ct,Es,Zs,Nt,Ws,Bs,Xt,Gs,Fs,Cs,re,Ve,Ns,z,Xs,At,As,Ls,Lt,Vs,Rs,ao,E,Re,zs,Vt,Ys,qs,ze,Qs,Rt,Hs,Os,Ks,N,Ye,ea,zt,ta,oa,de,io;return n=new Ka({}),fe=new Ka({}),we=new P({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.18.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. 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.18.0/en/api/models/unet2d-cond#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.18.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.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.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.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L101"}}),je=new P({props:{name:"__call__",anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": typing.Optional[int] = 50"},{name:"guidance_scale",val:": typing.Optional[float] = 7.5"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide 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.18.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.18.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.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L612",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.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.18.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),H=new gt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[ii]},$$scope:{ctx:S}}}),Je=new P({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.18.0/src/diffusers/pipelines/pipeline_utils.py#L1461"}}),Se=new P({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/pipeline_utils.py#L1477"}}),ke=new P({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.18.0/src/diffusers/pipelines/pipeline_utils.py#L1399"}}),K=new ai({props:{warning:!0,$$slots:{default:[li]},$$scope:{ctx:S}}}),ee=new gt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[ri]},$$scope:{ctx:S}}}),$e=new P({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/pipeline_utils.py#L1435"}}),We=new P({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/loaders.py#L469"}}),oe=new gt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[di]},$$scope:{ctx:S}}}),ne=new gt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[ci]},$$scope:{ctx:S}}}),Ce=new P({props:{name:"from_single_file",anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to True, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better to continue finetuning.`,name:"extract_ema"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it will be automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a> to use,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>
variant. If this parameter is <code>None</code>, the function will load a new instance of [CLIP] by itself, if
needed.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>
to use. If this parameter is <code>None</code>, the function will load a new instance of [CLIPTokenizer] by
itself, if needed.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/loaders.py#L1290"}}),se=new gt({props:{anchor:"diffusers.StableDiffusionImg2ImgPipeline.from_single_file.example",$$slots:{default:[pi]},$$scope:{ctx:S}}}),Ne=new P({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> (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on
the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing the model weights saved
with <a href="/docs/diffusers/v0.18.0/en/api/models/overview#diffusers.ModelMixin.save_pretrained">ModelMixin.save_pretrained()</a>.</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 where a downloaded pretrained model configuration is cached if the standard cache
is not 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 resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_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, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_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>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,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, a commit id, or 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;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/loaders.py#L746"}}),Ae=new P({props:{name:"save_lora_weights",anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save LoRA parameters to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the UNet.`,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`. Must explicitly pass the text\nencoder LoRA state dict because it comes &#x1F917; Transformers.",name:"text_encoder_lora_layers"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/loaders.py#L1150"}}),Le=new P({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.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L257"}}),Ve=new P({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.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L231"}}),Re=new P({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.18.0/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. 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.18.0/en/api/models/unet2d-cond#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.18.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.18.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py#L105"}}),Ye=new P({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.18.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>
`}}),de=new gt({props:{anchor:"diffusers.FlaxStableDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[fi]},$$scope:{ctx:S}}}),{c(){f=s("meta"),w=c(),u=s("h1"),d=s("a"),b=s("span"),v(n.$$.fragment),g=c(),bt=s("span"),Jo=a("Image-to-Image Generation"),Kt=c(),L=s("h2"),Y=s("a"),yt=s("span"),v(fe.$$.fragment),So=c(),wt=s("span"),Do=a("StableDiffusionImg2ImgPipeline"),eo=c(),D=s("p"),ko=a("The Stable Diffusion model was created by the researchers and engineers from "),me=s("a"),Uo=a("CompVis"),Po=a(", "),ue=s("a"),$o=a("Stability AI"),Eo=a(", "),ge=s("a"),Zo=a("runway"),Wo=a(", and "),he=s("a"),Bo=a("LAION"),Go=a(". The "),He=s("a"),Fo=a("StableDiffusionImg2ImgPipeline"),Co=a(" lets you pass a text prompt and an initial image to condition the generation of new images using Stable Diffusion."),to=c(),_e=s("p"),No=a("The original codebase can be found here: "),be=s("a"),Xo=a("CampVis/stable-diffusion"),oo=c(),q=s("p"),Oe=s("a"),Ao=a("StableDiffusionImg2ImgPipeline"),Lo=a(" is compatible with all Stable Diffusion checkpoints for "),Ke=s("a"),Vo=a("Text-to-Image"),no=c(),Q=s("p"),Ro=a("The pipeline uses the diffusion-denoising mechanism proposed by SDEdit ("),ye=s("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).`),so=c(),h=s("div"),v(we.$$.fragment),qo=c(),vt=s("p"),Qo=a("Pipeline for text-guided image to image generation using Stable Diffusion."),Ho=c(),ve=s("p"),Oo=a("This model inherits from "),et=s("a"),Ko=a("DiffusionPipeline"),en=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.)`),tn=c(),It=s("p"),on=a("In addition the pipeline inherits the following loading methods:"),nn=c(),V=s("ul"),Ie=s("li"),Mt=s("em"),sn=a("Textual-Inversion"),an=a(": "),tt=s("a"),ln=a("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),rn=c(),Me=s("li"),xt=s("em"),dn=a("LoRA"),cn=a(": "),ot=s("a"),pn=a("loaders.LoraLoaderMixin.load_lora_weights()"),fn=c(),xe=s("li"),Tt=s("em"),mn=a("Ckpt"),un=a(": "),nt=s("a"),gn=a("loaders.FromSingleFileMixin.from_single_file()"),hn=c(),jt=s("p"),_n=a("as well as the following saving methods:"),bn=c(),Jt=s("ul"),Te=s("li"),St=s("em"),yn=a("LoRA"),wn=a(": "),st=s("a"),vn=a("loaders.LoraLoaderMixin.save_lora_weights()"),In=c(),G=s("div"),v(je.$$.fragment),Mn=c(),Dt=s("p"),xn=a("Function invoked when calling the pipeline for generation."),Tn=c(),v(H.$$.fragment),jn=c(),F=s("div"),v(Je.$$.fragment),Jn=c(),kt=s("p"),Sn=a("Enable sliced attention computation."),Dn=c(),Ut=s("p"),kn=a(`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),Un=c(),O=s("div"),v(Se.$$.fragment),Pn=c(),De=s("p"),$n=a("Disable sliced attention computation. If "),Pt=s("code"),En=a("enable_attention_slicing"),Zn=a(` was previously called, attention is
computed in one step.`),Wn=c(),U=s("div"),v(ke.$$.fragment),Bn=c(),Ue=s("p"),Gn=a("Enable memory efficient attention from "),Pe=s("a"),Fn=a("xFormers"),Cn=a("."),Nn=c(),$t=s("p"),Xn=a(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),An=c(),v(K.$$.fragment),Ln=c(),v(ee.$$.fragment),Vn=c(),te=s("div"),v($e.$$.fragment),Rn=c(),Ee=s("p"),zn=a("Disable memory efficient attention from "),Ze=s("a"),Yn=a("xFormers"),qn=a("."),Qn=c(),k=s("div"),v(We.$$.fragment),Hn=c(),Be=s("p"),On=a("Load textual inversion embeddings into the text encoder of "),at=s("a"),Kn=a("StableDiffusionPipeline"),es=a(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),ts=c(),Et=s("p"),os=a("Example:"),ns=c(),v(oe.$$.fragment),ss=c(),Ge=s("p"),as=a(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Fe=s("a"),is=a("civitAI"),ls=a(") and then load the vector"),rs=c(),v(ne.$$.fragment),ds=c(),C=s("div"),v(Ce.$$.fragment),cs=c(),B=s("p"),ps=a("Instantiate a "),it=s("a"),fs=a("DiffusionPipeline"),ms=a(" from pretrained pipeline weights saved in the "),Zt=s("code"),us=a(".ckpt"),gs=a(` format. The pipeline
is set in evaluation mode (`),Wt=s("code"),hs=a("model.eval()"),_s=a(") by default."),bs=c(),v(se.$$.fragment),ys=c(),ae=s("div"),v(Ne.$$.fragment),ws=c(),R=s("p"),vs=a("Load pretrained LoRA attention processor layers into "),lt=s("a"),Is=a("UNet2DConditionModel"),Ms=a(` and
`),Xe=s("a"),Bt=s("code"),xs=a("CLIPTextModel"),Ts=a("."),js=c(),ie=s("div"),v(Ae.$$.fragment),Js=c(),Gt=s("p"),Ss=a("Save the LoRA parameters corresponding to the UNet and text encoder."),Ds=c(),le=s("div"),v(Le.$$.fragment),ks=c(),$=s("p"),Us=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ft=s("code"),Ps=a("enable_sequential_cpu_offload"),$s=a(", this method moves one whole model at a time to the GPU when its "),Ct=s("code"),Es=a("forward"),Zs=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Nt=s("code"),Ws=a("enable_sequential_cpu_offload"),Bs=a(", but performance is much better due to the iterative execution of the "),Xt=s("code"),Gs=a("unet"),Fs=a("."),Cs=c(),re=s("div"),v(Ve.$$.fragment),Ns=c(),z=s("p"),Xs=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
`),At=s("code"),As=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ls=a("forward"),Lt=s("code"),Vs=a("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Rs=a("enable_model_cpu_offload`, but performance is lower."),ao=c(),E=s("div"),v(Re.$$.fragment),zs=c(),Vt=s("p"),Ys=a("Pipeline for image-to-image generation using Stable Diffusion."),qs=c(),ze=s("p"),Qs=a("This model inherits from "),Rt=s("code"),Hs=a("FlaxDiffusionPipeline"),Os=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.)`),Ks=c(),N=s("div"),v(Ye.$$.fragment),ea=c(),zt=s("p"),ta=a("Function invoked when calling the pipeline for generation."),oa=c(),v(de.$$.fragment),this.h()},l(o){const y=ni('[data-svelte="svelte-1phssyn"]',document.head);f=i(y,"META",{name:!0,content:!0}),y.forEach(t),w=p(o),u=i(o,"H1",{class:!0});var qe=r(u);d=i(qe,"A",{id:!0,class:!0,href:!0});var Yt=r(d);b=i(Yt,"SPAN",{});var qt=r(b);I(n.$$.fragment,qt),qt.forEach(t),Yt.forEach(t),g=p(qe),bt=i(qe,"SPAN",{});var Qt=r(bt);Jo=l(Qt,"Image-to-Image Generation"),Qt.forEach(t),qe.forEach(t),Kt=p(o),L=i(o,"H2",{class:!0});var Qe=r(L);Y=i(Qe,"A",{id:!0,class:!0,href:!0});var Ht=r(Y);yt=i(Ht,"SPAN",{});var Ot=r(yt);I(fe.$$.fragment,Ot),Ot.forEach(t),Ht.forEach(t),So=p(Qe),wt=i(Qe,"SPAN",{});var sa=r(wt);Do=l(sa,"StableDiffusionImg2ImgPipeline"),sa.forEach(t),Qe.forEach(t),eo=p(o),D=i(o,"P",{});var Z=r(D);ko=l(Z,"The Stable Diffusion model was created by the researchers and engineers from "),me=i(Z,"A",{href:!0,rel:!0});var aa=r(me);Uo=l(aa,"CompVis"),aa.forEach(t),Po=l(Z,", "),ue=i(Z,"A",{href:!0,rel:!0});var ia=r(ue);$o=l(ia,"Stability AI"),ia.forEach(t),Eo=l(Z,", "),ge=i(Z,"A",{href:!0,rel:!0});var la=r(ge);Zo=l(la,"runway"),la.forEach(t),Wo=l(Z,", and "),he=i(Z,"A",{href:!0,rel:!0});var ra=r(he);Bo=l(ra,"LAION"),ra.forEach(t),Go=l(Z,". The "),He=i(Z,"A",{href:!0});var da=r(He);Fo=l(da,"StableDiffusionImg2ImgPipeline"),da.forEach(t),Co=l(Z," lets you pass a text prompt and an initial image to condition the generation of new images using Stable Diffusion."),Z.forEach(t),to=p(o),_e=i(o,"P",{});var na=r(_e);No=l(na,"The original codebase can be found here: "),be=i(na,"A",{href:!0,rel:!0});var ca=r(be);Xo=l(ca,"CampVis/stable-diffusion"),ca.forEach(t),na.forEach(t),oo=p(o),q=i(o,"P",{});var lo=r(q);Oe=i(lo,"A",{href:!0});var pa=r(Oe);Ao=l(pa,"StableDiffusionImg2ImgPipeline"),pa.forEach(t),Lo=l(lo," is compatible with all Stable Diffusion checkpoints for "),Ke=i(lo,"A",{href:!0});var fa=r(Ke);Vo=l(fa,"Text-to-Image"),fa.forEach(t),lo.forEach(t),no=p(o),Q=i(o,"P",{});var ro=r(Q);Ro=l(ro,"The pipeline uses the diffusion-denoising mechanism proposed by SDEdit ("),ye=i(ro,"A",{href:!0,rel:!0});var ma=r(ye);zo=l(ma,"SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations"),ma.forEach(t),Yo=l(ro,`
proposed by Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, Stefano Ermon).`),ro.forEach(t),so=p(o),h=i(o,"DIV",{class:!0});var _=r(h);I(we.$$.fragment,_),qo=p(_),vt=i(_,"P",{});var ua=r(vt);Qo=l(ua,"Pipeline for text-guided image to image generation using Stable Diffusion."),ua.forEach(t),Ho=p(_),ve=i(_,"P",{});var co=r(ve);Oo=l(co,"This model inherits from "),et=i(co,"A",{href:!0});var ga=r(et);Ko=l(ga,"DiffusionPipeline"),ga.forEach(t),en=l(co,`. 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.)`),co.forEach(t),tn=p(_),It=i(_,"P",{});var ha=r(It);on=l(ha,"In addition the pipeline inherits the following loading methods:"),ha.forEach(t),nn=p(_),V=i(_,"UL",{});var rt=r(V);Ie=i(rt,"LI",{});var po=r(Ie);Mt=i(po,"EM",{});var _a=r(Mt);sn=l(_a,"Textual-Inversion"),_a.forEach(t),an=l(po,": "),tt=i(po,"A",{href:!0});var ba=r(tt);ln=l(ba,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),ba.forEach(t),po.forEach(t),rn=p(rt),Me=i(rt,"LI",{});var fo=r(Me);xt=i(fo,"EM",{});var ya=r(xt);dn=l(ya,"LoRA"),ya.forEach(t),cn=l(fo,": "),ot=i(fo,"A",{href:!0});var wa=r(ot);pn=l(wa,"loaders.LoraLoaderMixin.load_lora_weights()"),wa.forEach(t),fo.forEach(t),fn=p(rt),xe=i(rt,"LI",{});var mo=r(xe);Tt=i(mo,"EM",{});var va=r(Tt);mn=l(va,"Ckpt"),va.forEach(t),un=l(mo,": "),nt=i(mo,"A",{href:!0});var Ia=r(nt);gn=l(Ia,"loaders.FromSingleFileMixin.from_single_file()"),Ia.forEach(t),mo.forEach(t),rt.forEach(t),hn=p(_),jt=i(_,"P",{});var Ma=r(jt);_n=l(Ma,"as well as the following saving methods:"),Ma.forEach(t),bn=p(_),Jt=i(_,"UL",{});var xa=r(Jt);Te=i(xa,"LI",{});var uo=r(Te);St=i(uo,"EM",{});var Ta=r(St);yn=l(Ta,"LoRA"),Ta.forEach(t),wn=l(uo,": "),st=i(uo,"A",{href:!0});var ja=r(st);vn=l(ja,"loaders.LoraLoaderMixin.save_lora_weights()"),ja.forEach(t),uo.forEach(t),xa.forEach(t),In=p(_),G=i(_,"DIV",{class:!0});var dt=r(G);I(je.$$.fragment,dt),Mn=p(dt),Dt=i(dt,"P",{});var Ja=r(Dt);xn=l(Ja,"Function invoked when calling the pipeline for generation."),Ja.forEach(t),Tn=p(dt),I(H.$$.fragment,dt),dt.forEach(t),jn=p(_),F=i(_,"DIV",{class:!0});var ct=r(F);I(Je.$$.fragment,ct),Jn=p(ct),kt=i(ct,"P",{});var Sa=r(kt);Sn=l(Sa,"Enable sliced attention computation."),Sa.forEach(t),Dn=p(ct),Ut=i(ct,"P",{});var Da=r(Ut);kn=l(Da,`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),Da.forEach(t),ct.forEach(t),Un=p(_),O=i(_,"DIV",{class:!0});var go=r(O);I(Se.$$.fragment,go),Pn=p(go),De=i(go,"P",{});var ho=r(De);$n=l(ho,"Disable sliced attention computation. If "),Pt=i(ho,"CODE",{});var ka=r(Pt);En=l(ka,"enable_attention_slicing"),ka.forEach(t),Zn=l(ho,` was previously called, attention is
computed in one step.`),ho.forEach(t),go.forEach(t),Wn=p(_),U=i(_,"DIV",{class:!0});var X=r(U);I(ke.$$.fragment,X),Bn=p(X),Ue=i(X,"P",{});var _o=r(Ue);Gn=l(_o,"Enable memory efficient attention from "),Pe=i(_o,"A",{href:!0,rel:!0});var Ua=r(Pe);Fn=l(Ua,"xFormers"),Ua.forEach(t),Cn=l(_o,"."),_o.forEach(t),Nn=p(X),$t=i(X,"P",{});var Pa=r($t);Xn=l(Pa,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),Pa.forEach(t),An=p(X),I(K.$$.fragment,X),Ln=p(X),I(ee.$$.fragment,X),X.forEach(t),Vn=p(_),te=i(_,"DIV",{class:!0});var bo=r(te);I($e.$$.fragment,bo),Rn=p(bo),Ee=i(bo,"P",{});var yo=r(Ee);zn=l(yo,"Disable memory efficient attention from "),Ze=i(yo,"A",{href:!0,rel:!0});var $a=r(Ze);Yn=l($a,"xFormers"),$a.forEach(t),qn=l(yo,"."),yo.forEach(t),bo.forEach(t),Qn=p(_),k=i(_,"DIV",{class:!0});var W=r(k);I(We.$$.fragment,W),Hn=p(W),Be=i(W,"P",{});var wo=r(Be);On=l(wo,"Load textual inversion embeddings into the text encoder of "),at=i(wo,"A",{href:!0});var Ea=r(at);Kn=l(Ea,"StableDiffusionPipeline"),Ea.forEach(t),es=l(wo,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),wo.forEach(t),ts=p(W),Et=i(W,"P",{});var Za=r(Et);os=l(Za,"Example:"),Za.forEach(t),ns=p(W),I(oe.$$.fragment,W),ss=p(W),Ge=i(W,"P",{});var vo=r(Ge);as=l(vo,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Fe=i(vo,"A",{href:!0,rel:!0});var Wa=r(Fe);is=l(Wa,"civitAI"),Wa.forEach(t),ls=l(vo,") and then load the vector"),vo.forEach(t),rs=p(W),I(ne.$$.fragment,W),W.forEach(t),ds=p(_),C=i(_,"DIV",{class:!0});var pt=r(C);I(Ce.$$.fragment,pt),cs=p(pt),B=i(pt,"P",{});var ce=r(B);ps=l(ce,"Instantiate a "),it=i(ce,"A",{href:!0});var Ba=r(it);fs=l(Ba,"DiffusionPipeline"),Ba.forEach(t),ms=l(ce," from pretrained pipeline weights saved in the "),Zt=i(ce,"CODE",{});var Ga=r(Zt);us=l(Ga,".ckpt"),Ga.forEach(t),gs=l(ce,` format. The pipeline
is set in evaluation mode (`),Wt=i(ce,"CODE",{});var Fa=r(Wt);hs=l(Fa,"model.eval()"),Fa.forEach(t),_s=l(ce,") by default."),ce.forEach(t),bs=p(pt),I(se.$$.fragment,pt),pt.forEach(t),ys=p(_),ae=i(_,"DIV",{class:!0});var Io=r(ae);I(Ne.$$.fragment,Io),ws=p(Io),R=i(Io,"P",{});var ft=r(R);vs=l(ft,"Load pretrained LoRA attention processor layers into "),lt=i(ft,"A",{href:!0});var Ca=r(lt);Is=l(Ca,"UNet2DConditionModel"),Ca.forEach(t),Ms=l(ft,` and
`),Xe=i(ft,"A",{href:!0,rel:!0});var Na=r(Xe);Bt=i(Na,"CODE",{});var Xa=r(Bt);xs=l(Xa,"CLIPTextModel"),Xa.forEach(t),Na.forEach(t),Ts=l(ft,"."),ft.forEach(t),Io.forEach(t),js=p(_),ie=i(_,"DIV",{class:!0});var Mo=r(ie);I(Ae.$$.fragment,Mo),Js=p(Mo),Gt=i(Mo,"P",{});var Aa=r(Gt);Ss=l(Aa,"Save the LoRA parameters corresponding to the UNet and text encoder."),Aa.forEach(t),Mo.forEach(t),Ds=p(_),le=i(_,"DIV",{class:!0});var xo=r(le);I(Le.$$.fragment,xo),ks=p(xo),$=i(xo,"P",{});var A=r($);Us=l(A,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ft=i(A,"CODE",{});var La=r(Ft);Ps=l(La,"enable_sequential_cpu_offload"),La.forEach(t),$s=l(A,", this method moves one whole model at a time to the GPU when its "),Ct=i(A,"CODE",{});var Va=r(Ct);Es=l(Va,"forward"),Va.forEach(t),Zs=l(A,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Nt=i(A,"CODE",{});var Ra=r(Nt);Ws=l(Ra,"enable_sequential_cpu_offload"),Ra.forEach(t),Bs=l(A,", but performance is much better due to the iterative execution of the "),Xt=i(A,"CODE",{});var za=r(Xt);Gs=l(za,"unet"),za.forEach(t),Fs=l(A,"."),A.forEach(t),xo.forEach(t),Cs=p(_),re=i(_,"DIV",{class:!0});var To=r(re);I(Ve.$$.fragment,To),Ns=p(To),z=i(To,"P",{});var mt=r(z);Xs=l(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
`),At=i(mt,"CODE",{});var Ya=r(At);As=l(Ya,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ya.forEach(t),Ls=l(mt,"forward"),Lt=i(mt,"CODE",{});var qa=r(Lt);Vs=l(qa,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),qa.forEach(t),Rs=l(mt,"enable_model_cpu_offload`, but performance is lower."),mt.forEach(t),To.forEach(t),_.forEach(t),ao=p(o),E=i(o,"DIV",{class:!0});var pe=r(E);I(Re.$$.fragment,pe),zs=p(pe),Vt=i(pe,"P",{});var Qa=r(Vt);Ys=l(Qa,"Pipeline for image-to-image generation using Stable Diffusion."),Qa.forEach(t),qs=p(pe),ze=i(pe,"P",{});var jo=r(ze);Qs=l(jo,"This model inherits from "),Rt=i(jo,"CODE",{});var Ha=r(Rt);Hs=l(Ha,"FlaxDiffusionPipeline"),Ha.forEach(t),Os=l(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),Ks=p(pe),N=i(pe,"DIV",{class:!0});var ut=r(N);I(Ye.$$.fragment,ut),ea=p(ut),zt=i(ut,"P",{});var Oa=r(zt);ta=l(Oa,"Function invoked when calling the pipeline for generation."),Oa.forEach(t),oa=p(ut),I(de.$$.fragment,ut),ut.forEach(t),pe.forEach(t),this.h()},h(){m(f,"name","hf:doc:metadata"),m(f,"content",JSON.stringify(ui)),m(d,"id","imagetoimage-generation"),m(d,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(d,"href","#imagetoimage-generation"),m(u,"class","relative group"),m(Y,"id","diffusers.StableDiffusionImg2ImgPipeline"),m(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Y,"href","#diffusers.StableDiffusionImg2ImgPipeline"),m(L,"class","relative group"),m(me,"href","https://github.com/CompVis"),m(me,"rel","nofollow"),m(ue,"href","https://stability.ai/"),m(ue,"rel","nofollow"),m(ge,"href","https://github.com/runwayml"),m(ge,"rel","nofollow"),m(he,"href","https://laion.ai/"),m(he,"rel","nofollow"),m(He,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),m(be,"href","https://github.com/CompVis/stable-diffusion/blob/main/scripts/img2img.py"),m(be,"rel","nofollow"),m(Oe,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),m(Ke,"href","./text2img"),m(ye,"href","https://arxiv.org/abs/2108.01073"),m(ye,"rel","nofollow"),m(et,"href","/docs/diffusers/v0.18.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),m(tt,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),m(ot,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_lora_weights"),m(nt,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),m(st,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.save_lora_weights"),m(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(F,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Pe,"href","https://facebookresearch.github.io/xformers/"),m(Pe,"rel","nofollow"),m(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ze,"href","https://facebookresearch.github.io/xformers/"),m(Ze,"rel","nofollow"),m(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(at,"href","/docs/diffusers/v0.18.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),m(Fe,"href","https://civitai.com/models/3036?modelVersionId=9857"),m(Fe,"rel","nofollow"),m(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(it,"href","/docs/diffusers/v0.18.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),m(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(lt,"href","/docs/diffusers/v0.18.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel"),m(Xe,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),m(Xe,"rel","nofollow"),m(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,y){e(document.head,f),J(o,w,y),J(o,u,y),e(u,d),e(d,b),M(n,b,null),e(u,g),e(u,bt),e(bt,Jo),J(o,Kt,y),J(o,L,y),e(L,Y),e(Y,yt),M(fe,yt,null),e(L,So),e(L,wt),e(wt,Do),J(o,eo,y),J(o,D,y),e(D,ko),e(D,me),e(me,Uo),e(D,Po),e(D,ue),e(ue,$o),e(D,Eo),e(D,ge),e(ge,Zo),e(D,Wo),e(D,he),e(he,Bo),e(D,Go),e(D,He),e(He,Fo),e(D,Co),J(o,to,y),J(o,_e,y),e(_e,No),e(_e,be),e(be,Xo),J(o,oo,y),J(o,q,y),e(q,Oe),e(Oe,Ao),e(q,Lo),e(q,Ke),e(Ke,Vo),J(o,no,y),J(o,Q,y),e(Q,Ro),e(Q,ye),e(ye,zo),e(Q,Yo),J(o,so,y),J(o,h,y),M(we,h,null),e(h,qo),e(h,vt),e(vt,Qo),e(h,Ho),e(h,ve),e(ve,Oo),e(ve,et),e(et,Ko),e(ve,en),e(h,tn),e(h,It),e(It,on),e(h,nn),e(h,V),e(V,Ie),e(Ie,Mt),e(Mt,sn),e(Ie,an),e(Ie,tt),e(tt,ln),e(V,rn),e(V,Me),e(Me,xt),e(xt,dn),e(Me,cn),e(Me,ot),e(ot,pn),e(V,fn),e(V,xe),e(xe,Tt),e(Tt,mn),e(xe,un),e(xe,nt),e(nt,gn),e(h,hn),e(h,jt),e(jt,_n),e(h,bn),e(h,Jt),e(Jt,Te),e(Te,St),e(St,yn),e(Te,wn),e(Te,st),e(st,vn),e(h,In),e(h,G),M(je,G,null),e(G,Mn),e(G,Dt),e(Dt,xn),e(G,Tn),M(H,G,null),e(h,jn),e(h,F),M(Je,F,null),e(F,Jn),e(F,kt),e(kt,Sn),e(F,Dn),e(F,Ut),e(Ut,kn),e(h,Un),e(h,O),M(Se,O,null),e(O,Pn),e(O,De),e(De,$n),e(De,Pt),e(Pt,En),e(De,Zn),e(h,Wn),e(h,U),M(ke,U,null),e(U,Bn),e(U,Ue),e(Ue,Gn),e(Ue,Pe),e(Pe,Fn),e(Ue,Cn),e(U,Nn),e(U,$t),e($t,Xn),e(U,An),M(K,U,null),e(U,Ln),M(ee,U,null),e(h,Vn),e(h,te),M($e,te,null),e(te,Rn),e(te,Ee),e(Ee,zn),e(Ee,Ze),e(Ze,Yn),e(Ee,qn),e(h,Qn),e(h,k),M(We,k,null),e(k,Hn),e(k,Be),e(Be,On),e(Be,at),e(at,Kn),e(Be,es),e(k,ts),e(k,Et),e(Et,os),e(k,ns),M(oe,k,null),e(k,ss),e(k,Ge),e(Ge,as),e(Ge,Fe),e(Fe,is),e(Ge,ls),e(k,rs),M(ne,k,null),e(h,ds),e(h,C),M(Ce,C,null),e(C,cs),e(C,B),e(B,ps),e(B,it),e(it,fs),e(B,ms),e(B,Zt),e(Zt,us),e(B,gs),e(B,Wt),e(Wt,hs),e(B,_s),e(C,bs),M(se,C,null),e(h,ys),e(h,ae),M(Ne,ae,null),e(ae,ws),e(ae,R),e(R,vs),e(R,lt),e(lt,Is),e(R,Ms),e(R,Xe),e(Xe,Bt),e(Bt,xs),e(R,Ts),e(h,js),e(h,ie),M(Ae,ie,null),e(ie,Js),e(ie,Gt),e(Gt,Ss),e(h,Ds),e(h,le),M(Le,le,null),e(le,ks),e(le,$),e($,Us),e($,Ft),e(Ft,Ps),e($,$s),e($,Ct),e(Ct,Es),e($,Zs),e($,Nt),e(Nt,Ws),e($,Bs),e($,Xt),e(Xt,Gs),e($,Fs),e(h,Cs),e(h,re),M(Ve,re,null),e(re,Ns),e(re,z),e(z,Xs),e(z,At),e(At,As),e(z,Ls),e(z,Lt),e(Lt,Vs),e(z,Rs),J(o,ao,y),J(o,E,y),M(Re,E,null),e(E,zs),e(E,Vt),e(Vt,Ys),e(E,qs),e(E,ze),e(ze,Qs),e(ze,Rt),e(Rt,Hs),e(ze,Os),e(E,Ks),e(E,N),M(Ye,N,null),e(N,ea),e(N,zt),e(zt,ta),e(N,oa),M(de,N,null),io=!0},p(o,[y]){const qe={};y&2&&(qe.$$scope={dirty:y,ctx:o}),H.$set(qe);const Yt={};y&2&&(Yt.$$scope={dirty:y,ctx:o}),K.$set(Yt);const qt={};y&2&&(qt.$$scope={dirty:y,ctx:o}),ee.$set(qt);const Qt={};y&2&&(Qt.$$scope={dirty:y,ctx:o}),oe.$set(Qt);const Qe={};y&2&&(Qe.$$scope={dirty:y,ctx:o}),ne.$set(Qe);const Ht={};y&2&&(Ht.$$scope={dirty:y,ctx:o}),se.$set(Ht);const Ot={};y&2&&(Ot.$$scope={dirty:y,ctx:o}),de.$set(Ot)},i(o){io||(x(n.$$.fragment,o),x(fe.$$.fragment,o),x(we.$$.fragment,o),x(je.$$.fragment,o),x(H.$$.fragment,o),x(Je.$$.fragment,o),x(Se.$$.fragment,o),x(ke.$$.fragment,o),x(K.$$.fragment,o),x(ee.$$.fragment,o),x($e.$$.fragment,o),x(We.$$.fragment,o),x(oe.$$.fragment,o),x(ne.$$.fragment,o),x(Ce.$$.fragment,o),x(se.$$.fragment,o),x(Ne.$$.fragment,o),x(Ae.$$.fragment,o),x(Le.$$.fragment,o),x(Ve.$$.fragment,o),x(Re.$$.fragment,o),x(Ye.$$.fragment,o),x(de.$$.fragment,o),io=!0)},o(o){T(n.$$.fragment,o),T(fe.$$.fragment,o),T(we.$$.fragment,o),T(je.$$.fragment,o),T(H.$$.fragment,o),T(Je.$$.fragment,o),T(Se.$$.fragment,o),T(ke.$$.fragment,o),T(K.$$.fragment,o),T(ee.$$.fragment,o),T($e.$$.fragment,o),T(We.$$.fragment,o),T(oe.$$.fragment,o),T(ne.$$.fragment,o),T(Ce.$$.fragment,o),T(se.$$.fragment,o),T(Ne.$$.fragment,o),T(Ae.$$.fragment,o),T(Le.$$.fragment,o),T(Ve.$$.fragment,o),T(Re.$$.fragment,o),T(Ye.$$.fragment,o),T(de.$$.fragment,o),io=!1},d(o){t(f),o&&t(w),o&&t(u),j(n),o&&t(Kt),o&&t(L),j(fe),o&&t(eo),o&&t(D),o&&t(to),o&&t(_e),o&&t(oo),o&&t(q),o&&t(no),o&&t(Q),o&&t(so),o&&t(h),j(we),j(je),j(H),j(Je),j(Se),j(ke),j(K),j(ee),j($e),j(We),j(oe),j(ne),j(Ce),j(se),j(Ne),j(Ae),j(Le),j(Ve),o&&t(ao),o&&t(E),j(Re),j(Ye),j(de)}}}const ui={local:"imagetoimage-generation",sections:[{local:"diffusers.StableDiffusionImg2ImgPipeline",title:"StableDiffusionImg2ImgPipeline"}],title:"Image-to-Image Generation"};function gi(S){return si(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ii extends ei{constructor(f){super();ti(this,f,gi,mi,oi,{})}}export{Ii as default,ui as metadata};
