Buckets:

download
raw
12.4 kB
import"../chunks/DsnmJJEf.js";import{i as E,h as C,C as P,H as u,D as s,E as A,s as I}from"../chunks/BLbO27j4.js";import{p as R,o as q,s as e,f as z,a as T,b as B,c as t,d as H,n as i,r as o}from"../chunks/jDjavuwI.js";const G='{"title":"MiniMaxH3Scheduler","local":"minimaxh3scheduler","sections":[{"title":"MiniMaxH3Scheduler","local":"diffusers.MiniMaxH3Scheduler","sections":[],"depth":2},{"title":"MiniMaxH3SchedulerOutput","local":"diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput","sections":[],"depth":2}],"depth":1}';var W=H('<meta name="hf:doc:metadata"/>'),j=H(`<p></p> <!> <!> <p><code>MiniMaxH3Scheduler</code> is the rectified-flow Euler scheduler (<code>eta = 0</code>) with an exponential sigma shift used by <a href="https://huggingface.co/MiniMaxAI" rel="nofollow">MiniMax-H3</a>, <code>sigma' = s * sigma / (1 + (s - 1) * sigma)</code>.</p> <p>The MiniMax-H3 pipelines register <strong>two</strong> of them, because video and audio latents step down two different schedules inside a single transformer call per step: <code>scheduler</code> carries the video schedule (<code>shift=12.0</code> in the released checkpoints) and <code>audio_scheduler</code> the audio one (<code>shift=3.0</code>).</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Rectified-flow Euler scheduler (<code>eta = 0</code>) with an exponential sigma shift, as used by MiniMax-H3.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Map a timestep value to its index in the schedule.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Rectified-flow forward process, in MiniMax-H3’s <code>t</code> convention: <code>x_t = t*x_0 + (1 - t)*noise</code>.</p> <p>MiniMax-H3 uses this to noise its conditioning anchors, where <code>t</code> is the <code>noise_aug</code> level rather than a
schedule entry, so <code>timestep</code> is taken at face value and is <em>not</em> looked up in <code>self.timesteps</code>.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Sets the begin index for the scheduler.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Overrides the configured sigma shift; call before <a href="/docs/diffusers/pr_14921/en/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler.set_timesteps">set_timesteps()</a>.</p> <p>MiniMax-H3 exposes this per request as <code>flow_shift</code> (video) / <code>audio_flow_shift</code> (audio).</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Build the sigma / timestep schedule.</p> <p>The grid is <code>linspace(1, 0, num_inference_steps)</code> pushed through the exponential shift, with consecutive
duplicates collapsed. The terminal <code>0</code> is already part of that grid — the shift maps <code>0</code> to exactly <code>0</code> — so
the schedule holds <code>num_inference_steps</code> sigmas and drives <code>num_inference_steps - 1</code> model evaluations, exposed
as <code>self.timesteps = 1 - sigmas[:-1]</code>.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Take one Euler (<code>eta = 0</code>) step.</p> <p>The model output is a data-ward velocity, so the denoised estimate is <code>x0 = x_t + (1 - t) * v</code> — note the <code>+</code>,
the opposite of the usual flow-match convention. The update is then the blend <code>x_next = r*x_t + (1 - r)*x0</code> with <code>r = sigma_next / sigma</code>, evaluated in float32 for half-precision samples.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Output class for the scheduler’s <code>step</code> function output.</p></div> <!> <p></p>`,1);function V(S,y){R(y,!1),q(()=>{new URLSearchParams(window.location.search).get("fw")}),E();var h=j();C("dyck1e",M=>{var b=W();I(b,"content",G),T(M,b)});var m=e(z(h),2);P(m,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var f=e(m,2);u(f,{title:"MiniMaxH3Scheduler",local:"minimaxh3scheduler",headingTag:"h1"});var g=e(f,6);u(g,{title:"MiniMaxH3Scheduler",local:"diffusers.MiniMaxH3Scheduler",headingTag:"h2"});var n=e(g,2),x=t(n);s(x,{name:"class diffusers.MiniMaxH3Scheduler",anchor:"diffusers.MiniMaxH3Scheduler",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L60",parameters:[{name:"shift",val:": float = 12.0"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.shift",description:`<strong>shift</strong> (<code>float</code>, defaults to <code>12.0</code>) &#x2014;
Exponential shift applied to the sigma grid, <code>sigma&apos; = s*sigma / (1 + (s-1)*sigma)</code>. The released
checkpoints use <code>12.0</code> for video latents and <code>3.0</code> for audio latents.`,name:"shift"}]});var r=e(x,4),w=t(r);s(w,{name:"index_for_timestep",anchor:"diffusers.MiniMaxH3Scheduler.index_for_timestep",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L172",parameters:[{name:"timestep",val:": typing.Union[float, torch.Tensor]"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.index_for_timestep.timestep",description:`<strong>timestep</strong> (<code>float</code> or <code>torch.Tensor</code>) &#x2014;
A value taken from <code>self.timesteps</code>. The schedule is strictly increasing in <code>t</code>, so the match is
unique.`,name:"timestep"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The index of <code>timestep</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>int</code></p>
`}),i(2),o(r);var d=e(r,2),F=t(d);s(F,{name:"scale_noise",anchor:"diffusers.MiniMaxH3Scheduler.scale_noise",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L193",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"},{name:"noise",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.scale_noise.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The clean sample <code>x_0</code>.`,name:"sample"},{anchor:"diffusers.MiniMaxH3Scheduler.scale_noise.timestep",description:`<strong>timestep</strong> (<code>float</code> or <code>torch.FloatTensor</code>) &#x2014;
The target time in <code>[0, 1]</code>; <code>1</code> returns <code>sample</code> unchanged.`,name:"timestep"},{anchor:"diffusers.MiniMaxH3Scheduler.scale_noise.noise",description:`<strong>noise</strong> (<code>torch.FloatTensor</code>) &#x2014;
The noise to mix in.`,name:"noise"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The noised sample.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>torch.FloatTensor</code></p>
`}),i(4),o(d);var a=e(d,2),D=t(a);s(D,{name:"set_begin_index",anchor:"diffusers.MiniMaxH3Scheduler.set_begin_index",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L100",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.set_begin_index.begin_index",description:`<strong>begin_index</strong> (<code>int</code>, defaults to <code>0</code>) &#x2014;
The begin index for the scheduler.`,name:"begin_index"}]}),i(2),o(a);var c=e(a,2),O=t(c);s(O,{name:"set_shift",anchor:"diffusers.MiniMaxH3Scheduler.set_shift",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L110",parameters:[{name:"shift",val:": float"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.set_shift.shift",description:`<strong>shift</strong> (<code>float</code>) &#x2014;
The exponential shift to use for the next schedule.`,name:"shift"}]}),i(4),o(c);var l=e(c,2),L=t(l);s(L,{name:"set_timesteps",anchor:"diffusers.MiniMaxH3Scheduler.set_timesteps",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L124",parameters:[{name:"num_inference_steps",val:": int | None = None"},{name:"device",val:": typing.Union[str, torch.device, NoneType] = None"},{name:"sigmas",val:": typing.Union[list[float], torch.Tensor, NoneType] = None"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of sigma grid points, terminal <code>0</code> included. Ignored when <code>sigmas</code> is given.`,name:"num_inference_steps"},{anchor:"diffusers.MiniMaxH3Scheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
Device the schedule tensors are moved to. The grid itself is always built on CPU in float32 so the
schedule does not depend on the accelerator.`,name:"device"},{anchor:"diffusers.MiniMaxH3Scheduler.set_timesteps.sigmas",description:`<strong>sigmas</strong> (<code>list[float]</code> or <code>torch.Tensor</code>, <em>optional</em>) &#x2014;
A fully-formed sigma schedule, used verbatim (no shifting, no deduplication). It must be strictly
decreasing and terminate at <code>0.0</code>.`,name:"sigmas"}]}),i(4),o(l);var _=e(l,2),k=t(_);s(k,{name:"step",anchor:"diffusers.MiniMaxH3Scheduler.step",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L223",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"},{name:"sample",val:": FloatTensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.MiniMaxH3Scheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.FloatTensor</code>) &#x2014;
The transformer&#x2019;s velocity prediction at <code>timestep</code>.`,name:"model_output"},{anchor:"diffusers.MiniMaxH3Scheduler.step.timestep",description:`<strong>timestep</strong> (<code>float</code> or <code>torch.FloatTensor</code>) &#x2014;
The current timestep, one of <code>self.timesteps</code> (so <code>timestep == 1 - sigma</code>).`,name:"timestep"},{anchor:"diffusers.MiniMaxH3Scheduler.step.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The current sample <code>x_t</code>.`,name:"sample"},{anchor:"diffusers.MiniMaxH3Scheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>MiniMaxH3SchedulerOutput</code> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>the sample for the next step.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>MiniMaxH3SchedulerOutput</code> or <code>tuple</code></p>
`}),i(4),o(_),o(n);var v=e(n,2);u(v,{title:"MiniMaxH3SchedulerOutput",local:"diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput",headingTag:"h2"});var p=e(v,2),N=t(p);s(N,{name:"class diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput",anchor:"diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/schedulers/scheduling_minimax_h3.py#L48",parameters:[{name:"prev_sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
Computed sample <code>x_{t+1}</code> for the next step of the denoising loop.`,name:"prev_sample"}]}),i(2),o(p);var U=e(p,2);A(U,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/minimax_h3.md"}),i(2),T(S,h),B()}export{V as component};

Xet Storage Details

Size:
12.4 kB
·
Xet hash:
9dbe07d90a185be681f38f07bb14e1abf0269a8545e98468c3ba7b5e18029a56

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