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