fix interrogate caption with t5

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-12-28 08:43:35 -05:00
parent 43b1035324
commit b1f4f9203a
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -15,6 +15,7 @@
- Fix: live preview image sizes in modern and standard UI
- Fix: image width/height calculation when doing img2img
- Fix: Flux pipeline switches: txt/img/inpaint
- Fix: Interrogate caption with T5
## Update for 2024-12-24
+5 -2
View File
@@ -248,14 +248,16 @@ def update_interrogate_params(caption_max_length, chunk_size, min_flavors, max_f
def get_clip_models():
import open_clip
return ['/'.join(x) for x in open_clip.list_pretrained()]
models = sorted(open_clip.list_pretrained())
shared.log.info(f'Interrogate: pkg=openclip version={open_clip.__version__} models={len(models)}')
return ['/'.join(x) for x in models]
def load_interrogator(clip_model, blip_model):
from installer import install
install('clip_interrogator==0.6.0')
import clip_interrogator
clip_interrogator.CAPTION_MODELS = caption_models
clip_interrogator.clip_interrogator.CAPTION_MODELS = caption_models
global ci # pylint: disable=global-statement
if ci is None:
interrogator_config = clip_interrogator.Config(
@@ -329,6 +331,7 @@ def interrogate_image(image, clip_model, blip_model, mode):
except Exception as e:
prompt = f"Exception {type(e)}"
shared.log.error(f'Interrogate: {e}')
errors.display(e, 'Interrogate')
shared.state.end()
return prompt