Skip to content

fix: exclude LoRA Manager sidecar .metadata.json from resume scan - #985

Open
smhc wants to merge 1 commit into
ostris:mainfrom
smhc:fix/resume-picks-lora-manager-metadata
Open

fix: exclude LoRA Manager sidecar .metadata.json from resume scan#985
smhc wants to merge 1 commit into
ostris:mainfrom
smhc:fix/resume-picks-lora-manager-metadata

Conversation

@smhc

@smhc smhc commented Jul 30, 2026

Copy link
Copy Markdown

get_latest_save_path() uses a broad glob pattern (f"{name}*{post}") that matches .metadata.json sidecar files written by model managers like the ComfyUI LoRA Manager. These sidecars have a later ctime than the matching .safetensors checkpoints, so max() picks them as the latest save path.

When torch.load() is then called on the .metadata.json file, it fails with:

WeightsUnpickler error: Unsupported operand 123

because JSON is not a valid pickle format.

Fix: filter out .metadata.json from the candidate paths list, following the same pattern as the existing false-positive filters (_LoRA, _refiner, _t2i, _cn).

get_latest_save_path() uses a broad glob pattern (f"{name}*{post}")
that matches .metadata.json sidecar files written by model managers
like the ComfyUI LoRA Manager. These sidecars have a later ctime
than the matching .safetensors checkpoints, so max() picks them
as the latest save path.

When torch.load() is then called on the .metadata.json file,
it fails with:
  WeightsUnpickler error: Unsupported operand 123
because JSON is not a valid pickle/safetensors format.

Fix: filter out .metadata.json from the candidate paths list,
following the same pattern as the existing false-positive filters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant