tutorialJanuary 5, 2025 · 15 min read

Building Deterministic Workflows in ComfyUI

Step-by-step guide to creating reproducible image generation pipelines using deterministic nodes and proper state management.

ComfyUI's node-based interface is powerful for iterative workflows, but achieving true reproducibility requires intentional setup.

Installation

Install deterministic-nodes via ComfyUI Manager or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aiconductor/deterministic-nodes
pip install -r deterministic-nodes/requirements.txt

Basic Workflow

  • . Replace KSampler with DeterministicKSampler
  • . Set batch_size to 1
  • . Enable RNG state locking
  • . Connect your standard pipeline

Verification

Generate the same image 10 times. Use an image diff tool to verify pixel-perfect matches.

Pipeline Export

Export workflows with locked seeds for version control:

workflow.export_deterministic('workflow_v1.json')

This captures all RNG states, enabling exact reproduction on any machine.

Related Processes

Ready to make your AI pipelines reproducible?