Skip to content

Repository files navigation

SwarmModelSync

SwarmModelSync adds a native Utilities → Model Sync view to SwarmUI for comparing and synchronizing model files across trusted SwarmUI instances. It covers every model category registered in SwarmUI, including checkpoints, diffusion models, LoRAs, VAEs, embeddings, ControlNets, CLIP, and CLIP Vision.

Features

  • Compare local and peer inventories by model type, relative name, and file size.
  • Automatically discovers compatible enabled Swarm-API-Backend entries already configured in SwarmUI.
  • Probe full-file SHA-256 hashes on either side to verify matching files.
  • Pull models from a peer or push local models to it with live background progress.
  • Bulk-select filtered models for transfer or probing.
  • Explicitly remove selected models from this instance, the peer, or both.
  • Refreshes the affected SwarmUI model list immediately after a successful transfer.
  • Reuses each backend's configured address, authorization header, additional headers, and SwarmUI session.
  • Uses standard Download Models / Delete Models permissions.

Install

Clone the repository into SwarmUI's extension directory, then restart SwarmUI:

Set-Location SwarmUI/src/Extensions
git clone https://github.com/tbbbtbbbtbbb/SwarmUI-ModelSync.git

Install the extension on every instance that will participate in synchronization. No ComfyUI nodes, Python packages, services, or other dependencies are required.

Configure the other instance as a normal Swarm-API-Backend in SwarmUI, including any required AuthorizationHeader or OtherHeaders. Then open Utilities → Model Sync. Compatible configured backends are discovered automatically; there is no separate address or credential configuration in this extension.

SwarmUI's InstallExtension HTTP API can install only names present in SwarmUI's public extension catalog; it does not accept an arbitrary Git URL. Once this repository is added to that catalog, an administrator can automate installation by creating a session and posting extensionName to /API/InstallExtension. Until then, automate the git clone command above and restart SwarmUI normally.

Transfer safety

  • A peer connection must authenticate through SwarmUI and have the appropriate core permissions.
  • Model bytes use a random, one-use capability that expires after ten minutes.
  • Model names are normalized and constrained to the configured model-type download folder.
  • Incoming data is written to a uniquely named .partial file.
  • Capability-authorized uploads raise SwarmUI's request-body limit only for that one transfer and only to the model's exact approved size, so multi-gigabyte models work without weakening the server-wide API limit.
  • Byte count and SHA-256 are verified before the file is moved into place.
  • Existing model names and files are never overwritten. Remove the destination explicitly before replacing a differing model.
  • Delete actions require a separate confirmation and use each instance's configured model recycle/deletion behavior.

Treat peer backend configuration as administrative access. Prefer HTTPS for any connection that leaves a trusted private network.

Isolated development peers

dev/isolated-test-peers.ps1 starts two temporary SwarmUI processes on ports 7811 and 7812. Each uses its own settings, data, output, backend, and model roots beneath .test-runtime; it does not read or modify the normal SwarmUI configuration.

./dev/isolated-test-peers.ps1 Start
./dev/isolated-test-peers.ps1 Status
./dev/isolated-test-peers.ps1 Stop
./dev/isolated-test-peers.ps1 Reset

The script seeds tiny synthetic .safetensors fixtures and configures Peer B as a normal Swarm backend on Peer A for discovery and transfer testing. It only stops PIDs whose recorded command line points to its isolated settings files.

Current scope

The main model file is synchronized. SwarmUI rebuilds its own model metadata cache after receipt; adjacent third-party preview and sidecar files are not transferred in this initial version.

License

MIT

About

Native-feeling peer model inventory and synchronization for SwarmUI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages