Prompt Chaining Workflow Planner

Plan multi-step AI image workflows generate, upscale, inpaint, export

Build a multi-step AI image pipeline by adding stages — generation, upscaling, inpainting, face restore, and export. The planner orders the stages correctly and estimates total processing time on your hardware. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the correct order for these stages?

Generate first, then face-restore the small native face, then upscale the whole image, then inpaint any fixes at the higher resolution, then export. Restoring before upscaling and inpainting last keeps each tool working at the resolution it does best.

Prompt chaining workflows

Great AI images rarely come from a single generation. A real pipeline chains stages: generate a base image, restore the face, upscale, inpaint problem areas, then export. Get the order wrong — upscale before face restore, inpaint before upscale — and you fight your own tools. This planner assembles the correct order and estimates the total processing time per image.

How it works

Each stage has a rough per-image cost that scales with your GPU tier. The planner holds the proven execution order and sums only the stages you enable:

generate → face-restore → upscale → inpaint → export
total_time = Σ stage_time(enabled stages, gpu)

Generation and upscaling dominate the budget; export is effectively free. Running face restore on the small native face (before upscaling) and inpainting at the final resolution (after upscaling) is what keeps quality high.

Why stage order is not negotiable

Each stage leaves the image in a state the next stage expects. Run the stages out of order and quality falls apart:

  • Face-restoring after upscaling wastes the restoration on a large, blurry face region and can introduce double-sharpening artifacts.
  • Inpainting before upscaling repairs detail at low resolution; the upscaler then softens the repair, forcing a redo.
  • Exporting before inpaint obviously exports the broken version.

The planner bakes the proven order in so you cannot accidentally wire the stages wrong before committing to a full batch.

Typical GPU time ranges

These are rough indicative ranges to help you understand relative cost; actual times depend on resolution, step count, and model size:

StageRelative cost
GenerationHigh — the most compute-intensive step
UpscalingMedium-high at 4× — lower for a 2× pass
Face restoreLow — fast, local operation
InpaintMedium — depends on mask size and steps
ExportNegligible

Tips for building the chain

  • Restore early, inpaint late. Fix faces at native size, fix everything else after upscaling.
  • Upscale once. A single good 2×–4× pass beats stacking several small ones, which compounds softness.
  • Mask tight for inpaint. Smaller masks at high resolution blend more cleanly and run faster.
  • Build it in ComfyUI. A saved graph runs the whole chain unattended across a batch — ideal once the planner confirms your time budget.
  • Use the time estimate as a batch budget. Multiply the per-image total by your target batch size to see how long the run will take before you commit.
  • Test the chain on one image first. Run the full pipeline on a single image before committing to a 50-image overnight batch. Catching a misconfigured inpaint mask costs minutes, not hours.
  • Save your ComfyUI graph. Once you have a working pipeline, the saved JSON graph is your repeatable workflow — changes to the planner settings should map back to your graph before the next batch.