This custom node for ComfyUI integrates the Flux-Prompt-Enhance model, allowing you to enhance your prompts directly within your ComfyUI workflows.
No longer maintained for public updates as another developer has started a version and we really don't need 2.
This custom node for ComfyUI integrates the Flux-Prompt-Enhance model, allowing you to enhance your prompts directly within your ComfyUI workflows.
Ensure you have ComfyUI installed and working.
Clone this repository into your ComfyUI custom nodes directory:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/marduk191/ComfyUI-Fluxpromptenhancer.git
Install the required dependencies:
cd ComfyUI-Fluxpromptenhancer
pip install -r requirements.txt
This will install PyTorch and the Hugging Face Transformers library, along with any other necessary dependencies.
Note: Make sure you're using the same Python environment that ComfyUI uses.
The Flux-Prompt-Enhance model will be automatically downloaded when you first use the node. However, if you want to pre-download it or if you're working in an offline environment, you can manually download the model:
python -c "from transformers import AutoTokenizer, AutoModelForSeq2SeqLM; AutoTokenizer.from_pretrained('gokaygokay/Flux-Prompt-Enhance'); AutoModelForSeq2SeqLM.from_pretrained('gokaygokay/Flux-Prompt-Enhance')"
This command will download the model and tokenizer to the default Hugging Face cache directory (usually ~/.cache/huggingface/
on Linux or C:\Users\YourUsername\.cache\huggingface\
on Windows).
Restart ComfyUI or reload custom nodes.
In the ComfyUI interface, you should now see a new node called "Flux Prompt Enhance" in the "marduk191/Flux_Prompt_Enhancer" category.
You can type in this node, or convert the widget to input and connect a string input (your initial prompt) to this node.
The node will output an enhanced version of your input prompt.
Input: "beautiful house with text 'hello'"
Output: "a two-story house with white trim, large windows on the second floor, three chimneys on the roof, green trees and shrubs in front of the house, stone pathway leading to the front door, text on the house reads "hello" in all caps, blue sky above, shadows cast by the trees, sunlight creating contrast on the house's facade, some plants visible near the bottom right corner, overall warm and serene atmosphere."
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.