import{s as Fs,o as Hs,n as Gs}from"../chunks/scheduler.8c3d61f6.js";import{S as zs,i as Ls,g as Z,s as u,r as f,A as Ss,h as b,f as a,c as r,j as ks,u as M,x as U,k as Cs,y as ps,a as p,v as m,d as h,t as j,w as y}from"../chunks/index.da70eac4.js";import{C as W}from"../chunks/CodeBlock.a9c4becf.js";import{H as ts,E as Ps}from"../chunks/getInferenceSnippets.cb466318.js";import{H as qs,a as Vs}from"../chunks/HfOption.6c3b4e77.js";function Ds(w){let n,d;return n=new W({props:{code:"Z3VpZGVyX3NwZWMlMjAlM0QlMjB0MmlfcGlwZWxpbmUuZ2V0X2NvbXBvbmVudF9zcGVjKCUyMmd1aWRlciUyMiklMEFndWlkZXIlMjAlM0QlMjBndWlkZXJfc3BlYy5jcmVhdGUoZ3VpZGFuY2Vfc2NhbGUlM0QxMCklMEF0MmlfcGlwZWxpbmUudXBkYXRlX2NvbXBvbmVudHMoZ3VpZGVyJTNEZ3VpZGVyKQ==",highlighted:`guider_spec = t2i_pipeline.get_component_spec(<span class="hljs-string">&quot;guider&quot;</span>)
guider = guider_spec.create(guidance_scale=<span class="hljs-number">10</span>)
t2i_pipeline.update_components(guider=guider)`,wrap:!1}}),{c(){f(n.$$.fragment)},l(t){M(n.$$.fragment,t)},m(t,c){m(n,t,c),d=!0},p:Gs,i(t){d||(h(n.$$.fragment,t),d=!0)},o(t){j(n.$$.fragment,t),d=!1},d(t){y(n,t)}}}function Ks(w){let n,d;return n=new W({props:{code:"Z3VpZGVyX3NwZWMlMjAlM0QlMjB0MmlfcGlwZWxpbmUuZ2V0X2NvbXBvbmVudF9zcGVjKCUyMmd1aWRlciUyMiklMEFndWlkZXJfc3BlYy5jb25maWclNUIlMjJndWlkYW5jZV9zY2FsZSUyMiU1RCUyMCUzRCUyMDEwJTBBdDJpX3BpcGVsaW5lLnVwZGF0ZV9jb21wb25lbnRzKGd1aWRlciUzRGd1aWRlcl9zcGVjKQ==",highlighted:`guider_spec = t2i_pipeline.get_component_spec(<span class="hljs-string">&quot;guider&quot;</span>)
guider_spec.config[<span class="hljs-string">&quot;guidance_scale&quot;</span>] = <span class="hljs-number">10</span>
t2i_pipeline.update_components(guider=guider_spec)`,wrap:!1}}),{c(){f(n.$$.fragment)},l(t){M(n.$$.fragment,t)},m(t,c){m(n,t,c),d=!0},p:Gs,i(t){d||(h(n.$$.fragment,t),d=!0)},o(t){j(n.$$.fragment,t),d=!1},d(t){y(n,t)}}}function Os(w){let n,d,t,c;return n=new Vs({props:{id:"switch",option:"create",$$slots:{default:[Ds]},$$scope:{ctx:w}}}),t=new Vs({props:{id:"switch",option:"update_components",$$slots:{default:[Ks]},$$scope:{ctx:w}}}),{c(){f(n.$$.fragment),d=u(),f(t.$$.fragment)},l(l){M(n.$$.fragment,l),d=r(l),M(t.$$.fragment,l)},m(l,i){m(n,l,i),p(l,d,i),m(t,l,i),c=!0},p(l,i){const J={};i&2&&(J.$$scope={dirty:i,ctx:l}),n.$set(J);const _={};i&2&&(_.$$scope={dirty:i,ctx:l}),t.$set(_)},i(l){c||(h(n.$$.fragment,l),h(t.$$.fragment,l),c=!0)},o(l){j(n.$$.fragment,l),j(t.$$.fragment,l),c=!1},d(l){l&&a(d),y(n,l),y(t,l)}}}function se(w){let n,d="Edit the <code>modular_model_index.json</code> file and add a loading specification for the guider by pointing to a folder containing the guider config.",t,c,l;return c=new W({props:{code:"JTdCJTBBJTIwJTIwJTIyZ3VpZGVyJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyUGVydHVyYmVkQXR0ZW50aW9uR3VpZGFuY2UlMjIlMkMlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJyZXBvJTIyJTNBJTIwJTIyWWlZaVh1JTJGbW9kdWxhci1sb2FkZXItdDJpLWd1aWRlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnJldmlzaW9uJTIyJTNBJTIwbnVsbCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnN1YmZvbGRlciUyMiUzQSUyMCUyMnBhZ19ndWlkZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJ0eXBlX2hpbnQlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJkaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJQZXJ0dXJiZWRBdHRlbnRpb25HdWlkYW5jZSUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnZhcmlhbnQlMjIlM0ElMjBudWxsJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTVEJTJD",highlighted:`<span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;guider&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;PerturbedAttentionGuidance&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">&quot;repo&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;YiYiXu/modular-loader-t2i-guider&quot;</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;revision&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;subfolder&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;pag_guider&quot;</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;type_hint&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
        <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
        <span class="hljs-string">&quot;PerturbedAttentionGuidance&quot;</span>
      <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;variant&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span>
    <span class="hljs-punctuation">}</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>`,wrap:!1}}),{c(){n=Z("p"),n.innerHTML=d,t=u(),f(c.$$.fragment)},l(i){n=b(i,"P",{"data-svelte-h":!0}),U(n)!=="svelte-1ouml9j"&&(n.innerHTML=d),t=r(i),M(c.$$.fragment,i)},m(i,J){p(i,n,J),p(i,t,J),m(c,i,J),l=!0},p:Gs,i(i){l||(h(c.$$.fragment,i),l=!0)},o(i){j(c.$$.fragment,i),l=!1},d(i){i&&(a(n),a(t)),y(c,i)}}}function ee(w){let n,d='Change the <code>default_creation_method()</code> to <code>from_pretrained</code> and use <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.update_components">update_components()</a> to update the guider and component specifications as well as the pipeline config.',t,c,l,i="Changing the creation method will return text letting you know you’re changing the creation type to <code>from_pretrained</code>.",J,_,V,$,I,k,C='To make it the default guider for a pipeline, call <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a>. This is an optional step and not necessary if you are only experimenting locally.',G,T,R;return _=new W({props:{code:"TW9kdWxhclBpcGVsaW5lLnVwZGF0ZV9jb21wb25lbnRzJTNBJTIwY2hhbmdpbmclMjB0aGUlMjBkZWZhdWx0X2NyZWF0aW9uX21ldGhvZCUyMG9mJTIwZ3VpZGVyJTIwZnJvbSUyMGZyb21fY29uZmlnJTIwdG8lMjBmcm9tX3ByZXRyYWluZWQu",highlighted:"ModularPipeline.update_components: changing the default_creation_method of guider from from_config to from_pretrained.",wrap:!1}}),$=new W({props:{code:"Z3VpZGVyX3NwZWMlMjAlM0QlMjB0MmlfcGlwZWxpbmUuZ2V0X2NvbXBvbmVudF9zcGVjKCUyMmd1aWRlciUyMiklMEFndWlkZXJfc3BlYy5kZWZhdWx0X2NyZWF0aW9uX21ldGhvZCUzRCUyMmZyb21fcHJldHJhaW5lZCUyMiUwQWd1aWRlcl9zcGVjLnJlcG8lM0QlMjJZaVlpWHUlMkZtb2R1bGFyLWxvYWRlci10MmktZ3VpZGVyJTIyJTBBZ3VpZGVyX3NwZWMuc3ViZm9sZGVyJTNEJTIycGFnX2d1aWRlciUyMiUwQXBhZ19ndWlkZXIlMjAlM0QlMjBndWlkZXJfc3BlYy5sb2FkKCklMEF0MmlfcGlwZWxpbmUudXBkYXRlX2NvbXBvbmVudHMoZ3VpZGVyJTNEcGFnX2d1aWRlcik=",highlighted:`guider_spec = t2i_pipeline.get_component_spec(<span class="hljs-string">&quot;guider&quot;</span>)
guider_spec.default_creation_method=<span class="hljs-string">&quot;from_pretrained&quot;</span>
guider_spec.repo=<span class="hljs-string">&quot;YiYiXu/modular-loader-t2i-guider&quot;</span>
guider_spec.subfolder=<span class="hljs-string">&quot;pag_guider&quot;</span>
pag_guider = guider_spec.load()
t2i_pipeline.update_components(guider=pag_guider)`,wrap:!1}}),T=new W({props:{code:"dDJpX3BpcGVsaW5lLnB1c2hfdG9faHViKCUyMllpWWlYdSUyRm1vZHVsYXItZG9jLWd1aWRlciUyMik=",highlighted:'t2i_pipeline.push_to_hub(<span class="hljs-string">&quot;YiYiXu/modular-doc-guider&quot;</span>)',wrap:!1}}),{c(){n=Z("p"),n.innerHTML=d,t=u(),c=Z("blockquote"),l=Z("p"),l.innerHTML=i,J=u(),f(_.$$.fragment),V=u(),f($.$$.fragment),I=u(),k=Z("p"),k.innerHTML=C,G=u(),f(T.$$.fragment),this.h()},l(o){n=b(o,"P",{"data-svelte-h":!0}),U(n)!=="svelte-e2g9i8"&&(n.innerHTML=d),t=r(o),c=b(o,"BLOCKQUOTE",{class:!0});var g=ks(c);l=b(g,"P",{"data-svelte-h":!0}),U(l)!=="svelte-1xgh49p"&&(l.innerHTML=i),J=r(g),M(_.$$.fragment,g),g.forEach(a),V=r(o),M($.$$.fragment,o),I=r(o),k=b(o,"P",{"data-svelte-h":!0}),U(k)!=="svelte-15ac2ub"&&(k.innerHTML=C),G=r(o),M(T.$$.fragment,o),this.h()},h(){Cs(c,"class","tip")},m(o,g){p(o,n,g),p(o,t,g),p(o,c,g),ps(c,l),ps(c,J),m(_,c,null),p(o,V,g),m($,o,g),p(o,I,g),p(o,k,g),p(o,G,g),m(T,o,g),R=!0},p:Gs,i(o){R||(h(_.$$.fragment,o),h($.$$.fragment,o),h(T.$$.fragment,o),R=!0)},o(o){j(_.$$.fragment,o),j($.$$.fragment,o),j(T.$$.fragment,o),R=!1},d(o){o&&(a(n),a(t),a(c),a(V),a(I),a(k),a(G)),y(_),y($,o),y(T,o)}}}function le(w){let n,d,t,c;return n=new Vs({props:{id:"upload",option:"modular_model_index.json",$$slots:{default:[se]},$$scope:{ctx:w}}}),t=new Vs({props:{id:"upload",option:"update_components",$$slots:{default:[ee]},$$scope:{ctx:w}}}),{c(){f(n.$$.fragment),d=u(),f(t.$$.fragment)},l(l){M(n.$$.fragment,l),d=r(l),M(t.$$.fragment,l)},m(l,i){m(n,l,i),p(l,d,i),m(t,l,i),c=!0},p(l,i){const J={};i&2&&(J.$$scope={dirty:i,ctx:l}),n.$set(J);const _={};i&2&&(_.$$scope={dirty:i,ctx:l}),t.$set(_)},i(l){c||(h(n.$$.fragment,l),h(t.$$.fragment,l),c=!0)},o(l){j(n.$$.fragment,l),j(t.$$.fragment,l),c=!1},d(l){l&&a(d),y(n,l),y(t,l)}}}function ne(w){let n,d,t,c,l,i,J,_='<a href="https://huggingface.co/papers/2207.12598" rel="nofollow">Classifier-free guidance</a> steers model generation that better match a prompt and is commonly used to improve generation quality, control, and adherence to prompts. There are different types of guidance methods, and in Diffusers, they are known as <em>guiders</em>. Like blocks, it is easy to switch and use different guiders for different use cases without rewriting the pipeline.',V,$,I="This guide will show you how to switch guiders, adjust guider parameters, and load and share them to the Hub.",k,C,G,T,R='<a href="/docs/diffusers/main/en/api/modular_diffusers/guiders#diffusers.ClassifierFreeGuidance">ClassifierFreeGuidance</a> is the default guider and created when a pipeline is initialized with <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.ModularPipelineBlocks.init_pipeline">init_pipeline()</a>. It is created by <code>from_config</code> which means it doesn’t require loading specifications from a modular repository. A guider won’t be listed in <code>modular_model_index.json</code>.',o,g,xs='Use <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.get_component_spec">get_component_spec()</a> to inspect a guider.',is,v,us,N,Bs='Switch to a different guider by passing the new guider to <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.update_components">update_components()</a>.',rs,X,ns,Is="Changing guiders will return text letting you know you’re changing the guider type.",Xs,A,cs,Y,os,Q,Rs='Use <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.get_component_spec">get_component_spec()</a> again to verify the guider type is different.',ds,E,fs,q,Ms,F,vs="Guiders that are already saved on the Hub with a <code>modular_model_index.json</code> file are considered a <code>from_pretrained</code> component now instead of a <code>from_config</code> component.",ms,H,hs,z,Ns='The guider is only created after calling <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.load_components">load_components()</a> based on the loading specification in <code>modular_model_index.json</code>.',js,L,ys,S,gs,P,As='The guider parameters can be adjusted with either the <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_components#diffusers.ComponentSpec.create">create()</a> method or with <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.update_components">update_components()</a>. The example below changes the <code>guidance_scale</code> value.',Js,x,Zs,D,bs,K,Ys='Call the <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method on a custom guider to share it to the Hub.',_s,O,Us,ss,Qs='To make this guider available to the pipeline, either modify the <code>modular_model_index.json</code> file or use the <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline#diffusers.ModularPipeline.update_components">update_components()</a> method.',$s,B,Ts,es,ws,as,Ws;return l=new ts({props:{title:"Guiders",local:"guiders",headingTag:"h1"}}),C=new ts({props:{title:"Switching guiders",local:"switching-guiders",headingTag:"h2"}}),v=new W({props:{code:"dDJpX3BpcGVsaW5lLmdldF9jb21wb25lbnRfc3BlYyglMjJndWlkZXIlMjIpJTBBQ29tcG9uZW50U3BlYyhuYW1lJTNEJ2d1aWRlciclMkMlMjB0eXBlX2hpbnQlM0QlM0NjbGFzcyUyMCdkaWZmdXNlcnMuZ3VpZGVycy5jbGFzc2lmaWVyX2ZyZWVfZ3VpZGFuY2UuQ2xhc3NpZmllckZyZWVHdWlkYW5jZSclM0UlMkMlMjBkZXNjcmlwdGlvbiUzRE5vbmUlMkMlMjBjb25maWclM0RGcm96ZW5EaWN0KCU1QignZ3VpZGFuY2Vfc2NhbGUnJTJDJTIwNy41KSUyQyUyMCgnZ3VpZGFuY2VfcmVzY2FsZSclMkMlMjAwLjApJTJDJTIwKCd1c2Vfb3JpZ2luYWxfZm9ybXVsYXRpb24nJTJDJTIwRmFsc2UpJTJDJTIwKCdzdGFydCclMkMlMjAwLjApJTJDJTIwKCdzdG9wJyUyQyUyMDEuMCklMkMlMjAoJ191c2VfZGVmYXVsdF92YWx1ZXMnJTJDJTIwJTVCJ3N0YXJ0JyUyQyUyMCdndWlkYW5jZV9yZXNjYWxlJyUyQyUyMCdzdG9wJyUyQyUyMCd1c2Vfb3JpZ2luYWxfZm9ybXVsYXRpb24nJTVEKSU1RCklMkMlMjByZXBvJTNETm9uZSUyQyUyMHN1YmZvbGRlciUzRE5vbmUlMkMlMjB2YXJpYW50JTNETm9uZSUyQyUyMHJldmlzaW9uJTNETm9uZSUyQyUyMGRlZmF1bHRfY3JlYXRpb25fbWV0aG9kJTNEJ2Zyb21fY29uZmlnJyk=",highlighted:`t2i_pipeline.get_component_spec(<span class="hljs-string">&quot;guider&quot;</span>)
ComponentSpec(name=<span class="hljs-string">&#x27;guider&#x27;</span>, type_hint=&lt;<span class="hljs-keyword">class</span> <span class="hljs-string">&#x27;diffusers.guiders.classifier_free_guidance.ClassifierFreeGuidance&#x27;</span>&gt;, description=<span class="hljs-literal">None</span>, config=FrozenDict([(<span class="hljs-string">&#x27;guidance_scale&#x27;</span>, <span class="hljs-number">7.5</span>), (<span class="hljs-string">&#x27;guidance_rescale&#x27;</span>, <span class="hljs-number">0.0</span>), (<span class="hljs-string">&#x27;use_original_formulation&#x27;</span>, <span class="hljs-literal">False</span>), (<span class="hljs-string">&#x27;start&#x27;</span>, <span class="hljs-number">0.0</span>), (<span class="hljs-string">&#x27;stop&#x27;</span>, <span class="hljs-number">1.0</span>), (<span class="hljs-string">&#x27;_use_default_values&#x27;</span>, [<span class="hljs-string">&#x27;start&#x27;</span>, <span class="hljs-string">&#x27;guidance_rescale&#x27;</span>, <span class="hljs-string">&#x27;stop&#x27;</span>, <span class="hljs-string">&#x27;use_original_formulation&#x27;</span>])]), repo=<span class="hljs-literal">None</span>, subfolder=<span class="hljs-literal">None</span>, variant=<span class="hljs-literal">None</span>, revision=<span class="hljs-literal">None</span>, default_creation_method=<span class="hljs-string">&#x27;from_config&#x27;</span>)`,wrap:!1}}),A=new W({props:{code:"TW9kdWxhclBpcGVsaW5lLnVwZGF0ZV9jb21wb25lbnRzJTNBJTIwYWRkaW5nJTIwZ3VpZGVyJTIwd2l0aCUyMG5ldyUyMHR5cGUlM0ElMjBQZXJ0dXJiZWRBdHRlbnRpb25HdWlkYW5jZSUyQyUyMHByZXZpb3VzJTIwdHlwZSUzQSUyMENsYXNzaWZpZXJGcmVlR3VpZGFuY2U=",highlighted:'ModularPipeline.update_components: adding guider with new <span class="hljs-built_in">type</span>: PerturbedAttentionGuidance, previous <span class="hljs-built_in">type</span>: ClassifierFreeGuidance',wrap:!1}}),Y=new W({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMExheWVyU2tpcENvbmZpZyUyQyUyMFBlcnR1cmJlZEF0dGVudGlvbkd1aWRhbmNlJTBBJTBBY29uZmlnJTIwJTNEJTIwTGF5ZXJTa2lwQ29uZmlnKGluZGljZXMlM0QlNUIyJTJDJTIwOSU1RCUyQyUyMGZxbiUzRCUyMm1pZF9ibG9jay5hdHRlbnRpb25zLjAudHJhbnNmb3JtZXJfYmxvY2tzJTIyJTJDJTIwc2tpcF9hdHRlbnRpb24lM0RGYWxzZSUyQyUyMHNraXBfYXR0ZW50aW9uX3Njb3JlcyUzRFRydWUlMkMlMjBza2lwX2ZmJTNERmFsc2UpJTBBZ3VpZGVyJTIwJTNEJTIwUGVydHVyYmVkQXR0ZW50aW9uR3VpZGFuY2UoJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q1LjAlMkMlMjBwZXJ0dXJiZWRfZ3VpZGFuY2Vfc2NhbGUlM0QyLjUlMkMlMjBwZXJ0dXJiZWRfZ3VpZGFuY2VfY29uZmlnJTNEY29uZmlnJTBBKSUwQXQyaV9waXBlbGluZS51cGRhdGVfY29tcG9uZW50cyhndWlkZXIlM0RndWlkZXIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LayerSkipConfig, PerturbedAttentionGuidance

config = LayerSkipConfig(indices=[<span class="hljs-number">2</span>, <span class="hljs-number">9</span>], fqn=<span class="hljs-string">&quot;mid_block.attentions.0.transformer_blocks&quot;</span>, skip_attention=<span class="hljs-literal">False</span>, skip_attention_scores=<span class="hljs-literal">True</span>, skip_ff=<span class="hljs-literal">False</span>)
guider = PerturbedAttentionGuidance(
    guidance_scale=<span class="hljs-number">5.0</span>, perturbed_guidance_scale=<span class="hljs-number">2.5</span>, perturbed_guidance_config=config
)
t2i_pipeline.update_components(guider=guider)`,wrap:!1}}),E=new W({props:{code:"dDJpX3BpcGVsaW5lLmdldF9jb21wb25lbnRfc3BlYyglMjJndWlkZXIlMjIpJTBBQ29tcG9uZW50U3BlYyhuYW1lJTNEJ2d1aWRlciclMkMlMjB0eXBlX2hpbnQlM0QlM0NjbGFzcyUyMCdkaWZmdXNlcnMuZ3VpZGVycy5wZXJ0dXJiZWRfYXR0ZW50aW9uX2d1aWRhbmNlLlBlcnR1cmJlZEF0dGVudGlvbkd1aWRhbmNlJyUzRSUyQyUyMGRlc2NyaXB0aW9uJTNETm9uZSUyQyUyMGNvbmZpZyUzREZyb3plbkRpY3QoJTVCKCdndWlkYW5jZV9zY2FsZSclMkMlMjA1LjApJTJDJTIwKCdwZXJ0dXJiZWRfZ3VpZGFuY2Vfc2NhbGUnJTJDJTIwMi41KSUyQyUyMCgncGVydHVyYmVkX2d1aWRhbmNlX3N0YXJ0JyUyQyUyMDAuMDEpJTJDJTIwKCdwZXJ0dXJiZWRfZ3VpZGFuY2Vfc3RvcCclMkMlMjAwLjIpJTJDJTIwKCdwZXJ0dXJiZWRfZ3VpZGFuY2VfbGF5ZXJzJyUyQyUyME5vbmUpJTJDJTIwKCdwZXJ0dXJiZWRfZ3VpZGFuY2VfY29uZmlnJyUyQyUyMExheWVyU2tpcENvbmZpZyhpbmRpY2VzJTNEJTVCMiUyQyUyMDklNUQlMkMlMjBmcW4lM0QnbWlkX2Jsb2NrLmF0dGVudGlvbnMuMC50cmFuc2Zvcm1lcl9ibG9ja3MnJTJDJTIwc2tpcF9hdHRlbnRpb24lM0RGYWxzZSUyQyUyMHNraXBfYXR0ZW50aW9uX3Njb3JlcyUzRFRydWUlMkMlMjBza2lwX2ZmJTNERmFsc2UlMkMlMjBkcm9wb3V0JTNEMS4wKSklMkMlMjAoJ2d1aWRhbmNlX3Jlc2NhbGUnJTJDJTIwMC4wKSUyQyUyMCgndXNlX29yaWdpbmFsX2Zvcm11bGF0aW9uJyUyQyUyMEZhbHNlKSUyQyUyMCgnc3RhcnQnJTJDJTIwMC4wKSUyQyUyMCgnc3RvcCclMkMlMjAxLjApJTJDJTIwKCdfdXNlX2RlZmF1bHRfdmFsdWVzJyUyQyUyMCU1QidwZXJ0dXJiZWRfZ3VpZGFuY2Vfc3RhcnQnJTJDJTIwJ3VzZV9vcmlnaW5hbF9mb3JtdWxhdGlvbiclMkMlMjAncGVydHVyYmVkX2d1aWRhbmNlX2xheWVycyclMkMlMjAnc3RvcCclMkMlMjAnc3RhcnQnJTJDJTIwJ2d1aWRhbmNlX3Jlc2NhbGUnJTJDJTIwJ3BlcnR1cmJlZF9ndWlkYW5jZV9zdG9wJyU1RCklMkMlMjAoJ19jbGFzc19uYW1lJyUyQyUyMCdQZXJ0dXJiZWRBdHRlbnRpb25HdWlkYW5jZScpJTJDJTIwKCdfZGlmZnVzZXJzX3ZlcnNpb24nJTJDJTIwJzAuMzUuMC5kZXYwJyklNUQpJTJDJTIwcmVwbyUzRE5vbmUlMkMlMjBzdWJmb2xkZXIlM0ROb25lJTJDJTIwdmFyaWFudCUzRE5vbmUlMkMlMjByZXZpc2lvbiUzRE5vbmUlMkMlMjBkZWZhdWx0X2NyZWF0aW9uX21ldGhvZCUzRCdmcm9tX2NvbmZpZycp",highlighted:`t2i_pipeline.get_component_spec(<span class="hljs-string">&quot;guider&quot;</span>)
ComponentSpec(name=<span class="hljs-string">&#x27;guider&#x27;</span>, type_hint=&lt;<span class="hljs-keyword">class</span> <span class="hljs-string">&#x27;diffusers.guiders.perturbed_attention_guidance.PerturbedAttentionGuidance&#x27;</span>&gt;, description=<span class="hljs-literal">None</span>, config=FrozenDict([(<span class="hljs-string">&#x27;guidance_scale&#x27;</span>, <span class="hljs-number">5.0</span>), (<span class="hljs-string">&#x27;perturbed_guidance_scale&#x27;</span>, <span class="hljs-number">2.5</span>), (<span class="hljs-string">&#x27;perturbed_guidance_start&#x27;</span>, <span class="hljs-number">0.01</span>), (<span class="hljs-string">&#x27;perturbed_guidance_stop&#x27;</span>, <span class="hljs-number">0.2</span>), (<span class="hljs-string">&#x27;perturbed_guidance_layers&#x27;</span>, <span class="hljs-literal">None</span>), (<span class="hljs-string">&#x27;perturbed_guidance_config&#x27;</span>, LayerSkipConfig(indices=[<span class="hljs-number">2</span>, <span class="hljs-number">9</span>], fqn=<span class="hljs-string">&#x27;mid_block.attentions.0.transformer_blocks&#x27;</span>, skip_attention=<span class="hljs-literal">False</span>, skip_attention_scores=<span class="hljs-literal">True</span>, skip_ff=<span class="hljs-literal">False</span>, dropout=<span class="hljs-number">1.0</span>)), (<span class="hljs-string">&#x27;guidance_rescale&#x27;</span>, <span class="hljs-number">0.0</span>), (<span class="hljs-string">&#x27;use_original_formulation&#x27;</span>, <span class="hljs-literal">False</span>), (<span class="hljs-string">&#x27;start&#x27;</span>, <span class="hljs-number">0.0</span>), (<span class="hljs-string">&#x27;stop&#x27;</span>, <span class="hljs-number">1.0</span>), (<span class="hljs-string">&#x27;_use_default_values&#x27;</span>, [<span class="hljs-string">&#x27;perturbed_guidance_start&#x27;</span>, <span class="hljs-string">&#x27;use_original_formulation&#x27;</span>, <span class="hljs-string">&#x27;perturbed_guidance_layers&#x27;</span>, <span class="hljs-string">&#x27;stop&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>, <span class="hljs-string">&#x27;guidance_rescale&#x27;</span>, <span class="hljs-string">&#x27;perturbed_guidance_stop&#x27;</span>]), (<span class="hljs-string">&#x27;_class_name&#x27;</span>, <span class="hljs-string">&#x27;PerturbedAttentionGuidance&#x27;</span>), (<span class="hljs-string">&#x27;_diffusers_version&#x27;</span>, <span class="hljs-string">&#x27;0.35.0.dev0&#x27;</span>)]), repo=<span class="hljs-literal">None</span>, subfolder=<span class="hljs-literal">None</span>, variant=<span class="hljs-literal">None</span>, revision=<span class="hljs-literal">None</span>, default_creation_method=<span class="hljs-string">&#x27;from_config&#x27;</span>)`,wrap:!1}}),q=new ts({props:{title:"Loading custom guiders",local:"loading-custom-guiders",headingTag:"h2"}}),H=new W({props:{code:"JTdCJTBBJTIwJTIwJTIyZ3VpZGVyJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwbnVsbCUyQyUwQSUyMCUyMCUyMCUyMG51bGwlMkMlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJyZXBvJTIyJTNBJTIwJTIyWWlZaVh1JTJGbW9kdWxhci1sb2FkZXItdDJpLWd1aWRlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnJldmlzaW9uJTIyJTNBJTIwbnVsbCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnN1YmZvbGRlciUyMiUzQSUyMCUyMnBhZ19ndWlkZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJ0eXBlX2hpbnQlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJkaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJQZXJ0dXJiZWRBdHRlbnRpb25HdWlkYW5jZSUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnZhcmlhbnQlMjIlM0ElMjBudWxsJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTVEJTBBJTdE",highlighted:`<span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;guider&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
    <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
    <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">&quot;repo&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;YiYiXu/modular-loader-t2i-guider&quot;</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;revision&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;subfolder&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;pag_guider&quot;</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;type_hint&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
        <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
        <span class="hljs-string">&quot;PerturbedAttentionGuidance&quot;</span>
      <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
      <span class="hljs-attr">&quot;variant&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">null</span></span>
    <span class="hljs-punctuation">}</span>
  <span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),L=new W({props:{code:"dDJpX3BpcGVsaW5lJTIwJTNEJTIwdDJpX2Jsb2Nrcy5pbml0X3BpcGVsaW5lKCUyMllpWWlYdSUyRm1vZHVsYXItZG9jLWd1aWRlciUyMiklMEElMjMlMjBub3QlMjBjcmVhdGVkJTIwZHVyaW5nJTIwaW5pdCUwQWFzc2VydCUyMHQyaV9waXBlbGluZS5ndWlkZXIlMjBpcyUyME5vbmUlMEF0MmlfcGlwZWxpbmUubG9hZF9jb21wb25lbnRzKCklMEElMjMlMjBsb2FkZWQlMjBhcyUyMFBBRyUyMGd1aWRlciUwQXQyaV9waXBlbGluZS5ndWlkZXI=",highlighted:`t2i_pipeline = t2i_blocks.init_pipeline(<span class="hljs-string">&quot;YiYiXu/modular-doc-guider&quot;</span>)
<span class="hljs-comment"># not created during init</span>
<span class="hljs-keyword">assert</span> t2i_pipeline.guider <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span>
t2i_pipeline.load_components()
<span class="hljs-comment"># loaded as PAG guider</span>
t2i_pipeline.guider`,wrap:!1}}),S=new ts({props:{title:"Changing guider parameters",local:"changing-guider-parameters",headingTag:"h2"}}),x=new qs({props:{id:"switch",options:["create","update_components"],$$slots:{default:[Os]},$$scope:{ctx:w}}}),D=new ts({props:{title:"Uploading custom guiders",local:"uploading-custom-guiders",headingTag:"h2"}}),O=new W({props:{code:"Z3VpZGVyLnB1c2hfdG9faHViKCUyMllpWWlYdSUyRm1vZHVsYXItbG9hZGVyLXQyaS1ndWlkZXIlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJwYWdfZ3VpZGVyJTIyKQ==",highlighted:'guider.push_to_hub(<span class="hljs-string">&quot;YiYiXu/modular-loader-t2i-guider&quot;</span>, subfolder=<span class="hljs-string">&quot;pag_guider&quot;</span>)',wrap:!1}}),B=new qs({props:{id:"upload",options:["modular_model_index.json","update_components"],$$slots:{default:[le]},$$scope:{ctx:w}}}),es=new Ps({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/modular_diffusers/guiders.md"}}),{c(){n=Z("meta"),d=u(),t=Z("p"),c=u(),f(l.$$.fragment),i=u(),J=Z("p"),J.innerHTML=_,V=u(),$=Z("p"),$.textContent=I,k=u(),f(C.$$.fragment),G=u(),T=Z("p"),T.innerHTML=R,o=u(),g=Z("p"),g.innerHTML=xs,is=u(),f(v.$$.fragment),us=u(),N=Z("p"),N.innerHTML=Bs,rs=u(),X=Z("blockquote"),ns=Z("p"),ns.textContent=Is,Xs=u(),f(A.$$.fragment),cs=u(),f(Y.$$.fragment),os=u(),Q=Z("p"),Q.innerHTML=Rs,ds=u(),f(E.$$.fragment),fs=u(),f(q.$$.fragment),Ms=u(),F=Z("p"),F.innerHTML=vs,ms=u(),f(H.$$.fragment),hs=u(),z=Z("p"),z.innerHTML=Ns,js=u(),f(L.$$.fragment),ys=u(),f(S.$$.fragment),gs=u(),P=Z("p"),P.innerHTML=As,Js=u(),f(x.$$.fragment),Zs=u(),f(D.$$.fragment),bs=u(),K=Z("p"),K.innerHTML=Ys,_s=u(),f(O.$$.fragment),Us=u(),ss=Z("p"),ss.innerHTML=Qs,$s=u(),f(B.$$.fragment),Ts=u(),f(es.$$.fragment),ws=u(),as=Z("p"),this.h()},l(s){const e=Ss("svelte-u9bgzb",document.head);n=b(e,"META",{name:!0,content:!0}),e.forEach(a),d=r(s),t=b(s,"P",{}),ks(t).forEach(a),c=r(s),M(l.$$.fragment,s),i=r(s),J=b(s,"P",{"data-svelte-h":!0}),U(J)!=="svelte-eyka96"&&(J.innerHTML=_),V=r(s),$=b(s,"P",{"data-svelte-h":!0}),U($)!=="svelte-1ir8as7"&&($.textContent=I),k=r(s),M(C.$$.fragment,s),G=r(s),T=b(s,"P",{"data-svelte-h":!0}),U(T)!=="svelte-okj828"&&(T.innerHTML=R),o=r(s),g=b(s,"P",{"data-svelte-h":!0}),U(g)!=="svelte-26f64c"&&(g.innerHTML=xs),is=r(s),M(v.$$.fragment,s),us=r(s),N=b(s,"P",{"data-svelte-h":!0}),U(N)!=="svelte-14ovw6"&&(N.innerHTML=Bs),rs=r(s),X=b(s,"BLOCKQUOTE",{class:!0});var ls=ks(X);ns=b(ls,"P",{"data-svelte-h":!0}),U(ns)!=="svelte-1lubf19"&&(ns.textContent=Is),Xs=r(ls),M(A.$$.fragment,ls),ls.forEach(a),cs=r(s),M(Y.$$.fragment,s),os=r(s),Q=b(s,"P",{"data-svelte-h":!0}),U(Q)!=="svelte-1dzarv8"&&(Q.innerHTML=Rs),ds=r(s),M(E.$$.fragment,s),fs=r(s),M(q.$$.fragment,s),Ms=r(s),F=b(s,"P",{"data-svelte-h":!0}),U(F)!=="svelte-xt8m5q"&&(F.innerHTML=vs),ms=r(s),M(H.$$.fragment,s),hs=r(s),z=b(s,"P",{"data-svelte-h":!0}),U(z)!=="svelte-l163td"&&(z.innerHTML=Ns),js=r(s),M(L.$$.fragment,s),ys=r(s),M(S.$$.fragment,s),gs=r(s),P=b(s,"P",{"data-svelte-h":!0}),U(P)!=="svelte-1rlpllq"&&(P.innerHTML=As),Js=r(s),M(x.$$.fragment,s),Zs=r(s),M(D.$$.fragment,s),bs=r(s),K=b(s,"P",{"data-svelte-h":!0}),U(K)!=="svelte-mtv9uz"&&(K.innerHTML=Ys),_s=r(s),M(O.$$.fragment,s),Us=r(s),ss=b(s,"P",{"data-svelte-h":!0}),U(ss)!=="svelte-1qqg4b1"&&(ss.innerHTML=Qs),$s=r(s),M(B.$$.fragment,s),Ts=r(s),M(es.$$.fragment,s),ws=r(s),as=b(s,"P",{}),ks(as).forEach(a),this.h()},h(){Cs(n,"name","hf:doc:metadata"),Cs(n,"content",ae),Cs(X,"class","tip")},m(s,e){ps(document.head,n),p(s,d,e),p(s,t,e),p(s,c,e),m(l,s,e),p(s,i,e),p(s,J,e),p(s,V,e),p(s,$,e),p(s,k,e),m(C,s,e),p(s,G,e),p(s,T,e),p(s,o,e),p(s,g,e),p(s,is,e),m(v,s,e),p(s,us,e),p(s,N,e),p(s,rs,e),p(s,X,e),ps(X,ns),ps(X,Xs),m(A,X,null),p(s,cs,e),m(Y,s,e),p(s,os,e),p(s,Q,e),p(s,ds,e),m(E,s,e),p(s,fs,e),m(q,s,e),p(s,Ms,e),p(s,F,e),p(s,ms,e),m(H,s,e),p(s,hs,e),p(s,z,e),p(s,js,e),m(L,s,e),p(s,ys,e),m(S,s,e),p(s,gs,e),p(s,P,e),p(s,Js,e),m(x,s,e),p(s,Zs,e),m(D,s,e),p(s,bs,e),p(s,K,e),p(s,_s,e),m(O,s,e),p(s,Us,e),p(s,ss,e),p(s,$s,e),m(B,s,e),p(s,Ts,e),m(es,s,e),p(s,ws,e),p(s,as,e),Ws=!0},p(s,[e]){const ls={};e&2&&(ls.$$scope={dirty:e,ctx:s}),x.$set(ls);const Es={};e&2&&(Es.$$scope={dirty:e,ctx:s}),B.$set(Es)},i(s){Ws||(h(l.$$.fragment,s),h(C.$$.fragment,s),h(v.$$.fragment,s),h(A.$$.fragment,s),h(Y.$$.fragment,s),h(E.$$.fragment,s),h(q.$$.fragment,s),h(H.$$.fragment,s),h(L.$$.fragment,s),h(S.$$.fragment,s),h(x.$$.fragment,s),h(D.$$.fragment,s),h(O.$$.fragment,s),h(B.$$.fragment,s),h(es.$$.fragment,s),Ws=!0)},o(s){j(l.$$.fragment,s),j(C.$$.fragment,s),j(v.$$.fragment,s),j(A.$$.fragment,s),j(Y.$$.fragment,s),j(E.$$.fragment,s),j(q.$$.fragment,s),j(H.$$.fragment,s),j(L.$$.fragment,s),j(S.$$.fragment,s),j(x.$$.fragment,s),j(D.$$.fragment,s),j(O.$$.fragment,s),j(B.$$.fragment,s),j(es.$$.fragment,s),Ws=!1},d(s){s&&(a(d),a(t),a(c),a(i),a(J),a(V),a($),a(k),a(G),a(T),a(o),a(g),a(is),a(us),a(N),a(rs),a(X),a(cs),a(os),a(Q),a(ds),a(fs),a(Ms),a(F),a(ms),a(hs),a(z),a(js),a(ys),a(gs),a(P),a(Js),a(Zs),a(bs),a(K),a(_s),a(Us),a(ss),a($s),a(Ts),a(ws),a(as)),a(n),y(l,s),y(C,s),y(v,s),y(A),y(Y,s),y(E,s),y(q,s),y(H,s),y(L,s),y(S,s),y(x,s),y(D,s),y(O,s),y(B,s),y(es,s)}}}const ae='{"title":"Guiders","local":"guiders","sections":[{"title":"Switching guiders","local":"switching-guiders","sections":[],"depth":2},{"title":"Loading custom guiders","local":"loading-custom-guiders","sections":[],"depth":2},{"title":"Changing guider parameters","local":"changing-guider-parameters","sections":[],"depth":2},{"title":"Uploading custom guiders","local":"uploading-custom-guiders","sections":[],"depth":2}],"depth":1}';function te(w){return Hs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class oe extends zs{constructor(n){super(),Ls(this,n,te,ne,Fs,{})}}export{oe as component};
