A Cleanup Script Deleted the ComfyUI Folder: Recover the Workflow and Outputs Safely

kiki
kiki updated
5 min(s)
robot TL;DR:

Recover a deleted ComfyUI folder by immediately stopping all writes to the affected storage and prioritizing the extraction of irreplaceable workflow JSON files or generated PNG outputs over re-downloading replaceable models and LoRAs.
    ● Export workflows directly from active browser sessions or load surviving ComfyUI PNG images to retrieve embedded prompt metadata, ensuring all recovered files are saved to a separate healthy drive.
    ● Pause all package installs, image generation, and ComfyUI reinstallations to prevent data overwriting, as SSD TRIM makes permanent file recovery unpredictable.
    ● When utilizing Recoverit File Recovery after native options are exhausted, note that recovery is not guaranteed and raw recovery may strip uncommon workflow files of their original names or folder paths.


Ask AI for a summary

In this ComfyUI file-loss case on Reddit, the user built a batch file to clear the input and output folders and empty the Recycle Bin. After changing the script path, running it deleted the entire ComfyUI folder. The user later recovered the master workflow from a browser-cached copy, but models and LoRAs had to be rebuilt or downloaded again. The safest priority is to recover irreplaceable workflows and outputs before spending time on replaceable model files.

Look for an Intact Workflow Copy Before Scanning the Drive

If ComfyUI is still open in a browser tab, or another machine, backup, or generated image contains the workflow, save that copy to a different healthy drive first. The official ComfyUI project supports saving and loading workflows as JSON and recovering complete workflows and seeds from supported generated media. Its SaveImage documentation also says PNG output can contain embedded workflow and prompt metadata when metadata is enabled.

Recover the Hardest-to-Replace Item First
  • A workflow is still open or cached: Export or save it to another drive before closing the session.
  • A surviving ComfyUI PNG exists: Load it in ComfyUI and check whether its embedded workflow metadata is intact.
  • Only models or LoRAs are missing: Re-download replaceable files where possible instead of writing more data to the affected drive while searching for irreplaceable work.

Stop Writing to the Drive If the Folder Was Permanently Deleted

If the cleanup script also emptied the Recycle Bin and no intact workflow or output copy remains, pause ComfyUI, model downloads, package installs, image generation, and other writes to the affected storage. Deleted-file space can be reused by new data, and SSD TRIM can make recovery less predictable. Do not reinstall ComfyUI into the same deleted folder before protecting the files you still need.

When Local File Recovery Becomes Relevant

If the drive is stable and readable, Recoverit File Recovery can scan the local storage for deleted files after native copies and ComfyUI recovery paths are exhausted. Prioritize workflow files and irreplaceable outputs, recover them to a different healthy drive, and verify each result before rebuilding the environment. Recovery is not guaranteed after overwrite or SSD TRIM, and an uncommon workflow file may not retain its original name or folder path after raw recovery.

Free Download
Free Download