Nodes/ComfyUI_MieNodes/Delete Asset ๐Ÿ‘
ComfyUI Node

Delete Asset ๐Ÿ‘

Delete Asset ๐Ÿ‘ Refuses to Delete Until You Click Twice โ€” That's the Feature

By MieMieeeeeยทCreated 2 years agoยทUpdated 2 days agoยท 269
Delete Asset ๐Ÿ‘
    • name
    • status
    โ—„kindcharacterโ–บ
    โ—„library_dirโ–บ
    โ—„name๏ผˆไธ‹ๆ‹‰้€‰ๆ‹ฉ่ต„ไบง๏ผ‰โ–บ
    โ—„confirm_tokenโ–บ

    Deleting an asset in this pack removes a folder - a character's PNG, its WAV, its character.json with the description you spent twenty minutes getting right. There's no undo. So Delete Asset ๐Ÿ‘ goes out of its way to be annoying: it will not delete anything unless you personally click a button twice on the node, and it will refuse to run if you queue the graph any other way.

    I've seen people call this broken in issue threads of similar packs. It isn't. It's the only guard rail standing between you and a stale Ctrl+Enter.

    How the confirmation works

    The node carries a hidden confirm_token input that you never type into. When you click the node's ๐Ÿ—‘ ๅˆ ้™ค ยท Delete button it arms itself (and auto-disarms after five seconds); the second click reads ๐Ÿ—‘ ็กฎ่ฎคๅˆ ้™ค๏ผŸ ยท Confirm?, stamps the token with the current unix time, and queues the graph.

    At execution the node checks that stamp. Anything older than 600 seconds, or missing, or left over from a saved workflow, gets a RuntimeError that deletes nothing at all. Queueing with Ctrl+Enter, the Queue button, or a workflow someone sent you therefore does not delete. Only the second click of a live confirmation does.

    The node is an output node, so it executes as part of the queue run - which is why deleting has that odd shape where the actual removal happens when the queue reaches it, in whatever order ComfyUI scheduled it, not when you clicked.

    Inputs and outputs

    Three required inputs you'll actually see. kind is a dropdown, character or scene, with character as the default; it decides which half of the library the node looks at. name is a dropdown that only lists existing assets of that kind - pick the victim. library_dir is there for the API/tests and is ignored by execution; the library lives at a fixed location per machine (the plugin's asset_library/ folder, or $MIE_ASSET_LIBRARY if you set it), so there's no path to fill in.

    The outputs are name and status, both strings. status is where the useful detail lands - it names the asset, counts the files removed and prints the directory that got deleted, so you can see exactly what went.

    A scene delete removes scenes/<name>/ (JSON plus picture). A character delete removes characters/<name>/ (JSON, image, audio), because a scene has no voice or audio to worry about in the first place.

    Install

    Through ComfyUI Manager (search ComfyUI_MieNodes) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
    pip install -r ComfyUI-MieNodes/requirements.txt
    

    Nothing to download for this one; it's filesystem work. The two-click button comes from the pack's own JS, so if the button is missing after install, you're looking at a cached old frontend - hard-refresh the browser before you conclude the node is broken.

    Things that go wrong

    character delete needs a FRESH on-node confirmation is the one you'll meet, and it's almost always Ctrl+Enter. Click the two-step button instead. It also fires when you load a saved workflow whose confirm_token is from last week - correctly, since a saved token isn't a confirmation of anything.

    name showing a placeholder instead of a list means the library has no assets of the selected kind. Flip the kind dropdown before assuming the library is empty; scenes and characters are listed separately.

    And the honest warning: deleting doesn't clean up your graph. Any Load Asset still pointing at that name will fail on its next run. That's deliberate on this pack's part - a missing asset should fail loudly rather than quietly shift every later slot - but it means deleting a character mid-project is a re-pick on every Load node that referenced it. If you're just tidying up, the ๐Ÿ“‚ folder button on the Load/Save nodes opens the library in your file manager, which is sometimes less disruptive than the node.

    Category๐Ÿ‘ MieNodes/๐Ÿ‘ Assets

    Inputs (4)

    NameTypeDefaultDescription
    kindCOMBOcharacter่ต„ไบง็ฑปๅž‹ kind๏ผšcharacter = ่ง’่‰ฒ๏ผˆvoice ้Ÿณ่‰ฒ + ้Ÿณ้ข‘ๆ ทๆœฌ๏ผ‰๏ผ›scene = ๅœบๆ™ฏ๏ผˆๅชๆœ‰ๆ่ฟฐ + ๅ›พ๏ผŒ้Ÿณ่‰ฒ/้Ÿณ้ข‘่ขซๅฟฝ็•ฅ๏ผ‰ใ€‚ Asset kind: character (voice + audio sample) or scene (description + image only; voice/audio are ignored).
    library_dirSTRINGโ€”
    nameCOMBO๏ผˆไธ‹ๆ‹‰้€‰ๆ‹ฉ่ต„ไบง๏ผ‰่ฆๅˆ ้™ค็š„่ต„ไบง๏ผšไธ‹ๆ‹‰ๅชๅˆ—ๆ‰€้€‰็ฑปๅž‹้‡Œๅทฒๆœ‰็š„่ต„ไบงใ€‚ๅˆ ้™คๅ‰้œ€ๅœจ่Š‚็‚นไธŠไธคๅ‡ป็กฎ่ฎค๏ผˆ็ฌฌไบŒๅ‡ปๆŽ’้˜Ÿๆ‰ง่กŒ๏ผ‰ใ€‚ Asset to delete: lists existing assets of the chosen kind only. Deletion requires the node's two-click confirm (the second click queues it).
    confirm_tokenSTRINGโ€”

    Outputs (2)

    NameTypeDescription
    nameSTRINGโ€”
    statusSTRINGโ€”