lllyasviel / lllyasviel/FramePack

Offline running failing due to HunyuanVideoTransformer3DModelPacked

Open
#298 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.3k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

The app is running perfectly fine when internet available

All models downloaded into

`os.environ['HF_HOME'] = os.path.abspath(os.path.realpath(os.path.join(os.path.dirname(__file__), './hf_download')))`

When i set like below

```
# Set local_files_only based on offline mode
local_files_only = args.offline
if local_files_only:
print("Running in OFFLINE mode - using local models only")
# Disable any online connections for HuggingFace when in offline mode
os.environ['HF_HUB_OFFLINE'] = '1'
os.environ['TRANSFORMERS_OFFLINE'] = '1'
os.environ['DIFFUSERS_OFFLINE'] = '1'

# Load models with local_files_only parameter when in offline mode
text_encoder = LlamaModel.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder='text_encoder', torch_dtype=torch.float16, local_files_only=local_files_only).cpu()
text_encoder_2 = CLIPTextModel.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder='text_encoder_2', torch_dtype=torch.float16, local_files_only=local_files_only).cpu()
tokenizer = LlamaTokenizerFast.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder='tokenizer', local_files_only=local_files_only)
tokenizer_2 = CLIPTokenizer.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder='tokenizer_2', local_files_only=local_files_only)
vae = AutoencoderKLHunyuanVideo.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder='vae', torch_dtype=torch.float16, local_files_only=local_files_only).cpu()

feature_extractor = SiglipImageProcessor.from_pretrained("lllyasviel/flux_redux_bfl", subfolder='feature_extractor', local_files_only=local_files_only)
image_encoder = SiglipVisionModel.from_pretrained("lllyasviel/flux_redux_bfl", subfolder='image_encoder', torch_dtype=torch.float16, local_files_only=local_files_only).cpu()

transformer = HunyuanVideoTransformer3DModelPacked.from_pretrained('lllyasviel/FramePackI2V_HY', torch_dtype=torch.bfloat16, local_files_only=local_files_only).cpu()

```

and run with turning off internet i get below error

`local_files_only = set as True`

```
Running in OFFLINE mode - using local models only
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 262.52it/s]
Traceback (most recent call last):
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connection.py", line 198, in _new_conn
sock = connection.create_connection(
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
response = self._make_request(
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connectionpool.py", line 488, in _make_request
raise new_e
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connectionpool.py", line 464, in _make_request
self._validate_conn(conn)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connectionpool.py", line 1093, in _validate_conn
conn.connect()
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connection.py", line 704, in connect
self.sock = sock = self._new_conn()
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connection.py", line 205, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: : Failed to resolve 'huggingface.co' ([Errno 11001] getaddrinfo failed)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\connectionpool.py", line 841, in urlopen
retries = retries.increment(
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\urllib3\util\retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/lllyasviel/FramePackI2V_HY (Caused by NameResolutionError(": Failed to resolve 'huggingface.co' ([Errno 11001] getaddrinfo failed)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "Q:\FramePack_v1\FramePack\app.py", line 72, in
transformer = HunyuanVideoTransformer3DModelPacked.from_pretrained('lllyasviel/FramePackI2V_HY', torch_dtype=torch.bfloat16, local_files_only=local_files_only).cpu()
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\diffusers\models\modeling_utils.py", line 1109, in from_pretrained
resolved_model_file, sharded_metadata = _get_checkpoint_shard_files(
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\diffusers\utils\hub_utils.py", line 407, in _get_checkpoint_shard_files
model_files_info = model_info(pretrained_model_name_or_path, revision=revision, token=token)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\huggingface_hub\hf_api.py", line 2591, in model_info
r = get_session().get(path, headers=headers, timeout=timeout, params=params)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\requests\sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\huggingface_hub\utils\_http.py", line 96, in send
return super().send(request, *args, **kwargs)
File "Q:\FramePack_v1\FramePack\venv\lib\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: (MaxRetryError('HTTPSConnectionPool(host=\'huggingface.co\', port=443): Max retries exceeded with url: /api/models/lllyasviel/FramePackI2V_HY (Caused by NameResolutionError(": Failed to resolve \'huggingface.co\' ([Errno 11001] getaddrinfo failed)"))'), '(Request ID: bdfab3f1-d0b6-4824-aec5-0635667a58ac)')
Press any key to continue . . .
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at app.py line 72 and inspect the HunyuanVideoTransformer3DModelPacked.from_pretrained call and its offline-loading path. Reproduce with the offline flag and local model files; done means the transformer loads without attempting to contact huggingface.co when internet access is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.