Buckets:

HuggingFaceDocBuilder's picture
download
raw
25.5 kB
import{s as $t,n as xt,o as Ct}from"../chunks/scheduler.53228c21.js";import{S as Wt,i as kt,e as o,s,c as r,h as Vt,a,d as l,b as n,f as de,g as m,j as p,k as b,l as h,m as i,n as d,t as u,o as c,p as f}from"../chunks/index.cac5d66a.js";import{C as It}from"../chunks/CopyLLMTxtMenu.956dd022.js";import{C as M}from"../chunks/CodeBlock.606cbaf4.js";import{D as Et}from"../chunks/DocNotebookDropdown.c9ebcd31.js";import{H as Ke,E as Rt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.798a8f4f.js";function Ht(st){let y,ue,re,ce,G,fe,$,he,x,ye,C,nt='Community pipelines are <a href="/docs/diffusers/pr_13862/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> classes that are different from the original paper implementation. They provide additional functionality or extend the original pipeline implementation.',we,T,ot='<p>Check out the community pipelines in <a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">diffusers/examples/community</a> with inference and training examples for how to use them.</p>',be,W,at="Community pipelines are either stored on the Hub or the Diffusers’ GitHub repository. Hub pipelines are completely customizable (scheduler, models, pipeline code, etc.) while GitHub pipelines are limited to only the custom pipeline code. Further compare the two community pipeline types in the table below.",Me,k,pt="<thead><tr><th></th> <th>GitHub</th> <th>Hub</th></tr></thead> <tbody><tr><td>Usage</td> <td>Same.</td> <td>Same.</td></tr> <tr><td>Review process</td> <td>Open a Pull Request on GitHub and undergo a review process from the Diffusers team before merging. This option is slower.</td> <td>Upload directly to a Hub repository without a review. This is the fastest option.</td></tr> <tr><td>Visibility</td> <td>Included in the official Diffusers repository and docs.</td> <td>Included on your Hub profile and relies on your own usage and promotion to gain visibility.</td></tr></tbody>",Te,V,_e,I,rt='Load either community pipeline types by passing the <code>custom_pipeline</code> argument to <a href="/docs/diffusers/pr_13862/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a>.',ge,E,Je,R,mt='Add the <code>custom_revision</code> argument to <a href="/docs/diffusers/pr_13862/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> to load a community pipeline from a specific version (for example, <code>v0.30.0</code> or <code>main</code>). By default, community pipelines are loaded from the latest stable version of Diffusers.',Ze,H,ve,_,dt='<p>While the Hugging Face Hub <a href="https://huggingface.co/docs/hub/security-malware" rel="nofollow">scans</a> files, you should still inspect the Hub pipeline code and make sure it is safe.</p>',Ue,z,ut="There are a few ways to load a community pipeline.",je,g,X,ne,ct="Pass a path to <code>custom_pipeline</code> to load a local community pipeline. The directory must contain a <code>pipeline.py</code> file containing the pipeline class.",et,N,tt,w,oe,ft='The <code>custom_pipeline</code> argument is also supported by <a href="/docs/diffusers/pr_13862/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a>, which is useful for <a href="./loading#reuse-a-pipeline">reusing pipelines</a> without using additional memory. It limits the memory usage to only the largest pipeline loaded.',lt,B,it,ae,ht='The <a href="/docs/diffusers/pr_13862/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a> method is especially useful for loading community pipelines because many of them don’t have pretrained weights. Community pipelines generally add a feature on top of an existing pipeline.',Ge,L,$e,q,yt="Community components let users build pipelines with custom transformers, UNets, VAEs, and schedulers not supported by Diffusers. These components require Python module implementations.",xe,F,wt='This section shows how users can use community components to build a community pipeline using <a href="https://huggingface.co/showlab/show-1-base" rel="nofollow">showlab/show-1-base</a> as an example.',Ce,D,bt='<li>Load the required components, the scheduler and image processor. The text encoder is generally imported from <a href="https://huggingface.co/docs/transformers/index" rel="nofollow">Transformers</a>.</li>',We,P,ke,J,Mt='<p>In steps 2 and 3, the custom <a href="https://github.com/showlab/Show-1/blob/main/showone/models/unet_3d_condition.py" rel="nofollow">UNet</a> and <a href="https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/unet/showone_unet_3d_condition.py" rel="nofollow">pipeline</a> implementation must match the format shown in their files for this example to work.</p>',Ve,Z,Tt='<li>Load a <a href="https://github.com/showlab/Show-1/blob/main/showone/models/unet_3d_condition.py" rel="nofollow">custom UNet</a> which is already implemented in <a href="https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/unet/showone_unet_3d_condition.py" rel="nofollow">showone_unet_3d_condition.py</a>. The <a href="/docs/diffusers/pr_13862/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a> class name is renamed to the custom implementation, <code>ShowOneUNet3DConditionModel</code>, because <a href="/docs/diffusers/pr_13862/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a> already exists in Diffusers. Any components required for <code>ShowOneUNet3DConditionModel</code> class should be placed in <code>showone_unet_3d_condition.py</code>.</li>',Ie,S,Ee,v,_t='<li>Load the custom pipeline code (already implemented in <a href="https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/pipeline_t2v_base_pixel.py" rel="nofollow">pipeline_t2v_base_pixel.py</a>). This script contains a custom <code>TextToVideoIFPipeline</code> class for generating videos from text. Like the custom UNet, any code required for <code>TextToVideIFPipeline</code> should be placed in <code>pipeline_t2v_base_pixel.py</code>.</li>',Re,Q,gt="Initialize <code>TextToVideoIFPipeline</code> with <code>ShowOneUNet3DConditionModel</code>.",He,Y,ze,U,Jt="<li>Push the pipeline to the Hub to share with the community.</li>",Xe,A,Ne,O,Zt="After the pipeline is successfully pushed, make the following changes.",Be,K,vt='<li>Change the <code>_class_name</code> attribute in <a href="https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/model_index.json#L2" rel="nofollow">model_index.json</a> to <code>&quot;pipeline_t2v_base_pixel&quot;</code> and <code>&quot;TextToVideoIFPipeline&quot;</code>.</li> <li>Upload <code>showone_unet_3d_condition.py</code> to the <a href="https://huggingface.co/sayakpaul/show-1-base-with-code/blob/main/unet/showone_unet_3d_condition.py" rel="nofollow">unet</a> subfolder.</li> <li>Upload <code>pipeline_t2v_base_pixel.py</code> to the pipeline <a href="https://huggingface.co/sayakpaul/show-1-base-with-code/tree/main" rel="nofollow">repository</a>.</li>',Le,ee,Ut="To run inference, add the <code>trust_remote_code</code> argument while initializing the pipeline to handle all the “magic” behind the scenes.",qe,te,Fe,j,jt='<p>As an additional precaution with <code>trust_remote_code=True</code>, we strongly encourage passing a commit hash to the <code>revision</code> argument in <a href="/docs/diffusers/pr_13862/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> to make sure the code hasn’t been updated with new malicious code (unless you fully trust the model owners).</p>',De,le,Pe,ie,Gt='<li>Take a look at Issue <a href="https://github.com/huggingface/diffusers/issues/841" rel="nofollow">#841</a> for more context about why we’re adding community pipelines to help everyone easily share their work without being slowed down.</li> <li>Check out the <a href="https://huggingface.co/stabilityai/japanese-stable-diffusion-xl/" rel="nofollow">stabilityai/japanese-stable-diffusion-xl</a> repository for an additional example of a community pipeline that also uses the <code>trust_remote_code</code> feature.</li>',Se,se,Qe,me,Ye;return G=new It({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new Et({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/custom_pipeline_overview.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/custom_pipeline_overview.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/custom_pipeline_overview.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/custom_pipeline_overview.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/custom_pipeline_overview.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/custom_pipeline_overview.ipynb"}]}}),x=new Ke({props:{title:"Community pipelines and components",local:"community-pipelines-and-components",headingTag:"h1"}}),V=new Ke({props:{title:"custom_pipeline",local:"custompipeline",headingTag:"h2"}}),E=new M({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMy1tZWRpdW0tZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIycGlwZWxpbmVfc3RhYmxlX2RpZmZ1c2lvbl8zX2luc3RydWN0X3BpeDJwaXglMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMiUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained(
<span class="hljs-string">&quot;stabilityai/stable-diffusion-3-medium-diffusers&quot;</span>,
custom_pipeline=<span class="hljs-string">&quot;pipeline_stable_diffusion_3_instruct_pix2pix&quot;</span>,
torch_dtype=torch.float16,
device_map=<span class="hljs-string">&quot;cuda&quot;</span>
)`,lang:"py",wrap:!1}}),H=new M({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMy1tZWRpdW0tZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIycGlwZWxpbmVfc3RhYmxlX2RpZmZ1c2lvbl8zX2luc3RydWN0X3BpeDJwaXglMjIlMkMlMEElMjAlMjAlMjAlMjBjdXN0b21fcmV2aXNpb24lM0QlMjJtYWluJTIyJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRCUyMmN1ZGElMjIlMEEp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained(
<span class="hljs-string">&quot;stabilityai/stable-diffusion-3-medium-diffusers&quot;</span>,
custom_pipeline=<span class="hljs-string">&quot;pipeline_stable_diffusion_3_instruct_pix2pix&quot;</span>,
custom_revision=<span class="hljs-string">&quot;main&quot;</span>
torch_dtype=torch.float16,
device_map=<span class="hljs-string">&quot;cuda&quot;</span>
)`,lang:"py",wrap:!1}}),N=new M({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMy1tZWRpdW0tZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIycGF0aCUyRnRvJTJGcGlwZWxpbmVfZGlyZWN0b3J5JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRCUyMmN1ZGElMjIlMEEp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained(
<span class="hljs-string">&quot;stabilityai/stable-diffusion-3-medium-diffusers&quot;</span>,
custom_pipeline=<span class="hljs-string">&quot;path/to/pipeline_directory&quot;</span>,
torch_dtype=torch.float16,
device_map=<span class="hljs-string">&quot;cuda&quot;</span>
)`,lang:"py",wrap:!1}}),B=new M({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZV9zZCUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJlbWlsaWFuSlIlMkZDeWJlclJlYWxpc3RpY19WMyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMGRldmljZV9tYXAlM0QlMjJjdWRhJTIyKSUwQXBpcGVsaW5lX2xwdyUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcGlwZSglMEElMjAlMjAlMjAlMjBwaXBlbGluZV9zZCUyQyUyMGN1c3RvbV9waXBlbGluZSUzRCUyMmxwd19zdGFibGVfZGlmZnVzaW9uJTIyJTJDJTIwZGV2aWNlX21hcCUzRCUyMmN1ZGElMjIlMEEp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
pipeline_sd = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;emilianJR/CyberRealistic_V3&quot;</span>, torch_dtype=torch.float16, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline_lpw = DiffusionPipeline.from_pipe(
pipeline_sd, custom_pipeline=<span class="hljs-string">&quot;lpw_stable_diffusion&quot;</span>, device_map=<span class="hljs-string">&quot;cuda&quot;</span>
)`,lang:"py",wrap:!1}}),L=new Ke({props:{title:"Community components",local:"community-components",headingTag:"h2"}}),P=new M({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFQ1VG9rZW5pemVyJTJDJTIwVDVFbmNvZGVyTW9kZWwlMkMlMjBDTElQSW1hZ2VQcm9jZXNzb3IlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRFBNU29sdmVyTXVsdGlzdGVwU2NoZWR1bGVyJTBBJTBBcGlwZWxpbmVfaWQlMjAlM0QlMjAlMjJzaG93bGFiJTJGc2hvdy0xLWJhc2UlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBUNVRva2VuaXplci5mcm9tX3ByZXRyYWluZWQocGlwZWxpbmVfaWQlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0b2tlbml6ZXIlMjIpJTBBdGV4dF9lbmNvZGVyJTIwJTNEJTIwVDVFbmNvZGVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKHBpcGVsaW5lX2lkJTJDJTIwc3ViZm9sZGVyJTNEJTIydGV4dF9lbmNvZGVyJTIyKSUwQXNjaGVkdWxlciUyMCUzRCUyMERQTVNvbHZlck11bHRpc3RlcFNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQocGlwZV9pZCUyQyUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiklMEFmZWF0dXJlX2V4dHJhY3RvciUyMCUzRCUyMENMSVBJbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQocGlwZV9pZCUyQyUyMHN1YmZvbGRlciUzRCUyMmZlYXR1cmVfZXh0cmFjdG9yJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> T5Tokenizer, T5EncoderModel, CLIPImageProcessor
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DPMSolverMultistepScheduler
pipeline_id = <span class="hljs-string">&quot;showlab/show-1-base&quot;</span>
tokenizer = T5Tokenizer.from_pretrained(pipeline_id, subfolder=<span class="hljs-string">&quot;tokenizer&quot;</span>)
text_encoder = T5EncoderModel.from_pretrained(pipeline_id, subfolder=<span class="hljs-string">&quot;text_encoder&quot;</span>)
scheduler = DPMSolverMultistepScheduler.from_pretrained(pipe_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
feature_extractor = CLIPImageProcessor.from_pretrained(pipe_id, subfolder=<span class="hljs-string">&quot;feature_extractor&quot;</span>)`,lang:"python",wrap:!1}}),S=new M({props:{code:"ZnJvbSUyMHNob3dvbmVfdW5ldF8zZF9jb25kaXRpb24lMjBpbXBvcnQlMjBTaG93T25lVU5ldDNEQ29uZGl0aW9uTW9kZWwlMEElMEF1bmV0JTIwJTNEJTIwU2hvd09uZVVOZXQzRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZChwaXBlbGluZV9pZCUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIp",highlighted:`<span class="hljs-keyword">from</span> showone_unet_3d_condition <span class="hljs-keyword">import</span> ShowOneUNet3DConditionModel
unet = ShowOneUNet3DConditionModel.from_pretrained(pipeline_id, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)`,lang:"python",wrap:!1}}),Y=new M({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwcGlwZWxpbmVfdDJ2X2Jhc2VfcGl4ZWwlMjBpbXBvcnQlMjBUZXh0VG9WaWRlb0lGUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMFRleHRUb1ZpZGVvSUZQaXBlbGluZSglMEElMjAlMjAlMjAlMjB1bmV0JTNEdW5ldCUyQyUwQSUyMCUyMCUyMCUyMHRleHRfZW5jb2RlciUzRHRleHRfZW5jb2RlciUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMHNjaGVkdWxlciUzRHNjaGVkdWxlciUyQyUwQSUyMCUyMCUyMCUyMGZlYXR1cmVfZXh0cmFjdG9yJTNEZmVhdHVyZV9leHRyYWN0b3IlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> pipeline_t2v_base_pixel <span class="hljs-keyword">import</span> TextToVideoIFPipeline
pipeline = TextToVideoIFPipeline(
unet=unet,
text_encoder=text_encoder,
tokenizer=tokenizer,
scheduler=scheduler,
feature_extractor=feature_extractor,
device_map=<span class="hljs-string">&quot;cuda&quot;</span>,
torch_dtype=torch.float16
)`,lang:"python",wrap:!1}}),A=new M({props:{code:"cGlwZWxpbmUucHVzaF90b19odWIoJTIyY3VzdG9tLXQydi1waXBlbGluZSUyMik=",highlighted:'pipeline.push_to_hub(<span class="hljs-string">&quot;custom-t2v-pipeline&quot;</span>)',lang:"python",wrap:!1}}),te=new M({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjIlM0NjaGFuZ2UtdXNlcm5hbWUlM0UlMkYlM0NjaGFuZ2UtaWQlM0UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained(
<span class="hljs-string">&quot;&lt;change-username&gt;/&lt;change-id&gt;&quot;</span>, trust_remote_code=<span class="hljs-literal">True</span>, torch_dtype=torch.float16
)`,lang:"python",wrap:!1}}),le=new Ke({props:{title:"Resources",local:"resources",headingTag:"h2"}}),se=new Rt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/custom_pipeline_overview.md"}}),{c(){y=o("meta"),ue=s(),re=o("p"),ce=s(),r(G.$$.fragment),fe=s(),r($.$$.fragment),he=s(),r(x.$$.fragment),ye=s(),C=o("p"),C.innerHTML=nt,we=s(),T=o("blockquote"),T.innerHTML=ot,be=s(),W=o("p"),W.textContent=at,Me=s(),k=o("table"),k.innerHTML=pt,Te=s(),r(V.$$.fragment),_e=s(),I=o("p"),I.innerHTML=rt,ge=s(),r(E.$$.fragment),Je=s(),R=o("p"),R.innerHTML=mt,Ze=s(),r(H.$$.fragment),ve=s(),_=o("blockquote"),_.innerHTML=dt,Ue=s(),z=o("p"),z.textContent=ut,je=s(),g=o("ul"),X=o("li"),ne=o("p"),ne.innerHTML=ct,et=s(),r(N.$$.fragment),tt=s(),w=o("li"),oe=o("p"),oe.innerHTML=ft,lt=s(),r(B.$$.fragment),it=s(),ae=o("p"),ae.innerHTML=ht,Ge=s(),r(L.$$.fragment),$e=s(),q=o("p"),q.textContent=yt,xe=s(),F=o("p"),F.innerHTML=wt,Ce=s(),D=o("ol"),D.innerHTML=bt,We=s(),r(P.$$.fragment),ke=s(),J=o("blockquote"),J.innerHTML=Mt,Ve=s(),Z=o("ol"),Z.innerHTML=Tt,Ie=s(),r(S.$$.fragment),Ee=s(),v=o("ol"),v.innerHTML=_t,Re=s(),Q=o("p"),Q.innerHTML=gt,He=s(),r(Y.$$.fragment),ze=s(),U=o("ol"),U.innerHTML=Jt,Xe=s(),r(A.$$.fragment),Ne=s(),O=o("p"),O.textContent=Zt,Be=s(),K=o("ul"),K.innerHTML=vt,Le=s(),ee=o("p"),ee.innerHTML=Ut,qe=s(),r(te.$$.fragment),Fe=s(),j=o("blockquote"),j.innerHTML=jt,De=s(),r(le.$$.fragment),Pe=s(),ie=o("ul"),ie.innerHTML=Gt,Se=s(),r(se.$$.fragment),Qe=s(),me=o("p"),this.h()},l(e){const t=Vt("svelte-u9bgzb",document.head);y=a(t,"META",{name:!0,content:!0}),t.forEach(l),ue=n(e),re=a(e,"P",{}),de(re).forEach(l),ce=n(e),m(G.$$.fragment,e),fe=n(e),m($.$$.fragment,e),he=n(e),m(x.$$.fragment,e),ye=n(e),C=a(e,"P",{"data-svelte-h":!0}),p(C)!=="svelte-1edy0re"&&(C.innerHTML=nt),we=n(e),T=a(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(T)!=="svelte-xgx94c"&&(T.innerHTML=ot),be=n(e),W=a(e,"P",{"data-svelte-h":!0}),p(W)!=="svelte-vv0ttp"&&(W.textContent=at),Me=n(e),k=a(e,"TABLE",{"data-svelte-h":!0}),p(k)!=="svelte-1eyoeg5"&&(k.innerHTML=pt),Te=n(e),m(V.$$.fragment,e),_e=n(e),I=a(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-1sf6z9t"&&(I.innerHTML=rt),ge=n(e),m(E.$$.fragment,e),Je=n(e),R=a(e,"P",{"data-svelte-h":!0}),p(R)!=="svelte-1y6f337"&&(R.innerHTML=mt),Ze=n(e),m(H.$$.fragment,e),ve=n(e),_=a(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(_)!=="svelte-1hogcd2"&&(_.innerHTML=dt),Ue=n(e),z=a(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-x7b87u"&&(z.textContent=ut),je=n(e),g=a(e,"UL",{});var Ae=de(g);X=a(Ae,"LI",{});var Oe=de(X);ne=a(Oe,"P",{"data-svelte-h":!0}),p(ne)!=="svelte-1lwiq0"&&(ne.innerHTML=ct),et=n(Oe),m(N.$$.fragment,Oe),Oe.forEach(l),tt=n(Ae),w=a(Ae,"LI",{});var pe=de(w);oe=a(pe,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-sdat4e"&&(oe.innerHTML=ft),lt=n(pe),m(B.$$.fragment,pe),it=n(pe),ae=a(pe,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-1a4xge1"&&(ae.innerHTML=ht),pe.forEach(l),Ae.forEach(l),Ge=n(e),m(L.$$.fragment,e),$e=n(e),q=a(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-1t5qd3d"&&(q.textContent=yt),xe=n(e),F=a(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-10u1dqi"&&(F.innerHTML=wt),Ce=n(e),D=a(e,"OL",{"data-svelte-h":!0}),p(D)!=="svelte-21v3n2"&&(D.innerHTML=bt),We=n(e),m(P.$$.fragment,e),ke=n(e),J=a(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(J)!=="svelte-1u8b6fh"&&(J.innerHTML=Mt),Ve=n(e),Z=a(e,"OL",{start:!0,"data-svelte-h":!0}),p(Z)!=="svelte-1mxkkp4"&&(Z.innerHTML=Tt),Ie=n(e),m(S.$$.fragment,e),Ee=n(e),v=a(e,"OL",{start:!0,"data-svelte-h":!0}),p(v)!=="svelte-1dbx1gh"&&(v.innerHTML=_t),Re=n(e),Q=a(e,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-1wem108"&&(Q.innerHTML=gt),He=n(e),m(Y.$$.fragment,e),ze=n(e),U=a(e,"OL",{start:!0,"data-svelte-h":!0}),p(U)!=="svelte-l1jz4"&&(U.innerHTML=Jt),Xe=n(e),m(A.$$.fragment,e),Ne=n(e),O=a(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-1bp75yg"&&(O.textContent=Zt),Be=n(e),K=a(e,"UL",{"data-svelte-h":!0}),p(K)!=="svelte-y3j3v4"&&(K.innerHTML=vt),Le=n(e),ee=a(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-3cd5s4"&&(ee.innerHTML=Ut),qe=n(e),m(te.$$.fragment,e),Fe=n(e),j=a(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(j)!=="svelte-179ejzi"&&(j.innerHTML=jt),De=n(e),m(le.$$.fragment,e),Pe=n(e),ie=a(e,"UL",{"data-svelte-h":!0}),p(ie)!=="svelte-j3e00b"&&(ie.innerHTML=Gt),Se=n(e),m(se.$$.fragment,e),Qe=n(e),me=a(e,"P",{}),de(me).forEach(l),this.h()},h(){b(y,"name","hf:doc:metadata"),b(y,"content",zt),b(T,"class","tip"),b(_,"class","warning"),b(J,"class","warning"),b(Z,"start","2"),b(v,"start","3"),b(U,"start","4"),b(j,"class","warning")},m(e,t){h(document.head,y),i(e,ue,t),i(e,re,t),i(e,ce,t),d(G,e,t),i(e,fe,t),d($,e,t),i(e,he,t),d(x,e,t),i(e,ye,t),i(e,C,t),i(e,we,t),i(e,T,t),i(e,be,t),i(e,W,t),i(e,Me,t),i(e,k,t),i(e,Te,t),d(V,e,t),i(e,_e,t),i(e,I,t),i(e,ge,t),d(E,e,t),i(e,Je,t),i(e,R,t),i(e,Ze,t),d(H,e,t),i(e,ve,t),i(e,_,t),i(e,Ue,t),i(e,z,t),i(e,je,t),i(e,g,t),h(g,X),h(X,ne),h(X,et),d(N,X,null),h(g,tt),h(g,w),h(w,oe),h(w,lt),d(B,w,null),h(w,it),h(w,ae),i(e,Ge,t),d(L,e,t),i(e,$e,t),i(e,q,t),i(e,xe,t),i(e,F,t),i(e,Ce,t),i(e,D,t),i(e,We,t),d(P,e,t),i(e,ke,t),i(e,J,t),i(e,Ve,t),i(e,Z,t),i(e,Ie,t),d(S,e,t),i(e,Ee,t),i(e,v,t),i(e,Re,t),i(e,Q,t),i(e,He,t),d(Y,e,t),i(e,ze,t),i(e,U,t),i(e,Xe,t),d(A,e,t),i(e,Ne,t),i(e,O,t),i(e,Be,t),i(e,K,t),i(e,Le,t),i(e,ee,t),i(e,qe,t),d(te,e,t),i(e,Fe,t),i(e,j,t),i(e,De,t),d(le,e,t),i(e,Pe,t),i(e,ie,t),i(e,Se,t),d(se,e,t),i(e,Qe,t),i(e,me,t),Ye=!0},p:xt,i(e){Ye||(u(G.$$.fragment,e),u($.$$.fragment,e),u(x.$$.fragment,e),u(V.$$.fragment,e),u(E.$$.fragment,e),u(H.$$.fragment,e),u(N.$$.fragment,e),u(B.$$.fragment,e),u(L.$$.fragment,e),u(P.$$.fragment,e),u(S.$$.fragment,e),u(Y.$$.fragment,e),u(A.$$.fragment,e),u(te.$$.fragment,e),u(le.$$.fragment,e),u(se.$$.fragment,e),Ye=!0)},o(e){c(G.$$.fragment,e),c($.$$.fragment,e),c(x.$$.fragment,e),c(V.$$.fragment,e),c(E.$$.fragment,e),c(H.$$.fragment,e),c(N.$$.fragment,e),c(B.$$.fragment,e),c(L.$$.fragment,e),c(P.$$.fragment,e),c(S.$$.fragment,e),c(Y.$$.fragment,e),c(A.$$.fragment,e),c(te.$$.fragment,e),c(le.$$.fragment,e),c(se.$$.fragment,e),Ye=!1},d(e){e&&(l(ue),l(re),l(ce),l(fe),l(he),l(ye),l(C),l(we),l(T),l(be),l(W),l(Me),l(k),l(Te),l(_e),l(I),l(ge),l(Je),l(R),l(Ze),l(ve),l(_),l(Ue),l(z),l(je),l(g),l(Ge),l($e),l(q),l(xe),l(F),l(Ce),l(D),l(We),l(ke),l(J),l(Ve),l(Z),l(Ie),l(Ee),l(v),l(Re),l(Q),l(He),l(ze),l(U),l(Xe),l(Ne),l(O),l(Be),l(K),l(Le),l(ee),l(qe),l(Fe),l(j),l(De),l(Pe),l(ie),l(Se),l(Qe),l(me)),l(y),f(G,e),f($,e),f(x,e),f(V,e),f(E,e),f(H,e),f(N),f(B),f(L,e),f(P,e),f(S,e),f(Y,e),f(A,e),f(te,e),f(le,e),f(se,e)}}}const zt='{"title":"Community pipelines and components","local":"community-pipelines-and-components","sections":[{"title":"custom_pipeline","local":"custompipeline","sections":[],"depth":2},{"title":"Community components","local":"community-components","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2}],"depth":1}';function Xt(st){return Ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pt extends Wt{constructor(y){super(),kt(this,y,Xt,Ht,$t,{})}}export{Pt as component};

Xet Storage Details

Size:
25.5 kB
·
Xet hash:
dd567a2421bd3e616893a23aa207788dee56bd02502cd1f46e1657d496162590

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