PDstring:del_EmptyLine
Del_EmptyLine: nukes the blank lines at the top of your text
- text
PDstring:del_EmptyLine (class Empty_Line) does exactly one thing: it strips the blank lines from the top of a text block. That's it. No options, no modes, one input and one output.
It sounds almost too small to bother with, but it's the kind of node you start appreciating the first time you pipe a multi-line prompt or a pasted caption dump into a downstream node and the leading newlines throw off the formatting - or just make your prompt text start with a wall of nothing. Paste anything with a leading blank line in and the output comes out clean.
How it works
The whole implementation is a single regex: re.sub(r'^[\r\n]+', '', text). It anchors to the start of the string and removes every leading carriage return and newline. That's the entire mechanism, so it's fast and it can't misfire on the body of the text.
Here's the honest limitation: it only handles leading empty lines. Interior double blank lines, trailing newlines, stray whitespace - none of that is touched. If you need whitespace collapsed throughout the string or keywords turned into line breaks, that's the sibling node PD_empty_word in the same pack, which does the heavier cleanup.
Inputs and output
text- a multi-lineSTRING. It's declared withforceInput, so you can wire another node's text output straight in, not just type.- Output
text- the cleaned string, ready to feed a CLIP Text Encode, a save node, or whatever comes next.
Both ends are a single string; there's no batch behavior here.
Installing
This ships in the 7BEII/Comfyui_PDuse pack. Grab it through ComfyUI Manager (search "Comfyui_PDuse") or:
cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/Comfyui_PDuse
cd Comfyui_PDuse
pip install -r requirements.txt
Then restart ComfyUI. No models, no heavy dependencies beyond what the pack's requirements.txt already lists (Pillow, numpy, opencv-python, and friends - torch ships with ComfyUI).
Gotchas
About the only way to be surprised here is to expect more than the node promises. Feed it text with blank lines only in the middle and it passes through unchanged - that's correct behavior, not a bug. It's a utility node in a utility pack: tiny, deterministic, and best used inside a small text-cleanup chain rather than as a headline feature.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |