import{s as oe,n as le,o as de}from"../chunks/scheduler.8c3d61f6.js";import{S as fe,i as pe,g as o,s as n,r as l,A as ue,h as d,f as a,c as s,j as O,u as f,x as X,k as P,y as K,a as r,v as p,d as u,t as c,w as g}from"../chunks/index.da70eac4.js";import{D as me}from"../chunks/Docstring.dcbc19b1.js";import{C as ie}from"../chunks/CodeBlock.a9c4becf.js";import{H as B,E as ce}from"../chunks/getInferenceSnippets.86beaec3.js";function ge(ee){let m,I,Z,W,h,k,M,te='A Transformer model for image-like data from <a href="https://huggingface.co/HiDream-ai" rel="nofollow">HiDream-I1</a>.',C,b,ae="The model can be loaded with the following code snippet.",x,_,F,y,j,$,re="GGUF checkpoints for the <code>HiDreamImageTransformer2DModel</code> can  be loaded using <code>~FromOriginalModelMixin.from_single_file</code>",V,T,L,v,z,D,H,E,J,N,i,U,A,R,ne='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',Y,w,Q,G,S;return h=new B({props:{title:"HiDreamImageTransformer2DModel",local:"hidreamimagetransformer2dmodel",headingTag:"h1"}}),_=new ie({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}}),y=new B({props:{title:"Loading GGUF quantized checkpoints for HiDream-I1",local:"loading-gguf-quantized-checkpoints-for-hidream-i1",headingTag:"h2"}}),T=new ie({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}}),v=new B({props:{title:"HiDreamImageTransformer2DModel",local:"diffusers.HiDreamImageTransformer2DModel",headingTag:"h2"}}),H=new me({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"}}),J=new B({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),U=new me({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#L20"}}),w=new ce({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/hidream_image_transformer.md"}}),{c(){m=o("meta"),I=n(),Z=o("p"),W=n(),l(h.$$.fragment),k=n(),M=o("p"),M.innerHTML=te,C=n(),b=o("p"),b.textContent=ae,x=n(),l(_.$$.fragment),F=n(),l(y.$$.fragment),j=n(),$=o("p"),$.innerHTML=re,V=n(),l(T.$$.fragment),L=n(),l(v.$$.fragment),z=n(),D=o("div"),l(H.$$.fragment),E=n(),l(J.$$.fragment),N=n(),i=o("div"),l(U.$$.fragment),A=n(),R=o("p"),R.innerHTML=ne,Y=n(),l(w.$$.fragment),Q=n(),G=o("p"),this.h()},l(e){const t=ue("svelte-u9bgzb",document.head);m=d(t,"META",{name:!0,content:!0}),t.forEach(a),I=s(e),Z=d(e,"P",{}),O(Z).forEach(a),W=s(e),f(h.$$.fragment,e),k=s(e),M=d(e,"P",{"data-svelte-h":!0}),X(M)!=="svelte-ta0ebe"&&(M.innerHTML=te),C=s(e),b=d(e,"P",{"data-svelte-h":!0}),X(b)!=="svelte-1vuni30"&&(b.textContent=ae),x=s(e),f(_.$$.fragment,e),F=s(e),f(y.$$.fragment,e),j=s(e),$=d(e,"P",{"data-svelte-h":!0}),X($)!=="svelte-p22jvc"&&($.innerHTML=re),V=s(e),f(T.$$.fragment,e),L=s(e),f(v.$$.fragment,e),z=s(e),D=d(e,"DIV",{class:!0});var se=O(D);f(H.$$.fragment,se),se.forEach(a),E=s(e),f(J.$$.fragment,e),N=s(e),i=d(e,"DIV",{class:!0});var q=O(i);f(U.$$.fragment,q),A=s(q),R=d(q,"P",{"data-svelte-h":!0}),X(R)!=="svelte-1x8c0js"&&(R.innerHTML=ne),q.forEach(a),Y=s(e),f(w.$$.fragment,e),Q=s(e),G=d(e,"P",{}),O(G).forEach(a),this.h()},h(){P(m,"name","hf:doc:metadata"),P(m,"content",he),P(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(i,"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){K(document.head,m),r(e,I,t),r(e,Z,t),r(e,W,t),p(h,e,t),r(e,k,t),r(e,M,t),r(e,C,t),r(e,b,t),r(e,x,t),p(_,e,t),r(e,F,t),p(y,e,t),r(e,j,t),r(e,$,t),r(e,V,t),p(T,e,t),r(e,L,t),p(v,e,t),r(e,z,t),r(e,D,t),p(H,D,null),r(e,E,t),p(J,e,t),r(e,N,t),r(e,i,t),p(U,i,null),K(i,A),K(i,R),r(e,Y,t),p(w,e,t),r(e,Q,t),r(e,G,t),S=!0},p:le,i(e){S||(u(h.$$.fragment,e),u(_.$$.fragment,e),u(y.$$.fragment,e),u(T.$$.fragment,e),u(v.$$.fragment,e),u(H.$$.fragment,e),u(J.$$.fragment,e),u(U.$$.fragment,e),u(w.$$.fragment,e),S=!0)},o(e){c(h.$$.fragment,e),c(_.$$.fragment,e),c(y.$$.fragment,e),c(T.$$.fragment,e),c(v.$$.fragment,e),c(H.$$.fragment,e),c(J.$$.fragment,e),c(U.$$.fragment,e),c(w.$$.fragment,e),S=!1},d(e){e&&(a(I),a(Z),a(W),a(k),a(M),a(C),a(b),a(x),a(F),a(j),a($),a(V),a(L),a(z),a(D),a(E),a(N),a(i),a(Y),a(Q),a(G)),a(m),g(h,e),g(_,e),g(y,e),g(T,e),g(v,e),g(H),g(J,e),g(U),g(w,e)}}}const he='{"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 Me(ee){return de(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ve extends fe{constructor(m){super(),pe(this,m,Me,ge,oe,{})}}export{ve as component};
