import{s as de,n as me,o as le}from"../chunks/scheduler.53228c21.js";import{S as fe,i as ce,e as a,s as r,c as f,h as ue,a as i,d as o,b as s,f as Y,g as c,j as q,k as Q,l as j,m as n,n as u,t as p,o as h,p as _}from"../chunks/index.100fac89.js";import{C as pe}from"../chunks/CopyLLMTxtMenu.20a72e0e.js";import{D as ie}from"../chunks/Docstring.49101787.js";import{C as he}from"../chunks/CodeBlock.d30a6509.js";import{H as ee,E as _e}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4d82655d.js";function ge(te){let d,R,z,L,g,Z,T,O,b,oe='A Diffusion Transformer model for 3D video-like data from <a href="https://huggingface.co/papers/2510.04290" rel="nofollow">ChronoEdit: Towards Temporal Reasoning for Image Editing and World Simulation</a> from NVIDIA and University of Toronto, by Jay Zhangjie Wu, Xuanchi Ren, Tianchang Shen, Tianshi Cao, Kai He, Yifan Lu, Ruiyuan Gao, Enze Xie, Shiyi Lan, Jose M. Alvarez, Jun Gao, Sanja Fidler, Zian Wang, Huan Ling.',N,v,ne="<p><strong>TL;DR:</strong> ChronoEdit reframes image editing as a video generation task, using input and edited images as start/end frames to leverage pretrained video models with temporal consistency. A temporal reasoning stage introduces reasoning tokens to ensure physically plausible edits and visualize the editing trajectory.</p>",H,$,re="The model can be loaded with the following code snippet.",V,y,W,M,I,m,C,B,w,se="A Transformer model for video-like data used in the ChronoEdit model.",J,D,P,l,E,K,k,ae='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',S,x,G,U,F;return g=new pe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=new ee({props:{title:"ChronoEditTransformer3DModel",local:"chronoedittransformer3dmodel",headingTag:"h1"}}),y=new he({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMENocm9ub0VkaXRUcmFuc2Zvcm1lcjNETW9kZWwlMEElMEF0cmFuc2Zvcm1lciUyMCUzRCUyMENocm9ub0VkaXRUcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRkNocm9ub0VkaXQtMTRCLURpZmZ1c2VycyUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ChronoEditTransformer3DModel

transformer = ChronoEditTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;nvidia/ChronoEdit-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)`,wrap:!1}}),M=new ee({props:{title:"ChronoEditTransformer3DModel",local:"diffusers.ChronoEditTransformer3DModel",headingTag:"h2"}}),C=new ie({props:{name:"class diffusers.ChronoEditTransformer3DModel",anchor:"diffusers.ChronoEditTransformer3DModel",parameters:[{name:"patch_size",val:": typing.Tuple[int] = (1, 2, 2)"},{name:"num_attention_heads",val:": int = 40"},{name:"attention_head_dim",val:": int = 128"},{name:"in_channels",val:": int = 16"},{name:"out_channels",val:": int = 16"},{name:"text_dim",val:": int = 4096"},{name:"freq_dim",val:": int = 256"},{name:"ffn_dim",val:": int = 13824"},{name:"num_layers",val:": int = 40"},{name:"cross_attn_norm",val:": bool = True"},{name:"qk_norm",val:": typing.Optional[str] = 'rms_norm_across_heads'"},{name:"eps",val:": float = 1e-06"},{name:"image_dim",val:": typing.Optional[int] = None"},{name:"added_kv_proj_dim",val:": typing.Optional[int] = None"},{name:"rope_max_seq_len",val:": int = 1024"},{name:"pos_embed_seq_len",val:": typing.Optional[int] = None"},{name:"rope_temporal_skip_len",val:": int = 8"}],parametersDescription:[{anchor:"diffusers.ChronoEditTransformer3DModel.patch_size",description:`<strong>patch_size</strong> (<code>Tuple[int]</code>, defaults to <code>(1, 2, 2)</code>) &#x2014;
3D patch dimensions for video embedding (t_patch, h_patch, w_patch).`,name:"patch_size"},{anchor:"diffusers.ChronoEditTransformer3DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to <code>40</code>) &#x2014;
Fixed length for text embeddings.`,name:"num_attention_heads"},{anchor:"diffusers.ChronoEditTransformer3DModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
The number of channels in each head.`,name:"attention_head_dim"},{anchor:"diffusers.ChronoEditTransformer3DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of channels in the input.`,name:"in_channels"},{anchor:"diffusers.ChronoEditTransformer3DModel.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of channels in the output.`,name:"out_channels"},{anchor:"diffusers.ChronoEditTransformer3DModel.text_dim",description:`<strong>text_dim</strong> (<code>int</code>, defaults to <code>512</code>) &#x2014;
Input dimension for text embeddings.`,name:"text_dim"},{anchor:"diffusers.ChronoEditTransformer3DModel.freq_dim",description:`<strong>freq_dim</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014;
Dimension for sinusoidal time embeddings.`,name:"freq_dim"},{anchor:"diffusers.ChronoEditTransformer3DModel.ffn_dim",description:`<strong>ffn_dim</strong> (<code>int</code>, defaults to <code>13824</code>) &#x2014;
Intermediate dimension in feed-forward network.`,name:"ffn_dim"},{anchor:"diffusers.ChronoEditTransformer3DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>40</code>) &#x2014;
The number of layers of transformer blocks to use.`,name:"num_layers"},{anchor:"diffusers.ChronoEditTransformer3DModel.window_size",description:`<strong>window_size</strong> (<code>Tuple[int]</code>, defaults to <code>(-1, -1)</code>) &#x2014;
Window size for local attention (-1 indicates global attention).`,name:"window_size"},{anchor:"diffusers.ChronoEditTransformer3DModel.cross_attn_norm",description:`<strong>cross_attn_norm</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Enable cross-attention normalization.`,name:"cross_attn_norm"},{anchor:"diffusers.ChronoEditTransformer3DModel.qk_norm",description:`<strong>qk_norm</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Enable query/key normalization.`,name:"qk_norm"},{anchor:"diffusers.ChronoEditTransformer3DModel.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to <code>1e-6</code>) &#x2014;
Epsilon value for normalization layers.`,name:"eps"},{anchor:"diffusers.ChronoEditTransformer3DModel.add_img_emb",description:`<strong>add_img_emb</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use img_emb.`,name:"add_img_emb"},{anchor:"diffusers.ChronoEditTransformer3DModel.added_kv_proj_dim",description:`<strong>added_kv_proj_dim</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of channels to use for the added key and value projections. If <code>None</code>, no projection is used.`,name:"added_kv_proj_dim"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_chronoedit.py#L520"}}),D=new ee({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),E=new ie({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"}}),x=new _e({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/chronoedit_transformer_3d.md"}}),{c(){d=a("meta"),R=r(),z=a("p"),L=r(),f(g.$$.fragment),Z=r(),f(T.$$.fragment),O=r(),b=a("p"),b.innerHTML=oe,N=r(),v=a("blockquote"),v.innerHTML=ne,H=r(),$=a("p"),$.textContent=re,V=r(),f(y.$$.fragment),W=r(),f(M.$$.fragment),I=r(),m=a("div"),f(C.$$.fragment),B=r(),w=a("p"),w.textContent=se,J=r(),f(D.$$.fragment),P=r(),l=a("div"),f(E.$$.fragment),K=r(),k=a("p"),k.innerHTML=ae,S=r(),f(x.$$.fragment),G=r(),U=a("p"),this.h()},l(e){const t=ue("svelte-u9bgzb",document.head);d=i(t,"META",{name:!0,content:!0}),t.forEach(o),R=s(e),z=i(e,"P",{}),Y(z).forEach(o),L=s(e),c(g.$$.fragment,e),Z=s(e),c(T.$$.fragment,e),O=s(e),b=i(e,"P",{"data-svelte-h":!0}),q(b)!=="svelte-ty5qbi"&&(b.innerHTML=oe),N=s(e),v=i(e,"BLOCKQUOTE",{"data-svelte-h":!0}),q(v)!=="svelte-1yp7b2h"&&(v.innerHTML=ne),H=s(e),$=i(e,"P",{"data-svelte-h":!0}),q($)!=="svelte-1vuni30"&&($.textContent=re),V=s(e),c(y.$$.fragment,e),W=s(e),c(M.$$.fragment,e),I=s(e),m=i(e,"DIV",{class:!0});var A=Y(m);c(C.$$.fragment,A),B=s(A),w=i(A,"P",{"data-svelte-h":!0}),q(w)!=="svelte-vzcuve"&&(w.textContent=se),A.forEach(o),J=s(e),c(D.$$.fragment,e),P=s(e),l=i(e,"DIV",{class:!0});var X=Y(l);c(E.$$.fragment,X),K=s(X),k=i(X,"P",{"data-svelte-h":!0}),q(k)!=="svelte-1x8c0js"&&(k.innerHTML=ae),X.forEach(o),S=s(e),c(x.$$.fragment,e),G=s(e),U=i(e,"P",{}),Y(U).forEach(o),this.h()},h(){Q(d,"name","hf:doc:metadata"),Q(d,"content",Te),Q(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(l,"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){j(document.head,d),n(e,R,t),n(e,z,t),n(e,L,t),u(g,e,t),n(e,Z,t),u(T,e,t),n(e,O,t),n(e,b,t),n(e,N,t),n(e,v,t),n(e,H,t),n(e,$,t),n(e,V,t),u(y,e,t),n(e,W,t),u(M,e,t),n(e,I,t),n(e,m,t),u(C,m,null),j(m,B),j(m,w),n(e,J,t),u(D,e,t),n(e,P,t),n(e,l,t),u(E,l,null),j(l,K),j(l,k),n(e,S,t),u(x,e,t),n(e,G,t),n(e,U,t),F=!0},p:me,i(e){F||(p(g.$$.fragment,e),p(T.$$.fragment,e),p(y.$$.fragment,e),p(M.$$.fragment,e),p(C.$$.fragment,e),p(D.$$.fragment,e),p(E.$$.fragment,e),p(x.$$.fragment,e),F=!0)},o(e){h(g.$$.fragment,e),h(T.$$.fragment,e),h(y.$$.fragment,e),h(M.$$.fragment,e),h(C.$$.fragment,e),h(D.$$.fragment,e),h(E.$$.fragment,e),h(x.$$.fragment,e),F=!1},d(e){e&&(o(R),o(z),o(L),o(Z),o(O),o(b),o(N),o(v),o(H),o($),o(V),o(W),o(I),o(m),o(J),o(P),o(l),o(S),o(G),o(U)),o(d),_(g,e),_(T,e),_(y,e),_(M,e),_(C),_(D,e),_(E),_(x,e)}}}const Te='{"title":"ChronoEditTransformer3DModel","local":"chronoedittransformer3dmodel","sections":[{"title":"ChronoEditTransformer3DModel","local":"diffusers.ChronoEditTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function be(te){return le(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ee extends fe{constructor(d){super(),ce(this,d,be,ge,de,{})}}export{Ee as component};
