Buckets:
| import"../chunks/DsnmJJEf.js";import{i as ce,h as le,C as me,H as s,D as n,E as ue,s as fe,a as ge}from"../chunks/BtE7mKSK.js";import{p as _e,o as he,s as e,f as O,a as w,b as ve,c as o,d as T,n as r,r as t}from"../chunks/jDjavuwI.js";import{E as be}from"../chunks/SrSJA0zO.js";const xe='{"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 ye=T('<meta name="hf:doc:metadata"/>'),Ce=T("<p>Example:</p> <!>",1),Me=T(`<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_13881/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 there’s insufficient memory, other models on the device are moved back to CPU</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></ol></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 components by a list of names, optionally filtered by 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>Get component IDs by a list of names, optionally filtered by 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>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 (pattern matching), 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>Search components by name with simple pattern matching. Optionally filter by collection or load_id.</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 Ie(R,q){_e(q,!1),he(()=>{new URLSearchParams(window.location.search).get("fw")}),ce();var I=Me();le("7v6pso",a=>{var N=ye();fe(N,"content",xe),w(a,N)});var S=e(O(I),2);me(S,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var J=e(S,2);s(J,{title:"Components and configs",local:"components-and-configs",headingTag:"h1"});var j=e(J,2);s(j,{title:"ComponentSpec",local:"diffusers.ComponentSpec",headingTag:"h2"});var i=e(j,2),k=o(i);n(k,{name:"class diffusers.ComponentSpec",anchor:"diffusers.ComponentSpec",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L97",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> — Name of the component",name:"name"},{anchor:"diffusers.ComponentSpec.type_hint",description:"<strong>type_hint</strong> — Type of the component (e.g. UNet2DConditionModel)",name:"type_hint"},{anchor:"diffusers.ComponentSpec.description",description:"<strong>description</strong> — Optional description of the component",name:"description"},{anchor:"diffusers.ComponentSpec.config",description:"<strong>config</strong> — 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> — 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> — Optional subfolder in pretrained_model_name_or_path",name:"subfolder"},{anchor:"diffusers.ComponentSpec.variant",description:"<strong>variant</strong> — Optional variant in pretrained_model_name_or_path",name:"variant"},{anchor:"diffusers.ComponentSpec.revision",description:"<strong>revision</strong> — Optional revision in pretrained_model_name_or_path",name:"revision"},{anchor:"diffusers.ComponentSpec.default_creation_method",description:"<strong>default_creation_method</strong> — Preferred creation method - “from_config” or “from_pretrained”",name:"default_creation_method"}]});var d=e(k,8),A=o(d);n(A,{name:"create",anchor:"diffusers.ComponentSpec.create",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L266",parameters:[{name:"config",val:": diffusers.configuration_utils.FrozenDict | dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}]}),r(2),t(d);var p=e(d,2),F=o(p);n(F,{name:"decode_load_id",anchor:"diffusers.ComponentSpec.decode_load_id",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L227",parameters:[{name:"load_id",val:": str"}],parametersDescription:[{anchor:"diffusers.ComponentSpec.decode_load_id.load_id",description:`<strong>load_id</strong> — The load_id string to decode, format: “pretrained_model_name_or_path|subfolder|variant|revision” | |
| where None values are represented as “null”`,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(p);var c=e(p,2),Y=o(c);n(Y,{name:"from_component",anchor:"diffusers.ComponentSpec.from_component",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L148",parameters:[{name:"name",val:": str"},{name:"component",val:": typing.Any"}],parametersDescription:[{anchor:"diffusers.ComponentSpec.from_component.name",description:"<strong>name</strong> — Name of the component",name:"name"},{anchor:"diffusers.ComponentSpec.from_component.component",description:"<strong>component</strong> — 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 l=e(c,2),P=o(l);n(P,{name:"load",anchor:"diffusers.ComponentSpec.load",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L294",parameters:[{name:"**kwargs",val:""}]}),r(2),t(l);var E=e(l,2),Q=o(E);n(Q,{name:"loading_fields",anchor:"diffusers.ComponentSpec.loading_fields",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L208",parameters:[]}),r(2),t(E),t(i);var L=e(i,2);s(L,{title:"ConfigSpec",local:"diffusers.ConfigSpec",headingTag:"h2"});var m=e(L,2),z=o(m);n(z,{name:"class diffusers.ConfigSpec",anchor:"diffusers.ConfigSpec",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L349",parameters:[{name:"name",val:": str"},{name:"default",val:": typing.Any"},{name:"description",val:": str | None = None"}]}),r(2),t(m);var B=e(m,2);s(B,{title:"ComponentsManager",local:"diffusers.ComponentsManager",headingTag:"h2"});var u=e(B,2),U=o(u);n(U,{name:"class diffusers.ComponentsManager",anchor:"diffusers.ComponentsManager",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L290",parameters:[]});var V=e(U,8);be(V,{anchor:"diffusers.ComponentsManager.example",children:(a,N)=>{var G=Ce(),pe=e(O(G),2);ge(pe,{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">"unet"</span>, unet_model, collection=<span class="hljs-string">"sdxl"</span>) | |
| cm.add(<span class="hljs-string">"vae"</span>, vae_model, collection=<span class="hljs-string">"sdxl"</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">"unet"</span>, collection=<span class="hljs-string">"sdxl"</span>)`,lang:"python",wrap:!1}),w(a,G)},$$slots:{default:!0}});var f=e(V,2),X=o(f);n(X,{name:"add",anchor:"diffusers.ComponentsManager.add",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L386",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) — The name of the component",name:"name"},{anchor:"diffusers.ComponentsManager.add.component",description:"<strong>component</strong> (Any) — The component to add",name:"component"},{anchor:"diffusers.ComponentsManager.add.collection",description:"<strong>collection</strong> (str | None) — 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(f);var g=e(f,2),H=o(g);n(H,{name:"disable_auto_cpu_offload",anchor:"diffusers.ComponentsManager.disable_auto_cpu_offload",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L753",parameters:[]}),r(2),t(g);var _=e(g,2),$=o(_);n($,{name:"enable_auto_cpu_offload",anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L695",parameters:[{name:"device",val:": str | int | torch.device = None"},{name:"memory_reserve_margin",val:" = '3GB'"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload.device",description:"<strong>device</strong> (str | int | torch.device) — The execution device where models are moved for forward passes",name:"device"},{anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload.memory_reserve_margin",description:`<strong>memory_reserve_margin</strong> (str) — The memory reserve margin to use, default is 3GB. This is the amount of | |
| memory to keep free on the device to avoid running out of memory during model | |
| execution (e.g., for intermediate activations, gradients, etc.)`,name:"memory_reserve_margin"}]}),r(6),t(_);var h=e(_,2),K=o(h);n(K,{name:"get_components_by_ids",anchor:"diffusers.ComponentsManager.get_components_by_ids",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L1061",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]) — | |
| 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) — | |
| 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),ee=o(v);n(ee,{name:"get_components_by_names",anchor:"diffusers.ComponentsManager.get_components_by_names",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L1094",parameters:[{name:"names",val:": list[str]"},{name:"collection",val:": str | None = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.get_components_by_names.names",description:"<strong>names</strong> (list[str]) — list of component names",name:"names"},{anchor:"diffusers.ComponentsManager.get_components_by_names.collection",description:"<strong>collection</strong> (str | None) — Optional collection to filter by",name:"collection"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Dictionary of components with component names as keys</p> | |
| `,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</li> | |
| </ul> | |
| `,raiseType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>ValueError</code></p> | |
| `}),r(2),t(v);var b=e(v,2),ne=o(b);n(ne,{name:"get_ids",anchor:"diffusers.ComponentsManager.get_ids",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L1043",parameters:[{name:"names",val:": str | list[str] = None"},{name:"collection",val:": str | None = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.get_ids.names",description:"<strong>names</strong> (str | list[str]) — list of component names",name:"names"},{anchor:"diffusers.ComponentsManager.get_ids.collection",description:"<strong>collection</strong> (str | None) — Optional collection to filter by",name:"collection"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>list of component IDs</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>list[str]</p> | |
| `}),r(2),t(b);var x=e(b,2),oe=o(x);n(oe,{name:"get_model_info",anchor:"diffusers.ComponentsManager.get_model_info",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L769",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) — 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) — | |
| Field(s) to return. Can be a string for single field or list of fields. If None, uses the | |
| available_info_fields setting.`,name:"fields"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Dictionary containing requested component metadata. If fields is specified, returns only those fields. | |
| Otherwise, returns all fields.</p> | |
| `}),r(2),t(x);var y=e(x,2),te=o(y);n(te,{name:"get_one",anchor:"diffusers.ComponentsManager.get_one",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L998",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) — Optional component ID to get",name:"component_id"},{anchor:"diffusers.ComponentsManager.get_one.name",description:"<strong>name</strong> (str | None) — Component name or pattern",name:"name"},{anchor:"diffusers.ComponentsManager.get_one.collection",description:"<strong>collection</strong> (str | None) — Optional collection to filter by",name:"collection"},{anchor:"diffusers.ComponentsManager.get_one.load_id",description:"<strong>load_id</strong> (str | None) — 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(y);var C=e(y,2),re=o(C);n(re,{name:"remove",anchor:"diffusers.ComponentsManager.remove",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L476",parameters:[{name:"component_id",val:": str = None"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.remove.component_id",description:"<strong>component_id</strong> (str) — The ID of the component to remove",name:"component_id"}]}),r(2),t(C);var M=e(C,2),se=o(M);n(se,{name:"remove_from_collection",anchor:"diffusers.ComponentsManager.remove_from_collection",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L458",parameters:[{name:"component_id",val:": str"},{name:"collection",val:": str"}]}),r(2),t(M);var W=e(M,2),ae=o(W);n(ae,{name:"search_components",anchor:"diffusers.ComponentsManager.search_components",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/components_manager.py#L509",parameters:[{name:"names",val:": str | None = None"},{name:"collection",val:": str | None = None"},{name:"load_id",val:": str | None = None"},{name:"return_dict_with_names",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.ComponentsManager.search_components.names",description:`<strong>names</strong> — Component name(s) or pattern(s) | |
| Patterns: | |
| <ul> | |
| <li>“unet” : match any component with base name “unet” (e.g., unet_123abc)</li> | |
| <li>“!unet” : everything except components with base name “unet”</li> | |
| <li>“unet*” : anything with base name starting with “unet”</li> | |
| <li>“!unet*” : anything with base name NOT starting with “unet”</li> | |
| <li>”<em>unet</em>” : anything with base name containing “unet”</li> | |
| <li>“!<em>unet</em>” : anything with base name NOT containing “unet”</li> | |
| <li>“refiner|vae|unet” : anything with base name exactly matching “refiner”, “vae”, or “unet”</li> | |
| <li>“!refiner|vae|unet” : anything with base name NOT exactly matching “refiner”, “vae”, or “unet”</li> | |
| <li>“unet<em>|vae</em>” : anything with base name starting with “unet” OR starting with “vae”</li> | |
| </ul>`,name:"names"},{anchor:"diffusers.ComponentsManager.search_components.collection",description:"<strong>collection</strong> — Optional collection to filter by",name:"collection"},{anchor:"diffusers.ComponentsManager.search_components.load_id",description:"<strong>load_id</strong> — Optional load_id to filter by",name:"load_id"},{anchor:"diffusers.ComponentsManager.search_components.return_dict_with_names",description:`<strong>return_dict_with_names</strong> — | |
| If True, returns a dictionary with component names as keys, throw an error if | |
| multiple components with the same name are found If False, returns a dictionary | |
| with component IDs as keys`,name:"return_dict_with_names"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Dictionary mapping component names to components if return_dict_with_names=True, or a dictionary mapping | |
| component IDs to components if return_dict_with_names=False</p> | |
| `}),r(2),t(W),t(u);var Z=e(u,2);s(Z,{title:"InsertableDict",local:"diffusers.modular_pipelines.InsertableDict",headingTag:"h2"});var D=e(Z,2),ie=o(D);n(ie,{name:"class diffusers.modular_pipelines.InsertableDict",anchor:"diffusers.modular_pipelines.InsertableDict",source:"https://github.com/huggingface/diffusers/blob/vr_13881/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L59",parameters:""}),t(D);var de=e(D,2);ue(de,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/modular_diffusers/pipeline_components.md"}),r(2),w(R,I),ve()}export{Ie as component}; | |
Xet Storage Details
- Size:
- 26.8 kB
- Xet hash:
- 1fe9d40a00a2055ba26b4b11a1a5e2701da9f790820a3e2259a5af0c3dcb0377
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.