liveBook · Manning

Pipeline

As explained in Local Image Generation

A workflow is an organized sequence or graph of processing components that produces an output through configured operations.

A pipeline organizes the operations that turn a prompt and its settings into generated images. In Diffusers, it hides the moving parts behind one callable object; in ComfyUI, the same idea becomes a visible workflow of connected nodes. One is a tidy machine with a control panel, the other lets you rearrange the machine. section 3.4.2 section 8.1.2

Run an image pipeline

Load a pretrained model, move it to the GPU, then call the pipeline with a prompt, negative prompt, size, guidance scale, and generator. The call returns a list of images, so select the result you want. Keep slow generation in its own notebook cell; tweak settings first, then rerun when ready. section 3.4.2 section 3.4.5

pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=width,
    height=height,
    guidance_scale=cfg_scale,
    generator=prng
    ).images[0]

This call is the compact pipeline interface: configure the request, run Stable Diffusion, then take the first returned image. section 3.4.5

ComfyUI pipelines are workflows: nodes pass outputs into later inputs to form a graph. Every input needs a source, an output can feed several nodes, and a single input accepts only one source. Build the setup once, then queue it repeatedly instead of replaying a long sequence of clicks. section 8.5 section 8.1.1

A reusable ComfyUI workflow can be extended to:

  • Decode sampled latents with a VAE and save or preview the resulting image. section 8.2.6
  • Run an anime-style ramen image through two checkpoints for a more realistic result, then queue further variations with one click. section 8.4.2
  • Merge two SDXL checkpoints while generating previews for both originals and the merge in one pass. section 14.3.1

Save workflows as files or share them through images that retain workflow metadata. Dragging such an image into ComfyUI restores its node graph, so existing workflows are a practical shortcut and a useful way to inspect unfamiliar setups. Complex graphs can look alarming; they are often repeated groups of familiar nodes. section 8.4 section 8.4.1 section 14.3.1

How Local Image Generation covers it

How deep it goes
Defines pipelines and builds ComfyUI graphs from fundamental nodes, while deferring many nodes and configuration details.
Examples
Demonstrates a Diffusers image call, img2img ramen upscaling, Flux workflow loading, and SDXL checkpoint-merging previews.
What it assumes
Assumes basic Stable Diffusion understanding for ComfyUI, while introducing pipeline use without requiring model internals.
What you can do after
Operate/configure it in Diffusers or ComfyUI to run, reuse, share, and extend image-generation processes.
How it connects
Connects DiffusionPipeline, ComfyUI, Stable Diffusion, VAE, scheduler, UNet, checkpoints, img2img, and checkpoint merging.

Also explained in

Compare how 63 books explain pipeline →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Local Image Generation. The section links point to the parts of the book it draws on.