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runwayml/stable-diffusion-v1-5")
pipe = pipe.to("cuda")

prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]

image.save("astronaut_rides_horse.png")`,highlighted:`<span class="hljs-comment"># make sure you&#x27;re logged in with \`huggingface-cli login\`</span>
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, LMSDiscreteScheduler

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

prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
image = pipe(prompt).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;astronaut_rides_horse.png&quot;</span>)`}}),Sa=new ke({}),ka=new tg({props:{code:`import requests
from PIL import Image
from io import BytesIO

from diffusers import StableDiffusionImg2ImgPipeline

# load the pipeline
device = "cuda"
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to(
    device
)

# let's download an initial image
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"

response = requests.get(url)
init_image = Image.open(BytesIO(response.content)).convert("RGB")
init_image = init_image.resize((768, 512))

prompt = "A fantasy landscape, trending on artstation"

images = pipe(prompt=prompt, image=init_image, strength=0.75, guidance_scale=7.5).images

images[0].save("fantasy_landscape.png")`,highlighted:`<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionImg2ImgPipeline

<span class="hljs-comment"># load the pipeline</span>
device = <span class="hljs-string">&quot;cuda&quot;</span>
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, torch_dtype=torch.float16).to(
    device
)

<span class="hljs-comment"># let&#x27;s download an initial image</span>
url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>

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

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

images = pipe(prompt=prompt, image=init_image, strength=<span class="hljs-number">0.75</span>, guidance_scale=<span class="hljs-number">7.5</span>).images

images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_landscape.png&quot;</span>)`}}),$a=new ke({}),Ra=new ke({}),Ca=new tg({props:{code:`import PIL
import requests
import torch
from io import BytesIO

from diffusers import StableDiffusionInpaintPipeline


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


img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"

init_image = download_image(img_url).resize((512, 512))
mask_image = download_image(mask_url).resize((512, 512))

pipe = StableDiffusionInpaintPipeline.from_pretrained(
    "runwayml/stable-diffusion-inpainting",
    torch_dtype=torch.float16,
)
pipe = pipe.to("cuda")

prompt = "Face of a yellow cat, high resolution, sitting on a park bench"
image = pipe(prompt=prompt, image=init_image, mask_image=mask_image).images[0]`,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> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionInpaintPipeline


<span class="hljs-keyword">def</span> <span class="hljs-title function_">download_image</span>(<span class="hljs-params">url</span>):
    response = requests.get(url)
    <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>)


img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

init_image = download_image(img_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))
mask_image = download_image(mask_url).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

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

prompt = <span class="hljs-string">&quot;Face of a yellow cat, high resolution, sitting on a park bench&quot;</span>
image = pipe(prompt=prompt, image=init_image, mask_image=mask_image).images[<span class="hljs-number">0</span>]`}}),{c(){_e=a("meta"),ji=f(),ve=a("h1"),Pe=a("a"),Tr=a("span"),P(Tt.$$.fragment),Ls=f(),Dr=a("span"),Ns=l("Pipelines"),Li=f(),Ba=a("p"),qs=l(`Pipelines provide a simple way to run state-of-the-art diffusion models in inference.
Most diffusion systems consist of multiple independently-trained models and highly adaptable scheduler
components - all of which are needed to have a functioning end-to-end diffusion system.`),Ni=f(),Ge=a("p"),Hs=l("As an example, "),Dt=a("a"),Us=l("Stable Diffusion"),Bs=l(" has three independently trained models:"),qi=f(),E=a("ul"),Ir=a("li"),Va=a("a"),Vs=l("Autoencoder"),Ys=f(),xr=a("li"),Ya=a("a"),zs=l("Conditional Unet"),Fs=f(),Ar=a("li"),It=a("a"),Qs=l("CLIP text encoder"),Ws=f(),xt=a("li"),Js=l("a scheduler component, "),za=a("a"),Ks=l("scheduler"),Xs=l(","),Zs=f(),At=a("li"),ef=l("a "),St=a("a"),tf=l("CLIPFeatureExtractor"),af=l(","),of=f(),kt=a("li"),rf=l("as well as a "),Fa=a("a"),lf=l("safety checker"),nf=l(`.
All of these components are necessary to run stable diffusion in inference even though they were trained
or created independently from each other.`),Hi=f(),Qa=a("p"),sf=l(`To that end, we strive to offer all open-sourced, state-of-the-art diffusion system under a unified API.
More specifically, we strive to provide pipelines that`),Ui=f(),D=a("ul"),Sr=a("li"),kr=a("ol"),C=a("li"),ff=l("can load the officially published weights and yield 1-to-1 the same outputs as the original implementation according to the corresponding paper ("),Pr=a("em"),df=l("e.g."),hf=f(),Pt=a("a"),cf=l("LDMTextToImagePipeline"),pf=l(", uses the officially released weights of "),Gt=a("a"),uf=l("High-Resolution Image Synthesis with Latent Diffusion Models"),mf=l("),"),gf=f(),Gr=a("li"),Wa=a("ol"),$t=a("li"),_f=l("have a simple user interface to run the model in inference (see the "),Ja=a("a"),vf=l("Pipelines API"),Ef=l(" section),"),bf=f(),$r=a("li"),Ka=a("ol"),Ot=a("li"),yf=l("are easy to understand with code that is self-explanatory and can be read along-side the official paper (see "),Xa=a("a"),wf=l("Pipelines summary"),Tf=l("),"),Df=f(),Or=a("li"),Za=a("ol"),Mt=a("li"),If=l("can easily be contributed by the community (see the "),eo=a("a"),xf=l("Contribution"),Af=l(" section)."),Bi=f(),j=a("p"),Mr=a("strong"),Sf=l("Note"),kf=l(` that pipelines do not (and should not) offer any training functionality.
If you are looking for `),Rr=a("em"),Pf=l("official"),Gf=l(" training examples, please have a look at "),Rt=a("a"),$f=l("examples"),Of=l("."),Vi=f(),Ee=a("h2"),$e=a("a"),Cr=a("span"),P(Ct.$$.fragment),Mf=f(),jr=a("span"),Rf=l("\u{1F9E8} Diffusers Summary"),Yi=f(),to=a("p"),Cf=l(`The following table summarizes all officially supported pipelines, their corresponding paper, and if
available a colab notebook to directly try them out.`),zi=f(),Oe=a("table"),Lr=a("thead"),L=a("tr"),Nr=a("th"),jf=l("Pipeline"),Lf=f(),qr=a("th"),Nf=l("Paper"),qf=f(),ao=a("th"),Hf=l("Tasks"),Uf=f(),oo=a("th"),Bf=l("Colab"),Vf=f(),p=a("tbody"),N=a("tr"),Hr=a("td"),ro=a("a"),Yf=l("alt_diffusion"),zf=f(),Ur=a("td"),jt=a("a"),Br=a("strong"),Ff=l("AltDiffusion"),Qf=f(),lo=a("td"),Wf=l("Image-to-Image Text-Guided Generation"),Jf=f(),no=a("td"),Kf=l("-"),Xf=f(),q=a("tr"),Vr=a("td"),io=a("a"),Zf=l("audio_diffusion"),ed=f(),Yr=a("td"),Lt=a("a"),zr=a("strong"),td=l("Audio Diffusion"),ad=f(),so=a("td"),od=l("Unconditional Audio Generation"),rd=f(),Fr=a("td"),ld=f(),H=a("tr"),Qr=a("td"),fo=a("a"),nd=l("cycle_diffusion"),id=f(),Wr=a("td"),Nt=a("a"),Jr=a("strong"),sd=l("Cycle Diffusion"),fd=f(),ho=a("td"),dd=l("Image-to-Image Text-Guided Generation"),hd=f(),Kr=a("td"),cd=f(),U=a("tr"),Xr=a("td"),co=a("a"),pd=l("dance_diffusion"),ud=f(),Zr=a("td"),qt=a("a"),el=a("strong"),md=l("Dance Diffusion"),gd=f(),po=a("td"),_d=l("Unconditional Audio Generation"),vd=f(),tl=a("td"),Ed=f(),B=a("tr"),al=a("td"),uo=a("a"),bd=l("ddpm"),yd=f(),ol=a("td"),Ht=a("a"),rl=a("strong"),wd=l("Denoising Diffusion Probabilistic Models"),Td=f(),mo=a("td"),Dd=l("Unconditional Image Generation"),Id=f(),ll=a("td"),xd=f(),V=a("tr"),nl=a("td"),go=a("a"),Ad=l("ddim"),Sd=f(),il=a("td"),Ut=a("a"),sl=a("strong"),kd=l("Denoising Diffusion Implicit Models"),Pd=f(),_o=a("td"),Gd=l("Unconditional Image Generation"),$d=f(),fl=a("td"),Od=f(),Y=a("tr"),dl=a("td"),vo=a("a"),Md=l("latent_diffusion"),Rd=f(),hl=a("td"),Bt=a("a"),cl=a("strong"),Cd=l("High-Resolution Image Synthesis with Latent Diffusion Models"),jd=f(),Eo=a("td"),Ld=l("Text-to-Image Generation"),Nd=f(),pl=a("td"),qd=f(),z=a("tr"),ul=a("td"),bo=a("a"),Hd=l("latent_diffusion"),Ud=f(),ml=a("td"),Vt=a("a"),gl=a("strong"),Bd=l("High-Resolution Image Synthesis with Latent Diffusion Models"),Vd=f(),yo=a("td"),Yd=l("Super Resolution Image-to-Image"),zd=f(),_l=a("td"),Fd=f(),F=a("tr"),vl=a("td"),wo=a("a"),Qd=l("latent_diffusion_uncond"),Wd=f(),El=a("td"),Yt=a("a"),bl=a("strong"),Jd=l("High-Resolution Image Synthesis with Latent Diffusion Models"),Kd=f(),To=a("td"),Xd=l("Unconditional Image Generation"),Zd=f(),yl=a("td"),eh=f(),Q=a("tr"),wl=a("td"),Do=a("a"),th=l("paint_by_example"),ah=f(),Tl=a("td"),zt=a("a"),Dl=a("strong"),oh=l("Paint by Example: Exemplar-based Image Editing with Diffusion Models"),rh=f(),Io=a("td"),lh=l("Image-Guided Image Inpainting"),nh=f(),Il=a("td"),ih=f(),W=a("tr"),xl=a("td"),xo=a("a"),sh=l("pndm"),fh=f(),Al=a("td"),Ft=a("a"),Sl=a("strong"),dh=l("Pseudo Numerical Methods for Diffusion Models on Manifolds"),hh=f(),Ao=a("td"),ch=l("Unconditional Image Generation"),ph=f(),kl=a("td"),uh=f(),J=a("tr"),Pl=a("td"),So=a("a"),mh=l("score_sde_ve"),gh=f(),Gl=a("td"),Qt=a("a"),$l=a("strong"),_h=l("Score-Based Generative Modeling through Stochastic Differential Equations"),vh=f(),ko=a("td"),Eh=l("Unconditional Image Generation"),bh=f(),Ol=a("td"),yh=f(),K=a("tr"),Ml=a("td"),Po=a("a"),wh=l("score_sde_vp"),Th=f(),Rl=a("td"),Wt=a("a"),Cl=a("strong"),Dh=l("Score-Based Generative Modeling through Stochastic Differential Equations"),Ih=f(),Go=a("td"),xh=l("Unconditional Image Generation"),Ah=f(),jl=a("td"),Sh=f(),X=a("tr"),Ll=a("td"),$o=a("a"),kh=l("stable_diffusion"),Ph=f(),Nl=a("td"),Jt=a("a"),ql=a("strong"),Gh=l("Stable Diffusion"),$h=f(),Oo=a("td"),Oh=l("Text-to-Image Generation"),Mh=f(),Mo=a("td"),Kt=a("a"),Ro=a("img"),Rh=f(),Z=a("tr"),Hl=a("td"),Co=a("a"),Ch=l("stable_diffusion"),jh=f(),Ul=a("td"),Xt=a("a"),Bl=a("strong"),Lh=l("Stable Diffusion"),Nh=f(),jo=a("td"),qh=l("Image-to-Image Text-Guided Generation"),Hh=f(),Lo=a("td"),Zt=a("a"),No=a("img"),Uh=f(),ee=a("tr"),Vl=a("td"),qo=a("a"),Bh=l("stable_diffusion"),Vh=f(),Yl=a("td"),ea=a("a"),zl=a("strong"),Yh=l("Stable Diffusion"),zh=f(),Ho=a("td"),Fh=l("Text-Guided Image Inpainting"),Qh=f(),Uo=a("td"),ta=a("a"),Bo=a("img"),Wh=f(),te=a("tr"),Fl=a("td"),Vo=a("a"),Jh=l("stable_diffusion_2"),Kh=f(),Ql=a("td"),aa=a("a"),Wl=a("strong"),Xh=l("Stable Diffusion 2"),Zh=f(),Yo=a("td"),ec=l("Text-to-Image Generation"),tc=f(),Jl=a("td"),ac=f(),ae=a("tr"),Kl=a("td"),zo=a("a"),oc=l("stable_diffusion_2"),rc=f(),Xl=a("td"),oa=a("a"),Zl=a("strong"),lc=l("Stable Diffusion 2"),nc=f(),Fo=a("td"),ic=l("Text-Guided Image Inpainting"),sc=f(),en=a("td"),fc=f(),oe=a("tr"),tn=a("td"),Qo=a("a"),dc=l("stable_diffusion_2"),hc=f(),an=a("td"),ra=a("a"),on=a("strong"),cc=l("Stable Diffusion 2"),pc=f(),Wo=a("td"),uc=l("Text-Guided Super Resolution Image-to-Image"),mc=f(),rn=a("td"),gc=f(),re=a("tr"),ln=a("td"),Jo=a("a"),_c=l("stable_diffusion_safe"),vc=f(),nn=a("td"),la=a("a"),sn=a("strong"),Ec=l("Safe Stable Diffusion"),bc=f(),Ko=a("td"),yc=l("Text-Guided Generation"),wc=f(),Xo=a("td"),na=a("a"),Zo=a("img"),Tc=f(),le=a("tr"),fn=a("td"),er=a("a"),Dc=l("stochastic_karras_ve"),Ic=f(),dn=a("td"),ia=a("a"),hn=a("strong"),xc=l("Elucidating the Design Space of Diffusion-Based Generative Models"),Ac=f(),tr=a("td"),Sc=l("Unconditional Image Generation"),kc=f(),cn=a("td"),Pc=f(),ne=a("tr"),pn=a("td"),ar=a("a"),Gc=l("unclip"),$c=f(),un=a("td"),sa=a("a"),Oc=l("Hierarchical Text-Conditional Image Generation with CLIP Latents"),Mc=f(),or=a("td"),Rc=l("Text-to-Image Generation"),Cc=f(),mn=a("td"),jc=f(),ie=a("tr"),gn=a("td"),rr=a("a"),Lc=l("versatile_diffusion"),Nc=f(),_n=a("td"),fa=a("a"),qc=l("Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),Hc=f(),lr=a("td"),Uc=l("Text-to-Image Generation"),Bc=f(),vn=a("td"),Vc=f(),se=a("tr"),En=a("td"),nr=a("a"),Yc=l("versatile_diffusion"),zc=f(),bn=a("td"),da=a("a"),Fc=l("Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),Qc=f(),ir=a("td"),Wc=l("Image Variations Generation"),Jc=f(),yn=a("td"),Kc=f(),fe=a("tr"),wn=a("td"),sr=a("a"),Xc=l("versatile_diffusion"),Zc=f(),Tn=a("td"),ha=a("a"),ep=l("Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),tp=f(),fr=a("td"),ap=l("Dual Image and Text Guided Generation"),op=f(),Dn=a("td"),rp=f(),de=a("tr"),In=a("td"),dr=a("a"),lp=l("vq_diffusion"),np=f(),xn=a("td"),ca=a("a"),ip=l("Vector Quantized Diffusion Model for Text-to-Image Synthesis"),sp=f(),hr=a("td"),fp=l("Text-to-Image Generation"),dp=f(),An=a("td"),Fi=f(),pa=a("p"),Sn=a("strong"),hp=l("Note"),cp=l(": Pipelines are simple examples of how to play around with the diffusion systems as described in the corresponding papers."),Qi=f(),Me=a("p"),pp=l("However, most of them can be adapted to use different scheduler components or even different model components. Some pipeline examples are shown in the "),cr=a("a"),up=l("Examples"),mp=l(" below."),Wi=f(),be=a("h2"),Re=a("a"),kn=a("span"),P(ua.$$.fragment),gp=f(),Pn=a("span"),_p=l("Pipelines API"),Ji=f(),pr=a("p"),vp=l("Diffusion models often consist of multiple independently-trained models or other previously existing components."),Ki=f(),ce=a("p"),Ep=l(`Each model has been trained independently on a different task and the scheduler can easily be swapped out and replaced with a different one.
During inference, we however want to be able to easily load all components and use them in inference - even if one component, `),Gn=a("em"),bp=l("e.g."),yp=l(" CLIP\u2019s text encoder, originates from a different library, such as "),ma=a("a"),wp=l("Transformers"),Tp=l(". To that end, all pipelines provide the following functionality:"),Xi=f(),I=a("ul"),m=a("li"),ga=a("a"),$n=a("code"),Dp=l("from_pretrained"),Ip=l(" method"),xp=l(" that accepts a Hugging Face Hub repository id, "),On=a("em"),Ap=l("e.g."),Sp=f(),_a=a("a"),kp=l("runwayml/stable-diffusion-v1-5"),Pp=l(" or a path to a local directory, "),Mn=a("em"),Gp=l("e.g."),$p=l(`
\u201D./stable-diffusion\u201D. To correctly retrieve which models and components should be loaded, one has to provide a `),Rn=a("code"),Op=l("model_index.json"),Mp=l(" file, "),Cn=a("em"),Rp=l("e.g."),Cp=f(),va=a("a"),jp=l("runwayml/stable-diffusion-v1-5/model_index.json"),Lp=l(`, which defines all components that should be
loaded into the pipelines. More specifically, for each model/component one needs to define the format `),jn=a("code"),Np=l('<name>: ["<library>", "<class name>"]'),qp=l(". "),Ln=a("code"),Hp=l("<name>"),Up=l(" is the attribute name given to the loaded instance of "),Nn=a("code"),Bp=l("<class name>"),Vp=l(" which can be found in the library or pipeline folder called "),qn=a("code"),Yp=l('"<library>"'),zp=l("."),Fp=f(),_=a("li"),ur=a("a"),Hn=a("code"),Qp=l("save_pretrained"),Wp=l(" that accepts a local path, "),Un=a("em"),Jp=l("e.g."),Kp=f(),Bn=a("code"),Xp=l("./stable-diffusion"),Zp=l(" under which all models/components of the pipeline will be saved. For each component/model a folder is created inside the local path that is named after the given attribute name, "),Vn=a("em"),eu=l("e.g."),tu=f(),Yn=a("code"),au=l("./stable_diffusion/unet"),ou=l(`.
In addition, a `),zn=a("code"),ru=l("model_index.json"),lu=l(" file is created at the root of the local path, "),Fn=a("em"),nu=l("e.g."),iu=f(),Qn=a("code"),su=l("./stable_diffusion/model_index.json"),fu=l(` so that the complete pipeline can again be instantiated
from the local path.`),du=f(),y=a("li"),mr=a("a"),Wn=a("code"),hu=l("to"),cu=l(" which accepts a "),Jn=a("code"),pu=l("string"),uu=l(" or "),Kn=a("code"),mu=l("torch.device"),gu=l(" to move all models that are of type "),Xn=a("code"),_u=l("torch.nn.Module"),vu=l(" to the passed device. The behavior is fully analogous to "),ye=a("a"),Eu=l("PyTorch\u2019s "),Zn=a("code"),bu=l("to"),yu=l(" method"),wu=l("."),Tu=f(),b=a("li"),ei=a("code"),Du=l("__call__"),Iu=l(" method to use the pipeline in inference. "),ti=a("code"),xu=l("__call__"),Au=l(" defines inference logic of the pipeline and should ideally encompass all aspects of it, from pre-processing to forwarding tensors to the different models and schedulers, as well as post-processing. The API of the "),ai=a("code"),Su=l("__call__"),ku=l(" method can strongly vary from pipeline to pipeline. "),oi=a("em"),Pu=l("E.g."),Gu=l(" a text-to-image pipeline, such as "),gr=a("a"),ri=a("code"),$u=l("StableDiffusionPipeline"),Ou=l(" should accept among other things the text prompt to generate the image. A pure image generation pipeline, such as "),Ea=a("a"),Mu=l("DDPMPipeline"),Ru=l(` on the other hand can be run without providing any inputs. To better understand what inputs can be adapted for
each pipeline, one should look directly into the respective pipeline.`),Zi=f(),x=a("p"),li=a("strong"),Cu=l("Note"),ju=l(": All pipelines have PyTorch\u2019s autograd disabled by decorating the "),ni=a("code"),Lu=l("__call__"),Nu=l(" method with a "),ba=a("a"),ii=a("code"),qu=l("torch.no_grad"),Hu=l(` decorator because pipelines should
not be used for training. If you want to store the gradients during the forward pass, we recommend writing your own pipeline, see also our `),ya=a("a"),Uu=l("community-examples"),es=f(),we=a("h2"),Ce=a("a"),si=a("span"),P(wa.$$.fragment),Bu=f(),fi=a("span"),Vu=l("Contribution"),ts=f(),w=a("p"),Yu=l(`We are more than happy about any contribution to the officially supported pipelines \u{1F917}. We aspire
all of our pipelines to be  `),di=a("strong"),zu=l("self-contained"),Fu=l(", "),hi=a("strong"),Qu=l("easy-to-tweak"),Wu=l(", "),ci=a("strong"),Ju=l("beginner-friendly"),Ku=l(" and for "),pi=a("strong"),Xu=l("one-purpose-only"),Zu=l("."),as=f(),A=a("ul"),je=a("li"),ui=a("strong"),em=l("Self-contained"),tm=l(": A pipeline shall be as self-contained as possible. More specifically, this means that all functionality should be either directly defined in the pipeline file itself, should be inherited from (and only from) the "),Ta=a("a"),mi=a("code"),am=l("DiffusionPipeline"),om=l(" class"),rm=l(" or be directly attached to the model and scheduler components of the pipeline."),lm=f(),pe=a("li"),gi=a("strong"),nm=l("Easy-to-use"),im=l(`: Pipelines should be extremely easy to use - one should be able to load the pipeline and
use it for its designated task, `),_i=a("em"),sm=l("e.g."),fm=l(` text-to-image generation, in just a couple of lines of code. Most
logic including pre-processing, an unrolled diffusion loop, and post-processing should all happen inside the `),vi=a("code"),dm=l("__call__"),hm=l(" method."),cm=f(),ue=a("li"),Ei=a("strong"),pm=l("Easy-to-tweak"),um=l(": Certain pipelines will not be able to handle all use cases and tasks that you might like them to. If you want to use a certain pipeline for a specific use case that is not yet supported, you might have to copy the pipeline file and tweak the code to your needs. We try to make the pipeline code as readable as possible so that each part \u2013from pre-processing to diffusing to post-processing\u2013 can easily be adapted. If you would like the community to benefit from your customized pipeline, we would love to see a contribution to our "),Da=a("a"),mm=l("community-examples"),gm=l(". If you feel that an important pipeline should be part of the official pipelines but isn\u2019t, a contribution to the "),_r=a("a"),_m=l("official pipelines"),vm=l(" would be even better."),Em=f(),S=a("li"),bi=a("strong"),bm=l("One-purpose-only"),ym=l(": Pipelines should be used for one task and one task only. Even if two tasks are very similar from a modeling point of view, "),yi=a("em"),wm=l("e.g."),Tm=l(" image2image translation and in-painting, pipelines shall be used for one task only to keep them "),wi=a("em"),Dm=l("easy-to-tweak"),Im=l(" and "),Ti=a("em"),xm=l("readable"),Am=l("."),os=f(),Te=a("h2"),Le=a("a"),Di=a("span"),P(Ia.$$.fragment),Sm=f(),Ii=a("span"),km=l("Examples"),rs=f(),De=a("h3"),Ne=a("a"),xi=a("span"),P(xa.$$.fragment),Pm=f(),Ai=a("span"),Gm=l("Text-to-Image generation with Stable Diffusion"),ls=f(),P(Aa.$$.fragment),ns=f(),Ie=a("h3"),qe=a("a"),Si=a("span"),P(Sa.$$.fragment),$m=f(),ki=a("span"),Om=l("Image-to-Image text-guided generation with Stable Diffusion"),is=f(),He=a("p"),Mm=l("The "),Pi=a("code"),Rm=l("StableDiffusionImg2ImgPipeline"),Cm=l(" lets you pass a text prompt and an initial image to condition the generation of new images."),ss=f(),P(ka.$$.fragment),fs=f(),Pa=a("p"),jm=l("You can also run this example on colab "),Ga=a("a"),vr=a("img"),ds=f(),xe=a("h3"),Ue=a("a"),Gi=a("span"),P($a.$$.fragment),Lm=f(),$i=a("span"),Nm=l("Tweak prompts reusing seeds and latents"),hs=f(),me=a("p"),qm=l("You can generate your own latents to reproduce results, or tweak your prompt on a specific result you liked. "),Oa=a("a"),Hm=l("This notebook"),Um=l(" shows how to do it step by step. You can also run it in Google Colab "),Ma=a("a"),Er=a("img"),Bm=l("."),cs=f(),Ae=a("h3"),Be=a("a"),Oi=a("span"),P(Ra.$$.fragment),Vm=f(),Mi=a("span"),Ym=l("In-painting using Stable Diffusion"),ps=f(),Ve=a("p"),zm=l("The "),Ri=a("code"),Fm=l("StableDiffusionInpaintPipeline"),Qm=l(" lets you edit specific parts of an image by providing a mask and text prompt."),us=f(),P(Ca.$$.fragment),ms=f(),ja=a("p"),Wm=l("You can also run this example on colab "),La=a("a"),br=a("img"),this.h()},l(s){const h=PE('[data-svelte="svelte-1phssyn"]',document.head);_e=o(h,"META",{name:!0,content:!0}),h.forEach(t),ji=d(s),ve=o(s,"H1",{class:!0});var _s=r(ve);Pe=o(_s,"A",{id:!0,class:!0,href:!0});var dg=r(Pe);Tr=o(dg,"SPAN",{});var hg=r(Tr);G(Tt.$$.fragment,hg),hg.forEach(t),dg.forEach(t),Ls=d(_s),Dr=o(_s,"SPAN",{});var cg=r(Dr);Ns=n(cg,"Pipelines"),cg.forEach(t),_s.forEach(t),Li=d(s),Ba=o(s,"P",{});var pg=r(Ba);qs=n(pg,`Pipelines provide a simple way to run state-of-the-art diffusion models in inference.
Most diffusion systems consist of multiple independently-trained models and highly adaptable scheduler
components - all of which are needed to have a functioning end-to-end diffusion system.`),pg.forEach(t),Ni=d(s),Ge=o(s,"P",{});var vs=r(Ge);Hs=n(vs,"As an example, "),Dt=o(vs,"A",{href:!0,rel:!0});var ug=r(Dt);Us=n(ug,"Stable Diffusion"),ug.forEach(t),Bs=n(vs," has three independently trained models:"),vs.forEach(t),qi=d(s),E=o(s,"UL",{});var k=r(E);Ir=o(k,"LI",{});var mg=r(Ir);Va=o(mg,"A",{href:!0});var gg=r(Va);Vs=n(gg,"Autoencoder"),gg.forEach(t),mg.forEach(t),Ys=d(k),xr=o(k,"LI",{});var _g=r(xr);Ya=o(_g,"A",{href:!0});var vg=r(Ya);zs=n(vg,"Conditional Unet"),vg.forEach(t),_g.forEach(t),Fs=d(k),Ar=o(k,"LI",{});var Eg=r(Ar);It=o(Eg,"A",{href:!0,rel:!0});var bg=r(It);Qs=n(bg,"CLIP text encoder"),bg.forEach(t),Eg.forEach(t),Ws=d(k),xt=o(k,"LI",{});var Es=r(xt);Js=n(Es,"a scheduler component, "),za=o(Es,"A",{href:!0});var yg=r(za);Ks=n(yg,"scheduler"),yg.forEach(t),Xs=n(Es,","),Es.forEach(t),Zs=d(k),At=o(k,"LI",{});var bs=r(At);ef=n(bs,"a "),St=o(bs,"A",{href:!0,rel:!0});var wg=r(St);tf=n(wg,"CLIPFeatureExtractor"),wg.forEach(t),af=n(bs,","),bs.forEach(t),of=d(k),kt=o(k,"LI",{});var ys=r(kt);rf=n(ys,"as well as a "),Fa=o(ys,"A",{href:!0});var Tg=r(Fa);lf=n(Tg,"safety checker"),Tg.forEach(t),nf=n(ys,`.
All of these components are necessary to run stable diffusion in inference even though they were trained
or created independently from each other.`),ys.forEach(t),k.forEach(t),Hi=d(s),Qa=o(s,"P",{});var Dg=r(Qa);sf=n(Dg,`To that end, we strive to offer all open-sourced, state-of-the-art diffusion system under a unified API.
More specifically, we strive to provide pipelines that`),Dg.forEach(t),Ui=d(s),D=o(s,"UL",{});var Ye=r(D);Sr=o(Ye,"LI",{});var Ig=r(Sr);kr=o(Ig,"OL",{});var xg=r(kr);C=o(xg,"LI",{});var ze=r(C);ff=n(ze,"can load the officially published weights and yield 1-to-1 the same outputs as the original implementation according to the corresponding paper ("),Pr=o(ze,"EM",{});var Ag=r(Pr);df=n(Ag,"e.g."),Ag.forEach(t),hf=d(ze),Pt=o(ze,"A",{href:!0,rel:!0});var Sg=r(Pt);cf=n(Sg,"LDMTextToImagePipeline"),Sg.forEach(t),pf=n(ze,", uses the officially released weights of "),Gt=o(ze,"A",{href:!0,rel:!0});var kg=r(Gt);uf=n(kg,"High-Resolution Image Synthesis with Latent Diffusion Models"),kg.forEach(t),mf=n(ze,"),"),ze.forEach(t),xg.forEach(t),Ig.forEach(t),gf=d(Ye),Gr=o(Ye,"LI",{});var Pg=r(Gr);Wa=o(Pg,"OL",{start:!0});var Gg=r(Wa);$t=o(Gg,"LI",{});var ws=r($t);_f=n(ws,"have a simple user interface to run the model in inference (see the "),Ja=o(ws,"A",{href:!0});var $g=r(Ja);vf=n($g,"Pipelines API"),$g.forEach(t),Ef=n(ws," section),"),ws.forEach(t),Gg.forEach(t),Pg.forEach(t),bf=d(Ye),$r=o(Ye,"LI",{});var Og=r($r);Ka=o(Og,"OL",{start:!0});var Mg=r(Ka);Ot=o(Mg,"LI",{});var Ts=r(Ot);yf=n(Ts,"are easy to understand with code that is self-explanatory and can be read along-side the official paper (see "),Xa=o(Ts,"A",{href:!0});var Rg=r(Xa);wf=n(Rg,"Pipelines summary"),Rg.forEach(t),Tf=n(Ts,"),"),Ts.forEach(t),Mg.forEach(t),Og.forEach(t),Df=d(Ye),Or=o(Ye,"LI",{});var Cg=r(Or);Za=o(Cg,"OL",{start:!0});var jg=r(Za);Mt=o(jg,"LI",{});var Ds=r(Mt);If=n(Ds,"can easily be contributed by the community (see the "),eo=o(Ds,"A",{href:!0});var Lg=r(eo);xf=n(Lg,"Contribution"),Lg.forEach(t),Af=n(Ds," section)."),Ds.forEach(t),jg.forEach(t),Cg.forEach(t),Ye.forEach(t),Bi=d(s),j=o(s,"P",{});var Na=r(j);Mr=o(Na,"STRONG",{});var Ng=r(Mr);Sf=n(Ng,"Note"),Ng.forEach(t),kf=n(Na,` that pipelines do not (and should not) offer any training functionality.
If you are looking for `),Rr=o(Na,"EM",{});var qg=r(Rr);Pf=n(qg,"official"),qg.forEach(t),Gf=n(Na," training examples, please have a look at "),Rt=o(Na,"A",{href:!0,rel:!0});var Hg=r(Rt);$f=n(Hg,"examples"),Hg.forEach(t),Of=n(Na,"."),Na.forEach(t),Vi=d(s),Ee=o(s,"H2",{class:!0});var Is=r(Ee);$e=o(Is,"A",{id:!0,class:!0,href:!0});var Ug=r($e);Cr=o(Ug,"SPAN",{});var Bg=r(Cr);G(Ct.$$.fragment,Bg),Bg.forEach(t),Ug.forEach(t),Mf=d(Is),jr=o(Is,"SPAN",{});var Vg=r(jr);Rf=n(Vg,"\u{1F9E8} Diffusers Summary"),Vg.forEach(t),Is.forEach(t),Yi=d(s),to=o(s,"P",{});var Yg=r(to);Cf=n(Yg,`The following table summarizes all officially supported pipelines, their corresponding paper, and if
available a colab notebook to directly try them out.`),Yg.forEach(t),zi=d(s),Oe=o(s,"TABLE",{});var xs=r(Oe);Lr=o(xs,"THEAD",{});var zg=r(Lr);L=o(zg,"TR",{});var Fe=r(L);Nr=o(Fe,"TH",{});var Fg=r(Nr);jf=n(Fg,"Pipeline"),Fg.forEach(t),Lf=d(Fe),qr=o(Fe,"TH",{});var Qg=r(qr);Nf=n(Qg,"Paper"),Qg.forEach(t),qf=d(Fe),ao=o(Fe,"TH",{align:!0});var Wg=r(ao);Hf=n(Wg,"Tasks"),Wg.forEach(t),Uf=d(Fe),oo=o(Fe,"TH",{align:!0});var Jg=r(oo);Bf=n(Jg,"Colab"),Jg.forEach(t),Fe.forEach(t),zg.forEach(t),Vf=d(xs),p=o(xs,"TBODY",{});var u=r(p);N=o(u,"TR",{});var Qe=r(N);Hr=o(Qe,"TD",{});var Kg=r(Hr);ro=o(Kg,"A",{href:!0});var Xg=r(ro);Yf=n(Xg,"alt_diffusion"),Xg.forEach(t),Kg.forEach(t),zf=d(Qe),Ur=o(Qe,"TD",{});var Zg=r(Ur);jt=o(Zg,"A",{href:!0,rel:!0});var e_=r(jt);Br=o(e_,"STRONG",{});var t_=r(Br);Ff=n(t_,"AltDiffusion"),t_.forEach(t),e_.forEach(t),Zg.forEach(t),Qf=d(Qe),lo=o(Qe,"TD",{align:!0});var a_=r(lo);Wf=n(a_,"Image-to-Image Text-Guided Generation"),a_.forEach(t),Jf=d(Qe),no=o(Qe,"TD",{align:!0});var o_=r(no);Kf=n(o_,"-"),o_.forEach(t),Qe.forEach(t),Xf=d(u),q=o(u,"TR",{});var We=r(q);Vr=o(We,"TD",{});var r_=r(Vr);io=o(r_,"A",{href:!0});var l_=r(io);Zf=n(l_,"audio_diffusion"),l_.forEach(t),r_.forEach(t),ed=d(We),Yr=o(We,"TD",{});var n_=r(Yr);Lt=o(n_,"A",{href:!0,rel:!0});var i_=r(Lt);zr=o(i_,"STRONG",{});var s_=r(zr);td=n(s_,"Audio Diffusion"),s_.forEach(t),i_.forEach(t),n_.forEach(t),ad=d(We),so=o(We,"TD",{align:!0});var f_=r(so);od=n(f_,"Unconditional Audio Generation"),f_.forEach(t),rd=d(We),Fr=o(We,"TD",{align:!0}),r(Fr).forEach(t),We.forEach(t),ld=d(u),H=o(u,"TR",{});var Je=r(H);Qr=o(Je,"TD",{});var d_=r(Qr);fo=o(d_,"A",{href:!0});var h_=r(fo);nd=n(h_,"cycle_diffusion"),h_.forEach(t),d_.forEach(t),id=d(Je),Wr=o(Je,"TD",{});var c_=r(Wr);Nt=o(c_,"A",{href:!0,rel:!0});var p_=r(Nt);Jr=o(p_,"STRONG",{});var u_=r(Jr);sd=n(u_,"Cycle Diffusion"),u_.forEach(t),p_.forEach(t),c_.forEach(t),fd=d(Je),ho=o(Je,"TD",{align:!0});var m_=r(ho);dd=n(m_,"Image-to-Image Text-Guided Generation"),m_.forEach(t),hd=d(Je),Kr=o(Je,"TD",{align:!0}),r(Kr).forEach(t),Je.forEach(t),cd=d(u),U=o(u,"TR",{});var Ke=r(U);Xr=o(Ke,"TD",{});var g_=r(Xr);co=o(g_,"A",{href:!0});var __=r(co);pd=n(__,"dance_diffusion"),__.forEach(t),g_.forEach(t),ud=d(Ke),Zr=o(Ke,"TD",{});var v_=r(Zr);qt=o(v_,"A",{href:!0,rel:!0});var E_=r(qt);el=o(E_,"STRONG",{});var b_=r(el);md=n(b_,"Dance Diffusion"),b_.forEach(t),E_.forEach(t),v_.forEach(t),gd=d(Ke),po=o(Ke,"TD",{align:!0});var y_=r(po);_d=n(y_,"Unconditional Audio Generation"),y_.forEach(t),vd=d(Ke),tl=o(Ke,"TD",{align:!0}),r(tl).forEach(t),Ke.forEach(t),Ed=d(u),B=o(u,"TR",{});var Xe=r(B);al=o(Xe,"TD",{});var w_=r(al);uo=o(w_,"A",{href:!0});var T_=r(uo);bd=n(T_,"ddpm"),T_.forEach(t),w_.forEach(t),yd=d(Xe),ol=o(Xe,"TD",{});var D_=r(ol);Ht=o(D_,"A",{href:!0,rel:!0});var I_=r(Ht);rl=o(I_,"STRONG",{});var x_=r(rl);wd=n(x_,"Denoising Diffusion Probabilistic Models"),x_.forEach(t),I_.forEach(t),D_.forEach(t),Td=d(Xe),mo=o(Xe,"TD",{align:!0});var A_=r(mo);Dd=n(A_,"Unconditional Image Generation"),A_.forEach(t),Id=d(Xe),ll=o(Xe,"TD",{align:!0}),r(ll).forEach(t),Xe.forEach(t),xd=d(u),V=o(u,"TR",{});var Ze=r(V);nl=o(Ze,"TD",{});var S_=r(nl);go=o(S_,"A",{href:!0});var k_=r(go);Ad=n(k_,"ddim"),k_.forEach(t),S_.forEach(t),Sd=d(Ze),il=o(Ze,"TD",{});var P_=r(il);Ut=o(P_,"A",{href:!0,rel:!0});var G_=r(Ut);sl=o(G_,"STRONG",{});var $_=r(sl);kd=n($_,"Denoising Diffusion Implicit Models"),$_.forEach(t),G_.forEach(t),P_.forEach(t),Pd=d(Ze),_o=o(Ze,"TD",{align:!0});var O_=r(_o);Gd=n(O_,"Unconditional Image Generation"),O_.forEach(t),$d=d(Ze),fl=o(Ze,"TD",{align:!0}),r(fl).forEach(t),Ze.forEach(t),Od=d(u),Y=o(u,"TR",{});var et=r(Y);dl=o(et,"TD",{});var M_=r(dl);vo=o(M_,"A",{href:!0});var R_=r(vo);Md=n(R_,"latent_diffusion"),R_.forEach(t),M_.forEach(t),Rd=d(et),hl=o(et,"TD",{});var C_=r(hl);Bt=o(C_,"A",{href:!0,rel:!0});var j_=r(Bt);cl=o(j_,"STRONG",{});var L_=r(cl);Cd=n(L_,"High-Resolution Image Synthesis with Latent Diffusion Models"),L_.forEach(t),j_.forEach(t),C_.forEach(t),jd=d(et),Eo=o(et,"TD",{align:!0});var N_=r(Eo);Ld=n(N_,"Text-to-Image Generation"),N_.forEach(t),Nd=d(et),pl=o(et,"TD",{align:!0}),r(pl).forEach(t),et.forEach(t),qd=d(u),z=o(u,"TR",{});var tt=r(z);ul=o(tt,"TD",{});var q_=r(ul);bo=o(q_,"A",{href:!0});var H_=r(bo);Hd=n(H_,"latent_diffusion"),H_.forEach(t),q_.forEach(t),Ud=d(tt),ml=o(tt,"TD",{});var U_=r(ml);Vt=o(U_,"A",{href:!0,rel:!0});var B_=r(Vt);gl=o(B_,"STRONG",{});var V_=r(gl);Bd=n(V_,"High-Resolution Image Synthesis with Latent Diffusion Models"),V_.forEach(t),B_.forEach(t),U_.forEach(t),Vd=d(tt),yo=o(tt,"TD",{align:!0});var Y_=r(yo);Yd=n(Y_,"Super Resolution Image-to-Image"),Y_.forEach(t),zd=d(tt),_l=o(tt,"TD",{align:!0}),r(_l).forEach(t),tt.forEach(t),Fd=d(u),F=o(u,"TR",{});var at=r(F);vl=o(at,"TD",{});var z_=r(vl);wo=o(z_,"A",{href:!0});var F_=r(wo);Qd=n(F_,"latent_diffusion_uncond"),F_.forEach(t),z_.forEach(t),Wd=d(at),El=o(at,"TD",{});var Q_=r(El);Yt=o(Q_,"A",{href:!0,rel:!0});var W_=r(Yt);bl=o(W_,"STRONG",{});var J_=r(bl);Jd=n(J_,"High-Resolution Image Synthesis with Latent Diffusion Models"),J_.forEach(t),W_.forEach(t),Q_.forEach(t),Kd=d(at),To=o(at,"TD",{align:!0});var K_=r(To);Xd=n(K_,"Unconditional Image Generation"),K_.forEach(t),Zd=d(at),yl=o(at,"TD",{align:!0}),r(yl).forEach(t),at.forEach(t),eh=d(u),Q=o(u,"TR",{});var ot=r(Q);wl=o(ot,"TD",{});var X_=r(wl);Do=o(X_,"A",{href:!0});var Z_=r(Do);th=n(Z_,"paint_by_example"),Z_.forEach(t),X_.forEach(t),ah=d(ot),Tl=o(ot,"TD",{});var ev=r(Tl);zt=o(ev,"A",{href:!0,rel:!0});var tv=r(zt);Dl=o(tv,"STRONG",{});var av=r(Dl);oh=n(av,"Paint by Example: Exemplar-based Image Editing with Diffusion Models"),av.forEach(t),tv.forEach(t),ev.forEach(t),rh=d(ot),Io=o(ot,"TD",{align:!0});var ov=r(Io);lh=n(ov,"Image-Guided Image Inpainting"),ov.forEach(t),nh=d(ot),Il=o(ot,"TD",{align:!0}),r(Il).forEach(t),ot.forEach(t),ih=d(u),W=o(u,"TR",{});var rt=r(W);xl=o(rt,"TD",{});var rv=r(xl);xo=o(rv,"A",{href:!0});var lv=r(xo);sh=n(lv,"pndm"),lv.forEach(t),rv.forEach(t),fh=d(rt),Al=o(rt,"TD",{});var nv=r(Al);Ft=o(nv,"A",{href:!0,rel:!0});var iv=r(Ft);Sl=o(iv,"STRONG",{});var sv=r(Sl);dh=n(sv,"Pseudo Numerical Methods for Diffusion Models on Manifolds"),sv.forEach(t),iv.forEach(t),nv.forEach(t),hh=d(rt),Ao=o(rt,"TD",{align:!0});var fv=r(Ao);ch=n(fv,"Unconditional Image Generation"),fv.forEach(t),ph=d(rt),kl=o(rt,"TD",{align:!0}),r(kl).forEach(t),rt.forEach(t),uh=d(u),J=o(u,"TR",{});var lt=r(J);Pl=o(lt,"TD",{});var dv=r(Pl);So=o(dv,"A",{href:!0});var hv=r(So);mh=n(hv,"score_sde_ve"),hv.forEach(t),dv.forEach(t),gh=d(lt),Gl=o(lt,"TD",{});var cv=r(Gl);Qt=o(cv,"A",{href:!0,rel:!0});var pv=r(Qt);$l=o(pv,"STRONG",{});var uv=r($l);_h=n(uv,"Score-Based Generative Modeling through Stochastic Differential Equations"),uv.forEach(t),pv.forEach(t),cv.forEach(t),vh=d(lt),ko=o(lt,"TD",{align:!0});var mv=r(ko);Eh=n(mv,"Unconditional Image Generation"),mv.forEach(t),bh=d(lt),Ol=o(lt,"TD",{align:!0}),r(Ol).forEach(t),lt.forEach(t),yh=d(u),K=o(u,"TR",{});var nt=r(K);Ml=o(nt,"TD",{});var gv=r(Ml);Po=o(gv,"A",{href:!0});var _v=r(Po);wh=n(_v,"score_sde_vp"),_v.forEach(t),gv.forEach(t),Th=d(nt),Rl=o(nt,"TD",{});var vv=r(Rl);Wt=o(vv,"A",{href:!0,rel:!0});var Ev=r(Wt);Cl=o(Ev,"STRONG",{});var bv=r(Cl);Dh=n(bv,"Score-Based Generative Modeling through Stochastic Differential Equations"),bv.forEach(t),Ev.forEach(t),vv.forEach(t),Ih=d(nt),Go=o(nt,"TD",{align:!0});var yv=r(Go);xh=n(yv,"Unconditional Image Generation"),yv.forEach(t),Ah=d(nt),jl=o(nt,"TD",{align:!0}),r(jl).forEach(t),nt.forEach(t),Sh=d(u),X=o(u,"TR",{});var it=r(X);Ll=o(it,"TD",{});var wv=r(Ll);$o=o(wv,"A",{href:!0});var Tv=r($o);kh=n(Tv,"stable_diffusion"),Tv.forEach(t),wv.forEach(t),Ph=d(it),Nl=o(it,"TD",{});var Dv=r(Nl);Jt=o(Dv,"A",{href:!0,rel:!0});var Iv=r(Jt);ql=o(Iv,"STRONG",{});var xv=r(ql);Gh=n(xv,"Stable Diffusion"),xv.forEach(t),Iv.forEach(t),Dv.forEach(t),$h=d(it),Oo=o(it,"TD",{align:!0});var Av=r(Oo);Oh=n(Av,"Text-to-Image Generation"),Av.forEach(t),Mh=d(it),Mo=o(it,"TD",{align:!0});var Sv=r(Mo);Kt=o(Sv,"A",{href:!0,rel:!0});var kv=r(Kt);Ro=o(kv,"IMG",{src:!0,alt:!0}),kv.forEach(t),Sv.forEach(t),it.forEach(t),Rh=d(u),Z=o(u,"TR",{});var st=r(Z);Hl=o(st,"TD",{});var Pv=r(Hl);Co=o(Pv,"A",{href:!0});var Gv=r(Co);Ch=n(Gv,"stable_diffusion"),Gv.forEach(t),Pv.forEach(t),jh=d(st),Ul=o(st,"TD",{});var $v=r(Ul);Xt=o($v,"A",{href:!0,rel:!0});var Ov=r(Xt);Bl=o(Ov,"STRONG",{});var Mv=r(Bl);Lh=n(Mv,"Stable Diffusion"),Mv.forEach(t),Ov.forEach(t),$v.forEach(t),Nh=d(st),jo=o(st,"TD",{align:!0});var Rv=r(jo);qh=n(Rv,"Image-to-Image Text-Guided Generation"),Rv.forEach(t),Hh=d(st),Lo=o(st,"TD",{align:!0});var Cv=r(Lo);Zt=o(Cv,"A",{href:!0,rel:!0});var jv=r(Zt);No=o(jv,"IMG",{src:!0,alt:!0}),jv.forEach(t),Cv.forEach(t),st.forEach(t),Uh=d(u),ee=o(u,"TR",{});var ft=r(ee);Vl=o(ft,"TD",{});var Lv=r(Vl);qo=o(Lv,"A",{href:!0});var Nv=r(qo);Bh=n(Nv,"stable_diffusion"),Nv.forEach(t),Lv.forEach(t),Vh=d(ft),Yl=o(ft,"TD",{});var qv=r(Yl);ea=o(qv,"A",{href:!0,rel:!0});var Hv=r(ea);zl=o(Hv,"STRONG",{});var Uv=r(zl);Yh=n(Uv,"Stable Diffusion"),Uv.forEach(t),Hv.forEach(t),qv.forEach(t),zh=d(ft),Ho=o(ft,"TD",{align:!0});var Bv=r(Ho);Fh=n(Bv,"Text-Guided Image Inpainting"),Bv.forEach(t),Qh=d(ft),Uo=o(ft,"TD",{align:!0});var Vv=r(Uo);ta=o(Vv,"A",{href:!0,rel:!0});var Yv=r(ta);Bo=o(Yv,"IMG",{src:!0,alt:!0}),Yv.forEach(t),Vv.forEach(t),ft.forEach(t),Wh=d(u),te=o(u,"TR",{});var dt=r(te);Fl=o(dt,"TD",{});var zv=r(Fl);Vo=o(zv,"A",{href:!0});var Fv=r(Vo);Jh=n(Fv,"stable_diffusion_2"),Fv.forEach(t),zv.forEach(t),Kh=d(dt),Ql=o(dt,"TD",{});var Qv=r(Ql);aa=o(Qv,"A",{href:!0,rel:!0});var Wv=r(aa);Wl=o(Wv,"STRONG",{});var Jv=r(Wl);Xh=n(Jv,"Stable Diffusion 2"),Jv.forEach(t),Wv.forEach(t),Qv.forEach(t),Zh=d(dt),Yo=o(dt,"TD",{align:!0});var Kv=r(Yo);ec=n(Kv,"Text-to-Image Generation"),Kv.forEach(t),tc=d(dt),Jl=o(dt,"TD",{align:!0}),r(Jl).forEach(t),dt.forEach(t),ac=d(u),ae=o(u,"TR",{});var ht=r(ae);Kl=o(ht,"TD",{});var Xv=r(Kl);zo=o(Xv,"A",{href:!0});var Zv=r(zo);oc=n(Zv,"stable_diffusion_2"),Zv.forEach(t),Xv.forEach(t),rc=d(ht),Xl=o(ht,"TD",{});var e1=r(Xl);oa=o(e1,"A",{href:!0,rel:!0});var t1=r(oa);Zl=o(t1,"STRONG",{});var a1=r(Zl);lc=n(a1,"Stable Diffusion 2"),a1.forEach(t),t1.forEach(t),e1.forEach(t),nc=d(ht),Fo=o(ht,"TD",{align:!0});var o1=r(Fo);ic=n(o1,"Text-Guided Image Inpainting"),o1.forEach(t),sc=d(ht),en=o(ht,"TD",{align:!0}),r(en).forEach(t),ht.forEach(t),fc=d(u),oe=o(u,"TR",{});var ct=r(oe);tn=o(ct,"TD",{});var r1=r(tn);Qo=o(r1,"A",{href:!0});var l1=r(Qo);dc=n(l1,"stable_diffusion_2"),l1.forEach(t),r1.forEach(t),hc=d(ct),an=o(ct,"TD",{});var n1=r(an);ra=o(n1,"A",{href:!0,rel:!0});var i1=r(ra);on=o(i1,"STRONG",{});var s1=r(on);cc=n(s1,"Stable Diffusion 2"),s1.forEach(t),i1.forEach(t),n1.forEach(t),pc=d(ct),Wo=o(ct,"TD",{align:!0});var f1=r(Wo);uc=n(f1,"Text-Guided Super Resolution Image-to-Image"),f1.forEach(t),mc=d(ct),rn=o(ct,"TD",{align:!0}),r(rn).forEach(t),ct.forEach(t),gc=d(u),re=o(u,"TR",{});var pt=r(re);ln=o(pt,"TD",{});var d1=r(ln);Jo=o(d1,"A",{href:!0});var h1=r(Jo);_c=n(h1,"stable_diffusion_safe"),h1.forEach(t),d1.forEach(t),vc=d(pt),nn=o(pt,"TD",{});var c1=r(nn);la=o(c1,"A",{href:!0,rel:!0});var p1=r(la);sn=o(p1,"STRONG",{});var u1=r(sn);Ec=n(u1,"Safe Stable Diffusion"),u1.forEach(t),p1.forEach(t),c1.forEach(t),bc=d(pt),Ko=o(pt,"TD",{align:!0});var m1=r(Ko);yc=n(m1,"Text-Guided Generation"),m1.forEach(t),wc=d(pt),Xo=o(pt,"TD",{align:!0});var g1=r(Xo);na=o(g1,"A",{href:!0,rel:!0});var _1=r(na);Zo=o(_1,"IMG",{src:!0,alt:!0}),_1.forEach(t),g1.forEach(t),pt.forEach(t),Tc=d(u),le=o(u,"TR",{});var ut=r(le);fn=o(ut,"TD",{});var v1=r(fn);er=o(v1,"A",{href:!0});var E1=r(er);Dc=n(E1,"stochastic_karras_ve"),E1.forEach(t),v1.forEach(t),Ic=d(ut),dn=o(ut,"TD",{});var b1=r(dn);ia=o(b1,"A",{href:!0,rel:!0});var y1=r(ia);hn=o(y1,"STRONG",{});var w1=r(hn);xc=n(w1,"Elucidating the Design Space of Diffusion-Based Generative Models"),w1.forEach(t),y1.forEach(t),b1.forEach(t),Ac=d(ut),tr=o(ut,"TD",{align:!0});var T1=r(tr);Sc=n(T1,"Unconditional Image Generation"),T1.forEach(t),kc=d(ut),cn=o(ut,"TD",{align:!0}),r(cn).forEach(t),ut.forEach(t),Pc=d(u),ne=o(u,"TR",{});var mt=r(ne);pn=o(mt,"TD",{});var D1=r(pn);ar=o(D1,"A",{href:!0});var I1=r(ar);Gc=n(I1,"unclip"),I1.forEach(t),D1.forEach(t),$c=d(mt),un=o(mt,"TD",{});var x1=r(un);sa=o(x1,"A",{href:!0,rel:!0});var A1=r(sa);Oc=n(A1,"Hierarchical Text-Conditional Image Generation with CLIP Latents"),A1.forEach(t),x1.forEach(t),Mc=d(mt),or=o(mt,"TD",{align:!0});var S1=r(or);Rc=n(S1,"Text-to-Image Generation"),S1.forEach(t),Cc=d(mt),mn=o(mt,"TD",{align:!0}),r(mn).forEach(t),mt.forEach(t),jc=d(u),ie=o(u,"TR",{});var gt=r(ie);gn=o(gt,"TD",{});var k1=r(gn);rr=o(k1,"A",{href:!0});var P1=r(rr);Lc=n(P1,"versatile_diffusion"),P1.forEach(t),k1.forEach(t),Nc=d(gt),_n=o(gt,"TD",{});var G1=r(_n);fa=o(G1,"A",{href:!0,rel:!0});var $1=r(fa);qc=n($1,"Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),$1.forEach(t),G1.forEach(t),Hc=d(gt),lr=o(gt,"TD",{align:!0});var O1=r(lr);Uc=n(O1,"Text-to-Image Generation"),O1.forEach(t),Bc=d(gt),vn=o(gt,"TD",{align:!0}),r(vn).forEach(t),gt.forEach(t),Vc=d(u),se=o(u,"TR",{});var _t=r(se);En=o(_t,"TD",{});var M1=r(En);nr=o(M1,"A",{href:!0});var R1=r(nr);Yc=n(R1,"versatile_diffusion"),R1.forEach(t),M1.forEach(t),zc=d(_t),bn=o(_t,"TD",{});var C1=r(bn);da=o(C1,"A",{href:!0,rel:!0});var j1=r(da);Fc=n(j1,"Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),j1.forEach(t),C1.forEach(t),Qc=d(_t),ir=o(_t,"TD",{align:!0});var L1=r(ir);Wc=n(L1,"Image Variations Generation"),L1.forEach(t),Jc=d(_t),yn=o(_t,"TD",{align:!0}),r(yn).forEach(t),_t.forEach(t),Kc=d(u),fe=o(u,"TR",{});var vt=r(fe);wn=o(vt,"TD",{});var N1=r(wn);sr=o(N1,"A",{href:!0});var q1=r(sr);Xc=n(q1,"versatile_diffusion"),q1.forEach(t),N1.forEach(t),Zc=d(vt),Tn=o(vt,"TD",{});var H1=r(Tn);ha=o(H1,"A",{href:!0,rel:!0});var U1=r(ha);ep=n(U1,"Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),U1.forEach(t),H1.forEach(t),tp=d(vt),fr=o(vt,"TD",{align:!0});var B1=r(fr);ap=n(B1,"Dual Image and Text Guided Generation"),B1.forEach(t),op=d(vt),Dn=o(vt,"TD",{align:!0}),r(Dn).forEach(t),vt.forEach(t),rp=d(u),de=o(u,"TR",{});var Et=r(de);In=o(Et,"TD",{});var V1=r(In);dr=o(V1,"A",{href:!0});var Y1=r(dr);lp=n(Y1,"vq_diffusion"),Y1.forEach(t),V1.forEach(t),np=d(Et),xn=o(Et,"TD",{});var z1=r(xn);ca=o(z1,"A",{href:!0,rel:!0});var F1=r(ca);ip=n(F1,"Vector Quantized Diffusion Model for Text-to-Image Synthesis"),F1.forEach(t),z1.forEach(t),sp=d(Et),hr=o(Et,"TD",{align:!0});var Q1=r(hr);fp=n(Q1,"Text-to-Image Generation"),Q1.forEach(t),dp=d(Et),An=o(Et,"TD",{align:!0}),r(An).forEach(t),Et.forEach(t),u.forEach(t),xs.forEach(t),Fi=d(s),pa=o(s,"P",{});var Jm=r(pa);Sn=o(Jm,"STRONG",{});var W1=r(Sn);hp=n(W1,"Note"),W1.forEach(t),cp=n(Jm,": Pipelines are simple examples of how to play around with the diffusion systems as described in the corresponding papers."),Jm.forEach(t),Qi=d(s),Me=o(s,"P",{});var As=r(Me);pp=n(As,"However, most of them can be adapted to use different scheduler components or even different model components. Some pipeline examples are shown in the "),cr=o(As,"A",{href:!0});var J1=r(cr);up=n(J1,"Examples"),J1.forEach(t),mp=n(As," below."),As.forEach(t),Wi=d(s),be=o(s,"H2",{class:!0});var Ss=r(be);Re=o(Ss,"A",{id:!0,class:!0,href:!0});var K1=r(Re);kn=o(K1,"SPAN",{});var X1=r(kn);G(ua.$$.fragment,X1),X1.forEach(t),K1.forEach(t),gp=d(Ss),Pn=o(Ss,"SPAN",{});var Z1=r(Pn);_p=n(Z1,"Pipelines API"),Z1.forEach(t),Ss.forEach(t),Ji=d(s),pr=o(s,"P",{});var e2=r(pr);vp=n(e2,"Diffusion models often consist of multiple independently-trained models or other previously existing components."),e2.forEach(t),Ki=d(s),ce=o(s,"P",{});var yr=r(ce);Ep=n(yr,`Each model has been trained independently on a different task and the scheduler can easily be swapped out and replaced with a different one.
During inference, we however want to be able to easily load all components and use them in inference - even if one component, `),Gn=o(yr,"EM",{});var t2=r(Gn);bp=n(t2,"e.g."),t2.forEach(t),yp=n(yr," CLIP\u2019s text encoder, originates from a different library, such as "),ma=o(yr,"A",{href:!0,rel:!0});var a2=r(ma);wp=n(a2,"Transformers"),a2.forEach(t),Tp=n(yr,". To that end, all pipelines provide the following functionality:"),yr.forEach(t),Xi=d(s),I=o(s,"UL",{});var bt=r(I);m=o(bt,"LI",{});var g=r(m);ga=o(g,"A",{href:!0});var Km=r(ga);$n=o(Km,"CODE",{});var o2=r($n);Dp=n(o2,"from_pretrained"),o2.forEach(t),Ip=n(Km," method"),Km.forEach(t),xp=n(g," that accepts a Hugging Face Hub repository id, "),On=o(g,"EM",{});var r2=r(On);Ap=n(r2,"e.g."),r2.forEach(t),Sp=d(g),_a=o(g,"A",{href:!0,rel:!0});var l2=r(_a);kp=n(l2,"runwayml/stable-diffusion-v1-5"),l2.forEach(t),Pp=n(g," or a path to a local directory, "),Mn=o(g,"EM",{});var n2=r(Mn);Gp=n(n2,"e.g."),n2.forEach(t),$p=n(g,`
\u201D./stable-diffusion\u201D. To correctly retrieve which models and components should be loaded, one has to provide a `),Rn=o(g,"CODE",{});var i2=r(Rn);Op=n(i2,"model_index.json"),i2.forEach(t),Mp=n(g," file, "),Cn=o(g,"EM",{});var s2=r(Cn);Rp=n(s2,"e.g."),s2.forEach(t),Cp=d(g),va=o(g,"A",{href:!0,rel:!0});var f2=r(va);jp=n(f2,"runwayml/stable-diffusion-v1-5/model_index.json"),f2.forEach(t),Lp=n(g,`, which defines all components that should be
loaded into the pipelines. More specifically, for each model/component one needs to define the format `),jn=o(g,"CODE",{});var d2=r(jn);Np=n(d2,'<name>: ["<library>", "<class name>"]'),d2.forEach(t),qp=n(g,". "),Ln=o(g,"CODE",{});var h2=r(Ln);Hp=n(h2,"<name>"),h2.forEach(t),Up=n(g," is the attribute name given to the loaded instance of "),Nn=o(g,"CODE",{});var c2=r(Nn);Bp=n(c2,"<class name>"),c2.forEach(t),Vp=n(g," which can be found in the library or pipeline folder called "),qn=o(g,"CODE",{});var p2=r(qn);Yp=n(p2,'"<library>"'),p2.forEach(t),zp=n(g,"."),g.forEach(t),Fp=d(bt),_=o(bt,"LI",{});var v=r(_);ur=o(v,"A",{href:!0});var u2=r(ur);Hn=o(u2,"CODE",{});var m2=r(Hn);Qp=n(m2,"save_pretrained"),m2.forEach(t),u2.forEach(t),Wp=n(v," that accepts a local path, "),Un=o(v,"EM",{});var g2=r(Un);Jp=n(g2,"e.g."),g2.forEach(t),Kp=d(v),Bn=o(v,"CODE",{});var _2=r(Bn);Xp=n(_2,"./stable-diffusion"),_2.forEach(t),Zp=n(v," under which all models/components of the pipeline will be saved. For each component/model a folder is created inside the local path that is named after the given attribute name, "),Vn=o(v,"EM",{});var v2=r(Vn);eu=n(v2,"e.g."),v2.forEach(t),tu=d(v),Yn=o(v,"CODE",{});var E2=r(Yn);au=n(E2,"./stable_diffusion/unet"),E2.forEach(t),ou=n(v,`.
In addition, a `),zn=o(v,"CODE",{});var b2=r(zn);ru=n(b2,"model_index.json"),b2.forEach(t),lu=n(v," file is created at the root of the local path, "),Fn=o(v,"EM",{});var y2=r(Fn);nu=n(y2,"e.g."),y2.forEach(t),iu=d(v),Qn=o(v,"CODE",{});var w2=r(Qn);su=n(w2,"./stable_diffusion/model_index.json"),w2.forEach(t),fu=n(v,` so that the complete pipeline can again be instantiated
from the local path.`),v.forEach(t),du=d(bt),y=o(bt,"LI",{});var he=r(y);mr=o(he,"A",{href:!0});var T2=r(mr);Wn=o(T2,"CODE",{});var D2=r(Wn);hu=n(D2,"to"),D2.forEach(t),T2.forEach(t),cu=n(he," which accepts a "),Jn=o(he,"CODE",{});var I2=r(Jn);pu=n(I2,"string"),I2.forEach(t),uu=n(he," or "),Kn=o(he,"CODE",{});var x2=r(Kn);mu=n(x2,"torch.device"),x2.forEach(t),gu=n(he," to move all models that are of type "),Xn=o(he,"CODE",{});var A2=r(Xn);_u=n(A2,"torch.nn.Module"),A2.forEach(t),vu=n(he," to the passed device. The behavior is fully analogous to "),ye=o(he,"A",{href:!0,rel:!0});var ks=r(ye);Eu=n(ks,"PyTorch\u2019s "),Zn=o(ks,"CODE",{});var S2=r(Zn);bu=n(S2,"to"),S2.forEach(t),yu=n(ks," method"),ks.forEach(t),wu=n(he,"."),he.forEach(t),Tu=d(bt),b=o(bt,"LI",{});var T=r(b);ei=o(T,"CODE",{});var k2=r(ei);Du=n(k2,"__call__"),k2.forEach(t),Iu=n(T," method to use the pipeline in inference. "),ti=o(T,"CODE",{});var P2=r(ti);xu=n(P2,"__call__"),P2.forEach(t),Au=n(T," defines inference logic of the pipeline and should ideally encompass all aspects of it, from pre-processing to forwarding tensors to the different models and schedulers, as well as post-processing. The API of the "),ai=o(T,"CODE",{});var G2=r(ai);Su=n(G2,"__call__"),G2.forEach(t),ku=n(T," method can strongly vary from pipeline to pipeline. "),oi=o(T,"EM",{});var $2=r(oi);Pu=n($2,"E.g."),$2.forEach(t),Gu=n(T," a text-to-image pipeline, such as "),gr=o(T,"A",{href:!0});var O2=r(gr);ri=o(O2,"CODE",{});var M2=r(ri);$u=n(M2,"StableDiffusionPipeline"),M2.forEach(t),O2.forEach(t),Ou=n(T," should accept among other things the text prompt to generate the image. A pure image generation pipeline, such as "),Ea=o(T,"A",{href:!0,rel:!0});var R2=r(Ea);Mu=n(R2,"DDPMPipeline"),R2.forEach(t),Ru=n(T,` on the other hand can be run without providing any inputs. To better understand what inputs can be adapted for
each pipeline, one should look directly into the respective pipeline.`),T.forEach(t),bt.forEach(t),Zi=d(s),x=o(s,"P",{});var yt=r(x);li=o(yt,"STRONG",{});var C2=r(li);Cu=n(C2,"Note"),C2.forEach(t),ju=n(yt,": All pipelines have PyTorch\u2019s autograd disabled by decorating the "),ni=o(yt,"CODE",{});var j2=r(ni);Lu=n(j2,"__call__"),j2.forEach(t),Nu=n(yt," method with a "),ba=o(yt,"A",{href:!0,rel:!0});var L2=r(ba);ii=o(L2,"CODE",{});var N2=r(ii);qu=n(N2,"torch.no_grad"),N2.forEach(t),L2.forEach(t),Hu=n(yt,` decorator because pipelines should
not be used for training. If you want to store the gradients during the forward pass, we recommend writing your own pipeline, see also our `),ya=o(yt,"A",{href:!0,rel:!0});var q2=r(ya);Uu=n(q2,"community-examples"),q2.forEach(t),yt.forEach(t),es=d(s),we=o(s,"H2",{class:!0});var Ps=r(we);Ce=o(Ps,"A",{id:!0,class:!0,href:!0});var H2=r(Ce);si=o(H2,"SPAN",{});var U2=r(si);G(wa.$$.fragment,U2),U2.forEach(t),H2.forEach(t),Bu=d(Ps),fi=o(Ps,"SPAN",{});var B2=r(fi);Vu=n(B2,"Contribution"),B2.forEach(t),Ps.forEach(t),ts=d(s),w=o(s,"P",{});var ge=r(w);Yu=n(ge,`We are more than happy about any contribution to the officially supported pipelines \u{1F917}. We aspire
all of our pipelines to be  `),di=o(ge,"STRONG",{});var V2=r(di);zu=n(V2,"self-contained"),V2.forEach(t),Fu=n(ge,", "),hi=o(ge,"STRONG",{});var Y2=r(hi);Qu=n(Y2,"easy-to-tweak"),Y2.forEach(t),Wu=n(ge,", "),ci=o(ge,"STRONG",{});var z2=r(ci);Ju=n(z2,"beginner-friendly"),z2.forEach(t),Ku=n(ge," and for "),pi=o(ge,"STRONG",{});var F2=r(pi);Xu=n(F2,"one-purpose-only"),F2.forEach(t),Zu=n(ge,"."),ge.forEach(t),as=d(s),A=o(s,"UL",{});var wt=r(A);je=o(wt,"LI",{});var Ci=r(je);ui=o(Ci,"STRONG",{});var Q2=r(ui);em=n(Q2,"Self-contained"),Q2.forEach(t),tm=n(Ci,": A pipeline shall be as self-contained as possible. More specifically, this means that all functionality should be either directly defined in the pipeline file itself, should be inherited from (and only from) the "),Ta=o(Ci,"A",{href:!0});var Xm=r(Ta);mi=o(Xm,"CODE",{});var W2=r(mi);am=n(W2,"DiffusionPipeline"),W2.forEach(t),om=n(Xm," class"),Xm.forEach(t),rm=n(Ci," or be directly attached to the model and scheduler components of the pipeline."),Ci.forEach(t),lm=d(wt),pe=o(wt,"LI",{});var qa=r(pe);gi=o(qa,"STRONG",{});var J2=r(gi);nm=n(J2,"Easy-to-use"),J2.forEach(t),im=n(qa,`: Pipelines should be extremely easy to use - one should be able to load the pipeline and
use it for its designated task, `),_i=o(qa,"EM",{});var K2=r(_i);sm=n(K2,"e.g."),K2.forEach(t),fm=n(qa,` text-to-image generation, in just a couple of lines of code. Most
logic including pre-processing, an unrolled diffusion loop, and post-processing should all happen inside the `),vi=o(qa,"CODE",{});var X2=r(vi);dm=n(X2,"__call__"),X2.forEach(t),hm=n(qa," method."),qa.forEach(t),cm=d(wt),ue=o(wt,"LI",{});var Ha=r(ue);Ei=o(Ha,"STRONG",{});var Z2=r(Ei);pm=n(Z2,"Easy-to-tweak"),Z2.forEach(t),um=n(Ha,": Certain pipelines will not be able to handle all use cases and tasks that you might like them to. If you want to use a certain pipeline for a specific use case that is not yet supported, you might have to copy the pipeline file and tweak the code to your needs. We try to make the pipeline code as readable as possible so that each part \u2013from pre-processing to diffusing to post-processing\u2013 can easily be adapted. If you would like the community to benefit from your customized pipeline, we would love to see a contribution to our "),Da=o(Ha,"A",{href:!0,rel:!0});var eE=r(Da);mm=n(eE,"community-examples"),eE.forEach(t),gm=n(Ha,". If you feel that an important pipeline should be part of the official pipelines but isn\u2019t, a contribution to the "),_r=o(Ha,"A",{href:!0});var tE=r(_r);_m=n(tE,"official pipelines"),tE.forEach(t),vm=n(Ha," would be even better."),Ha.forEach(t),Em=d(wt),S=o(wt,"LI",{});var Se=r(S);bi=o(Se,"STRONG",{});var aE=r(bi);bm=n(aE,"One-purpose-only"),aE.forEach(t),ym=n(Se,": Pipelines should be used for one task and one task only. Even if two tasks are very similar from a modeling point of view, "),yi=o(Se,"EM",{});var oE=r(yi);wm=n(oE,"e.g."),oE.forEach(t),Tm=n(Se," image2image translation and in-painting, pipelines shall be used for one task only to keep them "),wi=o(Se,"EM",{});var rE=r(wi);Dm=n(rE,"easy-to-tweak"),rE.forEach(t),Im=n(Se," and "),Ti=o(Se,"EM",{});var lE=r(Ti);xm=n(lE,"readable"),lE.forEach(t),Am=n(Se,"."),Se.forEach(t),wt.forEach(t),os=d(s),Te=o(s,"H2",{class:!0});var Gs=r(Te);Le=o(Gs,"A",{id:!0,class:!0,href:!0});var nE=r(Le);Di=o(nE,"SPAN",{});var iE=r(Di);G(Ia.$$.fragment,iE),iE.forEach(t),nE.forEach(t),Sm=d(Gs),Ii=o(Gs,"SPAN",{});var sE=r(Ii);km=n(sE,"Examples"),sE.forEach(t),Gs.forEach(t),rs=d(s),De=o(s,"H3",{class:!0});var $s=r(De);Ne=o($s,"A",{id:!0,class:!0,href:!0});var fE=r(Ne);xi=o(fE,"SPAN",{});var dE=r(xi);G(xa.$$.fragment,dE),dE.forEach(t),fE.forEach(t),Pm=d($s),Ai=o($s,"SPAN",{});var hE=r(Ai);Gm=n(hE,"Text-to-Image generation with Stable Diffusion"),hE.forEach(t),$s.forEach(t),ls=d(s),G(Aa.$$.fragment,s),ns=d(s),Ie=o(s,"H3",{class:!0});var Os=r(Ie);qe=o(Os,"A",{id:!0,class:!0,href:!0});var cE=r(qe);Si=o(cE,"SPAN",{});var pE=r(Si);G(Sa.$$.fragment,pE),pE.forEach(t),cE.forEach(t),$m=d(Os),ki=o(Os,"SPAN",{});var uE=r(ki);Om=n(uE,"Image-to-Image text-guided generation with Stable Diffusion"),uE.forEach(t),Os.forEach(t),is=d(s),He=o(s,"P",{});var Ms=r(He);Mm=n(Ms,"The "),Pi=o(Ms,"CODE",{});var mE=r(Pi);Rm=n(mE,"StableDiffusionImg2ImgPipeline"),mE.forEach(t),Cm=n(Ms," lets you pass a text prompt and an initial image to condition the generation of new images."),Ms.forEach(t),ss=d(s),G(ka.$$.fragment,s),fs=d(s),Pa=o(s,"P",{});var Zm=r(Pa);jm=n(Zm,"You can also run this example on colab "),Ga=o(Zm,"A",{href:!0,rel:!0});var gE=r(Ga);vr=o(gE,"IMG",{src:!0,alt:!0}),gE.forEach(t),Zm.forEach(t),ds=d(s),xe=o(s,"H3",{class:!0});var Rs=r(xe);Ue=o(Rs,"A",{id:!0,class:!0,href:!0});var _E=r(Ue);Gi=o(_E,"SPAN",{});var vE=r(Gi);G($a.$$.fragment,vE),vE.forEach(t),_E.forEach(t),Lm=d(Rs),$i=o(Rs,"SPAN",{});var EE=r($i);Nm=n(EE,"Tweak prompts reusing seeds and latents"),EE.forEach(t),Rs.forEach(t),hs=d(s),me=o(s,"P",{});var wr=r(me);qm=n(wr,"You can generate your own latents to reproduce results, or tweak your prompt on a specific result you liked. "),Oa=o(wr,"A",{href:!0,rel:!0});var bE=r(Oa);Hm=n(bE,"This notebook"),bE.forEach(t),Um=n(wr," shows how to do it step by step. You can also run it in Google Colab "),Ma=o(wr,"A",{href:!0,rel:!0});var yE=r(Ma);Er=o(yE,"IMG",{src:!0,alt:!0}),yE.forEach(t),Bm=n(wr,"."),wr.forEach(t),cs=d(s),Ae=o(s,"H3",{class:!0});var Cs=r(Ae);Be=o(Cs,"A",{id:!0,class:!0,href:!0});var wE=r(Be);Oi=o(wE,"SPAN",{});var TE=r(Oi);G(Ra.$$.fragment,TE),TE.forEach(t),wE.forEach(t),Vm=d(Cs),Mi=o(Cs,"SPAN",{});var DE=r(Mi);Ym=n(DE,"In-painting using Stable Diffusion"),DE.forEach(t),Cs.forEach(t),ps=d(s),Ve=o(s,"P",{});var js=r(Ve);zm=n(js,"The "),Ri=o(js,"CODE",{});var IE=r(Ri);Fm=n(IE,"StableDiffusionInpaintPipeline"),IE.forEach(t),Qm=n(js," lets you edit specific parts of an image by providing a mask and text prompt."),js.forEach(t),us=d(s),G(Ca.$$.fragment,s),ms=d(s),ja=o(s,"P",{});var eg=r(ja);Wm=n(eg,"You can also run this example on colab "),La=o(eg,"A",{href:!0,rel:!0});var xE=r(La);br=o(xE,"IMG",{src:!0,alt:!0}),xE.forEach(t),eg.forEach(t),this.h()},h(){i(_e,"name","hf:doc:metadata"),i(_e,"content",JSON.stringify(ME)),i(Pe,"id","pipelines"),i(Pe,"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"),i(Pe,"href","#pipelines"),i(ve,"class","relative group"),i(Dt,"href","https://huggingface.co/blog/stable_diffusion"),i(Dt,"rel","nofollow"),i(Va,"href","./api/models#vae"),i(Ya,"href","./api/models#UNet2DConditionModel"),i(It,"href","https://huggingface.co/docs/transformers/v4.21.2/en/model_doc/clip#transformers.CLIPTextModel"),i(It,"rel","nofollow"),i(za,"href","./api/scheduler#pndm"),i(St,"href","https://huggingface.co/docs/transformers/v4.21.2/en/model_doc/clip#transformers.CLIPFeatureExtractor"),i(St,"rel","nofollow"),i(Fa,"href","./stable_diffusion#safety_checker"),i(Pt,"href","https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines/latent_diffusion"),i(Pt,"rel","nofollow"),i(Gt,"href","https://arxiv.org/abs/2112.10752"),i(Gt,"rel","nofollow"),i(Ja,"href","#pipelines-api"),i(Wa,"start","2"),i(Xa,"href","#pipelines-summary"),i(Ka,"start","3"),i(eo,"href","#contribution"),i(Za,"start","4"),i(Rt,"href","https://github.com/huggingface/diffusers/tree/main/examples"),i(Rt,"rel","nofollow"),i($e,"id","diffusers-summary"),i($e,"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"),i($e,"href","#diffusers-summary"),i(Ee,"class","relative group"),i(ao,"align","center"),i(oo,"align","center"),i(ro,"href","./alt_diffusion"),i(jt,"href","https://arxiv.org/abs/2211.06679"),i(jt,"rel","nofollow"),i(lo,"align","center"),i(no,"align","center"),i(io,"href","./audio_diffusion"),i(Lt,"href","https://github.com/teticio/audio_diffusion.git"),i(Lt,"rel","nofollow"),i(so,"align","center"),i(Fr,"align","center"),i(fo,"href","./cycle_diffusion"),i(Nt,"href","https://arxiv.org/abs/2210.05559"),i(Nt,"rel","nofollow"),i(ho,"align","center"),i(Kr,"align","center"),i(co,"href","./dance_diffusion"),i(qt,"href","https://github.com/williamberman/diffusers.git"),i(qt,"rel","nofollow"),i(po,"align","center"),i(tl,"align","center"),i(uo,"href","./ddpm"),i(Ht,"href","https://arxiv.org/abs/2006.11239"),i(Ht,"rel","nofollow"),i(mo,"align","center"),i(ll,"align","center"),i(go,"href","./ddim"),i(Ut,"href","https://arxiv.org/abs/2010.02502"),i(Ut,"rel","nofollow"),i(_o,"align","center"),i(fl,"align","center"),i(vo,"href","./latent_diffusion"),i(Bt,"href","https://arxiv.org/abs/2112.10752"),i(Bt,"rel","nofollow"),i(Eo,"align","center"),i(pl,"align","center"),i(bo,"href","./latent_diffusion"),i(Vt,"href","https://arxiv.org/abs/2112.10752"),i(Vt,"rel","nofollow"),i(yo,"align","center"),i(_l,"align","center"),i(wo,"href","./latent_diffusion_uncond"),i(Yt,"href","https://arxiv.org/abs/2112.10752"),i(Yt,"rel","nofollow"),i(To,"align","center"),i(yl,"align","center"),i(Do,"href","./paint_by_example"),i(zt,"href","https://arxiv.org/abs/2211.13227"),i(zt,"rel","nofollow"),i(Io,"align","center"),i(Il,"align","center"),i(xo,"href","./pndm"),i(Ft,"href","https://arxiv.org/abs/2202.09778"),i(Ft,"rel","nofollow"),i(Ao,"align","center"),i(kl,"align","center"),i(So,"href","./score_sde_ve"),i(Qt,"href","https://openreview.net/forum?id=PxTIG12RRHS"),i(Qt,"rel","nofollow"),i(ko,"align","center"),i(Ol,"align","center"),i(Po,"href","./score_sde_vp"),i(Wt,"href","https://openreview.net/forum?id=PxTIG12RRHS"),i(Wt,"rel","nofollow"),i(Go,"align","center"),i(jl,"align","center"),i($o,"href","./stable_diffusion"),i(Jt,"href","https://stability.ai/blog/stable-diffusion-public-release"),i(Jt,"rel","nofollow"),i(Oo,"align","center"),Ua(Ro.src,og="https://colab.research.google.com/assets/colab-badge.svg")||i(Ro,"src",og),i(Ro,"alt","Open In Colab"),i(Kt,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb"),i(Kt,"rel","nofollow"),i(Mo,"align","center"),i(Co,"href","./stable_diffusion"),i(Xt,"href","https://stability.ai/blog/stable-diffusion-public-release"),i(Xt,"rel","nofollow"),i(jo,"align","center"),Ua(No.src,rg="https://colab.research.google.com/assets/colab-badge.svg")||i(No,"src",rg),i(No,"alt","Open In Colab"),i(Zt,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb"),i(Zt,"rel","nofollow"),i(Lo,"align","center"),i(qo,"href","./stable_diffusion"),i(ea,"href","https://stability.ai/blog/stable-diffusion-public-release"),i(ea,"rel","nofollow"),i(Ho,"align","center"),Ua(Bo.src,lg="https://colab.research.google.com/assets/colab-badge.svg")||i(Bo,"src",lg),i(Bo,"alt","Open In Colab"),i(ta,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb"),i(ta,"rel","nofollow"),i(Uo,"align","center"),i(Vo,"href","./stable_diffusion_2"),i(aa,"href","https://stability.ai/blog/stable-diffusion-v2-release"),i(aa,"rel","nofollow"),i(Yo,"align","center"),i(Jl,"align","center"),i(zo,"href","./stable_diffusion_2"),i(oa,"href","https://stability.ai/blog/stable-diffusion-v2-release"),i(oa,"rel","nofollow"),i(Fo,"align","center"),i(en,"align","center"),i(Qo,"href","./stable_diffusion_2"),i(ra,"href","https://stability.ai/blog/stable-diffusion-v2-release"),i(ra,"rel","nofollow"),i(Wo,"align","center"),i(rn,"align","center"),i(Jo,"href","./stable_diffusion_safe"),i(la,"href","https://arxiv.org/abs/2211.05105"),i(la,"rel","nofollow"),i(Ko,"align","center"),Ua(Zo.src,ng="https://colab.research.google.com/assets/colab-badge.svg")||i(Zo,"src",ng),i(Zo,"alt","Open In Colab"),i(na,"href","https://colab.research.google.com/github/ml-research/safe-latent-diffusion/blob/main/examples/Safe%20Latent%20Diffusion.ipynb"),i(na,"rel","nofollow"),i(Xo,"align","center"),i(er,"href","./stochastic_karras_ve"),i(ia,"href","https://arxiv.org/abs/2206.00364"),i(ia,"rel","nofollow"),i(tr,"align","center"),i(cn,"align","center"),i(ar,"href","./unclip"),i(sa,"href","https://arxiv.org/abs/2204.06125"),i(sa,"rel","nofollow"),i(or,"align","center"),i(mn,"align","center"),i(rr,"href","./versatile_diffusion"),i(fa,"href","https://arxiv.org/abs/2211.08332"),i(fa,"rel","nofollow"),i(lr,"align","center"),i(vn,"align","center"),i(nr,"href","./versatile_diffusion"),i(da,"href","https://arxiv.org/abs/2211.08332"),i(da,"rel","nofollow"),i(ir,"align","center"),i(yn,"align","center"),i(sr,"href","./versatile_diffusion"),i(ha,"href","https://arxiv.org/abs/2211.08332"),i(ha,"rel","nofollow"),i(fr,"align","center"),i(Dn,"align","center"),i(dr,"href","./vq_diffusion"),i(ca,"href","https://arxiv.org/abs/2111.14822"),i(ca,"rel","nofollow"),i(hr,"align","center"),i(An,"align","center"),i(cr,"href","#examples"),i(Re,"id","pipelines-api"),i(Re,"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"),i(Re,"href","#pipelines-api"),i(be,"class","relative group"),i(ma,"href","https://github.com/huggingface/transformers"),i(ma,"rel","nofollow"),i(ga,"href","../diffusion_pipeline"),i(_a,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),i(_a,"rel","nofollow"),i(va,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/model_index.json"),i(va,"rel","nofollow"),i(ur,"href","../diffusion_pipeline"),i(mr,"href","../diffusion_pipeline"),i(ye,"href","https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.to"),i(ye,"rel","nofollow"),i(gr,"href","./stable_diffusion"),i(Ea,"href","https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines/ddpm"),i(Ea,"rel","nofollow"),i(ba,"href","https://pytorch.org/docs/stable/generated/torch.no_grad.html"),i(ba,"rel","nofollow"),i(ya,"href","https://github.com/huggingface/diffusers/tree/main/examples/community"),i(ya,"rel","nofollow"),i(Ce,"id","contribution"),i(Ce,"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"),i(Ce,"href","#contribution"),i(we,"class","relative group"),i(Ta,"href",".../diffusion_pipeline"),i(Da,"href","https://github.com/huggingface/diffusers/tree/main/examples/community"),i(Da,"rel","nofollow"),i(_r,"href","./overview"),i(Le,"id","examples"),i(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Le,"href","#examples"),i(Te,"class","relative group"),i(Ne,"id","texttoimage-generation-with-stable-diffusion"),i(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Ne,"href","#texttoimage-generation-with-stable-diffusion"),i(De,"class","relative group"),i(qe,"id","imagetoimage-textguided-generation-with-stable-diffusion"),i(qe,"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"),i(qe,"href","#imagetoimage-textguided-generation-with-stable-diffusion"),i(Ie,"class","relative group"),Ua(vr.src,ig="https://colab.research.google.com/assets/colab-badge.svg")||i(vr,"src",ig),i(vr,"alt","Open In Colab"),i(Ga,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb"),i(Ga,"rel","nofollow"),i(Ue,"id","tweak-prompts-reusing-seeds-and-latents"),i(Ue,"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"),i(Ue,"href","#tweak-prompts-reusing-seeds-and-latents"),i(xe,"class","relative group"),i(Oa,"href","https://github.com/pcuenca/diffusers-examples/blob/main/notebooks/stable-diffusion-seeds.ipynb"),i(Oa,"rel","nofollow"),Ua(Er.src,sg="https://colab.research.google.com/assets/colab-badge.svg")||i(Er,"src",sg),i(Er,"alt","Open In Colab"),i(Ma,"href","https://colab.research.google.com/github/pcuenca/diffusers-examples/blob/main/notebooks/stable-diffusion-seeds.ipynb"),i(Ma,"rel","nofollow"),i(Be,"id","inpainting-using-stable-diffusion"),i(Be,"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"),i(Be,"href","#inpainting-using-stable-diffusion"),i(Ae,"class","relative group"),Ua(br.src,fg="https://colab.research.google.com/assets/colab-badge.svg")||i(br,"src",fg),i(br,"alt","Open In Colab"),i(La,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb"),i(La,"rel","nofollow")},m(s,h){e(document.head,_e),c(s,ji,h),c(s,ve,h),e(ve,Pe),e(Pe,Tr),$(Tt,Tr,null),e(ve,Ls),e(ve,Dr),e(Dr,Ns),c(s,Li,h),c(s,Ba,h),e(Ba,qs),c(s,Ni,h),c(s,Ge,h),e(Ge,Hs),e(Ge,Dt),e(Dt,Us),e(Ge,Bs),c(s,qi,h),c(s,E,h),e(E,Ir),e(Ir,Va),e(Va,Vs),e(E,Ys),e(E,xr),e(xr,Ya),e(Ya,zs),e(E,Fs),e(E,Ar),e(Ar,It),e(It,Qs),e(E,Ws),e(E,xt),e(xt,Js),e(xt,za),e(za,Ks),e(xt,Xs),e(E,Zs),e(E,At),e(At,ef),e(At,St),e(St,tf),e(At,af),e(E,of),e(E,kt),e(kt,rf),e(kt,Fa),e(Fa,lf),e(kt,nf),c(s,Hi,h),c(s,Qa,h),e(Qa,sf),c(s,Ui,h),c(s,D,h),e(D,Sr),e(Sr,kr),e(kr,C),e(C,ff),e(C,Pr),e(Pr,df),e(C,hf),e(C,Pt),e(Pt,cf),e(C,pf),e(C,Gt),e(Gt,uf),e(C,mf),e(D,gf),e(D,Gr),e(Gr,Wa),e(Wa,$t),e($t,_f),e($t,Ja),e(Ja,vf),e($t,Ef),e(D,bf),e(D,$r),e($r,Ka),e(Ka,Ot),e(Ot,yf),e(Ot,Xa),e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,or),e(or,Rc),e(ne,Cc),e(ne,mn),e(p,jc),e(p,ie),e(ie,gn),e(gn,rr),e(rr,Lc),e(ie,Nc),e(ie,_n),e(_n,fa),e(fa,qc),e(ie,Hc),e(ie,lr),e(lr,Uc),e(ie,Bc),e(ie,vn),e(p,Vc),e(p,se),e(se,En),e(En,nr),e(nr,Yc),e(se,zc),e(se,bn),e(bn,da),e(da,Fc),e(se,Qc),e(se,ir),e(ir,Wc),e(se,Jc),e(se,yn),e(p,Kc),e(p,fe),e(fe,wn),e(wn,sr),e(sr,Xc),e(fe,Zc),e(fe,Tn),e(Tn,ha),e(ha,ep),e(fe,tp),e(fe,fr),e(fr,ap),e(fe,op),e(fe,Dn),e(p,rp),e(p,de),e(de,In),e(In,dr),e(dr,lp),e(de,np),e(de,xn),e(xn,ca),e(ca,ip),e(de,sp),e(de,hr),e(hr,fp),e(de,dp),e(de,An),c(s,Fi,h),c(s,pa,h),e(pa,Sn),e(Sn,hp),e(pa,cp),c(s,Qi,h),c(s,Me,h),e(Me,pp),e(Me,cr),e(cr,up),e(Me,mp),c(s,Wi,h),c(s,be,h),e(be,Re),e(Re,kn),$(ua,kn,null),e(be,gp),e(be,Pn),e(Pn,_p),c(s,Ji,h),c(s,pr,h),e(pr,vp),c(s,Ki,h),c(s,ce,h),e(ce,Ep),e(ce,Gn),e(Gn,bp),e(ce,yp),e(ce,ma),e(ma,wp),e(ce,Tp),c(s,Xi,h),c(s,I,h),e(I,m),e(m,ga),e(ga,$n),e($n,Dp),e(ga,Ip),e(m,xp),e(m,On),e(On,Ap),e(m,Sp),e(m,_a),e(_a,kp),e(m,Pp),e(m,Mn),e(Mn,Gp),e(m,$p),e(m,Rn),e(Rn,Op),e(m,Mp),e(m,Cn),e(Cn,Rp),e(m,Cp),e(m,va),e(va,jp),e(m,Lp),e(m,jn),e(jn,Np),e(m,qp),e(m,Ln),e(Ln,Hp),e(m,Up),e(m,Nn),e(Nn,Bp),e(m,Vp),e(m,qn),e(qn,Yp),e(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,Ei),e(Ei,pm),e(ue,um),e(ue,Da),e(Da,mm),e(ue,gm),e(ue,_r),e(_r,_m),e(ue,vm),e(A,Em),e(A,S),e(S,bi),e(bi,bm),e(S,ym),e(S,yi),e(yi,wm),e(S,Tm),e(S,wi),e(wi,Dm),e(S,Im),e(S,Ti),e(Ti,xm),e(S,Am),c(s,os,h),c(s,Te,h),e(Te,Le),e(Le,Di),$(Ia,Di,null),e(Te,Sm),e(Te,Ii),e(Ii,km),c(s,rs,h),c(s,De,h),e(De,Ne),e(Ne,xi),$(xa,xi,null),e(De,Pm),e(De,Ai),e(Ai,Gm),c(s,ls,h),$(Aa,s,h),c(s,ns,h),c(s,Ie,h),e(Ie,qe),e(qe,Si),$(Sa,Si,null),e(Ie,$m),e(Ie,ki),e(ki,Om),c(s,is,h),c(s,He,h),e(He,Mm),e(He,Pi),e(Pi,Rm),e(He,Cm),c(s,ss,h),$(ka,s,h),c(s,fs,h),c(s,Pa,h),e(Pa,jm),e(Pa,Ga),e(Ga,vr),c(s,ds,h),c(s,xe,h),e(xe,Ue),e(Ue,Gi),$($a,Gi,null),e(xe,Lm),e(xe,$i),e($i,Nm),c(s,hs,h),c(s,me,h),e(me,qm),e(me,Oa),e(Oa,Hm),e(me,Um),e(me,Ma),e(Ma,Er),e(me,Bm),c(s,cs,h),c(s,Ae,h),e(Ae,Be),e(Be,Oi),$(Ra,Oi,null),e(Ae,Vm),e(Ae,Mi),e(Mi,Ym),c(s,ps,h),c(s,Ve,h),e(Ve,zm),e(Ve,Ri),e(Ri,Fm),e(Ve,Qm),c(s,us,h),$(Ca,s,h),c(s,ms,h),c(s,ja,h),e(ja,Wm),e(ja,La),e(La,br),gs=!0},p:GE,i(s){gs||(O(Tt.$$.fragment,s),O(Ct.$$.fragment,s),O(ua.$$.fragment,s),O(wa.$$.fragment,s),O(Ia.$$.fragment,s),O(xa.$$.fragment,s),O(Aa.$$.fragment,s),O(Sa.$$.fragment,s),O(ka.$$.fragment,s),O($a.$$.fragment,s),O(Ra.$$.fragment,s),O(Ca.$$.fragment,s),gs=!0)},o(s){M(Tt.$$.fragment,s),M(Ct.$$.fragment,s),M(ua.$$.fragment,s),M(wa.$$.fragment,s),M(Ia.$$.fragment,s),M(xa.$$.fragment,s),M(Aa.$$.fragment,s),M(Sa.$$.fragment,s),M(ka.$$.fragment,s),M($a.$$.fragment,s),M(Ra.$$.fragment,s),M(Ca.$$.fragment,s),gs=!1},d(s){t(_e),s&&t(ji),s&&t(ve),R(Tt),s&&t(Li),s&&t(Ba),s&&t(Ni),s&&t(Ge),s&&t(qi),s&&t(E),s&&t(Hi),s&&t(Qa),s&&t(Ui),s&&t(D),s&&t(Bi),s&&t(j),s&&t(Vi),s&&t(Ee),R(Ct),s&&t(Yi),s&&t(to),s&&t(zi),s&&t(Oe),s&&t(Fi),s&&t(pa),s&&t(Qi),s&&t(Me),s&&t(Wi),s&&t(be),R(ua),s&&t(Ji),s&&t(pr),s&&t(Ki),s&&t(ce),s&&t(Xi),s&&t(I),s&&t(Zi),s&&t(x),s&&t(es),s&&t(we),R(wa),s&&t(ts),s&&t(w),s&&t(as),s&&t(A),s&&t(os),s&&t(Te),R(Ia),s&&t(rs),s&&t(De),R(xa),s&&t(ls),R(Aa,s),s&&t(ns),s&&t(Ie),R(Sa),s&&t(is),s&&t(He),s&&t(ss),R(ka,s),s&&t(fs),s&&t(Pa),s&&t(ds),s&&t(xe),R($a),s&&t(hs),s&&t(me),s&&t(cs),s&&t(Ae),R(Ra),s&&t(ps),s&&t(Ve),s&&t(us),R(Ca,s),s&&t(ms),s&&t(ja)}}}const ME={local:"pipelines",sections:[{local:"diffusers-summary",title:"\u{1F9E8} Diffusers Summary"},{local:"pipelines-api",title:"Pipelines API"},{local:"contribution",title:"Contribution"},{local:"examples",sections:[{local:"texttoimage-generation-with-stable-diffusion",title:"Text-to-Image generation with Stable Diffusion"},{local:"imagetoimage-textguided-generation-with-stable-diffusion",title:"Image-to-Image text-guided generation with Stable Diffusion"},{local:"tweak-prompts-reusing-seeds-and-latents",title:"Tweak prompts reusing seeds and latents"},{local:"inpainting-using-stable-diffusion",title:"In-painting using Stable Diffusion"}],title:"Examples"}],title:"Pipelines"};function RE(ag){return $E(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class NE extends AE{constructor(_e){super();SE(this,_e,RE,OE,kE,{})}}export{NE as default,ME as metadata};
