You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to pass the local_files_only flag to the controlnet Processor load_processor function (see controlnet_aux/processor.py)
Code:
defload_processor(self, processor_id: str) ->'Processor':
"""Load controlnet aux processors Args: processor_id (str): processor name Returns: Processor: controlnet aux processor """processor=MODELS[processor_id]['class']
# check if the proecssor is a checkpoint modelifMODELS[processor_id]['checkpoint']:
processor=processor.from_pretrained("lllyasviel/Annotators")
else:
processor=processor()
returnprocessor
That function in-turn calls things such as LeresDetector.from_pretrained which looks like this
LeresDetector.from_pretrained in-turn calls hf_hub_download in order to download the model if the path is not a folder. hf_hub_download takes a local_files_only flag, however it is not being passed here.
Because of this, the hub attempts to access huggingface.co which causes the application to hang when offline.
Proposed fix
Add a local_files_only flag to the Processor and each controlnet class
defload_processor(self, processor_id: str, local_files_only: bool=False) ->'Processor':
"""Load controlnet aux processors Args: processor_id (str): processor name Returns: Processor: controlnet aux processor """processor=MODELS[processor_id]['class']
# check if the proecssor is a checkpoint modelifMODELS[processor_id]['checkpoint']:
processor=processor.from_pretrained("lllyasviel/Annotators", local_files_only=local_files_only)
else:
processor=processor()
returnprocessor
It appears that some of this is already solved in a recent PR, however when I install from main it says I'm on version 0.0.6 rather than something higher than 0.0.7. Additionally the load_processor function does not respect the flag so I will be fixing that and the version.
Describe the bug
There is no way to pass the local_files_only flag to the controlnet Processor
load_processor
function (seecontrolnet_aux/processor.py
)Code:
That function in-turn calls things such as
LeresDetector.from_pretrained
which looks like thisLeresDetector.from_pretrained
in-turn callshf_hub_download
in order to download the model if the path is not a folder.hf_hub_download
takes alocal_files_only
flag, however it is not being passed here.Because of this, the hub attempts to access huggingface.co which causes the application to hang when offline.
Proposed fix
Add a local_files_only flag to the Processor and each controlnet class
Reproduction
Attempt to initialize a processor using the
load_processor
function without an internet connection and see the script hang.Logs
No response
System Info
controlnet_aux >=0.0.7
The text was updated successfully, but these errors were encountered: