Buckets:

download
raw
14 kB
import"../chunks/DsnmJJEf.js";import{i as E,h as P,C,H as p,D as s,E as R,s as W}from"../chunks/X8cAGukj.js";import{p as A,o as G,s as e,f as q,a as T,b as I,c as i,d as H,n as t,r as o}from"../chunks/CQ2f15a1.js";const z='{"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 B=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_15212/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, or the explicit <code>sigmas</code>, shifted as well when <code>shift_provided_sigmas</code> is set. The
terminal <code>0</code> is already part of the 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, or one re-noising step with <code>stochastic_sampling</code>.</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. With <code>stochastic_sampling</code> the
update is <code>x_next = (1 - sigma_next) * x0 + sigma_next * noise</code> with fresh noise from <code>generator</code>, everything
in float32, so the last step (<code>sigma_next = 0</code>) returns <code>x0</code>.</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){A(y,!1),G(()=>{new URLSearchParams(window.location.search).get("fw")}),E();var u=j();P("dyck1e",M=>{var b=B();W(b,"content",z),T(M,b)});var m=e(q(u),2);C(m,{containerStyle:"float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"});var f=e(m,2);p(f,{title:"MiniMaxH3Scheduler",local:"minimaxh3scheduler",headingTag:"h1"});var g=e(f,6);p(g,{title:"MiniMaxH3Scheduler",local:"diffusers.MiniMaxH3Scheduler",headingTag:"h2"});var n=e(g,2),_=i(n);s(_,{name:"class diffusers.MiniMaxH3Scheduler",anchor:"diffusers.MiniMaxH3Scheduler",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L68",parameters:[{name:"shift",val:": float = 12.0"},{name:"stochastic_sampling",val:": bool = False"},{name:"shift_provided_sigmas",val:": bool | None = None"}],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"},{anchor:"diffusers.MiniMaxH3Scheduler.stochastic_sampling",description:`<strong>stochastic_sampling</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Replace the Euler blend with a re-noising update: predict the clean sample, then re-noise it to the next
sigma with fresh noise. The few-step Pika H3 Flex adapters were trained for this update; the base
checkpoints were not.`,name:"stochastic_sampling"},{anchor:"diffusers.MiniMaxH3Scheduler.shift_provided_sigmas",description:`<strong>shift_provided_sigmas</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether explicit <code>sigmas</code> passed to <a href="/docs/diffusers/pr_15212/en/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler.set_timesteps">set_timesteps()</a> are a base grid the scheduler
shifts, like its <code>linspace</code> grid, or a finished schedule taken verbatim. Unset means verbatim with a
deprecation warning; the default becomes <code>True</code> in 0.44.0.`,name:"shift_provided_sigmas"}]});var r=e(_,4),w=i(r);s(w,{name:"index_for_timestep",anchor:"diffusers.MiniMaxH3Scheduler.index_for_timestep",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L205",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:`
<p>The index of <code>timestep</code>.</p>
`,returnType:`
<p><code>int</code></p>
`}),t(2),o(r);var d=e(r,2),F=i(d);s(F,{name:"scale_noise",anchor:"diffusers.MiniMaxH3Scheduler.scale_noise",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L226",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:`
<p>The noised sample.</p>
`,returnType:`
<p><code>torch.FloatTensor</code></p>
`}),t(4),o(d);var a=e(d,2),D=i(a);s(D,{name:"set_begin_index",anchor:"diffusers.MiniMaxH3Scheduler.set_begin_index",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L118",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"}]}),t(2),o(a);var c=e(a,2),O=i(c);s(O,{name:"set_shift",anchor:"diffusers.MiniMaxH3Scheduler.set_shift",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L128",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"}]}),t(4),o(c);var l=e(c,2),k=i(l);s(k,{name:"set_timesteps",anchor:"diffusers.MiniMaxH3Scheduler.set_timesteps",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L142",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;
An explicit grid, strictly decreasing and terminating at <code>0.0</code>. With <code>shift_provided_sigmas=True</code> it is
a base grid in <code>[0, 1]</code> that goes through the shift like the <code>linspace</code> grid; otherwise it is used
verbatim (deprecated default).`,name:"sigmas"}]}),t(4),o(l);var x=e(l,2),L=i(x);s(L,{name:"step",anchor:"diffusers.MiniMaxH3Scheduler.step",source:"https://github.com/huggingface/diffusers/blob/vr_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L258",parameters:[{name:"model_output",val:": FloatTensor"},{name:"timestep",val:": typing.Union[float, torch.FloatTensor]"},{name:"sample",val:": FloatTensor"},{name:"generator",val:": typing.Optional[torch.Generator] = None"},{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.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
The generator the fresh noise is drawn from with <code>stochastic_sampling</code>; unused otherwise.`,name:"generator"},{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:`
<p>the sample for the next step.</p>
`,returnType:`
<p><code>MiniMaxH3SchedulerOutput</code> or <code>tuple</code></p>
`}),t(4),o(x),o(n);var v=e(n,2);p(v,{title:"MiniMaxH3SchedulerOutput",local:"diffusers.schedulers.scheduling_minimax_h3.MiniMaxH3SchedulerOutput",headingTag:"h2"});var h=e(v,2),N=i(h);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_15212/src/diffusers/schedulers/scheduling_minimax_h3.py#L56",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"}]}),t(2),o(h);var U=e(h,2);R(U,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/minimax_h3.md"}),t(2),T(S,u),I()}export{V as component};

Xet Storage Details

Size:
14 kB
·
Xet hash:
6da67ea2b79e34f81622b2e19e07306072a3b523f7af8d0c633524f566156fe5

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