ComfyUI Extension: ComfyUI-Caption-Cleaner
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.
A custom node for ComfyUI designed to automatically clean and format natural language captions (generated by VLMs like Florence-2, CogVLM, or JoyTag) for LoRA training datasets.
Looking for a different extension?
Custom Nodes (0)
README
ComfyUI Clean Caption (LoRA)
A custom node for ComfyUI designed to automatically clean and format natural language captions (generated by VLMs like Florence-2, CogVLM, or JoyTag) for LoRA training datasets.
It strips away "AI assistant" fluff, removes subjective descriptions, and enforces a trigger word.
✨ Features
- Prefix Removal: Automatically removes common starting phrases like "The image is a digital illustration of..." or "The image shows...".
- Subjective Filtering: Removes sentences describing "vibes" rather than visual content (e.g., removes "The overall mood is whimsical" or "The atmosphere is serene").
- Filler Cleanup: Scrubs specific filler phrases inside sentences (e.g., "in the image", "digital painting").
- Trigger Word Enforcement: Automatically adds your specific LoRA trigger word to the start of the caption if it isn't already there.
📦 Installation
- Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/
- Clone this repository:
git clone https://github.com/cristian1980/ComfyUI-Caption-Cleaner.git
- Restart ComfyUI.
🚀 Usage
Find the node under LoRA/Text > Clean Caption (LoRA).
Parameters
| Input | Type | Description |
| --- | --- | --- |
| text | STRING | The raw caption text (usually from a VLM node or text file). |
| trigger_word | STRING | The token you want to train (e.g., sks, my_char). Default: cayesvgrt. |
| enabled | BOOLEAN | Toggle the cleaning process on or off. |
Example
Input Text:
"The image is a digital illustration of a futuristic cyborg standing in neon rain. The overall atmosphere is dark and moody. In the image, the cyborg is holding a glowing sword."
Trigger Word: cyb0rg
Output Text:
"cyb0rg, A futuristic cyborg standing in neon rain. The cyborg is holding a glowing sword."
🛠️ Logic Details
The node performs the following operations in order:
- Prefix Stripping: Checks for and removes ~8 common VLM descriptive prefixes.
- Sentence Filtering: Splits text into sentences and discards any containing "bad keywords" (like "overall style", "cartoon-like", "design").
- Phrase Removal: Removes specific noise phrases ("vector art", "to the scene") from remaining sentences.
- Formatting: Cleans whitespace, fixes punctuation, and prepends the
trigger_word.
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.