Integrating the BlackForestLabs (BFL) API with ComfyUI unlocks a range of advanced features, allowing you to seamlessly connect to BFL’s robust tools and services directly within your image-generation workflows. With BFL’s API nodes, you can expand the creative and functional potential of ComfyUI by incorporating the power of FLUX and other cutting-edge features into your projects.
ComfyUI, known for its flexibility and modular architecture, is an open-source interface designed for running Stable Diffusion and similar models. Its node-based workflow system makes it highly adaptable for integrating external APIs like BlackForestLabs, enabling users to access advanced features with ease.
Installation Instructions
Setting up BFL API nodes in ComfyUI involves a few straightforward steps:
Step 1: Add the bfl_api.py
Node
To get started, download the BFL API script and place it in your ComfyUI environment:
- Clone the repository containing
bfl_api.py
into theComfyUI/custom_nodes
directory.
Step 2: Configure Your BFL API Key
Authentication with the BlackForestLabs API requires an API key. You can set up the key using one of two methods:
Environment Variable Method (Recommended):
- Export your API key as an environment variable:
bash export BFL_API_KEY=<your_api_key_here>
Text File Method:
- Create a text file named
bfl_api_key.txt
. - Add your API key to the file.
- Place the
bfl_api_key.txt
file in the same directory asbfl_api.py
.
Step 3: Restart ComfyUI
After setting up the API key, restart ComfyUI to load the new nodes.
Step 4: Add a FLUX API Node to Your Workflow
Once ComfyUI restarts, the BFL API nodes will be available in your workflow.
- Insert a node such as FLUX 1.1 [pro] by dragging and dropping it into your workspace.

Step 5: Start Exploring
With the nodes now active, you can start incorporating BFL’s API functionality into your image-generation pipelines.
ComfyUI Nodes available on GitHub:
https://github.com/black-forest-labs
Troubleshooting
If you encounter any issues, here are some common solutions:
- Invalid API Key Error: Double-check that the API key is correctly set in your environment variable or the
bfl_api_key.txt
file. - Node Not Appearing: Ensure
bfl_api.py
is placed in theComfyUI/custom_nodes
directory and restart ComfyUI.
For detailed API documentation and additional support, visit the Black Forest Labs API.
Why Use BFL API Nodes in ComfyUI?
ComfyUI is already a powerhouse for Stable Diffusion workflows, but integrating the BFL API takes it a step further by introducing tools like FLUX. These nodes allow you to:
- Access advanced image transformation features.
- Generate more refined and customized outputs.
- Leverage BlackForestLabs’ expertise directly in your workflows.
The modular nature of ComfyUI means these nodes can be seamlessly combined with existing workflows, enabling creative professionals to experiment with innovative AI-driven concepts.
With this setup, the fusion of ComfyUI and BlackForestLabs API offers unmatched versatility, making it a go-to solution for advanced AI image generation. Whether you’re a digital artist, a game designer, or an AI enthusiast, this integration opens new doors for exploration and creativity.