MCPcopy Create free account
hub / github.com/cubiq/ComfyUI_IPAdapter_plus / apply_ipadapter

Method apply_ipadapter

IPAdapterPlus.py:729–752  ·  view source on GitHub ↗
(self, model, ipadapter, image, weight, start_at, end_at, weight_type, attn_mask=None)

Source from the content-addressed store, hash-verified

727 CATEGORY = "ipadapter"
728
729 def apply_ipadapter(self, model, ipadapter, image, weight, start_at, end_at, weight_type, attn_mask=None):
730 if weight_type.startswith("style"):
731 weight_type = "style transfer"
732 elif weight_type == "prompt is more important":
733 weight_type = "ease out"
734 else:
735 weight_type = "linear"
736
737 ipa_args = {
738 "image": image,
739 "weight": weight,
740 "start_at": start_at,
741 "end_at": end_at,
742 "attn_mask": attn_mask,
743 "weight_type": weight_type,
744 "insightface": ipadapter['insightface']['model'] if 'insightface' in ipadapter else None,
745 }
746
747 if 'ipadapter' not in ipadapter:
748 raise Exception("IPAdapter model not present in the pipeline. Please load the models with the IPAdapterUnifiedLoader node.")
749 if 'clipvision' not in ipadapter:
750 raise Exception("CLIPVision model not present in the pipeline. Please load the models with the IPAdapterUnifiedLoader node.")
751
752 return ipadapter_execute(model.clone(), ipadapter['ipadapter']['model'], ipadapter['clipvision']['model'], **ipa_args)
753
754class IPAdapterAdvanced:
755 def __init__(self):

Callers

nothing calls this directly

Calls 1

ipadapter_executeFunction · 0.85

Tested by

no test coverage detected