import{S as Sa,i as Da,s as Ta,e as n,k as d,w as v,t as a,M as Ma,c as i,d as t,m as c,a as s,x as P,h as r,b as p,G as e,g as h,y,q as w,o as I,B as S,v as La,L as zo}from"../../../chunks/vendor-hf-doc-builder.js";import{T as ka}from"../../../chunks/Tip-hf-doc-builder.js";import{D as E}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Go}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ao}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Zo}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function $a(J){let f,T,g,u,x,l,_,B;return{c(){f=n("p"),T=a("Make sure to check out the Schedulers "),g=n("a"),u=a("guide"),x=a(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),l=n("a"),_=a("reuse components across pipelines"),B=a(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(R){f=i(R,"P",{});var U=s(f);T=r(U,"Make sure to check out the Schedulers "),g=i(U,"A",{href:!0});var W=s(g);u=r(W,"guide"),W.forEach(t),x=r(U," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),l=i(U,"A",{href:!0});var A=s(l);_=r(A,"reuse components across pipelines"),A.forEach(t),B=r(U," section to learn how to efficiently load the same components into multiple pipelines."),U.forEach(t),this.h()},h(){p(g,"href","/using-diffusers/schedulers"),p(l,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(R,U){h(R,f,U),e(f,T),e(f,g),e(g,u),e(f,x),e(f,l),e(l,_),e(f,B)},d(R){R&&t(f)}}}function Ea(J){let f,T,g,u,x;return u=new Go({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uSW5zdHJ1Y3RQaXgyUGl4UGlwZWxpbmUlMEElMEElMEFkZWYlMjBkb3dubG9hZF9pbWFnZSh1cmwpJTNBJTBBJTIwJTIwJTIwJTIwcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMFBJTC5JbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQSUwQWltZ191cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZkaWZmdXNlcnMlMkZkaWZmdXNlcnMtaW1hZ2VzLWRvY3MlMkZyZXNvbHZlJTJGbWFpbiUyRm1vdW50YWluLnBuZyUyMiUwQSUwQWltYWdlJTIwJTNEJTIwZG93bmxvYWRfaW1hZ2UoaW1nX3VybCkucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbnN0cnVjdFBpeDJQaXhQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIydGltYnJvb2tzJTJGaW5zdHJ1Y3QtcGl4MnBpeCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMm1ha2UlMjB0aGUlMjBtb3VudGFpbnMlMjBzbm93eSUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGltYWdlKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> PIL
<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> 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> StableDiffusionInstructPix2PixPipeline


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>):
<span class="hljs-meta">... </span>    response = requests.get(url)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> PIL.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>img_url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>image = download_image(img_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;timbrooks/instruct-pix2pix&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<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>prompt = <span class="hljs-string">&quot;make the mountains snowy&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt=prompt, image=image).images[<span class="hljs-number">0</span>]`}}),{c(){f=n("p"),T=a("Examples:"),g=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var _=s(f);T=r(_,"Examples:"),_.forEach(t),g=c(l),P(u.$$.fragment,l)},m(l,_){h(l,f,_),e(f,T),h(l,g,_),y(u,l,_),x=!0},p:zo,i(l){x||(w(u.$$.fragment,l),x=!0)},o(l){I(u.$$.fragment,l),x=!1},d(l){l&&t(f),l&&t(g),S(u,l)}}}function Ua(J){let f,T,g,u,x;return u=new Go({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=n("p"),T=a("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var _=s(f);T=r(_,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_.forEach(t),g=c(l),P(u.$$.fragment,l)},m(l,_){h(l,f,_),e(f,T),h(l,g,_),y(u,l,_),x=!0},p:zo,i(l){x||(w(u.$$.fragment,l),x=!0)},o(l){I(u.$$.fragment,l),x=!1},d(l){l&&t(f),l&&t(g),S(u,l)}}}function Ja(J){let f,T,g,u,x;return u=new Go({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=n("p"),T=a("locally:"),g=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var _=s(f);T=r(_,"locally:"),_.forEach(t),g=c(l),P(u.$$.fragment,l)},m(l,_){h(l,f,_),e(f,T),h(l,g,_),y(u,l,_),x=!0},p:zo,i(l){x||(w(u.$$.fragment,l),x=!0)},o(l){I(u.$$.fragment,l),x=!1},d(l){l&&t(f),l&&t(g),S(u,l)}}}function ja(J){let f,T,g,u,x;return u=new Go({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExJbnN0cnVjdFBpeDJQaXhQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBcmVzb2x1dGlvbiUyMCUzRCUyMDc2OCUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZkaWZmdXNlcnMlMkZkaWZmdXNlcnMtaW1hZ2VzLWRvY3MlMkZyZXNvbHZlJTJGbWFpbiUyRm1vdW50YWluLnBuZyUyMiUwQSkucmVzaXplKChyZXNvbHV0aW9uJTJDJTIwcmVzb2x1dGlvbikpJTBBZWRpdF9pbnN0cnVjdGlvbiUyMCUzRCUyMCUyMlR1cm4lMjBza3klMjBpbnRvJTIwYSUyMGNsb3VkeSUyMG9uZSUyMiUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTEluc3RydWN0UGl4MlBpeFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJkaWZmdXNlcnMlMkZzZHhsLWluc3RydWN0cGl4MnBpeC03NjglMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBZWRpdGVkX2ltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0RlZGl0X2luc3RydWN0aW9uJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRHJlc29sdXRpb24lMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRHJlc29sdXRpb24lMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDMuMCUyQyUwQSUyMCUyMCUyMCUyMGltYWdlX2d1aWRhbmNlX3NjYWxlJTNEMS41JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDMwJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBZWRpdGVkX2ltYWdl",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> StableDiffusionXLInstructPix2PixPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span>resolution = <span class="hljs-number">768</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://hf.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png&quot;</span>
<span class="hljs-meta">... </span>).resize((resolution, resolution))
<span class="hljs-meta">&gt;&gt;&gt; </span>edit_instruction = <span class="hljs-string">&quot;Turn sky into a cloudy one&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionXLInstructPix2PixPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;diffusers/sdxl-instructpix2pix-768&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>edited_image = pipe(
<span class="hljs-meta">... </span>    prompt=edit_instruction,
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    height=resolution,
<span class="hljs-meta">... </span>    width=resolution,
<span class="hljs-meta">... </span>    guidance_scale=<span class="hljs-number">3.0</span>,
<span class="hljs-meta">... </span>    image_guidance_scale=<span class="hljs-number">1.5</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">30</span>,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>edited_image`}}),{c(){f=n("p"),T=a("Examples:"),g=d(),v(u.$$.fragment)},l(l){f=i(l,"P",{});var _=s(f);T=r(_,"Examples:"),_.forEach(t),g=c(l),P(u.$$.fragment,l)},m(l,_){h(l,f,_),e(f,T),h(l,g,_),y(u,l,_),x=!0},p:zo,i(l){x||(w(u.$$.fragment,l),x=!0)},o(l){I(u.$$.fragment,l),x=!1},d(l){l&&t(f),l&&t(g),S(u,l)}}}function Na(J){let f,T,g,u,x,l,_,B,R,U,W,A,Fo,Bo,ro,Ye,Ro,lo,Qe,vt,Vo,co,j,qo,_e,Oo,Yo,be,Qo,Ho,xe,Ko,en,po,oe,fo,V,ne,Pt,ve,tn,yt,on,uo,M,Pe,nn,wt,sn,an,ye,rn,He,ln,dn,cn,It,pn,fn,q,Ke,et,un,mn,gn,tt,ot,hn,_n,bn,nt,it,xn,vn,Pn,Z,we,yn,St,wn,In,ie,Sn,k,Ie,Dn,Se,Tn,st,Mn,Ln,kn,Dt,$n,En,se,Un,De,Jn,Te,jn,Nn,Xn,ae,Cn,$,Me,Wn,C,An,Tt,Zn,zn,Mt,Gn,Fn,Lt,Bn,Rn,Vn,Le,qn,kt,On,Yn,Qn,ke,Hn,at,Kn,ei,ti,O,oi,rt,ni,ii,$t,si,ai,ri,Y,li,lt,di,ci,Et,pi,fi,ui,re,$e,mi,Ut,gi,mo,Q,le,Jt,Ee,hi,jt,_i,go,H,Ue,bi,Nt,xi,ho,K,de,Xt,Je,vi,Ct,Pi,_o,b,je,yi,Wt,wi,Ii,Ne,Si,dt,Di,Ti,Mi,At,Li,ki,Zt,Xe,zt,$i,Ei,ct,Ui,Ji,Gt,ji,Ni,Ft,Ce,Bt,Xi,Ci,pt,Wi,Ai,z,We,Zi,Rt,zi,Gi,ce,Fi,pe,Ae,Bi,Ze,Ri,Vt,Vi,qi,Oi,fe,ze,Yi,Ge,Qi,qt,Hi,Ki,es,G,Fe,ts,Ot,os,ns,Yt,is,ss,F,Be,as,Qt,rs,ls,Ht,ds,cs,ue,Re,ps,Kt,fs,bo,ee,me,eo,Ve,us,to,ms,xo,te,qe,gs,oo,hs,vo;return l=new ao({}),oe=new ka({props:{$$slots:{default:[$a]},$$scope:{ctx:J}}}),ve=new ao({}),Pe=new E({props:{name:"class diffusers.StableDiffusionInstructPix2PixPipeline",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline",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.StableDiffusionInstructPix2PixPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L61"}}),we=new E({props:{name:"__call__",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 7.5"},{name:"image_guidance_scale",val:": float = 1.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = 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"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> <code>np.ndarray</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to be repainted according to <code>prompt</code>. Can also accept
image latents as <code>image</code>, but if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#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.StableDiffusionInstructPix2PixPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.image_guidance_scale",description:`<strong>image_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.5) &#x2014;
Push the generated image towards the inital <code>image</code>. Image guidance scale is enabled by setting
<code>image_guidance_scale &gt; 1</code>. Higher image guidance scale encourages generated images that are closely
linked to the source <code>image</code>, usually at the expense of lower image quality. This pipeline requires a
value of at least <code>1</code>.`,name:"image_guidance_scale"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__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.StableDiffusionInstructPix2PixPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</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. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L138",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),ie=new Zo({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.example",$$slots:{default:[Ea]},$$scope:{ctx:J}}}),Ie=new E({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"text_encoder",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
If not specified, function will take self.tokenizer.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text. If not specified, function will take self.tokenizer.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L687"}}),se=new Zo({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.example",$$slots:{default:[Ua]},$$scope:{ctx:J}}}),ae=new Zo({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.example-2",$$slots:{default:[Ja]},$$scope:{ctx:J}}}),Me=new E({props:{name:"load_lora_weights",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
See <a href="/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L991"}}),$e=new E({props:{name:"save_lora_weights",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>unet</code>.`,name:"unet_lora_layers"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.save_lora_weights.text_encoder_lora_layers",description:`<strong>text_encoder_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_lora_layers"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.save_lora_weights.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.save_lora_weights.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L1623"}}),Ee=new ao({}),Ue=new E({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),Je=new ao({}),je=new E({props:{name:"class diffusers.StableDiffusionXLInstructPix2PixPipeline",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"force_zeros_for_empty_prompt",val:": bool = True"},{name:"add_watermarker",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion XL 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.StableDiffusionXLInstructPix2PixPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code> CLIPTextModelWithProjection</code>) &#x2014;
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIP</a>,
specifically the
<a href="https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k" rel="nofollow">laion/CLIP-ViT-bigG-14-laion2B-39B-b160k</a>
variant.`,name:"text_encoder_2"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.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.StableDiffusionXLInstructPix2PixPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>CLIPTokenizer</code>) &#x2014;
Second 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_2"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.21.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.StableDiffusionXLInstructPix2PixPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.requires_aesthetics_score",description:`<strong>requires_aesthetics_score</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;False&quot;</code>) &#x2014;
Whether the <code>unet</code> requires a aesthetic_score condition to be passed during inference. Also see the config
of <code>stabilityai/stable-diffusion-xl-refiner-1-0</code>.`,name:"requires_aesthetics_score"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.force_zeros_for_empty_prompt",description:`<strong>force_zeros_for_empty_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;True&quot;</code>) &#x2014;
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
<code>stabilityai/stable-diffusion-xl-base-1-0</code>.`,name:"force_zeros_for_empty_prompt"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.add_watermarker",description:`<strong>add_watermarker</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to use the <a href="https://github.com/ShieldMnt/invisible-watermark/" rel="nofollow">invisible_watermark library</a> to
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
watermarker will be used.`,name:"add_watermarker"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L95"}}),We=new E({props:{name:"__call__",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"denoising_end",val:": typing.Optional[float] = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"image_guidance_scale",val:": float = 1.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"negative_prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_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"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": typing.Tuple[int, int] = None"},{name:"crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"target_size",val:": typing.Tuple[int, int] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code> or <code>np.ndarray</code> or <code>List[torch.FloatTensor]</code> or <code>List[PIL.Image.Image]</code> or <code>List[np.ndarray]</code>) &#x2014;
The image(s) to modify with the pipeline.`,name:"image"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__call__.denoising_end",description:`<strong>denoising_end</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, determines the fraction (between 0.0 and 1.0) of the total denoising process to be
completed before it is intentionally prematurely terminated. As a result, the returned sample will
still retain a substantial amount of noise as determined by the discrete timesteps selected by the
scheduler. The denoising_end parameter should ideally be utilized when this pipeline forms a part of a
&#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as elaborated in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>`,name:"denoising_end"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 5.0) &#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.StableDiffusionXLInstructPix2PixPipeline.__call__.image_guidance_scale",description:`<strong>image_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.5) &#x2014;
Image guidance scale is to push the generated image towards the inital image <code>image</code>. Image guidance
scale is enabled by setting <code>image_guidance_scale &gt; 1</code>. Higher image guidance scale encourages to
generate images that are closely linked to the source image <code>image</code>, usually at the expense of lower
image quality. This pipeline requires a value of at least <code>1</code>.`,name:"image_guidance_scale"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders.`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[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.StableDiffusionXLInstructPix2PixPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</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. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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>~pipelines.stable_diffusion.StableDiffusionXLPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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.StableDiffusionXLInstructPix2PixPipeline.__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/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.7) &#x2014;
Guidance rescale factor proposed by <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a> <code>guidance_scale</code> is defined as <code>&#x3C6;</code> in equation 16. of
<a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are Flawed</a>.
Guidance rescale factor should fix overexposure when using zero terminal SNR.`,name:"guidance_rescale"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
If <code>original_size</code> is not the same as <code>target_size</code> the image will appear to be down- or upsampled.
<code>original_size</code> defaults to <code>(width, height)</code> if not specified. Part of SDXL&#x2019;s micro-conditioning as
explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"original_size"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
<code>crops_coords_top_left</code> can be used to generate an image that appears to be &#x201C;cropped&#x201D; from the position
<code>crops_coords_top_left</code> downwards. Favorable, well-centered images are usually achieved by setting
<code>crops_coords_top_left</code> to (0, 0). Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
For most cases, <code>target_size</code> should be set to the desired height and width of the generated image. If
not specified it will default to <code>(width, height)</code>. Part of SDXL&#x2019;s micro-conditioning as explained in
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"target_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L575",returnDescription:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/pix2pix#diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput"
>StableDiffusionXLPipelineOutput</a> if <code>return_dict</code> is True, otherwise a
<code>tuple</code>. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/pix2pix#diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput"
>StableDiffusionXLPipelineOutput</a> or <code>tuple</code></p>
`}}),ce=new Zo({props:{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.__call__.example",$$slots:{default:[ja]},$$scope:{ctx:J}}}),Ae=new E({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L190"}}),ze=new E({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L206"}}),Fe=new E({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L181"}}),Be=new E({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L197"}}),Re=new E({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": typing.Optional[str] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt_2",val:": typing.Optional[str] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInstructPix2PixPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py#L213"}}),Ve=new ao({}),qe=new E({props:{name:"class diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion_xl/pipeline_output.py#L11"}}),{c(){f=n("meta"),T=d(),g=n("h1"),u=n("a"),x=n("span"),v(l.$$.fragment),_=d(),B=n("span"),R=a("InstructPix2Pix"),U=d(),W=n("p"),A=n("a"),Fo=a("InstructPix2Pix: Learning to Follow Image Editing Instructions"),Bo=a(" is by Tim Brooks, Aleksander Holynski and Alexei A. Efros."),ro=d(),Ye=n("p"),Ro=a("The abstract from the paper is:"),lo=d(),Qe=n("p"),vt=n("em"),Vo=a("We propose a method for editing images from human instructions: given an input image and a written instruction that tells the model what to do, our model follows these instructions to edit the image. To obtain training data for this problem, we combine the knowledge of two large pretrained models \u2014 a language model (GPT-3) and a text-to-image model (Stable Diffusion) \u2014 to generate a large dataset of image editing examples. Our conditional diffusion model, InstructPix2Pix, is trained on our generated data, and generalizes to real images and user-written instructions at inference time. Since it performs edits in the forward pass and does not require per example fine-tuning or inversion, our model edits images quickly, in a matter of seconds. We show compelling editing results for a diverse collection of input images and written instructions."),co=d(),j=n("p"),qo=a("You can find additional information about InstructPix2Pix on the "),_e=n("a"),Oo=a("project page"),Yo=a(", "),be=n("a"),Qo=a("original codebase"),Ho=a(", and try it out in a "),xe=n("a"),Ko=a("demo"),en=a("."),po=d(),v(oe.$$.fragment),fo=d(),V=n("h2"),ne=n("a"),Pt=n("span"),v(ve.$$.fragment),tn=d(),yt=n("span"),on=a("StableDiffusionInstructPix2PixPipeline"),uo=d(),M=n("div"),v(Pe.$$.fragment),nn=d(),wt=n("p"),sn=a("Pipeline for pixel-level image editing by following text instructions (based on Stable Diffusion)."),an=d(),ye=n("p"),rn=a("This model inherits from "),He=n("a"),ln=a("DiffusionPipeline"),dn=a(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),cn=d(),It=n("p"),pn=a("The pipeline also inherits the following loading methods:"),fn=d(),q=n("ul"),Ke=n("li"),et=n("a"),un=a("load_textual_inversion()"),mn=a(" for loading textual inversion embeddings"),gn=d(),tt=n("li"),ot=n("a"),hn=a("load_lora_weights()"),_n=a(" for loading LoRA weights"),bn=d(),nt=n("li"),it=n("a"),xn=a("save_lora_weights()"),vn=a(" for saving LoRA weights"),Pn=d(),Z=n("div"),v(we.$$.fragment),yn=d(),St=n("p"),wn=a("The call function to the pipeline for generation."),In=d(),v(ie.$$.fragment),Sn=d(),k=n("div"),v(Ie.$$.fragment),Dn=d(),Se=n("p"),Tn=a("Load textual inversion embeddings into the text encoder of "),st=n("a"),Mn=a("StableDiffusionPipeline"),Ln=a(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),kn=d(),Dt=n("p"),$n=a("Example:"),En=d(),v(se.$$.fragment),Un=d(),De=n("p"),Jn=a(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Te=n("a"),jn=a("civitAI"),Nn=a(") and then load the vector"),Xn=d(),v(ae.$$.fragment),Cn=d(),$=n("div"),v(Me.$$.fragment),Wn=d(),C=n("p"),An=a("Load LoRA weights specified in "),Tt=n("code"),Zn=a("pretrained_model_name_or_path_or_dict"),zn=a(" into "),Mt=n("code"),Gn=a("self.unet"),Fn=a(` and
`),Lt=n("code"),Bn=a("self.text_encoder"),Rn=a("."),Vn=d(),Le=n("p"),qn=a("All kwargs are forwarded to "),kt=n("code"),On=a("self.lora_state_dict"),Yn=a("."),Qn=d(),ke=n("p"),Hn=a("See "),at=n("a"),Kn=a("lora_state_dict()"),ei=a(" for more details on how the state dict is loaded."),ti=d(),O=n("p"),oi=a("See "),rt=n("a"),ni=a("load_lora_into_unet()"),ii=a(` for more details on how the state dict is loaded into
`),$t=n("code"),si=a("self.unet"),ai=a("."),ri=d(),Y=n("p"),li=a("See "),lt=n("a"),di=a("load_lora_into_text_encoder()"),ci=a(` for more details on how the state dict is loaded
into `),Et=n("code"),pi=a("self.text_encoder"),fi=a("."),ui=d(),re=n("div"),v($e.$$.fragment),mi=d(),Ut=n("p"),gi=a("Save the LoRA parameters corresponding to the UNet and text encoder."),mo=d(),Q=n("h2"),le=n("a"),Jt=n("span"),v(Ee.$$.fragment),hi=d(),jt=n("span"),_i=a("StableDiffusionPipelineOutput"),go=d(),H=n("div"),v(Ue.$$.fragment),bi=d(),Nt=n("p"),xi=a("Output class for Stable Diffusion pipelines."),ho=d(),K=n("h2"),de=n("a"),Xt=n("span"),v(Je.$$.fragment),vi=d(),Ct=n("span"),Pi=a("StableDiffusionXLInstructPix2PixPipeline"),_o=d(),b=n("div"),v(je.$$.fragment),yi=d(),Wt=n("p"),wi=a("Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion XL."),Ii=d(),Ne=n("p"),Si=a("This model inherits from "),dt=n("a"),Di=a("DiffusionPipeline"),Ti=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.)`),Mi=d(),At=n("p"),Li=a("In addition the pipeline inherits the following loading methods:"),ki=d(),Zt=n("ul"),Xe=n("li"),zt=n("em"),$i=a("LoRA"),Ei=a(": "),ct=n("a"),Ui=a("loaders.LoraLoaderMixin.load_lora_weights()"),Ji=d(),Gt=n("p"),ji=a("as well as the following saving methods:"),Ni=d(),Ft=n("ul"),Ce=n("li"),Bt=n("em"),Xi=a("LoRA"),Ci=a(": "),pt=n("a"),Wi=a("loaders.LoraLoaderMixin.save_lora_weights()"),Ai=d(),z=n("div"),v(We.$$.fragment),Zi=d(),Rt=n("p"),zi=a("Function invoked when calling the pipeline for generation."),Gi=d(),v(ce.$$.fragment),Fi=d(),pe=n("div"),v(Ae.$$.fragment),Bi=d(),Ze=n("p"),Ri=a("Disable sliced VAE decoding. If "),Vt=n("code"),Vi=a("enable_vae_slicing"),qi=a(` was previously invoked, this method will go back to
computing decoding in one step.`),Oi=d(),fe=n("div"),v(ze.$$.fragment),Yi=d(),Ge=n("p"),Qi=a("Disable tiled VAE decoding. If "),qt=n("code"),Hi=a("enable_vae_tiling"),Ki=a(` was previously invoked, this method will go back to
computing decoding in one step.`),es=d(),G=n("div"),v(Fe.$$.fragment),ts=d(),Ot=n("p"),os=a("Enable sliced VAE decoding."),ns=d(),Yt=n("p"),is=a(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),ss=d(),F=n("div"),v(Be.$$.fragment),as=d(),Qt=n("p"),rs=a("Enable tiled VAE decoding."),ls=d(),Ht=n("p"),ds=a(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),cs=d(),ue=n("div"),v(Re.$$.fragment),ps=d(),Kt=n("p"),fs=a("Encodes the prompt into text encoder hidden states."),bo=d(),ee=n("h2"),me=n("a"),eo=n("span"),v(Ve.$$.fragment),us=d(),to=n("span"),ms=a("StableDiffusionXLPipelineOutput"),xo=d(),te=n("div"),v(qe.$$.fragment),gs=d(),oo=n("p"),hs=a("Output class for Stable Diffusion pipelines."),this.h()},l(o){const m=Ma('[data-svelte="svelte-1phssyn"]',document.head);f=i(m,"META",{name:!0,content:!0}),m.forEach(t),T=c(o),g=i(o,"H1",{class:!0});var Oe=s(g);u=i(Oe,"A",{id:!0,class:!0,href:!0});var no=s(u);x=i(no,"SPAN",{});var io=s(x);P(l.$$.fragment,io),io.forEach(t),no.forEach(t),_=c(Oe),B=i(Oe,"SPAN",{});var so=s(B);R=r(so,"InstructPix2Pix"),so.forEach(t),Oe.forEach(t),U=c(o),W=i(o,"P",{});var ft=s(W);A=i(ft,"A",{href:!0,rel:!0});var vs=s(A);Fo=r(vs,"InstructPix2Pix: Learning to Follow Image Editing Instructions"),vs.forEach(t),Bo=r(ft," is by Tim Brooks, Aleksander Holynski and Alexei A. Efros."),ft.forEach(t),ro=c(o),Ye=i(o,"P",{});var Ps=s(Ye);Ro=r(Ps,"The abstract from the paper is:"),Ps.forEach(t),lo=c(o),Qe=i(o,"P",{});var ys=s(Qe);vt=i(ys,"EM",{});var ws=s(vt);Vo=r(ws,"We propose a method for editing images from human instructions: given an input image and a written instruction that tells the model what to do, our model follows these instructions to edit the image. To obtain training data for this problem, we combine the knowledge of two large pretrained models \u2014 a language model (GPT-3) and a text-to-image model (Stable Diffusion) \u2014 to generate a large dataset of image editing examples. Our conditional diffusion model, InstructPix2Pix, is trained on our generated data, and generalizes to real images and user-written instructions at inference time. Since it performs edits in the forward pass and does not require per example fine-tuning or inversion, our model edits images quickly, in a matter of seconds. We show compelling editing results for a diverse collection of input images and written instructions."),ws.forEach(t),ys.forEach(t),co=c(o),j=i(o,"P",{});var ge=s(j);qo=r(ge,"You can find additional information about InstructPix2Pix on the "),_e=i(ge,"A",{href:!0,rel:!0});var Is=s(_e);Oo=r(Is,"project page"),Is.forEach(t),Yo=r(ge,", "),be=i(ge,"A",{href:!0,rel:!0});var Ss=s(be);Qo=r(Ss,"original codebase"),Ss.forEach(t),Ho=r(ge,", and try it out in a "),xe=i(ge,"A",{href:!0,rel:!0});var Ds=s(xe);Ko=r(Ds,"demo"),Ds.forEach(t),en=r(ge,"."),ge.forEach(t),po=c(o),P(oe.$$.fragment,o),fo=c(o),V=i(o,"H2",{class:!0});var Po=s(V);ne=i(Po,"A",{id:!0,class:!0,href:!0});var Ts=s(ne);Pt=i(Ts,"SPAN",{});var Ms=s(Pt);P(ve.$$.fragment,Ms),Ms.forEach(t),Ts.forEach(t),tn=c(Po),yt=i(Po,"SPAN",{});var Ls=s(yt);on=r(Ls,"StableDiffusionInstructPix2PixPipeline"),Ls.forEach(t),Po.forEach(t),uo=c(o),M=i(o,"DIV",{class:!0});var L=s(M);P(Pe.$$.fragment,L),nn=c(L),wt=i(L,"P",{});var ks=s(wt);sn=r(ks,"Pipeline for pixel-level image editing by following text instructions (based on Stable Diffusion)."),ks.forEach(t),an=c(L),ye=i(L,"P",{});var yo=s(ye);rn=r(yo,"This model inherits from "),He=i(yo,"A",{href:!0});var $s=s(He);ln=r($s,"DiffusionPipeline"),$s.forEach(t),dn=r(yo,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),yo.forEach(t),cn=c(L),It=i(L,"P",{});var Es=s(It);pn=r(Es,"The pipeline also inherits the following loading methods:"),Es.forEach(t),fn=c(L),q=i(L,"UL",{});var ut=s(q);Ke=i(ut,"LI",{});var _s=s(Ke);et=i(_s,"A",{href:!0});var Us=s(et);un=r(Us,"load_textual_inversion()"),Us.forEach(t),mn=r(_s," for loading textual inversion embeddings"),_s.forEach(t),gn=c(ut),tt=i(ut,"LI",{});var bs=s(tt);ot=i(bs,"A",{href:!0});var Js=s(ot);hn=r(Js,"load_lora_weights()"),Js.forEach(t),_n=r(bs," for loading LoRA weights"),bs.forEach(t),bn=c(ut),nt=i(ut,"LI",{});var xs=s(nt);it=i(xs,"A",{href:!0});var js=s(it);xn=r(js,"save_lora_weights()"),js.forEach(t),vn=r(xs," for saving LoRA weights"),xs.forEach(t),ut.forEach(t),Pn=c(L),Z=i(L,"DIV",{class:!0});var mt=s(Z);P(we.$$.fragment,mt),yn=c(mt),St=i(mt,"P",{});var Ns=s(St);wn=r(Ns,"The call function to the pipeline for generation."),Ns.forEach(t),In=c(mt),P(ie.$$.fragment,mt),mt.forEach(t),Sn=c(L),k=i(L,"DIV",{class:!0});var N=s(k);P(Ie.$$.fragment,N),Dn=c(N),Se=i(N,"P",{});var wo=s(Se);Tn=r(wo,"Load textual inversion embeddings into the text encoder of "),st=i(wo,"A",{href:!0});var Xs=s(st);Mn=r(Xs,"StableDiffusionPipeline"),Xs.forEach(t),Ln=r(wo,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),wo.forEach(t),kn=c(N),Dt=i(N,"P",{});var Cs=s(Dt);$n=r(Cs,"Example:"),Cs.forEach(t),En=c(N),P(se.$$.fragment,N),Un=c(N),De=i(N,"P",{});var Io=s(De);Jn=r(Io,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Te=i(Io,"A",{href:!0,rel:!0});var Ws=s(Te);jn=r(Ws,"civitAI"),Ws.forEach(t),Nn=r(Io,") and then load the vector"),Io.forEach(t),Xn=c(N),P(ae.$$.fragment,N),N.forEach(t),Cn=c(L),$=i(L,"DIV",{class:!0});var X=s($);P(Me.$$.fragment,X),Wn=c(X),C=i(X,"P",{});var he=s(C);An=r(he,"Load LoRA weights specified in "),Tt=i(he,"CODE",{});var As=s(Tt);Zn=r(As,"pretrained_model_name_or_path_or_dict"),As.forEach(t),zn=r(he," into "),Mt=i(he,"CODE",{});var Zs=s(Mt);Gn=r(Zs,"self.unet"),Zs.forEach(t),Fn=r(he,` and
`),Lt=i(he,"CODE",{});var zs=s(Lt);Bn=r(zs,"self.text_encoder"),zs.forEach(t),Rn=r(he,"."),he.forEach(t),Vn=c(X),Le=i(X,"P",{});var So=s(Le);qn=r(So,"All kwargs are forwarded to "),kt=i(So,"CODE",{});var Gs=s(kt);On=r(Gs,"self.lora_state_dict"),Gs.forEach(t),Yn=r(So,"."),So.forEach(t),Qn=c(X),ke=i(X,"P",{});var Do=s(ke);Hn=r(Do,"See "),at=i(Do,"A",{href:!0});var Fs=s(at);Kn=r(Fs,"lora_state_dict()"),Fs.forEach(t),ei=r(Do," for more details on how the state dict is loaded."),Do.forEach(t),ti=c(X),O=i(X,"P",{});var gt=s(O);oi=r(gt,"See "),rt=i(gt,"A",{href:!0});var Bs=s(rt);ni=r(Bs,"load_lora_into_unet()"),Bs.forEach(t),ii=r(gt,` for more details on how the state dict is loaded into
`),$t=i(gt,"CODE",{});var Rs=s($t);si=r(Rs,"self.unet"),Rs.forEach(t),ai=r(gt,"."),gt.forEach(t),ri=c(X),Y=i(X,"P",{});var ht=s(Y);li=r(ht,"See "),lt=i(ht,"A",{href:!0});var Vs=s(lt);di=r(Vs,"load_lora_into_text_encoder()"),Vs.forEach(t),ci=r(ht,` for more details on how the state dict is loaded
into `),Et=i(ht,"CODE",{});var qs=s(Et);pi=r(qs,"self.text_encoder"),qs.forEach(t),fi=r(ht,"."),ht.forEach(t),X.forEach(t),ui=c(L),re=i(L,"DIV",{class:!0});var To=s(re);P($e.$$.fragment,To),mi=c(To),Ut=i(To,"P",{});var Os=s(Ut);gi=r(Os,"Save the LoRA parameters corresponding to the UNet and text encoder."),Os.forEach(t),To.forEach(t),L.forEach(t),mo=c(o),Q=i(o,"H2",{class:!0});var Mo=s(Q);le=i(Mo,"A",{id:!0,class:!0,href:!0});var Ys=s(le);Jt=i(Ys,"SPAN",{});var Qs=s(Jt);P(Ee.$$.fragment,Qs),Qs.forEach(t),Ys.forEach(t),hi=c(Mo),jt=i(Mo,"SPAN",{});var Hs=s(jt);_i=r(Hs,"StableDiffusionPipelineOutput"),Hs.forEach(t),Mo.forEach(t),go=c(o),H=i(o,"DIV",{class:!0});var Lo=s(H);P(Ue.$$.fragment,Lo),bi=c(Lo),Nt=i(Lo,"P",{});var Ks=s(Nt);xi=r(Ks,"Output class for Stable Diffusion pipelines."),Ks.forEach(t),Lo.forEach(t),ho=c(o),K=i(o,"H2",{class:!0});var ko=s(K);de=i(ko,"A",{id:!0,class:!0,href:!0});var ea=s(de);Xt=i(ea,"SPAN",{});var ta=s(Xt);P(Je.$$.fragment,ta),ta.forEach(t),ea.forEach(t),vi=c(ko),Ct=i(ko,"SPAN",{});var oa=s(Ct);Pi=r(oa,"StableDiffusionXLInstructPix2PixPipeline"),oa.forEach(t),ko.forEach(t),_o=c(o),b=i(o,"DIV",{class:!0});var D=s(b);P(je.$$.fragment,D),yi=c(D),Wt=i(D,"P",{});var na=s(Wt);wi=r(na,"Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion XL."),na.forEach(t),Ii=c(D),Ne=i(D,"P",{});var $o=s(Ne);Si=r($o,"This model inherits from "),dt=i($o,"A",{href:!0});var ia=s(dt);Di=r(ia,"DiffusionPipeline"),ia.forEach(t),Ti=r($o,`. 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.)`),$o.forEach(t),Mi=c(D),At=i(D,"P",{});var sa=s(At);Li=r(sa,"In addition the pipeline inherits the following loading methods:"),sa.forEach(t),ki=c(D),Zt=i(D,"UL",{});var aa=s(Zt);Xe=i(aa,"LI",{});var Eo=s(Xe);zt=i(Eo,"EM",{});var ra=s(zt);$i=r(ra,"LoRA"),ra.forEach(t),Ei=r(Eo,": "),ct=i(Eo,"A",{href:!0});var la=s(ct);Ui=r(la,"loaders.LoraLoaderMixin.load_lora_weights()"),la.forEach(t),Eo.forEach(t),aa.forEach(t),Ji=c(D),Gt=i(D,"P",{});var da=s(Gt);ji=r(da,"as well as the following saving methods:"),da.forEach(t),Ni=c(D),Ft=i(D,"UL",{});var ca=s(Ft);Ce=i(ca,"LI",{});var Uo=s(Ce);Bt=i(Uo,"EM",{});var pa=s(Bt);Xi=r(pa,"LoRA"),pa.forEach(t),Ci=r(Uo,": "),pt=i(Uo,"A",{href:!0});var fa=s(pt);Wi=r(fa,"loaders.LoraLoaderMixin.save_lora_weights()"),fa.forEach(t),Uo.forEach(t),ca.forEach(t),Ai=c(D),z=i(D,"DIV",{class:!0});var _t=s(z);P(We.$$.fragment,_t),Zi=c(_t),Rt=i(_t,"P",{});var ua=s(Rt);zi=r(ua,"Function invoked when calling the pipeline for generation."),ua.forEach(t),Gi=c(_t),P(ce.$$.fragment,_t),_t.forEach(t),Fi=c(D),pe=i(D,"DIV",{class:!0});var Jo=s(pe);P(Ae.$$.fragment,Jo),Bi=c(Jo),Ze=i(Jo,"P",{});var jo=s(Ze);Ri=r(jo,"Disable sliced VAE decoding. If "),Vt=i(jo,"CODE",{});var ma=s(Vt);Vi=r(ma,"enable_vae_slicing"),ma.forEach(t),qi=r(jo,` was previously invoked, this method will go back to
computing decoding in one step.`),jo.forEach(t),Jo.forEach(t),Oi=c(D),fe=i(D,"DIV",{class:!0});var No=s(fe);P(ze.$$.fragment,No),Yi=c(No),Ge=i(No,"P",{});var Xo=s(Ge);Qi=r(Xo,"Disable tiled VAE decoding. If "),qt=i(Xo,"CODE",{});var ga=s(qt);Hi=r(ga,"enable_vae_tiling"),ga.forEach(t),Ki=r(Xo,` was previously invoked, this method will go back to
computing decoding in one step.`),Xo.forEach(t),No.forEach(t),es=c(D),G=i(D,"DIV",{class:!0});var bt=s(G);P(Fe.$$.fragment,bt),ts=c(bt),Ot=i(bt,"P",{});var ha=s(Ot);os=r(ha,"Enable sliced VAE decoding."),ha.forEach(t),ns=c(bt),Yt=i(bt,"P",{});var _a=s(Yt);is=r(_a,`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),_a.forEach(t),bt.forEach(t),ss=c(D),F=i(D,"DIV",{class:!0});var xt=s(F);P(Be.$$.fragment,xt),as=c(xt),Qt=i(xt,"P",{});var ba=s(Qt);rs=r(ba,"Enable tiled VAE decoding."),ba.forEach(t),ls=c(xt),Ht=i(xt,"P",{});var xa=s(Ht);ds=r(xa,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),xa.forEach(t),xt.forEach(t),cs=c(D),ue=i(D,"DIV",{class:!0});var Co=s(ue);P(Re.$$.fragment,Co),ps=c(Co),Kt=i(Co,"P",{});var va=s(Kt);fs=r(va,"Encodes the prompt into text encoder hidden states."),va.forEach(t),Co.forEach(t),D.forEach(t),bo=c(o),ee=i(o,"H2",{class:!0});var Wo=s(ee);me=i(Wo,"A",{id:!0,class:!0,href:!0});var Pa=s(me);eo=i(Pa,"SPAN",{});var ya=s(eo);P(Ve.$$.fragment,ya),ya.forEach(t),Pa.forEach(t),us=c(Wo),to=i(Wo,"SPAN",{});var wa=s(to);ms=r(wa,"StableDiffusionXLPipelineOutput"),wa.forEach(t),Wo.forEach(t),xo=c(o),te=i(o,"DIV",{class:!0});var Ao=s(te);P(qe.$$.fragment,Ao),gs=c(Ao),oo=i(Ao,"P",{});var Ia=s(oo);hs=r(Ia,"Output class for Stable Diffusion pipelines."),Ia.forEach(t),Ao.forEach(t),this.h()},h(){p(f,"name","hf:doc:metadata"),p(f,"content",JSON.stringify(Xa)),p(u,"id","instructpix2pix"),p(u,"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"),p(u,"href","#instructpix2pix"),p(g,"class","relative group"),p(A,"href","https://huggingface.co/papers/2211.09800"),p(A,"rel","nofollow"),p(_e,"href","https://www.timothybrooks.com/instruct-pix2pix"),p(_e,"rel","nofollow"),p(be,"href","https://github.com/timothybrooks/instruct-pix2pix"),p(be,"rel","nofollow"),p(xe,"href","https://huggingface.co/spaces/timbrooks/instruct-pix2pix"),p(xe,"rel","nofollow"),p(ne,"id","diffusers.StableDiffusionInstructPix2PixPipeline"),p(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ne,"href","#diffusers.StableDiffusionInstructPix2PixPipeline"),p(V,"class","relative group"),p(He,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(et,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),p(ot,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),p(it,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),p(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(st,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(Te,"href","https://civitai.com/models/3036?modelVersionId=9857"),p(Te,"rel","nofollow"),p(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(at,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),p(rt,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),p(lt,"href","/docs/diffusers/v0.21.0/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),p($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(le,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(le,"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"),p(le,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(Q,"class","relative group"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(de,"id","diffusers.StableDiffusionXLInstructPix2PixPipeline"),p(de,"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"),p(de,"href","#diffusers.StableDiffusionXLInstructPix2PixPipeline"),p(K,"class","relative group"),p(dt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(ct,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),p(pt,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),p(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(me,"id","diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput"),p(me,"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"),p(me,"href","#diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput"),p(ee,"class","relative group"),p(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(o,m){e(document.head,f),h(o,T,m),h(o,g,m),e(g,u),e(u,x),y(l,x,null),e(g,_),e(g,B),e(B,R),h(o,U,m),h(o,W,m),e(W,A),e(A,Fo),e(W,Bo),h(o,ro,m),h(o,Ye,m),e(Ye,Ro),h(o,lo,m),h(o,Qe,m),e(Qe,vt),e(vt,Vo),h(o,co,m),h(o,j,m),e(j,qo),e(j,_e),e(_e,Oo),e(j,Yo),e(j,be),e(be,Qo),e(j,Ho),e(j,xe),e(xe,Ko),e(j,en),h(o,po,m),y(oe,o,m),h(o,fo,m),h(o,V,m),e(V,ne),e(ne,Pt),y(ve,Pt,null),e(V,tn),e(V,yt),e(yt,on),h(o,uo,m),h(o,M,m),y(Pe,M,null),e(M,nn),e(M,wt),e(wt,sn),e(M,an),e(M,ye),e(ye,rn),e(ye,He),e(He,ln),e(ye,dn),e(M,cn),e(M,It),e(It,pn),e(M,fn),e(M,q),e(q,Ke),e(Ke,et),e(et,un),e(Ke,mn),e(q,gn),e(q,tt),e(tt,ot),e(ot,hn),e(tt,_n),e(q,bn),e(q,nt),e(nt,it),e(it,xn),e(nt,vn),e(M,Pn),e(M,Z),y(we,Z,null),e(Z,yn),e(Z,St),e(St,wn),e(Z,In),y(ie,Z,null),e(M,Sn),e(M,k),y(Ie,k,null),e(k,Dn),e(k,Se),e(Se,Tn),e(Se,st),e(st,Mn),e(Se,Ln),e(k,kn),e(k,Dt),e(Dt,$n),e(k,En),y(se,k,null),e(k,Un),e(k,De),e(De,Jn),e(De,Te),e(Te,jn),e(De,Nn),e(k,Xn),y(ae,k,null),e(M,Cn),e(M,$),y(Me,$,null),e($,Wn),e($,C),e(C,An),e(C,Tt),e(Tt,Zn),e(C,zn),e(C,Mt),e(Mt,Gn),e(C,Fn),e(C,Lt),e(Lt,Bn),e(C,Rn),e($,Vn),e($,Le),e(Le,qn),e(Le,kt),e(kt,On),e(Le,Yn),e($,Qn),e($,ke),e(ke,Hn),e(ke,at),e(at,Kn),e(ke,ei),e($,ti),e($,O),e(O,oi),e(O,rt),e(rt,ni),e(O,ii),e(O,$t),e($t,si),e(O,ai),e($,ri),e($,Y),e(Y,li),e(Y,lt),e(lt,di),e(Y,ci),e(Y,Et),e(Et,pi),e(Y,fi),e(M,ui),e(M,re),y($e,re,null),e(re,mi),e(re,Ut),e(Ut,gi),h(o,mo,m),h(o,Q,m),e(Q,le),e(le,Jt),y(Ee,Jt,null),e(Q,hi),e(Q,jt),e(jt,_i),h(o,go,m),h(o,H,m),y(Ue,H,null),e(H,bi),e(H,Nt),e(Nt,xi),h(o,ho,m),h(o,K,m),e(K,de),e(de,Xt),y(Je,Xt,null),e(K,vi),e(K,Ct),e(Ct,Pi),h(o,_o,m),h(o,b,m),y(je,b,null),e(b,yi),e(b,Wt),e(Wt,wi),e(b,Ii),e(b,Ne),e(Ne,Si),e(Ne,dt),e(dt,Di),e(Ne,Ti),e(b,Mi),e(b,At),e(At,Li),e(b,ki),e(b,Zt),e(Zt,Xe),e(Xe,zt),e(zt,$i),e(Xe,Ei),e(Xe,ct),e(ct,Ui),e(b,Ji),e(b,Gt),e(Gt,ji),e(b,Ni),e(b,Ft),e(Ft,Ce),e(Ce,Bt),e(Bt,Xi),e(Ce,Ci),e(Ce,pt),e(pt,Wi),e(b,Ai),e(b,z),y(We,z,null),e(z,Zi),e(z,Rt),e(Rt,zi),e(z,Gi),y(ce,z,null),e(b,Fi),e(b,pe),y(Ae,pe,null),e(pe,Bi),e(pe,Ze),e(Ze,Ri),e(Ze,Vt),e(Vt,Vi),e(Ze,qi),e(b,Oi),e(b,fe),y(ze,fe,null),e(fe,Yi),e(fe,Ge),e(Ge,Qi),e(Ge,qt),e(qt,Hi),e(Ge,Ki),e(b,es),e(b,G),y(Fe,G,null),e(G,ts),e(G,Ot),e(Ot,os),e(G,ns),e(G,Yt),e(Yt,is),e(b,ss),e(b,F),y(Be,F,null),e(F,as),e(F,Qt),e(Qt,rs),e(F,ls),e(F,Ht),e(Ht,ds),e(b,cs),e(b,ue),y(Re,ue,null),e(ue,ps),e(ue,Kt),e(Kt,fs),h(o,bo,m),h(o,ee,m),e(ee,me),e(me,eo),y(Ve,eo,null),e(ee,us),e(ee,to),e(to,ms),h(o,xo,m),h(o,te,m),y(qe,te,null),e(te,gs),e(te,oo),e(oo,hs),vo=!0},p(o,[m]){const Oe={};m&2&&(Oe.$$scope={dirty:m,ctx:o}),oe.$set(Oe);const no={};m&2&&(no.$$scope={dirty:m,ctx:o}),ie.$set(no);const io={};m&2&&(io.$$scope={dirty:m,ctx:o}),se.$set(io);const so={};m&2&&(so.$$scope={dirty:m,ctx:o}),ae.$set(so);const ft={};m&2&&(ft.$$scope={dirty:m,ctx:o}),ce.$set(ft)},i(o){vo||(w(l.$$.fragment,o),w(oe.$$.fragment,o),w(ve.$$.fragment,o),w(Pe.$$.fragment,o),w(we.$$.fragment,o),w(ie.$$.fragment,o),w(Ie.$$.fragment,o),w(se.$$.fragment,o),w(ae.$$.fragment,o),w(Me.$$.fragment,o),w($e.$$.fragment,o),w(Ee.$$.fragment,o),w(Ue.$$.fragment,o),w(Je.$$.fragment,o),w(je.$$.fragment,o),w(We.$$.fragment,o),w(ce.$$.fragment,o),w(Ae.$$.fragment,o),w(ze.$$.fragment,o),w(Fe.$$.fragment,o),w(Be.$$.fragment,o),w(Re.$$.fragment,o),w(Ve.$$.fragment,o),w(qe.$$.fragment,o),vo=!0)},o(o){I(l.$$.fragment,o),I(oe.$$.fragment,o),I(ve.$$.fragment,o),I(Pe.$$.fragment,o),I(we.$$.fragment,o),I(ie.$$.fragment,o),I(Ie.$$.fragment,o),I(se.$$.fragment,o),I(ae.$$.fragment,o),I(Me.$$.fragment,o),I($e.$$.fragment,o),I(Ee.$$.fragment,o),I(Ue.$$.fragment,o),I(Je.$$.fragment,o),I(je.$$.fragment,o),I(We.$$.fragment,o),I(ce.$$.fragment,o),I(Ae.$$.fragment,o),I(ze.$$.fragment,o),I(Fe.$$.fragment,o),I(Be.$$.fragment,o),I(Re.$$.fragment,o),I(Ve.$$.fragment,o),I(qe.$$.fragment,o),vo=!1},d(o){t(f),o&&t(T),o&&t(g),S(l),o&&t(U),o&&t(W),o&&t(ro),o&&t(Ye),o&&t(lo),o&&t(Qe),o&&t(co),o&&t(j),o&&t(po),S(oe,o),o&&t(fo),o&&t(V),S(ve),o&&t(uo),o&&t(M),S(Pe),S(we),S(ie),S(Ie),S(se),S(ae),S(Me),S($e),o&&t(mo),o&&t(Q),S(Ee),o&&t(go),o&&t(H),S(Ue),o&&t(ho),o&&t(K),S(Je),o&&t(_o),o&&t(b),S(je),S(We),S(ce),S(Ae),S(ze),S(Fe),S(Be),S(Re),o&&t(bo),o&&t(ee),S(Ve),o&&t(xo),o&&t(te),S(qe)}}}const Xa={local:"instructpix2pix",sections:[{local:"diffusers.StableDiffusionInstructPix2PixPipeline",title:"StableDiffusionInstructPix2PixPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"},{local:"diffusers.StableDiffusionXLInstructPix2PixPipeline",title:"StableDiffusionXLInstructPix2PixPipeline"},{local:"diffusers.pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput",title:"StableDiffusionXLPipelineOutput"}],title:"InstructPix2Pix"};function Ca(J){return La(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ba extends Sa{constructor(f){super();Da(this,f,Ca,Na,Ta,{})}}export{Ba as default,Xa as metadata};
