Buckets:

HuggingFaceDocBuilder's picture
download
raw
10.8 kB
import{s as Pe,n as Le,o as He}from"../chunks/scheduler.53228c21.js";import{S as Je,i as je,e as l,s as o,c as g,h as Ne,a as m,d as n,b as i,f as D,g as h,j as u,k as z,l as a,m as r,n as _,t as $,o as v,p as b}from"../chunks/index.cac5d66a.js";import{D as _e}from"../chunks/Docstring.aaa1435c.js";import{C as Ee}from"../chunks/CodeBlock.606cbaf4.js";import{H as se,E as Ie}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.6996b1e6.js";function Ue($e){let f,R,W,F,T,V,M,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.',S,x,Y,w,K,p,y,re,H,be="A ModularPipeline for Anima.",le,C,Te="<p>&gt; This is an experimental feature and is likely to change in the future.</p>",O,A,ee,s,k,me,J,Me="Auto Modular pipeline for text-to-image generation using Anima.",de,j,xe="Supported workflows:",pe,N,we="<li><code>text2image</code>: requires <code>prompt</code></li>",ce,E,ye=`Components:
text_encoder (<code>Qwen3Model</code>) tokenizer (<code>Qwen2Tokenizer</code>) t5_tokenizer (<code>T5TokenizerFast</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,Ce=`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,U,Ae=`Outputs:
images (<code>list</code>):
Generated images.`,te,B,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,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>.`,oe,L,ie,X,ae;return T=new se({props:{title:"Anima",local:"anima",headingTag:"h1"}}),x=new Ee({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9kdWxhclBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyME1vZHVsYXJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyY2lyY2xlc3RvbmUtbGFicyUyRkFuaW1hLUJhc2UtdjEuMC1EaWZmdXNlcnMlMjIpJTBBcGlwZS5sb2FkX2NvbXBvbmVudHModG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRCUyMm1hc3RlcnBpZWNlJTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjAxZ2lybCUyQyUyMHNvbG8lMkMlMjBjaXR5JTIwbGlnaHRzJTIyKS5pbWFnZXMlNUIwJTVE",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;circlestone-labs/Anima-Base-v1.0-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"}}),y=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"}}),A=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#L126"}}),B=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#L229"}}),L=new Ie({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/anima.md"}}),{c(){f=l("meta"),R=o(),W=l("p"),F=o(),g(T.$$.fragment),V=o(),M=l("p"),M.innerHTML=ve,S=o(),g(x.$$.fragment),Y=o(),g(w.$$.fragment),K=o(),p=l("div"),g(y.$$.fragment),re=o(),H=l("p"),H.textContent=be,le=o(),C=l("blockquote"),C.innerHTML=Te,O=o(),g(A.$$.fragment),ee=o(),s=l("div"),g(k.$$.fragment),me=o(),J=l("p"),J.textContent=Me,de=o(),j=l("p"),j.textContent=xe,pe=o(),N=l("ul"),N.innerHTML=we,ce=o(),E=l("p"),E.innerHTML=ye,ue=o(),I=l("p"),I.innerHTML=Ce,fe=o(),U=l("p"),U.innerHTML=Ae,te=o(),g(B.$$.fragment),ne=o(),c=l("div"),g(P.$$.fragment),ge=o(),q=l("p"),q.textContent=ke,he=o(),Z=l("p"),Z.innerHTML=Be,oe=o(),g(L.$$.fragment),ie=o(),X=l("p"),this.h()},l(e){const t=Ne("svelte-u9bgzb",document.head);f=m(t,"META",{name:!0,content:!0}),t.forEach(n),R=i(e),W=m(e,"P",{}),D(W).forEach(n),F=i(e),h(T.$$.fragment,e),V=i(e),M=m(e,"P",{"data-svelte-h":!0}),u(M)!=="svelte-3t548j"&&(M.innerHTML=ve),S=i(e),h(x.$$.fragment,e),Y=i(e),h(w.$$.fragment,e),K=i(e),p=m(e,"DIV",{class:!0});var G=D(p);h(y.$$.fragment,G),re=i(G),H=m(G,"P",{"data-svelte-h":!0}),u(H)!=="svelte-1nwzq6u"&&(H.textContent=be),le=i(G),C=m(G,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),u(C)!=="svelte-1o9sbyc"&&(C.innerHTML=Te),G.forEach(n),O=i(e),h(A.$$.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=Me),de=i(d),j=m(d,"P",{"data-svelte-h":!0}),u(j)!=="svelte-ls6ro2"&&(j.textContent=xe),pe=i(d),N=m(d,"UL",{"data-svelte-h":!0}),u(N)!=="svelte-v0h72t"&&(N.innerHTML=we),ce=i(d),E=m(d,"P",{"data-svelte-h":!0}),u(E)!=="svelte-1629ysr"&&(E.innerHTML=ye),ue=i(d),I=m(d,"P",{"data-svelte-h":!0}),u(I)!=="svelte-1de4bkj"&&(I.innerHTML=Ce),fe=i(d),U=m(d,"P",{"data-svelte-h":!0}),u(U)!=="svelte-pgeti7"&&(U.innerHTML=Ae),d.forEach(n),te=i(e),h(B.$$.fragment,e),ne=i(e),c=m(e,"DIV",{class:!0});var Q=D(c);h(P.$$.fragment,Q),ge=i(Q),q=m(Q,"P",{"data-svelte-h":!0}),u(q)!=="svelte-1f5qxsj"&&(q.textContent=ke),he=i(Q),Z=m(Q,"P",{"data-svelte-h":!0}),u(Z)!=="svelte-nnrwra"&&(Z.innerHTML=Be),Q.forEach(n),oe=i(e),h(L.$$.fragment,e),ie=i(e),X=m(e,"P",{}),D(X).forEach(n),this.h()},h(){z(f,"name","hf:doc:metadata"),z(f,"content",qe),z(C,"class","warning"),z(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),z(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,R,t),r(e,W,t),r(e,F,t),_(T,e,t),r(e,V,t),r(e,M,t),r(e,S,t),_(x,e,t),r(e,Y,t),_(w,e,t),r(e,K,t),r(e,p,t),_(y,p,null),a(p,re),a(p,H),a(p,le),a(p,C),r(e,O,t),_(A,e,t),r(e,ee,t),r(e,s,t),_(k,s,null),a(s,me),a(s,J),a(s,de),a(s,j),a(s,pe),a(s,N),a(s,ce),a(s,E),a(s,ue),a(s,I),a(s,fe),a(s,U),r(e,te,t),_(B,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),_(L,e,t),r(e,ie,t),r(e,X,t),ae=!0},p:Le,i(e){ae||($(T.$$.fragment,e),$(x.$$.fragment,e),$(w.$$.fragment,e),$(y.$$.fragment,e),$(A.$$.fragment,e),$(k.$$.fragment,e),$(B.$$.fragment,e),$(P.$$.fragment,e),$(L.$$.fragment,e),ae=!0)},o(e){v(T.$$.fragment,e),v(x.$$.fragment,e),v(w.$$.fragment,e),v(y.$$.fragment,e),v(A.$$.fragment,e),v(k.$$.fragment,e),v(B.$$.fragment,e),v(P.$$.fragment,e),v(L.$$.fragment,e),ae=!1},d(e){e&&(n(R),n(W),n(F),n(V),n(M),n(S),n(Y),n(K),n(p),n(O),n(ee),n(s),n(te),n(ne),n(c),n(oe),n(ie),n(X)),n(f),b(T,e),b(x,e),b(w,e),b(y),b(A,e),b(k),b(B,e),b(P),b(L,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(),je(this,f,Ze,Ue,Pe,{})}}export{De as component};

Xet Storage Details

Size:
10.8 kB
·
Xet hash:
c0b03a1f0f12b82ef9c6f524218218fb1d0a058f7eadc165b0e9286ff2f203ac

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