import{S as Er,i as kr,s as Pr,e as a,k as p,w as m,t as l,M as jr,c as i,d as s,m as f,a as o,x as d,h as r,b as n,N as gn,G as t,g as h,y as c,L as qr,q as g,o as _,B as b,v as $r}from"../../chunks/vendor-hf-doc-builder.js";import{I as G}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as de}from"../../chunks/CodeBlock-hf-doc-builder.js";function Dr(_n){let B,As,R,X,Jt,ce,La,Xt,Na,Ls,Je,Zt,ge,Oa,_e,Ga,Ba,Ns,M,es,Ra,Ma,ts,Va,Ua,Os,Z,ss,w,Xe,Wa,Ha,Ze,Fa,za,et,Ya,Ka,tt,Qa,Ja,st,Xa,Za,v,y,at,ei,ti,it,si,ai,ot,nt,ii,oi,lt,be,rt,bn,ni,pt,ve,li,ri,E,ft,pi,fi,ee,ui,we,hi,mi,di,ut,ht,ci,gi,mt,_i,bi,dt,ye,vi,wi,k,ct,yi,Ei,gt,ki,Pi,_t,bt,ji,qi,vt,$i,Di,wt,Ee,xi,Ti,P,yt,Ii,Si,$,as,Ci,Ai,ke,Li,Ni,Pe,Oi,Gi,je,Bi,Ri,Et,kt,Mi,Vi,Pt,Ui,Wi,jt,qe,Hi,Fi,j,qt,zi,Yi,$e,is,Ki,Qi,Ji,$t,Dt,Xi,Zi,xt,eo,to,Tt,De,so,ao,q,It,io,oo,St,no,lo,Ct,At,ro,po,Lt,fo,uo,Nt,xe,ho,Gs,D,mo,os,co,go,ns,_o,bo,ls,vo,wo,Bs,Te,Rs,V,te,rs,Ie,yo,ps,Eo,Ms,U,se,fs,Se,ko,us,Po,Vs,Ot,jo,Us,Gt,qo,Ws,Ce,Hs,ae,$o,hs,Do,xo,Fs,Ae,Bt,vn,To,zs,W,ie,ms,Le,Io,ds,So,Ys,Rt,Co,Ks,Ne,Qs,H,cs,Ao,Lo,Oe,No,Oo,Js,F,oe,gs,Ge,Go,_s,Bo,Xs,Mt,Ro,Zs,Be,ea,T,Mo,bs,Vo,Uo,vs,Wo,Ho,ta,Vt,ws,Re,Fo,Me,zo,Yo,sa,z,ne,ys,Ve,Ko,Es,Qo,aa,Ut,Jo,ia,Ue,oa,Wt,Xo,na,Y,le,ks,We,Zo,Ps,en,la,Ht,tn,ra,K,re,js,He,sn,qs,an,pa,Fe,fa,Q,pe,$s,ze,on,Ds,nn,ua,Ye,ha,fe,ln,xs,rn,pn,ma,J,ue,Ts,Ke,fn,Is,un,da,Ft,hn,ca,Qe,ga,zt,mn,_a,Yt,Kt,wn,ba;return ce=new G({}),Te=new de({props:{code:`pipe = DiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4", custom_pipeline="filename_in_the_community_folder"
)`,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>
)`}}),Ie=new G({}),Se=new G({}),Ce=new de({props:{code:`from diffusers import DiffusionPipeline
from transformers import CLIPImageProcessor, CLIPModel
import torch


feature_extractor = CLIPImageProcessor.from_pretrained("laion/CLIP-ViT-B-32-laion2B-s34B-b79K")
clip_model = CLIPModel.from_pretrained("laion/CLIP-ViT-B-32-laion2B-s34B-b79K", torch_dtype=torch.float16)


guided_pipeline = DiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    custom_pipeline="clip_guided_stable_diffusion",
    clip_model=clip_model,
    feature_extractor=feature_extractor,
    torch_dtype=torch.float16,
)
guided_pipeline.enable_attention_slicing()
guided_pipeline = guided_pipeline.to("cuda")

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

generator = torch.Generator(device="cuda").manual_seed(0)
images = []
for i in range(4):
    image = guided_pipeline(
        prompt,
        num_inference_steps=50,
        guidance_scale=7.5,
        clip_guidance_scale=100,
        num_cutouts=4,
        use_cutouts=False,
        generator=generator,
    ).images[0]
    images.append(image)

# save images locally
for i, img in enumerate(images):
    img.save(f"./clip_guided_sd/image_{i}.png")`,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>)`}}),Le=new G({}),Ne=new de({props:{code:`from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("google/ddpm-cifar10-32", custom_pipeline="one_step_unet")
pipe()`,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()`}}),Ge=new G({}),Be=new de({props:{code:`from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    torch_dtype=torch.float16,
    safety_checker=None,  # Very important for videos...lots of false positives while interpolating
    custom_pipeline="interpolate_stable_diffusion",
).to("cuda")
pipe.enable_attention_slicing()

frame_filepaths = pipe.walk(
    prompts=["a dog", "a cat", "a horse"],
    seeds=[42, 1337, 1234],
    num_interpolation_steps=16,
    output_dir="./dreams",
    batch_size=4,
    height=512,
    width=512,
    guidance_scale=8.5,
    num_inference_steps=50,
)`,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>,
)`}}),Ve=new G({}),Ue=new de({props:{code:`#!/usr/bin/env python3
from diffusers import DiffusionPipeline
import PIL
import requests
from io import BytesIO
import torch


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


pipe = DiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    custom_pipeline="stable_diffusion_mega",
    torch_dtype=torch.float16,
)
pipe.to("cuda")
pipe.enable_attention_slicing()


### Text-to-Image

images = pipe.text2img("An astronaut riding a horse").images

### Image-to-Image

init_image = download_image(
    "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
)

prompt = "A fantasy landscape, trending on artstation"

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

### Inpainting

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

prompt = "a cat sitting on a bench"
images = pipe.inpaint(prompt=prompt, image=init_image, mask_image=mask_image, strength=0.75).images`,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`}}),We=new G({}),He=new G({}),Fe=new de({props:{code:`from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained(
    "hakurei/waifu-diffusion", custom_pipeline="lpw_stable_diffusion", torch_dtype=torch.float16
)
pipe = pipe.to("cuda")

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

pipe.text2img(prompt, negative_prompt=neg_prompt, width=512, height=512, max_embeddings_multiples=3).images[0]`,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>]`}}),ze=new G({}),Ye=new de({props:{code:`from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    custom_pipeline="lpw_stable_diffusion_onnx",
    revision="onnx",
    provider="CUDAExecutionProvider",
)

prompt = "a photo of an astronaut riding a horse on mars, best quality"
neg_prompt = "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"

pipe.text2img(prompt, negative_prompt=neg_prompt, width=512, height=512, max_embeddings_multiples=3).images[0]`,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>]`}}),Ke=new G({}),Qe=new de({props:{code:`import torch

import matplotlib.pyplot as plt
from datasets import load_dataset
from diffusers import DiffusionPipeline
from transformers import (
    WhisperForConditionalGeneration,
    WhisperProcessor,
)


device = "cuda" if torch.cuda.is_available() else "cpu"

ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")

audio_sample = ds[3]

text = audio_sample["text"].lower()
speech_data = audio_sample["audio"]["array"]

model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small").to(device)
processor = WhisperProcessor.from_pretrained("openai/whisper-small")

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