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 b,o as _,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 Wt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Y}from"../../chunks/CodeBlock-hf-doc-builder.js";function Ks(Ge){let u,G,h,w,j;return{c(){u=s("p"),G=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);G=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,G),t(u,h),t(h,w),t(u,j)},d(m){m&&l(u)}}}function ea(Ge){let u,G,h,w,j;return{c(){u=s("p"),G=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);G=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,G),t(u,h),t(h,w),t(u,j)},d(m){m&&l(u)}}}function ta(Ge){let u,G,h,w,j,m,y,V,Vl,Nt,O,At,$,$l,Be,gl,kl,Qe,Cl,Rl,Dt,L,Xl,Fe,Wl,Nl,Ht,A,q,ze,re,Al,Ye,Dl,Pt,Z,Hl,Oe,Pl,Sl,Ve,xl,Ql,Le,Fl,zl,qe,Yl,Ol,St,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,bi,_i,ct,vi,Zi,qt,ue,Kt,te,Ii,he,dt,Ei,Ui,el,me,tl,H,le,ft,ye,ji,ut,Gi,ll,B,Bi,we,Vi,$i,ht,gi,ki,Me,Ci,Ri,il,k,Xi,mt,Wi,Ni,yt,Ai,Di,ol,Je,sl,U,Hi,wt,Pi,Si,Te,xi,Qi,Mt,Fi,zi,Jt,Yi,Oi,al,be,nl,ge,Li,rl,ie,Tt,P,pl,qi,bt,Ki,eo,_t,to,lo,S,x,vt,io,oo,Zt,so,ao,It,no,ro,Q,Et,po,co,Ut,fo,uo,jt,ho,mo,F,Gt,yo,wo,Bt,Mo,Jo,Vt,To,cl,oe,dl,z,se,$t,_e,bo,gt,_o,fl,ae,vo,ke,Zo,Io,ul,C,ve,Eo,kt,Uo,jo,Go,Ze,Bo,Ct,Vo,$o,go,Ie,ko,Rt,Co,Ro,hl,Ce,Xo,ml,Ee,yl,Re,Wo,wl,Ue,Ml;return m=new Wt({}),O=new Fs({props:{$$slots:{default:[Ks]},$$scope:{ctx:Ge}}}),re=new Wt({}),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 Wt({}),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:"cGlwZWxpbmUlMjAlM0QlMjBVbmV0U2NoZWR1bGVyT25lRm9yd2FyZFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIpJTBBJTBBb3V0cHV0JTIwJTNEJTIwcGlwZWxpbmUoKQ==",highlighted:`pipeline = UnetSchedulerOneForwardPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>)

output = pipeline()`}}),ye=new Wt({}),Je=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMkMlMjBjdXN0b21fcGlwZWxpbmUlM0QlMjJvbmVfc3RlcF91bmV0JTIyKSUwQXBpcGUoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;one_step_unet&quot;</span>)
pipe()`}}),be=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZGRwbS1jaWZhcjEwLTMyJTIyJTJDJTIwY3VzdG9tX3BpcGVsaW5lJTNEJTIyc3RldmhsaXUlMkZvbmVfc3RlcF91bmV0JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;stevhliu/one_step_unet&quot;</span>)`}}),oe=new Fs({props:{$$slots:{default:[ea]},$$scope:{ctx:Ge}}}),_e=new Wt({}),Ee=new Y({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBGZWF0dXJlRXh0cmFjdG9yJTJDJTIwQ0xJUE1vZGVsJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTBBY2xpcF9tb2RlbF9pZCUyMCUzRCUyMCUyMmxhaW9uJTJGQ0xJUC1WaVQtQi0zMi1sYWlvbjJCLXMzNEItYjc5SyUyMiUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwQ0xJUEZlYXR1cmVFeHRyYWN0b3IuZnJvbV9wcmV0cmFpbmVkKGNsaXBfbW9kZWxfaWQpJTBBY2xpcF9tb2RlbCUyMCUzRCUyMENMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoY2xpcF9tb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUwQSUyMCUyMCUyMCUyMGN1c3RvbV9waXBlbGluZSUzRCUyMmNsaXBfZ3VpZGVkX3N0YWJsZV9kaWZmdXNpb24lMjIlMkMlMEElMjAlMjAlMjAlMjBjbGlwX21vZGVsJTNEY2xpcF9tb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGZlYXR1cmVfZXh0cmFjdG9yJTNEZmVhdHVyZV9leHRyYWN0b3IlMkMlMEElMjAlMjAlMjAlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEEp",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">&quot;CompVis/stable-diffusion-v1-4&quot;</span>
clip_model_id = <span class="hljs-string">&quot;laion/CLIP-ViT-B-32-laion2B-s34B-b79K&quot;</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">&quot;clip_guided_stable_diffusion&quot;</span>,
    clip_model=clip_model,
    feature_extractor=feature_extractor,
    scheduler=scheduler,
    torch_dtype=torch.float16,
)`}}),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&#x27;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">&quot;.&quot;</span>)[<span class="hljs-number">0</span>])
    pipeline_class = <span class="hljs-built_in">getattr</span>(diffusers_module, config_dict[<span class="hljs-string">&quot;_class_name&quot;</span>])`}}),{c(){u=s("meta"),G=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"),Nt=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 "),Be=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"),Wl=i("UNet"),Nl=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"),Pt=c(),Z=s("p"),Hl=i("You should start by creating a "),Oe=s("code"),Pl=i("one_step_unet.py"),Sl=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:"),St=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"),bi=i("unet"),_i=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"),Gi=i("Share your pipeline"),ll=c(),B=s("p"),Bi=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"),Wi=i("diffusers >= 0.4.0"),Ni=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"),Pi=i("one_step_unet.py"),Si=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(be.$$.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"),P=s("tr"),pl=s("th"),qi=c(),bt=s("th"),Ki=i("GitHub community pipeline"),eo=c(),_t=s("th"),to=i("HF Hub community pipeline"),lo=c(),S=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"),Gt=s("td"),yo=i("visibility"),wo=c(),Bt=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(_e.$$.fragment),bo=c(),gt=s("span"),_o=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."),Go=c(),Ze=s("li"),Bo=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"),Wo=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),G=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 No=n(j);J(m.$$.fragment,No),No.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),Nt=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 "),Be=a(Xe,"A",{href:!0});var Do=n(Be);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 Po=n(Fe);Wl=o(Po,"UNet"),Po.forEach(l),Nl=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 So=n(q);ze=a(So,"SPAN",{});var xo=n(ze);J(re.$$.fragment,xo),xo.forEach(l),So.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),Pt=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);Pl=o(Fo,"one_step_unet.py"),Fo.forEach(l),Sl=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),St=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 bl=n(K);ai=o(bl,"Cool, the "),lt=a(bl,"CODE",{});var ts=n(lt);ni=o(ts,"__init__"),ts.forEach(l),ri=o(bl," step is done and you can move to the forward pass now! \u{1F525}"),bl.forEach(l),zt=d(e),D=a(e,"H2",{class:!0});var _l=n(D);ee=a(_l,"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(_l),ot=a(_l,"SPAN",{});var os=n(ot);ci=o(os,"Define the forward pass"),os.forEach(l),_l.forEach(l),Yt=d(e),E=a(e,"P",{});var W=n(E);di=o(W,"In the forward pass, which we recommend defining as "),st=a(W,"CODE",{});var ss=n(st);fi=o(ss,"__call__"),ss.forEach(l),ui=o(W,", 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(W,"CODE",{});var as=n(at);hi=o(as,"unet"),as.forEach(l),mi=o(W," and "),nt=a(W,"CODE",{});var ns=n(nt);yi=o(ns,"scheduler"),ns.forEach(l),wi=o(W," once by setting "),rt=a(W,"CODE",{});var rs=n(rt);Mi=o(rs,"timestep=1"),rs.forEach(l),Ji=o(W,":"),W.forEach(l),Ot=d(e),J(fe.$$.fragment,e),Lt=d(e),g=a(e,"P",{});var We=n(g);Ti=o(We,"That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=a(We,"CODE",{});var ps=n(pt);bi=o(ps,"unet"),ps.forEach(l),_i=o(We," and "),ct=a(We,"CODE",{});var cs=n(ct);vi=o(cs,"scheduler"),cs.forEach(l),Zi=o(We," to it:"),We.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);Gi=o(ms,"Share your pipeline"),ms.forEach(l),Zl.forEach(l),ll=d(e),B=a(e,"P",{});var ne=n(B);Bi=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 Ne=n(k);Xi=o(Ne,"Once it is merged, anyone with "),mt=a(Ne,"CODE",{});var Js=n(mt);Wi=o(Js,"diffusers >= 0.4.0"),Js.forEach(l),Ni=o(Ne," installed can use this pipeline magically \u{1FA84} by specifying it in the "),yt=a(Ne,"CODE",{});var Ts=n(yt);Ai=o(Ts,"custom_pipeline"),Ts.forEach(l),Di=o(Ne," argument:"),Ne.forEach(l),ol=d(e),J(Je.$$.fragment,e),sl=d(e),U=a(e,"P",{});var N=n(U);Hi=o(N,"Another way to share your community pipeline is to upload the "),wt=a(N,"CODE",{});var bs=n(wt);Pi=o(bs,"one_step_unet.py"),bs.forEach(l),Si=o(N," file directly to your preferred "),Te=a(N,"A",{href:!0,rel:!0});var _s=n(Te);xi=o(_s,"model repository"),_s.forEach(l),Qi=o(N," on the Hub. Instead of specifying the "),Mt=a(N,"CODE",{});var vs=n(Mt);Fi=o(vs,"one_step_unet.py"),vs.forEach(l),zi=o(N," file, pass the model repository id to the "),Jt=a(N,"CODE",{});var Zs=n(Jt);Yi=o(Zs,"custom_pipeline"),Zs.forEach(l),Oi=o(N," argument:"),N.forEach(l),al=d(e),J(be.$$.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);P=a(Es,"TR",{});var Ae=n(P);pl=a(Ae,"TH",{}),n(pl).forEach(l),qi=d(Ae),bt=a(Ae,"TH",{});var Us=n(bt);Ki=o(Us,"GitHub community pipeline"),Us.forEach(l),eo=d(Ae),_t=a(Ae,"TH",{});var js=n(_t);to=o(js,"HF Hub community pipeline"),js.forEach(l),Ae.forEach(l),Es.forEach(l),lo=d(Il),S=a(Il,"TBODY",{});var De=n(S);x=a(De,"TR",{});var He=n(x);vt=a(He,"TD",{});var Gs=n(vt);io=o(Gs,"usage"),Gs.forEach(l),oo=d(He),Zt=a(He,"TD",{});var Bs=n(Zt);so=o(Bs,"same"),Bs.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 Pe=n(Q);Et=a(Pe,"TD",{});var $s=n(Et);po=o($s,"review process"),$s.forEach(l),co=d(Pe),Ut=a(Pe,"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(Pe),jt=a(Pe,"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),Pe.forEach(l),mo=d(De),F=a(De,"TR",{});var Se=n(F);Gt=a(Se,"TD",{});var Cs=n(Gt);yo=o(Cs,"visibility"),Cs.forEach(l),wo=d(Se),Bt=a(Se,"TD",{});var Rs=n(Bt);Mo=o(Rs,"included in the official Diffusers repository and documentation"),Rs.forEach(l),Jo=d(Se),Vt=a(Se,"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),Se.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 Ws=n(se);$t=a(Ws,"SPAN",{});var Ns=n($t);J(_e.$$.fragment,Ns),Ns.forEach(l),Ws.forEach(l),bo=d(El),gt=a(El,"SPAN",{});var As=n(gt);_o=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),Go=d(xe),Ze=a(xe,"LI",{});var Gl=n(Ze);Bo=o(Gl,"The model weights and scheduler configuration are loaded from "),Ct=a(Gl,"CODE",{});var Ps=n(Ct);Vo=o(Ps,"pretrained_model_name_or_path"),Ps.forEach(l),$o=o(Gl,"."),Gl.forEach(l),go=d(xe),Ie=a(xe,"LI",{});var Bl=n(Ie);ko=o(Bl,"The code that implements a feature in the community pipeline is defined in a "),Rt=a(Bl,"CODE",{});var Ss=n(Rt);Co=o(Ss,"pipeline.py"),Ss.forEach(l),Ro=o(Bl," file."),Bl.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);Wo=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(Be,"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,G,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,Nt,r),T(O,e,r),p(e,At,r),p(e,$,r),t($,$l),t($,Be),t(Be,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,Wl),t(L,Nl),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,Pt,r),p(e,Z,r),t(Z,Hl),t(Z,Oe),t(Oe,Pl),t(Z,Sl),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,St,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,bi),t(g,_i),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,Gi),p(e,ll,r),p(e,B,r),t(B,Bi),t(B,we),t(we,Vi),t(B,$i),t(B,ht),t(ht,gi),t(B,ki),t(B,Me),t(Me,Ci),t(B,Ri),p(e,il,r),p(e,k,r),t(k,Xi),t(k,mt),t(mt,Wi),t(k,Ni),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,Pi),t(U,Si),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(be,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,P),t(P,pl),t(P,qi),t(P,bt),t(bt,Ki),t(P,eo),t(P,_t),t(_t,to),t(ie,lo),t(ie,S),t(S,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(S,ro),t(S,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(S,mo),t(S,F),t(F,Gt),t(Gt,yo),t(F,wo),t(F,Bt),t(Bt,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(_e,$t,null),t(z,bo),t(z,gt),t(gt,_o),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,Go),t(C,Ze),t(Ze,Bo),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,Wo),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||(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(be.$$.fragment,e),b(oe.$$.fragment,e),b(_e.$$.fragment,e),b(Ee.$$.fragment,e),b(Ue.$$.fragment,e),Ml=!0)},o(e){_(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),_(be.$$.fragment,e),_(oe.$$.fragment,e),_(_e.$$.fragment,e),_(Ee.$$.fragment,e),_(Ue.$$.fragment,e),Ml=!1},d(e){l(u),e&&l(G),e&&l(h),v(m),e&&l(Nt),v(O,e),e&&l(At),e&&l($),e&&l(Dt),e&&l(L),e&&l(Ht),e&&l(A),v(re),e&&l(Pt),e&&l(Z),e&&l(St),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(B),e&&l(il),e&&l(k),e&&l(ol),v(Je,e),e&&l(sl),e&&l(U),e&&l(al),v(be,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(_e),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(Ge){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};
