import{s as te,o as re,n as se}from"../chunks/scheduler.8c3d61f6.js";import{S as ae,i as oe,g as l,s as o,r as M,A as ne,h as m,f as r,c as n,j as G,u as S,x as E,k as B,y as x,a,v as y,d as P,t as C,w as H}from"../chunks/index.da70eac4.js";import{T as ie}from"../chunks/Tip.1d9b8c37.js";import{D as Z}from"../chunks/Docstring.c021b19a.js";import{H as ee,E as de}from"../chunks/getInferenceSnippets.725ed3d4.js";function le(I){let s,u='To learn more about how to load LoRA weights, see the <a href="../../using-diffusers/loading_adapters#lora">LoRA</a> loading guide.';return{c(){s=l("p"),s.innerHTML=u},l(i){s=m(i,"P",{"data-svelte-h":!0}),E(s)!=="svelte-1fw6lx1"&&(s.innerHTML=u)},m(i,L){a(i,s,L)},p:se,d(i){i&&r(s)}}}function me(I){let s,u,i,L,g,z,h,Q='This class is useful when <em>only</em> loading weights into a <a href="/docs/diffusers/main/en/api/models/sd3_transformer2d#diffusers.SD3Transformer2DModel">SD3Transformer2DModel</a>. If you need to load weights into the text encoder or a text encoder and SD3Transformer2DModel, check <a href="lora#diffusers.loaders.SD3LoraLoaderMixin"><code>SD3LoraLoaderMixin</code></a> class instead.',R,_,W="The <code>SD3Transformer2DLoadersMixin</code> class currently only loads IP-Adapter weights, but will be used in the future to save weights and load LoRAs.",j,p,k,$,q,d,D,J,v,X="Load IP-Adapters and LoRA layers into a <code>[SD3Transformer2DModel]</code>.",K,c,T,N,b,Y="Sets IP-Adapter attention processors, image projection, and loads state_dict.",O,w,U,A,V;return g=new ee({props:{title:"SD3Transformer2D",local:"sd3transformer2d",headingTag:"h1"}}),p=new ie({props:{$$slots:{default:[le]},$$scope:{ctx:I}}}),$=new ee({props:{title:"SD3Transformer2DLoadersMixin",local:"diffusers.loaders.SD3Transformer2DLoadersMixin",headingTag:"h2"}}),D=new Z({props:{name:"class diffusers.loaders.SD3Transformer2DLoadersMixin",anchor:"diffusers.loaders.SD3Transformer2DLoadersMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/transformer_sd3.py#L27"}}),T=new Z({props:{name:"_load_ip_adapter_weights",anchor:"diffusers.loaders.SD3Transformer2DLoadersMixin._load_ip_adapter_weights",parameters:[{name:"state_dict",val:": typing.Dict"},{name:"low_cpu_mem_usage",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.loaders.SD3Transformer2DLoadersMixin._load_ip_adapter_weights.state_dict",description:`<strong>state_dict</strong> (<code>Dict</code>) &#x2014;
State dict with keys &#x201C;ip_adapter&#x201D;, which contains parameters for attention processors, and
&#x201C;image_proj&#x201D;, which contains parameters for image projection net.`,name:"state_dict"},{anchor:"diffusers.loaders.SD3Transformer2DLoadersMixin._load_ip_adapter_weights.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/transformer_sd3.py#L157"}}),w=new de({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/loaders/transformer_sd3.md"}}),{c(){s=l("meta"),u=o(),i=l("p"),L=o(),M(g.$$.fragment),z=o(),h=l("p"),h.innerHTML=Q,R=o(),_=l("p"),_.innerHTML=W,j=o(),M(p.$$.fragment),k=o(),M($.$$.fragment),q=o(),d=l("div"),M(D.$$.fragment),J=o(),v=l("p"),v.innerHTML=X,K=o(),c=l("div"),M(T.$$.fragment),N=o(),b=l("p"),b.textContent=Y,O=o(),M(w.$$.fragment),U=o(),A=l("p"),this.h()},l(e){const t=ne("svelte-u9bgzb",document.head);s=m(t,"META",{name:!0,content:!0}),t.forEach(r),u=n(e),i=m(e,"P",{}),G(i).forEach(r),L=n(e),S(g.$$.fragment,e),z=n(e),h=m(e,"P",{"data-svelte-h":!0}),E(h)!=="svelte-1hqy5vz"&&(h.innerHTML=Q),R=n(e),_=m(e,"P",{"data-svelte-h":!0}),E(_)!=="svelte-b199o"&&(_.innerHTML=W),j=n(e),S(p.$$.fragment,e),k=n(e),S($.$$.fragment,e),q=n(e),d=m(e,"DIV",{class:!0});var f=G(d);S(D.$$.fragment,f),J=n(f),v=m(f,"P",{"data-svelte-h":!0}),E(v)!=="svelte-v7p57z"&&(v.innerHTML=X),K=n(f),c=m(f,"DIV",{class:!0});var F=G(c);S(T.$$.fragment,F),N=n(F),b=m(F,"P",{"data-svelte-h":!0}),E(b)!=="svelte-ym8e73"&&(b.textContent=Y),F.forEach(r),f.forEach(r),O=n(e),S(w.$$.fragment,e),U=n(e),A=m(e,"P",{}),G(A).forEach(r),this.h()},h(){B(s,"name","hf:doc:metadata"),B(s,"content",fe),B(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){x(document.head,s),a(e,u,t),a(e,i,t),a(e,L,t),y(g,e,t),a(e,z,t),a(e,h,t),a(e,R,t),a(e,_,t),a(e,j,t),y(p,e,t),a(e,k,t),y($,e,t),a(e,q,t),a(e,d,t),y(D,d,null),x(d,J),x(d,v),x(d,K),x(d,c),y(T,c,null),x(c,N),x(c,b),a(e,O,t),y(w,e,t),a(e,U,t),a(e,A,t),V=!0},p(e,[t]){const f={};t&2&&(f.$$scope={dirty:t,ctx:e}),p.$set(f)},i(e){V||(P(g.$$.fragment,e),P(p.$$.fragment,e),P($.$$.fragment,e),P(D.$$.fragment,e),P(T.$$.fragment,e),P(w.$$.fragment,e),V=!0)},o(e){C(g.$$.fragment,e),C(p.$$.fragment,e),C($.$$.fragment,e),C(D.$$.fragment,e),C(T.$$.fragment,e),C(w.$$.fragment,e),V=!1},d(e){e&&(r(u),r(i),r(L),r(z),r(h),r(R),r(_),r(j),r(k),r(q),r(d),r(O),r(U),r(A)),r(s),H(g,e),H(p,e),H($,e),H(D),H(T),H(w,e)}}}const fe='{"title":"SD3Transformer2D","local":"sd3transformer2d","sections":[{"title":"SD3Transformer2DLoadersMixin","local":"diffusers.loaders.SD3Transformer2DLoadersMixin","sections":[],"depth":2}],"depth":1}';function pe(I){return re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $e extends ae{constructor(s){super(),oe(this,s,pe,me,te,{})}}export{$e as component};
