Skip to content

comfyui: install --reinstall deletes the user's models, saved workflows and outputs without warning #530

Closed

Description

@rominf

Current behavior

rocm comfyui install --reinstall calls fs::remove_dir_all on the ComfyUI source folder as soon as the flag is set (apps/rocm/src/comfyui.rs, install), before downloading anything. That folder holds everything the user has added to ComfyUI:

  • source/models: the folder rocm comfyui models-path returns and the install and status output prints as models path:.
  • source/user: saved workflows. start() runs main.py from source without --user-directory.
  • source/output: generated images. start() runs without --output-directory.

There is no prompt, backup or move-aside, and --dry-run doesn't mention the deletion. The install command it prints also leaves --reinstall out. If the download then fails, the user has neither an install nor their data.

Expected behavior

A reinstall replaces ComfyUI's code but keeps models/, user/ and output/, or at minimum states plainly, in the plan and the dry run, that they will be deleted.

Steps to reproduce

  1. Have a ComfyUI install, with a file in source/models/checkpoints/, a saved workflow in source/user/default/workflows/, and an image in source/output/.
  2. Point the source download at an unreachable URL, so step 3 fails after the deletion.
  3. rocm comfyui install --reinstall

Observed: Downloading ComfyUI source... and then Error: failed to download …, exit 1. Afterwards the ComfyUI directory holds only downloads/ and logs/; the model, workflow and image are gone. With a working download the result is the same, but you get a fresh install.

--reinstall --dry-run prints the models path and an install command with no --reinstall and no mention of deletion.

Possible solution

Download and unpack the new source into a staging directory first. Then swap it in, carrying models/, user/ and output/ across, or start ComfyUI with --output-directory/--user-directory/an extra-models config that points outside source, so a reinstall never touches them. The dry run should state what a reinstall replaces.

Environment

Built from main. Platform-independent.

How it was found

Property-testing every recursive-deletion site against a real filesystem, then reproduced with the built binary in a sandbox.

Activity

  1. added a commit that references this issue on Oct 13, 2026
    5a88166
  2. added a commit that references this issue on Oct 13, 2026
    ee3131b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions