Added comparitive loss when training clip encoder. Allow selecting clip layer. on ip adapter. Improvements to prior prediction
This commit is contained in:
@@ -130,6 +130,7 @@ class NetworkConfig:
|
||||
|
||||
AdapterTypes = Literal['t2i', 'ip', 'ip+', 'clip', 'ilora', 'photo_maker']
|
||||
|
||||
CLIPLayer = Literal['penultimate_hidden_states', 'image_embeds', 'last_hidden_state']
|
||||
|
||||
class AdapterConfig:
|
||||
def __init__(self, **kwargs):
|
||||
@@ -169,6 +170,13 @@ class AdapterConfig:
|
||||
|
||||
self.class_names = kwargs.get('class_names', [])
|
||||
|
||||
self.clip_layer: CLIPLayer = kwargs.get('clip_layer', None)
|
||||
if self.clip_layer is None:
|
||||
if self.type.startswith('ip+'):
|
||||
self.clip_layer = 'penultimate_hidden_states'
|
||||
else:
|
||||
self.clip_layer = 'last_hidden_state'
|
||||
|
||||
|
||||
class EmbeddingConfig:
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user