Model Short Hash Extractor:
MarModelShortHashExtractor creates a short identifier for a checkpoint or diffusion model file. It calculates the file’s SHA-256 hash and returns its first 10 hexadecimal characters, matching the format described by the node as Civitai AutoV2. This can help you identify a specific model file without displaying a full-length hash. The node reads the entire file in 4 MB chunks, which limits memory use while hashing large models; it does not hash only a small portion of the file.
Model Short Hash Extractor Input Parameters:
model_filename
A required STRING input supplied through a connection. Provide the model filename that you want to identify. The node removes whitespace from the beginning and end, then looks for the file in the checkpoints folder first and the diffusion_models folder second. The file it finds determines the hash, so a filename present in both folders refers to the checkpoint copy when that copy exists. An empty value or the exact text None produces an empty result. No default value, minimum or maximum length, or selectable options are defined in the source.
Model Short Hash Extractor Output Parameters:
short_hash
A STRING containing the first 10 hexadecimal characters of the model file’s SHA-256 hash when hashing succeeds. This identifies the contents of the file rather than just its name: renaming a file without changing its contents does not change the calculated value. If the input is empty or exactly None, this output is an empty string. If the file cannot be found, it contains Error: `{filename}` not found; if reading or hashing fails, it contains Error: {exception message}. Check for those cases before treating the output as a valid hash.
Model Short Hash Extractor Usage Tips:
- Connect a model filename from another node to
model_filename. Use a name that resolves to a file in the checkpoints or diffusion_models folder. - If you have files with the same name in both folders, remember that the checkpoint file takes priority. Check which file is being found before relying on the result.
- Allow time for large models: the node reads the entire file to calculate its hash. Its 4 MB read chunks reduce memory use, but do not avoid disk reading.
- Treat a valid result as a 10-character identifier. An empty string or a string beginning with
Error:is not a calculated hash.
Model Short Hash Extractor Common Errors and Solutions:
Error: `{filename}` not found
- Explanation: The node could not find an existing file with that name in either the checkpoints or diffusion_models folder.
- Solution: Check the filename, including its extension, and confirm the file is in one of those folders. If you recently added it, make sure the application can see the file before running the node again.
Empty short_hash
- Explanation: The input was empty or was exactly
None. This is a defined result, not a calculated hash. - Solution: Connect a source that supplies a nonempty model filename and check the value it sends to the node.
Error: [Errno 13] Permission denied: ...
- Explanation: The node found a file path but could not read the file. The precise exception text can vary by system.
- Solution: Check that the application has permission to read the model file and its containing folder, then try again.
Error: [Errno 2] No such file or directory: ...
- Explanation: A file that appeared to exist during the initial check was unavailable when the node tried to open it, for example because it was moved or removed.
- Solution: Confirm that the file is still in place and accessible, then run the node again.
Error: {exception message}
- Explanation: An unexpected problem occurred while opening, reading, or hashing the file. The node returns the underlying exception message after
Error:. - Solution: Read that message for the specific cause. Check the file’s availability and readability; if the problem continues, use the full returned message when troubleshooting.
