Buckets:

HuggingFaceDocBuilder's picture
download
raw
11 kB
import{s as He,n as Je,o as Ue}from"../chunks/scheduler.53228c21.js";import{S as Ee,i as Ge,e as l,s as o,c as f,h as Ie,a as m,d as n,b as i,f as S,g,j as u,k as X,l as a,m as r,n as h,t as _,o as $,p as v}from"../chunks/index.100fac89.js";import{C as Ne}from"../chunks/CopyLLMTxtMenu.356334a4.js";import{D as ve}from"../chunks/Docstring.34b3584e.js";import{C as qe}from"../chunks/CodeBlock.0adb3827.js";import{H as le,E as ze}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c7e0d7fc.js";function Ze(Te){let T,V,W,F,b,R,y,Y,x,be='Anima is a text-to-image model that reuses the <a href="/docs/diffusers/pr_13732/en/api/models/cosmos_transformer3d#diffusers.CosmosTransformer3DModel">CosmosTransformer3DModel</a> with a Qwen3 text encoder, a T5-token text conditioner, and the <a href="/docs/diffusers/pr_13732/en/api/models/autoencoderkl_qwenimage#diffusers.AutoencoderKLQwenImage">AutoencoderKLQwenImage</a> VAE.',K,M,O,w,ee,p,C,me,J,ye="A ModularPipeline for Anima.",de,A,xe="<p>&gt; This is an experimental feature and is likely to change in the future.</p>",te,k,ne,s,L,pe,U,Me="Auto Modular pipeline for text-to-image generation using Anima.",ce,E,we="Supported workflows:",ue,G,Ce="<li><code>text2image</code>: requires <code>prompt</code></li>",fe,I,Ae=`Components:
text_encoder (<code>Qwen3Model</code>)
tokenizer (<code>Qwen2Tokenizer</code>)
t5_tokenizer (<code>T5Tokenizer</code>)
text_conditioner (<code>AnimaTextConditioner</code>)
guider (<code>ClassifierFreeGuidance</code>)
transformer (<code>CosmosTransformer3DModel</code>)
scheduler (<code>FlowMatchEulerDiscreteScheduler</code>)
vae (<code>AutoencoderKLQwenImage</code>)
image_processor (<code>VaeImageProcessor</code>)`,ge,N,ke=`Inputs:
prompt (<code>str</code>):
The prompt or prompts to guide image generation.
negative_prompt (<code>str</code>, <em>optional</em>):
The prompt or prompts not to guide the image generation.
max_sequence_length (<code>int</code>, <em>optional</em>, defaults to 512):
Maximum sequence length for prompt encoding.
num_images_per_prompt (<code>int</code>, <em>optional</em>, defaults to 1):
The number of images to generate per prompt.
height (<code>int</code>, <em>optional</em>):
The height in pixels of the generated image.
width (<code>int</code>, <em>optional</em>):
The width in pixels of the generated image.
latents (<code>Tensor</code>, <em>optional</em>):
Pre-generated noisy latents for image generation.
generator (<code>Generator</code>, <em>optional</em>):
Torch generator for deterministic generation.
num_inference_steps (<code>int</code>, <em>optional</em>, defaults to 50):
The number of denoising steps.
sigmas (<code>list</code>, <em>optional</em>):
Custom sigmas for the denoising process.
*<em>denoiser_input_fields (<code>None</code>, </em>optional<em>):
The conditional model inputs for the Anima denoiser.
output_type (<code>str</code>, </em>optional*, defaults to pil):
Output format: ‘pil’, ‘np’, ‘pt’.`,he,q,Le=`Outputs:
images (<code>list</code>):
Generated images.`,oe,P,ie,c,B,_e,z,Pe="Text conditioner used by Anima to map Qwen3 hidden states and T5 token ids to Cosmos text embeddings.",$e,Z,Be=`Anima reuses the Cosmos Predict2 DiT. The only model-specific conditioning module is this LLM adapter, which
cross-attends from learned T5 token embeddings to Qwen3 text encoder hidden states before the diffusion loop.
<code>target_dim</code> is the conditioner output dimension and must match the transformer’s <code>text_embed_dim</code>.`,ae,H,se,D,re;return b=new Ne({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),y=new le({props:{title:"Anima",local:"anima",headingTag:"h1"}}),M=new qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9kdWxhclBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyME1vZHVsYXJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIybXJmYXRzbyUyRmFuaW1hLXByZXZpZXczLWRpZmZ1c2VycyUyMiklMEFwaXBlLmxvYWRfY29tcG9uZW50cyh0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEJTIybWFzdGVycGllY2UlMkMlMjBiZXN0JTIwcXVhbGl0eSUyQyUyMDFnaXJsJTJDJTIwc29sbyUyQyUyMGNpdHklMjBsaWdodHMlMjIpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline
pipe = ModularPipeline.from_pretrained(<span class="hljs-string">&quot;mrfatso/anima-preview3-diffusers&quot;</span>)
pipe.load_components(torch_dtype=torch.bfloat16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
image = pipe(prompt=<span class="hljs-string">&quot;masterpiece, best quality, 1girl, solo, city lights&quot;</span>).images[<span class="hljs-number">0</span>]`,lang:"python",wrap:!1}}),w=new le({props:{title:"AnimaModularPipeline",local:"diffusers.AnimaModularPipeline",headingTag:"h2"}}),C=new ve({props:{name:"class diffusers.AnimaModularPipeline",anchor:"diffusers.AnimaModularPipeline",parameters:[{name:"blocks",val:": diffusers.modular_pipelines.modular_pipeline.ModularPipelineBlocks | None = None"},{name:"pretrained_model_name_or_path",val:": str | os.PathLike | None = None"},{name:"components_manager",val:": diffusers.modular_pipelines.components_manager.ComponentsManager | None = None"},{name:"collection",val:": str | None = None"},{name:"modular_config_dict",val:": dict[str, typing.Any] | None = None"},{name:"config_dict",val:": dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13732/src/diffusers/modular_pipelines/anima/modular_pipeline.py#L19"}}),k=new le({props:{title:"AnimaAutoBlocks",local:"diffusers.AnimaAutoBlocks",headingTag:"h2"}}),L=new ve({props:{name:"class diffusers.AnimaAutoBlocks",anchor:"diffusers.AnimaAutoBlocks",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_13732/src/diffusers/modular_pipelines/anima/modular_blocks_anima.py#L110"}}),P=new le({props:{title:"AnimaTextConditioner",local:"diffusers.AnimaTextConditioner",headingTag:"h2"}}),B=new ve({props:{name:"class diffusers.AnimaTextConditioner",anchor:"diffusers.AnimaTextConditioner",parameters:[{name:"source_dim",val:": int = 1024"},{name:"target_dim",val:": int = 1024"},{name:"model_dim",val:": int = 1024"},{name:"num_layers",val:": int = 6"},{name:"num_attention_heads",val:": int = 16"},{name:"mlp_ratio",val:": float = 4.0"},{name:"target_vocab_size",val:": int = 32128"},{name:"use_self_attention",val:": bool = True"},{name:"use_layer_norm",val:": bool = False"},{name:"min_sequence_length",val:": int = 512"}],source:"https://github.com/huggingface/diffusers/blob/vr_13732/src/diffusers/models/transformers/transformer_anima.py#L233"}}),H=new ze({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/anima.md"}}),{c(){T=l("meta"),V=o(),W=l("p"),F=o(),f(b.$$.fragment),R=o(),f(y.$$.fragment),Y=o(),x=l("p"),x.innerHTML=be,K=o(),f(M.$$.fragment),O=o(),f(w.$$.fragment),ee=o(),p=l("div"),f(C.$$.fragment),me=o(),J=l("p"),J.textContent=ye,de=o(),A=l("blockquote"),A.innerHTML=xe,te=o(),f(k.$$.fragment),ne=o(),s=l("div"),f(L.$$.fragment),pe=o(),U=l("p"),U.textContent=Me,ce=o(),E=l("p"),E.textContent=we,ue=o(),G=l("ul"),G.innerHTML=Ce,fe=o(),I=l("p"),I.innerHTML=Ae,ge=o(),N=l("p"),N.innerHTML=ke,he=o(),q=l("p"),q.innerHTML=Le,oe=o(),f(P.$$.fragment),ie=o(),c=l("div"),f(B.$$.fragment),_e=o(),z=l("p"),z.textContent=Pe,$e=o(),Z=l("p"),Z.innerHTML=Be,ae=o(),f(H.$$.fragment),se=o(),D=l("p"),this.h()},l(e){const t=Ie("svelte-u9bgzb",document.head);T=m(t,"META",{name:!0,content:!0}),t.forEach(n),V=i(e),W=m(e,"P",{}),S(W).forEach(n),F=i(e),g(b.$$.fragment,e),R=i(e),g(y.$$.fragment,e),Y=i(e),x=m(e,"P",{"data-svelte-h":!0}),u(x)!=="svelte-3t548j"&&(x.innerHTML=be),K=i(e),g(M.$$.fragment,e),O=i(e),g(w.$$.fragment,e),ee=i(e),p=m(e,"DIV",{class:!0});var j=S(p);g(C.$$.fragment,j),me=i(j),J=m(j,"P",{"data-svelte-h":!0}),u(J)!=="svelte-1nwzq6u"&&(J.textContent=ye),de=i(j),A=m(j,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),u(A)!=="svelte-1o9sbyc"&&(A.innerHTML=xe),j.forEach(n),te=i(e),g(k.$$.fragment,e),ne=i(e),s=m(e,"DIV",{class:!0});var d=S(s);g(L.$$.fragment,d),pe=i(d),U=m(d,"P",{"data-svelte-h":!0}),u(U)!=="svelte-169sbp1"&&(U.textContent=Me),ce=i(d),E=m(d,"P",{"data-svelte-h":!0}),u(E)!=="svelte-ls6ro2"&&(E.textContent=we),ue=i(d),G=m(d,"UL",{"data-svelte-h":!0}),u(G)!=="svelte-v0h72t"&&(G.innerHTML=Ce),fe=i(d),I=m(d,"P",{"data-svelte-h":!0}),u(I)!=="svelte-15w5czd"&&(I.innerHTML=Ae),ge=i(d),N=m(d,"P",{"data-svelte-h":!0}),u(N)!=="svelte-1de4bkj"&&(N.innerHTML=ke),he=i(d),q=m(d,"P",{"data-svelte-h":!0}),u(q)!=="svelte-pgeti7"&&(q.innerHTML=Le),d.forEach(n),oe=i(e),g(P.$$.fragment,e),ie=i(e),c=m(e,"DIV",{class:!0});var Q=S(c);g(B.$$.fragment,Q),_e=i(Q),z=m(Q,"P",{"data-svelte-h":!0}),u(z)!=="svelte-1f5qxsj"&&(z.textContent=Pe),$e=i(Q),Z=m(Q,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-nnrwra"&&(Z.innerHTML=Be),Q.forEach(n),ae=i(e),g(H.$$.fragment,e),se=i(e),D=m(e,"P",{}),S(D).forEach(n),this.h()},h(){X(T,"name","hf:doc:metadata"),X(T,"content",je),X(A,"class","warning"),X(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),X(c,"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){a(document.head,T),r(e,V,t),r(e,W,t),r(e,F,t),h(b,e,t),r(e,R,t),h(y,e,t),r(e,Y,t),r(e,x,t),r(e,K,t),h(M,e,t),r(e,O,t),h(w,e,t),r(e,ee,t),r(e,p,t),h(C,p,null),a(p,me),a(p,J),a(p,de),a(p,A),r(e,te,t),h(k,e,t),r(e,ne,t),r(e,s,t),h(L,s,null),a(s,pe),a(s,U),a(s,ce),a(s,E),a(s,ue),a(s,G),a(s,fe),a(s,I),a(s,ge),a(s,N),a(s,he),a(s,q),r(e,oe,t),h(P,e,t),r(e,ie,t),r(e,c,t),h(B,c,null),a(c,_e),a(c,z),a(c,$e),a(c,Z),r(e,ae,t),h(H,e,t),r(e,se,t),r(e,D,t),re=!0},p:Je,i(e){re||(_(b.$$.fragment,e),_(y.$$.fragment,e),_(M.$$.fragment,e),_(w.$$.fragment,e),_(C.$$.fragment,e),_(k.$$.fragment,e),_(L.$$.fragment,e),_(P.$$.fragment,e),_(B.$$.fragment,e),_(H.$$.fragment,e),re=!0)},o(e){$(b.$$.fragment,e),$(y.$$.fragment,e),$(M.$$.fragment,e),$(w.$$.fragment,e),$(C.$$.fragment,e),$(k.$$.fragment,e),$(L.$$.fragment,e),$(P.$$.fragment,e),$(B.$$.fragment,e),$(H.$$.fragment,e),re=!1},d(e){e&&(n(V),n(W),n(F),n(R),n(Y),n(x),n(K),n(O),n(ee),n(p),n(te),n(ne),n(s),n(oe),n(ie),n(c),n(ae),n(se),n(D)),n(T),v(b,e),v(y,e),v(M,e),v(w,e),v(C),v(k,e),v(L),v(P,e),v(B),v(H,e)}}}const je='{"title":"Anima","local":"anima","sections":[{"title":"AnimaModularPipeline","local":"diffusers.AnimaModularPipeline","sections":[],"depth":2},{"title":"AnimaAutoBlocks","local":"diffusers.AnimaAutoBlocks","sections":[],"depth":2},{"title":"AnimaTextConditioner","local":"diffusers.AnimaTextConditioner","sections":[],"depth":2}],"depth":1}';function Qe(Te){return Ue(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Re extends Ee{constructor(T){super(),Ge(this,T,Qe,Ze,He,{})}}export{Re as component};

Xet Storage Details

Size:
11 kB
·
Xet hash:
d71fbf3e47994e21ff95b122afac24118472cd57e8d22f8d25129977aa7f0d54

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.