Buckets:

HuggingFaceDocBuilder's picture
download
raw
10.7 kB
import{s as Pe,n as Be,o as He}from"../chunks/scheduler.53228c21.js";import{S as Je,i as Ue,e as l,s as o,c as g,h as Ee,a as m,d as n,b as i,f as D,g as h,j as u,k as Q,l as a,m as r,n as _,t as $,o as v,p as b}from"../chunks/index.100fac89.js";import{D as _e}from"../chunks/Docstring.34b3584e.js";import{C as Ge}from"../chunks/CodeBlock.0adb3827.js";import{H as se,E as Ie}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c7e0d7fc.js";function Ne($e){let f,S,X,V,T,F,y,ve='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.',R,M,Y,w,K,p,x,re,H,be="A ModularPipeline for Anima.",le,A,Te="<p>&gt; This is an experimental feature and is likely to change in the future.</p>",O,C,ee,s,k,me,J,ye="Auto Modular pipeline for text-to-image generation using Anima.",de,U,Me="Supported workflows:",pe,E,we="<li><code>text2image</code>: requires <code>prompt</code></li>",ce,G,xe=`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>)`,ue,I,Ae=`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’.`,fe,N,Ce=`Outputs:
images (<code>list</code>):
Generated images.`,te,L,ne,c,P,ge,q,ke="Text conditioner used by Anima to map Qwen3 hidden states and T5 token ids to Cosmos text embeddings.",he,Z,Le=`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>.`,oe,B,ie,W,ae;return T=new se({props:{title:"Anima",local:"anima",headingTag:"h1"}}),M=new Ge({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 se({props:{title:"AnimaModularPipeline",local:"diffusers.AnimaModularPipeline",headingTag:"h2"}}),x=new _e({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"}}),C=new se({props:{title:"AnimaAutoBlocks",local:"diffusers.AnimaAutoBlocks",headingTag:"h2"}}),k=new _e({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#L129"}}),L=new se({props:{title:"AnimaTextConditioner",local:"diffusers.AnimaTextConditioner",headingTag:"h2"}}),P=new _e({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/condition_embedders/condition_embedder_anima.py#L233"}}),B=new Ie({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/anima.md"}}),{c(){f=l("meta"),S=o(),X=l("p"),V=o(),g(T.$$.fragment),F=o(),y=l("p"),y.innerHTML=ve,R=o(),g(M.$$.fragment),Y=o(),g(w.$$.fragment),K=o(),p=l("div"),g(x.$$.fragment),re=o(),H=l("p"),H.textContent=be,le=o(),A=l("blockquote"),A.innerHTML=Te,O=o(),g(C.$$.fragment),ee=o(),s=l("div"),g(k.$$.fragment),me=o(),J=l("p"),J.textContent=ye,de=o(),U=l("p"),U.textContent=Me,pe=o(),E=l("ul"),E.innerHTML=we,ce=o(),G=l("p"),G.innerHTML=xe,ue=o(),I=l("p"),I.innerHTML=Ae,fe=o(),N=l("p"),N.innerHTML=Ce,te=o(),g(L.$$.fragment),ne=o(),c=l("div"),g(P.$$.fragment),ge=o(),q=l("p"),q.textContent=ke,he=o(),Z=l("p"),Z.innerHTML=Le,oe=o(),g(B.$$.fragment),ie=o(),W=l("p"),this.h()},l(e){const t=Ee("svelte-u9bgzb",document.head);f=m(t,"META",{name:!0,content:!0}),t.forEach(n),S=i(e),X=m(e,"P",{}),D(X).forEach(n),V=i(e),h(T.$$.fragment,e),F=i(e),y=m(e,"P",{"data-svelte-h":!0}),u(y)!=="svelte-3t548j"&&(y.innerHTML=ve),R=i(e),h(M.$$.fragment,e),Y=i(e),h(w.$$.fragment,e),K=i(e),p=m(e,"DIV",{class:!0});var j=D(p);h(x.$$.fragment,j),re=i(j),H=m(j,"P",{"data-svelte-h":!0}),u(H)!=="svelte-1nwzq6u"&&(H.textContent=be),le=i(j),A=m(j,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),u(A)!=="svelte-1o9sbyc"&&(A.innerHTML=Te),j.forEach(n),O=i(e),h(C.$$.fragment,e),ee=i(e),s=m(e,"DIV",{class:!0});var d=D(s);h(k.$$.fragment,d),me=i(d),J=m(d,"P",{"data-svelte-h":!0}),u(J)!=="svelte-169sbp1"&&(J.textContent=ye),de=i(d),U=m(d,"P",{"data-svelte-h":!0}),u(U)!=="svelte-ls6ro2"&&(U.textContent=Me),pe=i(d),E=m(d,"UL",{"data-svelte-h":!0}),u(E)!=="svelte-v0h72t"&&(E.innerHTML=we),ce=i(d),G=m(d,"P",{"data-svelte-h":!0}),u(G)!=="svelte-15w5czd"&&(G.innerHTML=xe),ue=i(d),I=m(d,"P",{"data-svelte-h":!0}),u(I)!=="svelte-1de4bkj"&&(I.innerHTML=Ae),fe=i(d),N=m(d,"P",{"data-svelte-h":!0}),u(N)!=="svelte-pgeti7"&&(N.innerHTML=Ce),d.forEach(n),te=i(e),h(L.$$.fragment,e),ne=i(e),c=m(e,"DIV",{class:!0});var z=D(c);h(P.$$.fragment,z),ge=i(z),q=m(z,"P",{"data-svelte-h":!0}),u(q)!=="svelte-1f5qxsj"&&(q.textContent=ke),he=i(z),Z=m(z,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-nnrwra"&&(Z.innerHTML=Le),z.forEach(n),oe=i(e),h(B.$$.fragment,e),ie=i(e),W=m(e,"P",{}),D(W).forEach(n),this.h()},h(){Q(f,"name","hf:doc:metadata"),Q(f,"content",qe),Q(A,"class","warning"),Q(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(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,f),r(e,S,t),r(e,X,t),r(e,V,t),_(T,e,t),r(e,F,t),r(e,y,t),r(e,R,t),_(M,e,t),r(e,Y,t),_(w,e,t),r(e,K,t),r(e,p,t),_(x,p,null),a(p,re),a(p,H),a(p,le),a(p,A),r(e,O,t),_(C,e,t),r(e,ee,t),r(e,s,t),_(k,s,null),a(s,me),a(s,J),a(s,de),a(s,U),a(s,pe),a(s,E),a(s,ce),a(s,G),a(s,ue),a(s,I),a(s,fe),a(s,N),r(e,te,t),_(L,e,t),r(e,ne,t),r(e,c,t),_(P,c,null),a(c,ge),a(c,q),a(c,he),a(c,Z),r(e,oe,t),_(B,e,t),r(e,ie,t),r(e,W,t),ae=!0},p:Be,i(e){ae||($(T.$$.fragment,e),$(M.$$.fragment,e),$(w.$$.fragment,e),$(x.$$.fragment,e),$(C.$$.fragment,e),$(k.$$.fragment,e),$(L.$$.fragment,e),$(P.$$.fragment,e),$(B.$$.fragment,e),ae=!0)},o(e){v(T.$$.fragment,e),v(M.$$.fragment,e),v(w.$$.fragment,e),v(x.$$.fragment,e),v(C.$$.fragment,e),v(k.$$.fragment,e),v(L.$$.fragment,e),v(P.$$.fragment,e),v(B.$$.fragment,e),ae=!1},d(e){e&&(n(S),n(X),n(V),n(F),n(y),n(R),n(Y),n(K),n(p),n(O),n(ee),n(s),n(te),n(ne),n(c),n(oe),n(ie),n(W)),n(f),b(T,e),b(M,e),b(w,e),b(x),b(C,e),b(k),b(L,e),b(P),b(B,e)}}}const qe='{"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 Ze($e){return He(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class De extends Je{constructor(f){super(),Ue(this,f,Ze,Ne,Pe,{})}}export{De as component};

Xet Storage Details

Size:
10.7 kB
·
Xet hash:
4206362dc82e871d1b0ce221ab2fbe4fd243817cb7250c6ee2bedda23f93e7b9

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