import{S as zs,i as Ys,s as Os,e as s,k as c,w as M,t as o,M as Ls,c as a,d as l,m as d,a as n,x as J,h as i,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=o("\u{1F4A1} Take a look at GitHub Issue "),h=s("a"),w=o("#841"),j=o(" 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=i(y,"\u{1F4A1} Take a look at GitHub Issue "),h=a(y,"A",{href:!0,rel:!0});var V=n(h);w=i(V,"#841"),V.forEach(l),j=i(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=o("\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=o("DiffusionPipeline"),j=o(" because this is automatically detected.")},l(m){u=a(m,"P",{});var y=n(u);G=i(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=i(V,"DiffusionPipeline"),V.forEach(l),j=i(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,eo,to,$e,lo,oo,tt,io,so,Qt,ce,Ft,K,ao,lt,no,ro,zt,D,ee,ot,de,po,it,co,Yt,E,fo,st,uo,ho,at,mo,yo,nt,wo,Mo,rt,Jo,To,Ot,fe,Lt,g,bo,pt,_o,vo,ct,Zo,Io,qt,ue,Kt,te,Eo,he,dt,Uo,jo,el,me,tl,H,le,ft,ye,Go,ut,Bo,ll,B,Vo,we,$o,go,ht,ko,Co,Me,Ro,Xo,ol,k,Wo,mt,No,Ao,yt,Do,Ho,il,Je,sl,U,Po,wt,So,xo,Te,Qo,Fo,Mt,zo,Yo,Jt,Oo,Lo,al,be,nl,ge,qo,rl,oe,Tt,P,pl,Ko,bt,ei,ti,_t,li,oi,S,x,vt,ii,si,Zt,ai,ni,It,ri,pi,Q,Et,ci,di,Ut,fi,ui,jt,hi,mi,F,Gt,yi,wi,Bt,Mi,Ji,Vt,Ti,cl,ie,dl,z,se,$t,_e,bi,gt,_i,fl,ae,vi,ke,Zi,Ii,ul,C,ve,Ei,kt,Ui,ji,Gi,Ze,Bi,Ct,Vi,$i,gi,Ie,ki,Rt,Ci,Ri,hl,Ce,Xi,ml,Ee,yl,Re,Wi,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>)`}}),ie=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=o("How to contribute a community pipeline"),Nt=c(),M(O.$$.fragment),At=c(),$=s("p"),$l=o("Community pipelines allow you to add any additional features you\u2019d like on top of the "),Be=s("a"),gl=o("DiffusionPipeline"),kl=o(". The main benefit of building on top of the "),Qe=s("code"),Cl=o("DiffusionPipeline"),Rl=o(" 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=o("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=o("UNet"),Nl=o(" 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=o("Initialize the pipeline"),Pt=c(),Z=s("p"),Hl=o("You should start by creating a "),Oe=s("code"),Pl=o("one_step_unet.py"),Sl=o(" file for your community pipeline. In this file, create a pipeline class that inherits from the "),Ve=s("a"),xl=o("DiffusionPipeline"),Ql=o(" to be able to load model weights and the scheduler configuration from the Hub. The one-step pipeline needs a "),Le=s("code"),Fl=o("UNet"),zl=o(" and a scheduler, so you\u2019ll need to add these as arguments to the "),qe=s("code"),Yl=o("__init__"),Ol=o(" function:"),St=c(),M(pe.$$.fragment),xt=c(),I=s("p"),Ll=o("To ensure your pipeline and its components ("),Ke=s("code"),ql=o("unet"),Kl=o(" and "),et=s("code"),eo=o("scheduler"),to=o(") can be saved with "),$e=s("a"),lo=o("save_pretrained()"),oo=o(", add them to the "),tt=s("code"),io=o("register_modules"),so=o(" function:"),Qt=c(),M(ce.$$.fragment),Ft=c(),K=s("p"),ao=o("Cool, the "),lt=s("code"),no=o("__init__"),ro=o(" step is done and you can move to the forward pass now! \u{1F525}"),zt=c(),D=s("h2"),ee=s("a"),ot=s("span"),M(de.$$.fragment),po=c(),it=s("span"),co=o("Define the forward pass"),Yt=c(),E=s("p"),fo=o("In the forward pass, which we recommend defining as "),st=s("code"),uo=o("__call__"),ho=o(", 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"),mo=o("unet"),yo=o(" and "),nt=s("code"),wo=o("scheduler"),Mo=o(" once by setting "),rt=s("code"),Jo=o("timestep=1"),To=o(":"),Ot=c(),M(fe.$$.fragment),Lt=c(),g=s("p"),bo=o("That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=s("code"),_o=o("unet"),vo=o(" and "),ct=s("code"),Zo=o("scheduler"),Io=o(" to it:"),qt=c(),M(ue.$$.fragment),Kt=c(),te=s("p"),Eo=o("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"),Uo=o("google/ddpm-cifar10-32"),jo=o(" 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),Go=c(),ut=s("span"),Bo=o("Share your pipeline"),ll=c(),B=s("p"),Vo=o("Open a Pull Request on the \u{1F9E8} Diffusers "),we=s("a"),$o=o("repository"),go=o(" to add your awesome pipeline in "),ht=s("code"),ko=o("one_step_unet.py"),Co=o(" to the "),Me=s("a"),Ro=o("examples/community"),Xo=o(" subfolder."),ol=c(),k=s("p"),Wo=o("Once it is merged, anyone with "),mt=s("code"),No=o("diffusers >= 0.4.0"),Ao=o(" installed can use this pipeline magically \u{1FA84} by specifying it in the "),yt=s("code"),Do=o("custom_pipeline"),Ho=o(" argument:"),il=c(),M(Je.$$.fragment),sl=c(),U=s("p"),Po=o("Another way to share your community pipeline is to upload the "),wt=s("code"),So=o("one_step_unet.py"),xo=o(" file directly to your preferred "),Te=s("a"),Qo=o("model repository"),Fo=o(" on the Hub. Instead of specifying the "),Mt=s("code"),zo=o("one_step_unet.py"),Yo=o(" file, pass the model repository id to the "),Jt=s("code"),Oo=o("custom_pipeline"),Lo=o(" argument:"),al=c(),M(be.$$.fragment),nl=c(),ge=s("p"),qo=o("Take a look at the following table to compare the two sharing workflows to help you decide the best option for you:"),rl=c(),oe=s("table"),Tt=s("thead"),P=s("tr"),pl=s("th"),Ko=c(),bt=s("th"),ei=o("GitHub community pipeline"),ti=c(),_t=s("th"),li=o("HF Hub community pipeline"),oi=c(),S=s("tbody"),x=s("tr"),vt=s("td"),ii=o("usage"),si=c(),Zt=s("td"),ai=o("same"),ni=c(),It=s("td"),ri=o("same"),pi=c(),Q=s("tr"),Et=s("td"),ci=o("review process"),di=c(),Ut=s("td"),fi=o("open a Pull Request on GitHub and undergo a review process from the Diffusers team before merging; may be slower"),ui=c(),jt=s("td"),hi=o("upload directly to a Hub repository without any review; this is the fastest workflow"),mi=c(),F=s("tr"),Gt=s("td"),yi=o("visibility"),wi=c(),Bt=s("td"),Mi=o("included in the official Diffusers repository and documentation"),Ji=c(),Vt=s("td"),Ti=o("included on your HF Hub profile and relies on your own usage/promotion to gain visibility"),cl=c(),M(ie.$$.fragment),dl=c(),z=s("h2"),se=s("a"),$t=s("span"),M(_e.$$.fragment),bi=c(),gt=s("span"),_i=o("How do community pipelines work?"),fl=c(),ae=s("p"),vi=o("A community pipeline is a class that inherits from "),ke=s("a"),Zi=o("DiffusionPipeline"),Ii=o(" which means:"),ul=c(),C=s("ul"),ve=s("li"),Ei=o("It can be loaded with the "),kt=s("code"),Ui=o("custom_pipeline"),ji=o(" argument."),Gi=c(),Ze=s("li"),Bi=o("The model weights and scheduler configuration are loaded from "),Ct=s("code"),Vi=o("pretrained_model_name_or_path"),$i=o("."),gi=c(),Ie=s("li"),ki=o("The code that implements a feature in the community pipeline is defined in a "),Rt=s("code"),Ci=o("pipeline.py"),Ri=o(" file."),hl=c(),Ce=s("p"),Xi=o("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"),Wi=o("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 Ni=n(j);J(m.$$.fragment,Ni),Ni.forEach(l),Xt.forEach(l),y=d(je),V=a(je,"SPAN",{});var Ai=n(V);Vl=i(Ai,"How to contribute a community pipeline"),Ai.forEach(l),je.forEach(l),Nt=d(e),J(O.$$.fragment,e),At=d(e),$=a(e,"P",{});var Xe=n($);$l=i(Xe,"Community pipelines allow you to add any additional features you\u2019d like on top of the "),Be=a(Xe,"A",{href:!0});var Di=n(Be);gl=i(Di,"DiffusionPipeline"),Di.forEach(l),kl=i(Xe,". The main benefit of building on top of the "),Qe=a(Xe,"CODE",{});var Hi=n(Qe);Cl=i(Hi,"DiffusionPipeline"),Hi.forEach(l),Rl=i(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=i(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 Pi=n(Fe);Wl=i(Pi,"UNet"),Pi.forEach(l),Nl=i(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 Si=n(q);ze=a(Si,"SPAN",{});var xi=n(ze);J(re.$$.fragment,xi),xi.forEach(l),Si.forEach(l),Al=d(Tl),Ye=a(Tl,"SPAN",{});var Qi=n(Ye);Dl=i(Qi,"Initialize the pipeline"),Qi.forEach(l),Tl.forEach(l),Pt=d(e),Z=a(e,"P",{});var R=n(Z);Hl=i(R,"You should start by creating a "),Oe=a(R,"CODE",{});var Fi=n(Oe);Pl=i(Fi,"one_step_unet.py"),Fi.forEach(l),Sl=i(R," file for your community pipeline. In this file, create a pipeline class that inherits from the "),Ve=a(R,"A",{href:!0});var zi=n(Ve);xl=i(zi,"DiffusionPipeline"),zi.forEach(l),Ql=i(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 Yi=n(Le);Fl=i(Yi,"UNet"),Yi.forEach(l),zl=i(R," and a scheduler, so you\u2019ll need to add these as arguments to the "),qe=a(R,"CODE",{});var Oi=n(qe);Yl=i(Oi,"__init__"),Oi.forEach(l),Ol=i(R," function:"),R.forEach(l),St=d(e),J(pe.$$.fragment,e),xt=d(e),I=a(e,"P",{});var X=n(I);Ll=i(X,"To ensure your pipeline and its components ("),Ke=a(X,"CODE",{});var Li=n(Ke);ql=i(Li,"unet"),Li.forEach(l),Kl=i(X," and "),et=a(X,"CODE",{});var qi=n(et);eo=i(qi,"scheduler"),qi.forEach(l),to=i(X,") can be saved with "),$e=a(X,"A",{href:!0});var Ki=n($e);lo=i(Ki,"save_pretrained()"),Ki.forEach(l),oo=i(X,", add them to the "),tt=a(X,"CODE",{});var es=n(tt);io=i(es,"register_modules"),es.forEach(l),so=i(X," function:"),X.forEach(l),Qt=d(e),J(ce.$$.fragment,e),Ft=d(e),K=a(e,"P",{});var bl=n(K);ao=i(bl,"Cool, the "),lt=a(bl,"CODE",{});var ts=n(lt);no=i(ts,"__init__"),ts.forEach(l),ro=i(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);ot=a(ls,"SPAN",{});var os=n(ot);J(de.$$.fragment,os),os.forEach(l),ls.forEach(l),po=d(_l),it=a(_l,"SPAN",{});var is=n(it);co=i(is,"Define the forward pass"),is.forEach(l),_l.forEach(l),Yt=d(e),E=a(e,"P",{});var W=n(E);fo=i(W,"In the forward pass, which we recommend defining as "),st=a(W,"CODE",{});var ss=n(st);uo=i(ss,"__call__"),ss.forEach(l),ho=i(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);mo=i(as,"unet"),as.forEach(l),yo=i(W," and "),nt=a(W,"CODE",{});var ns=n(nt);wo=i(ns,"scheduler"),ns.forEach(l),Mo=i(W," once by setting "),rt=a(W,"CODE",{});var rs=n(rt);Jo=i(rs,"timestep=1"),rs.forEach(l),To=i(W,":"),W.forEach(l),Ot=d(e),J(fe.$$.fragment,e),Lt=d(e),g=a(e,"P",{});var We=n(g);bo=i(We,"That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=a(We,"CODE",{});var ps=n(pt);_o=i(ps,"unet"),ps.forEach(l),vo=i(We," and "),ct=a(We,"CODE",{});var cs=n(ct);Zo=i(cs,"scheduler"),cs.forEach(l),Io=i(We," to it:"),We.forEach(l),qt=d(e),J(ue.$$.fragment,e),Kt=d(e),te=a(e,"P",{});var vl=n(te);Eo=i(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);Uo=i(fs,"google/ddpm-cifar10-32"),fs.forEach(l),ds.forEach(l),jo=i(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),Go=d(Zl),ut=a(Zl,"SPAN",{});var ms=n(ut);Bo=i(ms,"Share your pipeline"),ms.forEach(l),Zl.forEach(l),ll=d(e),B=a(e,"P",{});var ne=n(B);Vo=i(ne,"Open a Pull Request on the \u{1F9E8} Diffusers "),we=a(ne,"A",{href:!0,rel:!0});var ys=n(we);$o=i(ys,"repository"),ys.forEach(l),go=i(ne," to add your awesome pipeline in "),ht=a(ne,"CODE",{});var ws=n(ht);ko=i(ws,"one_step_unet.py"),ws.forEach(l),Co=i(ne," to the "),Me=a(ne,"A",{href:!0,rel:!0});var Ms=n(Me);Ro=i(Ms,"examples/community"),Ms.forEach(l),Xo=i(ne," subfolder."),ne.forEach(l),ol=d(e),k=a(e,"P",{});var Ne=n(k);Wo=i(Ne,"Once it is merged, anyone with "),mt=a(Ne,"CODE",{});var Js=n(mt);No=i(Js,"diffusers >= 0.4.0"),Js.forEach(l),Ao=i(Ne," installed can use this pipeline magically \u{1FA84} by specifying it in the "),yt=a(Ne,"CODE",{});var Ts=n(yt);Do=i(Ts,"custom_pipeline"),Ts.forEach(l),Ho=i(Ne," argument:"),Ne.forEach(l),il=d(e),J(Je.$$.fragment,e),sl=d(e),U=a(e,"P",{});var N=n(U);Po=i(N,"Another way to share your community pipeline is to upload the "),wt=a(N,"CODE",{});var bs=n(wt);So=i(bs,"one_step_unet.py"),bs.forEach(l),xo=i(N," file directly to your preferred "),Te=a(N,"A",{href:!0,rel:!0});var _s=n(Te);Qo=i(_s,"model repository"),_s.forEach(l),Fo=i(N," on the Hub. Instead of specifying the "),Mt=a(N,"CODE",{});var vs=n(Mt);zo=i(vs,"one_step_unet.py"),vs.forEach(l),Yo=i(N," file, pass the model repository id to the "),Jt=a(N,"CODE",{});var Zs=n(Jt);Oo=i(Zs,"custom_pipeline"),Zs.forEach(l),Lo=i(N," argument:"),N.forEach(l),al=d(e),J(be.$$.fragment,e),nl=d(e),ge=a(e,"P",{});var Is=n(ge);qo=i(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),oe=a(e,"TABLE",{});var Il=n(oe);Tt=a(Il,"THEAD",{});var Es=n(Tt);P=a(Es,"TR",{});var Ae=n(P);pl=a(Ae,"TH",{}),n(pl).forEach(l),Ko=d(Ae),bt=a(Ae,"TH",{});var Us=n(bt);ei=i(Us,"GitHub community pipeline"),Us.forEach(l),ti=d(Ae),_t=a(Ae,"TH",{});var js=n(_t);li=i(js,"HF Hub community pipeline"),js.forEach(l),Ae.forEach(l),Es.forEach(l),oi=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);ii=i(Gs,"usage"),Gs.forEach(l),si=d(He),Zt=a(He,"TD",{});var Bs=n(Zt);ai=i(Bs,"same"),Bs.forEach(l),ni=d(He),It=a(He,"TD",{});var Vs=n(It);ri=i(Vs,"same"),Vs.forEach(l),He.forEach(l),pi=d(De),Q=a(De,"TR",{});var Pe=n(Q);Et=a(Pe,"TD",{});var $s=n(Et);ci=i($s,"review process"),$s.forEach(l),di=d(Pe),Ut=a(Pe,"TD",{});var gs=n(Ut);fi=i(gs,"open a Pull Request on GitHub and undergo a review process from the Diffusers team before merging; may be slower"),gs.forEach(l),ui=d(Pe),jt=a(Pe,"TD",{});var ks=n(jt);hi=i(ks,"upload directly to a Hub repository without any review; this is the fastest workflow"),ks.forEach(l),Pe.forEach(l),mi=d(De),F=a(De,"TR",{});var Se=n(F);Gt=a(Se,"TD",{});var Cs=n(Gt);yi=i(Cs,"visibility"),Cs.forEach(l),wi=d(Se),Bt=a(Se,"TD",{});var Rs=n(Bt);Mi=i(Rs,"included in the official Diffusers repository and documentation"),Rs.forEach(l),Ji=d(Se),Vt=a(Se,"TD",{});var Xs=n(Vt);Ti=i(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(ie.$$.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),bi=d(El),gt=a(El,"SPAN",{});var As=n(gt);_i=i(As,"How do community pipelines work?"),As.forEach(l),El.forEach(l),fl=d(e),ae=a(e,"P",{});var Ul=n(ae);vi=i(Ul,"A community pipeline is a class that inherits from "),ke=a(Ul,"A",{href:!0});var Ds=n(ke);Zi=i(Ds,"DiffusionPipeline"),Ds.forEach(l),Ii=i(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);Ei=i(jl,"It can be loaded with the "),kt=a(jl,"CODE",{});var Hs=n(kt);Ui=i(Hs,"custom_pipeline"),Hs.forEach(l),ji=i(jl," argument."),jl.forEach(l),Gi=d(xe),Ze=a(xe,"LI",{});var Gl=n(Ze);Bi=i(Gl,"The model weights and scheduler configuration are loaded from "),Ct=a(Gl,"CODE",{});var Ps=n(Ct);Vi=i(Ps,"pretrained_model_name_or_path"),Ps.forEach(l),$i=i(Gl,"."),Gl.forEach(l),gi=d(xe),Ie=a(xe,"LI",{});var Bl=n(Ie);ki=i(Bl,"The code that implements a feature in the community pipeline is defined in a "),Rt=a(Bl,"CODE",{});var Ss=n(Rt);Ci=i(Ss,"pipeline.py"),Ss.forEach(l),Ri=i(Bl," file."),Bl.forEach(l),xe.forEach(l),hl=d(e),Ce=a(e,"P",{});var xs=n(Ce);Xi=i(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);Wi=i(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/v0.19.2/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/v0.19.2/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f($e,"href","/docs/diffusers/v0.19.2/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/v0.19.2/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,eo),t(I,to),t(I,$e),t($e,lo),t(I,oo),t(I,tt),t(tt,io),t(I,so),p(e,Qt,r),T(ce,e,r),p(e,Ft,r),p(e,K,r),t(K,ao),t(K,lt),t(lt,no),t(K,ro),p(e,zt,r),p(e,D,r),t(D,ee),t(ee,ot),T(de,ot,null),t(D,po),t(D,it),t(it,co),p(e,Yt,r),p(e,E,r),t(E,fo),t(E,st),t(st,uo),t(E,ho),t(E,at),t(at,mo),t(E,yo),t(E,nt),t(nt,wo),t(E,Mo),t(E,rt),t(rt,Jo),t(E,To),p(e,Ot,r),T(fe,e,r),p(e,Lt,r),p(e,g,r),t(g,bo),t(g,pt),t(pt,_o),t(g,vo),t(g,ct),t(ct,Zo),t(g,Io),p(e,qt,r),T(ue,e,r),p(e,Kt,r),p(e,te,r),t(te,Eo),t(te,he),t(he,dt),t(dt,Uo),t(te,jo),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,Go),t(H,ut),t(ut,Bo),p(e,ll,r),p(e,B,r),t(B,Vo),t(B,we),t(we,$o),t(B,go),t(B,ht),t(ht,ko),t(B,Co),t(B,Me),t(Me,Ro),t(B,Xo),p(e,ol,r),p(e,k,r),t(k,Wo),t(k,mt),t(mt,No),t(k,Ao),t(k,yt),t(yt,Do),t(k,Ho),p(e,il,r),T(Je,e,r),p(e,sl,r),p(e,U,r),t(U,Po),t(U,wt),t(wt,So),t(U,xo),t(U,Te),t(Te,Qo),t(U,Fo),t(U,Mt),t(Mt,zo),t(U,Yo),t(U,Jt),t(Jt,Oo),t(U,Lo),p(e,al,r),T(be,e,r),p(e,nl,r),p(e,ge,r),t(ge,qo),p(e,rl,r),p(e,oe,r),t(oe,Tt),t(Tt,P),t(P,pl),t(P,Ko),t(P,bt),t(bt,ei),t(P,ti),t(P,_t),t(_t,li),t(oe,oi),t(oe,S),t(S,x),t(x,vt),t(vt,ii),t(x,si),t(x,Zt),t(Zt,ai),t(x,ni),t(x,It),t(It,ri),t(S,pi),t(S,Q),t(Q,Et),t(Et,ci),t(Q,di),t(Q,Ut),t(Ut,fi),t(Q,ui),t(Q,jt),t(jt,hi),t(S,mi),t(S,F),t(F,Gt),t(Gt,yi),t(F,wi),t(F,Bt),t(Bt,Mi),t(F,Ji),t(F,Vt),t(Vt,Ti),p(e,cl,r),T(ie,e,r),p(e,dl,r),p(e,z,r),t(z,se),t(se,$t),T(_e,$t,null),t(z,bi),t(z,gt),t(gt,_i),p(e,fl,r),p(e,ae,r),t(ae,vi),t(ae,ke),t(ke,Zi),t(ae,Ii),p(e,ul,r),p(e,C,r),t(C,ve),t(ve,Ei),t(ve,kt),t(kt,Ui),t(ve,ji),t(C,Gi),t(C,Ze),t(Ze,Bi),t(Ze,Ct),t(Ct,Vi),t(Ze,$i),t(C,gi),t(C,Ie),t(Ie,ki),t(Ie,Rt),t(Rt,Ci),t(Ie,Ri),p(e,hl,r),p(e,Ce,r),t(Ce,Xi),p(e,ml,r),T(Ee,e,r),p(e,yl,r),p(e,Re,r),t(Re,Wi),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}),ie.$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(ie.$$.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),_(ie.$$.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(ol),e&&l(k),e&&l(il),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(oe),e&&l(cl),v(ie,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 oa(Ge){return qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ra extends zs{constructor(u){super();Ys(this,u,oa,ta,Os,{})}}export{ra as default,la as metadata};
