(self, model, ipadapter, image, weight, start_at, end_at, weight_type, attn_mask=None)
| 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 | |
| 754 | class IPAdapterAdvanced: |
| 755 | def __init__(self): |
nothing calls this directly
no test coverage detected