"RunningHub API key is not configured" Error When Adding a Tool
When attempting to add a tool, specifically one involving Gaussian blur within a ComfyUI workflow, you might encounter the error message: RunningHub API key is not configured. Please set RUNNINGHUB_API_KEY in your environment. This indicates that the Pixelle-MCP project is trying to utilize the RunningHub cloud execution engine, but it cannot find the necessary API key in your environment variables.
Root Cause
The core of the problem lies in the configuration of the tool you are adding. It's designed to leverage RunningHub for processing. RunningHub is a cloud-based service that can execute computationally intensive tasks, freeing up your local resources. However, to access RunningHub's services, you need a valid API key, which acts as your authentication credential. The error message clearly states that this key is missing from your environment variables, preventing the tool from functioning correctly.
Solutions
There are two main approaches to resolve this issue, depending on whether you intend to use RunningHub or prefer local ComfyUI execution:
1. Using RunningHub
If you want to utilize RunningHub for its cloud processing capabilities, you need to obtain a RunningHub API key. This typically involves purchasing a RunningHub membership. Once you have the key, you must configure it within your environment variables.
Steps:
- Obtain a RunningHub API Key: Visit RunningHub's website (either https://www.runninghub.ai for international users or https://www.runninghub.cn for users in China) and follow their instructions to purchase a membership and retrieve your API key.
- Set the
RUNNINGHUB_API_KEYEnvironment Variable: The method for setting environment variables depends on your operating system. Here's how to do it on different platforms:- Linux/macOS: Add the following line to your
.envfile:
ReplaceRUNNINGHUB_API_KEY="YOUR_RUNNINGHUB_API_KEY"YOUR_RUNNINGHUB_API_KEYwith the actual key you obtained. - Windows:
- Search for "Environment Variables" in the Start Menu.
- Click "Edit the system environment variables".
- Click "Environment Variables..."
- Under "System variables", click "New...".
- Enter
RUNNINGHUB_API_KEYas the variable name and your actual API key as the variable value. - Click "OK" on all windows to save the changes.
- Linux/macOS: Add the following line to your
- Restart Pixelle-MCP: Ensure that you restart the Pixelle-MCP project after setting the environment variable so that it can pick up the new configuration.
2. Using Local ComfyUI
If you prefer to run the workflow locally using your ComfyUI instance, you need to ensure that the tool you're adding is configured to use the local ComfyUI API. This means providing a ComfyUI workflow API format file that adheres to the expected structure for local execution.
Steps:
- Verify ComfyUI Configuration: Double-check that your
COMFYUI_BASE_URLandCOMFYUI_API_KEY(if required) are correctly configured in your.envfile. Ensure that the ComfyUI server is running and accessible at the specified URL. - Modify the Tool Configuration: When adding the tool, make sure you are providing a workflow file that is designed for local ComfyUI execution, not for RunningHub. This typically involves ensuring the workflow doesn't rely on RunningHub-specific nodes or configurations.
- Check the Workflow API Format: Ensure that the workflow file you are providing adheres to the ComfyUI API format. You can test the workflow directly within ComfyUI to ensure it functions as expected.
Practical Tips and Considerations
- Prioritize Local Execution: If you have sufficient local resources, consider prioritizing local ComfyUI execution for faster iteration and reduced dependency on external services.
- Secure Your API Keys: Always protect your API keys. Avoid committing them directly to your code repository and utilize environment variables for secure storage.
- RunningHub Region Selection: If using RunningHub, select the appropriate region (Global or China) based on your location for optimal performance.
- Review Tool Documentation: Consult the documentation for the specific tool you are adding to understand its dependencies and configuration requirements, especially regarding RunningHub integration.
- Test Thoroughly: After implementing either solution, thoroughly test the tool to ensure it functions correctly and produces the expected results.