reference load cleanup

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2025-10-25 23:25:10 -04:00
parent cffca11d5b
commit 512036d291
6 changed files with 28 additions and 18 deletions
+5 -5
View File
@@ -79,7 +79,7 @@ def download_diffusers_model(hub_id: str, cache_dir: str = None, download_config
download_config["mirror"] = mirror
if custom_pipeline is not None and len(custom_pipeline) > 0:
download_config["custom_pipeline"] = custom_pipeline
shared.log.debug(f'Diffusers downloading: id="{hub_id}" args={download_config}')
shared.log.debug(f'HF download: id="{hub_id}" args={download_config}')
token = token or shared.opts.huggingface_token
if token is not None and len(token) > 2:
hf_login(token)
@@ -94,20 +94,20 @@ def download_diffusers_model(hub_id: str, cache_dir: str = None, download_config
except Exception as e:
err = e
ok = False
debug(f'Diffusers download error: id="{hub_id}" {e}')
debug(f'HF download error: id="{hub_id}" {e}')
if not ok and 'Repository Not Found' not in str(err):
try:
download_config.pop('load_connected_pipeline', None)
download_config.pop('variant', None)
pipeline_dir = hf.snapshot_download(hub_id, **download_config)
except Exception as e:
debug(f'Diffusers download error: id="{hub_id}" {e}')
debug(f'HF download error: id="{hub_id}" {e}')
if 'gated' in str(e):
shared.log.error(f'Diffusers download error: id="{hub_id}" model access requires login')
shared.log.error(f'HF download error: id="{hub_id}" model access requires login')
shared.state.end(jobid)
return None
if pipeline_dir is None:
shared.log.error(f'Diffusers download error: id="{hub_id}" {err}')
shared.log.error(f'HF download error: id="{hub_id}" {err}')
shared.state.end(jobid)
return None
try: