import{s as de,n as fe,o as pe}from"../chunks/scheduler.53228c21.js";import{S as ue,i as ce,e as c,s as r,c as m,h as ge,a as g,d as a,b as s,f as P,g as i,j as B,k as A,l as te,m as n,n as o,t as l,o as d,p as f}from"../chunks/index.100fac89.js";import{C as he}from"../chunks/CopyLLMTxtMenu.999d3d86.js";import{D as oe}from"../chunks/Docstring.46d0934e.js";import{C as le}from"../chunks/CodeBlock.d30a6509.js";import{H as K,E as $e}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d27ae4df.js";function Me(ae){let p,W,G,x,h,C,$,k,M,ne='A Transformer model for image-like data from <a href="https://huggingface.co/HiDream-ai" rel="nofollow">HiDream-I1</a>.',F,y,re="The model can be loaded with the following code snippet.",L,b,j,_,V,T,se="GGUF checkpoints for the <code>HiDreamImageTransformer2DModel</code> can  be loaded using <code>~FromOriginalModelMixin.from_single_file</code>",z,v,E,D,N,H,J,Y,U,Q,u,w,ee,Z,me='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',S,R,q,I,O;return h=new he({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new K({props:{title:"HiDreamImageTransformer2DModel",local:"hidreamimagetransformer2dmodel",headingTag:"h1"}}),b=new le({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEhpRHJlYW1JbWFnZVRyYW5zZm9ybWVyMkRNb2RlbCUwQSUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwSGlEcmVhbUltYWdlVHJhbnNmb3JtZXIyRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJIaURyZWFtLWFpJTJGSGlEcmVhbS1JMS1GdWxsJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydHJhbnNmb3JtZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HiDreamImageTransformer2DModel

transformer = HiDreamImageTransformer2DModel.from_pretrained(<span class="hljs-string">&quot;HiDream-ai/HiDream-I1-Full&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)`,wrap:!1}}),_=new K({props:{title:"Loading GGUF quantized checkpoints for HiDream-I1",local:"loading-gguf-quantized-checkpoints-for-hidream-i1",headingTag:"h2"}}),v=new le({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwR0dVRlF1YW50aXphdGlvbkNvbmZpZyUyQyUyMEhpRHJlYW1JbWFnZVRyYW5zZm9ybWVyMkRNb2RlbCUwQSUwQWNrcHRfcGF0aCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZjaXR5OTYlMkZIaURyZWFtLUkxLURldi1nZ3VmJTJGYmxvYiUyRm1haW4lMkZoaWRyZWFtLWkxLWRldi1RMl9LLmdndWYlMjIlMEF0cmFuc2Zvcm1lciUyMCUzRCUyMEhpRHJlYW1JbWFnZVRyYW5zZm9ybWVyMkRNb2RlbC5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMGNrcHRfcGF0aCUyQyUwQSUyMCUyMCUyMCUyMHF1YW50aXphdGlvbl9jb25maWclM0RHR1VGUXVhbnRpemF0aW9uQ29uZmlnKGNvbXB1dGVfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> GGUFQuantizationConfig, HiDreamImageTransformer2DModel

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/city96/HiDream-I1-Dev-gguf/blob/main/hidream-i1-dev-Q2_K.gguf&quot;</span>
transformer = HiDreamImageTransformer2DModel.from_single_file(
    ckpt_path,
    quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
    torch_dtype=torch.bfloat16
)`,wrap:!1}}),D=new K({props:{title:"HiDreamImageTransformer2DModel",local:"diffusers.HiDreamImageTransformer2DModel",headingTag:"h2"}}),J=new oe({props:{name:"class diffusers.HiDreamImageTransformer2DModel",anchor:"diffusers.HiDreamImageTransformer2DModel",parameters:[{name:"patch_size",val:": typing.Optional[int] = None"},{name:"in_channels",val:": int = 64"},{name:"out_channels",val:": typing.Optional[int] = None"},{name:"num_layers",val:": int = 16"},{name:"num_single_layers",val:": int = 32"},{name:"attention_head_dim",val:": int = 128"},{name:"num_attention_heads",val:": int = 20"},{name:"caption_channels",val:": typing.List[int] = None"},{name:"text_emb_dim",val:": int = 2048"},{name:"num_routed_experts",val:": int = 4"},{name:"num_activated_experts",val:": int = 2"},{name:"axes_dims_rope",val:": typing.Tuple[int, int] = (32, 32)"},{name:"max_resolution",val:": typing.Tuple[int, int] = (128, 128)"},{name:"llama_layers",val:": typing.List[int] = None"},{name:"force_inference_output",val:": bool = False"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_hidream_image.py#L605"}}),U=new K({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),w=new oe({props:{name:"class diffusers.models.modeling_outputs.Transformer2DModelOutput",anchor:"diffusers.models.modeling_outputs.Transformer2DModelOutput",parameters:[{name:"sample",val:": torch.Tensor"}],parametersDescription:[{anchor:"diffusers.models.modeling_outputs.Transformer2DModelOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> or <code>(batch size, num_vector_embeds - 1, num_latent_pixels)</code> if <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a> is discrete) &#x2014;
The hidden states output conditioned on the <code>encoder_hidden_states</code> input. If discrete, returns probability
distributions for the unnoised latent pixels.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_outputs.py#L21"}}),R=new $e({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/hidream_image_transformer.md"}}),{c(){p=c("meta"),W=r(),G=c("p"),x=r(),m(h.$$.fragment),C=r(),m($.$$.fragment),k=r(),M=c("p"),M.innerHTML=ne,F=r(),y=c("p"),y.textContent=re,L=r(),m(b.$$.fragment),j=r(),m(_.$$.fragment),V=r(),T=c("p"),T.innerHTML=se,z=r(),m(v.$$.fragment),E=r(),m(D.$$.fragment),N=r(),H=c("div"),m(J.$$.fragment),Y=r(),m(U.$$.fragment),Q=r(),u=c("div"),m(w.$$.fragment),ee=r(),Z=c("p"),Z.innerHTML=me,S=r(),m(R.$$.fragment),q=r(),I=c("p"),this.h()},l(e){const t=ge("svelte-u9bgzb",document.head);p=g(t,"META",{name:!0,content:!0}),t.forEach(a),W=s(e),G=g(e,"P",{}),P(G).forEach(a),x=s(e),i(h.$$.fragment,e),C=s(e),i($.$$.fragment,e),k=s(e),M=g(e,"P",{"data-svelte-h":!0}),B(M)!=="svelte-ta0ebe"&&(M.innerHTML=ne),F=s(e),y=g(e,"P",{"data-svelte-h":!0}),B(y)!=="svelte-1vuni30"&&(y.textContent=re),L=s(e),i(b.$$.fragment,e),j=s(e),i(_.$$.fragment,e),V=s(e),T=g(e,"P",{"data-svelte-h":!0}),B(T)!=="svelte-p22jvc"&&(T.innerHTML=se),z=s(e),i(v.$$.fragment,e),E=s(e),i(D.$$.fragment,e),N=s(e),H=g(e,"DIV",{class:!0});var ie=P(H);i(J.$$.fragment,ie),ie.forEach(a),Y=s(e),i(U.$$.fragment,e),Q=s(e),u=g(e,"DIV",{class:!0});var X=P(u);i(w.$$.fragment,X),ee=s(X),Z=g(X,"P",{"data-svelte-h":!0}),B(Z)!=="svelte-1x8c0js"&&(Z.innerHTML=me),X.forEach(a),S=s(e),i(R.$$.fragment,e),q=s(e),I=g(e,"P",{}),P(I).forEach(a),this.h()},h(){A(p,"name","hf:doc:metadata"),A(p,"content",ye),A(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(u,"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){te(document.head,p),n(e,W,t),n(e,G,t),n(e,x,t),o(h,e,t),n(e,C,t),o($,e,t),n(e,k,t),n(e,M,t),n(e,F,t),n(e,y,t),n(e,L,t),o(b,e,t),n(e,j,t),o(_,e,t),n(e,V,t),n(e,T,t),n(e,z,t),o(v,e,t),n(e,E,t),o(D,e,t),n(e,N,t),n(e,H,t),o(J,H,null),n(e,Y,t),o(U,e,t),n(e,Q,t),n(e,u,t),o(w,u,null),te(u,ee),te(u,Z),n(e,S,t),o(R,e,t),n(e,q,t),n(e,I,t),O=!0},p:fe,i(e){O||(l(h.$$.fragment,e),l($.$$.fragment,e),l(b.$$.fragment,e),l(_.$$.fragment,e),l(v.$$.fragment,e),l(D.$$.fragment,e),l(J.$$.fragment,e),l(U.$$.fragment,e),l(w.$$.fragment,e),l(R.$$.fragment,e),O=!0)},o(e){d(h.$$.fragment,e),d($.$$.fragment,e),d(b.$$.fragment,e),d(_.$$.fragment,e),d(v.$$.fragment,e),d(D.$$.fragment,e),d(J.$$.fragment,e),d(U.$$.fragment,e),d(w.$$.fragment,e),d(R.$$.fragment,e),O=!1},d(e){e&&(a(W),a(G),a(x),a(C),a(k),a(M),a(F),a(y),a(L),a(j),a(V),a(T),a(z),a(E),a(N),a(H),a(Y),a(Q),a(u),a(S),a(q),a(I)),a(p),f(h,e),f($,e),f(b,e),f(_,e),f(v,e),f(D,e),f(J),f(U,e),f(w),f(R,e)}}}const ye='{"title":"HiDreamImageTransformer2DModel","local":"hidreamimagetransformer2dmodel","sections":[{"title":"Loading GGUF quantized checkpoints for HiDream-I1","local":"loading-gguf-quantized-checkpoints-for-hidream-i1","sections":[],"depth":2},{"title":"HiDreamImageTransformer2DModel","local":"diffusers.HiDreamImageTransformer2DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function be(ae){return pe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ue extends ue{constructor(p){super(),ce(this,p,be,Me,de,{})}}export{Ue as component};
