import{S as Na,i as Xa,s as Fa,e as a,k as l,w as v,t as d,M as La,c as s,d as n,m as r,a as i,x as y,h as c,b as o,G as e,g as f,y as x,q as w,o as E,B as M,v as Va,L as za}from"../../../chunks/vendor-hf-doc-builder.js";import{D as ke}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Ra}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as it}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ha}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Qa(ot){let m,Z,b,g,U;return g=new Ra({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQXR0ZW5kQW5kRXhjaXRlUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQXR0ZW5kQW5kRXhjaXRlUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMGNhdCUyMGFuZCUyMGElMjBmcm9nJTIyJTBBJTBBJTIzJTIwdXNlJTIwZ2V0X2luZGljZXMlMjBmdW5jdGlvbiUyMHRvJTIwZmluZCUyMG91dCUyMGluZGljZXMlMjBvZiUyMHRoZSUyMHRva2VucyUyMHlvdSUyMHdhbnQlMjB0byUyMGFsdGVyJTBBcGlwZS5nZXRfaW5kaWNlcyhwcm9tcHQpJTBBJTBBdG9rZW5faW5kaWNlcyUyMCUzRCUyMCU1QjIlMkMlMjA1JTVEJTBBc2VlZCUyMCUzRCUyMDYxNDElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoJTIyY3VkYSUyMikubWFudWFsX3NlZWQoc2VlZCklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuX2luZGljZXMlM0R0b2tlbl9pbmRpY2VzJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBtYXhfaXRlcl90b19hbHRlciUzRDI1JTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSUyMCUzRCUyMGltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKGYlMjIuLiUyRmltYWdlcyUyRiU3QnByb21wdCU3RF8lN0JzZWVkJTdELnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionAttendAndExcitePipeline

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


<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a cat and a frog&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># use get_indices function to find out indices of the tokens you want to alter</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.get_indices(prompt)
{<span class="hljs-number">0</span>: <span class="hljs-string">&#x27;&lt;|startoftext|&gt;&#x27;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&#x27;a&lt;/w&gt;&#x27;</span>, <span class="hljs-number">2</span>: <span class="hljs-string">&#x27;cat&lt;/w&gt;&#x27;</span>, <span class="hljs-number">3</span>: <span class="hljs-string">&#x27;and&lt;/w&gt;&#x27;</span>, <span class="hljs-number">4</span>: <span class="hljs-string">&#x27;a&lt;/w&gt;&#x27;</span>, <span class="hljs-number">5</span>: <span class="hljs-string">&#x27;frog&lt;/w&gt;&#x27;</span>, <span class="hljs-number">6</span>: <span class="hljs-string">&#x27;&lt;|endoftext|&gt;&#x27;</span>}

<span class="hljs-meta">&gt;&gt;&gt; </span>token_indices = [<span class="hljs-number">2</span>, <span class="hljs-number">5</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>seed = <span class="hljs-number">6141</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.Generator(<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(seed)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    token_indices=token_indices,
<span class="hljs-meta">... </span>    guidance_scale=<span class="hljs-number">7.5</span>,
<span class="hljs-meta">... </span>    generator=generator,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    max_iter_to_alter=<span class="hljs-number">25</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>image = images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">f&quot;../images/<span class="hljs-subst">{prompt}</span>_<span class="hljs-subst">{seed}</span>.png&quot;</span>)`}}),{c(){m=a("p"),Z=d("Examples:"),b=l(),v(g.$$.fragment)},l(u){m=s(u,"P",{});var k=i(m);Z=c(k,"Examples:"),k.forEach(n),b=r(u),y(g.$$.fragment,u)},m(u,k){f(u,m,k),e(m,Z),f(u,b,k),x(g,u,k),U=!0},p:za,i(u){U||(w(g.$$.fragment,u),U=!0)},o(u){E(g.$$.fragment,u),U=!1},d(u){u&&n(m),u&&n(b),M(g,u)}}}function qa(ot){let m,Z,b,g,U,u,k,De,Pt,lt,S,B,Pe,Y,St,Se,$t,rt,G,It,O,Ct,Jt,dt,be,Zt,ct,ve,$e,Bt,pt,ye,Gt,ft,A,Ie,K,Wt,Rt,Ce,ee,Nt,Xt,Je,te,Ft,Lt,Ze,ne,Vt,ut,$,W,Be,ae,zt,Ge,Ht,ht,R,We,T,Re,Qt,qt,Ne,Yt,Ot,xe,Kt,en,we,tn,nn,Xe,j,Fe,se,an,sn,Le,Ve,on,ln,Ee,rn,dn,Me,ie,cn,mt,I,N,ze,oe,pn,He,fn,gt,le,_t,C,X,Qe,re,un,qe,hn,bt,h,de,mn,Ye,gn,_n,ce,bn,Ae,vn,yn,xn,D,pe,wn,Oe,En,Mn,F,An,L,fe,Tn,ue,jn,Ke,Un,kn,Dn,V,he,Pn,J,Sn,et,$n,In,tt,Cn,Jn,Zn,P,me,Bn,nt,Gn,Wn,at,Rn,Nn,z,ge,Xn,st,Fn,vt;return u=new it({}),Y=new it({}),ae=new it({}),oe=new it({}),le=new Ra({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQXR0ZW5kQW5kRXhjaXRlUGlwZWxpbmUlMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQXR0ZW5kQW5kRXhjaXRlUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KS50byglMjJjdWRhJTIyKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMGNhdCUyMGFuZCUyMGElMjBmcm9nJTIyJTBBJTBBJTIzJTIwdXNlJTIwZ2V0X2luZGljZXMlMjBmdW5jdGlvbiUyMHRvJTIwZmluZCUyMG91dCUyMGluZGljZXMlMjBvZiUyMHRoZSUyMHRva2VucyUyMHlvdSUyMHdhbnQlMjB0byUyMGFsdGVyJTBBcGlwZS5nZXRfaW5kaWNlcyhwcm9tcHQpJTBBJTBBdG9rZW5faW5kaWNlcyUyMCUzRCUyMCU1QjIlMkMlMjA1JTVEJTBBc2VlZCUyMCUzRCUyMDYxNDElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoJTIyY3VkYSUyMikubWFudWFsX3NlZWQoc2VlZCklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuX2luZGljZXMlM0R0b2tlbl9pbmRpY2VzJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBtYXhfaXRlcl90b19hbHRlciUzRDI1JTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSUyMCUzRCUyMGltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKGYlMjIuLiUyRmltYWdlcyUyRiU3QnByb21wdCU3RF8lN0JzZWVkJTdELnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionAttendAndExcitePipeline

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

prompt = <span class="hljs-string">&quot;a cat and a frog&quot;</span>

<span class="hljs-comment"># use get_indices function to find out indices of the tokens you want to alter</span>
pipe.get_indices(prompt)

token_indices = [<span class="hljs-number">2</span>, <span class="hljs-number">5</span>]
seed = <span class="hljs-number">6141</span>
generator = torch.Generator(<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(seed)

images = pipe(
    prompt=prompt,
    token_indices=token_indices,
    guidance_scale=<span class="hljs-number">7.5</span>,
    generator=generator,
    num_inference_steps=<span class="hljs-number">50</span>,
    max_iter_to_alter=<span class="hljs-number">25</span>,
).images

image = images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">f&quot;../images/<span class="hljs-subst">{prompt}</span>_<span class="hljs-subst">{seed}</span>.png&quot;</span>)`}}),re=new it({}),de=new ke({props:{name:"class diffusers.StableDiffusionAttendAndExcitePipeline",anchor:"diffusers.StableDiffusionAttendAndExcitePipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.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.StableDiffusionAttendAndExcitePipeline.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.StableDiffusionAttendAndExcitePipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.2/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.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/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</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/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py#L165"}}),pe=new ke({props:{name:"__call__",anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"token_indices",val:": typing.Union[typing.List[int], typing.List[typing.List[int]]]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",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:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"max_iter_to_alter",val:": int = 25"},{name:"thresholds",val:": dict = {0: 0.05, 10: 0.5, 20: 0.8}"},{name:"scale_factor",val:": int = 20"},{name:"attn_res",val:": typing.Optional[typing.Tuple[int]] = (16, 16)"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.token_indices",description:`<strong>token_indices</strong> (<code>List[int]</code>) &#x2014;
The token indices to alter with attend-and-excite.`,name:"token_indices"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__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.StableDiffusionAttendAndExcitePipeline.__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.StableDiffusionAttendAndExcitePipeline.__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. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__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.StableDiffusionAttendAndExcitePipeline.__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/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__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.StableDiffusionAttendAndExcitePipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__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.StableDiffusionAttendAndExcitePipeline.__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/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__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.StableDiffusionAttendAndExcitePipeline.__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"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.max_iter_to_alter",description:`<strong>max_iter_to_alter</strong> (<code>int</code>, <em>optional</em>, defaults to <code>25</code>) &#x2014;
Number of denoising steps to apply attend-and-excite. The first <max_iter_to_alter> denoising steps are
where the attend-and-excite is applied. I.e. if <code>max_iter_to_alter</code> is 25 and there are a total of <code>30</code>
denoising steps, the first 25 denoising steps will apply attend-and-excite and the last 5 will not
apply attend-and-excite.</max_iter_to_alter>`,name:"max_iter_to_alter"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.thresholds",description:`<strong>thresholds</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>{0 -- 0.05, 10: 0.5, 20: 0.8}</code>):
Dictionary defining the iterations and desired thresholds to apply iterative latent refinement in.`,name:"thresholds"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.scale_factor",description:`<strong>scale_factor</strong> (<code>int</code>, <em>optional</em>, default to 20) &#x2014;
Scale factor that controls the step size of each Attend and Excite update.`,name:"scale_factor"},{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.attn_res",description:`<strong>attn_res</strong> (<code>tuple</code>, <em>optional</em>, default computed from width and height) &#x2014;
The 2D resolution of the semantic attention map.`,name:"attn_res"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py#L722",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#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\`. :type attention_store: object</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),F=new Ha({props:{anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.__call__.example",$$slots:{default:[Qa]},$$scope:{ctx:ot}}}),fe=new ke({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py#L247"}}),he=new ke({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py#L255"}}),me=new ke({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py#L237"}}),ge=new ke({props:{name:"get_indices",anchor:"diffusers.StableDiffusionAttendAndExcitePipeline.get_indices",parameters:[{name:"prompt",val:": str"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_attend_and_excite.py#L716"}}),{c(){m=a("meta"),Z=l(),b=a("h1"),g=a("a"),U=a("span"),v(u.$$.fragment),k=l(),De=a("span"),Pt=d("Attend and Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models"),lt=l(),S=a("h2"),B=a("a"),Pe=a("span"),v(Y.$$.fragment),St=l(),Se=a("span"),$t=d("Overview"),rt=l(),G=a("p"),It=d("Attend and Excite for Stable Diffusion was proposed in "),O=a("a"),Ct=d("Attend-and-Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models"),Jt=d(" and provides textual attention control over the image generation."),dt=l(),be=a("p"),Zt=d("The abstract of the paper is the following:"),ct=l(),ve=a("p"),$e=a("em"),Bt=d("Text-to-image diffusion models have recently received a lot of interest for their astonishing ability to produce high-fidelity images from text only. However, achieving one-shot generation that aligns with the user\u2019s intent is nearly impossible, yet small changes to the input prompt often result in very different images. This leaves the user with little semantic control. To put the user in control, we show how to interact with the diffusion process to flexibly steer it along semantic directions. This semantic guidance (SEGA) allows for subtle and extensive edits, changes in composition and style, as well as optimizing the overall artistic conception. We demonstrate SEGA\u2019s effectiveness on a variety of tasks and provide evidence for its versatility and flexibility."),pt=l(),ye=a("p"),Gt=d("Resources"),ft=l(),A=a("ul"),Ie=a("li"),K=a("a"),Wt=d("Project Page"),Rt=l(),Ce=a("li"),ee=a("a"),Nt=d("Paper"),Xt=l(),Je=a("li"),te=a("a"),Ft=d("Original Code"),Lt=l(),Ze=a("li"),ne=a("a"),Vt=d("Demo"),ut=l(),$=a("h2"),W=a("a"),Be=a("span"),v(ae.$$.fragment),zt=l(),Ge=a("span"),Ht=d("Available Pipelines:"),ht=l(),R=a("table"),We=a("thead"),T=a("tr"),Re=a("th"),Qt=d("Pipeline"),qt=l(),Ne=a("th"),Yt=d("Tasks"),Ot=l(),xe=a("th"),Kt=d("Colab"),en=l(),we=a("th"),tn=d("Demo"),nn=l(),Xe=a("tbody"),j=a("tr"),Fe=a("td"),se=a("a"),an=d("pipeline_semantic_stable_diffusion_attend_and_excite.py"),sn=l(),Le=a("td"),Ve=a("em"),on=d("Text-to-Image Generation"),ln=l(),Ee=a("td"),rn=d("-"),dn=l(),Me=a("td"),ie=a("a"),cn=d("https://huggingface.co/spaces/AttendAndExcite/Attend-and-Excite"),mt=l(),I=a("h3"),N=a("a"),ze=a("span"),v(oe.$$.fragment),pn=l(),He=a("span"),fn=d("Usage example"),gt=l(),v(le.$$.fragment),_t=l(),C=a("h2"),X=a("a"),Qe=a("span"),v(re.$$.fragment),un=l(),qe=a("span"),hn=d("StableDiffusionAttendAndExcitePipeline"),bt=l(),h=a("div"),v(de.$$.fragment),mn=l(),Ye=a("p"),gn=d("Pipeline for text-to-image generation using Stable Diffusion and Attend and Excite."),_n=l(),ce=a("p"),bn=d("This model inherits from "),Ae=a("a"),vn=d("DiffusionPipeline"),yn=d(`. 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.)`),xn=l(),D=a("div"),v(pe.$$.fragment),wn=l(),Oe=a("p"),En=d("Function invoked when calling the pipeline for generation."),Mn=l(),v(F.$$.fragment),An=l(),L=a("div"),v(fe.$$.fragment),Tn=l(),ue=a("p"),jn=d("Disable sliced VAE decoding. If "),Ke=a("code"),Un=d("enable_vae_slicing"),kn=d(` was previously invoked, this method will go back to
computing decoding in one step.`),Dn=l(),V=a("div"),v(he.$$.fragment),Pn=l(),J=a("p"),Sn=d(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),et=a("code"),$n=d("torch.device('meta') and loaded to GPU only when their specific submodule has its "),In=d("forward"),tt=a("code"),Cn=d("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Jn=d("enable_model_cpu_offload`, but performance is lower."),Zn=l(),P=a("div"),v(me.$$.fragment),Bn=l(),nt=a("p"),Gn=d("Enable sliced VAE decoding."),Wn=l(),at=a("p"),Rn=d(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),Nn=l(),z=a("div"),v(ge.$$.fragment),Xn=l(),st=a("p"),Fn=d("Utility function to list the indices of the tokens you wish to alte"),this.h()},l(t){const p=La('[data-svelte="svelte-1phssyn"]',document.head);m=s(p,"META",{name:!0,content:!0}),p.forEach(n),Z=r(t),b=s(t,"H1",{class:!0});var _e=i(b);g=s(_e,"A",{id:!0,class:!0,href:!0});var Ln=i(g);U=s(Ln,"SPAN",{});var Vn=i(U);y(u.$$.fragment,Vn),Vn.forEach(n),Ln.forEach(n),k=r(_e),De=s(_e,"SPAN",{});var zn=i(De);Pt=c(zn,"Attend and Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models"),zn.forEach(n),_e.forEach(n),lt=r(t),S=s(t,"H2",{class:!0});var yt=i(S);B=s(yt,"A",{id:!0,class:!0,href:!0});var Hn=i(B);Pe=s(Hn,"SPAN",{});var Qn=i(Pe);y(Y.$$.fragment,Qn),Qn.forEach(n),Hn.forEach(n),St=r(yt),Se=s(yt,"SPAN",{});var qn=i(Se);$t=c(qn,"Overview"),qn.forEach(n),yt.forEach(n),rt=r(t),G=s(t,"P",{});var xt=i(G);It=c(xt,"Attend and Excite for Stable Diffusion was proposed in "),O=s(xt,"A",{href:!0,rel:!0});var Yn=i(O);Ct=c(Yn,"Attend-and-Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models"),Yn.forEach(n),Jt=c(xt," and provides textual attention control over the image generation."),xt.forEach(n),dt=r(t),be=s(t,"P",{});var On=i(be);Zt=c(On,"The abstract of the paper is the following:"),On.forEach(n),ct=r(t),ve=s(t,"P",{});var Kn=i(ve);$e=s(Kn,"EM",{});var ea=i($e);Bt=c(ea,"Text-to-image diffusion models have recently received a lot of interest for their astonishing ability to produce high-fidelity images from text only. However, achieving one-shot generation that aligns with the user\u2019s intent is nearly impossible, yet small changes to the input prompt often result in very different images. This leaves the user with little semantic control. To put the user in control, we show how to interact with the diffusion process to flexibly steer it along semantic directions. This semantic guidance (SEGA) allows for subtle and extensive edits, changes in composition and style, as well as optimizing the overall artistic conception. We demonstrate SEGA\u2019s effectiveness on a variety of tasks and provide evidence for its versatility and flexibility."),ea.forEach(n),Kn.forEach(n),pt=r(t),ye=s(t,"P",{});var ta=i(ye);Gt=c(ta,"Resources"),ta.forEach(n),ft=r(t),A=s(t,"UL",{});var H=i(A);Ie=s(H,"LI",{});var na=i(Ie);K=s(na,"A",{href:!0,rel:!0});var aa=i(K);Wt=c(aa,"Project Page"),aa.forEach(n),na.forEach(n),Rt=r(H),Ce=s(H,"LI",{});var sa=i(Ce);ee=s(sa,"A",{href:!0,rel:!0});var ia=i(ee);Nt=c(ia,"Paper"),ia.forEach(n),sa.forEach(n),Xt=r(H),Je=s(H,"LI",{});var oa=i(Je);te=s(oa,"A",{href:!0,rel:!0});var la=i(te);Ft=c(la,"Original Code"),la.forEach(n),oa.forEach(n),Lt=r(H),Ze=s(H,"LI",{});var ra=i(Ze);ne=s(ra,"A",{href:!0,rel:!0});var da=i(ne);Vt=c(da,"Demo"),da.forEach(n),ra.forEach(n),H.forEach(n),ut=r(t),$=s(t,"H2",{class:!0});var wt=i($);W=s(wt,"A",{id:!0,class:!0,href:!0});var ca=i(W);Be=s(ca,"SPAN",{});var pa=i(Be);y(ae.$$.fragment,pa),pa.forEach(n),ca.forEach(n),zt=r(wt),Ge=s(wt,"SPAN",{});var fa=i(Ge);Ht=c(fa,"Available Pipelines:"),fa.forEach(n),wt.forEach(n),ht=r(t),R=s(t,"TABLE",{});var Et=i(R);We=s(Et,"THEAD",{});var ua=i(We);T=s(ua,"TR",{});var Q=i(T);Re=s(Q,"TH",{});var ha=i(Re);Qt=c(ha,"Pipeline"),ha.forEach(n),qt=r(Q),Ne=s(Q,"TH",{});var ma=i(Ne);Yt=c(ma,"Tasks"),ma.forEach(n),Ot=r(Q),xe=s(Q,"TH",{align:!0});var ga=i(xe);Kt=c(ga,"Colab"),ga.forEach(n),en=r(Q),we=s(Q,"TH",{align:!0});var _a=i(we);tn=c(_a,"Demo"),_a.forEach(n),Q.forEach(n),ua.forEach(n),nn=r(Et),Xe=s(Et,"TBODY",{});var ba=i(Xe);j=s(ba,"TR",{});var q=i(j);Fe=s(q,"TD",{});var va=i(Fe);se=s(va,"A",{href:!0,rel:!0});var ya=i(se);an=c(ya,"pipeline_semantic_stable_diffusion_attend_and_excite.py"),ya.forEach(n),va.forEach(n),sn=r(q),Le=s(q,"TD",{});var xa=i(Le);Ve=s(xa,"EM",{});var wa=i(Ve);on=c(wa,"Text-to-Image Generation"),wa.forEach(n),xa.forEach(n),ln=r(q),Ee=s(q,"TD",{align:!0});var Ea=i(Ee);rn=c(Ea,"-"),Ea.forEach(n),dn=r(q),Me=s(q,"TD",{align:!0});var Ma=i(Me);ie=s(Ma,"A",{href:!0,rel:!0});var Aa=i(ie);cn=c(Aa,"https://huggingface.co/spaces/AttendAndExcite/Attend-and-Excite"),Aa.forEach(n),Ma.forEach(n),q.forEach(n),ba.forEach(n),Et.forEach(n),mt=r(t),I=s(t,"H3",{class:!0});var Mt=i(I);N=s(Mt,"A",{id:!0,class:!0,href:!0});var Ta=i(N);ze=s(Ta,"SPAN",{});var ja=i(ze);y(oe.$$.fragment,ja),ja.forEach(n),Ta.forEach(n),pn=r(Mt),He=s(Mt,"SPAN",{});var Ua=i(He);fn=c(Ua,"Usage example"),Ua.forEach(n),Mt.forEach(n),gt=r(t),y(le.$$.fragment,t),_t=r(t),C=s(t,"H2",{class:!0});var At=i(C);X=s(At,"A",{id:!0,class:!0,href:!0});var ka=i(X);Qe=s(ka,"SPAN",{});var Da=i(Qe);y(re.$$.fragment,Da),Da.forEach(n),ka.forEach(n),un=r(At),qe=s(At,"SPAN",{});var Pa=i(qe);hn=c(Pa,"StableDiffusionAttendAndExcitePipeline"),Pa.forEach(n),At.forEach(n),bt=r(t),h=s(t,"DIV",{class:!0});var _=i(h);y(de.$$.fragment,_),mn=r(_),Ye=s(_,"P",{});var Sa=i(Ye);gn=c(Sa,"Pipeline for text-to-image generation using Stable Diffusion and Attend and Excite."),Sa.forEach(n),_n=r(_),ce=s(_,"P",{});var Tt=i(ce);bn=c(Tt,"This model inherits from "),Ae=s(Tt,"A",{href:!0});var $a=i(Ae);vn=c($a,"DiffusionPipeline"),$a.forEach(n),yn=c(Tt,`. 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.)`),Tt.forEach(n),xn=r(_),D=s(_,"DIV",{class:!0});var Te=i(D);y(pe.$$.fragment,Te),wn=r(Te),Oe=s(Te,"P",{});var Ia=i(Oe);En=c(Ia,"Function invoked when calling the pipeline for generation."),Ia.forEach(n),Mn=r(Te),y(F.$$.fragment,Te),Te.forEach(n),An=r(_),L=s(_,"DIV",{class:!0});var jt=i(L);y(fe.$$.fragment,jt),Tn=r(jt),ue=s(jt,"P",{});var Ut=i(ue);jn=c(Ut,"Disable sliced VAE decoding. If "),Ke=s(Ut,"CODE",{});var Ca=i(Ke);Un=c(Ca,"enable_vae_slicing"),Ca.forEach(n),kn=c(Ut,` was previously invoked, this method will go back to
computing decoding in one step.`),Ut.forEach(n),jt.forEach(n),Dn=r(_),V=s(_,"DIV",{class:!0});var kt=i(V);y(he.$$.fragment,kt),Pn=r(kt),J=s(kt,"P",{});var je=i(J);Sn=c(je,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),et=s(je,"CODE",{});var Ja=i(et);$n=c(Ja,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ja.forEach(n),In=c(je,"forward"),tt=s(je,"CODE",{});var Za=i(tt);Cn=c(Za,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Za.forEach(n),Jn=c(je,"enable_model_cpu_offload`, but performance is lower."),je.forEach(n),kt.forEach(n),Zn=r(_),P=s(_,"DIV",{class:!0});var Ue=i(P);y(me.$$.fragment,Ue),Bn=r(Ue),nt=s(Ue,"P",{});var Ba=i(nt);Gn=c(Ba,"Enable sliced VAE decoding."),Ba.forEach(n),Wn=r(Ue),at=s(Ue,"P",{});var Ga=i(at);Rn=c(Ga,`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),Ga.forEach(n),Ue.forEach(n),Nn=r(_),z=s(_,"DIV",{class:!0});var Dt=i(z);y(ge.$$.fragment,Dt),Xn=r(Dt),st=s(Dt,"P",{});var Wa=i(st);Fn=c(Wa,"Utility function to list the indices of the tokens you wish to alte"),Wa.forEach(n),Dt.forEach(n),_.forEach(n),this.h()},h(){o(m,"name","hf:doc:metadata"),o(m,"content",JSON.stringify(Ya)),o(g,"id","attend-and-excite-attentionbased-semantic-guidance-for-texttoimage-diffusion-models"),o(g,"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"),o(g,"href","#attend-and-excite-attentionbased-semantic-guidance-for-texttoimage-diffusion-models"),o(b,"class","relative group"),o(B,"id","overview"),o(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"),o(B,"href","#overview"),o(S,"class","relative group"),o(O,"href","https://attendandexcite.github.io/Attend-and-Excite/"),o(O,"rel","nofollow"),o(K,"href","https://attendandexcite.github.io/Attend-and-Excite/"),o(K,"rel","nofollow"),o(ee,"href","https://arxiv.org/abs/2301.13826"),o(ee,"rel","nofollow"),o(te,"href","https://github.com/AttendAndExcite/Attend-and-Excite"),o(te,"rel","nofollow"),o(ne,"href","https://huggingface.co/spaces/AttendAndExcite/Attend-and-Excite"),o(ne,"rel","nofollow"),o(W,"id","available-pipelines"),o(W,"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"),o(W,"href","#available-pipelines"),o($,"class","relative group"),o(xe,"align","center"),o(we,"align","center"),o(se,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_semantic_stable_diffusion_attend_and_excite"),o(se,"rel","nofollow"),o(Ee,"align","center"),o(ie,"href","https://huggingface.co/spaces/AttendAndExcite/Attend-and-Excite"),o(ie,"rel","nofollow"),o(Me,"align","center"),o(N,"id","usage-example"),o(N,"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"),o(N,"href","#usage-example"),o(I,"class","relative group"),o(X,"id","diffusers.StableDiffusionAttendAndExcitePipeline"),o(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"),o(X,"href","#diffusers.StableDiffusionAttendAndExcitePipeline"),o(C,"class","relative group"),o(Ae,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),o(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),o(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),o(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),o(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),o(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),o(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,m),f(t,Z,p),f(t,b,p),e(b,g),e(g,U),x(u,U,null),e(b,k),e(b,De),e(De,Pt),f(t,lt,p),f(t,S,p),e(S,B),e(B,Pe),x(Y,Pe,null),e(S,St),e(S,Se),e(Se,$t),f(t,rt,p),f(t,G,p),e(G,It),e(G,O),e(O,Ct),e(G,Jt),f(t,dt,p),f(t,be,p),e(be,Zt),f(t,ct,p),f(t,ve,p),e(ve,$e),e($e,Bt),f(t,pt,p),f(t,ye,p),e(ye,Gt),f(t,ft,p),f(t,A,p),e(A,Ie),e(Ie,K),e(K,Wt),e(A,Rt),e(A,Ce),e(Ce,ee),e(ee,Nt),e(A,Xt),e(A,Je),e(Je,te),e(te,Ft),e(A,Lt),e(A,Ze),e(Ze,ne),e(ne,Vt),f(t,ut,p),f(t,$,p),e($,W),e(W,Be),x(ae,Be,null),e($,zt),e($,Ge),e(Ge,Ht),f(t,ht,p),f(t,R,p),e(R,We),e(We,T),e(T,Re),e(Re,Qt),e(T,qt),e(T,Ne),e(Ne,Yt),e(T,Ot),e(T,xe),e(xe,Kt),e(T,en),e(T,we),e(we,tn),e(R,nn),e(R,Xe),e(Xe,j),e(j,Fe),e(Fe,se),e(se,an),e(j,sn),e(j,Le),e(Le,Ve),e(Ve,on),e(j,ln),e(j,Ee),e(Ee,rn),e(j,dn),e(j,Me),e(Me,ie),e(ie,cn),f(t,mt,p),f(t,I,p),e(I,N),e(N,ze),x(oe,ze,null),e(I,pn),e(I,He),e(He,fn),f(t,gt,p),x(le,t,p),f(t,_t,p),f(t,C,p),e(C,X),e(X,Qe),x(re,Qe,null),e(C,un),e(C,qe),e(qe,hn),f(t,bt,p),f(t,h,p),x(de,h,null),e(h,mn),e(h,Ye),e(Ye,gn),e(h,_n),e(h,ce),e(ce,bn),e(ce,Ae),e(Ae,vn),e(ce,yn),e(h,xn),e(h,D),x(pe,D,null),e(D,wn),e(D,Oe),e(Oe,En),e(D,Mn),x(F,D,null),e(h,An),e(h,L),x(fe,L,null),e(L,Tn),e(L,ue),e(ue,jn),e(ue,Ke),e(Ke,Un),e(ue,kn),e(h,Dn),e(h,V),x(he,V,null),e(V,Pn),e(V,J),e(J,Sn),e(J,et),e(et,$n),e(J,In),e(J,tt),e(tt,Cn),e(J,Jn),e(h,Zn),e(h,P),x(me,P,null),e(P,Bn),e(P,nt),e(nt,Gn),e(P,Wn),e(P,at),e(at,Rn),e(h,Nn),e(h,z),x(ge,z,null),e(z,Xn),e(z,st),e(st,Fn),vt=!0},p(t,[p]){const _e={};p&2&&(_e.$$scope={dirty:p,ctx:t}),F.$set(_e)},i(t){vt||(w(u.$$.fragment,t),w(Y.$$.fragment,t),w(ae.$$.fragment,t),w(oe.$$.fragment,t),w(le.$$.fragment,t),w(re.$$.fragment,t),w(de.$$.fragment,t),w(pe.$$.fragment,t),w(F.$$.fragment,t),w(fe.$$.fragment,t),w(he.$$.fragment,t),w(me.$$.fragment,t),w(ge.$$.fragment,t),vt=!0)},o(t){E(u.$$.fragment,t),E(Y.$$.fragment,t),E(ae.$$.fragment,t),E(oe.$$.fragment,t),E(le.$$.fragment,t),E(re.$$.fragment,t),E(de.$$.fragment,t),E(pe.$$.fragment,t),E(F.$$.fragment,t),E(fe.$$.fragment,t),E(he.$$.fragment,t),E(me.$$.fragment,t),E(ge.$$.fragment,t),vt=!1},d(t){n(m),t&&n(Z),t&&n(b),M(u),t&&n(lt),t&&n(S),M(Y),t&&n(rt),t&&n(G),t&&n(dt),t&&n(be),t&&n(ct),t&&n(ve),t&&n(pt),t&&n(ye),t&&n(ft),t&&n(A),t&&n(ut),t&&n($),M(ae),t&&n(ht),t&&n(R),t&&n(mt),t&&n(I),M(oe),t&&n(gt),M(le,t),t&&n(_t),t&&n(C),M(re),t&&n(bt),t&&n(h),M(de),M(pe),M(F),M(fe),M(he),M(me),M(ge)}}}const Ya={local:"attend-and-excite-attentionbased-semantic-guidance-for-texttoimage-diffusion-models",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",sections:[{local:"usage-example",title:"Usage example"}],title:"Available Pipelines:"},{local:"diffusers.StableDiffusionAttendAndExcitePipeline",title:"StableDiffusionAttendAndExcitePipeline"}],title:"Attend and Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models"};function Oa(ot){return Va(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ss extends Na{constructor(m){super();Xa(this,m,Oa,qa,Fa,{})}}export{ss as default,Ya as metadata};
