Practical overview
When it fits
Use Hordelib when a Python process needs to run ComfyUI-designed image inference programmatically, or when building an AI Horde inference worker around its backend.
Who it is for
- Python developers integrating ComfyUI-designed image workflows into applications or services.
- AI Horde worker and backend developers using its documented inference engine.
Documented uses
- Execute ComfyUI-designed inference pipelines from Python code.
- Submit image-generation settings such as prompt, model, sampler, dimensions and seed through an API payload.
- Retrieve and save an image result from a single-image inference call.
- Provide an inference backend for AI Horde workers.
Requirements & limits
The source repository identifies the project as AGPL-3.0 licensed. The README names horde-engine as the PyPI package and hordelib as the Python module.
- The README requires Python 3.12 or later.
- The standard installation requires an NVIDIA GPU with CUDA; Linux NVIDIA installations require the CUDA Toolkit.
- The README also describes AMD ROCm installation for Linux and a CPU build designated for testing; CPU execution is described as roughly 100 times slower.
- Users choose a PyTorch build for their hardware. The README provides CUDA-specific package guidance and currently documents only a torch 2.9.1 ROCm 6.4 option.
- Set AIWORKER_CACHE_HOME to a model directory before using the quick-start API flow.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run a single-image pipeline through the Python API
Generate and save one image from a Python process using Hordelib’s documented quick-start flow.
Before you start
- Python 3.12 or later.
- A supported PyTorch build matched to the hardware; the standard installation requires an NVIDIA GPU with CUDA.
- A model directory configured with AIWORKER_CACHE_HOME.
Steps
Install horde-engine with the PyTorch build appropriate for the CUDA hardware.
Set AIWORKER_CACHE_HOME to the model directory.
Parse command-line arguments before initialization, then call hordelib.initialise() once in the process.
Import HordeLib and ImageGenPayload from hordelib.api, create a payload with generation settings, and call basic_inference_single_image(payload).
Save the returned result.image to a file.
Expected outcome
The documented API returns an image result that can be saved as a file.
Guide limitations
- ComfyUI-touching imports must follow initialization; initialization clears sys.argv.
- The standard installation instructions require NVIDIA CUDA. The README separately describes AMD ROCm on Linux and a CPU build for testing; CPU execution is described as roughly 100 times slower.
- Audio generation is currently unsupported.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- Haidra-Org/hordelib · Official homepage title · retained in its source language

