pipe to create a workflow

required https://github.com/jags111/efficiency-nodes-comfyui

Hierarchy (view full)

  • BasePipe<EfficientPipeContext>
    • EfficientPipe

Constructors

Properties

_disposed: boolean = false
_disposed_cbs: any[] = ...
_invoked?: Promise<InvokedWorkflow<unknown>>
_workflow: Workflow = ...
context: EfficientPipeContext
defaultContext: EfficientPipeContext = ...

Methods

  • Updates the context with the provided batch size and returns the current instance of the class for method chaining.

    Parameters

    • batch_size: number

      The batch size to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Parameters

    • __namedParameters: {
          end: number;
          image: Buffer;
          name: string;
          start: number;
          strength: number;
      }
      • end: number
      • image: Buffer
      • name: string
      • start: number
      • strength: number
    • stack: any

    Returns NodeOutput

  • Adds a control net block to the EfficientPipe context.

    Parameters

    • name: string

      The name of the control net block.

    • image: Buffer

      The image data of the control net block.

    • options: {
          end?: number;
          start?: number;
          strength?: number;
      } = {}

      Optional configuration for the control net block.

      • Optional end?: number

        The end value of the control net block.

      • Optional start?: number

        The start value of the control net block.

      • Optional strength?: number

        The strength of the control net block.

    Returns EfficientPipe

    The EfficientPipe instance for chaining.

  • Updates the context with the provided denoise value and returns the current instance of the class for method chaining.

    Parameters

    • denoise: number

      The denoise value to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Adds a LoRA (Low-Rank Adaptation) to the EfficientPipe context.

    Parameters

    • name: string

      The name of the LoRA.

    • options: {
          clip_strength?: number;
          strength?: number;
          weight?: number;
      } = {}

      Optional configuration for the LoRA.

      • Optional clip_strength?: number

        The clip strength of the LoRA.

      • Optional strength?: number

        The strength of the LoRA.

      • Optional weight?: number

        The weight of the LoRA.

    Returns EfficientPipe

    The EfficientPipe instance for chaining.

  • Updates the context with the provided model checkpoint name.

    Parameters

    • ckpt_name: string

      The name of the model checkpoint to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Updates the context with the provided sampler name and returns the current instance of the class for method chaining.

    Parameters

    • sampler_name: "euler" | "euler_cfg_pp" | "euler_ancestral" | "euler_ancestral_cfg_pp" | "heun" | "heunpp2" | "dpm_2" | "dpm_2_ancestral" | "lms" | "dpm_fast" | "dpm_adaptive" | "dpmpp_2s_ancestral" | "dpmpp_sde" | "dpmpp_sde_gpu" | "dpmpp_2m" | "dpmpp_2m_sde" | "dpmpp_2m_sde_gpu" | "dpmpp_3m_sde" | "dpmpp_3m_sde_gpu" | "ddpm" | "lcm" | "ipndm" | "ipndm_v" | "deis" | "ddim" | "uni_pc" | "uni_pc_bh2" | {} & string

      The sampler name to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Saves the workflow by invoking the workflow instance and enqueuing it.

    Parameters

    • Optional filename_prefix: string

      The prefix for the saved filename. if not provided, the workflow will be saved as a websocket connection.

    Returns EfficientPipe

    • Returns the instance of the class for method chaining.

    Throws

    • Throws an error if the client is not defined.
  • Updates the context with the provided scheduler value and returns the current instance of the class for method chaining.

    Parameters

    • scheduler: "normal" | "karras" | "exponential" | "sgm_uniform" | "simple" | "ddim_uniform" | "beta" | {} & string

      The scheduler value to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Updates the context with the provided seed value or generates a random seed value if none is provided.

    Parameters

    • Optional seed: number = ...

      The seed value to update the context with. If not provided, a random seed value will be generated.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Updates the context with the provided width and height, and returns the current instance of the class for method chaining.

    Parameters

    • w: number

      The width to update the context with.

    • h: number

      The height to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Updates the context with the provided steps and returns the current instance of the class for method chaining.

    Parameters

    • steps: number

      The number of steps to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.

  • Waits for the workflow to complete and returns the result and the images.

    Returns Promise<{
        images: {
            data: ArrayBuffer;
            mime: string;
        }[];
        result: WorkflowOutput;
    }>

    • A promise that resolves to an object containing the result of the workflow and the images.

    Throws

    • Throws an error if the workflow has not been invoked.
  • Waits for the workflow to complete and returns the result and the images.

    *This function does not rely on WebSocket Events, so it maybe will lose events output by WebSocket node

    Returns Promise<{
        images: {
            data: ArrayBuffer;
            mime: string;
        }[];
        result: WorkflowOutput;
    }>

    • A promise that resolves to an object containing the result of the workflow and the images.

    Throws

    • Throws an error if the workflow has not been invoked.
  • Updates the context with the provided client and returns the current instance of the class for method chaining.

    Parameters

    • client: Client

      The client to update the context with.

    Returns EfficientPipe

    The current instance of the class for method chaining.