import{S as vr,i as jr,s as Zr,e as s,k as p,w as h,t as o,M as _r,c as a,d as t,m as c,a as i,x as m,h as r,b as n,N as Mn,G as l,g as f,y as d,L as Gr,q as y,o as M,B as b,v as Br}from"../../chunks/vendor-hf-doc-builder.js";import{I as S}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as me}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as Ir}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function Wr(bn){let Q,Ct,N,K,Kl,de,Vs,Ol,Ss,Xt,ye,Vt,Ke,et,Me,Qs,be,Ns,xs,St,x,lt,Ds,Ys,tt,$s,Fs,Qt,O,st,J,Oe,zs,As,el,qs,Ps,ll,Hs,Ls,tl,Ks,Os,sl,ea,la,g,w,al,ta,sa,il,aa,ia,nl,ol,na,oa,rl,ge,pl,gn,ra,cl,Je,pa,ca,U,ul,ua,fa,ee,ha,we,ma,da,ya,fl,hl,Ma,ba,ml,ga,Ja,dl,Ue,wa,Ua,T,yl,Ta,va,Ml,ja,Za,bl,gl,_a,Ga,Jl,Ba,Ia,wl,Te,Wa,Ea,v,Ul,ka,Ra,_,at,Ca,Xa,ve,Va,Sa,je,Qa,Na,Ze,xa,Da,Tl,vl,Ya,$a,jl,Fa,za,Zl,_e,Aa,qa,j,_l,Pa,Ha,Ge,it,La,Ka,Oa,Gl,Bl,ei,li,Il,ti,si,Wl,Be,ai,ii,Z,El,ni,oi,kl,ri,pi,Rl,Cl,ci,ui,Xl,fi,hi,Vl,Ie,mi,Nt,G,di,nt,yi,Mi,ot,bi,gi,rt,Ji,wi,xt,We,Dt,D,le,pt,Ee,Ui,ct,Ti,Yt,Y,te,ut,ke,vi,ft,ji,$t,Sl,Zi,Ft,Ql,_i,zt,Re,At,se,Gi,ht,Bi,Ii,qt,Ce,Nl,Jn,Wi,Pt,$,ae,mt,Xe,Ei,dt,ki,Ht,xl,Ri,Lt,Ve,Kt,F,yt,Ci,Xi,Se,Vi,Si,Ot,z,ie,Mt,Qe,Qi,bt,Ni,es,Dl,xi,ls,Ne,ts,I,Di,gt,Yi,$i,Jt,Fi,zi,ss,Yl,wt,xe,Ai,De,qi,Pi,as,A,ne,Ut,Ye,Hi,Tt,Li,is,$l,Ki,ns,$e,os,Fl,Oi,rs,q,oe,vt,Fe,en,jt,ln,ps,zl,tn,cs,P,re,Zt,ze,sn,_t,an,us,Ae,fs,H,pe,Gt,qe,nn,Bt,on,hs,Pe,ms,ce,rn,It,pn,cn,ds,L,ue,Wt,He,un,Et,fn,ys,Al,hn,Ms,Le,bs,ql,mn,gs,Pl,Hl,wn,Js;return de=new S({}),ye=new Ir({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/custom_pipeline_examples.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/custom_pipeline_examples.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/custom_pipeline_examples.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/custom_pipeline_examples.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/custom_pipeline_examples.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/custom_pipeline_examples.ipynb"}]}}),We=new me({props:{code:"cGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTJDJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIyZmlsZW5hbWVfaW5fdGhlX2NvbW11bml0eV9mb2xkZXIlMjIlMEEp",highlighted:`pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;filename_in_the_community_folder&quot;</span>
)`}}),Ee=new S({}),ke=new S({}),Re=new me({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBJbWFnZVByb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBDTElQSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmxhaW9uJTJGQ0xJUC1WaVQtQi0zMi1sYWlvbjJCLXMzNEItYjc5SyUyMiklMEFjbGlwX21vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJsYWlvbiUyRkNMSVAtVmlULUItMzItbGFpb24yQi1zMzRCLWI3OUslMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTBBJTBBZ3VpZGVkX3BpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMkMlMEElMjAlMjAlMjAlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJjbGlwX2d1aWRlZF9zdGFibGVfZGlmZnVzaW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwY2xpcF9tb2RlbCUzRGNsaXBfbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBmZWF0dXJlX2V4dHJhY3RvciUzRGZlYXR1cmVfZXh0cmFjdG9yJTJDJTBBJTIwJTIwJTIwJTIwd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cyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjbGlwX2d1aWRhbmNlX3NjYWxlJTNEMTAwJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbnVtX2N1dG91dHMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdXNlX2N1dG91dHMlM0RGYWxzZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMCkuaW1hZ2VzJTVCMCU1RCUwQSUyMCUyMCUyMCUyMGltYWdlcy5hcHBlbmQoaW1hZ2UpJTBBJTBBJTIzJTIwc2F2ZSUyMGltYWdlcyUyMGxvY2FsbHklMEFmb3IlMjBpJTJDJTIwaW1nJTIwaW4lMjBlbnVtZXJhdGUoaW1hZ2VzKSUzQSUwQSUyMCUyMCUyMCUyMGltZy5zYXZlKGYlMjIuJTJGY2xpcF9ndWlkZWRfc2QlMkZpbWFnZV8lN0JpJTdELnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPImageProcessor, CLIPModel
<span class="hljs-keyword">import</span> torch


feature_extractor = CLIPImageProcessor.from_pretrained(<span class="hljs-string">&quot;laion/CLIP-ViT-B-32-laion2B-s34B-b79K&quot;</span>)
clip_model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;laion/CLIP-ViT-B-32-laion2B-s34B-b79K&quot;</span>, torch_dtype=torch.float16)


guided_pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    custom_pipeline=<span class="hljs-string">&quot;clip_guided_stable_diffusion&quot;</span>,
    clip_model=clip_model,
    feature_extractor=feature_extractor,
    torch_dtype=torch.float16,
)
guided_pipeline.enable_attention_slicing()
guided_pipeline = guided_pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;fantasy book cover, full moon, fantasy forest landscape, golden vector elements, fantasy magic, dark light night, intricate, elegant, sharp focus, illustration, highly detailed, digital painting, concept art, matte, art by WLOP and Artgerm and Albert Bierstadt, masterpiece&quot;</span>

generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">0</span>)
images = []
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">4</span>):
    image = guided_pipeline(
        prompt,
        num_inference_steps=<span class="hljs-number">50</span>,
        guidance_scale=<span class="hljs-number">7.5</span>,
        clip_guidance_scale=<span class="hljs-number">100</span>,
        num_cutouts=<span class="hljs-number">4</span>,
        use_cutouts=<span class="hljs-literal">False</span>,
        generator=generator,
    ).images[<span class="hljs-number">0</span>]
    images.append(image)

<span class="hljs-comment"># save images locally</span>
<span class="hljs-keyword">for</span> i, img <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(images):
    img.save(<span class="hljs-string">f&quot;./clip_guided_sd/image_<span class="hljs-subst">{i}</span>.png&quot;</span>)`}}),Xe=new S({}),Ve=new me({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMkMlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJvbmVfc3RlcF91bmV0JTIyKSUwQXBpcGUoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;one_step_unet&quot;</span>)
pipe()`}}),Qe=new S({}),Ne=new me({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBzYWZldHlfY2hlY2tlciUzRE5vbmUlMkMlMjAlMjAlMjMlMjBWZXJ5JTIwaW1wb3J0YW50JTIwZm9yJTIwdmlkZW9zLi4ubG90cyUyMG9mJTIwZmFsc2UlMjBwb3NpdGl2ZXMlMjB3aGlsZSUyMGludGVycG9sYXRpbmclMEElMjAlMjAlMjAlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJpbnRlcnBvbGF0ZV9zdGFibGVfZGlmZnVzaW9uJTIyJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX2F0dGVudGlvbl9zbGljaW5nKCklMEElMEFmcmFtZV9maWxlcGF0aHMlMjAlM0QlMjBwaXBlLndhbGsoJTBBJTIwJTIwJTIwJTIwcHJvbXB0cyUzRCU1QiUyMmElMjBkb2clMjIlMkMlMjAlMjJhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMGhvcnNlJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwc2VlZHMlM0QlNUI0MiUyQyUyMDEzMzclMkMlMjAxMjM0JTVEJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2ludGVycG9sYXRpb25fc3RlcHMlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGZHJlYW1zJTIyJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDQlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q1MTIlMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDUxMiUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEOC41JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    torch_dtype=torch.float16,
    safety_checker=<span class="hljs-literal">None</span>,  <span class="hljs-comment"># Very important for videos...lots of false positives while interpolating</span>
    custom_pipeline=<span class="hljs-string">&quot;interpolate_stable_diffusion&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.enable_attention_slicing()

frame_filepaths = pipe.walk(
    prompts=[<span class="hljs-string">&quot;a dog&quot;</span>, <span class="hljs-string">&quot;a cat&quot;</span>, <span class="hljs-string">&quot;a horse&quot;</span>],
    seeds=[<span class="hljs-number">42</span>, <span class="hljs-number">1337</span>, <span class="hljs-number">1234</span>],
    num_interpolation_steps=<span class="hljs-number">16</span>,
    output_dir=<span class="hljs-string">&quot;./dreams&quot;</span>,
    batch_size=<span class="hljs-number">4</span>,
    height=<span class="hljs-number">512</span>,
    width=<span class="hljs-number">512</span>,
    guidance_scale=<span class="hljs-number">8.5</span>,
    num_inference_steps=<span class="hljs-number">50</span>,
)`}}),Ye=new S({}),$e=new me({props:{code:"JTIzISUyRnVzciUyRmJpbiUyRmVudiUyMHB5dGhvbjMlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9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DUxMiUyQyUyMDUxMikpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMGNhdCUyMHNpdHRpbmclMjBvbiUyMGElMjBiZW5jaCUyMiUwQWltYWdlcyUyMCUzRCUyMHBpcGUuaW5wYWludChwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTNEbWFza19pbWFnZSUyQyUyMHN0cmVuZ3RoJTNEMC43NSkuaW1hZ2Vz",highlighted:`<span class="hljs-comment">#!/usr/bin/env python3</span>
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> PIL
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">import</span> torch


<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>)


pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    custom_pipeline=<span class="hljs-string">&quot;stable_diffusion_mega&quot;</span>,
    torch_dtype=torch.float16,
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.enable_attention_slicing()


<span class="hljs-comment">### Text-to-Image</span>

images = pipe.text2img(<span class="hljs-string">&quot;An astronaut riding a horse&quot;</span>).images

<span class="hljs-comment">### Image-to-Image</span>

init_image = download_image(
    <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
)

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

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

<span class="hljs-comment">### Inpainting</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>))

prompt = <span class="hljs-string">&quot;a cat sitting on a bench&quot;</span>
images = pipe.inpaint(prompt=prompt, image=init_image, mask_image=mask_image, strength=<span class="hljs-number">0.75</span>).images`}}),Fe=new S({}),ze=new S({}),Ae=new me({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmhha3VyZWklMkZ3YWlmdS1kaWZmdXNpb24lMjIlMkMlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJscHdfc3RhYmxlX2RpZmZ1c2lvbiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmJlc3RfcXVhbGl0eSUyMCgxZ2lybCUzQTEuMyklMjBib3clMjBicmlkZSUyMGJyb3duX2hhaXIlMjBjbG9zZWRfbW91dGglMjBmcmlsbGVkX2JvdyUyMGZyaWxsZWRfaGFpcl90dWJlcyUyMGZyaWxscyUyMChmdWxsX2JvZHklM0ExLjMpJTIwZm94X2VhciUyMGhhaXJfYm93JT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GRpbmdzX211bHRpcGxlcyUzRDMpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;hakurei/waifu-diffusion&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;lpw_stable_diffusion&quot;</span>, torch_dtype=torch.float16
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;best_quality (1girl:1.3) bow bride brown_hair closed_mouth frilled_bow frilled_hair_tubes frills (full_body:1.3) fox_ear hair_bow hair_tubes happy hood japanese_clothes kimono long_sleeves red_bow smile solo tabi uchikake white_kimono wide_sleeves cherry_blossoms&quot;</span>
neg_prompt = <span class="hljs-string">&quot;lowres, bad_anatomy, error_body, error_hair, error_arm, error_hands, bad_hands, error_fingers, bad_fingers, missing_fingers, error_legs, bad_legs, multiple_legs, missing_legs, error_lighting, error_shadow, error_reflection, text, error, extra_digit, fewer_digits, cropped, worst_quality, low_quality, normal_quality, jpeg_artifacts, signature, watermark, username, blurry&quot;</span>

pipe.text2img(prompt, negative_prompt=neg_prompt, width=<span class="hljs-number">512</span>, height=<span class="hljs-number">512</span>, max_embeddings_multiples=<span class="hljs-number">3</span>).images[<span class="hljs-number">0</span>]`}}),qe=new S({}),Pe=new me({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMkMlMEElMjAlMjAlMjAlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJscHdfc3RhYmxlX2RpZmZ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cGUudGV4dDJpbWcocHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnX3Byb21wdCUyQyUyMHdpZHRoJTNENTEyJTJDJTIwaGVpZ2h0JTNENTEyJTJDJTIwbWF4X2VtYmVkZGluZ3NfbXVsdGlwbGVzJTNEMykuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    custom_pipeline=<span class="hljs-string">&quot;lpw_stable_diffusion_onnx&quot;</span>,
    revision=<span class="hljs-string">&quot;onnx&quot;</span>,
    provider=<span class="hljs-string">&quot;CUDAExecutionProvider&quot;</span>,
)

prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars, best quality&quot;</span>
neg_prompt = <span class="hljs-string">&quot;lowres, bad anatomy, error body, error hair, error arm, error hands, bad hands, error fingers, bad fingers, missing fingers, error legs, bad legs, multiple legs, missing legs, error lighting, error shadow, error reflection, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry&quot;</span>

pipe.text2img(prompt, negative_prompt=neg_prompt, width=<span class="hljs-number">512</span>, height=<span class="hljs-number">512</span>, max_embeddings_multiples=<span class="hljs-number">3</span>).images[<span class="hljs-number">0</span>]`}}),He=new S({}),Le=new me({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBtYXRwbG90bGliLnB5cGxvdCUyMGFzJTIwcGx0JTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBX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NoX3RvX2ltYWdlX2RpZmZ1c2lvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMHNwZWVjaF9tb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwc3BlZWNoX3Byb2Nlc3NvciUzRHByb2Nlc3NvciUyQyUwQSUyMCUyMCUyMCUyMCUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSklMEElMEFkaWZmdXNlcl9waXBlbGluZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWRpZmZ1c2VyX3BpcGVsaW5lJTIwJTNEJTIwZGlmZnVzZXJfcGlwZWxpbmUudG8oZGV2aWNlKSUwQSUwQW91dHB1dCUyMCUzRCUyMGRpZmZ1c2VyX3BpcGVsaW5lKHNwZWVjaF9kYXRhKSUwQXBsdC5pbXNob3cob3V0cHV0LmltYWdlcyU1QjAlNUQp",highlighted:`<span class="hljs-keyword">import</span> torch

<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
    WhisperForConditionalGeneration,
    WhisperProcessor,
)


device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)

audio_sample = ds[<span class="hljs-number">3</span>]

text = audio_sample[<span class="hljs-string">&quot;text&quot;</span>].lower()
speech_data = audio_sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>]

model = WhisperForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;openai/whisper-small&quot;</span>).to(device)
processor = WhisperProcessor.from_pretrained(<span class="hljs-string">&quot;openai/whisper-small&quot;</span>)

diffuser_pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    custom_pipeline=<span class="hljs-string">&quot;speech_to_image_diffusion&quot;</span>,
    speech_model=model,
    speech_processor=processor,
    
    torch_dtype=torch.float16,
)

diffuser_pipeline.enable_attention_slicing()
diffuser_pipeline = diffuser_pipeline.to(device)

output = diffuser_pipeline(speech_data)
plt.imshow(output.images[<span class="hljs-number">0</span>])`}}),{c(){Q=s("meta"),Ct=p(),N=s("h1"),K=s("a"),Kl=s("span"),h(de.$$.fragment),Vs=p(),Ol=s("span"),Ss=o("Community pipelines"),Xt=p(),h(ye.$$.fragment),Vt=p(),Ke=s("blockquote"),et=s("p"),Me=s("strong"),Qs=o("For more information about community pipelines, please have a look at "),be=s("a"),Ns=o("this issue"),xs=o("."),St=p(),x=s("p"),lt=s("strong"),Ds=o("Community"),Ys=o(` examples consist of both inference and training examples that have been added by the community.
Please have a look at the following table to get an overview of all community examples. Click on the `),tt=s("strong"),$s=o("Code Example"),Fs=o(` to get a copy-and-paste ready code example that you can try out.
If a community doesn\u2019t work as expected, please open an issue and ping the author on it.`),Qt=p(),O=s("table"),st=s("thead"),J=s("tr"),Oe=s("th"),zs=o("Example"),As=p(),el=s("th"),qs=o("Description"),Ps=p(),ll=s("th"),Hs=o("Code Example"),Ls=p(),tl=s("th"),Ks=o("Colab"),Os=p(),sl=s("th"),ea=o("Author"),la=p(),g=s("tbody"),w=s("tr"),al=s("td"),ta=o("CLIP Guided Stable Diffusion"),sa=p(),il=s("td"),aa=o("Doing CLIP guidance for text to image generation with Stable Diffusion"),ia=p(),nl=s("td"),ol=s("a"),na=o("CLIP Guided Stable Diffusion"),oa=p(),rl=s("td"),ge=s("a"),pl=s("img"),ra=p(),cl=s("td"),Je=s("a"),pa=o("Suraj Patil"),ca=p(),U=s("tr"),ul=s("td"),ua=o("One Step U-Net (Dummy)"),fa=p(),ee=s("td"),ha=o("Example showcasing of how to use Community Pipelines (see "),we=s("a"),ma=o("https://github.com/huggingface/diffusers/issues/841"),da=o(")"),ya=p(),fl=s("td"),hl=s("a"),Ma=o("One Step U-Net"),ba=p(),ml=s("td"),ga=o("-"),Ja=p(),dl=s("td"),Ue=s("a"),wa=o("Patrick von Platen"),Ua=p(),T=s("tr"),yl=s("td"),Ta=o("Stable Diffusion Interpolation"),va=p(),Ml=s("td"),ja=o("Interpolate the latent space of Stable Diffusion between different prompts/seeds"),Za=p(),bl=s("td"),gl=s("a"),_a=o("Stable Diffusion Interpolation"),Ga=p(),Jl=s("td"),Ba=o("-"),Ia=p(),wl=s("td"),Te=s("a"),Wa=o("Nate Raw"),Ea=p(),v=s("tr"),Ul=s("td"),ka=o("Stable Diffusion Mega"),Ra=p(),_=s("td"),at=s("strong"),Ca=o("One"),Xa=o(" Stable Diffusion Pipeline with all functionalities of "),ve=s("a"),Va=o("Text2Image"),Sa=o(", "),je=s("a"),Qa=o("Image2Image"),Na=o(" and "),Ze=s("a"),xa=o("Inpainting"),Da=p(),Tl=s("td"),vl=s("a"),Ya=o("Stable Diffusion Mega"),$a=p(),jl=s("td"),Fa=o("-"),za=p(),Zl=s("td"),_e=s("a"),Aa=o("Patrick von Platen"),qa=p(),j=s("tr"),_l=s("td"),Pa=o("Long Prompt Weighting Stable Diffusion"),Ha=p(),Ge=s("td"),it=s("strong"),La=o("One"),Ka=o(" Stable Diffusion Pipeline without tokens length limit, and support parsing weighting in prompt."),Oa=p(),Gl=s("td"),Bl=s("a"),ei=o("Long Prompt Weighting Stable Diffusion"),li=p(),Il=s("td"),ti=o("-"),si=p(),Wl=s("td"),Be=s("a"),ai=o("SkyTNT"),ii=p(),Z=s("tr"),El=s("td"),ni=o("Speech to Image"),oi=p(),kl=s("td"),ri=o("Using automatic-speech-recognition to transcribe text and Stable Diffusion to generate images"),pi=p(),Rl=s("td"),Cl=s("a"),ci=o("Speech to Image"),ui=p(),Xl=s("td"),fi=o("-"),hi=p(),Vl=s("td"),Ie=s("a"),mi=o("Mikail Duzenli"),Nt=p(),G=s("p"),di=o("To load a custom pipeline you just need to pass the "),nt=s("code"),yi=o("custom_pipeline"),Mi=o(" argument to "),ot=s("code"),bi=o("DiffusionPipeline"),gi=o(", as one of the files in "),rt=s("code"),Ji=o("diffusers/examples/community"),wi=o(". Feel free to send a PR with your own pipelines, we will merge them quickly."),xt=p(),h(We.$$.fragment),Dt=p(),D=s("h2"),le=s("a"),pt=s("span"),h(Ee.$$.fragment),Ui=p(),ct=s("span"),Ti=o("Example usages"),Yt=p(),Y=s("h3"),te=s("a"),ut=s("span"),h(ke.$$.fragment),vi=p(),ft=s("span"),ji=o("CLIP Guided Stable Diffusion"),$t=p(),Sl=s("p"),Zi=o(`CLIP guided stable diffusion can help to generate more realistic images
by guiding stable diffusion at every denoising step with an additional CLIP model.`),Ft=p(),Ql=s("p"),_i=o("The following code requires roughly 12GB of GPU RAM."),zt=p(),h(Re.$$.fragment),At=p(),se=s("p"),Gi=o("The "),ht=s("code"),Bi=o("images"),Ii=o(` list contains a list of PIL images that can be saved locally or displayed directly in a google colab.
Generated images tend to be of higher qualtiy than natively using stable diffusion. E.g. the above script generates the following images:`),qt=p(),Ce=s("p"),Nl=s("img"),Wi=o("."),Pt=p(),$=s("h3"),ae=s("a"),mt=s("span"),h(Xe.$$.fragment),Ei=p(),dt=s("span"),ki=o("One Step Unet"),Ht=p(),xl=s("p"),Ri=o("The dummy \u201Cone-step-unet\u201D can be run as follows:"),Lt=p(),h(Ve.$$.fragment),Kt=p(),F=s("p"),yt=s("strong"),Ci=o("Note"),Xi=o(": This community pipeline is not useful as a feature, but rather just serves as an example of how community pipelines can be added (see "),Se=s("a"),Vi=o("https://github.com/huggingface/diffusers/issues/841"),Si=o(")."),Ot=p(),z=s("h3"),ie=s("a"),Mt=s("span"),h(Qe.$$.fragment),Qi=p(),bt=s("span"),Ni=o("Stable Diffusion Interpolation"),es=p(),Dl=s("p"),xi=o("The following code can be run on a GPU of at least 8GB VRAM and should take approximately 5 minutes."),ls=p(),h(Ne.$$.fragment),ts=p(),I=s("p"),Di=o("The output of the "),gt=s("code"),Yi=o("walk(...)"),$i=o(" function returns a list of images saved under the folder as defined in "),Jt=s("code"),Fi=o("output_dir"),zi=o(". You can use these images to create videos of stable diffusion."),ss=p(),Yl=s("blockquote"),wt=s("p"),xe=s("strong"),Ai=o("Please have a look at "),De=s("a"),qi=o("https://github.com/nateraw/stable-diffusion-videos"),Pi=o(" for more in-detail information on how to create videos using stable diffusion as well as more feature-complete functionality."),as=p(),A=s("h3"),ne=s("a"),Ut=s("span"),h(Ye.$$.fragment),Hi=p(),Tt=s("span"),Li=o("Stable Diffusion Mega"),is=p(),$l=s("p"),Ki=o("The Stable Diffusion Mega Pipeline lets you use the main use cases of the stable diffusion pipeline in a single class."),ns=p(),h($e.$$.fragment),os=p(),Fl=s("p"),Oi=o("As shown above this one pipeline can run all both \u201Ctext-to-image\u201D, \u201Cimage-to-image\u201D, and \u201Cinpainting\u201D in one pipeline."),rs=p(),q=s("h3"),oe=s("a"),vt=s("span"),h(Fe.$$.fragment),en=p(),jt=s("span"),ln=o("Long Prompt Weighting Stable Diffusion"),ps=p(),zl=s("p"),tn=o(`The Pipeline lets you input prompt without 77 token length limit. And you can increase words weighting by using \u201D()\u201D or decrease words weighting by using \u201D[]\u201D
The Pipeline also lets you use the main use cases of the stable diffusion pipeline in a single class.`),cs=p(),P=s("h4"),re=s("a"),Zt=s("span"),h(ze.$$.fragment),sn=p(),_t=s("span"),an=o("pytorch"),us=p(),h(Ae.$$.fragment),fs=p(),H=s("h4"),pe=s("a"),Gt=s("span"),h(qe.$$.fragment),nn=p(),Bt=s("span"),on=o("onnxruntime"),hs=p(),h(Pe.$$.fragment),ms=p(),ce=s("p"),rn=o("if you see "),It=s("code"),pn=o("Token indices sequence length is longer than the specified maximum sequence length for this model ( *** > 77 ) . Running this sequence through the model will result in indexing errors"),cn=o(". Do not worry, it is normal."),ds=p(),L=s("h3"),ue=s("a"),Wt=s("span"),h(He.$$.fragment),un=p(),Et=s("span"),fn=o("Speech to Image"),ys=p(),Al=s("p"),hn=o("The following code can generate an image from an audio sample using pre-trained OpenAI whisper-small and Stable Diffusion."),Ms=p(),h(Le.$$.fragment),bs=p(),ql=s("p"),mn=o("This example produces the following image:"),gs=p(),Pl=s("p"),Hl=s("img"),this.h()},l(e){const u=_r('[data-svelte="svelte-1phssyn"]',document.head);Q=a(u,"META",{name:!0,content:!0}),u.forEach(t),Ct=c(e),N=a(e,"H1",{class:!0});var ws=i(N);K=a(ws,"A",{id:!0,class:!0,href:!0});var Un=i(K);Kl=a(Un,"SPAN",{});var Tn=i(Kl);m(de.$$.fragment,Tn),Tn.forEach(t),Un.forEach(t),Vs=c(ws),Ol=a(ws,"SPAN",{});var vn=i(Ol);Ss=r(vn,"Community pipelines"),vn.forEach(t),ws.forEach(t),Xt=c(e),m(ye.$$.fragment,e),Vt=c(e),Ke=a(e,"BLOCKQUOTE",{});var jn=i(Ke);et=a(jn,"P",{});var Zn=i(et);Me=a(Zn,"STRONG",{});var Us=i(Me);Qs=r(Us,"For more information about community pipelines, please have a look at "),be=a(Us,"A",{href:!0,rel:!0});var _n=i(be);Ns=r(_n,"this issue"),_n.forEach(t),xs=r(Us,"."),Us.forEach(t),Zn.forEach(t),jn.forEach(t),St=c(e),x=a(e,"P",{});var kt=i(x);lt=a(kt,"STRONG",{});var Gn=i(lt);Ds=r(Gn,"Community"),Gn.forEach(t),Ys=r(kt,` examples consist of both inference and training examples that have been added by the community.
Please have a look at the following table to get an overview of all community examples. Click on the `),tt=a(kt,"STRONG",{});var Bn=i(tt);$s=r(Bn,"Code Example"),Bn.forEach(t),Fs=r(kt,` to get a copy-and-paste ready code example that you can try out.
If a community doesn\u2019t work as expected, please open an issue and ping the author on it.`),kt.forEach(t),Qt=c(e),O=a(e,"TABLE",{});var Ts=i(O);st=a(Ts,"THEAD",{});var In=i(st);J=a(In,"TR",{});var W=i(J);Oe=a(W,"TH",{align:!0});var Wn=i(Oe);zs=r(Wn,"Example"),Wn.forEach(t),As=c(W),el=a(W,"TH",{align:!0});var En=i(el);qs=r(En,"Description"),En.forEach(t),Ps=c(W),ll=a(W,"TH",{align:!0});var kn=i(ll);Hs=r(kn,"Code Example"),kn.forEach(t),Ls=c(W),tl=a(W,"TH",{align:!0});var Rn=i(tl);Ks=r(Rn,"Colab"),Rn.forEach(t),Os=c(W),sl=a(W,"TH",{align:!0});var Cn=i(sl);ea=r(Cn,"Author"),Cn.forEach(t),W.forEach(t),In.forEach(t),la=c(Ts),g=a(Ts,"TBODY",{});var B=i(g);w=a(B,"TR",{});var E=i(w);al=a(E,"TD",{align:!0});var Xn=i(al);ta=r(Xn,"CLIP Guided Stable Diffusion"),Xn.forEach(t),sa=c(E),il=a(E,"TD",{align:!0});var Vn=i(il);aa=r(Vn,"Doing CLIP guidance for text to image generation with Stable Diffusion"),Vn.forEach(t),ia=c(E),nl=a(E,"TD",{align:!0});var Sn=i(nl);ol=a(Sn,"A",{href:!0});var Qn=i(ol);na=r(Qn,"CLIP Guided Stable Diffusion"),Qn.forEach(t),Sn.forEach(t),oa=c(E),rl=a(E,"TD",{align:!0});var Nn=i(rl);ge=a(Nn,"A",{href:!0,rel:!0});var xn=i(ge);pl=a(xn,"IMG",{src:!0,alt:!0}),xn.forEach(t),Nn.forEach(t),ra=c(E),cl=a(E,"TD",{align:!0});var Dn=i(cl);Je=a(Dn,"A",{href:!0,rel:!0});var Yn=i(Je);pa=r(Yn,"Suraj Patil"),Yn.forEach(t),Dn.forEach(t),E.forEach(t),ca=c(B),U=a(B,"TR",{});var k=i(U);ul=a(k,"TD",{align:!0});var $n=i(ul);ua=r($n,"One Step U-Net (Dummy)"),$n.forEach(t),fa=c(k),ee=a(k,"TD",{align:!0});var vs=i(ee);ha=r(vs,"Example showcasing of how to use Community Pipelines (see "),we=a(vs,"A",{href:!0,rel:!0});var Fn=i(we);ma=r(Fn,"https://github.com/huggingface/diffusers/issues/841"),Fn.forEach(t),da=r(vs,")"),vs.forEach(t),ya=c(k),fl=a(k,"TD",{align:!0});var zn=i(fl);hl=a(zn,"A",{href:!0});var An=i(hl);Ma=r(An,"One Step U-Net"),An.forEach(t),zn.forEach(t),ba=c(k),ml=a(k,"TD",{align:!0});var qn=i(ml);ga=r(qn,"-"),qn.forEach(t),Ja=c(k),dl=a(k,"TD",{align:!0});var Pn=i(dl);Ue=a(Pn,"A",{href:!0,rel:!0});var Hn=i(Ue);wa=r(Hn,"Patrick von Platen"),Hn.forEach(t),Pn.forEach(t),k.forEach(t),Ua=c(B),T=a(B,"TR",{});var R=i(T);yl=a(R,"TD",{align:!0});var Ln=i(yl);Ta=r(Ln,"Stable Diffusion Interpolation"),Ln.forEach(t),va=c(R),Ml=a(R,"TD",{align:!0});var Kn=i(Ml);ja=r(Kn,"Interpolate the latent space of Stable Diffusion between different prompts/seeds"),Kn.forEach(t),Za=c(R),bl=a(R,"TD",{align:!0});var On=i(bl);gl=a(On,"A",{href:!0});var eo=i(gl);_a=r(eo,"Stable Diffusion Interpolation"),eo.forEach(t),On.forEach(t),Ga=c(R),Jl=a(R,"TD",{align:!0});var lo=i(Jl);Ba=r(lo,"-"),lo.forEach(t),Ia=c(R),wl=a(R,"TD",{align:!0});var to=i(wl);Te=a(to,"A",{href:!0,rel:!0});var so=i(Te);Wa=r(so,"Nate Raw"),so.forEach(t),to.forEach(t),R.forEach(t),Ea=c(B),v=a(B,"TR",{});var C=i(v);Ul=a(C,"TD",{align:!0});var ao=i(Ul);ka=r(ao,"Stable Diffusion Mega"),ao.forEach(t),Ra=c(C),_=a(C,"TD",{align:!0});var fe=i(_);at=a(fe,"STRONG",{});var io=i(at);Ca=r(io,"One"),io.forEach(t),Xa=r(fe," Stable Diffusion Pipeline with all functionalities of "),ve=a(fe,"A",{href:!0,rel:!0});var no=i(ve);Va=r(no,"Text2Image"),no.forEach(t),Sa=r(fe,", "),je=a(fe,"A",{href:!0,rel:!0});var oo=i(je);Qa=r(oo,"Image2Image"),oo.forEach(t),Na=r(fe," and "),Ze=a(fe,"A",{href:!0,rel:!0});var ro=i(Ze);xa=r(ro,"Inpainting"),ro.forEach(t),fe.forEach(t),Da=c(C),Tl=a(C,"TD",{align:!0});var po=i(Tl);vl=a(po,"A",{href:!0});var co=i(vl);Ya=r(co,"Stable Diffusion Mega"),co.forEach(t),po.forEach(t),$a=c(C),jl=a(C,"TD",{align:!0});var uo=i(jl);Fa=r(uo,"-"),uo.forEach(t),za=c(C),Zl=a(C,"TD",{align:!0});var fo=i(Zl);_e=a(fo,"A",{href:!0,rel:!0});var ho=i(_e);Aa=r(ho,"Patrick von Platen"),ho.forEach(t),fo.forEach(t),C.forEach(t),qa=c(B),j=a(B,"TR",{});var X=i(j);_l=a(X,"TD",{align:!0});var mo=i(_l);Pa=r(mo,"Long Prompt Weighting Stable Diffusion"),mo.forEach(t),Ha=c(X),Ge=a(X,"TD",{align:!0});var dn=i(Ge);it=a(dn,"STRONG",{});var yo=i(it);La=r(yo,"One"),yo.forEach(t),Ka=r(dn," Stable Diffusion Pipeline without tokens length limit, and support parsing weighting in prompt."),dn.forEach(t),Oa=c(X),Gl=a(X,"TD",{align:!0});var Mo=i(Gl);Bl=a(Mo,"A",{href:!0});var bo=i(Bl);ei=r(bo,"Long Prompt Weighting Stable Diffusion"),bo.forEach(t),Mo.forEach(t),li=c(X),Il=a(X,"TD",{align:!0});var go=i(Il);ti=r(go,"-"),go.forEach(t),si=c(X),Wl=a(X,"TD",{align:!0});var Jo=i(Wl);Be=a(Jo,"A",{href:!0,rel:!0});var wo=i(Be);ai=r(wo,"SkyTNT"),wo.forEach(t),Jo.forEach(t),X.forEach(t),ii=c(B),Z=a(B,"TR",{});var V=i(Z);El=a(V,"TD",{align:!0});var Uo=i(El);ni=r(Uo,"Speech to Image"),Uo.forEach(t),oi=c(V),kl=a(V,"TD",{align:!0});var To=i(kl);ri=r(To,"Using automatic-speech-recognition to transcribe text and Stable Diffusion to generate images"),To.forEach(t),pi=c(V),Rl=a(V,"TD",{align:!0});var vo=i(Rl);Cl=a(vo,"A",{href:!0});var jo=i(Cl);ci=r(jo,"Speech to Image"),jo.forEach(t),vo.forEach(t),ui=c(V),Xl=a(V,"TD",{align:!0});var Zo=i(Xl);fi=r(Zo,"-"),Zo.forEach(t),hi=c(V),Vl=a(V,"TD",{align:!0});var _o=i(Vl);Ie=a(_o,"A",{href:!0,rel:!0});var Go=i(Ie);mi=r(Go,"Mikail Duzenli"),Go.forEach(t),_o.forEach(t),V.forEach(t),B.forEach(t),Ts.forEach(t),Nt=c(e),G=a(e,"P",{});var he=i(G);di=r(he,"To load a custom pipeline you just need to pass the "),nt=a(he,"CODE",{});var Bo=i(nt);yi=r(Bo,"custom_pipeline"),Bo.forEach(t),Mi=r(he," argument to "),ot=a(he,"CODE",{});var Io=i(ot);bi=r(Io,"DiffusionPipeline"),Io.forEach(t),gi=r(he,", as one of the files in "),rt=a(he,"CODE",{});var Wo=i(rt);Ji=r(Wo,"diffusers/examples/community"),Wo.forEach(t),wi=r(he,". Feel free to send a PR with your own pipelines, we will merge them quickly."),he.forEach(t),xt=c(e),m(We.$$.fragment,e),Dt=c(e),D=a(e,"H2",{class:!0});var js=i(D);le=a(js,"A",{id:!0,class:!0,href:!0});var Eo=i(le);pt=a(Eo,"SPAN",{});var ko=i(pt);m(Ee.$$.fragment,ko),ko.forEach(t),Eo.forEach(t),Ui=c(js),ct=a(js,"SPAN",{});var Ro=i(ct);Ti=r(Ro,"Example usages"),Ro.forEach(t),js.forEach(t),Yt=c(e),Y=a(e,"H3",{class:!0});var Zs=i(Y);te=a(Zs,"A",{id:!0,class:!0,href:!0});var Co=i(te);ut=a(Co,"SPAN",{});var Xo=i(ut);m(ke.$$.fragment,Xo),Xo.forEach(t),Co.forEach(t),vi=c(Zs),ft=a(Zs,"SPAN",{});var Vo=i(ft);ji=r(Vo,"CLIP Guided Stable Diffusion"),Vo.forEach(t),Zs.forEach(t),$t=c(e),Sl=a(e,"P",{});var So=i(Sl);Zi=r(So,`CLIP guided stable diffusion can help to generate more realistic images
by guiding stable diffusion at every denoising step with an additional CLIP model.`),So.forEach(t),Ft=c(e),Ql=a(e,"P",{});var Qo=i(Ql);_i=r(Qo,"The following code requires roughly 12GB of GPU RAM."),Qo.forEach(t),zt=c(e),m(Re.$$.fragment,e),At=c(e),se=a(e,"P",{});var _s=i(se);Gi=r(_s,"The "),ht=a(_s,"CODE",{});var No=i(ht);Bi=r(No,"images"),No.forEach(t),Ii=r(_s,` list contains a list of PIL images that can be saved locally or displayed directly in a google colab.
Generated images tend to be of higher qualtiy than natively using stable diffusion. E.g. the above script generates the following images:`),_s.forEach(t),qt=c(e),Ce=a(e,"P",{});var yn=i(Ce);Nl=a(yn,"IMG",{src:!0,alt:!0}),Wi=r(yn,"."),yn.forEach(t),Pt=c(e),$=a(e,"H3",{class:!0});var Gs=i($);ae=a(Gs,"A",{id:!0,class:!0,href:!0});var xo=i(ae);mt=a(xo,"SPAN",{});var Do=i(mt);m(Xe.$$.fragment,Do),Do.forEach(t),xo.forEach(t),Ei=c(Gs),dt=a(Gs,"SPAN",{});var Yo=i(dt);ki=r(Yo,"One Step Unet"),Yo.forEach(t),Gs.forEach(t),Ht=c(e),xl=a(e,"P",{});var $o=i(xl);Ri=r($o,"The dummy \u201Cone-step-unet\u201D can be run as follows:"),$o.forEach(t),Lt=c(e),m(Ve.$$.fragment,e),Kt=c(e),F=a(e,"P",{});var Rt=i(F);yt=a(Rt,"STRONG",{});var Fo=i(yt);Ci=r(Fo,"Note"),Fo.forEach(t),Xi=r(Rt,": This community pipeline is not useful as a feature, but rather just serves as an example of how community pipelines can be added (see "),Se=a(Rt,"A",{href:!0,rel:!0});var zo=i(Se);Vi=r(zo,"https://github.com/huggingface/diffusers/issues/841"),zo.forEach(t),Si=r(Rt,")."),Rt.forEach(t),Ot=c(e),z=a(e,"H3",{class:!0});var Bs=i(z);ie=a(Bs,"A",{id:!0,class:!0,href:!0});var Ao=i(ie);Mt=a(Ao,"SPAN",{});var qo=i(Mt);m(Qe.$$.fragment,qo),qo.forEach(t),Ao.forEach(t),Qi=c(Bs),bt=a(Bs,"SPAN",{});var Po=i(bt);Ni=r(Po,"Stable Diffusion Interpolation"),Po.forEach(t),Bs.forEach(t),es=c(e),Dl=a(e,"P",{});var Ho=i(Dl);xi=r(Ho,"The following code can be run on a GPU of at least 8GB VRAM and should take approximately 5 minutes."),Ho.forEach(t),ls=c(e),m(Ne.$$.fragment,e),ts=c(e),I=a(e,"P",{});var Ll=i(I);Di=r(Ll,"The output of the "),gt=a(Ll,"CODE",{});var Lo=i(gt);Yi=r(Lo,"walk(...)"),Lo.forEach(t),$i=r(Ll," function returns a list of images saved under the folder as defined in "),Jt=a(Ll,"CODE",{});var Ko=i(Jt);Fi=r(Ko,"output_dir"),Ko.forEach(t),zi=r(Ll,". You can use these images to create videos of stable diffusion."),Ll.forEach(t),ss=c(e),Yl=a(e,"BLOCKQUOTE",{});var Oo=i(Yl);wt=a(Oo,"P",{});var er=i(wt);xe=a(er,"STRONG",{});var Is=i(xe);Ai=r(Is,"Please have a look at "),De=a(Is,"A",{href:!0,rel:!0});var lr=i(De);qi=r(lr,"https://github.com/nateraw/stable-diffusion-videos"),lr.forEach(t),Pi=r(Is," for more in-detail information on how to create videos using stable diffusion as well as more feature-complete functionality."),Is.forEach(t),er.forEach(t),Oo.forEach(t),as=c(e),A=a(e,"H3",{class:!0});var Ws=i(A);ne=a(Ws,"A",{id:!0,class:!0,href:!0});var tr=i(ne);Ut=a(tr,"SPAN",{});var sr=i(Ut);m(Ye.$$.fragment,sr),sr.forEach(t),tr.forEach(t),Hi=c(Ws),Tt=a(Ws,"SPAN",{});var ar=i(Tt);Li=r(ar,"Stable Diffusion Mega"),ar.forEach(t),Ws.forEach(t),is=c(e),$l=a(e,"P",{});var ir=i($l);Ki=r(ir,"The Stable Diffusion Mega Pipeline lets you use the main use cases of the stable diffusion pipeline in a single class."),ir.forEach(t),ns=c(e),m($e.$$.fragment,e),os=c(e),Fl=a(e,"P",{});var nr=i(Fl);Oi=r(nr,"As shown above this one pipeline can run all both \u201Ctext-to-image\u201D, \u201Cimage-to-image\u201D, and \u201Cinpainting\u201D in one pipeline."),nr.forEach(t),rs=c(e),q=a(e,"H3",{class:!0});var Es=i(q);oe=a(Es,"A",{id:!0,class:!0,href:!0});var or=i(oe);vt=a(or,"SPAN",{});var rr=i(vt);m(Fe.$$.fragment,rr),rr.forEach(t),or.forEach(t),en=c(Es),jt=a(Es,"SPAN",{});var pr=i(jt);ln=r(pr,"Long Prompt Weighting Stable Diffusion"),pr.forEach(t),Es.forEach(t),ps=c(e),zl=a(e,"P",{});var cr=i(zl);tn=r(cr,`The Pipeline lets you input prompt without 77 token length limit. And you can increase words weighting by using \u201D()\u201D or decrease words weighting by using \u201D[]\u201D
The Pipeline also lets you use the main use cases of the stable diffusion pipeline in a single class.`),cr.forEach(t),cs=c(e),P=a(e,"H4",{class:!0});var ks=i(P);re=a(ks,"A",{id:!0,class:!0,href:!0});var ur=i(re);Zt=a(ur,"SPAN",{});var fr=i(Zt);m(ze.$$.fragment,fr),fr.forEach(t),ur.forEach(t),sn=c(ks),_t=a(ks,"SPAN",{});var hr=i(_t);an=r(hr,"pytorch"),hr.forEach(t),ks.forEach(t),us=c(e),m(Ae.$$.fragment,e),fs=c(e),H=a(e,"H4",{class:!0});var Rs=i(H);pe=a(Rs,"A",{id:!0,class:!0,href:!0});var mr=i(pe);Gt=a(mr,"SPAN",{});var dr=i(Gt);m(qe.$$.fragment,dr),dr.forEach(t),mr.forEach(t),nn=c(Rs),Bt=a(Rs,"SPAN",{});var yr=i(Bt);on=r(yr,"onnxruntime"),yr.forEach(t),Rs.forEach(t),hs=c(e),m(Pe.$$.fragment,e),ms=c(e),ce=a(e,"P",{});var Cs=i(ce);rn=r(Cs,"if you see "),It=a(Cs,"CODE",{});var Mr=i(It);pn=r(Mr,"Token indices sequence length is longer than the specified maximum sequence length for this model ( *** > 77 ) . Running this sequence through the model will result in indexing errors"),Mr.forEach(t),cn=r(Cs,". Do not worry, it is normal."),Cs.forEach(t),ds=c(e),L=a(e,"H3",{class:!0});var Xs=i(L);ue=a(Xs,"A",{id:!0,class:!0,href:!0});var br=i(ue);Wt=a(br,"SPAN",{});var gr=i(Wt);m(He.$$.fragment,gr),gr.forEach(t),br.forEach(t),un=c(Xs),Et=a(Xs,"SPAN",{});var Jr=i(Et);fn=r(Jr,"Speech to Image"),Jr.forEach(t),Xs.forEach(t),ys=c(e),Al=a(e,"P",{});var wr=i(Al);hn=r(wr,"The following code can generate an image from an audio sample using pre-trained OpenAI whisper-small and Stable Diffusion."),wr.forEach(t),Ms=c(e),m(Le.$$.fragment,e),bs=c(e),ql=a(e,"P",{});var Ur=i(ql);mn=r(Ur,"This example produces the following image:"),Ur.forEach(t),gs=c(e),Pl=a(e,"P",{});var Tr=i(Pl);Hl=a(Tr,"IMG",{src:!0,alt:!0}),Tr.forEach(t),this.h()},h(){n(Q,"name","hf:doc:metadata"),n(Q,"content",JSON.stringify(Er)),n(K,"id","community-pipelines"),n(K,"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"),n(K,"href","#community-pipelines"),n(N,"class","relative group"),n(be,"href","https://github.com/huggingface/diffusers/issues/841"),n(be,"rel","nofollow"),n(Oe,"align","left"),n(el,"align","left"),n(ll,"align","left"),n(tl,"align","left"),n(sl,"align","right"),n(al,"align","left"),n(il,"align","left"),n(ol,"href","#clip-guided-stable-diffusion"),n(nl,"align","left"),Mn(pl.src,gn="https://colab.research.google.com/assets/colab-badge.svg")||n(pl,"src",gn),n(pl,"alt","Open In Colab"),n(ge,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/CLIP_Guided_Stable_diffusion_with_diffusers.ipynb"),n(ge,"rel","nofollow"),n(rl,"align","left"),n(Je,"href","https://github.com/patil-suraj/"),n(Je,"rel","nofollow"),n(cl,"align","right"),n(ul,"align","left"),n(we,"href","https://github.com/huggingface/diffusers/issues/841"),n(we,"rel","nofollow"),n(ee,"align","left"),n(hl,"href","#one-step-unet"),n(fl,"align","left"),n(ml,"align","left"),n(Ue,"href","https://github.com/patrickvonplaten/"),n(Ue,"rel","nofollow"),n(dl,"align","right"),n(yl,"align","left"),n(Ml,"align","left"),n(gl,"href","#stable-diffusion-interpolation"),n(bl,"align","left"),n(Jl,"align","left"),n(Te,"href","https://github.com/nateraw/"),n(Te,"rel","nofollow"),n(wl,"align","right"),n(Ul,"align","left"),n(ve,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py"),n(ve,"rel","nofollow"),n(je,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py"),n(je,"rel","nofollow"),n(Ze,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py"),n(Ze,"rel","nofollow"),n(_,"align","left"),n(vl,"href","#stable-diffusion-mega"),n(Tl,"align","left"),n(jl,"align","left"),n(_e,"href","https://github.com/patrickvonplaten/"),n(_e,"rel","nofollow"),n(Zl,"align","right"),n(_l,"align","left"),n(Ge,"align","left"),n(Bl,"href","#long-prompt-weighting-stable-diffusion"),n(Gl,"align","left"),n(Il,"align","left"),n(Be,"href","https://github.com/SkyTNT"),n(Be,"rel","nofollow"),n(Wl,"align","right"),n(El,"align","left"),n(kl,"align","left"),n(Cl,"href","#speech-to-image"),n(Rl,"align","left"),n(Xl,"align","left"),n(Ie,"href","https://github.com/MikailINTech"),n(Ie,"rel","nofollow"),n(Vl,"align","right"),n(le,"id","example-usages"),n(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"),n(le,"href","#example-usages"),n(D,"class","relative group"),n(te,"id","clip-guided-stable-diffusion"),n(te,"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"),n(te,"href","#clip-guided-stable-diffusion"),n(Y,"class","relative group"),Mn(Nl.src,Jn="https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/clip_guidance/merged_clip_guidance.jpg")||n(Nl,"src",Jn),n(Nl,"alt","clip_guidance"),n(ae,"id","one-step-unet"),n(ae,"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"),n(ae,"href","#one-step-unet"),n($,"class","relative group"),n(Se,"href","https://github.com/huggingface/diffusers/issues/841"),n(Se,"rel","nofollow"),n(ie,"id","stable-diffusion-interpolation"),n(ie,"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"),n(ie,"href","#stable-diffusion-interpolation"),n(z,"class","relative group"),n(De,"href","https://github.com/nateraw/stable-diffusion-videos"),n(De,"rel","nofollow"),n(ne,"id","stable-diffusion-mega"),n(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"),n(ne,"href","#stable-diffusion-mega"),n(A,"class","relative group"),n(oe,"id","long-prompt-weighting-stable-diffusion"),n(oe,"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"),n(oe,"href","#long-prompt-weighting-stable-diffusion"),n(q,"class","relative group"),n(re,"id","pytorch"),n(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"),n(re,"href","#pytorch"),n(P,"class","relative group"),n(pe,"id","onnxruntime"),n(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"),n(pe,"href","#onnxruntime"),n(H,"class","relative group"),n(ue,"id","speech-to-image"),n(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"),n(ue,"href","#speech-to-image"),n(L,"class","relative group"),Mn(Hl.src,wn="https://user-images.githubusercontent.com/45072645/196901736-77d9c6fc-63ee-4072-90b0-dc8b903d63e3.png")||n(Hl,"src",wn),n(Hl,"alt","image")},m(e,u){l(document.head,Q),f(e,Ct,u),f(e,N,u),l(N,K),l(K,Kl),d(de,Kl,null),l(N,Vs),l(N,Ol),l(Ol,Ss),f(e,Xt,u),d(ye,e,u),f(e,Vt,u),f(e,Ke,u),l(Ke,et),l(et,Me),l(Me,Qs),l(Me,be),l(be,Ns),l(Me,xs),f(e,St,u),f(e,x,u),l(x,lt),l(lt,Ds),l(x,Ys),l(x,tt),l(tt,$s),l(x,Fs),f(e,Qt,u),f(e,O,u),l(O,st),l(st,J),l(J,Oe),l(Oe,zs),l(J,As),l(J,el),l(el,qs),l(J,Ps),l(J,ll),l(ll,Hs),l(J,Ls),l(J,tl),l(tl,Ks),l(J,Os),l(J,sl),l(sl,ea),l(O,la),l(O,g),l(g,w),l(w,al),l(al,ta),l(w,sa),l(w,il),l(il,aa),l(w,ia),l(w,nl),l(nl,ol),l(ol,na),l(w,oa),l(w,rl),l(rl,ge),l(ge,pl),l(w,ra),l(w,cl),l(cl,Je),l(Je,pa),l(g,ca),l(g,U),l(U,ul),l(ul,ua),l(U,fa),l(U,ee),l(ee,ha),l(ee,we),l(we,ma),l(ee,da),l(U,ya),l(U,fl),l(fl,hl),l(hl,Ma),l(U,ba),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,e,u),f(e,At,u),f(e,se,u),l(se,Gi),l(se,ht),l(ht,Bi),l(se,Ii),f(e,qt,u),f(e,Ce,u),l(Ce,Nl),l(Ce,Wi),f(e,Pt,u),f(e,$,u),l($,ae),l(ae,mt),d(Xe,mt,null),l($,Ei),l($,dt),l(dt,ki),f(e,Ht,u),f(e,xl,u),l(xl,Ri),f(e,Lt,u),d(Ve,e,u),f(e,Kt,u),f(e,F,u),l(F,yt),l(yt,Ci),l(F,Xi),l(F,Se),l(Se,Vi),l(F,Si),f(e,Ot,u),f(e,z,u),l(z,ie),l(ie,Mt),d(Qe,Mt,null),l(z,Qi),l(z,bt),l(bt,Ni),f(e,es,u),f(e,Dl,u),l(Dl,xi),f(e,ls,u),d(Ne,e,u),f(e,ts,u),f(e,I,u),l(I,Di),l(I,gt),l(gt,Yi),l(I,$i),l(I,Jt),l(Jt,Fi),l(I,zi),f(e,ss,u),f(e,Yl,u),l(Yl,wt),l(wt,xe),l(xe,Ai),l(xe,De),l(De,qi),l(xe,Pi),f(e,as,u),f(e,A,u),l(A,ne),l(ne,Ut),d(Ye,Ut,null),l(A,Hi),l(A,Tt),l(Tt,Li),f(e,is,u),f(e,$l,u),l($l,Ki),f(e,ns,u),d($e,e,u),f(e,os,u),f(e,Fl,u),l(Fl,Oi),f(e,rs,u),f(e,q,u),l(q,oe),l(oe,vt),d(Fe,vt,null),l(q,en),l(q,jt),l(jt,ln),f(e,ps,u),f(e,zl,u),l(zl,tn),f(e,cs,u),f(e,P,u),l(P,re),l(re,Zt),d(ze,Zt,null),l(P,sn),l(P,_t),l(_t,an),f(e,us,u),d(Ae,e,u),f(e,fs,u),f(e,H,u),l(H,pe),l(pe,Gt),d(qe,Gt,null),l(H,nn),l(H,Bt),l(Bt,on),f(e,hs,u),d(Pe,e,u),f(e,ms,u),f(e,ce,u),l(ce,rn),l(ce,It),l(It,pn),l(ce,cn),f(e,ds,u),f(e,L,u),l(L,ue),l(ue,Wt),d(He,Wt,null),l(L,un),l(L,Et),l(Et,fn),f(e,ys,u),f(e,Al,u),l(Al,hn),f(e,Ms,u),d(Le,e,u),f(e,bs,u),f(e,ql,u),l(ql,mn),f(e,gs,u),f(e,Pl,u),l(Pl,Hl),Js=!0},p:Gr,i(e){Js||(y(de.$$.fragment,e),y(ye.$$.fragment,e),y(We.$$.fragment,e),y(Ee.$$.fragment,e),y(ke.$$.fragment,e),y(Re.$$.fragment,e),y(Xe.$$.fragment,e),y(Ve.$$.fragment,e),y(Qe.$$.fragment,e),y(Ne.$$.fragment,e),y(Ye.$$.fragment,e),y($e.$$.fragment,e),y(Fe.$$.fragment,e),y(ze.$$.fragment,e),y(Ae.$$.fragment,e),y(qe.$$.fragment,e),y(Pe.$$.fragment,e),y(He.$$.fragment,e),y(Le.$$.fragment,e),Js=!0)},o(e){M(de.$$.fragment,e),M(ye.$$.fragment,e),M(We.$$.fragment,e),M(Ee.$$.fragment,e),M(ke.$$.fragment,e),M(Re.$$.fragment,e),M(Xe.$$.fragment,e),M(Ve.$$.fragment,e),M(Qe.$$.fragment,e),M(Ne.$$.fragment,e),M(Ye.$$.fragment,e),M($e.$$.fragment,e),M(Fe.$$.fragment,e),M(ze.$$.fragment,e),M(Ae.$$.fragment,e),M(qe.$$.fragment,e),M(Pe.$$.fragment,e),M(He.$$.fragment,e),M(Le.$$.fragment,e),Js=!1},d(e){t(Q),e&&t(Ct),e&&t(N),b(de),e&&t(Xt),b(ye,e),e&&t(Vt),e&&t(Ke),e&&t(St),e&&t(x),e&&t(Qt),e&&t(O),e&&t(Nt),e&&t(G),e&&t(xt),b(We,e),e&&t(Dt),e&&t(D),b(Ee),e&&t(Yt),e&&t(Y),b(ke),e&&t($t),e&&t(Sl),e&&t(Ft),e&&t(Ql),e&&t(zt),b(Re,e),e&&t(At),e&&t(se),e&&t(qt),e&&t(Ce),e&&t(Pt),e&&t($),b(Xe),e&&t(Ht),e&&t(xl),e&&t(Lt),b(Ve,e),e&&t(Kt),e&&t(F),e&&t(Ot),e&&t(z),b(Qe),e&&t(es),e&&t(Dl),e&&t(ls),b(Ne,e),e&&t(ts),e&&t(I),e&&t(ss),e&&t(Yl),e&&t(as),e&&t(A),b(Ye),e&&t(is),e&&t($l),e&&t(ns),b($e,e),e&&t(os),e&&t(Fl),e&&t(rs),e&&t(q),b(Fe),e&&t(ps),e&&t(zl),e&&t(cs),e&&t(P),b(ze),e&&t(us),b(Ae,e),e&&t(fs),e&&t(H),b(qe),e&&t(hs),b(Pe,e),e&&t(ms),e&&t(ce),e&&t(ds),e&&t(L),b(He),e&&t(ys),e&&t(Al),e&&t(Ms),b(Le,e),e&&t(bs),e&&t(ql),e&&t(gs),e&&t(Pl)}}}const Er={local:"community-pipelines",sections:[{local:"example-usages",sections:[{local:"clip-guided-stable-diffusion",title:"CLIP Guided Stable Diffusion"},{local:"one-step-unet",title:"One Step Unet"},{local:"stable-diffusion-interpolation",title:"Stable Diffusion Interpolation"},{local:"stable-diffusion-mega",title:"Stable Diffusion Mega"},{local:"long-prompt-weighting-stable-diffusion",sections:[{local:"pytorch",title:"pytorch"},{local:"onnxruntime",title:"onnxruntime"}],title:"Long Prompt Weighting Stable Diffusion"},{local:"speech-to-image",title:"Speech to Image"}],title:"Example usages"}],title:"Community pipelines"};function kr(bn){return Br(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Sr extends vr{constructor(Q){super();jr(this,Q,kr,Wr,Zr,{})}}export{Sr as default,Er as metadata};
