ComfyUI Node

Role Deleter

Pruning your prompt library with Role Deleter

By laolaoruqin·Created 9 months ago·Updated 9 months ago· 0
Role Deleter
    • status
    role
    delete_triggerfalse

    Every prompt library eventually turns into a junk drawer. You save "test 1", then "test 1 real", then "portrait wip don't use" - and suddenly your Role Loader dropdown has twenty entries of which three are real. Role Deleter is the broom for that drawer. It's the least glamorous node in the ComfyUI-Role-Master pack and the one you'll be grateful for exactly once, about two weeks after you start using the Saver.

    The mechanism is dead simple. You get a role dropdown listing everything in the pack's roles.json file, sorted A–Z, and a delete_trigger boolean. Flip the trigger to Delete, queue the prompt, and the role is removed from the JSON and reported back through the status output - "Successfully deleted role: X". Leave the trigger on Wait (the default) and it just reports "Waiting for delete trigger..." and does nothing.

    That trigger is the safety feature, and it's worth taking seriously: deletion is permanent. There's no undo, no trash, no confirm dialog - the toggle is the confirmation, and the deletion happens the moment you queue. So the workflow is deliberate by design: select the role, flip to Delete, queue, done. If that one-stage "are you sure" feels thin, the same backup advice for the rest of the pack applies double here - roles.json lives inside the pack's folder, so a copy of that file is your entire safety net for everything this pack can do.

    Two small details keep it from being annoying. If the file is empty or nothing's selected, the dropdown shows a literal "None" entry and the node refuses politely ("No role selected.") instead of erroring. And because the trigger defaults to Wait, you can keep a Role Deleter parked in a workflow permanently without risking accidental wipes - it only acts when you tell it to.

    Install matches the rest of the pack exactly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/laolaoruqin/ComfyUI-Role-Master.git
    

    Restart ComfyUI, or search "Role Master" in ComfyUI Manager. No dependencies, no models, no keys - it's a few lines of Python that delete one entry from a JSON file.

    The status string is an output node, so it runs every queue, but you don't wire it into anything - it's your receipt. This is the node you add to a cleanup workflow, run once, and never think about again. Which, for a housekeeping tool, is exactly the compliment.

    CategoryRole Master

    Inputs (2)

    NameTypeDefaultDescription
    roleCOMBO1 options: Example Role
    delete_triggerBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    statusSTRING