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 _,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=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);B=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,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=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);B=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,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,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,_o,pt,bo,vo,ct,Zo,Io,qt,ue,Kt,te,Eo,he,dt,Uo,jo,el,me,tl,H,le,ft,ye,Bo,ut,Go,ll,G,Vo,we,$o,go,ht,ko,Co,Me,Ro,Xo,ol,k,No,mt,Wo,Ao,yt,Do,Ho,il,Je,sl,U,So,wt,Po,xo,Te,Qo,Fo,Mt,zo,Yo,Jt,Oo,Lo,al,_e,nl,ge,qo,rl,oe,Tt,S,pl,Ko,_t,ei,ti,bt,li,oi,P,x,vt,ii,si,Zt,ai,ni,It,ri,pi,Q,Et,ci,di,Ut,fi,ui,jt,hi,mi,F,Bt,yi,wi,Gt,Mi,Ji,Vt,Ti,cl,ie,dl,z,se,$t,be,_i,gt,bi,fl,ae,vi,ke,Zi,Ii,ul,C,ve,Ei,kt,Ui,ji,Bi,Ze,Gi,Ct,Vi,$i,gi,Ie,ki,Rt,Ci,Ri,hl,Ce,Xi,ml,Ee,yl,Re,Ni,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">&quot;google/ddpm-cifar10-32&quot;</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">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;one_step_unet&quot;</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">&quot;google/ddpm-cifar10-32&quot;</span>, custom_pipeline=<span class="hljs-string">&quot;stevhliu/one_step_unet&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)`}}),ie=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">&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,
    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&#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"),B=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"),Wt=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 "),Ge=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"),Nl=o("UNet"),Wl=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"),St=c(),Z=s("p"),Hl=o("You should start by creating a "),Oe=s("code"),Sl=o("one_step_unet.py"),Pl=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:"),Pt=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"),_o=o("That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=s("code"),bo=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),Bo=c(),ut=s("span"),Go=o("Share your pipeline"),ll=c(),G=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"),No=o("Once it is merged, anyone with "),mt=s("code"),Wo=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"),So=o("Another way to share your community pipeline is to upload the "),wt=s("code"),Po=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(_e.$$.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"),S=s("tr"),pl=s("th"),Ko=c(),_t=s("th"),ei=o("GitHub community pipeline"),ti=c(),bt=s("th"),li=o("HF Hub community pipeline"),oi=c(),P=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"),Bt=s("td"),yi=o("visibility"),wi=c(),Gt=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(be.$$.fragment),_i=c(),gt=s("span"),bi=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."),Bi=c(),Ze=s("li"),Gi=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"),Ni=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),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 Wi=n(j);J(m.$$.fragment,Wi),Wi.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),Wt=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 "),Ge=a(Xe,"A",{href:!0});var Di=n(Ge);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 Si=n(Fe);Nl=i(Si,"UNet"),Si.forEach(l),Wl=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 Pi=n(q);ze=a(Pi,"SPAN",{});var xi=n(ze);J(re.$$.fragment,xi),xi.forEach(l),Pi.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),St=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);Sl=i(Fi,"one_step_unet.py"),Fi.forEach(l),Pl=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),Pt=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 _l=n(K);ao=i(_l,"Cool, the "),lt=a(_l,"CODE",{});var ts=n(lt);no=i(ts,"__init__"),ts.forEach(l),ro=i(_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);ot=a(ls,"SPAN",{});var os=n(ot);J(de.$$.fragment,os),os.forEach(l),ls.forEach(l),po=d(bl),it=a(bl,"SPAN",{});var is=n(it);co=i(is,"Define the forward pass"),is.forEach(l),bl.forEach(l),Yt=d(e),E=a(e,"P",{});var N=n(E);fo=i(N,"In the forward pass, which we recommend defining as "),st=a(N,"CODE",{});var ss=n(st);uo=i(ss,"__call__"),ss.forEach(l),ho=i(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);mo=i(as,"unet"),as.forEach(l),yo=i(N," and "),nt=a(N,"CODE",{});var ns=n(nt);wo=i(ns,"scheduler"),ns.forEach(l),Mo=i(N," once by setting "),rt=a(N,"CODE",{});var rs=n(rt);Jo=i(rs,"timestep=1"),rs.forEach(l),To=i(N,":"),N.forEach(l),Ot=d(e),J(fe.$$.fragment,e),Lt=d(e),g=a(e,"P",{});var Ne=n(g);_o=i(Ne,"That\u2019s it! \u{1F680} You can now run this pipeline by passing a "),pt=a(Ne,"CODE",{});var ps=n(pt);bo=i(ps,"unet"),ps.forEach(l),vo=i(Ne," and "),ct=a(Ne,"CODE",{});var cs=n(ct);Zo=i(cs,"scheduler"),cs.forEach(l),Io=i(Ne," to it:"),Ne.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),Bo=d(Zl),ut=a(Zl,"SPAN",{});var ms=n(ut);Go=i(ms,"Share your pipeline"),ms.forEach(l),Zl.forEach(l),ll=d(e),G=a(e,"P",{});var ne=n(G);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 We=n(k);No=i(We,"Once it is merged, anyone with "),mt=a(We,"CODE",{});var Js=n(mt);Wo=i(Js,"diffusers >= 0.4.0"),Js.forEach(l),Ao=i(We," installed can use this pipeline magically \u{1FA84} by specifying it in the "),yt=a(We,"CODE",{});var Ts=n(yt);Do=i(Ts,"custom_pipeline"),Ts.forEach(l),Ho=i(We," argument:"),We.forEach(l),il=d(e),J(Je.$$.fragment,e),sl=d(e),U=a(e,"P",{});var W=n(U);So=i(W,"Another way to share your community pipeline is to upload the "),wt=a(W,"CODE",{});var _s=n(wt);Po=i(_s,"one_step_unet.py"),_s.forEach(l),xo=i(W," file directly to your preferred "),Te=a(W,"A",{href:!0,rel:!0});var bs=n(Te);Qo=i(bs,"model repository"),bs.forEach(l),Fo=i(W," on the Hub. Instead of specifying the "),Mt=a(W,"CODE",{});var vs=n(Mt);zo=i(vs,"one_step_unet.py"),vs.forEach(l),Yo=i(W," file, pass the model repository id to the "),Jt=a(W,"CODE",{});var Zs=n(Jt);Oo=i(Zs,"custom_pipeline"),Zs.forEach(l),Lo=i(W," argument:"),W.forEach(l),al=d(e),J(_e.$$.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);S=a(Es,"TR",{});var Ae=n(S);pl=a(Ae,"TH",{}),n(pl).forEach(l),Ko=d(Ae),_t=a(Ae,"TH",{});var Us=n(_t);ei=i(Us,"GitHub community pipeline"),Us.forEach(l),ti=d(Ae),bt=a(Ae,"TH",{});var js=n(bt);li=i(js,"HF Hub community pipeline"),js.forEach(l),Ae.forEach(l),Es.forEach(l),oi=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);ii=i(Bs,"usage"),Bs.forEach(l),si=d(He),Zt=a(He,"TD",{});var Gs=n(Zt);ai=i(Gs,"same"),Gs.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 Se=n(Q);Et=a(Se,"TD",{});var $s=n(Et);ci=i($s,"review process"),$s.forEach(l),di=d(Se),Ut=a(Se,"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(Se),jt=a(Se,"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),Se.forEach(l),mi=d(De),F=a(De,"TR",{});var Pe=n(F);Bt=a(Pe,"TD",{});var Cs=n(Bt);yi=i(Cs,"visibility"),Cs.forEach(l),wi=d(Pe),Gt=a(Pe,"TD",{});var Rs=n(Gt);Mi=i(Rs,"included in the official Diffusers repository and documentation"),Rs.forEach(l),Ji=d(Pe),Vt=a(Pe,"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),Pe.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 Ns=n(se);$t=a(Ns,"SPAN",{});var Ws=n($t);J(be.$$.fragment,Ws),Ws.forEach(l),Ns.forEach(l),_i=d(El),gt=a(El,"SPAN",{});var As=n(gt);bi=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),Bi=d(xe),Ze=a(xe,"LI",{});var Bl=n(Ze);Gi=i(Bl,"The model weights and scheduler configuration are loaded from "),Ct=a(Bl,"CODE",{});var Ss=n(Ct);Vi=i(Ss,"pretrained_model_name_or_path"),Ss.forEach(l),$i=i(Bl,"."),Bl.forEach(l),gi=d(xe),Ie=a(xe,"LI",{});var Gl=n(Ie);ki=i(Gl,"The code that implements a feature in the community pipeline is defined in a "),Rt=a(Gl,"CODE",{});var Ps=n(Rt);Ci=i(Ps,"pipeline.py"),Ps.forEach(l),Ri=i(Gl," file."),Gl.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);Ni=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(Ge,"href","/docs/diffusers/v0.20.0/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.20.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f($e,"href","/docs/diffusers/v0.20.0/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.20.0/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,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,_o),t(g,pt),t(pt,bo),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,Bo),t(H,ut),t(ut,Go),p(e,ll,r),p(e,G,r),t(G,Vo),t(G,we),t(we,$o),t(G,go),t(G,ht),t(ht,ko),t(G,Co),t(G,Me),t(Me,Ro),t(G,Xo),p(e,ol,r),p(e,k,r),t(k,No),t(k,mt),t(mt,Wo),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,So),t(U,wt),t(wt,Po),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(_e,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,S),t(S,pl),t(S,Ko),t(S,_t),t(_t,ei),t(S,ti),t(S,bt),t(bt,li),t(oe,oi),t(oe,P),t(P,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(P,pi),t(P,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(P,mi),t(P,F),t(F,Bt),t(Bt,yi),t(F,wi),t(F,Gt),t(Gt,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(be,$t,null),t(z,_i),t(z,gt),t(gt,bi),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,Bi),t(C,Ze),t(Ze,Gi),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,Ni),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||(_(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),_(ie.$$.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(ie.$$.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(ol),e&&l(k),e&&l(il),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(oe),e&&l(cl),v(ie,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 oa(Be){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};
