Buckets:
| import{s as Rn,o as An,n as Fn}from"../chunks/scheduler.53228c21.js";import{S as Yn,i as zn,e as r,s as n,c as d,h as Qn,a as s,d as a,b as o,f as x,g as p,j as c,k as v,l as t,m as $,n as f,t as u,o as g,p as _}from"../chunks/index.100fac89.js";import{C as Xn}from"../chunks/CopyLLMTxtMenu.50ab6782.js";import{D as C}from"../chunks/Docstring.d95185c4.js";import{C as Kn}from"../chunks/CodeBlock.d30a6509.js";import{E as eo}from"../chunks/ExampleCodeBlock.fd8b68b3.js";import{H as Xe,E as to}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.720a8c3c.js";function no(Ke){let M,Y="Example:",E,w,D;return w=new Kn({props:{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>)`,wrap:!1}}),{c(){M=r("p"),M.textContent=Y,E=n(),d(w.$$.fragment)},l(y){M=s(y,"P",{"data-svelte-h":!0}),c(M)!=="svelte-11lpom8"&&(M.textContent=Y),E=o(y),p(w.$$.fragment,y)},m(y,I){$(y,M,I),$(y,E,I),f(w,y,I),D=!0},p:Fn,i(y){D||(u(w.$$.fragment,y),D=!0)},o(y){g(w.$$.fragment,y),D=!1},d(y){y&&(a(M),a(E)),_(w,y)}}}function oo(Ke){let M,Y,E,w,D,y,I,et,z,tt,h,Q,wt,ye,hn="Specification for a pipeline component.",Dt,Me,vn="A component can be created in two ways:",Nt,we,xn="<li>From scratch using <strong>init</strong> with a config dict</li> <li>using <code>from_pretrained</code></li>",Tt,V,X,It,De,bn="Create component using from_config with config.",Et,k,K,Lt,Ne,$n="Decode a load_id string back into a dictionary of loading fields and values.",St,N,ee,Vt,Te,Cn="Create a ComponentSpec from a Component.",kt,Ie,yn="Currently supports:",Pt,Ee,Mn="<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>",jt,P,te,Jt,Le,wn="Load component using from_pretrained.",Ut,j,ne,Bt,Se,Dn="Return the names of all loading‐related fields (i.e. those whose field.metadata[“loading”] is True).",nt,oe,ot,S,re,Ot,Ve,Nn="Specification for a pipeline configuration parameter.",rt,se,st,i,ae,Wt,ke,Tn="A central registry and management system for model components across multiple pipelines.",Zt,Pe,In=`<a href="/docs/diffusers/pr_12652/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.`,qt,ie,En="<p>> This is an experimental feature and is likely to change in the future.</p>",Gt,J,Ht,U,le,Rt,je,Ln="Add a component to the ComponentsManager.",At,B,me,Ft,Je,Sn="Disable automatic CPU offloading for all components.",Yt,T,de,zt,Ue,Vn="Enable automatic CPU offloading for all components.",Qt,Be,kn="The algorithm works as follows:",Xt,Oe,Pn="<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>",Kt,O,pe,en,We,jn="Get components by a list of IDs.",tn,W,ce,nn,Ze,Jn="Get components by a list of names, optionally filtered by collection.",on,Z,fe,rn,qe,Un="Get component IDs by a list of names, optionally filtered by collection.",sn,q,ue,an,Ge,Bn="Get comprehensive information about a component.",ln,L,ge,mn,He,On="Get a single component by either:",dn,Re,Wn=`<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>`,pn,G,_e,cn,Ae,Zn="Remove a component from the ComponentsManager.",fn,H,he,un,Fe,qn="Remove a component from a collection.",gn,R,ve,_n,Ye,Gn="Search components by name with simple pattern matching. Optionally filter by collection or load_id.",at,xe,it,be,$e,lt,Ce,mt,Qe,dt;return D=new Xn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),I=new Xe({props:{title:"Components and configs",local:"components-and-configs",headingTag:"h1"}}),z=new Xe({props:{title:"ComponentSpec",local:"diffusers.ComponentSpec",headingTag:"h2"}}),Q=new C({props:{name:"class diffusers.ComponentSpec",anchor:"diffusers.ComponentSpec",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L97"}}),X=new C({props:{name:"create",anchor:"diffusers.ComponentSpec.create",parameters:[{name:"config",val:": diffusers.configuration_utils.FrozenDict | dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L266"}}),K=new C({props:{name:"decode_load_id",anchor:"diffusers.ComponentSpec.decode_load_id",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L227",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> | |
| `}}),ee=new C({props:{name:"from_component",anchor:"diffusers.ComponentSpec.from_component",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L148",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> | |
| `}}),te=new C({props:{name:"load",anchor:"diffusers.ComponentSpec.load",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L294"}}),ne=new C({props:{name:"loading_fields",anchor:"diffusers.ComponentSpec.loading_fields",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L208"}}),oe=new Xe({props:{title:"ConfigSpec",local:"diffusers.ConfigSpec",headingTag:"h2"}}),re=new C({props:{name:"class diffusers.ConfigSpec",anchor:"diffusers.ConfigSpec",parameters:[{name:"name",val:": str"},{name:"default",val:": typing.Any"},{name:"description",val:": str | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L355"}}),se=new Xe({props:{title:"ComponentsManager",local:"diffusers.ComponentsManager",headingTag:"h2"}}),ae=new C({props:{name:"class diffusers.ComponentsManager",anchor:"diffusers.ComponentsManager",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L290"}}),J=new eo({props:{anchor:"diffusers.ComponentsManager.example",$$slots:{default:[no]},$$scope:{ctx:Ke}}}),le=new C({props:{name:"add",anchor:"diffusers.ComponentsManager.add",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L386",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> | |
| `}}),me=new C({props:{name:"disable_auto_cpu_offload",anchor:"diffusers.ComponentsManager.disable_auto_cpu_offload",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L753"}}),de=new C({props:{name:"enable_auto_cpu_offload",anchor:"diffusers.ComponentsManager.enable_auto_cpu_offload",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L695"}}),pe=new C({props:{name:"get_components_by_ids",anchor:"diffusers.ComponentsManager.get_components_by_ids",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L1061",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> | |
| `}}),ce=new C({props:{name:"get_components_by_names",anchor:"diffusers.ComponentsManager.get_components_by_names",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L1094",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> | |
| `}}),fe=new C({props:{name:"get_ids",anchor:"diffusers.ComponentsManager.get_ids",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L1043",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> | |
| `}}),ue=new C({props:{name:"get_model_info",anchor:"diffusers.ComponentsManager.get_model_info",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L769",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> | |
| `}}),ge=new C({props:{name:"get_one",anchor:"diffusers.ComponentsManager.get_one",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L998",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> | |
| `}}),_e=new C({props:{name:"remove",anchor:"diffusers.ComponentsManager.remove",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L476"}}),he=new C({props:{name:"remove_from_collection",anchor:"diffusers.ComponentsManager.remove_from_collection",parameters:[{name:"component_id",val:": str"},{name:"collection",val:": str"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L458"}}),ve=new C({props:{name:"search_components",anchor:"diffusers.ComponentsManager.search_components",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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/components_manager.py#L509",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> | |
| `}}),xe=new Xe({props:{title:"InsertableDict",local:"diffusers.modular_pipelines.InsertableDict",headingTag:"h2"}}),$e=new C({props:{name:"class diffusers.modular_pipelines.InsertableDict",anchor:"diffusers.modular_pipelines.InsertableDict",parameters:"",source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/modular_pipelines/modular_pipeline_utils.py#L59"}}),Ce=new to({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/modular_diffusers/pipeline_components.md"}}),{c(){M=r("meta"),Y=n(),E=r("p"),w=n(),d(D.$$.fragment),y=n(),d(I.$$.fragment),et=n(),d(z.$$.fragment),tt=n(),h=r("div"),d(Q.$$.fragment),wt=n(),ye=r("p"),ye.textContent=hn,Dt=n(),Me=r("p"),Me.textContent=vn,Nt=n(),we=r("ol"),we.innerHTML=xn,Tt=n(),V=r("div"),d(X.$$.fragment),It=n(),De=r("p"),De.textContent=bn,Et=n(),k=r("div"),d(K.$$.fragment),Lt=n(),Ne=r("p"),Ne.textContent=$n,St=n(),N=r("div"),d(ee.$$.fragment),Vt=n(),Te=r("p"),Te.textContent=Cn,kt=n(),Ie=r("p"),Ie.textContent=yn,Pt=n(),Ee=r("ul"),Ee.innerHTML=Mn,jt=n(),P=r("div"),d(te.$$.fragment),Jt=n(),Le=r("p"),Le.textContent=wn,Ut=n(),j=r("div"),d(ne.$$.fragment),Bt=n(),Se=r("p"),Se.textContent=Dn,nt=n(),d(oe.$$.fragment),ot=n(),S=r("div"),d(re.$$.fragment),Ot=n(),Ve=r("p"),Ve.textContent=Nn,rt=n(),d(se.$$.fragment),st=n(),i=r("div"),d(ae.$$.fragment),Wt=n(),ke=r("p"),ke.textContent=Tn,Zt=n(),Pe=r("p"),Pe.innerHTML=In,qt=n(),ie=r("blockquote"),ie.innerHTML=En,Gt=n(),d(J.$$.fragment),Ht=n(),U=r("div"),d(le.$$.fragment),Rt=n(),je=r("p"),je.textContent=Ln,At=n(),B=r("div"),d(me.$$.fragment),Ft=n(),Je=r("p"),Je.textContent=Sn,Yt=n(),T=r("div"),d(de.$$.fragment),zt=n(),Ue=r("p"),Ue.textContent=Vn,Qt=n(),Be=r("p"),Be.textContent=kn,Xt=n(),Oe=r("ol"),Oe.innerHTML=Pn,Kt=n(),O=r("div"),d(pe.$$.fragment),en=n(),We=r("p"),We.textContent=jn,tn=n(),W=r("div"),d(ce.$$.fragment),nn=n(),Ze=r("p"),Ze.textContent=Jn,on=n(),Z=r("div"),d(fe.$$.fragment),rn=n(),qe=r("p"),qe.textContent=Un,sn=n(),q=r("div"),d(ue.$$.fragment),an=n(),Ge=r("p"),Ge.textContent=Bn,ln=n(),L=r("div"),d(ge.$$.fragment),mn=n(),He=r("p"),He.textContent=On,dn=n(),Re=r("ul"),Re.innerHTML=Wn,pn=n(),G=r("div"),d(_e.$$.fragment),cn=n(),Ae=r("p"),Ae.textContent=Zn,fn=n(),H=r("div"),d(he.$$.fragment),un=n(),Fe=r("p"),Fe.textContent=qn,gn=n(),R=r("div"),d(ve.$$.fragment),_n=n(),Ye=r("p"),Ye.textContent=Gn,at=n(),d(xe.$$.fragment),it=n(),be=r("div"),d($e.$$.fragment),lt=n(),d(Ce.$$.fragment),mt=n(),Qe=r("p"),this.h()},l(e){const l=Qn("svelte-u9bgzb",document.head);M=s(l,"META",{name:!0,content:!0}),l.forEach(a),Y=o(e),E=s(e,"P",{}),x(E).forEach(a),w=o(e),p(D.$$.fragment,e),y=o(e),p(I.$$.fragment,e),et=o(e),p(z.$$.fragment,e),tt=o(e),h=s(e,"DIV",{class:!0});var b=x(h);p(Q.$$.fragment,b),wt=o(b),ye=s(b,"P",{"data-svelte-h":!0}),c(ye)!=="svelte-rg7py0"&&(ye.textContent=hn),Dt=o(b),Me=s(b,"P",{"data-svelte-h":!0}),c(Me)!=="svelte-1fjrzl6"&&(Me.textContent=vn),Nt=o(b),we=s(b,"OL",{"data-svelte-h":!0}),c(we)!=="svelte-t74lz6"&&(we.innerHTML=xn),Tt=o(b),V=s(b,"DIV",{class:!0});var pt=x(V);p(X.$$.fragment,pt),It=o(pt),De=s(pt,"P",{"data-svelte-h":!0}),c(De)!=="svelte-1skqxe4"&&(De.textContent=bn),pt.forEach(a),Et=o(b),k=s(b,"DIV",{class:!0});var ct=x(k);p(K.$$.fragment,ct),Lt=o(ct),Ne=s(ct,"P",{"data-svelte-h":!0}),c(Ne)!=="svelte-yd5k4j"&&(Ne.textContent=$n),ct.forEach(a),St=o(b),N=s(b,"DIV",{class:!0});var A=x(N);p(ee.$$.fragment,A),Vt=o(A),Te=s(A,"P",{"data-svelte-h":!0}),c(Te)!=="svelte-1io88ln"&&(Te.textContent=Cn),kt=o(A),Ie=s(A,"P",{"data-svelte-h":!0}),c(Ie)!=="svelte-1b3e5l8"&&(Ie.textContent=yn),Pt=o(A),Ee=s(A,"UL",{"data-svelte-h":!0}),c(Ee)!=="svelte-4gx39s"&&(Ee.innerHTML=Mn),A.forEach(a),jt=o(b),P=s(b,"DIV",{class:!0});var ft=x(P);p(te.$$.fragment,ft),Jt=o(ft),Le=s(ft,"P",{"data-svelte-h":!0}),c(Le)!=="svelte-1a0mgic"&&(Le.textContent=wn),ft.forEach(a),Ut=o(b),j=s(b,"DIV",{class:!0});var ut=x(j);p(ne.$$.fragment,ut),Bt=o(ut),Se=s(ut,"P",{"data-svelte-h":!0}),c(Se)!=="svelte-1d19e9d"&&(Se.textContent=Dn),ut.forEach(a),b.forEach(a),nt=o(e),p(oe.$$.fragment,e),ot=o(e),S=s(e,"DIV",{class:!0});var gt=x(S);p(re.$$.fragment,gt),Ot=o(gt),Ve=s(gt,"P",{"data-svelte-h":!0}),c(Ve)!=="svelte-tkt13y"&&(Ve.textContent=Nn),gt.forEach(a),rt=o(e),p(se.$$.fragment,e),st=o(e),i=s(e,"DIV",{class:!0});var m=x(i);p(ae.$$.fragment,m),Wt=o(m),ke=s(m,"P",{"data-svelte-h":!0}),c(ke)!=="svelte-12zga2o"&&(ke.textContent=Tn),Zt=o(m),Pe=s(m,"P",{"data-svelte-h":!0}),c(Pe)!=="svelte-1lr9et2"&&(Pe.innerHTML=In),qt=o(m),ie=s(m,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),c(ie)!=="svelte-1o9sbyc"&&(ie.innerHTML=En),Gt=o(m),p(J.$$.fragment,m),Ht=o(m),U=s(m,"DIV",{class:!0});var _t=x(U);p(le.$$.fragment,_t),Rt=o(_t),je=s(_t,"P",{"data-svelte-h":!0}),c(je)!=="svelte-1efcbti"&&(je.textContent=Ln),_t.forEach(a),At=o(m),B=s(m,"DIV",{class:!0});var ht=x(B);p(me.$$.fragment,ht),Ft=o(ht),Je=s(ht,"P",{"data-svelte-h":!0}),c(Je)!=="svelte-13yhxq2"&&(Je.textContent=Sn),ht.forEach(a),Yt=o(m),T=s(m,"DIV",{class:!0});var F=x(T);p(de.$$.fragment,F),zt=o(F),Ue=s(F,"P",{"data-svelte-h":!0}),c(Ue)!=="svelte-16h8j23"&&(Ue.textContent=Vn),Qt=o(F),Be=s(F,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-2s8rs4"&&(Be.textContent=kn),Xt=o(F),Oe=s(F,"OL",{"data-svelte-h":!0}),c(Oe)!=="svelte-ju3amt"&&(Oe.innerHTML=Pn),F.forEach(a),Kt=o(m),O=s(m,"DIV",{class:!0});var vt=x(O);p(pe.$$.fragment,vt),en=o(vt),We=s(vt,"P",{"data-svelte-h":!0}),c(We)!=="svelte-l3gs77"&&(We.textContent=jn),vt.forEach(a),tn=o(m),W=s(m,"DIV",{class:!0});var xt=x(W);p(ce.$$.fragment,xt),nn=o(xt),Ze=s(xt,"P",{"data-svelte-h":!0}),c(Ze)!=="svelte-f2egka"&&(Ze.textContent=Jn),xt.forEach(a),on=o(m),Z=s(m,"DIV",{class:!0});var bt=x(Z);p(fe.$$.fragment,bt),rn=o(bt),qe=s(bt,"P",{"data-svelte-h":!0}),c(qe)!=="svelte-wy2xsr"&&(qe.textContent=Un),bt.forEach(a),sn=o(m),q=s(m,"DIV",{class:!0});var $t=x(q);p(ue.$$.fragment,$t),an=o($t),Ge=s($t,"P",{"data-svelte-h":!0}),c(Ge)!=="svelte-180fv61"&&(Ge.textContent=Bn),$t.forEach(a),ln=o(m),L=s(m,"DIV",{class:!0});var ze=x(L);p(ge.$$.fragment,ze),mn=o(ze),He=s(ze,"P",{"data-svelte-h":!0}),c(He)!=="svelte-1spaopm"&&(He.textContent=On),dn=o(ze),Re=s(ze,"UL",{"data-svelte-h":!0}),c(Re)!=="svelte-1pkakir"&&(Re.innerHTML=Wn),ze.forEach(a),pn=o(m),G=s(m,"DIV",{class:!0});var Ct=x(G);p(_e.$$.fragment,Ct),cn=o(Ct),Ae=s(Ct,"P",{"data-svelte-h":!0}),c(Ae)!=="svelte-57h0qa"&&(Ae.textContent=Zn),Ct.forEach(a),fn=o(m),H=s(m,"DIV",{class:!0});var yt=x(H);p(he.$$.fragment,yt),un=o(yt),Fe=s(yt,"P",{"data-svelte-h":!0}),c(Fe)!=="svelte-x54sx9"&&(Fe.textContent=qn),yt.forEach(a),gn=o(m),R=s(m,"DIV",{class:!0});var Mt=x(R);p(ve.$$.fragment,Mt),_n=o(Mt),Ye=s(Mt,"P",{"data-svelte-h":!0}),c(Ye)!=="svelte-6gf3km"&&(Ye.textContent=Gn),Mt.forEach(a),m.forEach(a),at=o(e),p(xe.$$.fragment,e),it=o(e),be=s(e,"DIV",{class:!0});var Hn=x(be);p($e.$$.fragment,Hn),Hn.forEach(a),lt=o(e),p(Ce.$$.fragment,e),mt=o(e),Qe=s(e,"P",{}),x(Qe).forEach(a),this.h()},h(){v(M,"name","hf:doc:metadata"),v(M,"content",ro),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ie,"class","warning"),v(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(be,"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,l){t(document.head,M),$(e,Y,l),$(e,E,l),$(e,w,l),f(D,e,l),$(e,y,l),f(I,e,l),$(e,et,l),f(z,e,l),$(e,tt,l),$(e,h,l),f(Q,h,null),t(h,wt),t(h,ye),t(h,Dt),t(h,Me),t(h,Nt),t(h,we),t(h,Tt),t(h,V),f(X,V,null),t(V,It),t(V,De),t(h,Et),t(h,k),f(K,k,null),t(k,Lt),t(k,Ne),t(h,St),t(h,N),f(ee,N,null),t(N,Vt),t(N,Te),t(N,kt),t(N,Ie),t(N,Pt),t(N,Ee),t(h,jt),t(h,P),f(te,P,null),t(P,Jt),t(P,Le),t(h,Ut),t(h,j),f(ne,j,null),t(j,Bt),t(j,Se),$(e,nt,l),f(oe,e,l),$(e,ot,l),$(e,S,l),f(re,S,null),t(S,Ot),t(S,Ve),$(e,rt,l),f(se,e,l),$(e,st,l),$(e,i,l),f(ae,i,null),t(i,Wt),t(i,ke),t(i,Zt),t(i,Pe),t(i,qt),t(i,ie),t(i,Gt),f(J,i,null),t(i,Ht),t(i,U),f(le,U,null),t(U,Rt),t(U,je),t(i,At),t(i,B),f(me,B,null),t(B,Ft),t(B,Je),t(i,Yt),t(i,T),f(de,T,null),t(T,zt),t(T,Ue),t(T,Qt),t(T,Be),t(T,Xt),t(T,Oe),t(i,Kt),t(i,O),f(pe,O,null),t(O,en),t(O,We),t(i,tn),t(i,W),f(ce,W,null),t(W,nn),t(W,Ze),t(i,on),t(i,Z),f(fe,Z,null),t(Z,rn),t(Z,qe),t(i,sn),t(i,q),f(ue,q,null),t(q,an),t(q,Ge),t(i,ln),t(i,L),f(ge,L,null),t(L,mn),t(L,He),t(L,dn),t(L,Re),t(i,pn),t(i,G),f(_e,G,null),t(G,cn),t(G,Ae),t(i,fn),t(i,H),f(he,H,null),t(H,un),t(H,Fe),t(i,gn),t(i,R),f(ve,R,null),t(R,_n),t(R,Ye),$(e,at,l),f(xe,e,l),$(e,it,l),$(e,be,l),f($e,be,null),$(e,lt,l),f(Ce,e,l),$(e,mt,l),$(e,Qe,l),dt=!0},p(e,[l]){const b={};l&2&&(b.$$scope={dirty:l,ctx:e}),J.$set(b)},i(e){dt||(u(D.$$.fragment,e),u(I.$$.fragment,e),u(z.$$.fragment,e),u(Q.$$.fragment,e),u(X.$$.fragment,e),u(K.$$.fragment,e),u(ee.$$.fragment,e),u(te.$$.fragment,e),u(ne.$$.fragment,e),u(oe.$$.fragment,e),u(re.$$.fragment,e),u(se.$$.fragment,e),u(ae.$$.fragment,e),u(J.$$.fragment,e),u(le.$$.fragment,e),u(me.$$.fragment,e),u(de.$$.fragment,e),u(pe.$$.fragment,e),u(ce.$$.fragment,e),u(fe.$$.fragment,e),u(ue.$$.fragment,e),u(ge.$$.fragment,e),u(_e.$$.fragment,e),u(he.$$.fragment,e),u(ve.$$.fragment,e),u(xe.$$.fragment,e),u($e.$$.fragment,e),u(Ce.$$.fragment,e),dt=!0)},o(e){g(D.$$.fragment,e),g(I.$$.fragment,e),g(z.$$.fragment,e),g(Q.$$.fragment,e),g(X.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(ne.$$.fragment,e),g(oe.$$.fragment,e),g(re.$$.fragment,e),g(se.$$.fragment,e),g(ae.$$.fragment,e),g(J.$$.fragment,e),g(le.$$.fragment,e),g(me.$$.fragment,e),g(de.$$.fragment,e),g(pe.$$.fragment,e),g(ce.$$.fragment,e),g(fe.$$.fragment,e),g(ue.$$.fragment,e),g(ge.$$.fragment,e),g(_e.$$.fragment,e),g(he.$$.fragment,e),g(ve.$$.fragment,e),g(xe.$$.fragment,e),g($e.$$.fragment,e),g(Ce.$$.fragment,e),dt=!1},d(e){e&&(a(Y),a(E),a(w),a(y),a(et),a(tt),a(h),a(nt),a(ot),a(S),a(rt),a(st),a(i),a(at),a(it),a(be),a(lt),a(mt),a(Qe)),a(M),_(D,e),_(I,e),_(z,e),_(Q),_(X),_(K),_(ee),_(te),_(ne),_(oe,e),_(re),_(se,e),_(ae),_(J),_(le),_(me),_(de),_(pe),_(ce),_(fe),_(ue),_(ge),_(_e),_(he),_(ve),_(xe,e),_($e),_(Ce,e)}}}const ro='{"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}';function so(Ke){return An(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class uo extends Yn{constructor(M){super(),zn(this,M,so,oo,Rn,{})}}export{uo as component}; | |
Xet Storage Details
- Size:
- 36.3 kB
- Xet hash:
- 3abc71714c1c55686708cbafbaafa3c6934277bddaba6066bcdde18828eba681
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.