add kandinsky3 support

This commit is contained in:
Vladimir Mandic
2023-11-25 13:27:16 -05:00
parent a6a3216d2e
commit 1502dc2e13
5 changed files with 22 additions and 10 deletions
+6 -6
View File
@@ -58,12 +58,6 @@ class Script(scripts.Script):
if shared.backend != shared.Backend.DIFFUSERS:
shared.log.warning('IP adapter: not in diffusers mode')
return
if not hasattr(shared.sd_model, 'load_ip_adapter'):
shared.log.error(f'IP adapter: pipeline not supported: {shared.sd_model.__class__.__name__}')
return
if image is None:
shared.log.error('IP adapter: no image')
return
if adapter == 'none':
if hasattr(shared.sd_model, 'set_ip_adapter_scale'):
shared.sd_model.set_ip_adapter_scale(0)
@@ -73,6 +67,12 @@ class Script(scripts.Script):
shared.sd_model.unet.config.encoder_hid_dim_type = None
loaded = None
return
if image is None:
shared.log.error('IP adapter: no image')
return
if not hasattr(shared.sd_model, 'load_ip_adapter'):
shared.log.error(f'IP adapter: pipeline not supported: {shared.sd_model.__class__.__name__}')
return
if getattr(shared.sd_model, 'image_encoder', None) is None:
if shared.sd_model_type == 'sd':
subfolder = 'models/image_encoder'