Skip to main content

HuggingFace Guess

A simple tool to guess an HuggingFace repo URL from a state dict.

This repo does almost the same thing as from diffusers.loaders.single_file_utils import fetch_diffusers_config but a bit stronger and more robust.

The main model detection logics are extracted from Diffusers and stolen from ComfyUI.

import safetensors.torch as sf
import huggingface_guess


state_dict = sf.load_file('./realisticVisionV51_v51VAE.safetensors')
repo_name = huggingface_guess.guess_repo_name(state_dict)
print(repo_name)

The above codes will print runwayml/stable-diffusion-v1-5.

Then you can download (or prefetch configs) from HuggingFace to instantiate models and load weights.

Metadata

Release files for huggingface-guess 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for huggingface-guess 0.1.0
File Size Uploaded
huggingface_guess-0.1.0.tar.gz 30.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for huggingface-guess 0.1.0
File Interpreter ABI Platform
huggingface_guess-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.0 kB

Release files / huggingface_guess-0.1.0.tar.gz

Download URL huggingface_guess-0.1.0.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
285c8281e72508b522e68eb0cf605220a7335d7f0cfff75c5f537a7ac5d5d3ba
BLAKE2b-256 checksum
How to use checksums
fec7dd98df73ae1754c06cfb979f92da61717e98b4d05f38448d4d7b8a0b820b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / huggingface_guess-0.1.0-py3-none-any.whl

Download URL huggingface_guess-0.1.0-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
226d44ef678c2cccba8a8532d27f8cd257370d3ebb093475e1c69814fbe3873b
BLAKE2b-256 checksum
How to use checksums
27a5e4bb5fcf5ddcdc810b4a53baa66f4d2f2b521780b1ed9bea177fc1323928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page