Buckets:
hf-doc-build/doc / diffusers /main /en /_app /pages /using-diffusers /contribute_pipeline.mdx-hf-doc-builder.js
| import{S as zs,i as Ys,s as Os,e as s,k as c,w as M,t as i,M as Ls,c as a,d as l,m as d,a as n,x as J,h as o,b as f,G as t,g as p,y as T,q as _,o as b,B as v,v as qs}from"../../chunks/vendor-hf-doc-builder.js";import{T as Fs}from"../../chunks/Tip-hf-doc-builder.js";import{I as Nt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Y}from"../../chunks/CodeBlock-hf-doc-builder.js";function Ks(Be){let u,B,h,w,j;return{c(){u=s("p"),B=i("\u{1F4A1} Take a look at GitHub Issue "),h=s("a"),w=i("#841"),j=i(" for more context about why we\u2019re adding community pipelines to help everyone easily share their work without being slowed down."),this.h()},l(m){u=a(m,"P",{});var y=n(u);B=o(y,"\u{1F4A1} Take a look at GitHub Issue "),h=a(y,"A",{href:!0,rel:!0});var V=n(h);w=o(V,"#841"),V.forEach(l),j=o(y," for more context about why we\u2019re adding community pipelines to help everyone easily share their work without being slowed down."),y.forEach(l),this.h()},h(){f(h,"href","https://github.com/huggingface/diffusers/issues/841"),f(h,"rel","nofollow")},m(m,y){p(m,u,y),t(u,B),t(u,h),t(h,w),t(u,j)},d(m){m&&l(u)}}}function ea(Be){let u,B,h,w,j;return{c(){u=s("p"),B=i("\u{1F4A1} You can use whatever package you want in your community pipeline file - as long as the user has it installed, everything will work fine. Make sure you have one and only one pipeline class that inherits from "),h=s("code"),w=i("DiffusionPipeline"),j=i(" because this is automatically detected.")},l(m){u=a(m,"P",{});var y=n(u);B=o(y,"\u{1F4A1} You can use whatever package you want in your community pipeline file - as long as the user has it installed, everything will work fine. Make sure you have one and only one pipeline class that inherits from "),h=a(y,"CODE",{});var V=n(h);w=o(V,"DiffusionPipeline"),V.forEach(l),j=o(y," because this is automatically detected."),y.forEach(l)},m(m,y){p(m,u,y),t(u,B),t(u,h),t(h,w),t(u,j)},d(m){m&&l(u)}}}function ta(Be){let u,B,h,w,j,m,y,V,Vl,Wt,O,At,$,$l,Ge,gl,kl,Qe,Cl,Rl,Dt,L,Xl,Fe,Nl,Wl,Ht,A,q,ze,re,Al,Ye,Dl,St,Z,Hl,Oe,Sl,Pl,Ve,xl,Ql,Le,Fl,zl,qe,Yl,Ol,Pt,pe,xt,I,Ll,Ke,ql,Kl,et,ei,ti,$e,li,ii,tt,oi,si,Qt,ce,Ft,K,ai,lt,ni,ri,zt,D,ee,it,de,pi,ot,ci,Yt,E,di,st,fi,ui,at,hi,mi,nt,yi,wi,rt,Mi,Ji,Ot,fe,Lt,g,Ti,pt,_i,bi,ct,vi,Zi,qt,ue,Kt,te,Ii,he,dt,Ei,Ui,el,me,tl,H,le,ft,ye,ji,ut,Bi,ll,G,Gi,we,Vi,$i,ht,gi,ki,Me,Ci,Ri,il,k,Xi,mt,Ni,Wi,yt,Ai,Di,ol,Je,sl,U,Hi,wt,Si,Pi,Te,xi,Qi,Mt,Fi,zi,Jt,Yi,Oi,al,_e,nl,ge,Li,rl,ie,Tt,S,pl,qi,_t,Ki,eo,bt,to,lo,P,x,vt,io,oo,Zt,so,ao,It,no,ro,Q,Et,po,co,Ut,fo,uo,jt,ho,mo,F,Bt,yo,wo,Gt,Mo,Jo,Vt,To,cl,oe,dl,z,se,$t,be,_o,gt,bo,fl,ae,vo,ke,Zo,Io,ul,C,ve,Eo,kt,Uo,jo,Bo,Ze,Go,Ct,Vo,$o,go,Ie,ko,Rt,Co,Ro,hl,Ce,Xo,ml,Ee,yl,Re,No,wl,Ue,Ml;return m=new Nt({}),O=new Fs({props:{$$slots:{default:[Ks]},$$scope:{ctx:Be}}}),re=new Nt({}),pe=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEElMEFjbGFzcyUyMFVuZXRTY2hlZHVsZXJPbmVGb3J3YXJkUGlwZWxpbmUoRGlmZnVzaW9uUGlwZWxpbmUpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMHVuZXQlMkMlMjBzY2hlZHVsZXIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| <span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">class</span> <span class="hljs-title class_">UnetSchedulerOneForwardPipeline</span>(<span class="hljs-title class_ inherited__">DiffusionPipeline</span>): | |
| <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, unet, scheduler</span>): | |
| <span class="hljs-built_in">super</span>().__init__()`}}),ce=new Y({props:{code:"JTIwJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTIwJTIwaW1wb3J0JTIwdG9yY2glMEElMEElMjAlMjBjbGFzcyUyMFVuZXRTY2hlZHVsZXJPbmVGb3J3YXJkUGlwZWxpbmUoRGlmZnVzaW9uUGlwZWxpbmUpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMHVuZXQlMkMlMjBzY2hlZHVsZXIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5yZWdpc3Rlcl9tb2R1bGVzKHVuZXQlM0R1bmV0JTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKQ==",highlighted:` from diffusers import DiffusionPipeline | |
| import torch | |
| class UnetSchedulerOneForwardPipeline(DiffusionPipeline): | |
| def __init__(self, unet, scheduler): | |
| super().__init__() | |
| <span class="hljs-addition">+ self.register_modules(unet=unet, scheduler=scheduler)</span>`}}),de=new Nt({}),fe=new Y({props:{code:"JTIwJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTIwJTIwaW1wb3J0JTIwdG9yY2glMEElMEElMEElMjAlMjBjbGFzcyUyMFVuZXRTY2hlZHVsZXJPbmVGb3J3YXJkUGlwZWxpbmUoRGlmZnVzaW9uUGlwZWxpbmUpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMHVuZXQlMkMlMjBzY2hlZHVsZXIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3VwZXIoKS5fX2luaXRfXygpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5yZWdpc3Rlcl9tb2R1bGVzKHVuZXQlM0R1bmV0JTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKSUwQSUwQSUyQiUyMCUyMCUyMCUyMCUyMGRlZiUyMF9fY2FsbF9fKHNlbGYpJTNBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjB0b3JjaC5yYW5kbiglMEElMkIlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAoMSUyQyUyMHNlbGYudW5ldC5jb25maWcuaW5fY2hhbm5lbHMlMkMlMjBzZWxmLnVuZXQuY29uZmlnLnNhbXBsZV9zaXplJTJDJTIwc2VsZi51bmV0LmNvbmZpZy5zYW1wbGVfc2l6ZSklMkMlMEElMkIlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjApJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdGltZXN0ZXAlMjAlM0QlMjAxJTBBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9kZWxfb3V0cHV0JTIwJTNEJTIwc2VsZi51bmV0KGltYWdlJTJDJTIwdGltZXN0ZXApLnNhbXBsZSUwQSUyQiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNjaGVkdWxlcl9vdXRwdXQlMjAlM0QlMjBzZWxmLnNjaGVkdWxlci5zdGVwKG1vZGVsX291dHB1dCUyQyUyMHRpbWVzdGVwJTJDJTIwaW1hZ2UpLnByZXZfc2FtcGxlJTBBJTBBJTJCJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwc2NoZWR1bGVyX291dHB1dA==",highlighted:` from diffusers import DiffusionPipeline | |
| import torch | |
| class UnetSchedulerOneForwardPipeline(DiffusionPipeline): | |
| def __init__(self, unet, scheduler): | |
| super().__init__() | |
| self.register_modules(unet=unet, scheduler=scheduler) | |
| <span class="hljs-addition">+ def __call__(self):</span> | |
| <span class="hljs-addition">+ image = torch.randn(</span> | |
| <span class="hljs-addition">+ (1, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size),</span> | |
| <span class="hljs-addition">+ )</span> | |
| <span class="hljs-addition">+ timestep = 1</span> | |
| <span class="hljs-addition">+ model_output = self.unet(image, timestep).sample</span> | |
| <span class="hljs-addition">+ scheduler_output = self.scheduler.step(model_output, timestep, image).prev_sample</span> | |
| <span class="hljs-addition">+ return scheduler_output</span>`}}),ue=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEREUE1TY2hlZHVsZXIlMkMlMjBVTmV0MkRNb2RlbCUwQSUwQXNjaGVkdWxlciUyMCUzRCUyMEREUE1TY2hlZHVsZXIoKSUwQXVuZXQlMjAlM0QlMjBVTmV0MkRNb2RlbCgpJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBVbmV0U2NoZWR1bGVyT25lRm9yd2FyZFBpcGVsaW5lKHVuZXQlM0R1bmV0JTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKSUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGVsaW5lKCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDPMScheduler, UNet2DModel | |
| scheduler = DDPMScheduler() | |
| unet = UNet2DModel() | |
| pipeline = UnetSchedulerOneForwardPipeline(unet=unet, scheduler=scheduler) | |
| output = pipeline()`}}),me=new Y({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBVbmV0U2NoZWR1bGVyT25lRm9yd2FyZFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKSUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGVsaW5lKCk=",highlighted:`pipeline = UnetSchedulerOneForwardPipeline.from_pretrained(<span class="hljs-string">"google/ddpm-cifar10-32"</span>, use_safetensors=<span class="hljs-literal">True</span>) | |
| output = pipeline()`}}),ye=new Nt({}),Je=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMkMlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJvbmVfc3RlcF91bmV0JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSklMEFwaXBlKCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| pipe = DiffusionPipeline.from_pretrained( | |
| <span class="hljs-string">"google/ddpm-cifar10-32"</span>, custom_pipeline=<span class="hljs-string">"one_step_unet"</span>, use_safetensors=<span class="hljs-literal">True</span> | |
| ) | |
| pipe()`}}),_e=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyJTJDJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIyc3RldmhsaXUlMkZvbmVfc3RlcF91bmV0JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| <span class="hljs-string">"google/ddpm-cifar10-32"</span>, custom_pipeline=<span class="hljs-string">"stevhliu/one_step_unet"</span>, use_safetensors=<span class="hljs-literal">True</span> | |
| )`}}),oe=new Fs({props:{$$slots:{default:[ea]},$$scope:{ctx:Be}}}),be=new Nt({}),Ee=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBGZWF0dXJlRXh0cmFjdG9yJTJDJTIwQ0xJUE1vZGVsJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTBBY2xpcF9tb2RlbF9pZCUyMCUzRCUyMCUyMmxhaW9uJTJGQ0xJUC1WaVQtQi0zMi1sYWlvbjJCLXMzNEItYjc5SyUyMiUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwQ0xJUEZlYXR1cmVFeHRyYWN0b3IuZnJvbV9wcmV0cmFpbmVkKGNsaXBfbW9kZWxfaWQpJTBBY2xpcF9tb2RlbCUyMCUzRCUyMENMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoY2xpcF9tb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUwQSUyMCUyMCUyMCUyMGN1c3RvbV9waXBlbGluZSUzRCUyMmNsaXBfZ3VpZGVkX3N0YWJsZV9kaWZmdXNpb24lMjIlMkMlMEElMjAlMjAlMjAlMjBjbGlwX21vZGVsJTNEY2xpcF9tb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGZlYXR1cmVfZXh0cmFjdG9yJTNEZmVhdHVyZV9leHRyYWN0b3IlMkMlMEElMjAlMjAlMjAlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPFeatureExtractor, CLIPModel | |
| model_id = <span class="hljs-string">"CompVis/stable-diffusion-v1-4"</span> | |
| clip_model_id = <span class="hljs-string">"laion/CLIP-ViT-B-32-laion2B-s34B-b79K"</span> | |
| feature_extractor = CLIPFeatureExtractor.from_pretrained(clip_model_id) | |
| clip_model = CLIPModel.from_pretrained(clip_model_id, torch_dtype=torch.float16) | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| model_id, | |
| custom_pipeline=<span class="hljs-string">"clip_guided_stable_diffusion"</span>, | |
| clip_model=clip_model, | |
| feature_extractor=feature_extractor, | |
| scheduler=scheduler, | |
| torch_dtype=torch.float16, | |
| use_safetensors=<span class="hljs-literal">True</span>, | |
| )`}}),Ue=new Y({props:{code:"JTIzJTIwMi4lMjBMb2FkJTIwdGhlJTIwcGlwZWxpbmUlMjBjbGFzcyUyQyUyMGlmJTIwdXNpbmclMjBjdXN0b20lMjBtb2R1bGUlMjB0aGVuJTIwbG9hZCUyMGl0JTIwZnJvbSUyMHRoZSUyMGh1YiUwQSUyMyUyMGlmJTIwd2UlMjBsb2FkJTIwZnJvbSUyMGV4cGxpY2l0JTIwY2xhc3MlMkMlMjBsZXQncyUyMHVzZSUyMGl0JTBBaWYlMjBjdXN0b21fcGlwZWxpbmUlMjBpcyUyMG5vdCUyME5vbmUlM0ElMEElMjAlMjAlMjAlMjBwaXBlbGluZV9jbGFzcyUyMCUzRCUyMGdldF9jbGFzc19mcm9tX2R5bmFtaWNfbW9kdWxlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGN1c3RvbV9waXBlbGluZSUyQyUyMG1vZHVsZV9maWxlJTNEQ1VTVE9NX1BJUEVMSU5FX0ZJTEVfTkFNRSUyQyUyMGNhY2hlX2RpciUzRGN1c3RvbV9waXBlbGluZSUwQSUyMCUyMCUyMCUyMCklMEFlbGlmJTIwY2xzJTIwISUzRCUyMERpZmZ1c2lvblBpcGVsaW5lJTNBJTBBJTIwJTIwJTIwJTIwcGlwZWxpbmVfY2xhc3MlMjAlM0QlMjBjbHMlMEFlbHNlJTNBJTBBJTIwJTIwJTIwJTIwZGlmZnVzZXJzX21vZHVsZSUyMCUzRCUyMGltcG9ydGxpYi5pbXBvcnRfbW9kdWxlKGNscy5fX21vZHVsZV9fLnNwbGl0KCUyMi4lMjIpJTVCMCU1RCklMEElMjAlMjAlMjAlMjBwaXBlbGluZV9jbGFzcyUyMCUzRCUyMGdldGF0dHIoZGlmZnVzZXJzX21vZHVsZSUyQyUyMGNvbmZpZ19kaWN0JTVCJTIyX2NsYXNzX25hbWUlMjIlNUQp",highlighted:`<span class="hljs-comment"># 2. Load the pipeline class, if using custom module then load it from the hub</span> | |
| <span class="hljs-comment"># if we load from explicit class, let's use it</span> | |
| <span class="hljs-keyword">if</span> custom_pipeline <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>: | |
| pipeline_class = get_class_from_dynamic_module( | |
| custom_pipeline, module_file=CUSTOM_PIPELINE_FILE_NAME, cache_dir=custom_pipeline | |
| ) | |
| <span class="hljs-keyword">elif</span> cls != DiffusionPipeline: | |
| pipeline_class = cls | |
| <span class="hljs-keyword">else</span>: | |
| diffusers_module = importlib.import_module(cls.__module__.split(<span class="hljs-string">"."</span>)[<span class="hljs-number">0</span>]) | |
| pipeline_class = <span class="hljs-built_in">getattr</span>(diffusers_module, config_dict[<span class="hljs-string">"_class_name"</span>])`}}),{c(){u=s("meta"),B=c(),h=s("h1"),w=s("a"),j=s("span"),M(m.$$.fragment),y=c(),V=s("span"),Vl=i("How to contribute a community pipeline"),Wt=c(),M(O.$$.fragment),At=c(),$=s("p"),$l=i("Community pipelines allow you to add any additional features you\u2019d like on top of the "),Ge=s("a"),gl=i("DiffusionPipeline"),kl=i(". The main benefit of building on top of the "),Qe=s("code"),Cl=i("DiffusionPipeline"),Rl=i(" is anyone can load and use your pipeline by only adding one more argument, making it super easy for the community to access."),Dt=c(),L=s("p"),Xl=i("This guide will show you how to create a community pipeline and explain how they work. To keep things simple, you\u2019ll create a \u201Cone-step\u201D pipeline where the "),Fe=s("code"),Nl=i("UNet"),Wl=i(" does a single forward pass and calls the scheduler once."),Ht=c(),A=s("h2"),q=s("a"),ze=s("span"),M(re.$$.fragment),Al=c(),Ye=s("span"),Dl=i("Initialize the pipeline"),St=c(),Z=s("p"),Hl=i("You should start by creating a "),Oe=s("code"),Sl=i("one_step_unet.py"),Pl=i(" file for your community pipeline. In this file, create a pipeline class that inherits from the "),Ve=s("a"),xl=i("DiffusionPipeline"),Ql=i(" to be able to load model weights and the scheduler configuration from the Hub. The one-step pipeline needs a "),Le=s("code"),Fl=i("UNet"),zl=i(" and a scheduler, so you\u2019ll need to add these as arguments to the "),qe=s("code"),Yl=i("__init__"),Ol=i(" function:"),Pt=c(),M(pe.$$.fragment),xt=c(),I=s("p"),Ll=i("To ensure your pipeline and its components ("),Ke=s("code"),ql=i("unet"),Kl=i(" and "),et=s("code"),ei=i("scheduler"),ti=i(") can be saved with "),$e=s("a"),li=i("save_pretrained()"),ii=i(", add them to the "),tt=s("code"),oi=i("register_modules"),si=i(" function:"),Qt=c(),M(ce.$$.fragment),Ft=c(),K=s("p"),ai=i("Cool, the "),lt=s("code"),ni=i("__init__"),ri=i(" step is done and you can move to the forward pass now! \u{1F525}"),zt=c(),D=s("h2"),ee=s("a"),it=s("span"),M(de.$$.fragment),pi=c(),ot=s("span"),ci=i("Define the forward pass"),Yt=c(),E=s("p"),di=i("In the forward pass, which we recommend defining as "),st=s("code"),fi=i("__call__"),ui=i(", you have complete creative freedom to add whatever feature you\u2019d like. For our amazing one-step pipeline, create a random image and only call the "),at=s("code"),hi=i("unet"),mi=i(" and "),nt=s("code"),yi=i("scheduler"),wi=i(" once by setting "),rt=s("code"),Mi=i("timestep=1"),Ji=i(":"),Ot=c(),M(fe.$$.fragment),Lt=c(),g=s("p"),Ti=i("That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=s("code"),_i=i("unet"),bi=i(" and "),ct=s("code"),vi=i("scheduler"),Zi=i(" to it:"),qt=c(),M(ue.$$.fragment),Kt=c(),te=s("p"),Ii=i("But what\u2019s even better is you can load pre-existing weights into the pipeline if the pipeline structure is identical. For example, you can load the "),he=s("a"),dt=s("code"),Ei=i("google/ddpm-cifar10-32"),Ui=i(" weights into the one-step pipeline:"),el=c(),M(me.$$.fragment),tl=c(),H=s("h2"),le=s("a"),ft=s("span"),M(ye.$$.fragment),ji=c(),ut=s("span"),Bi=i("Share your pipeline"),ll=c(),G=s("p"),Gi=i("Open a Pull Request on the \u{1F9E8} Diffusers "),we=s("a"),Vi=i("repository"),$i=i(" to add your awesome pipeline in "),ht=s("code"),gi=i("one_step_unet.py"),ki=i(" to the "),Me=s("a"),Ci=i("examples/community"),Ri=i(" subfolder."),il=c(),k=s("p"),Xi=i("Once it is merged, anyone with "),mt=s("code"),Ni=i("diffusers >= 0.4.0"),Wi=i(" installed can use this pipeline magically \u{1FA84} by specifying it in the "),yt=s("code"),Ai=i("custom_pipeline"),Di=i(" argument:"),ol=c(),M(Je.$$.fragment),sl=c(),U=s("p"),Hi=i("Another way to share your community pipeline is to upload the "),wt=s("code"),Si=i("one_step_unet.py"),Pi=i(" file directly to your preferred "),Te=s("a"),xi=i("model repository"),Qi=i(" on the Hub. Instead of specifying the "),Mt=s("code"),Fi=i("one_step_unet.py"),zi=i(" file, pass the model repository id to the "),Jt=s("code"),Yi=i("custom_pipeline"),Oi=i(" argument:"),al=c(),M(_e.$$.fragment),nl=c(),ge=s("p"),Li=i("Take a look at the following table to compare the two sharing workflows to help you decide the best option for you:"),rl=c(),ie=s("table"),Tt=s("thead"),S=s("tr"),pl=s("th"),qi=c(),_t=s("th"),Ki=i("GitHub community pipeline"),eo=c(),bt=s("th"),to=i("HF Hub community pipeline"),lo=c(),P=s("tbody"),x=s("tr"),vt=s("td"),io=i("usage"),oo=c(),Zt=s("td"),so=i("same"),ao=c(),It=s("td"),no=i("same"),ro=c(),Q=s("tr"),Et=s("td"),po=i("review process"),co=c(),Ut=s("td"),fo=i("open a Pull Request on GitHub and undergo a review process from the Diffusers team before merging; may be slower"),uo=c(),jt=s("td"),ho=i("upload directly to a Hub repository without any review; this is the fastest workflow"),mo=c(),F=s("tr"),Bt=s("td"),yo=i("visibility"),wo=c(),Gt=s("td"),Mo=i("included in the official Diffusers repository and documentation"),Jo=c(),Vt=s("td"),To=i("included on your HF Hub profile and relies on your own usage/promotion to gain visibility"),cl=c(),M(oe.$$.fragment),dl=c(),z=s("h2"),se=s("a"),$t=s("span"),M(be.$$.fragment),_o=c(),gt=s("span"),bo=i("How do community pipelines work?"),fl=c(),ae=s("p"),vo=i("A community pipeline is a class that inherits from "),ke=s("a"),Zo=i("DiffusionPipeline"),Io=i(" which means:"),ul=c(),C=s("ul"),ve=s("li"),Eo=i("It can be loaded with the "),kt=s("code"),Uo=i("custom_pipeline"),jo=i(" argument."),Bo=c(),Ze=s("li"),Go=i("The model weights and scheduler configuration are loaded from "),Ct=s("code"),Vo=i("pretrained_model_name_or_path"),$o=i("."),go=c(),Ie=s("li"),ko=i("The code that implements a feature in the community pipeline is defined in a "),Rt=s("code"),Co=i("pipeline.py"),Ro=i(" file."),hl=c(),Ce=s("p"),Xo=i("Sometimes you can\u2019t load all the pipeline components weights from an official repository. In this case, the other components should be passed directly to the pipeline:"),ml=c(),M(Ee.$$.fragment),yl=c(),Re=s("p"),No=i("The magic behind community pipelines is contained in the following code. It allows the community pipeline to be loaded from GitHub or the Hub, and it\u2019ll be available to all \u{1F9E8} Diffusers packages."),wl=c(),M(Ue.$$.fragment),this.h()},l(e){const r=Ls('[data-svelte="svelte-1phssyn"]',document.head);u=a(r,"META",{name:!0,content:!0}),r.forEach(l),B=d(e),h=a(e,"H1",{class:!0});var je=n(h);w=a(je,"A",{id:!0,class:!0,href:!0});var Xt=n(w);j=a(Xt,"SPAN",{});var Wo=n(j);J(m.$$.fragment,Wo),Wo.forEach(l),Xt.forEach(l),y=d(je),V=a(je,"SPAN",{});var Ao=n(V);Vl=o(Ao,"How to contribute a community pipeline"),Ao.forEach(l),je.forEach(l),Wt=d(e),J(O.$$.fragment,e),At=d(e),$=a(e,"P",{});var Xe=n($);$l=o(Xe,"Community pipelines allow you to add any additional features you\u2019d like on top of the "),Ge=a(Xe,"A",{href:!0});var Do=n(Ge);gl=o(Do,"DiffusionPipeline"),Do.forEach(l),kl=o(Xe,". The main benefit of building on top of the "),Qe=a(Xe,"CODE",{});var Ho=n(Qe);Cl=o(Ho,"DiffusionPipeline"),Ho.forEach(l),Rl=o(Xe," is anyone can load and use your pipeline by only adding one more argument, making it super easy for the community to access."),Xe.forEach(l),Dt=d(e),L=a(e,"P",{});var Jl=n(L);Xl=o(Jl,"This guide will show you how to create a community pipeline and explain how they work. To keep things simple, you\u2019ll create a \u201Cone-step\u201D pipeline where the "),Fe=a(Jl,"CODE",{});var So=n(Fe);Nl=o(So,"UNet"),So.forEach(l),Wl=o(Jl," does a single forward pass and calls the scheduler once."),Jl.forEach(l),Ht=d(e),A=a(e,"H2",{class:!0});var Tl=n(A);q=a(Tl,"A",{id:!0,class:!0,href:!0});var Po=n(q);ze=a(Po,"SPAN",{});var xo=n(ze);J(re.$$.fragment,xo),xo.forEach(l),Po.forEach(l),Al=d(Tl),Ye=a(Tl,"SPAN",{});var Qo=n(Ye);Dl=o(Qo,"Initialize the pipeline"),Qo.forEach(l),Tl.forEach(l),St=d(e),Z=a(e,"P",{});var R=n(Z);Hl=o(R,"You should start by creating a "),Oe=a(R,"CODE",{});var Fo=n(Oe);Sl=o(Fo,"one_step_unet.py"),Fo.forEach(l),Pl=o(R," file for your community pipeline. In this file, create a pipeline class that inherits from the "),Ve=a(R,"A",{href:!0});var zo=n(Ve);xl=o(zo,"DiffusionPipeline"),zo.forEach(l),Ql=o(R," to be able to load model weights and the scheduler configuration from the Hub. The one-step pipeline needs a "),Le=a(R,"CODE",{});var Yo=n(Le);Fl=o(Yo,"UNet"),Yo.forEach(l),zl=o(R," and a scheduler, so you\u2019ll need to add these as arguments to the "),qe=a(R,"CODE",{});var Oo=n(qe);Yl=o(Oo,"__init__"),Oo.forEach(l),Ol=o(R," function:"),R.forEach(l),Pt=d(e),J(pe.$$.fragment,e),xt=d(e),I=a(e,"P",{});var X=n(I);Ll=o(X,"To ensure your pipeline and its components ("),Ke=a(X,"CODE",{});var Lo=n(Ke);ql=o(Lo,"unet"),Lo.forEach(l),Kl=o(X," and "),et=a(X,"CODE",{});var qo=n(et);ei=o(qo,"scheduler"),qo.forEach(l),ti=o(X,") can be saved with "),$e=a(X,"A",{href:!0});var Ko=n($e);li=o(Ko,"save_pretrained()"),Ko.forEach(l),ii=o(X,", add them to the "),tt=a(X,"CODE",{});var es=n(tt);oi=o(es,"register_modules"),es.forEach(l),si=o(X," function:"),X.forEach(l),Qt=d(e),J(ce.$$.fragment,e),Ft=d(e),K=a(e,"P",{});var _l=n(K);ai=o(_l,"Cool, the "),lt=a(_l,"CODE",{});var ts=n(lt);ni=o(ts,"__init__"),ts.forEach(l),ri=o(_l," step is done and you can move to the forward pass now! \u{1F525}"),_l.forEach(l),zt=d(e),D=a(e,"H2",{class:!0});var bl=n(D);ee=a(bl,"A",{id:!0,class:!0,href:!0});var ls=n(ee);it=a(ls,"SPAN",{});var is=n(it);J(de.$$.fragment,is),is.forEach(l),ls.forEach(l),pi=d(bl),ot=a(bl,"SPAN",{});var os=n(ot);ci=o(os,"Define the forward pass"),os.forEach(l),bl.forEach(l),Yt=d(e),E=a(e,"P",{});var N=n(E);di=o(N,"In the forward pass, which we recommend defining as "),st=a(N,"CODE",{});var ss=n(st);fi=o(ss,"__call__"),ss.forEach(l),ui=o(N,", you have complete creative freedom to add whatever feature you\u2019d like. For our amazing one-step pipeline, create a random image and only call the "),at=a(N,"CODE",{});var as=n(at);hi=o(as,"unet"),as.forEach(l),mi=o(N," and "),nt=a(N,"CODE",{});var ns=n(nt);yi=o(ns,"scheduler"),ns.forEach(l),wi=o(N," once by setting "),rt=a(N,"CODE",{});var rs=n(rt);Mi=o(rs,"timestep=1"),rs.forEach(l),Ji=o(N,":"),N.forEach(l),Ot=d(e),J(fe.$$.fragment,e),Lt=d(e),g=a(e,"P",{});var Ne=n(g);Ti=o(Ne,"That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=a(Ne,"CODE",{});var ps=n(pt);_i=o(ps,"unet"),ps.forEach(l),bi=o(Ne," and "),ct=a(Ne,"CODE",{});var cs=n(ct);vi=o(cs,"scheduler"),cs.forEach(l),Zi=o(Ne," to it:"),Ne.forEach(l),qt=d(e),J(ue.$$.fragment,e),Kt=d(e),te=a(e,"P",{});var vl=n(te);Ii=o(vl,"But what\u2019s even better is you can load pre-existing weights into the pipeline if the pipeline structure is identical. For example, you can load the "),he=a(vl,"A",{href:!0,rel:!0});var ds=n(he);dt=a(ds,"CODE",{});var fs=n(dt);Ei=o(fs,"google/ddpm-cifar10-32"),fs.forEach(l),ds.forEach(l),Ui=o(vl," weights into the one-step pipeline:"),vl.forEach(l),el=d(e),J(me.$$.fragment,e),tl=d(e),H=a(e,"H2",{class:!0});var Zl=n(H);le=a(Zl,"A",{id:!0,class:!0,href:!0});var us=n(le);ft=a(us,"SPAN",{});var hs=n(ft);J(ye.$$.fragment,hs),hs.forEach(l),us.forEach(l),ji=d(Zl),ut=a(Zl,"SPAN",{});var ms=n(ut);Bi=o(ms,"Share your pipeline"),ms.forEach(l),Zl.forEach(l),ll=d(e),G=a(e,"P",{});var ne=n(G);Gi=o(ne,"Open a Pull Request on the \u{1F9E8} Diffusers "),we=a(ne,"A",{href:!0,rel:!0});var ys=n(we);Vi=o(ys,"repository"),ys.forEach(l),$i=o(ne," to add your awesome pipeline in "),ht=a(ne,"CODE",{});var ws=n(ht);gi=o(ws,"one_step_unet.py"),ws.forEach(l),ki=o(ne," to the "),Me=a(ne,"A",{href:!0,rel:!0});var Ms=n(Me);Ci=o(Ms,"examples/community"),Ms.forEach(l),Ri=o(ne," subfolder."),ne.forEach(l),il=d(e),k=a(e,"P",{});var We=n(k);Xi=o(We,"Once it is merged, anyone with "),mt=a(We,"CODE",{});var Js=n(mt);Ni=o(Js,"diffusers >= 0.4.0"),Js.forEach(l),Wi=o(We," installed can use this pipeline magically \u{1FA84} by specifying it in the "),yt=a(We,"CODE",{});var Ts=n(yt);Ai=o(Ts,"custom_pipeline"),Ts.forEach(l),Di=o(We," argument:"),We.forEach(l),ol=d(e),J(Je.$$.fragment,e),sl=d(e),U=a(e,"P",{});var W=n(U);Hi=o(W,"Another way to share your community pipeline is to upload the "),wt=a(W,"CODE",{});var _s=n(wt);Si=o(_s,"one_step_unet.py"),_s.forEach(l),Pi=o(W," file directly to your preferred "),Te=a(W,"A",{href:!0,rel:!0});var bs=n(Te);xi=o(bs,"model repository"),bs.forEach(l),Qi=o(W," on the Hub. Instead of specifying the "),Mt=a(W,"CODE",{});var vs=n(Mt);Fi=o(vs,"one_step_unet.py"),vs.forEach(l),zi=o(W," file, pass the model repository id to the "),Jt=a(W,"CODE",{});var Zs=n(Jt);Yi=o(Zs,"custom_pipeline"),Zs.forEach(l),Oi=o(W," argument:"),W.forEach(l),al=d(e),J(_e.$$.fragment,e),nl=d(e),ge=a(e,"P",{});var Is=n(ge);Li=o(Is,"Take a look at the following table to compare the two sharing workflows to help you decide the best option for you:"),Is.forEach(l),rl=d(e),ie=a(e,"TABLE",{});var Il=n(ie);Tt=a(Il,"THEAD",{});var Es=n(Tt);S=a(Es,"TR",{});var Ae=n(S);pl=a(Ae,"TH",{}),n(pl).forEach(l),qi=d(Ae),_t=a(Ae,"TH",{});var Us=n(_t);Ki=o(Us,"GitHub community pipeline"),Us.forEach(l),eo=d(Ae),bt=a(Ae,"TH",{});var js=n(bt);to=o(js,"HF Hub community pipeline"),js.forEach(l),Ae.forEach(l),Es.forEach(l),lo=d(Il),P=a(Il,"TBODY",{});var De=n(P);x=a(De,"TR",{});var He=n(x);vt=a(He,"TD",{});var Bs=n(vt);io=o(Bs,"usage"),Bs.forEach(l),oo=d(He),Zt=a(He,"TD",{});var Gs=n(Zt);so=o(Gs,"same"),Gs.forEach(l),ao=d(He),It=a(He,"TD",{});var Vs=n(It);no=o(Vs,"same"),Vs.forEach(l),He.forEach(l),ro=d(De),Q=a(De,"TR",{});var Se=n(Q);Et=a(Se,"TD",{});var $s=n(Et);po=o($s,"review process"),$s.forEach(l),co=d(Se),Ut=a(Se,"TD",{});var gs=n(Ut);fo=o(gs,"open a Pull Request on GitHub and undergo a review process from the Diffusers team before merging; may be slower"),gs.forEach(l),uo=d(Se),jt=a(Se,"TD",{});var ks=n(jt);ho=o(ks,"upload directly to a Hub repository without any review; this is the fastest workflow"),ks.forEach(l),Se.forEach(l),mo=d(De),F=a(De,"TR",{});var Pe=n(F);Bt=a(Pe,"TD",{});var Cs=n(Bt);yo=o(Cs,"visibility"),Cs.forEach(l),wo=d(Pe),Gt=a(Pe,"TD",{});var Rs=n(Gt);Mo=o(Rs,"included in the official Diffusers repository and documentation"),Rs.forEach(l),Jo=d(Pe),Vt=a(Pe,"TD",{});var Xs=n(Vt);To=o(Xs,"included on your HF Hub profile and relies on your own usage/promotion to gain visibility"),Xs.forEach(l),Pe.forEach(l),De.forEach(l),Il.forEach(l),cl=d(e),J(oe.$$.fragment,e),dl=d(e),z=a(e,"H2",{class:!0});var El=n(z);se=a(El,"A",{id:!0,class:!0,href:!0});var Ns=n(se);$t=a(Ns,"SPAN",{});var Ws=n($t);J(be.$$.fragment,Ws),Ws.forEach(l),Ns.forEach(l),_o=d(El),gt=a(El,"SPAN",{});var As=n(gt);bo=o(As,"How do community pipelines work?"),As.forEach(l),El.forEach(l),fl=d(e),ae=a(e,"P",{});var Ul=n(ae);vo=o(Ul,"A community pipeline is a class that inherits from "),ke=a(Ul,"A",{href:!0});var Ds=n(ke);Zo=o(Ds,"DiffusionPipeline"),Ds.forEach(l),Io=o(Ul," which means:"),Ul.forEach(l),ul=d(e),C=a(e,"UL",{});var xe=n(C);ve=a(xe,"LI",{});var jl=n(ve);Eo=o(jl,"It can be loaded with the "),kt=a(jl,"CODE",{});var Hs=n(kt);Uo=o(Hs,"custom_pipeline"),Hs.forEach(l),jo=o(jl," argument."),jl.forEach(l),Bo=d(xe),Ze=a(xe,"LI",{});var Bl=n(Ze);Go=o(Bl,"The model weights and scheduler configuration are loaded from "),Ct=a(Bl,"CODE",{});var Ss=n(Ct);Vo=o(Ss,"pretrained_model_name_or_path"),Ss.forEach(l),$o=o(Bl,"."),Bl.forEach(l),go=d(xe),Ie=a(xe,"LI",{});var Gl=n(Ie);ko=o(Gl,"The code that implements a feature in the community pipeline is defined in a "),Rt=a(Gl,"CODE",{});var Ps=n(Rt);Co=o(Ps,"pipeline.py"),Ps.forEach(l),Ro=o(Gl," file."),Gl.forEach(l),xe.forEach(l),hl=d(e),Ce=a(e,"P",{});var xs=n(Ce);Xo=o(xs,"Sometimes you can\u2019t load all the pipeline components weights from an official repository. In this case, the other components should be passed directly to the pipeline:"),xs.forEach(l),ml=d(e),J(Ee.$$.fragment,e),yl=d(e),Re=a(e,"P",{});var Qs=n(Re);No=o(Qs,"The magic behind community pipelines is contained in the following code. It allows the community pipeline to be loaded from GitHub or the Hub, and it\u2019ll be available to all \u{1F9E8} Diffusers packages."),Qs.forEach(l),wl=d(e),J(Ue.$$.fragment,e),this.h()},h(){f(u,"name","hf:doc:metadata"),f(u,"content",JSON.stringify(la)),f(w,"id","how-to-contribute-a-community-pipeline"),f(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(w,"href","#how-to-contribute-a-community-pipeline"),f(h,"class","relative group"),f(Ge,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f(q,"id","initialize-the-pipeline"),f(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(q,"href","#initialize-the-pipeline"),f(A,"class","relative group"),f(Ve,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f($e,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained"),f(ee,"id","define-the-forward-pass"),f(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(ee,"href","#define-the-forward-pass"),f(D,"class","relative group"),f(he,"href","https://huggingface.co/google/ddpm-cifar10-32"),f(he,"rel","nofollow"),f(le,"id","share-your-pipeline"),f(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(le,"href","#share-your-pipeline"),f(H,"class","relative group"),f(we,"href","https://github.com/huggingface/diffusers"),f(we,"rel","nofollow"),f(Me,"href","https://github.com/huggingface/diffusers/tree/main/examples/community"),f(Me,"rel","nofollow"),f(Te,"href","https://huggingface.co/docs/hub/models-uploading"),f(Te,"rel","nofollow"),f(se,"id","how-do-community-pipelines-work"),f(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(se,"href","#how-do-community-pipelines-work"),f(z,"class","relative group"),f(ke,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline")},m(e,r){t(document.head,u),p(e,B,r),p(e,h,r),t(h,w),t(w,j),T(m,j,null),t(h,y),t(h,V),t(V,Vl),p(e,Wt,r),T(O,e,r),p(e,At,r),p(e,$,r),t($,$l),t($,Ge),t(Ge,gl),t($,kl),t($,Qe),t(Qe,Cl),t($,Rl),p(e,Dt,r),p(e,L,r),t(L,Xl),t(L,Fe),t(Fe,Nl),t(L,Wl),p(e,Ht,r),p(e,A,r),t(A,q),t(q,ze),T(re,ze,null),t(A,Al),t(A,Ye),t(Ye,Dl),p(e,St,r),p(e,Z,r),t(Z,Hl),t(Z,Oe),t(Oe,Sl),t(Z,Pl),t(Z,Ve),t(Ve,xl),t(Z,Ql),t(Z,Le),t(Le,Fl),t(Z,zl),t(Z,qe),t(qe,Yl),t(Z,Ol),p(e,Pt,r),T(pe,e,r),p(e,xt,r),p(e,I,r),t(I,Ll),t(I,Ke),t(Ke,ql),t(I,Kl),t(I,et),t(et,ei),t(I,ti),t(I,$e),t($e,li),t(I,ii),t(I,tt),t(tt,oi),t(I,si),p(e,Qt,r),T(ce,e,r),p(e,Ft,r),p(e,K,r),t(K,ai),t(K,lt),t(lt,ni),t(K,ri),p(e,zt,r),p(e,D,r),t(D,ee),t(ee,it),T(de,it,null),t(D,pi),t(D,ot),t(ot,ci),p(e,Yt,r),p(e,E,r),t(E,di),t(E,st),t(st,fi),t(E,ui),t(E,at),t(at,hi),t(E,mi),t(E,nt),t(nt,yi),t(E,wi),t(E,rt),t(rt,Mi),t(E,Ji),p(e,Ot,r),T(fe,e,r),p(e,Lt,r),p(e,g,r),t(g,Ti),t(g,pt),t(pt,_i),t(g,bi),t(g,ct),t(ct,vi),t(g,Zi),p(e,qt,r),T(ue,e,r),p(e,Kt,r),p(e,te,r),t(te,Ii),t(te,he),t(he,dt),t(dt,Ei),t(te,Ui),p(e,el,r),T(me,e,r),p(e,tl,r),p(e,H,r),t(H,le),t(le,ft),T(ye,ft,null),t(H,ji),t(H,ut),t(ut,Bi),p(e,ll,r),p(e,G,r),t(G,Gi),t(G,we),t(we,Vi),t(G,$i),t(G,ht),t(ht,gi),t(G,ki),t(G,Me),t(Me,Ci),t(G,Ri),p(e,il,r),p(e,k,r),t(k,Xi),t(k,mt),t(mt,Ni),t(k,Wi),t(k,yt),t(yt,Ai),t(k,Di),p(e,ol,r),T(Je,e,r),p(e,sl,r),p(e,U,r),t(U,Hi),t(U,wt),t(wt,Si),t(U,Pi),t(U,Te),t(Te,xi),t(U,Qi),t(U,Mt),t(Mt,Fi),t(U,zi),t(U,Jt),t(Jt,Yi),t(U,Oi),p(e,al,r),T(_e,e,r),p(e,nl,r),p(e,ge,r),t(ge,Li),p(e,rl,r),p(e,ie,r),t(ie,Tt),t(Tt,S),t(S,pl),t(S,qi),t(S,_t),t(_t,Ki),t(S,eo),t(S,bt),t(bt,to),t(ie,lo),t(ie,P),t(P,x),t(x,vt),t(vt,io),t(x,oo),t(x,Zt),t(Zt,so),t(x,ao),t(x,It),t(It,no),t(P,ro),t(P,Q),t(Q,Et),t(Et,po),t(Q,co),t(Q,Ut),t(Ut,fo),t(Q,uo),t(Q,jt),t(jt,ho),t(P,mo),t(P,F),t(F,Bt),t(Bt,yo),t(F,wo),t(F,Gt),t(Gt,Mo),t(F,Jo),t(F,Vt),t(Vt,To),p(e,cl,r),T(oe,e,r),p(e,dl,r),p(e,z,r),t(z,se),t(se,$t),T(be,$t,null),t(z,_o),t(z,gt),t(gt,bo),p(e,fl,r),p(e,ae,r),t(ae,vo),t(ae,ke),t(ke,Zo),t(ae,Io),p(e,ul,r),p(e,C,r),t(C,ve),t(ve,Eo),t(ve,kt),t(kt,Uo),t(ve,jo),t(C,Bo),t(C,Ze),t(Ze,Go),t(Ze,Ct),t(Ct,Vo),t(Ze,$o),t(C,go),t(C,Ie),t(Ie,ko),t(Ie,Rt),t(Rt,Co),t(Ie,Ro),p(e,hl,r),p(e,Ce,r),t(Ce,Xo),p(e,ml,r),T(Ee,e,r),p(e,yl,r),p(e,Re,r),t(Re,No),p(e,wl,r),T(Ue,e,r),Ml=!0},p(e,[r]){const je={};r&2&&(je.$$scope={dirty:r,ctx:e}),O.$set(je);const Xt={};r&2&&(Xt.$$scope={dirty:r,ctx:e}),oe.$set(Xt)},i(e){Ml||(_(m.$$.fragment,e),_(O.$$.fragment,e),_(re.$$.fragment,e),_(pe.$$.fragment,e),_(ce.$$.fragment,e),_(de.$$.fragment,e),_(fe.$$.fragment,e),_(ue.$$.fragment,e),_(me.$$.fragment,e),_(ye.$$.fragment,e),_(Je.$$.fragment,e),_(_e.$$.fragment,e),_(oe.$$.fragment,e),_(be.$$.fragment,e),_(Ee.$$.fragment,e),_(Ue.$$.fragment,e),Ml=!0)},o(e){b(m.$$.fragment,e),b(O.$$.fragment,e),b(re.$$.fragment,e),b(pe.$$.fragment,e),b(ce.$$.fragment,e),b(de.$$.fragment,e),b(fe.$$.fragment,e),b(ue.$$.fragment,e),b(me.$$.fragment,e),b(ye.$$.fragment,e),b(Je.$$.fragment,e),b(_e.$$.fragment,e),b(oe.$$.fragment,e),b(be.$$.fragment,e),b(Ee.$$.fragment,e),b(Ue.$$.fragment,e),Ml=!1},d(e){l(u),e&&l(B),e&&l(h),v(m),e&&l(Wt),v(O,e),e&&l(At),e&&l($),e&&l(Dt),e&&l(L),e&&l(Ht),e&&l(A),v(re),e&&l(St),e&&l(Z),e&&l(Pt),v(pe,e),e&&l(xt),e&&l(I),e&&l(Qt),v(ce,e),e&&l(Ft),e&&l(K),e&&l(zt),e&&l(D),v(de),e&&l(Yt),e&&l(E),e&&l(Ot),v(fe,e),e&&l(Lt),e&&l(g),e&&l(qt),v(ue,e),e&&l(Kt),e&&l(te),e&&l(el),v(me,e),e&&l(tl),e&&l(H),v(ye),e&&l(ll),e&&l(G),e&&l(il),e&&l(k),e&&l(ol),v(Je,e),e&&l(sl),e&&l(U),e&&l(al),v(_e,e),e&&l(nl),e&&l(ge),e&&l(rl),e&&l(ie),e&&l(cl),v(oe,e),e&&l(dl),e&&l(z),v(be),e&&l(fl),e&&l(ae),e&&l(ul),e&&l(C),e&&l(hl),e&&l(Ce),e&&l(ml),v(Ee,e),e&&l(yl),e&&l(Re),e&&l(wl),v(Ue,e)}}}const la={local:"how-to-contribute-a-community-pipeline",sections:[{local:"initialize-the-pipeline",title:"Initialize the pipeline"},{local:"define-the-forward-pass",title:"Define the forward pass"},{local:"share-your-pipeline",title:"Share your pipeline"},{local:"how-do-community-pipelines-work",title:"How do community pipelines work?"}],title:"How to contribute a community pipeline"};function ia(Be){return qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ra extends zs{constructor(u){super();Ys(this,u,ia,ta,Os,{})}}export{ra as default,la as metadata}; | |
Xet Storage Details
- Size:
- 36 kB
- Xet hash:
- f5d64294a691d8596667a8885cc4e5e07cf18cd017df283d343de6ab6d354108
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.