From a4309110284cdb7a21c6430fd9a301deda809f87 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 17 Jun 2024 11:13:55 -0400 Subject: [PATCH] fix t2i-color adapter --- CHANGELOG.md | 1 + modules/control/units/t2iadapter.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad593c8c5..d0b2d7722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - fix starting from non git repo - fix control api negative prompt handling - fix saving style without name provided +- fix t2i-color adapter - restructure api examples: `cli/api-*` - handle theme fallback when invalid theme is specified - remove obsolete training code leftovers diff --git a/modules/control/units/t2iadapter.py b/modules/control/units/t2iadapter.py index 1c481398b..80eca41dd 100644 --- a/modules/control/units/t2iadapter.py +++ b/modules/control/units/t2iadapter.py @@ -74,7 +74,7 @@ class Adapter(): self.model_id: str = model_id self.device = device self.dtype = dtype - self.load_config = { 'cache_dir': cache_dir } + self.load_config = { 'cache_dir': cache_dir, 'use_safetensors': False } if load_config is not None: self.load_config.update(load_config) if model_id is not None: @@ -101,7 +101,7 @@ class Adapter(): log.error(f'Control {what} model load failed: id="{model_id}" error=unknown model id') return log.debug(f'Control {what} model loading: id="{model_id}" path="{model_path}"') - if model_path.endswith('.pth') or model_path.endswith('.pt') or model_path.endswith('.safetensors'): + if model_path.endswith('.pth') or model_path.endswith('.pt') or model_path.endswith('.safetensors') or model_path.endswith('.bin'): from huggingface_hub import hf_hub_download parts = model_path.split('/') repo_id = f'{parts[0]}/{parts[1]}'