You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Eva clip does not work in forge. Therefore, pulid is incompatible. I am no pro but I like AI. So I leave it to the coders and professionals. But would the following code alterations be a good start for getting it to work in forge?
After looking at Forge's structure, a good starting point would be modules/core/clip.py as this is where Forge handles its CLIP implementations. Here's a suggested minimal-impact approach:
First, examine modules/core/clip.py:
# Add EVA support while maintaining existing structurefromtransformersimportCLIPProcessor, CLIPModelclassClipImplementation:
def__init__(self):
self.clip_type=Noneself.model=Nonedefload_eva(self, model_name):
self.clip_type='eva'self.model=CLIPModel.from_pretrained(model_name)
self.processor=CLIPProcessor.from_pretrained(model_name)
returnself# This preserves Forge's existing clip handling while adding EVA supportdefencode_text(self, text):
ifself.clip_type=='eva':
returnself._encode_eva_text(text)
returnself._encode_original_text(text) # existing methoddef_encode_eva_text(self, text):
# EVA specific encodinginputs=self.processor(text=text, return_tensors="pt", padding=True)
returnself.model.get_text_features(**inputs)
Then modify modules/core/implementations.py to add EVA as an option:
Currently, Eva clip does not work in forge. Therefore, pulid is incompatible. I am no pro but I like AI. So I leave it to the coders and professionals. But would the following code alterations be a good start for getting it to work in forge?
After looking at Forge's structure, a good starting point would be
modules/core/clip.py
as this is where Forge handles its CLIP implementations. Here's a suggested minimal-impact approach:modules/core/clip.py
:modules/core/implementations.py
to add EVA as an option:This approach:
Can anyone weigh in?
The text was updated successfully, but these errors were encountered: