import{S as Sa,i as Ta,s as qa,e as n,k as c,w as I,t as s,M as La,c as i,d as t,m as p,a,x as D,h as r,b as d,G as e,g as v,y as k,q as E,o as S,B as T,v as ja,L as Di}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as bo}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as Ue}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as xo}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Vt}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ii}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Aa(j){let l,x,f,g,w;return g=new xo({props:{code:`import PIL
import requests
import torch
from io import BytesIO

from diffusers import StableDiffusionInstructPix2PixPipeline


def download_image(url):
    response = requests.get(url)
    return PIL.Image.open(BytesIO(response.content)).convert("RGB")


img_url = "https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png"

image = download_image(img_url).resize((512, 512))

pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
    "timbrooks/instruct-pix2pix", torch_dtype=torch.float16
)
pipe = pipe.to("cuda")

prompt = "make the mountains snowy"
image = pipe(prompt=prompt, image=image).images[0]`,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(){l=n("p"),x=s("Examples:"),f=c(),I(g.$$.fragment)},l(u){l=i(u,"P",{});var b=a(l);x=r(b,"Examples:"),b.forEach(t),f=p(u),D(g.$$.fragment,u)},m(u,b){v(u,l,b),e(l,x),v(u,f,b),k(g,u,b),w=!0},p:Di,i(u){w||(E(g.$$.fragment,u),w=!0)},o(u){S(g.$$.fragment,u),w=!1},d(u){u&&t(l),u&&t(f),T(g,u)}}}function Ca(j){let l,x;return{c(){l=n("p"),x=s("This function is experimental and might change in the future.")},l(f){l=i(f,"P",{});var g=a(l);x=r(g,"This function is experimental and might change in the future."),g.forEach(t)},m(f,g){v(f,l,g),e(l,x)},d(f){f&&t(l)}}}function Ma(j){let l,x,f,g,w,u,b,$;return{c(){l=n("p"),x=s("It is required to be logged in ("),f=n("code"),g=s("huggingface-cli login"),w=s(") when you want to use private or "),u=n("a"),b=s(`gated
models`),$=s("."),this.h()},l(m){l=i(m,"P",{});var _=a(l);x=r(_,"It is required to be logged in ("),f=i(_,"CODE",{});var q=a(f);g=r(q,"huggingface-cli login"),q.forEach(t),w=r(_,") when you want to use private or "),u=i(_,"A",{href:!0,rel:!0});var C=a(u);b=r(C,`gated
models`),C.forEach(t),$=r(_,"."),_.forEach(t),this.h()},h(){d(u,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),d(u,"rel","nofollow")},m(m,_){v(m,l,_),e(l,x),e(l,f),e(f,g),e(l,w),e(l,u),e(u,b),e(l,$)},d(m){m&&t(l)}}}function Oa(j){let l,x,f,g,w,u,b,$;return b=new xo({props:{code:`from diffusers import StableDiffusionPipeline
import torch

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")

pipe.load_textual_inversion("sd-concepts-library/cat-toy")

prompt = "A <cat-toy> backpack"

image = pipe(prompt, num_inference_steps=50).images[0]
image.save("cat-backpack.png")`,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(){l=n("p"),x=s("To load a textual inversion embedding vector in "),f=n("code"),g=s("diffusers"),w=s(" format:"),u=c(),I(b.$$.fragment)},l(m){l=i(m,"P",{});var _=a(l);x=r(_,"To load a textual inversion embedding vector in "),f=i(_,"CODE",{});var q=a(f);g=r(q,"diffusers"),q.forEach(t),w=r(_," format:"),_.forEach(t),u=p(m),D(b.$$.fragment,m)},m(m,_){v(m,l,_),e(l,x),e(l,f),e(f,g),e(l,w),v(m,u,_),k(b,m,_),$=!0},p:Di,i(m){$||(E(b.$$.fragment,m),$=!0)},o(m){S(b.$$.fragment,m),$=!1},d(m){m&&t(l),m&&t(u),T(b,m)}}}function Na(j){let l,x,f,g,w,u,b,$;return b=new xo({props:{code:`from diffusers import StableDiffusionPipeline
import torch

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")

pipe.load_textual_inversion("./charturnerv2.pt", token="charturnerv2")

prompt = "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."

image = pipe(prompt, num_inference_steps=50).images[0]
image.save("character.png")`,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(){l=n("p"),x=s("e.g. from "),f=n("a"),g=s("civitAI"),w=s(" and then load the vector locally:"),u=c(),I(b.$$.fragment),this.h()},l(m){l=i(m,"P",{});var _=a(l);x=r(_,"e.g. from "),f=i(_,"A",{href:!0,rel:!0});var q=a(f);g=r(q,"civitAI"),q.forEach(t),w=r(_," and then load the vector locally:"),_.forEach(t),u=p(m),D(b.$$.fragment,m),this.h()},h(){d(f,"href","https://civitai.com/models/3036?modelVersionId=9857"),d(f,"rel","nofollow")},m(m,_){v(m,l,_),e(l,x),e(l,f),e(f,g),e(l,w),v(m,u,_),k(b,m,_),$=!0},p:Di,i(m){$||(E(b.$$.fragment,m),$=!0)},o(m){S(b.$$.fragment,m),$=!1},d(m){m&&t(l),m&&t(u),T(b,m)}}}function Ua(j){let l,x;return{c(){l=n("p"),x=s("This function is experimental and might change in the future.")},l(f){l=i(f,"P",{});var g=a(l);x=r(g,"This function is experimental and might change in the future."),g.forEach(t)},m(f,g){v(f,l,g),e(l,x)},d(f){f&&t(l)}}}function Fa(j){let l,x,f,g,w,u,b,$;return{c(){l=n("p"),x=s("It is required to be logged in ("),f=n("code"),g=s("huggingface-cli login"),w=s(") when you want to use private or "),u=n("a"),b=s(`gated
models`),$=s("."),this.h()},l(m){l=i(m,"P",{});var _=a(l);x=r(_,"It is required to be logged in ("),f=i(_,"CODE",{});var q=a(f);g=r(q,"huggingface-cli login"),q.forEach(t),w=r(_,") when you want to use private or "),u=i(_,"A",{href:!0,rel:!0});var C=a(u);b=r(C,`gated
models`),C.forEach(t),$=r(_,"."),_.forEach(t),this.h()},h(){d(u,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),d(u,"rel","nofollow")},m(m,_){v(m,l,_),e(l,x),e(l,f),e(f,g),e(l,w),e(l,u),e(u,b),e(l,$)},d(m){m&&t(l)}}}function Ba(j){let l,x,f,g,w,u,b,$,m,_,q,C,st,pe,Po,rt,wo,Kt,fe,ue,yo,$o,Jt,Fe,Io,Yt,Be,lt,Do,Qt,Ge,ko,Xt,O,Re,me,Eo,So,To,ze,he,qo,Lo,jo,We,ge,Ao,Co,Mo,He,_e,Oo,No,Zt,B,J,dt,ve,Uo,ct,Fo,eo,Y,pt,G,ft,Bo,Go,ut,Ro,zo,Ve,Wo,Ho,mt,R,ht,be,Vo,Ko,gt,_t,Jo,Yo,Ke,xe,Qo,to,z,Q,vt,Pe,Xo,bt,Zo,oo,we,no,W,X,xt,ye,en,Pt,tn,io,P,$e,on,wt,nn,an,Ie,sn,Je,rn,ln,dn,yt,cn,pn,De,ke,$t,fn,un,Ye,mn,hn,Ee,It,gn,_n,Qe,vn,bn,Dt,xn,Pn,kt,Se,Et,wn,yn,Xe,$n,In,U,Te,Dn,St,kn,En,Z,Sn,L,qe,Tn,H,qn,Tt,Ln,jn,qt,An,Cn,Mn,ee,On,te,Nn,Lt,Un,Fn,oe,Bn,jt,Gn,Rn,ne,zn,N,Le,Wn,V,Hn,Ze,Vn,Kn,je,At,Jn,Yn,Qn,ie,Xn,ae,Zn,se,Ae,ei,Ct,ti,oi,re,Ce,ni,M,ii,Mt,ai,si,Ot,ri,li,Nt,di,ci,Ut,pi,fi,ui,le,Me,mi,K,hi,Ft,gi,_i,Bt,vi,bi,ao;return u=new Vt({}),pe=new Vt({}),ve=new Vt({}),Pe=new Vt({}),we=new xo({props:{code:`import PIL
import requests
import torch
from diffusers import StableDiffusionInstructPix2PixPipeline

model_id = "timbrooks/instruct-pix2pix"
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")

url = "https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png"


def download_image(url):
    image = PIL.Image.open(requests.get(url, stream=True).raw)
    image = PIL.ImageOps.exif_transpose(image)
    image = image.convert("RGB")
    return image


image = download_image(url)

prompt = "make the mountains snowy"
images = pipe(prompt, image=image, num_inference_steps=20, image_guidance_scale=1.5, guidance_scale=7).images
images[0].save("snowy_mountains.png")`,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>)`}}),ye=new Vt({}),$e=new Ue({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.16.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.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.16.0/en/api/models#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.16.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.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.16.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.16.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 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.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L64"}}),Te=new Ue({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] = 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 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>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch which will be repainted according to <code>prompt</code>.`,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.16.0/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.16.0/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.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L141",returnDescription:`
<p><a
  href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Z=new Ii({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.__call__.example",$$slots:{default:[Aa]},$$scope:{ctx:j}}}),qe=new Ue({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"token",val:": typing.Optional[str] = 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>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{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 in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> format, but was saved under a specific weight
name, such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the &#x201C;Automatic1111&#x201D; form.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/loaders.py#L420"}}),ee=new bo({props:{warning:!0,$$slots:{default:[Ca]},$$scope:{ctx:j}}}),te=new bo({props:{$$slots:{default:[Ma]},$$scope:{ctx:j}}}),oe=new Ii({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.example",$$slots:{default:[Oa]},$$scope:{ctx:j}}}),ne=new Ii({props:{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_textual_inversion.example-2",$$slots:{default:[Na]},$$scope:{ctx:j}}}),Le=new Ue({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> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <code>~ModelMixin.save_config</code>, e.g.,
<code>./my_model_directory/</code>.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionInstructPix2PixPipeline.load_lora_weights.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/loaders.py#L678"}}),ie=new bo({props:{warning:!0,$$slots:{default:[Ua]},$$scope:{ctx:j}}}),ae=new bo({props:{$$slots:{default:[Fa]},$$scope:{ctx:j}}}),Ae=new Ue({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, torch.nn.modules.module.Module] = 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 which to save. 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>]) &#x2014;
State dict of the LoRA layers corresponding to the UNet. Specifying this helps to make the
serialization process easier and cleaner.`,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>]) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Since the <code>text_encoder</code> comes from
<code>transformers</code>, we cannot rejig it. That is why we have to explicitly pass the text encoder LoRA state
dict.`,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 when in distributed training like
TPUs and need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on
the main process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.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 on distributed training like TPUs when one
need to replace <code>torch.save</code> by another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/loaders.py#L1038"}}),Ce=new Ue({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.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L433"}}),Me=new Ue({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.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py#L407"}}),{c(){l=n("meta"),x=c(),f=n("h1"),g=n("a"),w=n("span"),I(u.$$.fragment),b=c(),$=n("span"),m=s("InstructPix2Pix: Learning to Follow Image Editing Instructions"),_=c(),q=n("h2"),C=n("a"),st=n("span"),I(pe.$$.fragment),Po=c(),rt=n("span"),wo=s("Overview"),Kt=c(),fe=n("p"),ue=n("a"),yo=s("InstructPix2Pix: Learning to Follow Image Editing Instructions"),$o=s(" by Tim Brooks, Aleksander Holynski and Alexei A. Efros."),Jt=c(),Fe=n("p"),Io=s("The abstract of the paper is the following:"),Yt=c(),Be=n("p"),lt=n("em"),Do=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."),Qt=c(),Ge=n("p"),ko=s("Resources:"),Xt=c(),O=n("ul"),Re=n("li"),me=n("a"),Eo=s("Project Page"),So=s("."),To=c(),ze=n("li"),he=n("a"),qo=s("Paper"),Lo=s("."),jo=c(),We=n("li"),ge=n("a"),Ao=s("Original Code"),Co=s("."),Mo=c(),He=n("li"),_e=n("a"),Oo=s("Demo"),No=s("."),Zt=c(),B=n("h2"),J=n("a"),dt=n("span"),I(ve.$$.fragment),Uo=c(),ct=n("span"),Fo=s("Available Pipelines:"),eo=c(),Y=n("table"),pt=n("thead"),G=n("tr"),ft=n("th"),Bo=s("Pipeline"),Go=c(),ut=n("th"),Ro=s("Tasks"),zo=c(),Ve=n("th"),Wo=s("Demo"),Ho=c(),mt=n("tbody"),R=n("tr"),ht=n("td"),be=n("a"),Vo=s("StableDiffusionInstructPix2PixPipeline"),Ko=c(),gt=n("td"),_t=n("em"),Jo=s("Text-Based Image Editing"),Yo=c(),Ke=n("td"),xe=n("a"),Qo=s("\u{1F917} Space"),to=c(),z=n("h2"),Q=n("a"),vt=n("span"),I(Pe.$$.fragment),Xo=c(),bt=n("span"),Zo=s("Usage example"),oo=c(),I(we.$$.fragment),no=c(),W=n("h2"),X=n("a"),xt=n("span"),I(ye.$$.fragment),en=c(),Pt=n("span"),tn=s("StableDiffusionInstructPix2PixPipeline"),io=c(),P=n("div"),I($e.$$.fragment),on=c(),wt=n("p"),nn=s("Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion."),an=c(),Ie=n("p"),sn=s("This model inherits from "),Je=n("a"),rn=s("DiffusionPipeline"),ln=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.)`),dn=c(),yt=n("p"),cn=s("In addition the pipeline inherits the following loading methods:"),pn=c(),De=n("ul"),ke=n("li"),$t=n("em"),fn=s("Textual-Inversion"),un=s(": "),Ye=n("a"),mn=s("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),hn=c(),Ee=n("li"),It=n("em"),gn=s("LoRA"),_n=s(": "),Qe=n("a"),vn=s("loaders.LoraLoaderMixin.load_lora_weights()"),bn=c(),Dt=n("p"),xn=s("as well as the following saving methods:"),Pn=c(),kt=n("ul"),Se=n("li"),Et=n("em"),wn=s("LoRA"),yn=s(": "),Xe=n("a"),$n=s("loaders.LoraLoaderMixin.save_lora_weights()"),In=c(),U=n("div"),I(Te.$$.fragment),Dn=c(),St=n("p"),kn=s("Function invoked when calling the pipeline for generation."),En=c(),I(Z.$$.fragment),Sn=c(),L=n("div"),I(qe.$$.fragment),Tn=c(),H=n("p"),qn=s("Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Tt=n("code"),Ln=s("diffusers"),jn=s(` and
`),qt=n("code"),An=s("Automatic1111"),Cn=s(" formats are supported (see example below)."),Mn=c(),I(ee.$$.fragment),On=c(),I(te.$$.fragment),Nn=c(),Lt=n("p"),Un=s("Example:"),Fn=c(),I(oe.$$.fragment),Bn=c(),jt=n("p"),Gn=s("To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),Rn=c(),I(ne.$$.fragment),zn=c(),N=n("div"),I(Le.$$.fragment),Wn=c(),V=n("p"),Hn=s("Load pretrained attention processor layers (such as LoRA) into "),Ze=n("a"),Vn=s("UNet2DConditionModel"),Kn=s(` and
`),je=n("a"),At=n("code"),Jn=s("CLIPTextModel"),Yn=s(")."),Qn=c(),I(ie.$$.fragment),Xn=c(),I(ae.$$.fragment),Zn=c(),se=n("div"),I(Ae.$$.fragment),ei=c(),Ct=n("p"),ti=s("Save the LoRA parameters corresponding to the UNet and the text encoder."),oi=c(),re=n("div"),I(Ce.$$.fragment),ni=c(),M=n("p"),ii=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Mt=n("code"),ai=s("enable_sequential_cpu_offload"),si=s(", this method moves one whole model at a time to the GPU when its "),Ot=n("code"),ri=s("forward"),li=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Nt=n("code"),di=s("enable_sequential_cpu_offload"),ci=s(", but performance is much better due to the iterative execution of the "),Ut=n("code"),pi=s("unet"),fi=s("."),ui=c(),le=n("div"),I(Me.$$.fragment),mi=c(),K=n("p"),hi=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
`),Ft=n("code"),gi=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),_i=s("forward"),Bt=n("code"),vi=s("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),bi=s("enable_model_cpu_offload`, but performance is lower."),this.h()},l(o){const h=La('[data-svelte="svelte-1phssyn"]',document.head);l=i(h,"META",{name:!0,content:!0}),h.forEach(t),x=p(o),f=i(o,"H1",{class:!0});var Oe=a(f);g=i(Oe,"A",{id:!0,class:!0,href:!0});var Gt=a(g);w=i(Gt,"SPAN",{});var Rt=a(w);D(u.$$.fragment,Rt),Rt.forEach(t),Gt.forEach(t),b=p(Oe),$=i(Oe,"SPAN",{});var zt=a($);m=r(zt,"InstructPix2Pix: Learning to Follow Image Editing Instructions"),zt.forEach(t),Oe.forEach(t),_=p(o),q=i(o,"H2",{class:!0});var Ne=a(q);C=i(Ne,"A",{id:!0,class:!0,href:!0});var Wt=a(C);st=i(Wt,"SPAN",{});var Ht=a(st);D(pe.$$.fragment,Ht),Ht.forEach(t),Wt.forEach(t),Po=p(Ne),rt=i(Ne,"SPAN",{});var ki=a(rt);wo=r(ki,"Overview"),ki.forEach(t),Ne.forEach(t),Kt=p(o),fe=i(o,"P",{});var xi=a(fe);ue=i(xi,"A",{href:!0,rel:!0});var Ei=a(ue);yo=r(Ei,"InstructPix2Pix: Learning to Follow Image Editing Instructions"),Ei.forEach(t),$o=r(xi," by Tim Brooks, Aleksander Holynski and Alexei A. Efros."),xi.forEach(t),Jt=p(o),Fe=i(o,"P",{});var Si=a(Fe);Io=r(Si,"The abstract of the paper is the following:"),Si.forEach(t),Yt=p(o),Be=i(o,"P",{});var Ti=a(Be);lt=i(Ti,"EM",{});var qi=a(lt);Do=r(qi,"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."),qi.forEach(t),Ti.forEach(t),Qt=p(o),Ge=i(o,"P",{});var Li=a(Ge);ko=r(Li,"Resources:"),Li.forEach(t),Xt=p(o),O=i(o,"UL",{});var de=a(O);Re=i(de,"LI",{});var Pi=a(Re);me=i(Pi,"A",{href:!0,rel:!0});var ji=a(me);Eo=r(ji,"Project Page"),ji.forEach(t),So=r(Pi,"."),Pi.forEach(t),To=p(de),ze=i(de,"LI",{});var wi=a(ze);he=i(wi,"A",{href:!0,rel:!0});var Ai=a(he);qo=r(Ai,"Paper"),Ai.forEach(t),Lo=r(wi,"."),wi.forEach(t),jo=p(de),We=i(de,"LI",{});var yi=a(We);ge=i(yi,"A",{href:!0,rel:!0});var Ci=a(ge);Ao=r(Ci,"Original Code"),Ci.forEach(t),Co=r(yi,"."),yi.forEach(t),Mo=p(de),He=i(de,"LI",{});var $i=a(He);_e=i($i,"A",{href:!0,rel:!0});var Mi=a(_e);Oo=r(Mi,"Demo"),Mi.forEach(t),No=r($i,"."),$i.forEach(t),de.forEach(t),Zt=p(o),B=i(o,"H2",{class:!0});var so=a(B);J=i(so,"A",{id:!0,class:!0,href:!0});var Oi=a(J);dt=i(Oi,"SPAN",{});var Ni=a(dt);D(ve.$$.fragment,Ni),Ni.forEach(t),Oi.forEach(t),Uo=p(so),ct=i(so,"SPAN",{});var Ui=a(ct);Fo=r(Ui,"Available Pipelines:"),Ui.forEach(t),so.forEach(t),eo=p(o),Y=i(o,"TABLE",{});var ro=a(Y);pt=i(ro,"THEAD",{});var Fi=a(pt);G=i(Fi,"TR",{});var et=a(G);ft=i(et,"TH",{});var Bi=a(ft);Bo=r(Bi,"Pipeline"),Bi.forEach(t),Go=p(et),ut=i(et,"TH",{});var Gi=a(ut);Ro=r(Gi,"Tasks"),Gi.forEach(t),zo=p(et),Ve=i(et,"TH",{align:!0});var Ri=a(Ve);Wo=r(Ri,"Demo"),Ri.forEach(t),et.forEach(t),Fi.forEach(t),Ho=p(ro),mt=i(ro,"TBODY",{});var zi=a(mt);R=i(zi,"TR",{});var tt=a(R);ht=i(tt,"TD",{});var Wi=a(ht);be=i(Wi,"A",{href:!0,rel:!0});var Hi=a(be);Vo=r(Hi,"StableDiffusionInstructPix2PixPipeline"),Hi.forEach(t),Wi.forEach(t),Ko=p(tt),gt=i(tt,"TD",{});var Vi=a(gt);_t=i(Vi,"EM",{});var Ki=a(_t);Jo=r(Ki,"Text-Based Image Editing"),Ki.forEach(t),Vi.forEach(t),Yo=p(tt),Ke=i(tt,"TD",{align:!0});var Ji=a(Ke);xe=i(Ji,"A",{href:!0,rel:!0});var Yi=a(xe);Qo=r(Yi,"\u{1F917} Space"),Yi.forEach(t),Ji.forEach(t),tt.forEach(t),zi.forEach(t),ro.forEach(t),to=p(o),z=i(o,"H2",{class:!0});var lo=a(z);Q=i(lo,"A",{id:!0,class:!0,href:!0});var Qi=a(Q);vt=i(Qi,"SPAN",{});var Xi=a(vt);D(Pe.$$.fragment,Xi),Xi.forEach(t),Qi.forEach(t),Xo=p(lo),bt=i(lo,"SPAN",{});var Zi=a(bt);Zo=r(Zi,"Usage example"),Zi.forEach(t),lo.forEach(t),oo=p(o),D(we.$$.fragment,o),no=p(o),W=i(o,"H2",{class:!0});var co=a(W);X=i(co,"A",{id:!0,class:!0,href:!0});var ea=a(X);xt=i(ea,"SPAN",{});var ta=a(xt);D(ye.$$.fragment,ta),ta.forEach(t),ea.forEach(t),en=p(co),Pt=i(co,"SPAN",{});var oa=a(Pt);tn=r(oa,"StableDiffusionInstructPix2PixPipeline"),oa.forEach(t),co.forEach(t),io=p(o),P=i(o,"DIV",{class:!0});var y=a(P);D($e.$$.fragment,y),on=p(y),wt=i(y,"P",{});var na=a(wt);nn=r(na,"Pipeline for pixel-level image editing by following text instructions. Based on Stable Diffusion."),na.forEach(t),an=p(y),Ie=i(y,"P",{});var po=a(Ie);sn=r(po,"This model inherits from "),Je=i(po,"A",{href:!0});var ia=a(Je);rn=r(ia,"DiffusionPipeline"),ia.forEach(t),ln=r(po,`. 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.)`),po.forEach(t),dn=p(y),yt=i(y,"P",{});var aa=a(yt);cn=r(aa,"In addition the pipeline inherits the following loading methods:"),aa.forEach(t),pn=p(y),De=i(y,"UL",{});var fo=a(De);ke=i(fo,"LI",{});var uo=a(ke);$t=i(uo,"EM",{});var sa=a($t);fn=r(sa,"Textual-Inversion"),sa.forEach(t),un=r(uo,": "),Ye=i(uo,"A",{href:!0});var ra=a(Ye);mn=r(ra,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),ra.forEach(t),uo.forEach(t),hn=p(fo),Ee=i(fo,"LI",{});var mo=a(Ee);It=i(mo,"EM",{});var la=a(It);gn=r(la,"LoRA"),la.forEach(t),_n=r(mo,": "),Qe=i(mo,"A",{href:!0});var da=a(Qe);vn=r(da,"loaders.LoraLoaderMixin.load_lora_weights()"),da.forEach(t),mo.forEach(t),fo.forEach(t),bn=p(y),Dt=i(y,"P",{});var ca=a(Dt);xn=r(ca,"as well as the following saving methods:"),ca.forEach(t),Pn=p(y),kt=i(y,"UL",{});var pa=a(kt);Se=i(pa,"LI",{});var ho=a(Se);Et=i(ho,"EM",{});var fa=a(Et);wn=r(fa,"LoRA"),fa.forEach(t),yn=r(ho,": "),Xe=i(ho,"A",{href:!0});var ua=a(Xe);$n=r(ua,"loaders.LoraLoaderMixin.save_lora_weights()"),ua.forEach(t),ho.forEach(t),pa.forEach(t),In=p(y),U=i(y,"DIV",{class:!0});var ot=a(U);D(Te.$$.fragment,ot),Dn=p(ot),St=i(ot,"P",{});var ma=a(St);kn=r(ma,"Function invoked when calling the pipeline for generation."),ma.forEach(t),En=p(ot),D(Z.$$.fragment,ot),ot.forEach(t),Sn=p(y),L=i(y,"DIV",{class:!0});var A=a(L);D(qe.$$.fragment,A),Tn=p(A),H=i(A,"P",{});var nt=a(H);qn=r(nt,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Tt=i(nt,"CODE",{});var ha=a(Tt);Ln=r(ha,"diffusers"),ha.forEach(t),jn=r(nt,` and
`),qt=i(nt,"CODE",{});var ga=a(qt);An=r(ga,"Automatic1111"),ga.forEach(t),Cn=r(nt," formats are supported (see example below)."),nt.forEach(t),Mn=p(A),D(ee.$$.fragment,A),On=p(A),D(te.$$.fragment,A),Nn=p(A),Lt=i(A,"P",{});var _a=a(Lt);Un=r(_a,"Example:"),_a.forEach(t),Fn=p(A),D(oe.$$.fragment,A),Bn=p(A),jt=i(A,"P",{});var va=a(jt);Gn=r(va,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),va.forEach(t),Rn=p(A),D(ne.$$.fragment,A),A.forEach(t),zn=p(y),N=i(y,"DIV",{class:!0});var ce=a(N);D(Le.$$.fragment,ce),Wn=p(ce),V=i(ce,"P",{});var it=a(V);Hn=r(it,"Load pretrained attention processor layers (such as LoRA) into "),Ze=i(it,"A",{href:!0});var ba=a(Ze);Vn=r(ba,"UNet2DConditionModel"),ba.forEach(t),Kn=r(it,` and
`),je=i(it,"A",{href:!0,rel:!0});var xa=a(je);At=i(xa,"CODE",{});var Pa=a(At);Jn=r(Pa,"CLIPTextModel"),Pa.forEach(t),xa.forEach(t),Yn=r(it,")."),it.forEach(t),Qn=p(ce),D(ie.$$.fragment,ce),Xn=p(ce),D(ae.$$.fragment,ce),ce.forEach(t),Zn=p(y),se=i(y,"DIV",{class:!0});var go=a(se);D(Ae.$$.fragment,go),ei=p(go),Ct=i(go,"P",{});var wa=a(Ct);ti=r(wa,"Save the LoRA parameters corresponding to the UNet and the text encoder."),wa.forEach(t),go.forEach(t),oi=p(y),re=i(y,"DIV",{class:!0});var _o=a(re);D(Ce.$$.fragment,_o),ni=p(_o),M=i(_o,"P",{});var F=a(M);ii=r(F,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Mt=i(F,"CODE",{});var ya=a(Mt);ai=r(ya,"enable_sequential_cpu_offload"),ya.forEach(t),si=r(F,", this method moves one whole model at a time to the GPU when its "),Ot=i(F,"CODE",{});var $a=a(Ot);ri=r($a,"forward"),$a.forEach(t),li=r(F,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Nt=i(F,"CODE",{});var Ia=a(Nt);di=r(Ia,"enable_sequential_cpu_offload"),Ia.forEach(t),ci=r(F,", but performance is much better due to the iterative execution of the "),Ut=i(F,"CODE",{});var Da=a(Ut);pi=r(Da,"unet"),Da.forEach(t),fi=r(F,"."),F.forEach(t),_o.forEach(t),ui=p(y),le=i(y,"DIV",{class:!0});var vo=a(le);D(Me.$$.fragment,vo),mi=p(vo),K=i(vo,"P",{});var at=a(K);hi=r(at,`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
`),Ft=i(at,"CODE",{});var ka=a(Ft);gi=r(ka,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),ka.forEach(t),_i=r(at,"forward"),Bt=i(at,"CODE",{});var Ea=a(Bt);vi=r(Ea,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Ea.forEach(t),bi=r(at,"enable_model_cpu_offload`, but performance is lower."),at.forEach(t),vo.forEach(t),y.forEach(t),this.h()},h(){d(l,"name","hf:doc:metadata"),d(l,"content",JSON.stringify(Ga)),d(g,"id","instructpix2pix-learning-to-follow-image-editing-instructions"),d(g,"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(g,"href","#instructpix2pix-learning-to-follow-image-editing-instructions"),d(f,"class","relative group"),d(C,"id","overview"),d(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(C,"href","#overview"),d(q,"class","relative group"),d(ue,"href","https://arxiv.org/abs/2211.09800"),d(ue,"rel","nofollow"),d(me,"href","https://www.timothybrooks.com/instruct-pix2pix"),d(me,"rel","nofollow"),d(he,"href","https://arxiv.org/abs/2211.09800"),d(he,"rel","nofollow"),d(ge,"href","https://github.com/timothybrooks/instruct-pix2pix"),d(ge,"rel","nofollow"),d(_e,"href","https://huggingface.co/spaces/timbrooks/instruct-pix2pix"),d(_e,"rel","nofollow"),d(J,"id","available-pipelines"),d(J,"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(J,"href","#available-pipelines"),d(B,"class","relative group"),d(Ve,"align","center"),d(be,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py"),d(be,"rel","nofollow"),d(xe,"href","https://huggingface.co/spaces/timbrooks/instruct-pix2pix"),d(xe,"rel","nofollow"),d(Ke,"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(z,"class","relative group"),d(X,"id","diffusers.StableDiffusionInstructPix2PixPipeline"),d(X,"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(X,"href","#diffusers.StableDiffusionInstructPix2PixPipeline"),d(W,"class","relative group"),d(Je,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),d(Ye,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),d(Qe,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),d(Xe,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.UNet2DConditionModel"),d(je,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),d(je,"rel","nofollow"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"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,h){e(document.head,l),v(o,x,h),v(o,f,h),e(f,g),e(g,w),k(u,w,null),e(f,b),e(f,$),e($,m),v(o,_,h),v(o,q,h),e(q,C),e(C,st),k(pe,st,null),e(q,Po),e(q,rt),e(rt,wo),v(o,Kt,h),v(o,fe,h),e(fe,ue),e(ue,yo),e(fe,$o),v(o,Jt,h),v(o,Fe,h),e(Fe,Io),v(o,Yt,h),v(o,Be,h),e(Be,lt),e(lt,Do),v(o,Qt,h),v(o,Ge,h),e(Ge,ko),v(o,Xt,h),v(o,O,h),e(O,Re),e(Re,me),e(me,Eo),e(Re,So),e(O,To),e(O,ze),e(ze,he),e(he,qo),e(ze,Lo),e(O,jo),e(O,We),e(We,ge),e(ge,Ao),e(We,Co),e(O,Mo),e(O,He),e(He,_e),e(_e,Oo),e(He,No),v(o,Zt,h),v(o,B,h),e(B,J),e(J,dt),k(ve,dt,null),e(B,Uo),e(B,ct),e(ct,Fo),v(o,eo,h),v(o,Y,h),e(Y,pt),e(pt,G),e(G,ft),e(ft,Bo),e(G,Go),e(G,ut),e(ut,Ro),e(G,zo),e(G,Ve),e(Ve,Wo),e(Y,Ho),e(Y,mt),e(mt,R),e(R,ht),e(ht,be),e(be,Vo),e(R,Ko),e(R,gt),e(gt,_t),e(_t,Jo),e(R,Yo),e(R,Ke),e(Ke,xe),e(xe,Qo),v(o,to,h),v(o,z,h),e(z,Q),e(Q,vt),k(Pe,vt,null),e(z,Xo),e(z,bt),e(bt,Zo),v(o,oo,h),k(we,o,h),v(o,no,h),v(o,W,h),e(W,X),e(X,xt),k(ye,xt,null),e(W,en),e(W,Pt),e(Pt,tn),v(o,io,h),v(o,P,h),k($e,P,null),e(P,on),e(P,wt),e(wt,nn),e(P,an),e(P,Ie),e(Ie,sn),e(Ie,Je),e(Je,rn),e(Ie,ln),e(P,dn),e(P,yt),e(yt,cn),e(P,pn),e(P,De),e(De,ke),e(ke,$t),e($t,fn),e(ke,un),e(ke,Ye),e(Ye,mn),e(De,hn),e(De,Ee),e(Ee,It),e(It,gn),e(Ee,_n),e(Ee,Qe),e(Qe,vn),e(P,bn),e(P,Dt),e(Dt,xn),e(P,Pn),e(P,kt),e(kt,Se),e(Se,Et),e(Et,wn),e(Se,yn),e(Se,Xe),e(Xe,$n),e(P,In),e(P,U),k(Te,U,null),e(U,Dn),e(U,St),e(St,kn),e(U,En),k(Z,U,null),e(P,Sn),e(P,L),k(qe,L,null),e(L,Tn),e(L,H),e(H,qn),e(H,Tt),e(Tt,Ln),e(H,jn),e(H,qt),e(qt,An),e(H,Cn),e(L,Mn),k(ee,L,null),e(L,On),k(te,L,null),e(L,Nn),e(L,Lt),e(Lt,Un),e(L,Fn),k(oe,L,null),e(L,Bn),e(L,jt),e(jt,Gn),e(L,Rn),k(ne,L,null),e(P,zn),e(P,N),k(Le,N,null),e(N,Wn),e(N,V),e(V,Hn),e(V,Ze),e(Ze,Vn),e(V,Kn),e(V,je),e(je,At),e(At,Jn),e(V,Yn),e(N,Qn),k(ie,N,null),e(N,Xn),k(ae,N,null),e(P,Zn),e(P,se),k(Ae,se,null),e(se,ei),e(se,Ct),e(Ct,ti),e(P,oi),e(P,re),k(Ce,re,null),e(re,ni),e(re,M),e(M,ii),e(M,Mt),e(Mt,ai),e(M,si),e(M,Ot),e(Ot,ri),e(M,li),e(M,Nt),e(Nt,di),e(M,ci),e(M,Ut),e(Ut,pi),e(M,fi),e(P,ui),e(P,le),k(Me,le,null),e(le,mi),e(le,K),e(K,hi),e(K,Ft),e(Ft,gi),e(K,_i),e(K,Bt),e(Bt,vi),e(K,bi),ao=!0},p(o,[h]){const Oe={};h&2&&(Oe.$$scope={dirty:h,ctx:o}),Z.$set(Oe);const Gt={};h&2&&(Gt.$$scope={dirty:h,ctx:o}),ee.$set(Gt);const Rt={};h&2&&(Rt.$$scope={dirty:h,ctx:o}),te.$set(Rt);const zt={};h&2&&(zt.$$scope={dirty:h,ctx:o}),oe.$set(zt);const Ne={};h&2&&(Ne.$$scope={dirty:h,ctx:o}),ne.$set(Ne);const Wt={};h&2&&(Wt.$$scope={dirty:h,ctx:o}),ie.$set(Wt);const Ht={};h&2&&(Ht.$$scope={dirty:h,ctx:o}),ae.$set(Ht)},i(o){ao||(E(u.$$.fragment,o),E(pe.$$.fragment,o),E(ve.$$.fragment,o),E(Pe.$$.fragment,o),E(we.$$.fragment,o),E(ye.$$.fragment,o),E($e.$$.fragment,o),E(Te.$$.fragment,o),E(Z.$$.fragment,o),E(qe.$$.fragment,o),E(ee.$$.fragment,o),E(te.$$.fragment,o),E(oe.$$.fragment,o),E(ne.$$.fragment,o),E(Le.$$.fragment,o),E(ie.$$.fragment,o),E(ae.$$.fragment,o),E(Ae.$$.fragment,o),E(Ce.$$.fragment,o),E(Me.$$.fragment,o),ao=!0)},o(o){S(u.$$.fragment,o),S(pe.$$.fragment,o),S(ve.$$.fragment,o),S(Pe.$$.fragment,o),S(we.$$.fragment,o),S(ye.$$.fragment,o),S($e.$$.fragment,o),S(Te.$$.fragment,o),S(Z.$$.fragment,o),S(qe.$$.fragment,o),S(ee.$$.fragment,o),S(te.$$.fragment,o),S(oe.$$.fragment,o),S(ne.$$.fragment,o),S(Le.$$.fragment,o),S(ie.$$.fragment,o),S(ae.$$.fragment,o),S(Ae.$$.fragment,o),S(Ce.$$.fragment,o),S(Me.$$.fragment,o),ao=!1},d(o){t(l),o&&t(x),o&&t(f),T(u),o&&t(_),o&&t(q),T(pe),o&&t(Kt),o&&t(fe),o&&t(Jt),o&&t(Fe),o&&t(Yt),o&&t(Be),o&&t(Qt),o&&t(Ge),o&&t(Xt),o&&t(O),o&&t(Zt),o&&t(B),T(ve),o&&t(eo),o&&t(Y),o&&t(to),o&&t(z),T(Pe),o&&t(oo),T(we,o),o&&t(no),o&&t(W),T(ye),o&&t(io),o&&t(P),T($e),T(Te),T(Z),T(qe),T(ee),T(te),T(oe),T(ne),T(Le),T(ie),T(ae),T(Ae),T(Ce),T(Me)}}}const Ga={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 Ra(j){return ja(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ya extends Sa{constructor(l){super();Ta(this,l,Ra,Ba,qa,{})}}export{Ya as default,Ga as metadata};
