A ComfyUI custom node that generates high-quality prompts for AI image generation using OpenAI API.
- Support for all OpenAI-compatible API services, not limited to specific models:
- Official OpenAI API
- Self-hosted open-source models (via LM Studio, text-generation-webui, etc.)
- Third-party compatible APIs (Claude API, Anthropic API, etc.)
- Customize system prompts and user inputs
- Filter generated text using regular expressions
- Configure API parameters (temperature, max tokens, etc.)
- Seamless integration with ComfyUI workflow
- Make sure you have ComfyUI installed
- Clone this repository to your ComfyUI's custom_nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/cracya01/ComfyUI-PromptGenerator.git
3. Install dependencies:
```bash
cd ComfyUI-PromptGenerator
pip install -r requirements.txt
- Restart ComfyUI
- Add the "cracya OpenAI API Config" node and set your API key
- Add the "cracya Prompt Generator" node and connect it to the API config node
- Set your system prompt and user prompt
- Optional: Use the "cracya Regex Filter" node to clean up the generated text
- Connect the generated prompt to other ComfyUI nodes (like CLIP Text Encode)
Configure OpenAI API parameters, including API key, base URL, model name, temperature, and max tokens.
Generate prompts using OpenAI API. Requires connection to an API config node.
Filter text using regular expressions. Useful for cleaning up generated prompts.
- Configure API → Generate Prompt → Filter Prompt → Use in Text to Image
MIT