import{s as ws,o as Js,n as es}from"../chunks/scheduler.8c3d61f6.js";import{S as ms,i as js,g as w,s as i,r as m,A as Ts,h as J,f as n,c as o,j as ys,u as j,x as b,k as rs,y as Us,a as M,v as T,d as U,t as u,w as d}from"../chunks/index.da70eac4.js";import{C as S}from"../chunks/CodeBlock.a9c4becf.js";import{H as us,E as ds}from"../chunks/getInferenceSnippets.28ca3596.js";import{H as Is,a as ls}from"../chunks/HfOption.6c3b4e77.js";function hs(I){let e,p;return e=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzLm1vZHVsYXJfcGlwZWxpbmVzJTIwaW1wb3J0JTIwTW9kdWxhclBpcGVsaW5lQmxvY2tzJTJDJTIwSW5wdXRQYXJhbSUyQyUyME91dHB1dFBhcmFtJTBBJTBBY2xhc3MlMjBUZXh0VG9JbWFnZUJsb2NrKE1vZHVsYXJQaXBlbGluZUJsb2NrcyklM0ElMEElMjAlMjAlMjAlMjBtb2RlbF9uYW1lJTIwJTNEJTIwJTIydGV4dDJpbWclMjIlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGlucHV0cyhzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCU1QklucHV0UGFyYW0obmFtZSUzRCUyMnByb21wdCUyMiklNUQlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGludGVybWVkaWF0ZV9vdXRwdXRzKHNlbGYpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTVCJTVEJTBBJTBBJTIwJTIwJTIwJTIwJTQwcHJvcGVydHklMEElMjAlMjAlMjAlMjBkZWYlMjBkZXNjcmlwdGlvbihzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCUyMkknbSUyMGElMjB0ZXh0LXRvLWltYWdlJTIwd29ya2Zsb3chJTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19jYWxsX18oc2VsZiUyQyUyMGNvbXBvbmVudHMlMkMlMjBzdGF0ZSklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBibG9ja19zdGF0ZSUyMCUzRCUyMHNlbGYuZ2V0X2Jsb2NrX3N0YXRlKHN0YXRlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByaW50KCUyMnJ1bm5pbmclMjB0aGUlMjB0ZXh0LXRvLWltYWdlJTIwd29ya2Zsb3clMjIpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwQWRkJTIweW91ciUyMHRleHQtdG8taW1hZ2UlMjBsb2dpYyUyMGhlcmUlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBGb3IlMjBleGFtcGxlJTNBJTIwZ2VuZXJhdGUlMjBpbWFnZSUyMGZyb20lMjBwcm9tcHQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLnNldF9ibG9ja19zdGF0ZShzdGF0ZSUyQyUyMGJsb2NrX3N0YXRlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGNvbXBvbmVudHMlMkMlMjBzdGF0ZQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers.modular_pipelines <span class="hljs-keyword">import</span> ModularPipelineBlocks, InputParam, OutputParam

<span class="hljs-keyword">class</span> <span class="hljs-title class_">TextToImageBlock</span>(<span class="hljs-title class_ inherited__">ModularPipelineBlocks</span>):
    model_name = <span class="hljs-string">&quot;text2img&quot;</span>

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> [InputParam(name=<span class="hljs-string">&quot;prompt&quot;</span>)]

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">intermediate_outputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> []

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;I&#x27;m a text-to-image workflow!&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, components, state</span>):
        block_state = self.get_block_state(state)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;running the text-to-image workflow&quot;</span>)
        <span class="hljs-comment"># Add your text-to-image logic here</span>
        <span class="hljs-comment"># For example: generate image from prompt</span>
        self.set_block_state(state, block_state)
        <span class="hljs-keyword">return</span> components, state`,wrap:!1}}),{c(){m(e.$$.fragment)},l(l){j(e.$$.fragment,l)},m(l,y){T(e,l,y),p=!0},p:es,i(l){p||(U(e.$$.fragment,l),p=!0)},o(l){u(e.$$.fragment,l),p=!1},d(l){d(e,l)}}}function fs(I){let e,p;return e=new S({props:{code:"Y2xhc3MlMjBJbWFnZVRvSW1hZ2VCbG9jayhNb2R1bGFyUGlwZWxpbmVCbG9ja3MpJTNBJTBBJTIwJTIwJTIwJTIwbW9kZWxfbmFtZSUyMCUzRCUyMCUyMmltZzJpbWclMjIlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGlucHV0cyhzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCU1QklucHV0UGFyYW0obmFtZSUzRCUyMnByb21wdCUyMiklMkMlMjBJbnB1dFBhcmFtKG5hbWUlM0QlMjJpbWFnZSUyMiklNUQlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGludGVybWVkaWF0ZV9vdXRwdXRzKHNlbGYpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTVCJTVEJTBBJTBBJTIwJTIwJTIwJTIwJTQwcHJvcGVydHklMEElMjAlMjAlMjAlMjBkZWYlMjBkZXNjcmlwdGlvbihzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCUyMkknbSUyMGFuJTIwaW1hZ2UtdG8taW1hZ2UlMjB3b3JrZmxvdyElMjIlMEElMEElMjAlMjAlMjAlMjBkZWYlMjBfX2NhbGxfXyhzZWxmJTJDJTIwY29tcG9uZW50cyUyQyUyMHN0YXRlKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJsb2NrX3N0YXRlJTIwJTNEJTIwc2VsZi5nZXRfYmxvY2tfc3RhdGUoc3RhdGUpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJpbnQoJTIycnVubmluZyUyMHRoZSUyMGltYWdlLXRvLWltYWdlJTIwd29ya2Zsb3clMjIpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwQWRkJTIweW91ciUyMGltYWdlLXRvLWltYWdlJTIwbG9naWMlMjBoZXJlJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwRm9yJTIwZXhhbXBsZSUzQSUyMHRyYW5zZm9ybSUyMGlucHV0JTIwaW1hZ2UlMjBiYXNlZCUyMG9uJTIwcHJvbXB0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5zZXRfYmxvY2tfc3RhdGUoc3RhdGUlMkMlMjBibG9ja19zdGF0ZSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBjb21wb25lbnRzJTJDJTIwc3RhdGU=",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">ImageToImageBlock</span>(<span class="hljs-title class_ inherited__">ModularPipelineBlocks</span>):
    model_name = <span class="hljs-string">&quot;img2img&quot;</span>

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> [InputParam(name=<span class="hljs-string">&quot;prompt&quot;</span>), InputParam(name=<span class="hljs-string">&quot;image&quot;</span>)]

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">intermediate_outputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> []

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;I&#x27;m an image-to-image workflow!&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, components, state</span>):
        block_state = self.get_block_state(state)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;running the image-to-image workflow&quot;</span>)
        <span class="hljs-comment"># Add your image-to-image logic here</span>
        <span class="hljs-comment"># For example: transform input image based on prompt</span>
        self.set_block_state(state, block_state)
        <span class="hljs-keyword">return</span> components, state`,wrap:!1}}),{c(){m(e.$$.fragment)},l(l){j(e.$$.fragment,l)},m(l,y){T(e,l,y),p=!0},p:es,i(l){p||(U(e.$$.fragment,l),p=!0)},o(l){u(e.$$.fragment,l),p=!1},d(l){d(e,l)}}}function bs(I){let e,p;return e=new S({props:{code:"Y2xhc3MlMjBJbnBhaW50QmxvY2soTW9kdWxhclBpcGVsaW5lQmxvY2tzKSUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsX25hbWUlMjAlM0QlMjAlMjJpbnBhaW50JTIyJTBBJTBBJTIwJTIwJTIwJTIwJTQwcHJvcGVydHklMEElMjAlMjAlMjAlMjBkZWYlMjBpbnB1dHMoc2VsZiklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAlNUJJbnB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ShzdGF0ZSUyQyUyMGJsb2NrX3N0YXRlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGNvbXBvbmVudHMlMkMlMjBzdGF0ZQ==",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">InpaintBlock</span>(<span class="hljs-title class_ inherited__">ModularPipelineBlocks</span>):
    model_name = <span class="hljs-string">&quot;inpaint&quot;</span>

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> [InputParam(name=<span class="hljs-string">&quot;prompt&quot;</span>), InputParam(name=<span class="hljs-string">&quot;image&quot;</span>), InputParam(name=<span class="hljs-string">&quot;mask&quot;</span>)]

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">intermediate_outputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> []

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;I&#x27;m an inpaint workflow!&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, components, state</span>):
        block_state = self.get_block_state(state)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;running the inpaint workflow&quot;</span>)
        <span class="hljs-comment"># Add your inpainting logic here</span>
        <span class="hljs-comment"># For example: fill masked areas based on prompt</span>
        self.set_block_state(state, block_state)
        <span class="hljs-keyword">return</span> components, state`,wrap:!1}}),{c(){m(e.$$.fragment)},l(l){j(e.$$.fragment,l)},m(l,y){T(e,l,y),p=!0},p:es,i(l){p||(U(e.$$.fragment,l),p=!0)},o(l){u(e.$$.fragment,l),p=!1},d(l){d(e,l)}}}function Bs(I){let e,p,l,y,c,f;return e=new ls({props:{id:"auto",option:"text-to-image",$$slots:{default:[hs]},$$scope:{ctx:I}}}),l=new ls({props:{id:"auto",option:"image-to-image",$$slots:{default:[fs]},$$scope:{ctx:I}}}),c=new ls({props:{id:"auto",option:"inpaint",$$slots:{default:[bs]},$$scope:{ctx:I}}}),{c(){m(e.$$.fragment),p=i(),m(l.$$.fragment),y=i(),m(c.$$.fragment)},l(t){j(e.$$.fragment,t),p=o(t),j(l.$$.fragment,t),y=o(t),j(c.$$.fragment,t)},m(t,r){T(e,t,r),M(t,p,r),T(l,t,r),M(t,y,r),T(c,t,r),f=!0},p(t,r){const k={};r&2&&(k.$$scope={dirty:r,ctx:t}),e.$set(k);const h={};r&2&&(h.$$scope={dirty:r,ctx:t}),l.$set(h);const Q={};r&2&&(Q.$$scope={dirty:r,ctx:t}),c.$set(Q)},i(t){f||(U(e.$$.fragment,t),U(l.$$.fragment,t),U(c.$$.fragment,t),f=!0)},o(t){u(e.$$.fragment,t),u(l.$$.fragment,t),u(c.$$.fragment,t),f=!1},d(t){t&&(n(p),n(y)),d(e,t),d(l,t),d(c,t)}}}function ks(I){let e,p,l,y,c,f,t,r='<a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> are a multi-block type containing blocks that support different workflows. It automatically selects which sub-blocks to run based on the input provided at runtime. This is typically used to package multiple workflows - text-to-image, image-to-image, inpaint - into a single pipeline for convenience.',k,h,Q='This guide shows how to create <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a>.',V,C,as='Create three <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.ModularPipelineBlocks">ModularPipelineBlocks</a> for text-to-image, image-to-image, and inpainting. These represent the different workflows available in the pipeline.',E,B,N,g,ts='Create an <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> class that includes a list of the sub-block classes and their corresponding block names.',x,G,ns="You also need to include <code>block_trigger_inputs</code>, a list of input names that trigger the corresponding block. If a trigger input is provided at runtime, then that block is selected to run. Use <code>None</code> to specify the default block to run if no trigger inputs are detected.",z,Z,Ms="Lastly, it is important to include a <code>description</code> that clearly explains which inputs trigger which workflow. This helps users understand how to run specific workflows.",R,A,F,_,ps='It is <strong>very</strong> important to include a <code>description</code> to avoid any confusion over how to run a block and what inputs are required. While <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> are convenient, it’s conditional logic may be difficult to figure out if it isn’t properly explained.',q,W,is="Create an instance of <code>AutoImageBlocks</code>.",P,$,L,X,os='For more complex compositions, such as nested <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> blocks when they’re used as sub-blocks in larger pipelines, use the <code>get_execution_blocks()</code> method to extract the a block that is actually run based on your input.',K,H,D,v,O,Y,ss;return c=new us({props:{title:"AutoPipelineBlocks",local:"autopipelineblocks",headingTag:"h1"}}),B=new Is({props:{id:"auto",options:["text-to-image","image-to-image","inpaint"],$$slots:{default:[Bs]},$$scope:{ctx:I}}}),A=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5tb2R1bGFyX3BpcGVsaW5lcyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUJsb2NrcyUwQSUwQWNsYXNzJTIwQXV0b0ltYWdlQmxvY2tzKEF1dG9QaXBlbGluZUJsb2NrcyklM0ElMEElMjAlMjAlMjAlMjAlMjMlMjBMaXN0JTIwb2YlMjBzdWItYmxvY2slMjBjbGFzc2VzJTIwdG8lMjBjaG9vc2UlMjBmcm9tJTBBJTIwJTIwJTIwJTIwYmxvY2tfY2xhc3NlcyUyMCUzRCUyMCU1QmJsb2NrX2lucGFpbnRfY2xzJTJDJTIwYmxvY2tfaTJpX2NscyUyQyUyMGJsb2NrX3QyaV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JTIwKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.modular_pipelines <span class="hljs-keyword">import</span> AutoPipelineBlocks

<span class="hljs-keyword">class</span> <span class="hljs-title class_">AutoImageBlocks</span>(<span class="hljs-title class_ inherited__">AutoPipelineBlocks</span>):
    <span class="hljs-comment"># List of sub-block classes to choose from</span>
    block_classes = [block_inpaint_cls, block_i2i_cls, block_t2i_cls]
    <span class="hljs-comment"># Names for each block in the same order</span>
    block_names = [<span class="hljs-string">&quot;inpaint&quot;</span>, <span class="hljs-string">&quot;img2img&quot;</span>, <span class="hljs-string">&quot;text2img&quot;</span>]
    <span class="hljs-comment"># Trigger inputs that determine which block to run</span>
    <span class="hljs-comment"># - &quot;mask&quot; triggers inpaint workflow</span>
    <span class="hljs-comment"># - &quot;image&quot; triggers img2img workflow (but only if mask is not provided)</span>
    <span class="hljs-comment"># - if none of above, runs the text2img workflow (default)</span>
    block_trigger_inputs = [<span class="hljs-string">&quot;mask&quot;</span>, <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-literal">None</span>]
    <span class="hljs-comment"># Description is extremely important for AutoPipelineBlocks</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> (
            <span class="hljs-string">&quot;Pipeline generates images given different types of conditions!\\n&quot;</span>
            + <span class="hljs-string">&quot;This is an auto pipeline block that works for text2img, img2img and inpainting tasks.\\n&quot;</span>
            + <span class="hljs-string">&quot; - inpaint workflow is run when \`mask\` is provided.\\n&quot;</span>
            + <span class="hljs-string">&quot; - img2img workflow is run when \`image\` is provided (but only when \`mask\` is not provided).\\n&quot;</span>
            + <span class="hljs-string">&quot; - text2img workflow is run when neither \`image\` nor \`mask\` is provided.\\n&quot;</span>
        )`,wrap:!1}}),$=new S({props:{code:"YXV0b19ibG9ja3MlMjAlM0QlMjBBdXRvSW1hZ2VCbG9ja3MoKQ==",highlighted:"auto_blocks = AutoImageBlocks()",wrap:!1}}),H=new S({props:{code:"YXV0b19ibG9ja3MuZ2V0X2V4ZWN1dGlvbl9ibG9ja3MoJTIybWFzayUyMik=",highlighted:'auto_blocks.get_execution_blocks(<span class="hljs-string">&quot;mask&quot;</span>)',wrap:!1}}),v=new ds({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/modular_diffusers/auto_pipeline_blocks.md"}}),{c(){e=w("meta"),p=i(),l=w("p"),y=i(),m(c.$$.fragment),f=i(),t=w("p"),t.innerHTML=r,k=i(),h=w("p"),h.innerHTML=Q,V=i(),C=w("p"),C.innerHTML=as,E=i(),m(B.$$.fragment),N=i(),g=w("p"),g.innerHTML=ts,x=i(),G=w("p"),G.innerHTML=ns,z=i(),Z=w("p"),Z.innerHTML=Ms,R=i(),m(A.$$.fragment),F=i(),_=w("p"),_.innerHTML=ps,q=i(),W=w("p"),W.innerHTML=is,P=i(),m($.$$.fragment),L=i(),X=w("p"),X.innerHTML=os,K=i(),m(H.$$.fragment),D=i(),m(v.$$.fragment),O=i(),Y=w("p"),this.h()},l(s){const a=Ts("svelte-u9bgzb",document.head);e=J(a,"META",{name:!0,content:!0}),a.forEach(n),p=o(s),l=J(s,"P",{}),ys(l).forEach(n),y=o(s),j(c.$$.fragment,s),f=o(s),t=J(s,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1ugzm89"&&(t.innerHTML=r),k=o(s),h=J(s,"P",{"data-svelte-h":!0}),b(h)!=="svelte-1ahqkdy"&&(h.innerHTML=Q),V=o(s),C=J(s,"P",{"data-svelte-h":!0}),b(C)!=="svelte-1wwe2b4"&&(C.innerHTML=as),E=o(s),j(B.$$.fragment,s),N=o(s),g=J(s,"P",{"data-svelte-h":!0}),b(g)!=="svelte-8j7l4"&&(g.innerHTML=ts),x=o(s),G=J(s,"P",{"data-svelte-h":!0}),b(G)!=="svelte-ay1e4a"&&(G.innerHTML=ns),z=o(s),Z=J(s,"P",{"data-svelte-h":!0}),b(Z)!=="svelte-13ticwk"&&(Z.innerHTML=Ms),R=o(s),j(A.$$.fragment,s),F=o(s),_=J(s,"P",{"data-svelte-h":!0}),b(_)!=="svelte-onwwut"&&(_.innerHTML=ps),q=o(s),W=J(s,"P",{"data-svelte-h":!0}),b(W)!=="svelte-hgnyn2"&&(W.innerHTML=is),P=o(s),j($.$$.fragment,s),L=o(s),X=J(s,"P",{"data-svelte-h":!0}),b(X)!=="svelte-1cj50l7"&&(X.innerHTML=os),K=o(s),j(H.$$.fragment,s),D=o(s),j(v.$$.fragment,s),O=o(s),Y=J(s,"P",{}),ys(Y).forEach(n),this.h()},h(){rs(e,"name","hf:doc:metadata"),rs(e,"content",Cs)},m(s,a){Us(document.head,e),M(s,p,a),M(s,l,a),M(s,y,a),T(c,s,a),M(s,f,a),M(s,t,a),M(s,k,a),M(s,h,a),M(s,V,a),M(s,C,a),M(s,E,a),T(B,s,a),M(s,N,a),M(s,g,a),M(s,x,a),M(s,G,a),M(s,z,a),M(s,Z,a),M(s,R,a),T(A,s,a),M(s,F,a),M(s,_,a),M(s,q,a),M(s,W,a),M(s,P,a),T($,s,a),M(s,L,a),M(s,X,a),M(s,K,a),T(H,s,a),M(s,D,a),T(v,s,a),M(s,O,a),M(s,Y,a),ss=!0},p(s,[a]){const cs={};a&2&&(cs.$$scope={dirty:a,ctx:s}),B.$set(cs)},i(s){ss||(U(c.$$.fragment,s),U(B.$$.fragment,s),U(A.$$.fragment,s),U($.$$.fragment,s),U(H.$$.fragment,s),U(v.$$.fragment,s),ss=!0)},o(s){u(c.$$.fragment,s),u(B.$$.fragment,s),u(A.$$.fragment,s),u($.$$.fragment,s),u(H.$$.fragment,s),u(v.$$.fragment,s),ss=!1},d(s){s&&(n(p),n(l),n(y),n(f),n(t),n(k),n(h),n(V),n(C),n(E),n(N),n(g),n(x),n(G),n(z),n(Z),n(R),n(F),n(_),n(q),n(W),n(P),n(L),n(X),n(K),n(D),n(O),n(Y)),n(e),d(c,s),d(B,s),d(A,s),d($,s),d(H,s),d(v,s)}}}const Cs='{"title":"AutoPipelineBlocks","local":"autopipelineblocks","sections":[],"depth":1}';function gs(I){return Js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $s extends ms{constructor(e){super(),js(this,e,gs,ks,ws,{})}}export{$s as component};
