import{S as xa,i as wa,s as ya,e as n,k as c,w,t as s,M as Pa,c as i,d as t,m as p,a,x as y,h as r,b as d,G as e,g as h,y as P,q as I,o as M,B as T,v as Ia,L as hi}from"../../../chunks/vendor-hf-doc-builder.js";import{D as De}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as fo}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Zt}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as mi}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ma(F){let g,U,b,u,x;return u=new fo({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(){g=n("p"),U=s("Examples:"),b=c(),w(u.$$.fragment)},l(l){g=i(l,"P",{});var v=a(g);U=r(v,"Examples:"),v.forEach(t),b=p(l),y(u.$$.fragment,l)},m(l,v){h(l,g,v),e(g,U),h(l,b,v),P(u,l,v),x=!0},p:hi,i(l){x||(I(u.$$.fragment,l),x=!0)},o(l){M(u.$$.fragment,l),x=!1},d(l){l&&t(g),l&&t(b),T(u,l)}}}function Ta(F){let g,U,b,u,x;return u=new fo({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(){g=n("p"),U=s("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),b=c(),w(u.$$.fragment)},l(l){g=i(l,"P",{});var v=a(g);U=r(v,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),v.forEach(t),b=p(l),y(u.$$.fragment,l)},m(l,v){h(l,g,v),e(g,U),h(l,b,v),P(u,l,v),x=!0},p:hi,i(l){x||(I(u.$$.fragment,l),x=!0)},o(l){M(u.$$.fragment,l),x=!1},d(l){l&&t(g),l&&t(b),T(u,l)}}}function Ua(F){let g,U,b,u,x;return u=new fo({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(){g=n("p"),U=s("locally:"),b=c(),w(u.$$.fragment)},l(l){g=i(l,"P",{});var v=a(g);U=r(v,"locally:"),v.forEach(t),b=p(l),y(u.$$.fragment,l)},m(l,v){h(l,g,v),e(g,U),h(l,b,v),P(u,l,v),x=!0},p:hi,i(l){x||(I(u.$$.fragment,l),x=!0)},o(l){M(u.$$.fragment,l),x=!1},d(l){l&&t(g),l&&t(b),T(u,l)}}}function Ea(F){let g,U,b,u,x,l,v,Ke,uo,Wt,j,A,et,oe,mo,tt,ho,Ct,ne,ie,go,_o,Nt,$e,bo,Lt,je,ot,vo,Bt,Ze,xo,Gt,k,We,ae,wo,yo,Po,Ce,se,Io,Mo,To,Ne,re,Uo,Eo,So,Le,le,ko,Jo,Ft,Z,R,nt,de,Do,it,$o,At,X,at,W,st,jo,Zo,rt,Wo,Co,Be,No,Lo,lt,C,dt,ce,Bo,Go,ct,pt,Fo,Ao,Ge,pe,Ro,Rt,N,q,ft,fe,Xo,ut,qo,Xt,ue,qt,L,Y,mt,me,Yo,ht,Qo,Yt,m,he,Vo,gt,Ho,zo,ge,Oo,Fe,Ko,en,tn,_t,on,nn,_e,be,bt,an,sn,Ae,rn,ln,ve,vt,dn,cn,Re,pn,fn,xt,un,mn,wt,xe,yt,hn,gn,Xe,_n,bn,D,we,vn,Pt,xn,wn,Q,yn,E,ye,Pn,Pe,In,qe,Mn,Tn,Un,It,En,Sn,V,kn,Ie,Jn,Me,Dn,$n,jn,H,Zn,z,Te,Wn,B,Cn,Ye,Nn,Ln,Ue,Mt,Bn,Gn,Fn,O,Ee,An,Tt,Rn,Xn,K,Se,qn,S,Yn,Ut,Qn,Vn,Et,Hn,zn,St,On,Kn,kt,ei,ti,oi,ee,ke,ni,G,ii,Jt,ai,si,Dt,ri,li,Qt;return l=new Zt({}),oe=new Zt({}),de=new Zt({}),fe=new Zt({}),ue=new fo({props:{code:"aW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25JbnN0cnVjdFBpeDJQaXhQaXBlbGluZSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIydGltYnJvb2tzJTJGaW5zdHJ1Y3QtcGl4MnBpeCUyMiUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbnN0cnVjdFBpeDJQaXhQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGZGlmZnVzZXJzJTJGZGlmZnVzZXJzLWltYWdlcy1kb2NzJTJGcmVzb2x2ZSUyRm1haW4lMkZtb3VudGFpbi5wbmclMjIlMEElMEElMEFkZWYlMjBkb3dubG9hZF9pbWFnZSh1cmwpJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBQSUwuSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwUElMLkltYWdlT3BzLmV4aWZfdHJhbnNwb3NlKGltYWdlKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwaW1hZ2UuY29udmVydCglMjJSR0IlMjIpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaW1hZ2UlMEElMEElMEFpbWFnZSUyMCUzRCUyMGRvd25sb2FkX2ltYWdlKHVybCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJtYWtlJTIwdGhlJTIwbW91bnRhaW5zJTIwc25vd3klMjIlMEFpbWFnZXMlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGltYWdlJTNEaW1hZ2UlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjAlMkMlMjBpbWFnZV9ndWlkYW5jZV9zY2FsZSUzRDEuNSUyQyUyMGd1aWRhbmNlX3NjYWxlJTNENykuaW1hZ2VzJTBBaW1hZ2VzJTVCMCU1RC5zYXZlKCUyMnNub3d5X21vdW50YWlucy5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> PIL
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionInstructPix2PixPipeline

model_id = <span class="hljs-string">&quot;timbrooks/instruct-pix2pix&quot;</span>
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png&quot;</span>


<span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>):
    image = PIL.Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
    image = PIL.ImageOps.exif_transpose(image)
    image = image.convert(<span class="hljs-string">&quot;RGB&quot;</span>)
    <span class="hljs-keyword">return</span> image


image = download_image(url)

prompt = <span class="hljs-string">&quot;make the mountains snowy&quot;</span>
images = pipe(prompt, image=image, num_inference_steps=<span class="hljs-number">20</span>, image_guidance_scale=<span class="hljs-number">1.5</span>, guidance_scale=<span class="hljs-number">7</span>).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;snowy_mountains.png&quot;</span>)`}}),me=new Zt({}),he=new De({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.18.2/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. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.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.StableDiffusionInstructPix2PixPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.2/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 details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L71"}}),we=new De({props:{name:"__call__",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"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[typing.List[str], 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 the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,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 which will be repainted according to <code>prompt</code>. Can also
accpet image latents as <code>image</code>, if passing latents directly, it will not be 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;
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. This pipeline requires a value of at least <code>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;
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.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 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.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;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.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 will ge 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, <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.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, <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.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 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.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.18.2/en/api/pipelines/stable_diffusion/overview#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 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.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 will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L149",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Q=new mi({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.example",$$slots:{default:[Ma]},$$scope:{ctx:F}}}),ye=new De({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:"**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.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.18.2/src/diffusers/loaders.py#L469"}}),V=new mi({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.example",$$slots:{default:[Ta]},$$scope:{ctx:F}}}),H=new mi({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.example-2",$$slots:{default:[Ua]},$$scope:{ctx:F}}}),Te=new De({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;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on
the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing the model weights saved
with <a href="/docs/diffusers/v0.18.2/en/api/models/overview#diffusers.ModelMixin.save_pretrained">ModelMixin.save_pretrained()</a>.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/loaders.py#L746"}}),Ee=new De({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 = False"}],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 UNet.`,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] or </code>Dict[str, torch.Tensor]<code>) -- State dict of the LoRA layers corresponding to the </code>text_encoder`. Must explicitly pass the text\nencoder LoRA state dict because it comes &#x1F917; Transformers.",name:"text_encoder_lora_layers"},{anchor:"diffusers.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/loaders.py#L1150"}}),Se=new De({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L458"}}),ke=new De({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L432"}}),{c(){g=n("meta"),U=c(),b=n("h1"),u=n("a"),x=n("span"),w(l.$$.fragment),v=c(),Ke=n("span"),uo=s("InstructPix2Pix: Learning to Follow Image Editing Instructions"),Wt=c(),j=n("h2"),A=n("a"),et=n("span"),w(oe.$$.fragment),mo=c(),tt=n("span"),ho=s("Overview"),Ct=c(),ne=n("p"),ie=n("a"),go=s("InstructPix2Pix: Learning to Follow Image Editing Instructions"),_o=s(" by Tim Brooks, Aleksander Holynski and Alexei A. Efros."),Nt=c(),$e=n("p"),bo=s("The abstract of the paper is the following:"),Lt=c(),je=n("p"),ot=n("em"),vo=s("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."),Bt=c(),Ze=n("p"),xo=s("Resources:"),Gt=c(),k=n("ul"),We=n("li"),ae=n("a"),wo=s("Project Page"),yo=s("."),Po=c(),Ce=n("li"),se=n("a"),Io=s("Paper"),Mo=s("."),To=c(),Ne=n("li"),re=n("a"),Uo=s("Original Code"),Eo=s("."),So=c(),Le=n("li"),le=n("a"),ko=s("Demo"),Jo=s("."),Ft=c(),Z=n("h2"),R=n("a"),nt=n("span"),w(de.$$.fragment),Do=c(),it=n("span"),$o=s("Available Pipelines:"),At=c(),X=n("table"),at=n("thead"),W=n("tr"),st=n("th"),jo=s("Pipeline"),Zo=c(),rt=n("th"),Wo=s("Tasks"),Co=c(),Be=n("th"),No=s("Demo"),Lo=c(),lt=n("tbody"),C=n("tr"),dt=n("td"),ce=n("a"),Bo=s("StableDiffusionInstructPix2PixPipeline"),Go=c(),ct=n("td"),pt=n("em"),Fo=s("Text-Based Image Editing"),Ao=c(),Ge=n("td"),pe=n("a"),Ro=s("\u{1F917} Space"),Rt=c(),N=n("h2"),q=n("a"),ft=n("span"),w(fe.$$.fragment),Xo=c(),ut=n("span"),qo=s("Usage example"),Xt=c(),w(ue.$$.fragment),qt=c(),L=n("h2"),Y=n("a"),mt=n("span"),w(me.$$.fragment),Yo=c(),ht=n("span"),Qo=s("StableDiffusionInstructPix2PixPipeline"),Yt=c(),m=n("div"),w(he.$$.fragment),Vo=c(),gt=n("p"),Ho=s("Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion."),zo=c(),ge=n("p"),Oo=s("This model inherits from "),Fe=n("a"),Ko=s("DiffusionPipeline"),en=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),tn=c(),_t=n("p"),on=s("In addition the pipeline inherits the following loading methods:"),nn=c(),_e=n("ul"),be=n("li"),bt=n("em"),an=s("Textual-Inversion"),sn=s(": "),Ae=n("a"),rn=s("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),ln=c(),ve=n("li"),vt=n("em"),dn=s("LoRA"),cn=s(": "),Re=n("a"),pn=s("loaders.LoraLoaderMixin.load_lora_weights()"),fn=c(),xt=n("p"),un=s("as well as the following saving methods:"),mn=c(),wt=n("ul"),xe=n("li"),yt=n("em"),hn=s("LoRA"),gn=s(": "),Xe=n("a"),_n=s("loaders.LoraLoaderMixin.save_lora_weights()"),bn=c(),D=n("div"),w(we.$$.fragment),vn=c(),Pt=n("p"),xn=s("Function invoked when calling the pipeline for generation."),wn=c(),w(Q.$$.fragment),yn=c(),E=n("div"),w(ye.$$.fragment),Pn=c(),Pe=n("p"),In=s("Load textual inversion embeddings into the text encoder of "),qe=n("a"),Mn=s("StableDiffusionPipeline"),Tn=s(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Un=c(),It=n("p"),En=s("Example:"),Sn=c(),w(V.$$.fragment),kn=c(),Ie=n("p"),Jn=s(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Me=n("a"),Dn=s("civitAI"),$n=s(") and then load the vector"),jn=c(),w(H.$$.fragment),Zn=c(),z=n("div"),w(Te.$$.fragment),Wn=c(),B=n("p"),Cn=s("Load pretrained LoRA attention processor layers into "),Ye=n("a"),Nn=s("UNet2DConditionModel"),Ln=s(` and
`),Ue=n("a"),Mt=n("code"),Bn=s("CLIPTextModel"),Gn=s("."),Fn=c(),O=n("div"),w(Ee.$$.fragment),An=c(),Tt=n("p"),Rn=s("Save the LoRA parameters corresponding to the UNet and text encoder."),Xn=c(),K=n("div"),w(Se.$$.fragment),qn=c(),S=n("p"),Yn=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ut=n("code"),Qn=s("enable_sequential_cpu_offload"),Vn=s(", this method moves one whole model at a time to the GPU when its "),Et=n("code"),Hn=s("forward"),zn=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),St=n("code"),On=s("enable_sequential_cpu_offload"),Kn=s(", but performance is much better due to the iterative execution of the "),kt=n("code"),ei=s("unet"),ti=s("."),oi=c(),ee=n("div"),w(ke.$$.fragment),ni=c(),G=n("p"),ii=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Jt=n("code"),ai=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),si=s("forward"),Dt=n("code"),ri=s("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),li=s("enable_model_cpu_offload`, but performance is lower."),this.h()},l(o){const f=Pa('[data-svelte="svelte-1phssyn"]',document.head);g=i(f,"META",{name:!0,content:!0}),f.forEach(t),U=p(o),b=i(o,"H1",{class:!0});var Je=a(b);u=i(Je,"A",{id:!0,class:!0,href:!0});var $t=a(u);x=i($t,"SPAN",{});var jt=a(x);y(l.$$.fragment,jt),jt.forEach(t),$t.forEach(t),v=p(Je),Ke=i(Je,"SPAN",{});var gi=a(Ke);uo=r(gi,"InstructPix2Pix: Learning to Follow Image Editing Instructions"),gi.forEach(t),Je.forEach(t),Wt=p(o),j=i(o,"H2",{class:!0});var Vt=a(j);A=i(Vt,"A",{id:!0,class:!0,href:!0});var _i=a(A);et=i(_i,"SPAN",{});var bi=a(et);y(oe.$$.fragment,bi),bi.forEach(t),_i.forEach(t),mo=p(Vt),tt=i(Vt,"SPAN",{});var vi=a(tt);ho=r(vi,"Overview"),vi.forEach(t),Vt.forEach(t),Ct=p(o),ne=i(o,"P",{});var di=a(ne);ie=i(di,"A",{href:!0,rel:!0});var xi=a(ie);go=r(xi,"InstructPix2Pix: Learning to Follow Image Editing Instructions"),xi.forEach(t),_o=r(di," by Tim Brooks, Aleksander Holynski and Alexei A. Efros."),di.forEach(t),Nt=p(o),$e=i(o,"P",{});var wi=a($e);bo=r(wi,"The abstract of the paper is the following:"),wi.forEach(t),Lt=p(o),je=i(o,"P",{});var yi=a(je);ot=i(yi,"EM",{});var Pi=a(ot);vo=r(Pi,"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."),Pi.forEach(t),yi.forEach(t),Bt=p(o),Ze=i(o,"P",{});var Ii=a(Ze);xo=r(Ii,"Resources:"),Ii.forEach(t),Gt=p(o),k=i(o,"UL",{});var te=a(k);We=i(te,"LI",{});var ci=a(We);ae=i(ci,"A",{href:!0,rel:!0});var Mi=a(ae);wo=r(Mi,"Project Page"),Mi.forEach(t),yo=r(ci,"."),ci.forEach(t),Po=p(te),Ce=i(te,"LI",{});var pi=a(Ce);se=i(pi,"A",{href:!0,rel:!0});var Ti=a(se);Io=r(Ti,"Paper"),Ti.forEach(t),Mo=r(pi,"."),pi.forEach(t),To=p(te),Ne=i(te,"LI",{});var fi=a(Ne);re=i(fi,"A",{href:!0,rel:!0});var Ui=a(re);Uo=r(Ui,"Original Code"),Ui.forEach(t),Eo=r(fi,"."),fi.forEach(t),So=p(te),Le=i(te,"LI",{});var ui=a(Le);le=i(ui,"A",{href:!0,rel:!0});var Ei=a(le);ko=r(Ei,"Demo"),Ei.forEach(t),Jo=r(ui,"."),ui.forEach(t),te.forEach(t),Ft=p(o),Z=i(o,"H2",{class:!0});var Ht=a(Z);R=i(Ht,"A",{id:!0,class:!0,href:!0});var Si=a(R);nt=i(Si,"SPAN",{});var ki=a(nt);y(de.$$.fragment,ki),ki.forEach(t),Si.forEach(t),Do=p(Ht),it=i(Ht,"SPAN",{});var Ji=a(it);$o=r(Ji,"Available Pipelines:"),Ji.forEach(t),Ht.forEach(t),At=p(o),X=i(o,"TABLE",{});var zt=a(X);at=i(zt,"THEAD",{});var Di=a(at);W=i(Di,"TR",{});var Qe=a(W);st=i(Qe,"TH",{});var $i=a(st);jo=r($i,"Pipeline"),$i.forEach(t),Zo=p(Qe),rt=i(Qe,"TH",{});var ji=a(rt);Wo=r(ji,"Tasks"),ji.forEach(t),Co=p(Qe),Be=i(Qe,"TH",{align:!0});var Zi=a(Be);No=r(Zi,"Demo"),Zi.forEach(t),Qe.forEach(t),Di.forEach(t),Lo=p(zt),lt=i(zt,"TBODY",{});var Wi=a(lt);C=i(Wi,"TR",{});var Ve=a(C);dt=i(Ve,"TD",{});var Ci=a(dt);ce=i(Ci,"A",{href:!0,rel:!0});var Ni=a(ce);Bo=r(Ni,"StableDiffusionInstructPix2PixPipeline"),Ni.forEach(t),Ci.forEach(t),Go=p(Ve),ct=i(Ve,"TD",{});var Li=a(ct);pt=i(Li,"EM",{});var Bi=a(pt);Fo=r(Bi,"Text-Based Image Editing"),Bi.forEach(t),Li.forEach(t),Ao=p(Ve),Ge=i(Ve,"TD",{align:!0});var Gi=a(Ge);pe=i(Gi,"A",{href:!0,rel:!0});var Fi=a(pe);Ro=r(Fi,"\u{1F917} Space"),Fi.forEach(t),Gi.forEach(t),Ve.forEach(t),Wi.forEach(t),zt.forEach(t),Rt=p(o),N=i(o,"H2",{class:!0});var Ot=a(N);q=i(Ot,"A",{id:!0,class:!0,href:!0});var Ai=a(q);ft=i(Ai,"SPAN",{});var Ri=a(ft);y(fe.$$.fragment,Ri),Ri.forEach(t),Ai.forEach(t),Xo=p(Ot),ut=i(Ot,"SPAN",{});var Xi=a(ut);qo=r(Xi,"Usage example"),Xi.forEach(t),Ot.forEach(t),Xt=p(o),y(ue.$$.fragment,o),qt=p(o),L=i(o,"H2",{class:!0});var Kt=a(L);Y=i(Kt,"A",{id:!0,class:!0,href:!0});var qi=a(Y);mt=i(qi,"SPAN",{});var Yi=a(mt);y(me.$$.fragment,Yi),Yi.forEach(t),qi.forEach(t),Yo=p(Kt),ht=i(Kt,"SPAN",{});var Qi=a(ht);Qo=r(Qi,"StableDiffusionInstructPix2PixPipeline"),Qi.forEach(t),Kt.forEach(t),Yt=p(o),m=i(o,"DIV",{class:!0});var _=a(m);y(he.$$.fragment,_),Vo=p(_),gt=i(_,"P",{});var Vi=a(gt);Ho=r(Vi,"Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion."),Vi.forEach(t),zo=p(_),ge=i(_,"P",{});var eo=a(ge);Oo=r(eo,"This model inherits from "),Fe=i(eo,"A",{href:!0});var Hi=a(Fe);Ko=r(Hi,"DiffusionPipeline"),Hi.forEach(t),en=r(eo,`. 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.)`),eo.forEach(t),tn=p(_),_t=i(_,"P",{});var zi=a(_t);on=r(zi,"In addition the pipeline inherits the following loading methods:"),zi.forEach(t),nn=p(_),_e=i(_,"UL",{});var to=a(_e);be=i(to,"LI",{});var oo=a(be);bt=i(oo,"EM",{});var Oi=a(bt);an=r(Oi,"Textual-Inversion"),Oi.forEach(t),sn=r(oo,": "),Ae=i(oo,"A",{href:!0});var Ki=a(Ae);rn=r(Ki,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Ki.forEach(t),oo.forEach(t),ln=p(to),ve=i(to,"LI",{});var no=a(ve);vt=i(no,"EM",{});var ea=a(vt);dn=r(ea,"LoRA"),ea.forEach(t),cn=r(no,": "),Re=i(no,"A",{href:!0});var ta=a(Re);pn=r(ta,"loaders.LoraLoaderMixin.load_lora_weights()"),ta.forEach(t),no.forEach(t),to.forEach(t),fn=p(_),xt=i(_,"P",{});var oa=a(xt);un=r(oa,"as well as the following saving methods:"),oa.forEach(t),mn=p(_),wt=i(_,"UL",{});var na=a(wt);xe=i(na,"LI",{});var io=a(xe);yt=i(io,"EM",{});var ia=a(yt);hn=r(ia,"LoRA"),ia.forEach(t),gn=r(io,": "),Xe=i(io,"A",{href:!0});var aa=a(Xe);_n=r(aa,"loaders.LoraLoaderMixin.save_lora_weights()"),aa.forEach(t),io.forEach(t),na.forEach(t),bn=p(_),D=i(_,"DIV",{class:!0});var He=a(D);y(we.$$.fragment,He),vn=p(He),Pt=i(He,"P",{});var sa=a(Pt);xn=r(sa,"Function invoked when calling the pipeline for generation."),sa.forEach(t),wn=p(He),y(Q.$$.fragment,He),He.forEach(t),yn=p(_),E=i(_,"DIV",{class:!0});var J=a(E);y(ye.$$.fragment,J),Pn=p(J),Pe=i(J,"P",{});var ao=a(Pe);In=r(ao,"Load textual inversion embeddings into the text encoder of "),qe=i(ao,"A",{href:!0});var ra=a(qe);Mn=r(ra,"StableDiffusionPipeline"),ra.forEach(t),Tn=r(ao,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),ao.forEach(t),Un=p(J),It=i(J,"P",{});var la=a(It);En=r(la,"Example:"),la.forEach(t),Sn=p(J),y(V.$$.fragment,J),kn=p(J),Ie=i(J,"P",{});var so=a(Ie);Jn=r(so,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Me=i(so,"A",{href:!0,rel:!0});var da=a(Me);Dn=r(da,"civitAI"),da.forEach(t),$n=r(so,") and then load the vector"),so.forEach(t),jn=p(J),y(H.$$.fragment,J),J.forEach(t),Zn=p(_),z=i(_,"DIV",{class:!0});var ro=a(z);y(Te.$$.fragment,ro),Wn=p(ro),B=i(ro,"P",{});var ze=a(B);Cn=r(ze,"Load pretrained LoRA attention processor layers into "),Ye=i(ze,"A",{href:!0});var ca=a(Ye);Nn=r(ca,"UNet2DConditionModel"),ca.forEach(t),Ln=r(ze,` and
`),Ue=i(ze,"A",{href:!0,rel:!0});var pa=a(Ue);Mt=i(pa,"CODE",{});var fa=a(Mt);Bn=r(fa,"CLIPTextModel"),fa.forEach(t),pa.forEach(t),Gn=r(ze,"."),ze.forEach(t),ro.forEach(t),Fn=p(_),O=i(_,"DIV",{class:!0});var lo=a(O);y(Ee.$$.fragment,lo),An=p(lo),Tt=i(lo,"P",{});var ua=a(Tt);Rn=r(ua,"Save the LoRA parameters corresponding to the UNet and text encoder."),ua.forEach(t),lo.forEach(t),Xn=p(_),K=i(_,"DIV",{class:!0});var co=a(K);y(Se.$$.fragment,co),qn=p(co),S=i(co,"P",{});var $=a(S);Yn=r($,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ut=i($,"CODE",{});var ma=a(Ut);Qn=r(ma,"enable_sequential_cpu_offload"),ma.forEach(t),Vn=r($,", this method moves one whole model at a time to the GPU when its "),Et=i($,"CODE",{});var ha=a(Et);Hn=r(ha,"forward"),ha.forEach(t),zn=r($,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),St=i($,"CODE",{});var ga=a(St);On=r(ga,"enable_sequential_cpu_offload"),ga.forEach(t),Kn=r($,", but performance is much better due to the iterative execution of the "),kt=i($,"CODE",{});var _a=a(kt);ei=r(_a,"unet"),_a.forEach(t),ti=r($,"."),$.forEach(t),co.forEach(t),oi=p(_),ee=i(_,"DIV",{class:!0});var po=a(ee);y(ke.$$.fragment,po),ni=p(po),G=i(po,"P",{});var Oe=a(G);ii=r(Oe,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Jt=i(Oe,"CODE",{});var ba=a(Jt);ai=r(ba,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),ba.forEach(t),si=r(Oe,"forward"),Dt=i(Oe,"CODE",{});var va=a(Dt);ri=r(va,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),va.forEach(t),li=r(Oe,"enable_model_cpu_offload`, but performance is lower."),Oe.forEach(t),po.forEach(t),_.forEach(t),this.h()},h(){d(g,"name","hf:doc:metadata"),d(g,"content",JSON.stringify(Sa)),d(u,"id","instructpix2pix-learning-to-follow-image-editing-instructions"),d(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"),d(u,"href","#instructpix2pix-learning-to-follow-image-editing-instructions"),d(b,"class","relative group"),d(A,"id","overview"),d(A,"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"),d(A,"href","#overview"),d(j,"class","relative group"),d(ie,"href","https://arxiv.org/abs/2211.09800"),d(ie,"rel","nofollow"),d(ae,"href","https://www.timothybrooks.com/instruct-pix2pix"),d(ae,"rel","nofollow"),d(se,"href","https://arxiv.org/abs/2211.09800"),d(se,"rel","nofollow"),d(re,"href","https://github.com/timothybrooks/instruct-pix2pix"),d(re,"rel","nofollow"),d(le,"href","https://huggingface.co/spaces/timbrooks/instruct-pix2pix"),d(le,"rel","nofollow"),d(R,"id","available-pipelines"),d(R,"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"),d(R,"href","#available-pipelines"),d(Z,"class","relative group"),d(Be,"align","center"),d(ce,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py"),d(ce,"rel","nofollow"),d(pe,"href","https://huggingface.co/spaces/timbrooks/instruct-pix2pix"),d(pe,"rel","nofollow"),d(Ge,"align","center"),d(q,"id","usage-example"),d(q,"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"),d(q,"href","#usage-example"),d(N,"class","relative group"),d(Y,"id","diffusers.StableDiffusionInstructPix2PixPipeline"),d(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Y,"href","#diffusers.StableDiffusionInstructPix2PixPipeline"),d(L,"class","relative group"),d(Fe,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),d(Ae,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),d(Re,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_lora_weights"),d(Xe,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.save_lora_weights"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),d(Me,"href","https://civitai.com/models/3036?modelVersionId=9857"),d(Me,"rel","nofollow"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ye,"href","/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel"),d(Ue,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),d(Ue,"rel","nofollow"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,f){e(document.head,g),h(o,U,f),h(o,b,f),e(b,u),e(u,x),P(l,x,null),e(b,v),e(b,Ke),e(Ke,uo),h(o,Wt,f),h(o,j,f),e(j,A),e(A,et),P(oe,et,null),e(j,mo),e(j,tt),e(tt,ho),h(o,Ct,f),h(o,ne,f),e(ne,ie),e(ie,go),e(ne,_o),h(o,Nt,f),h(o,$e,f),e($e,bo),h(o,Lt,f),h(o,je,f),e(je,ot),e(ot,vo),h(o,Bt,f),h(o,Ze,f),e(Ze,xo),h(o,Gt,f),h(o,k,f),e(k,We),e(We,ae),e(ae,wo),e(We,yo),e(k,Po),e(k,Ce),e(Ce,se),e(se,Io),e(Ce,Mo),e(k,To),e(k,Ne),e(Ne,re),e(re,Uo),e(Ne,Eo),e(k,So),e(k,Le),e(Le,le),e(le,ko),e(Le,Jo),h(o,Ft,f),h(o,Z,f),e(Z,R),e(R,nt),P(de,nt,null),e(Z,Do),e(Z,it),e(it,$o),h(o,At,f),h(o,X,f),e(X,at),e(at,W),e(W,st),e(st,jo),e(W,Zo),e(W,rt),e(rt,Wo),e(W,Co),e(W,Be),e(Be,No),e(X,Lo),e(X,lt),e(lt,C),e(C,dt),e(dt,ce),e(ce,Bo),e(C,Go),e(C,ct),e(ct,pt),e(pt,Fo),e(C,Ao),e(C,Ge),e(Ge,pe),e(pe,Ro),h(o,Rt,f),h(o,N,f),e(N,q),e(q,ft),P(fe,ft,null),e(N,Xo),e(N,ut),e(ut,qo),h(o,Xt,f),P(ue,o,f),h(o,qt,f),h(o,L,f),e(L,Y),e(Y,mt),P(me,mt,null),e(L,Yo),e(L,ht),e(ht,Qo),h(o,Yt,f),h(o,m,f),P(he,m,null),e(m,Vo),e(m,gt),e(gt,Ho),e(m,zo),e(m,ge),e(ge,Oo),e(ge,Fe),e(Fe,Ko),e(ge,en),e(m,tn),e(m,_t),e(_t,on),e(m,nn),e(m,_e),e(_e,be),e(be,bt),e(bt,an),e(be,sn),e(be,Ae),e(Ae,rn),e(_e,ln),e(_e,ve),e(ve,vt),e(vt,dn),e(ve,cn),e(ve,Re),e(Re,pn),e(m,fn),e(m,xt),e(xt,un),e(m,mn),e(m,wt),e(wt,xe),e(xe,yt),e(yt,hn),e(xe,gn),e(xe,Xe),e(Xe,_n),e(m,bn),e(m,D),P(we,D,null),e(D,vn),e(D,Pt),e(Pt,xn),e(D,wn),P(Q,D,null),e(m,yn),e(m,E),P(ye,E,null),e(E,Pn),e(E,Pe),e(Pe,In),e(Pe,qe),e(qe,Mn),e(Pe,Tn),e(E,Un),e(E,It),e(It,En),e(E,Sn),P(V,E,null),e(E,kn),e(E,Ie),e(Ie,Jn),e(Ie,Me),e(Me,Dn),e(Ie,$n),e(E,jn),P(H,E,null),e(m,Zn),e(m,z),P(Te,z,null),e(z,Wn),e(z,B),e(B,Cn),e(B,Ye),e(Ye,Nn),e(B,Ln),e(B,Ue),e(Ue,Mt),e(Mt,Bn),e(B,Gn),e(m,Fn),e(m,O),P(Ee,O,null),e(O,An),e(O,Tt),e(Tt,Rn),e(m,Xn),e(m,K),P(Se,K,null),e(K,qn),e(K,S),e(S,Yn),e(S,Ut),e(Ut,Qn),e(S,Vn),e(S,Et),e(Et,Hn),e(S,zn),e(S,St),e(St,On),e(S,Kn),e(S,kt),e(kt,ei),e(S,ti),e(m,oi),e(m,ee),P(ke,ee,null),e(ee,ni),e(ee,G),e(G,ii),e(G,Jt),e(Jt,ai),e(G,si),e(G,Dt),e(Dt,ri),e(G,li),Qt=!0},p(o,[f]){const Je={};f&2&&(Je.$$scope={dirty:f,ctx:o}),Q.$set(Je);const $t={};f&2&&($t.$$scope={dirty:f,ctx:o}),V.$set($t);const jt={};f&2&&(jt.$$scope={dirty:f,ctx:o}),H.$set(jt)},i(o){Qt||(I(l.$$.fragment,o),I(oe.$$.fragment,o),I(de.$$.fragment,o),I(fe.$$.fragment,o),I(ue.$$.fragment,o),I(me.$$.fragment,o),I(he.$$.fragment,o),I(we.$$.fragment,o),I(Q.$$.fragment,o),I(ye.$$.fragment,o),I(V.$$.fragment,o),I(H.$$.fragment,o),I(Te.$$.fragment,o),I(Ee.$$.fragment,o),I(Se.$$.fragment,o),I(ke.$$.fragment,o),Qt=!0)},o(o){M(l.$$.fragment,o),M(oe.$$.fragment,o),M(de.$$.fragment,o),M(fe.$$.fragment,o),M(ue.$$.fragment,o),M(me.$$.fragment,o),M(he.$$.fragment,o),M(we.$$.fragment,o),M(Q.$$.fragment,o),M(ye.$$.fragment,o),M(V.$$.fragment,o),M(H.$$.fragment,o),M(Te.$$.fragment,o),M(Ee.$$.fragment,o),M(Se.$$.fragment,o),M(ke.$$.fragment,o),Qt=!1},d(o){t(g),o&&t(U),o&&t(b),T(l),o&&t(Wt),o&&t(j),T(oe),o&&t(Ct),o&&t(ne),o&&t(Nt),o&&t($e),o&&t(Lt),o&&t(je),o&&t(Bt),o&&t(Ze),o&&t(Gt),o&&t(k),o&&t(Ft),o&&t(Z),T(de),o&&t(At),o&&t(X),o&&t(Rt),o&&t(N),T(fe),o&&t(Xt),T(ue,o),o&&t(qt),o&&t(L),T(me),o&&t(Yt),o&&t(m),T(he),T(we),T(Q),T(ye),T(V),T(H),T(Te),T(Ee),T(Se),T(ke)}}}const Sa={local:"instructpix2pix-learning-to-follow-image-editing-instructions",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"usage-example",title:"Usage example"},{local:"diffusers.StableDiffusionInstructPix2PixPipeline",title:"StableDiffusionInstructPix2PixPipeline"}],title:"InstructPix2Pix: Learning to Follow Image Editing Instructions"};function ka(F){return Ia(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wa extends xa{constructor(g){super();wa(this,g,ka,Ea,ya,{})}}export{Wa as default,Sa as metadata};
