fix(model-manager): support offline Qwen3 tokenizer loading for Z-Image#8719
Merged
lstein merged 8 commits intoinvoke-ai:mainfrom Jan 2, 2026
Merged
Conversation
Add local_files_only fallback for Qwen3 tokenizer loading in both Checkpoint and GGUF loaders. This ensures Z-Image models can generate images offline after the initial tokenizer download. The tokenizer is now loaded with local_files_only=True first, falling back to network download only if files aren't cached yet. Fixes invoke-ai#8716
lstein
requested changes
Dec 29, 2025
Collaborator
There was a problem hiding this comment.
It works offline when the encoder is being loaded from the Z-Image model and the optional encoder field is empty.
However, when the encoder is specified separately, I still get connection errors. I am using the following Advanced settings:
- VAE: FLUX.1-schnell_ae
- Qwen3 Encoder: Z-Image Qwen3 Text Encoder (quantized)
- Qwen3 Source: Empty
The error message is:
requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/Qwen/Qwen3-4B (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7c68aa02f860>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: 021583db-0ea3-4ab1-971e-a078e8ec1351)')
Add local_files_only parameter for Qwen3 tokenizer and text encoder loading in all three loader types: - Qwen3EncoderLoader (directory format): now uses local_files_only=True for both tokenizer and text encoder since files are already local - Qwen3EncoderCheckpointLoader (safetensors): tries local cache first, falls back to network download if not cached - Qwen3EncoderGGUFLoader (GGUF): same fallback behavior as checkpoint This ensures Z-Image models can generate images offline after the initial tokenizer download, regardless of whether the encoder is embedded in the main model or specified separately.
…com/Pfannkuchensack/InvokeAI into fix/qwen3-tokenizer-offline-support
Collaborator
Author
|
Ok now all the cases should use the "local_files_only=True" option |
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.
Summary
Add local_files_only fallback for Qwen3 tokenizer loading in both Checkpoint and GGUF loaders. This ensures Z-Image models can generate images offline after the initial tokenizer download.
The tokenizer is now loaded with local_files_only=True first, falling back to network download only if files aren't cached yet.
Fixes #8716
Related Issues / Discussions
#8716
QA Instructions
Merge Plan
No special merge considerations required.
Checklist
What's Newcopy (if doing a release after this PR)