CONVERSATIONS · THE PRESERVED RECORD
A question.
A conversation worth keeping.
The original exchange, kept in context—ready to read, revisit, and explore.
Begin reading ↗Yeah, that combo of:
> Stable diffusion model failed to load
> and
> OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'
after a clean venv rebuild tells us something pretty specific:
- A1111 itself is fine
- Your SD 1.5 checkpoints are fine
- The failure is entirely in trying to pull that CLIP tokenizer from HuggingFace
- And Transformers ends up with no valid vocab file, so the model load aborts
At this point it’s one of three things:
- Something local is still shadowing that model id
- The HuggingFace cache for it is broken (we already cleared once)
- Or ouqway can’t actually fetch that model cleanly from HF (network / TLS / whatever)
Rather than keep smacking the same code, here’s a concrete step-by-step path you can follow and interpret on your own.
1️⃣ Double-check no local folder is shadowing openai/clip-vit-large-patch14
From the webui dir:
cd ~/ai/stable-diffusion-webui
find . -maxdepth 5 -type d \( -name "openai" -o -name "clip-vit-large-patch14" \)
Interpretation:
- If this prints only stuff under
./venv/lib/python3.10/site-packages→ that’s fine, ignore. - If it prints something like
./openaior./models/openai(outsidevenv/) → that can confusefrom_pretrained.
If you see a top-level ./openai or similar that clearly isn’t the Python package, temporarily rename it:
mv openai openai.bak # adjust path if needed
Leave the venv’s site-packages/openai alone.
2️⃣ Check whether ougway can actually reach HuggingFace
Still on ougway:
curl -I https://huggingface.co/openai/clip-vit-large-patch14
You’ll either see:
HTTP/2 200or a redirect → network OK, HF is reachable- Some TLS error, timeout, name lookup issue → network problem, Transformers will never be able to fetch that model automatically
If the curl fails, that’s your root cause: the machine simply can’t pull from HF, and every attempt to auto-download the tokenizer will die. In that case the “fix” is either:
- fix whatever is blocking HF (DNS, firewall, ESM, etc.), or
- manually download the tokenizer files on another machine and copy them into
~/.cache/huggingfaceon ougway (totally doable, just more manual).
3️⃣ If HF is reachable, but the tokenizer still errors
Then likely it’s a compatibility mismatch:
- HF model layout changed
- A1111’s pinned
transformersversion doesn’t parse it correctly - so
vocab_filein the config ends up asNone
In that case, inside the A1111 venv (after the fresh rebuild you just did):
cd ~/ai/stable-diffusion-webui
source venv/bin/activate
pip install --upgrade "transformers>=4.42.0" "huggingface_hub>=0.23.0"
rm -rf ~/.cache/huggingface
Then re-run the test:
python - << 'EOF'
from transformers import CLIPTokenizer
print("Downloading CLIP tokenizer...")
tok = CLIPTokenizer.from_pretrained("openai/clip-vit-large-patch14")
print("Done, vocab size:", tok.vocab_size)
EOF
If that finally prints:
Downloading CLIP tokenizer...
Done, vocab size: 49408
…then CLIP is fixed and cached. Restart:
./webui.sh --xformers
Select v1-5-pruned.safetensors, try a simple prompt, and it should now happily generate.
4️⃣ Reality check / fallback
If:
curlto HuggingFace fails, or- even with upgraded
transformersand a clear cache, the tokenizer still can’t load,
then you have two pragmatic options:
-
We work around this by manually seeding the tokenizer.
– Download theopenai/clip-vit-large-patch14files on another machine using a browser orhuggingface-cli
– Copy them into ougway’s~/.cache/huggingface/hub/models--openai--clip-vit-large-patch14/...
– Once those files exist locally, A1111/transformers will happily use them without trying to pull from the network. -
Or we sidestep this specific CLIP dependency entirely.
Since SD 1.5 itself doesn’t inherently need HF’s CLIP repo, we can:
– temporarily disable any features/extensions that call that model, or
– use a different UI (e.g. ComfyUI) that bundles only the CLIP it actually needs for SD 1.5.
You’ve done all the “right” moves so far:
- fresh venv
- proper 3.10
- A1111 from git
- checkpoints in place
What’s blocking you now is purely:
> something about how this environment is fetching or parsing openai/clip-vit-large-patch14.
The shortest path from here is:
- run that
curlcheck yourself - decide whether you’d rather:
- upgrade transformers and let HF handle it, or
- go fully manual (download-and-copy tokenizer once and forget about it).
If you tell me:
- whether
curl -I https://huggingface.co/openai/clip-vit-large-patch14works,
I can give you a very specific “do this next” branch instead of broad options.
i found some help on the web that suggested to try upgrading transformers so I did and it did do upgrades then upgraded pip as well re removed and am installing again … this error comes up at start of install though
Cannot locate TCMalloc. Do you have tcmalloc or google-perftool installed on your system? (improves CPU memory usage)
Yeah, that TCMalloc message is nothing to worry about. 😊
That line:
> Cannot locate TCMalloc. Do you have tcmalloc or google-perftool installed on your system? (improves CPU memory usage)
is just AUTOMATIC1111 being chatty. It’s saying:
- “If you install this extra library, I can use a slightly better memory allocator.”
- It is optional.
- It does not block Stable Diffusion from working.
- It has nothing to do with the CLIP tokenizer issue.
By default, most people just ignore it.
If you want to get rid of the warning (optional)
You can install it like this:
sudo apt install google-perftools
That package provides libtcmalloc, and on a lot of systems A1111 will auto-detect it next run and stop complaining.
But it is purely a nice-to-have.
It does not affect GPU rendering or whether SD runs.
What I’d do right now
Since you:
- upgraded
transformers - wiped/reinstalled the venv/webui
- are running the installer again
I’d just let this TCMalloc message go, finish the install, then:
- Start the web UI
- Make sure
v1-5-pruned.safetensorsis selected as checkpoint - Try a simple prompt again
- See if the CLIP error still appears or not
If SD generates an image, TCMalloc is officially a non-issue.
If the CLIP tokenizer error shows up again, we’ll treat that as the next (and only) problem to solve and I’ll walk you through a manual “download tokenizer once, drop it in the right place” fix so we can force it to shut up.
For now:
✅ You can safely ignore the TCMalloc warning and keep going.
