ComfyUI Node

Name Crop

A three-input text cutter for long model names

By loz2754·Created 8 months ago·Updated about 24 hours ago· 5
Name Crop
    • cropped_name
    nameName
    croptrue
    words1

    Model names are awful for filenames. Nobody wants juggernautXL_v9Rundiffusion.safetensors stamped across the start of every output file, and half the reason people build custom filename nodes is just to tame that string. Name Crop is AUN's tiny answer: feed it any string, tell it how many words to keep, and it hands back the cropped version. Three inputs, one output, no state. It's the sort of node you'll use ten times a week and never think about again.

    What it does

    name is the string, words is how many words from the start to keep, and crop is the master switch - when it's off, the string passes through untouched. Output is cropped_name (STRING). So "juggernautXL_v9Rundiffusion.safetensors" isn't really a word-splitting problem - it's one big token - but something like "my cinematic night city prompt v2" crops cleanly to "my cinematic night city" at 4 words. It exists because AUN's filename builders want a short, filename-safe "name" to lead their output files, and auto-generated names tend to run long.

    The crop toggle matters more than it looks. Wire a boolean from a controller node (AUN's Node Controller switches output booleans precisely for this) and you get conditional naming: full name for your own archive, cropped name for social sharing, with one switch.

    Where you'll actually use it

    • Between a prompt source and a filename builder - crop a long auto-name down to a few words before it lands in AUN Path Filename V2's auto_name input.
    • Cleaning labels - trim a multi-word title for display or file naming.
    • Conditional cropping - the crop flag as a routing switch, as above.

    Honest take: on its own it's a 30-second solution to a problem you could also solve by typing a shorter name. Where it earns its keep is inside workflows that already automate naming - there you can't type anything, and a crop node is the difference between clean files and files named like a hash explosion. It also shares the AUN pack's philosophy: small, single-purpose, composes with everything else in the pack.

    Install

    It ships in AUN ComfyUI Nodes (loz2754). Install via ComfyUI Manager (search "AUN ComfyUI Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
    

    then restart ComfyUI. No dependencies worth mentioning beyond the pack's standard ones (piexif, opencv-python-headless, imageio-ffmpeg, requests), which Manager installs for you. No models, no config.

    Note

    A word-count crop is blunt - it doesn't understand that "SDXL" should count as one word, and it can't crop from the end or middle. If you need those, this isn't it; you'd want a regex or text-manipulation node. But for the 90% case of "keep the first few words of a generated name," this is the whole job in one small node.

    CategoryAUN Nodes/Text

    Inputs (3)

    NameTypeDefaultDescription
    nameSTRINGNameThe input string to crop.
    cropBOOLEANtrueEnable or disable cropping.
    wordsINT11–10The number of words to keep from the start of the string.

    Outputs (1)

    NameTypeDescription
    cropped_nameSTRING