Nodes/comfyui-huyl2-nodes/Remove First Line
ComfyUI Node

Remove First Line

Strip a header row out of a text blob

By huyl3-cpu·Created 9 months ago·Updated 4 months ago· 1
Remove First Line
    • result
    text_list

    A small, single-purpose text utility: feed it a multi-line string, and it hands back everything except the first line.

    What it's for

    The obvious use, in the context of the rest of this pack, is cleaning up text that another tool or node prepended a header or status line to before you actually want to use it - a file listing with a summary line at the top, a command-line tool's log output with a status header, that kind of thing. Rather than write a custom text node every time this comes up, this one node handles the one specific job.

    How it works

    It's a straightforward split on the first newline: whatever's before it is discarded, and everything after is returned unchanged. There's no configuration beyond that - no option to remove more than one line, no pattern to match against, no way to preview what got dropped before it's gone.

    That simplicity is also the whole appeal. In a pack full of small, single-job utility nodes (Get-Timestamp, File-List-To-File-Path, and the rest), this is the plainest of the bunch - one job, no settings, easy to reason about when you're staring at a graph six months later trying to remember what a node does.

    Inputs and outputs

    • text_list (STRING, multiline, required) - your input text block.
    • Output: result (STRING) - the same text with the first line removed.

    Installing it

    No models or extra dependencies mentioned in the README - this is a plain string operation. Search ComfyUI Manager for the repo name first, but as a small personal pack it may not be listed there. The manual route works reliably:

    cd ComfyUI/custom_nodes
    git clone https://github.com/huyl3-cpu/comfyui-sortlist.git
    

    Restart ComfyUI afterward.

    Common issues and troubleshooting

    It's a blunt instrument - it always removes exactly one line. There's no pattern matching, no "only remove it if it looks like a header" logic. If your input sometimes has a header line and sometimes doesn't, this node will silently eat real data on the runs where there isn't one to strip. Check your upstream data's shape before relying on this in an automated pipeline.

    Single-line input becomes an empty string. If the text you feed it only has one line to begin with, removing "the first line" removes everything - worth a sanity check with a text-preview node if you're not certain your input always has at least two lines.

    It doesn't trim whitespace or do anything else. This node does exactly one thing (drop line one) and nothing more - if you need additional cleanup (trimming, deduplicating, filtering blank lines), you'll need a separate text-processing step for that.

    It's the kind of node that's easy to forget is even in your graph. Because it does so little, it's also easy to leave wired in after whatever originally produced the header line has changed - if you swap out an upstream node for something that no longer prepends a status line, this one will now be silently eating the first real line of your data instead. Worth a quick check any time you rewire something earlier in the same chain.

    Categorycomfyui-sortlist

    Inputs (1)

    NameTypeDefaultDescription
    text_listSTRING

    Outputs (1)

    NameTypeDescription
    resultSTRING