Buckets:

download
raw
23.4 kB
import"../chunks/DsnmJJEf.js";import{i as se,h as ie,C as de,H as a,D as o,E as le,s as ce,a as pe}from"../chunks/BtE7mKSK.js";import{p as me,o as fe,s as e,f as Z,a as N,b as ue,c as n,d as w,n as r,r as t}from"../chunks/jDjavuwI.js";import{E as ge}from"../chunks/SrSJA0zO.js";const _e='{"title":"Components and configs","local":"components-and-configs","sections":[{"title":"ComponentSpec","local":"diffusers.ComponentSpec","sections":[],"depth":2},{"title":"ConfigSpec","local":"diffusers.ConfigSpec","sections":[],"depth":2},{"title":"ComponentsManager","local":"diffusers.ComponentsManager","sections":[],"depth":2},{"title":"InsertableDict","local":"diffusers.modular_pipelines.InsertableDict","sections":[],"depth":2}],"depth":1}';var he=w('<meta name="hf:doc:metadata"/>'),ve=w("<p>Example:</p> <!>",1),be=w(`<p></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>Specification for a pipeline component.</p> <p>A component can be created in two ways:</p> <ol><li>From scratch using <strong>init</strong> with a config dict</li> <li>using <code>from_pretrained</code></li></ol> <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>Create component using from_config with config.</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>Decode a load_id string back into a dictionary of loading fields and values.</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>Create a ComponentSpec from a Component.</p> <p>Currently supports:</p> <ul><li>Components created with <code>ComponentSpec.load()</code> method</li> <li>Components that are ConfigMixin subclasses but not nn.Modules (e.g. schedulers, guiders)</li></ul></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>Load component using from_pretrained.</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>Return the names of all loading‐related fields (i.e. those whose field.metadata[“loading”] is True).</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>Specification for a pipeline configuration parameter.</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>A central registry and management system for model components across multiple pipelines.</p> <p><a href="/docs/diffusers/pr_14304/en/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> provides a unified way to register, track, and reuse model components (like UNet, VAE, text
encoders, etc.) across different modular pipelines. It includes features for duplicate detection, memory
management, and component organization.</p> <blockquote class="warning"><p>> This is an experimental feature and is likely to change in the future.</p></blockquote> <!> <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>Add a component to the ComponentsManager.</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>Disable automatic CPU offloading for all components.</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>Enable automatic CPU offloading for all components.</p> <p>The algorithm works as follows:</p> <ol><li>All models start on CPU by default</li> <li>When a model’s forward pass is called, it’s moved to the execution device</li> <li>If it doesn’t fit into the memory currently available on the device minus <code>memory_reserve</code>, other models on
the device are moved back to CPU first</li> <li>The system tries to offload the smallest combination of models that frees enough memory</li> <li>Models stay on the execution device until another model needs memory and forces them off</li> <li>If a forward pass still runs out of device memory, the smallest model on the device is offloaded and the
forward is retried, escalating one model at a time until it fits (inference only: each retried forward
re-runs from its original inputs)</li></ol> <p>Every move the offloader makes is recorded in <code>offload_record</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>Get components by a list of IDs.</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>Get comprehensive information about a component.</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>Get a single component by either:</p> <ul><li>searching name, collection, or load_id.</li> <li>passing in a component_id
Raises an error if multiple components match or none are found.</li></ul></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>Remove a component from the ComponentsManager.</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>Remove a component from a collection.</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>Replace the offload strategy on all managed models. Only valid while auto CPU offloading is enabled.</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"><!></div> <!> <p></p>`,1);function Ne(V,G){me(G,!1),fe(()=>{new URLSearchParams(window.location.search).get("fw")}),se();var T=be();ie("7v6pso",s=>{var M=he();ce(M,"content",_e),N(s,M)});var D=e(Z(T),2);de(D,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var S=e(D,2);a(S,{title:"Components and configs",local:"components-and-configs",headingTag:"h1"});var I=e(S,2);a(I,{title:"ComponentSpec",local:"diffusers.ComponentSpec",headingTag:"h2"});var i=e(I,2),k=n(i);o(k,{name:"class diffusers.ComponentSpec",anchor:"diffusers.ComponentSpec",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L99",parameters:[{name:"name",val:": str | None = None"},{name:"type_hint",val:": typing.Optional[typing.Type] = None"},{name:"description",val:": str | None = None"},{name:"config",val:": diffusers.configuration_utils.FrozenDict | None = None"},{name:"pretrained_model_name_or_path",val:": str | list[str] | None = None"},{name:"subfolder",val:": str | None = ''"},{name:"variant",val:": str | None = None"},{name:"revision",val:": str | None = None"},{name:"default_creation_method",val:": typing.Literal['from_config', 'from_pretrained'] = 'from_pretrained'"},{name:"repo",val:": str | list[str] | None = None"}],parametersDescription:[{anchor:"diffusers.ComponentSpec.name",description:"<strong>name</strong> &#x2014; Name of the component",name:"name"},{anchor:"diffusers.ComponentSpec.type_hint",description:"<strong>type_hint</strong> &#x2014; Type of the component (e.g. UNet2DConditionModel)",name:"type_hint"},{anchor:"diffusers.ComponentSpec.description",description:"<strong>description</strong> &#x2014; Optional description of the component",name:"description"},{anchor:"diffusers.ComponentSpec.config",description:"<strong>config</strong> &#x2014; Optional config dict for <strong>init</strong> creation",name:"config"},{anchor:"diffusers.ComponentSpec.pretrained_model_name_or_path",description:"<strong>pretrained_model_name_or_path</strong> &#x2014; Optional pretrained_model_name_or_path path for from_pretrained creation",name:"pretrained_model_name_or_path"},{anchor:"diffusers.ComponentSpec.subfolder",description:"<strong>subfolder</strong> &#x2014; Optional subfolder in pretrained_model_name_or_path",name:"subfolder"},{anchor:"diffusers.ComponentSpec.variant",description:"<strong>variant</strong> &#x2014; Optional variant in pretrained_model_name_or_path",name:"variant"},{anchor:"diffusers.ComponentSpec.revision",description:"<strong>revision</strong> &#x2014; Optional revision in pretrained_model_name_or_path",name:"revision"},{anchor:"diffusers.ComponentSpec.default_creation_method",description:"<strong>default_creation_method</strong> &#x2014; Preferred creation method - &#x201C;from_config&#x201D; or &#x201C;from_pretrained&#x201D;",name:"default_creation_method"}]});var d=e(k,8),R=n(d);o(R,{name:"create",anchor:"diffusers.ComponentSpec.create",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L268",parameters:[{name:"config",val:": diffusers.configuration_utils.FrozenDict | dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}]}),r(2),t(d);var l=e(d,2),A=n(l);o(A,{name:"decode_load_id",anchor:"diffusers.ComponentSpec.decode_load_id",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L229",parameters:[{name:"load_id",val:": str"}],parametersDescription:[{anchor:"diffusers.ComponentSpec.decode_load_id.load_id",description:`<strong>load_id</strong> &#x2014; The load_id string to decode, format: &#x201C;pretrained_model_name_or_path|subfolder|variant|revision&#x201D;
where None values are represented as &#x201C;null&#x201D;`,name:"load_id"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Dict mapping loading field names to their values. e.g. {
“pretrained_model_name_or_path”: “path/to/repo”, “subfolder”: “subfolder”, “variant”: “variant”,
“revision”: “revision”
} If a segment value is “null”, it’s replaced with None. Returns None if load_id is “null” (indicating
component not created with <code>load</code> method).</p>
`}),r(2),t(l);var c=e(l,2),O=n(c);o(O,{name:"from_component",anchor:"diffusers.ComponentSpec.from_component",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L150",parameters:[{name:"name",val:": str"},{name:"component",val:": typing.Any"}],parametersDescription:[{anchor:"diffusers.ComponentSpec.from_component.name",description:"<strong>name</strong> &#x2014; Name of the component",name:"name"},{anchor:"diffusers.ComponentSpec.from_component.component",description:"<strong>component</strong> &#x2014; Component object to create spec from",name:"component"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>ComponentSpec object</p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li><code>ValueError</code> — If component is not supported (e.g. nn.Module without load_id, non-ConfigMixin)</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>ValueError</code></p>
`}),r(6),t(c);var p=e(c,2),F=n(p);o(F,{name:"load",anchor:"diffusers.ComponentSpec.load",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L296",parameters:[{name:"**kwargs",val:""}]}),r(2),t(p);var J=e(p,2),Y=n(J);o(Y,{name:"loading_fields",anchor:"diffusers.ComponentSpec.loading_fields",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L210",parameters:[]}),r(2),t(J),t(i);var j=e(i,2);a(j,{title:"ConfigSpec",local:"diffusers.ConfigSpec",headingTag:"h2"});var m=e(j,2),P=n(m);o(P,{name:"class diffusers.ConfigSpec",anchor:"diffusers.ConfigSpec",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L361",parameters:[{name:"name",val:": str"},{name:"default",val:": typing.Any"},{name:"description",val:": str | None = None"}]}),r(2),t(m);var E=e(m,2);a(E,{title:"ComponentsManager",local:"diffusers.ComponentsManager",headingTag:"h2"});var f=e(E,2),L=n(f);o(L,{name:"class diffusers.ComponentsManager",anchor:"diffusers.ComponentsManager",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L481",parameters:[]});var B=e(L,8);ge(B,{anchor:"diffusers.ComponentsManager.example",children:(s,M)=>{var q=ve(),ae=e(Z(q),2);pe(ae,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMENvbXBvbmVudHNNYW5hZ2VyJTBBJTBBJTIzJTIwQ3JlYXRlJTIwYSUyMGNvbXBvbmVudHMlMjBtYW5hZ2VyJTBBY20lMjAlM0QlMjBDb21wb25lbnRzTWFuYWdlcigpJTBBJTBBJTIzJTIwQWRkJTIwY29tcG9uZW50cyUwQWNtLmFkZCglMjJ1bmV0JTIyJTJDJTIwdW5ldF9tb2RlbCUyQyUyMGNvbGxlY3Rpb24lM0QlMjJzZHhsJTIyKSUwQWNtLmFkZCglMjJ2YWUlMjIlMkMlMjB2YWVfbW9kZWwlMkMlMjBjb2xsZWN0aW9uJTNEJTIyc2R4bCUyMiklMEElMEElMjMlMjBFbmFibGUlMjBhdXRvJTIwb2ZmbG9hZGluZyUwQWNtLmVuYWJsZV9hdXRvX2NwdV9vZmZsb2FkKCklMEElMEElMjMlMjBSZXRyaWV2ZSUyMGNvbXBvbmVudHMlMEF1bmV0JTIwJTNEJTIwY20uZ2V0X29uZShuYW1lJTNEJTIydW5ldCUyMiUyQyUyMGNvbGxlY3Rpb24lM0QlMjJzZHhsJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager
<span class="hljs-comment"># Create a components manager</span>
cm = ComponentsManager()
<span class="hljs-comment"># Add components</span>
cm.add(<span class="hljs-string">&quot;unet&quot;</span>, unet_model, collection=<span class="hljs-string">&quot;sdxl&quot;</span>)
cm.add(<span class="hljs-string">&quot;vae&quot;</span>, vae_model, collection=<span class="hljs-string">&quot;sdxl&quot;</span>)
<span class="hljs-comment"># Enable auto offloading</span>
cm.enable_auto_cpu_offload()
<span class="hljs-comment"># Retrieve components</span>
unet = cm.get_one(name=<span class="hljs-string">&quot;unet&quot;</span>, collection=<span class="hljs-string">&quot;sdxl&quot;</span>)`,lang:"python",wrap:!1}),N(s,q)},$$slots:{default:!0}});var u=e(B,2),Q=n(u);o(Q,{name:"add",anchor:"diffusers.ComponentsManager.add",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L579",parameters:[{name:"name",val:": str"},{name:"component",val:": Any"},{name:"collection",val:": str | None = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.add.name",description:"<strong>name</strong> (str) &#x2014; The name of the component",name:"name"},{anchor:"diffusers.ComponentsManager.add.component",description:"<strong>component</strong> (Any) &#x2014; The component to add",name:"component"},{anchor:"diffusers.ComponentsManager.add.collection",description:"<strong>collection</strong> (str | None) &#x2014; The collection to add the component to",name:"collection"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The unique component ID, which is generated as “{name}_{id(component)}” where
id(component) is Python’s built-in unique identifier for the object</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>str</p>
`}),r(2),t(u);var g=e(u,2),z=n(g);o(z,{name:"disable_auto_cpu_offload",anchor:"diffusers.ComponentsManager.disable_auto_cpu_offload",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L826",parameters:[]}),r(2),t(g);var _=e(g,2),X=n(_);o(X,{name:"enable_auto_cpu_offload",anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L720",parameters:[{name:"device",val:": str | int | torch.device = None"},{name:"memory_reserve",val:": str | int = '3GB'"},{name:"retry_on_oom",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload.device",description:"<strong>device</strong> (str | int | torch.device) &#x2014; The execution device where models are moved for forward passes",name:"device"},{anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload.memory_reserve",description:`<strong>memory_reserve</strong> (str | int, <em>optional</em>, defaults to <code>&quot;3GB&quot;</code>) &#x2014;
The amount of available device memory to keep free when deciding whether an incoming model fits,
checked at each offloading decision &#x2014; e.g. <code>&quot;3GB&quot;</code> or a number of bytes. The reserve is what covers
allocations the offloading cannot see, mainly activations, which scale with resolution / batch size /
sequence length. Set it to <code>0</code> to keep as much on the device as possible, relying on the OOM retry.`,name:"memory_reserve"},{anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload.retry_on_oom",description:`<strong>retry_on_oom</strong> (bool, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to recover from a forward pass that runs out of device memory by offloading the models on the
device one at a time, smallest first, and retrying until it fits. Set it to <code>False</code> to raise the error
instead &#x2014; the forward passes are then left untouched.`,name:"retry_on_oom"}]}),r(8),t(_);var h=e(_,2),H=n(h);o(H,{name:"get_components_by_ids",anchor:"diffusers.ComponentsManager.get_components_by_ids",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L1035",parameters:[{name:"ids",val:": list[str]"},{name:"return_dict_with_names",val:": bool | None = True"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.get_components_by_ids.ids",description:`<strong>ids</strong> (list[str]) &#x2014;
list of component IDs`,name:"ids"},{anchor:"diffusers.ComponentsManager.get_components_by_ids.return_dict_with_names",description:`<strong>return_dict_with_names</strong> (bool | None) &#x2014;
Whether to return a dictionary with component names as keys:`,name:"return_dict_with_names"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Dictionary of components.</p>
<ul>
<li>If return_dict_with_names=True, keys are component names.</li>
<li>If return_dict_with_names=False, keys are component IDs.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p>dict[str, Any]</p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li><code>ValueError</code> — If duplicate component names are found in the search results when return_dict_with_names=True</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>ValueError</code></p>
`}),r(2),t(h);var v=e(h,2),$=n(v);o($,{name:"get_model_info",anchor:"diffusers.ComponentsManager.get_model_info",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L856",parameters:[{name:"component_id",val:": str"},{name:"fields",val:": str | list[str] | None = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.get_model_info.component_id",description:"<strong>component_id</strong> (str) &#x2014; Name of the component to get info for",name:"component_id"},{anchor:"diffusers.ComponentsManager.get_model_info.fields",description:"<strong>fields</strong> (str | list[str] | None) &#x2014; Field(s) to return, all fields if <code>None</code>.",name:"fields"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Dictionary containing the requested component metadata.</p>
`}),r(2),t(v);var b=e(v,2),K=n(b);o(K,{name:"get_one",anchor:"diffusers.ComponentsManager.get_one",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L990",parameters:[{name:"component_id",val:": str | None = None"},{name:"name",val:": str | None = None"},{name:"collection",val:": str | None = None"},{name:"load_id",val:": str | None = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.get_one.component_id",description:"<strong>component_id</strong> (str | None) &#x2014; Optional component ID to get",name:"component_id"},{anchor:"diffusers.ComponentsManager.get_one.name",description:"<strong>name</strong> (str | None) &#x2014; Component name",name:"name"},{anchor:"diffusers.ComponentsManager.get_one.collection",description:"<strong>collection</strong> (str | None) &#x2014; Optional collection to filter by",name:"collection"},{anchor:"diffusers.ComponentsManager.get_one.load_id",description:"<strong>load_id</strong> (str | None) &#x2014; Optional load_id to filter by",name:"load_id"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A single component</p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<ul>
<li><code>ValueError</code> — If no components match or multiple components match</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>ValueError</code></p>
`}),r(4),t(b);var y=e(b,2),ee=n(y);o(ee,{name:"remove",anchor:"diffusers.ComponentsManager.remove",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L683",parameters:[{name:"component_id",val:": str = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.remove.component_id",description:"<strong>component_id</strong> (str) &#x2014; The ID of the component to remove",name:"component_id"}]}),r(2),t(y);var x=e(y,2),oe=n(x);o(oe,{name:"remove_from_collection",anchor:"diffusers.ComponentsManager.remove_from_collection",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L665",parameters:[{name:"component_id",val:": str"},{name:"collection",val:": str"}]}),r(2),t(x);var U=e(x,2),ne=n(U);o(ne,{name:"set_offload_strategy",anchor:"diffusers.ComponentsManager.set_offload_strategy",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/components_manager.py#L800",parameters:[{name:"offload_strategy",val:""}],parametersDescription:[{anchor:"diffusers.ComponentsManager.set_offload_strategy.offload_strategy",description:`<strong>offload_strategy</strong> &#x2014;
Any callable with the signature <code>(hooks, model_id, model, execution_device) -&gt; hooks</code>: it receives the
hooks of the models currently on the device and returns the ones to offload before the incoming model
loads. The default is <code>AutoOffloadStrategy</code>, which frees the smallest sufficient combination.`,name:"offload_strategy"}]}),r(2),t(U),t(f);var W=e(f,2);a(W,{title:"InsertableDict",local:"diffusers.modular_pipelines.InsertableDict",headingTag:"h2"});var C=e(W,2),te=n(C);o(te,{name:"class diffusers.modular_pipelines.InsertableDict",anchor:"diffusers.modular_pipelines.InsertableDict",source:"https://github.com/huggingface/diffusers/blob/vr_14304/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L61",parameters:""}),t(C);var re=e(C,2);le(re,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/modular_diffusers/pipeline_components.md"}),r(2),N(V,T),ue()}export{Ne as component};

Xet Storage Details

Size:
23.4 kB
·
Xet hash:
a210c65a53e31b86227b6da1c23ce2751e485b696cac667bb39e81c83a209eca

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