fix: exclude LoRA Manager sidecar .metadata.json from resume scan - #985
Open
smhc wants to merge 1 commit into
Open
fix: exclude LoRA Manager sidecar .metadata.json from resume scan#985smhc wants to merge 1 commit into
smhc wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_latest_save_path()uses a broad glob pattern (f"{name}*{post}") that matches.metadata.jsonsidecar files written by model managers like the ComfyUI LoRA Manager. These sidecars have a later ctime than the matching.safetensorscheckpoints, somax()picks them as the latest save path.When
torch.load()is then called on the.metadata.jsonfile, it fails with:because JSON is not a valid pickle format.
Fix: filter out
.metadata.jsonfrom the candidate paths list, following the same pattern as the existing false-positive filters (_LoRA,_refiner,_t2i,_cn).