import{S as Tr,i as Lr,s as Cr,e as n,k as f,w as u,t as r,M as Mr,c as o,d as t,m as d,a as s,x as h,h as l,b as a,N as gn,G as e,g as p,y as m,L as Ar,q as g,o as _,B as b,v as Or}from"../../../chunks/vendor-hf-doc-builder.js";import{D as I}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Nr}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Tt}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function zr(Xs){let z,wi,U,B,Lt,ce,_n,Ct,bn,Ii,w,vn,Mt,Dn,yn,pe,wn,In,ue,Pn,Sn,he,xn,kn,me,En,$n,Pi,C,Tn,ge,Ln,Cn,at,Mn,An,Si,M,On,_e,Nn,zn,be,Un,qn,xi,ve,At,Gn,Fn,ki,rt,lt,Vn,De,ft,Zs,Ei,ye,Ot,Wn,jn,$i,R,Nt,E,zt,Hn,Bn,Ut,Rn,Kn,dt,Yn,Jn,ct,Qn,Xn,q,$,qt,we,Zn,eo,Gt,Ft,to,io,pt,Ie,ut,ea,no,ht,Pe,oo,so,T,Vt,Se,ao,ro,Wt,jt,lo,fo,mt,xe,gt,ta,co,_t,ke,po,uo,L,Ht,Ee,ho,mo,$e,Bt,go,_o,Rt,bo,vo,bt,Te,vt,ia,Do,Dt,yo,Ti,G,K,Kt,Le,wo,Yt,Io,Li,Y,Po,Jt,So,xo,Ci,J,Ce,ko,Me,Eo,$o,To,Ae,Lo,Qt,Co,Mo,Mi,Oe,Ai,F,Q,Xt,Ne,Ao,Zt,Oo,Oi,V,ze,No,ei,zo,Ni,W,X,ti,Ue,Uo,ii,qo,zi,v,qe,Go,ni,Fo,Vo,Ge,Wo,yt,jo,Ho,Bo,Z,Fe,Ro,oi,Ko,Yo,A,Ve,Jo,si,Qo,Xo,ai,Zo,es,ee,We,ts,je,is,ri,ns,os,Ui,j,te,li,He,ss,fi,as,qi,D,Be,rs,di,ls,fs,Re,ds,wt,cs,ps,us,ie,Ke,hs,ci,ms,gs,O,Ye,_s,pi,bs,vs,ui,Ds,ys,ne,Je,ws,Qe,Is,hi,Ps,Ss,Gi,H,oe,mi,Xe,xs,gi,ks,Fi,y,Ze,Es,et,$s,_i,Ts,Ls,Cs,tt,Ms,It,As,Os,Ns,se,it,zs,bi,Us,qs,N,nt,Gs,vi,Fs,Vs,Di,Ws,js,ae,ot,Hs,st,Bs,yi,Rs,Ks,Vi;return ce=new Tt({}),Le=new Tt({}),Oe=new Nr({props:{code:`from diffusers import (
    StableDiffusionPipeline,
    StableDiffusionImg2ImgPipeline,
    StableDiffusionInpaintPipeline,
)

img2text = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
img2img = StableDiffusionImg2ImgPipeline(**img2text.components)
inpaint = StableDiffusionInpaintPipeline(**img2text.components)

# now you can use img2text(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    StableDiffusionPipeline,
<span class="hljs-meta">... </span>    StableDiffusionImg2ImgPipeline,
<span class="hljs-meta">... </span>    StableDiffusionInpaintPipeline,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>img2text = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>img2img = StableDiffusionImg2ImgPipeline(**img2text.components)
<span class="hljs-meta">&gt;&gt;&gt; </span>inpaint = StableDiffusionInpaintPipeline(**img2text.components)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># now you can use img2text(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline</span>`}}),Ne=new Tt({}),ze=new I({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List of flags denoting whether the corresponding generated image likely represents &#x201C;not-safe-for-work&#x201D;
(nsfw) content, or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/__init__.py#L13"}}),Ue=new Tt({}),qe=new I({props:{name:"class diffusers.StableDiffusionPipeline",anchor:"diffusers.StableDiffusionPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_922/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/pr_922/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latens. Can be one of
<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/CompVis/stable-diffusion-v1-4" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L20"}}),Fe=new I({props:{name:"__call__",anchor:"diffusers.StableDiffusionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation
deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L121",returnDescription:`
<p><a
  href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Ve=new I({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
a number is provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case,
<code>attention_head_dim</code> must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L94"}}),We=new I({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py#L113"}}),He=new Tt({}),Be=new I({props:{name:"class diffusers.StableDiffusionImg2ImgPipeline",anchor:"diffusers.StableDiffusionImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_922/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/pr_922/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latens. Can be one of
<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/CompVis/stable-diffusion-v1-4" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L32"}}),Ke=new I({props:{name:"__call__",anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"init_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": typing.Optional[int] = 50"},{name:"guidance_scale",val:": typing.Optional[float] = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.init_image",description:`<strong>init_image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"init_image"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>init_image</code>. Must be between 0 and 1.
<code>init_image</code> will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The
number of denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added
noise will be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>init_image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference. This parameter will be modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation
deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L133",returnDescription:`
<p><a
  href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Ye=new I({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
a number is provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case,
<code>attention_head_dim</code> must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L106"}}),Je=new I({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L125"}}),Xe=new Tt({}),Ze=new I({props:{name:"class diffusers.StableDiffusionInpaintPipeline",anchor:"diffusers.StableDiffusionInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_922/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/pr_922/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latens. Can be one of
<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/CompVis/stable-diffusion-v1-4" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L39"}}),it=new I({props:{name:"__call__",anchor:"diffusers.StableDiffusionInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch which will be inpainted, <em>i.e.</em> parts of the image will
be masked out with <code>mask_image</code> and repainted according to <code>prompt</code>.`,name:"image"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be
repainted, while black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be converted
to a single channel (luminance) before use. If it&#x2019;s a tensor, it should contain one color channel (L)
instead of 3, so the expected shape would be <code>(B, H, W, 1)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/pr_922/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation
deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L140",returnDescription:`
<p><a
  href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/pr_922/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),nt=new I({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionInpaintPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionInpaintPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
a number is provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case,
<code>attention_head_dim</code> must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L113"}}),ot=new I({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_922/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py#L132"}}),{c(){z=n("meta"),wi=f(),U=n("h1"),B=n("a"),Lt=n("span"),u(ce.$$.fragment),_n=f(),Ct=n("span"),bn=r("Stable diffusion pipelines"),Ii=f(),w=n("p"),vn=r("Stable Diffusion is a text-to-image "),Mt=n("em"),Dn=r("latent diffusion"),yn=r(" model created by the researchers and engineers from "),pe=n("a"),wn=r("CompVis"),In=r(", "),ue=n("a"),Pn=r("Stability AI"),Sn=r(" and "),he=n("a"),xn=r("LAION"),kn=r(". It\u2019s trained on 512x512 images from a subset of the "),me=n("a"),En=r("LAION-5B"),$n=r(" dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs."),Pi=f(),C=n("p"),Tn=r("Latent diffusion is the research on top of which Stable Diffusion was built. It was proposed in "),ge=n("a"),Ln=r("High-Resolution Image Synthesis with Latent Diffusion Models"),Cn=r(" by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer. You can learn more details about it in the "),at=n("a"),Mn=r("specific pipeline for latent diffusion"),An=r(" that is part of \u{1F917} Diffusers."),Si=f(),M=n("p"),On=r("For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, please refer to the official "),_e=n("a"),Nn=r("launch announcement post"),zn=r(" and "),be=n("a"),Un=r("this section of our own blog post"),qn=r("."),xi=f(),ve=n("p"),At=n("em"),Gn=r("Tips"),Fn=r(":"),ki=f(),rt=n("ul"),lt=n("li"),Vn=r("To tweak your prompts on a specific result you liked, you can generate your own latents, as demonstrated in the following notebook: "),De=n("a"),ft=n("img"),Ei=f(),ye=n("p"),Ot=n("em"),Wn=r("Overview"),jn=r(":"),$i=f(),R=n("table"),Nt=n("thead"),E=n("tr"),zt=n("th"),Hn=r("Pipeline"),Bn=f(),Ut=n("th"),Rn=r("Tasks"),Kn=f(),dt=n("th"),Yn=r("Colab"),Jn=f(),ct=n("th"),Qn=r("Demo"),Xn=f(),q=n("tbody"),$=n("tr"),qt=n("td"),we=n("a"),Zn=r("pipeline_stable_diffusion.py"),eo=f(),Gt=n("td"),Ft=n("em"),to=r("Text-to-Image Generation"),io=f(),pt=n("td"),Ie=n("a"),ut=n("img"),no=f(),ht=n("td"),Pe=n("a"),oo=r("\u{1F917} Stable Diffusion"),so=f(),T=n("tr"),Vt=n("td"),Se=n("a"),ao=r("pipeline_stable_diffusion_img2img.py"),ro=f(),Wt=n("td"),jt=n("em"),lo=r("Image-to-Image Text-Guided Generation"),fo=f(),mt=n("td"),xe=n("a"),gt=n("img"),co=f(),_t=n("td"),ke=n("a"),po=r("\u{1F917} Diffuse the Rest"),uo=f(),L=n("tr"),Ht=n("td"),Ee=n("a"),ho=r("pipeline_stable_diffusion_inpaint.py"),mo=f(),$e=n("td"),Bt=n("strong"),go=r("Experimental"),_o=r(" \u2013 "),Rt=n("em"),bo=r("Text-Guided Image Inpainting"),vo=f(),bt=n("td"),Te=n("a"),vt=n("img"),Do=f(),Dt=n("td"),yo=r("Coming soon"),Ti=f(),G=n("h2"),K=n("a"),Kt=n("span"),u(Le.$$.fragment),wo=f(),Yt=n("span"),Io=r("Tips"),Li=f(),Y=n("p"),Po=r("If you want to use all possible use cases in a single "),Jt=n("code"),So=r("DiffusionPipeline"),xo=r(" you can either:"),Ci=f(),J=n("ul"),Ce=n("li"),ko=r("Make use of the "),Me=n("a"),Eo=r("Stable Diffusion Mega Pipeline"),$o=r(" or"),To=f(),Ae=n("li"),Lo=r("Make use of the "),Qt=n("code"),Co=r("components"),Mo=r(" functionality to instantiate all components in the most memory-efficient way:"),Mi=f(),u(Oe.$$.fragment),Ai=f(),F=n("h2"),Q=n("a"),Xt=n("span"),u(Ne.$$.fragment),Ao=f(),Zt=n("span"),Oo=r("StableDiffusionPipelineOutput"),Oi=f(),V=n("div"),u(ze.$$.fragment),No=f(),ei=n("p"),zo=r("Output class for Stable Diffusion pipelines."),Ni=f(),W=n("h2"),X=n("a"),ti=n("span"),u(Ue.$$.fragment),Uo=f(),ii=n("span"),qo=r("StableDiffusionPipeline"),zi=f(),v=n("div"),u(qe.$$.fragment),Go=f(),ni=n("p"),Fo=r("Pipeline for text-to-image generation using Stable Diffusion."),Vo=f(),Ge=n("p"),Wo=r("This model inherits from "),yt=n("a"),jo=r("DiffusionPipeline"),Ho=r(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Bo=f(),Z=n("div"),u(Fe.$$.fragment),Ro=f(),oi=n("p"),Ko=r("Function invoked when calling the pipeline for generation."),Yo=f(),A=n("div"),u(Ve.$$.fragment),Jo=f(),si=n("p"),Qo=r("Enable sliced attention computation."),Xo=f(),ai=n("p"),Zo=r(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),es=f(),ee=n("div"),u(We.$$.fragment),ts=f(),je=n("p"),is=r("Disable sliced attention computation. If "),ri=n("code"),ns=r("enable_attention_slicing"),os=r(` was previously invoked, this method will go
back to computing attention in one step.`),Ui=f(),j=n("h2"),te=n("a"),li=n("span"),u(He.$$.fragment),ss=f(),fi=n("span"),as=r("StableDiffusionImg2ImgPipeline"),qi=f(),D=n("div"),u(Be.$$.fragment),rs=f(),di=n("p"),ls=r("Pipeline for text-guided image to image generation using Stable Diffusion."),fs=f(),Re=n("p"),ds=r("This model inherits from "),wt=n("a"),cs=r("DiffusionPipeline"),ps=r(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),us=f(),ie=n("div"),u(Ke.$$.fragment),hs=f(),ci=n("p"),ms=r("Function invoked when calling the pipeline for generation."),gs=f(),O=n("div"),u(Ye.$$.fragment),_s=f(),pi=n("p"),bs=r("Enable sliced attention computation."),vs=f(),ui=n("p"),Ds=r(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),ys=f(),ne=n("div"),u(Je.$$.fragment),ws=f(),Qe=n("p"),Is=r("Disable sliced attention computation. If "),hi=n("code"),Ps=r("enable_attention_slicing"),Ss=r(` was previously invoked, this method will go
back to computing attention in one step.`),Gi=f(),H=n("h2"),oe=n("a"),mi=n("span"),u(Xe.$$.fragment),xs=f(),gi=n("span"),ks=r("StableDiffusionInpaintPipeline"),Fi=f(),y=n("div"),u(Ze.$$.fragment),Es=f(),et=n("p"),$s=r("Pipeline for text-guided image inpainting using Stable Diffusion. "),_i=n("em"),Ts=r("This is an experimental feature"),Ls=r("."),Cs=f(),tt=n("p"),Ms=r("This model inherits from "),It=n("a"),As=r("DiffusionPipeline"),Os=r(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ns=f(),se=n("div"),u(it.$$.fragment),zs=f(),bi=n("p"),Us=r("Function invoked when calling the pipeline for generation."),qs=f(),N=n("div"),u(nt.$$.fragment),Gs=f(),vi=n("p"),Fs=r("Enable sliced attention computation."),Vs=f(),Di=n("p"),Ws=r(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),js=f(),ae=n("div"),u(ot.$$.fragment),Hs=f(),st=n("p"),Bs=r("Disable sliced attention computation. If "),yi=n("code"),Rs=r("enable_attention_slicing"),Ks=r(` was previously invoked, this method will go
back to computing attention in one step.`),this.h()},l(i){const c=Mr('[data-svelte="svelte-1phssyn"]',document.head);z=o(c,"META",{name:!0,content:!0}),c.forEach(t),wi=d(i),U=o(i,"H1",{class:!0});var Wi=s(U);B=o(Wi,"A",{id:!0,class:!0,href:!0});var na=s(B);Lt=o(na,"SPAN",{});var oa=s(Lt);h(ce.$$.fragment,oa),oa.forEach(t),na.forEach(t),_n=d(Wi),Ct=o(Wi,"SPAN",{});var sa=s(Ct);bn=l(sa,"Stable diffusion pipelines"),sa.forEach(t),Wi.forEach(t),Ii=d(i),w=o(i,"P",{});var P=s(w);vn=l(P,"Stable Diffusion is a text-to-image "),Mt=o(P,"EM",{});var aa=s(Mt);Dn=l(aa,"latent diffusion"),aa.forEach(t),yn=l(P," model created by the researchers and engineers from "),pe=o(P,"A",{href:!0,rel:!0});var ra=s(pe);wn=l(ra,"CompVis"),ra.forEach(t),In=l(P,", "),ue=o(P,"A",{href:!0,rel:!0});var la=s(ue);Pn=l(la,"Stability AI"),la.forEach(t),Sn=l(P," and "),he=o(P,"A",{href:!0,rel:!0});var fa=s(he);xn=l(fa,"LAION"),fa.forEach(t),kn=l(P,". It\u2019s trained on 512x512 images from a subset of the "),me=o(P,"A",{href:!0,rel:!0});var da=s(me);En=l(da,"LAION-5B"),da.forEach(t),$n=l(P," dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs."),P.forEach(t),Pi=d(i),C=o(i,"P",{});var Pt=s(C);Tn=l(Pt,"Latent diffusion is the research on top of which Stable Diffusion was built. It was proposed in "),ge=o(Pt,"A",{href:!0,rel:!0});var ca=s(ge);Ln=l(ca,"High-Resolution Image Synthesis with Latent Diffusion Models"),ca.forEach(t),Cn=l(Pt," by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer. You can learn more details about it in the "),at=o(Pt,"A",{href:!0});var pa=s(at);Mn=l(pa,"specific pipeline for latent diffusion"),pa.forEach(t),An=l(Pt," that is part of \u{1F917} Diffusers."),Pt.forEach(t),Si=d(i),M=o(i,"P",{});var St=s(M);On=l(St,"For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, please refer to the official "),_e=o(St,"A",{href:!0,rel:!0});var ua=s(_e);Nn=l(ua,"launch announcement post"),ua.forEach(t),zn=l(St," and "),be=o(St,"A",{href:!0,rel:!0});var ha=s(be);Un=l(ha,"this section of our own blog post"),ha.forEach(t),qn=l(St,"."),St.forEach(t),xi=d(i),ve=o(i,"P",{});var Ys=s(ve);At=o(Ys,"EM",{});var ma=s(At);Gn=l(ma,"Tips"),ma.forEach(t),Fn=l(Ys,":"),Ys.forEach(t),ki=d(i),rt=o(i,"UL",{});var ga=s(rt);lt=o(ga,"LI",{});var Js=s(lt);Vn=l(Js,"To tweak your prompts on a specific result you liked, you can generate your own latents, as demonstrated in the following notebook: "),De=o(Js,"A",{href:!0,rel:!0});var _a=s(De);ft=o(_a,"IMG",{src:!0,alt:!0}),_a.forEach(t),Js.forEach(t),ga.forEach(t),Ei=d(i),ye=o(i,"P",{});var Qs=s(ye);Ot=o(Qs,"EM",{});var ba=s(Ot);Wn=l(ba,"Overview"),ba.forEach(t),jn=l(Qs,":"),Qs.forEach(t),$i=d(i),R=o(i,"TABLE",{});var ji=s(R);Nt=o(ji,"THEAD",{});var va=s(Nt);E=o(va,"TR",{});var re=s(E);zt=o(re,"TH",{});var Da=s(zt);Hn=l(Da,"Pipeline"),Da.forEach(t),Bn=d(re),Ut=o(re,"TH",{});var ya=s(Ut);Rn=l(ya,"Tasks"),ya.forEach(t),Kn=d(re),dt=o(re,"TH",{align:!0});var wa=s(dt);Yn=l(wa,"Colab"),wa.forEach(t),Jn=d(re),ct=o(re,"TH",{align:!0});var Ia=s(ct);Qn=l(Ia,"Demo"),Ia.forEach(t),re.forEach(t),va.forEach(t),Xn=d(ji),q=o(ji,"TBODY",{});var xt=s(q);$=o(xt,"TR",{});var le=s($);qt=o(le,"TD",{});var Pa=s(qt);we=o(Pa,"A",{href:!0,rel:!0});var Sa=s(we);Zn=l(Sa,"pipeline_stable_diffusion.py"),Sa.forEach(t),Pa.forEach(t),eo=d(le),Gt=o(le,"TD",{});var xa=s(Gt);Ft=o(xa,"EM",{});var ka=s(Ft);to=l(ka,"Text-to-Image Generation"),ka.forEach(t),xa.forEach(t),io=d(le),pt=o(le,"TD",{align:!0});var Ea=s(pt);Ie=o(Ea,"A",{href:!0,rel:!0});var $a=s(Ie);ut=o($a,"IMG",{src:!0,alt:!0}),$a.forEach(t),Ea.forEach(t),no=d(le),ht=o(le,"TD",{align:!0});var Ta=s(ht);Pe=o(Ta,"A",{href:!0,rel:!0});var La=s(Pe);oo=l(La,"\u{1F917} Stable Diffusion"),La.forEach(t),Ta.forEach(t),le.forEach(t),so=d(xt),T=o(xt,"TR",{});var fe=s(T);Vt=o(fe,"TD",{});var Ca=s(Vt);Se=o(Ca,"A",{href:!0,rel:!0});var Ma=s(Se);ao=l(Ma,"pipeline_stable_diffusion_img2img.py"),Ma.forEach(t),Ca.forEach(t),ro=d(fe),Wt=o(fe,"TD",{});var Aa=s(Wt);jt=o(Aa,"EM",{});var Oa=s(jt);lo=l(Oa,"Image-to-Image Text-Guided Generation"),Oa.forEach(t),Aa.forEach(t),fo=d(fe),mt=o(fe,"TD",{align:!0});var Na=s(mt);xe=o(Na,"A",{href:!0,rel:!0});var za=s(xe);gt=o(za,"IMG",{src:!0,alt:!0}),za.forEach(t),Na.forEach(t),co=d(fe),_t=o(fe,"TD",{align:!0});var Ua=s(_t);ke=o(Ua,"A",{href:!0,rel:!0});var qa=s(ke);po=l(qa,"\u{1F917} Diffuse the Rest"),qa.forEach(t),Ua.forEach(t),fe.forEach(t),uo=d(xt),L=o(xt,"TR",{});var de=s(L);Ht=o(de,"TD",{});var Ga=s(Ht);Ee=o(Ga,"A",{href:!0,rel:!0});var Fa=s(Ee);ho=l(Fa,"pipeline_stable_diffusion_inpaint.py"),Fa.forEach(t),Ga.forEach(t),mo=d(de),$e=o(de,"TD",{});var Hi=s($e);Bt=o(Hi,"STRONG",{});var Va=s(Bt);go=l(Va,"Experimental"),Va.forEach(t),_o=l(Hi," \u2013 "),Rt=o(Hi,"EM",{});var Wa=s(Rt);bo=l(Wa,"Text-Guided Image Inpainting"),Wa.forEach(t),Hi.forEach(t),vo=d(de),bt=o(de,"TD",{align:!0});var ja=s(bt);Te=o(ja,"A",{href:!0,rel:!0});var Ha=s(Te);vt=o(Ha,"IMG",{src:!0,alt:!0}),Ha.forEach(t),ja.forEach(t),Do=d(de),Dt=o(de,"TD",{align:!0});var Ba=s(Dt);yo=l(Ba,"Coming soon"),Ba.forEach(t),de.forEach(t),xt.forEach(t),ji.forEach(t),Ti=d(i),G=o(i,"H2",{class:!0});var Bi=s(G);K=o(Bi,"A",{id:!0,class:!0,href:!0});var Ra=s(K);Kt=o(Ra,"SPAN",{});var Ka=s(Kt);h(Le.$$.fragment,Ka),Ka.forEach(t),Ra.forEach(t),wo=d(Bi),Yt=o(Bi,"SPAN",{});var Ya=s(Yt);Io=l(Ya,"Tips"),Ya.forEach(t),Bi.forEach(t),Li=d(i),Y=o(i,"P",{});var Ri=s(Y);Po=l(Ri,"If you want to use all possible use cases in a single "),Jt=o(Ri,"CODE",{});var Ja=s(Jt);So=l(Ja,"DiffusionPipeline"),Ja.forEach(t),xo=l(Ri," you can either:"),Ri.forEach(t),Ci=d(i),J=o(i,"UL",{});var Ki=s(J);Ce=o(Ki,"LI",{});var Yi=s(Ce);ko=l(Yi,"Make use of the "),Me=o(Yi,"A",{href:!0,rel:!0});var Qa=s(Me);Eo=l(Qa,"Stable Diffusion Mega Pipeline"),Qa.forEach(t),$o=l(Yi," or"),Yi.forEach(t),To=d(Ki),Ae=o(Ki,"LI",{});var Ji=s(Ae);Lo=l(Ji,"Make use of the "),Qt=o(Ji,"CODE",{});var Xa=s(Qt);Co=l(Xa,"components"),Xa.forEach(t),Mo=l(Ji," functionality to instantiate all components in the most memory-efficient way:"),Ji.forEach(t),Ki.forEach(t),Mi=d(i),h(Oe.$$.fragment,i),Ai=d(i),F=o(i,"H2",{class:!0});var Qi=s(F);Q=o(Qi,"A",{id:!0,class:!0,href:!0});var Za=s(Q);Xt=o(Za,"SPAN",{});var er=s(Xt);h(Ne.$$.fragment,er),er.forEach(t),Za.forEach(t),Ao=d(Qi),Zt=o(Qi,"SPAN",{});var tr=s(Zt);Oo=l(tr,"StableDiffusionPipelineOutput"),tr.forEach(t),Qi.forEach(t),Oi=d(i),V=o(i,"DIV",{class:!0});var Xi=s(V);h(ze.$$.fragment,Xi),No=d(Xi),ei=o(Xi,"P",{});var ir=s(ei);zo=l(ir,"Output class for Stable Diffusion pipelines."),ir.forEach(t),Xi.forEach(t),Ni=d(i),W=o(i,"H2",{class:!0});var Zi=s(W);X=o(Zi,"A",{id:!0,class:!0,href:!0});var nr=s(X);ti=o(nr,"SPAN",{});var or=s(ti);h(Ue.$$.fragment,or),or.forEach(t),nr.forEach(t),Uo=d(Zi),ii=o(Zi,"SPAN",{});var sr=s(ii);qo=l(sr,"StableDiffusionPipeline"),sr.forEach(t),Zi.forEach(t),zi=d(i),v=o(i,"DIV",{class:!0});var S=s(v);h(qe.$$.fragment,S),Go=d(S),ni=o(S,"P",{});var ar=s(ni);Fo=l(ar,"Pipeline for text-to-image generation using Stable Diffusion."),ar.forEach(t),Vo=d(S),Ge=o(S,"P",{});var en=s(Ge);Wo=l(en,"This model inherits from "),yt=o(en,"A",{href:!0});var rr=s(yt);jo=l(rr,"DiffusionPipeline"),rr.forEach(t),Ho=l(en,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),en.forEach(t),Bo=d(S),Z=o(S,"DIV",{class:!0});var tn=s(Z);h(Fe.$$.fragment,tn),Ro=d(tn),oi=o(tn,"P",{});var lr=s(oi);Ko=l(lr,"Function invoked when calling the pipeline for generation."),lr.forEach(t),tn.forEach(t),Yo=d(S),A=o(S,"DIV",{class:!0});var kt=s(A);h(Ve.$$.fragment,kt),Jo=d(kt),si=o(kt,"P",{});var fr=s(si);Qo=l(fr,"Enable sliced attention computation."),fr.forEach(t),Xo=d(kt),ai=o(kt,"P",{});var dr=s(ai);Zo=l(dr,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),dr.forEach(t),kt.forEach(t),es=d(S),ee=o(S,"DIV",{class:!0});var nn=s(ee);h(We.$$.fragment,nn),ts=d(nn),je=o(nn,"P",{});var on=s(je);is=l(on,"Disable sliced attention computation. If "),ri=o(on,"CODE",{});var cr=s(ri);ns=l(cr,"enable_attention_slicing"),cr.forEach(t),os=l(on,` was previously invoked, this method will go
back to computing attention in one step.`),on.forEach(t),nn.forEach(t),S.forEach(t),Ui=d(i),j=o(i,"H2",{class:!0});var sn=s(j);te=o(sn,"A",{id:!0,class:!0,href:!0});var pr=s(te);li=o(pr,"SPAN",{});var ur=s(li);h(He.$$.fragment,ur),ur.forEach(t),pr.forEach(t),ss=d(sn),fi=o(sn,"SPAN",{});var hr=s(fi);as=l(hr,"StableDiffusionImg2ImgPipeline"),hr.forEach(t),sn.forEach(t),qi=d(i),D=o(i,"DIV",{class:!0});var x=s(D);h(Be.$$.fragment,x),rs=d(x),di=o(x,"P",{});var mr=s(di);ls=l(mr,"Pipeline for text-guided image to image generation using Stable Diffusion."),mr.forEach(t),fs=d(x),Re=o(x,"P",{});var an=s(Re);ds=l(an,"This model inherits from "),wt=o(an,"A",{href:!0});var gr=s(wt);cs=l(gr,"DiffusionPipeline"),gr.forEach(t),ps=l(an,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),an.forEach(t),us=d(x),ie=o(x,"DIV",{class:!0});var rn=s(ie);h(Ke.$$.fragment,rn),hs=d(rn),ci=o(rn,"P",{});var _r=s(ci);ms=l(_r,"Function invoked when calling the pipeline for generation."),_r.forEach(t),rn.forEach(t),gs=d(x),O=o(x,"DIV",{class:!0});var Et=s(O);h(Ye.$$.fragment,Et),_s=d(Et),pi=o(Et,"P",{});var br=s(pi);bs=l(br,"Enable sliced attention computation."),br.forEach(t),vs=d(Et),ui=o(Et,"P",{});var vr=s(ui);Ds=l(vr,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),vr.forEach(t),Et.forEach(t),ys=d(x),ne=o(x,"DIV",{class:!0});var ln=s(ne);h(Je.$$.fragment,ln),ws=d(ln),Qe=o(ln,"P",{});var fn=s(Qe);Is=l(fn,"Disable sliced attention computation. If "),hi=o(fn,"CODE",{});var Dr=s(hi);Ps=l(Dr,"enable_attention_slicing"),Dr.forEach(t),Ss=l(fn,` was previously invoked, this method will go
back to computing attention in one step.`),fn.forEach(t),ln.forEach(t),x.forEach(t),Gi=d(i),H=o(i,"H2",{class:!0});var dn=s(H);oe=o(dn,"A",{id:!0,class:!0,href:!0});var yr=s(oe);mi=o(yr,"SPAN",{});var wr=s(mi);h(Xe.$$.fragment,wr),wr.forEach(t),yr.forEach(t),xs=d(dn),gi=o(dn,"SPAN",{});var Ir=s(gi);ks=l(Ir,"StableDiffusionInpaintPipeline"),Ir.forEach(t),dn.forEach(t),Fi=d(i),y=o(i,"DIV",{class:!0});var k=s(y);h(Ze.$$.fragment,k),Es=d(k),et=o(k,"P",{});var cn=s(et);$s=l(cn,"Pipeline for text-guided image inpainting using Stable Diffusion. "),_i=o(cn,"EM",{});var Pr=s(_i);Ts=l(Pr,"This is an experimental feature"),Pr.forEach(t),Ls=l(cn,"."),cn.forEach(t),Cs=d(k),tt=o(k,"P",{});var pn=s(tt);Ms=l(pn,"This model inherits from "),It=o(pn,"A",{href:!0});var Sr=s(It);As=l(Sr,"DiffusionPipeline"),Sr.forEach(t),Os=l(pn,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),pn.forEach(t),Ns=d(k),se=o(k,"DIV",{class:!0});var un=s(se);h(it.$$.fragment,un),zs=d(un),bi=o(un,"P",{});var xr=s(bi);Us=l(xr,"Function invoked when calling the pipeline for generation."),xr.forEach(t),un.forEach(t),qs=d(k),N=o(k,"DIV",{class:!0});var $t=s(N);h(nt.$$.fragment,$t),Gs=d($t),vi=o($t,"P",{});var kr=s(vi);Fs=l(kr,"Enable sliced attention computation."),kr.forEach(t),Vs=d($t),Di=o($t,"P",{});var Er=s(Di);Ws=l(Er,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),Er.forEach(t),$t.forEach(t),js=d(k),ae=o(k,"DIV",{class:!0});var hn=s(ae);h(ot.$$.fragment,hn),Hs=d(hn),st=o(hn,"P",{});var mn=s(st);Bs=l(mn,"Disable sliced attention computation. If "),yi=o(mn,"CODE",{});var $r=s(yi);Rs=l($r,"enable_attention_slicing"),$r.forEach(t),Ks=l(mn,` was previously invoked, this method will go
back to computing attention in one step.`),mn.forEach(t),hn.forEach(t),k.forEach(t),this.h()},h(){a(z,"name","hf:doc:metadata"),a(z,"content",JSON.stringify(Ur)),a(B,"id","stable-diffusion-pipelines"),a(B,"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"),a(B,"href","#stable-diffusion-pipelines"),a(U,"class","relative group"),a(pe,"href","https://github.com/CompVis"),a(pe,"rel","nofollow"),a(ue,"href","https://stability.ai/"),a(ue,"rel","nofollow"),a(he,"href","https://laion.ai/"),a(he,"rel","nofollow"),a(me,"href","https://laion.ai/blog/laion-5b/"),a(me,"rel","nofollow"),a(ge,"href","https://arxiv.org/abs/2112.10752"),a(ge,"rel","nofollow"),a(at,"href","pipelines/latent_diffusion"),a(_e,"href","https://stability.ai/blog/stable-diffusion-announcement"),a(_e,"rel","nofollow"),a(be,"href","https://huggingface.co/blog/stable_diffusion#how-does-stable-diffusion-work"),a(be,"rel","nofollow"),gn(ft.src,Zs="https://colab.research.google.com/assets/colab-badge.svg")||a(ft,"src",Zs),a(ft,"alt","Open In Colab"),a(De,"href","https://colab.research.google.com/github/pcuenca/diffusers-examples/blob/main/notebooks/stable-diffusion-seeds.ipynb"),a(De,"rel","nofollow"),a(dt,"align","center"),a(ct,"align","center"),a(we,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py"),a(we,"rel","nofollow"),gn(ut.src,ea="https://colab.research.google.com/assets/colab-badge.svg")||a(ut,"src",ea),a(ut,"alt","Open In Colab"),a(Ie,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb"),a(Ie,"rel","nofollow"),a(pt,"align","center"),a(Pe,"href","https://huggingface.co/spaces/stabilityai/stable-diffusion"),a(Pe,"rel","nofollow"),a(ht,"align","center"),a(Se,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py"),a(Se,"rel","nofollow"),gn(gt.src,ta="https://colab.research.google.com/assets/colab-badge.svg")||a(gt,"src",ta),a(gt,"alt","Open In Colab"),a(xe,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb"),a(xe,"rel","nofollow"),a(mt,"align","center"),a(ke,"href","https://huggingface.co/spaces/huggingface/diffuse-the-rest"),a(ke,"rel","nofollow"),a(_t,"align","center"),a(Ee,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py"),a(Ee,"rel","nofollow"),gn(vt.src,ia="https://colab.research.google.com/assets/colab-badge.svg")||a(vt,"src",ia),a(vt,"alt","Open In Colab"),a(Te,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb"),a(Te,"rel","nofollow"),a(bt,"align","center"),a(Dt,"align","center"),a(K,"id","tips"),a(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"),a(K,"href","#tips"),a(G,"class","relative group"),a(Me,"href","https://github.com/huggingface/diffusers/tree/main/examples/community#stable-diffusion-mega"),a(Me,"rel","nofollow"),a(Q,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),a(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),a(Q,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),a(F,"class","relative group"),a(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(X,"id","diffusers.StableDiffusionPipeline"),a(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"),a(X,"href","#diffusers.StableDiffusionPipeline"),a(W,"class","relative group"),a(yt,"href","/docs/diffusers/pr_922/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),a(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(te,"id","diffusers.StableDiffusionImg2ImgPipeline"),a(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"),a(te,"href","#diffusers.StableDiffusionImg2ImgPipeline"),a(j,"class","relative group"),a(wt,"href","/docs/diffusers/pr_922/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),a(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(oe,"id","diffusers.StableDiffusionInpaintPipeline"),a(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"),a(oe,"href","#diffusers.StableDiffusionInpaintPipeline"),a(H,"class","relative group"),a(It,"href","/docs/diffusers/pr_922/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),a(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),a(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,c){e(document.head,z),p(i,wi,c),p(i,U,c),e(U,B),e(B,Lt),m(ce,Lt,null),e(U,_n),e(U,Ct),e(Ct,bn),p(i,Ii,c),p(i,w,c),e(w,vn),e(w,Mt),e(Mt,Dn),e(w,yn),e(w,pe),e(pe,wn),e(w,In),e(w,ue),e(ue,Pn),e(w,Sn),e(w,he),e(he,xn),e(w,kn),e(w,me),e(me,En),e(w,$n),p(i,Pi,c),p(i,C,c),e(C,Tn),e(C,ge),e(ge,Ln),e(C,Cn),e(C,at),e(at,Mn),e(C,An),p(i,Si,c),p(i,M,c),e(M,On),e(M,_e),e(_e,Nn),e(M,zn),e(M,be),e(be,Un),e(M,qn),p(i,xi,c),p(i,ve,c),e(ve,At),e(At,Gn),e(ve,Fn),p(i,ki,c),p(i,rt,c),e(rt,lt),e(lt,Vn),e(lt,De),e(De,ft),p(i,Ei,c),p(i,ye,c),e(ye,Ot),e(Ot,Wn),e(ye,jn),p(i,$i,c),p(i,R,c),e(R,Nt),e(Nt,E),e(E,zt),e(zt,Hn),e(E,Bn),e(E,Ut),e(Ut,Rn),e(E,Kn),e(E,dt),e(dt,Yn),e(E,Jn),e(E,ct),e(ct,Qn),e(R,Xn),e(R,q),e(q,$),e($,qt),e(qt,we),e(we,Zn),e($,eo),e($,Gt),e(Gt,Ft),e(Ft,to),e($,io),e($,pt),e(pt,Ie),e(Ie,ut),e($,no),e($,ht),e(ht,Pe),e(Pe,oo),e(q,so),e(q,T),e(T,Vt),e(Vt,Se),e(Se,ao),e(T,ro),e(T,Wt),e(Wt,jt),e(jt,lo),e(T,fo),e(T,mt),e(mt,xe),e(xe,gt),e(T,co),e(T,_t),e(_t,ke),e(ke,po),e(q,uo),e(q,L),e(L,Ht),e(Ht,Ee),e(Ee,ho),e(L,mo),e(L,$e),e($e,Bt),e(Bt,go),e($e,_o),e($e,Rt),e(Rt,bo),e(L,vo),e(L,bt),e(bt,Te),e(Te,vt),e(L,Do),e(L,Dt),e(Dt,yo),p(i,Ti,c),p(i,G,c),e(G,K),e(K,Kt),m(Le,Kt,null),e(G,wo),e(G,Yt),e(Yt,Io),p(i,Li,c),p(i,Y,c),e(Y,Po),e(Y,Jt),e(Jt,So),e(Y,xo),p(i,Ci,c),p(i,J,c),e(J,Ce),e(Ce,ko),e(Ce,Me),e(Me,Eo),e(Ce,$o),e(J,To),e(J,Ae),e(Ae,Lo),e(Ae,Qt),e(Qt,Co),e(Ae,Mo),p(i,Mi,c),m(Oe,i,c),p(i,Ai,c),p(i,F,c),e(F,Q),e(Q,Xt),m(Ne,Xt,null),e(F,Ao),e(F,Zt),e(Zt,Oo),p(i,Oi,c),p(i,V,c),m(ze,V,null),e(V,No),e(V,ei),e(ei,zo),p(i,Ni,c),p(i,W,c),e(W,X),e(X,ti),m(Ue,ti,null),e(W,Uo),e(W,ii),e(ii,qo),p(i,zi,c),p(i,v,c),m(qe,v,null),e(v,Go),e(v,ni),e(ni,Fo),e(v,Vo),e(v,Ge),e(Ge,Wo),e(Ge,yt),e(yt,jo),e(Ge,Ho),e(v,Bo),e(v,Z),m(Fe,Z,null),e(Z,Ro),e(Z,oi),e(oi,Ko),e(v,Yo),e(v,A),m(Ve,A,null),e(A,Jo),e(A,si),e(si,Qo),e(A,Xo),e(A,ai),e(ai,Zo),e(v,es),e(v,ee),m(We,ee,null),e(ee,ts),e(ee,je),e(je,is),e(je,ri),e(ri,ns),e(je,os),p(i,Ui,c),p(i,j,c),e(j,te),e(te,li),m(He,li,null),e(j,ss),e(j,fi),e(fi,as),p(i,qi,c),p(i,D,c),m(Be,D,null),e(D,rs),e(D,di),e(di,ls),e(D,fs),e(D,Re),e(Re,ds),e(Re,wt),e(wt,cs),e(Re,ps),e(D,us),e(D,ie),m(Ke,ie,null),e(ie,hs),e(ie,ci),e(ci,ms),e(D,gs),e(D,O),m(Ye,O,null),e(O,_s),e(O,pi),e(pi,bs),e(O,vs),e(O,ui),e(ui,Ds),e(D,ys),e(D,ne),m(Je,ne,null),e(ne,ws),e(ne,Qe),e(Qe,Is),e(Qe,hi),e(hi,Ps),e(Qe,Ss),p(i,Gi,c),p(i,H,c),e(H,oe),e(oe,mi),m(Xe,mi,null),e(H,xs),e(H,gi),e(gi,ks),p(i,Fi,c),p(i,y,c),m(Ze,y,null),e(y,Es),e(y,et),e(et,$s),e(et,_i),e(_i,Ts),e(et,Ls),e(y,Cs),e(y,tt),e(tt,Ms),e(tt,It),e(It,As),e(tt,Os),e(y,Ns),e(y,se),m(it,se,null),e(se,zs),e(se,bi),e(bi,Us),e(y,qs),e(y,N),m(nt,N,null),e(N,Gs),e(N,vi),e(vi,Fs),e(N,Vs),e(N,Di),e(Di,Ws),e(y,js),e(y,ae),m(ot,ae,null),e(ae,Hs),e(ae,st),e(st,Bs),e(st,yi),e(yi,Rs),e(st,Ks),Vi=!0},p:Ar,i(i){Vi||(g(ce.$$.fragment,i),g(Le.$$.fragment,i),g(Oe.$$.fragment,i),g(Ne.$$.fragment,i),g(ze.$$.fragment,i),g(Ue.$$.fragment,i),g(qe.$$.fragment,i),g(Fe.$$.fragment,i),g(Ve.$$.fragment,i),g(We.$$.fragment,i),g(He.$$.fragment,i),g(Be.$$.fragment,i),g(Ke.$$.fragment,i),g(Ye.$$.fragment,i),g(Je.$$.fragment,i),g(Xe.$$.fragment,i),g(Ze.$$.fragment,i),g(it.$$.fragment,i),g(nt.$$.fragment,i),g(ot.$$.fragment,i),Vi=!0)},o(i){_(ce.$$.fragment,i),_(Le.$$.fragment,i),_(Oe.$$.fragment,i),_(Ne.$$.fragment,i),_(ze.$$.fragment,i),_(Ue.$$.fragment,i),_(qe.$$.fragment,i),_(Fe.$$.fragment,i),_(Ve.$$.fragment,i),_(We.$$.fragment,i),_(He.$$.fragment,i),_(Be.$$.fragment,i),_(Ke.$$.fragment,i),_(Ye.$$.fragment,i),_(Je.$$.fragment,i),_(Xe.$$.fragment,i),_(Ze.$$.fragment,i),_(it.$$.fragment,i),_(nt.$$.fragment,i),_(ot.$$.fragment,i),Vi=!1},d(i){t(z),i&&t(wi),i&&t(U),b(ce),i&&t(Ii),i&&t(w),i&&t(Pi),i&&t(C),i&&t(Si),i&&t(M),i&&t(xi),i&&t(ve),i&&t(ki),i&&t(rt),i&&t(Ei),i&&t(ye),i&&t($i),i&&t(R),i&&t(Ti),i&&t(G),b(Le),i&&t(Li),i&&t(Y),i&&t(Ci),i&&t(J),i&&t(Mi),b(Oe,i),i&&t(Ai),i&&t(F),b(Ne),i&&t(Oi),i&&t(V),b(ze),i&&t(Ni),i&&t(W),b(Ue),i&&t(zi),i&&t(v),b(qe),b(Fe),b(Ve),b(We),i&&t(Ui),i&&t(j),b(He),i&&t(qi),i&&t(D),b(Be),b(Ke),b(Ye),b(Je),i&&t(Gi),i&&t(H),b(Xe),i&&t(Fi),i&&t(y),b(Ze),b(it),b(nt),b(ot)}}}const Ur={local:"stable-diffusion-pipelines",sections:[{local:"tips",title:"Tips"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"},{local:"diffusers.StableDiffusionPipeline",title:"StableDiffusionPipeline"},{local:"diffusers.StableDiffusionImg2ImgPipeline",title:"StableDiffusionImg2ImgPipeline"},{local:"diffusers.StableDiffusionInpaintPipeline",title:"StableDiffusionInpaintPipeline"}],title:"Stable diffusion pipelines"};function qr(Xs){return Or(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class jr extends Tr{constructor(z){super();Lr(this,z,qr,zr,Cr,{})}}export{jr as default,Ur as metadata};
