Add clip skip option to prompt node

This commit is contained in:
Sergey Borisov
2023-07-06 16:09:40 +03:00
parent 94e38e9769
commit 04b57c408f
2 changed files with 20 additions and 0 deletions

View File

@ -44,6 +44,7 @@ class CompelInvocation(BaseInvocation):
prompt: str = Field(default="", description="Prompt")
clip: ClipField = Field(None, description="Clip to use")
clip_skip: int = Field(0, description="Layers to skip in text_encoder")
# Schema customisation
class Config(InvocationConfig):
@ -95,6 +96,7 @@ class CompelInvocation(BaseInvocation):
with ModelPatcher.apply_lora_text_encoder(text_encoder_info.context.model, _lora_loader()),\
ModelPatcher.apply_ti(tokenizer_info.context.model, text_encoder_info.context.model, ti_list) as (tokenizer, ti_manager),\
ModelPatcher.apply_clip_skip(text_encoder_info.context.model, self.clip_skip),\
text_encoder_info as text_encoder:
compel = Compel(