diff --git a/IPAdapterPlus.py b/IPAdapterPlus.py index 782a412..d7cf85b 100644 --- a/IPAdapterPlus.py +++ b/IPAdapterPlus.py @@ -20,9 +20,10 @@ from .resampler import Resampler GLOBAL_MODELS_DIR = os.path.join(folder_paths.models_dir, "ipadapter") MODELS_DIR = GLOBAL_MODELS_DIR if os.path.isdir(GLOBAL_MODELS_DIR) else os.path.join(os.path.dirname(os.path.realpath(__file__)), "models") if "ipadapter" not in folder_paths.folder_names_and_paths: - folder_paths.folder_names_and_paths["ipadapter"] = ([MODELS_DIR], folder_paths.supported_pt_extensions) + current_paths = [MODELS_DIR] else: - folder_paths.folder_names_and_paths["ipadapter"][1].update(folder_paths.supported_pt_extensions) + current_paths, _ = folder_paths.folder_names_and_paths["ipadapter"] +folder_paths.folder_names_and_paths["ipadapter"] = (current_paths, folder_paths.supported_pt_extensions) class MLPProjModel(torch.nn.Module): """SD model with image prompt""" @@ -94,19 +95,10 @@ def image_add_noise(image, noise): def zeroed_hidden_states(clip_vision, batch_size): image = torch.zeros([batch_size, 224, 224, 3]) comfy.model_management.load_model_gpu(clip_vision.patcher) - pixel_values = clip_preprocess(image.to(clip_vision.load_device)) - - if clip_vision.dtype != torch.float32: - precision_scope = torch.autocast - else: - precision_scope = lambda a, b: contextlib.nullcontext(a) - - with precision_scope(comfy.model_management.get_autocast_device(clip_vision.load_device), torch.float32): - outputs = clip_vision.model(pixel_values, intermediate_output=-2) - + pixel_values = clip_preprocess(image.to(clip_vision.load_device)).float() + outputs = clip_vision.model(pixel_values=pixel_values, intermediate_output=-2) # we only need the penultimate hidden states outputs = outputs[1].to(comfy.model_management.intermediate_device()) - return outputs def min_(tensor_list): @@ -211,13 +203,11 @@ class IPAdapter(nn.Module): class CrossAttentionPatch: # forward for patching - def __init__(self, weight, ipadapter, device, dtype, number, cond, uncond, weight_type, mask=None, sigma_start=0.0, sigma_end=1.0, unfold_batch=False): + def __init__(self, weight, ipadapter, number, cond, uncond, weight_type, mask=None, sigma_start=0.0, sigma_end=1.0, unfold_batch=False): self.weights = [weight] self.ipadapters = [ipadapter] self.conds = [cond] self.unconds = [uncond] - self.device = 'cuda' if 'cuda' in device.type else 'cpu' - self.dtype = dtype if 'cuda' in self.device else torch.bfloat16 self.number = number self.weight_type = [weight_type] self.masks = [mask] @@ -228,14 +218,12 @@ class CrossAttentionPatch: self.k_key = str(self.number*2+1) + "_to_k_ip" self.v_key = str(self.number*2+1) + "_to_v_ip" - def set_new_condition(self, weight, ipadapter, device, dtype, number, cond, uncond, weight_type, mask=None, sigma_start=0.0, sigma_end=1.0, unfold_batch=False): + def set_new_condition(self, weight, ipadapter, number, cond, uncond, weight_type, mask=None, sigma_start=0.0, sigma_end=1.0, unfold_batch=False): self.weights.append(weight) self.ipadapters.append(ipadapter) self.conds.append(cond) self.unconds.append(uncond) self.masks.append(mask) - self.device = 'cuda' if 'cuda' in device.type else 'cpu' - self.dtype = dtype if 'cuda' in self.device else torch.bfloat16 self.weight_type.append(weight_type) self.sigma_start.append(sigma_start) self.sigma_end.append(sigma_end) @@ -249,122 +237,121 @@ class CrossAttentionPatch: # extra options for AnimateDiff ad_params = extra_options['ad_params'] if "ad_params" in extra_options else None - with torch.autocast(device_type=self.device, dtype=self.dtype): - q = n - k = context_attn2 - v = value_attn2 - b = q.shape[0] - qs = q.shape[1] - batch_prompt = b // len(cond_or_uncond) - out = optimized_attention(q, k, v, extra_options["n_heads"]) - _, _, lh, lw = extra_options["original_shape"] - - for weight, cond, uncond, ipadapter, mask, weight_type, sigma_start, sigma_end, unfold_batch in zip(self.weights, self.conds, self.unconds, self.ipadapters, self.masks, self.weight_type, self.sigma_start, self.sigma_end, self.unfold_batch): - if sigma > sigma_start or sigma < sigma_end: - continue + q = n + k = context_attn2 + v = value_attn2 + b = q.shape[0] + qs = q.shape[1] + batch_prompt = b // len(cond_or_uncond) + out = optimized_attention(q, k, v, extra_options["n_heads"]) + _, _, lh, lw = extra_options["original_shape"] + + for weight, cond, uncond, ipadapter, mask, weight_type, sigma_start, sigma_end, unfold_batch in zip(self.weights, self.conds, self.unconds, self.ipadapters, self.masks, self.weight_type, self.sigma_start, self.sigma_end, self.unfold_batch): + if sigma > sigma_start or sigma < sigma_end: + continue - if unfold_batch and cond.shape[0] > 1: - # Check AnimateDiff context window - if ad_params is not None and ad_params["sub_idxs"] is not None: - # if images length matches or exceeds full_length get sub_idx images - if cond.shape[0] >= ad_params["full_length"]: - cond = torch.Tensor(cond[ad_params["sub_idxs"]]) - uncond = torch.Tensor(uncond[ad_params["sub_idxs"]]) - # otherwise, need to do more to get proper sub_idxs masks - else: - # check if images length matches full_length - if not, make it match - if cond.shape[0] < ad_params["full_length"]: - cond = torch.cat((cond, cond[-1:].repeat((ad_params["full_length"]-cond.shape[0], 1, 1))), dim=0) - uncond = torch.cat((uncond, uncond[-1:].repeat((ad_params["full_length"]-uncond.shape[0], 1, 1))), dim=0) - # if we have too many remove the excess (should not happen, but just in case) - if cond.shape[0] > ad_params["full_length"]: - cond = cond[:ad_params["full_length"]] - uncond = uncond[:ad_params["full_length"]] - cond = cond[ad_params["sub_idxs"]] - uncond = uncond[ad_params["sub_idxs"]] - - # if we don't have enough reference images repeat the last one until we reach the right size - if cond.shape[0] < batch_prompt: - cond = torch.cat((cond, cond[-1:].repeat((batch_prompt-cond.shape[0], 1, 1))), dim=0) - uncond = torch.cat((uncond, uncond[-1:].repeat((batch_prompt-uncond.shape[0], 1, 1))), dim=0) - # if we have too many remove the exceeding - elif cond.shape[0] > batch_prompt: - cond = cond[:batch_prompt] - uncond = uncond[:batch_prompt] - - k_cond = ipadapter.ip_layers.to_kvs[self.k_key](cond) - k_uncond = ipadapter.ip_layers.to_kvs[self.k_key](uncond) - v_cond = ipadapter.ip_layers.to_kvs[self.v_key](cond) - v_uncond = ipadapter.ip_layers.to_kvs[self.v_key](uncond) - else: - k_cond = ipadapter.ip_layers.to_kvs[self.k_key](cond).repeat(batch_prompt, 1, 1) - k_uncond = ipadapter.ip_layers.to_kvs[self.k_key](uncond).repeat(batch_prompt, 1, 1) - v_cond = ipadapter.ip_layers.to_kvs[self.v_key](cond).repeat(batch_prompt, 1, 1) - v_uncond = ipadapter.ip_layers.to_kvs[self.v_key](uncond).repeat(batch_prompt, 1, 1) - - if weight_type.startswith("linear"): - ip_k = torch.cat([(k_cond, k_uncond)[i] for i in cond_or_uncond], dim=0) * weight - ip_v = torch.cat([(v_cond, v_uncond)[i] for i in cond_or_uncond], dim=0) * weight - else: - ip_k = torch.cat([(k_cond, k_uncond)[i] for i in cond_or_uncond], dim=0) - ip_v = torch.cat([(v_cond, v_uncond)[i] for i in cond_or_uncond], dim=0) - - if weight_type.startswith("channel"): - # code by Lvmin Zhang at Stanford University as also seen on Fooocus IPAdapter implementation - # please read licensing notes https://github.com/lllyasviel/Fooocus/blob/main/fooocus_extras/ip_adapter.py#L225 - ip_v_mean = torch.mean(ip_v, dim=1, keepdim=True) - ip_v_offset = ip_v - ip_v_mean - _, _, C = ip_k.shape - channel_penalty = float(C) / 1280.0 - W = weight * channel_penalty - ip_k = ip_k * W - ip_v = ip_v_offset + ip_v_mean * W - - out_ip = optimized_attention(q, ip_k, ip_v, extra_options["n_heads"]) - if weight_type.startswith("original"): - out_ip = out_ip * weight - - if mask is not None: - # TODO: needs checking - mask_h = max(1, round(lh / math.sqrt(lh * lw / qs))) - mask_w = qs // mask_h - - # check if using AnimateDiff and sliding context window - if (mask.shape[0] > 1 and ad_params is not None and ad_params["sub_idxs"] is not None): - # if mask length matches or exceeds full_length, just get sub_idx masks, resize, and continue - if mask.shape[0] >= ad_params["full_length"]: - mask_downsample = torch.Tensor(mask[ad_params["sub_idxs"]]) - mask_downsample = F.interpolate(mask_downsample.unsqueeze(1), size=(mask_h, mask_w), mode="bicubic").squeeze(1) - # otherwise, need to do more to get proper sub_idxs masks - else: - # resize to needed attention size (to save on memory) - mask_downsample = F.interpolate(mask.unsqueeze(1), size=(mask_h, mask_w), mode="bicubic").squeeze(1) - # check if mask length matches full_length - if not, make it match - if mask_downsample.shape[0] < ad_params["full_length"]: - mask_downsample = torch.cat((mask_downsample, mask_downsample[-1:].repeat((ad_params["full_length"]-mask_downsample.shape[0], 1, 1))), dim=0) - # if we have too many remove the excess (should not happen, but just in case) - if mask_downsample.shape[0] > ad_params["full_length"]: - mask_downsample = mask_downsample[:ad_params["full_length"]] - # now, select sub_idxs masks - mask_downsample = mask_downsample[ad_params["sub_idxs"]] - # otherwise, perform usual mask interpolation + if unfold_batch and cond.shape[0] > 1: + # Check AnimateDiff context window + if ad_params is not None and ad_params["sub_idxs"] is not None: + # if images length matches or exceeds full_length get sub_idx images + if cond.shape[0] >= ad_params["full_length"]: + cond = torch.Tensor(cond[ad_params["sub_idxs"]]) + uncond = torch.Tensor(uncond[ad_params["sub_idxs"]]) + # otherwise, need to do more to get proper sub_idxs masks else: + # check if images length matches full_length - if not, make it match + if cond.shape[0] < ad_params["full_length"]: + cond = torch.cat((cond, cond[-1:].repeat((ad_params["full_length"]-cond.shape[0], 1, 1))), dim=0) + uncond = torch.cat((uncond, uncond[-1:].repeat((ad_params["full_length"]-uncond.shape[0], 1, 1))), dim=0) + # if we have too many remove the excess (should not happen, but just in case) + if cond.shape[0] > ad_params["full_length"]: + cond = cond[:ad_params["full_length"]] + uncond = uncond[:ad_params["full_length"]] + cond = cond[ad_params["sub_idxs"]] + uncond = uncond[ad_params["sub_idxs"]] + + # if we don't have enough reference images repeat the last one until we reach the right size + if cond.shape[0] < batch_prompt: + cond = torch.cat((cond, cond[-1:].repeat((batch_prompt-cond.shape[0], 1, 1))), dim=0) + uncond = torch.cat((uncond, uncond[-1:].repeat((batch_prompt-uncond.shape[0], 1, 1))), dim=0) + # if we have too many remove the exceeding + elif cond.shape[0] > batch_prompt: + cond = cond[:batch_prompt] + uncond = uncond[:batch_prompt] + + k_cond = ipadapter.ip_layers.to_kvs[self.k_key](cond) + k_uncond = ipadapter.ip_layers.to_kvs[self.k_key](uncond) + v_cond = ipadapter.ip_layers.to_kvs[self.v_key](cond) + v_uncond = ipadapter.ip_layers.to_kvs[self.v_key](uncond) + else: + k_cond = ipadapter.ip_layers.to_kvs[self.k_key](cond).repeat(batch_prompt, 1, 1) + k_uncond = ipadapter.ip_layers.to_kvs[self.k_key](uncond).repeat(batch_prompt, 1, 1) + v_cond = ipadapter.ip_layers.to_kvs[self.v_key](cond).repeat(batch_prompt, 1, 1) + v_uncond = ipadapter.ip_layers.to_kvs[self.v_key](uncond).repeat(batch_prompt, 1, 1) + + if weight_type.startswith("linear"): + ip_k = torch.cat([(k_cond, k_uncond)[i] for i in cond_or_uncond], dim=0) * weight + ip_v = torch.cat([(v_cond, v_uncond)[i] for i in cond_or_uncond], dim=0) * weight + else: + ip_k = torch.cat([(k_cond, k_uncond)[i] for i in cond_or_uncond], dim=0) + ip_v = torch.cat([(v_cond, v_uncond)[i] for i in cond_or_uncond], dim=0) + + if weight_type.startswith("channel"): + # code by Lvmin Zhang at Stanford University as also seen on Fooocus IPAdapter implementation + # please read licensing notes https://github.com/lllyasviel/Fooocus/blob/69a23c4d60c9e627409d0cb0f8862cdb015488eb/extras/ip_adapter.py#L234 + ip_v_mean = torch.mean(ip_v, dim=1, keepdim=True) + ip_v_offset = ip_v - ip_v_mean + _, _, C = ip_k.shape + channel_penalty = float(C) / 1280.0 + W = weight * channel_penalty + ip_k = ip_k * W + ip_v = ip_v_offset + ip_v_mean * W + + out_ip = optimized_attention(q, ip_k, ip_v, extra_options["n_heads"]) + if weight_type.startswith("original"): + out_ip = out_ip * weight + + if mask is not None: + # TODO: needs checking + mask_h = max(1, round(lh / math.sqrt(lh * lw / qs))) + mask_w = qs // mask_h + + # check if using AnimateDiff and sliding context window + if (mask.shape[0] > 1 and ad_params is not None and ad_params["sub_idxs"] is not None): + # if mask length matches or exceeds full_length, just get sub_idx masks, resize, and continue + if mask.shape[0] >= ad_params["full_length"]: + mask_downsample = torch.Tensor(mask[ad_params["sub_idxs"]]) + mask_downsample = F.interpolate(mask_downsample.unsqueeze(1), size=(mask_h, mask_w), mode="bicubic").squeeze(1) + # otherwise, need to do more to get proper sub_idxs masks + else: + # resize to needed attention size (to save on memory) mask_downsample = F.interpolate(mask.unsqueeze(1), size=(mask_h, mask_w), mode="bicubic").squeeze(1) + # check if mask length matches full_length - if not, make it match + if mask_downsample.shape[0] < ad_params["full_length"]: + mask_downsample = torch.cat((mask_downsample, mask_downsample[-1:].repeat((ad_params["full_length"]-mask_downsample.shape[0], 1, 1))), dim=0) + # if we have too many remove the excess (should not happen, but just in case) + if mask_downsample.shape[0] > ad_params["full_length"]: + mask_downsample = mask_downsample[:ad_params["full_length"]] + # now, select sub_idxs masks + mask_downsample = mask_downsample[ad_params["sub_idxs"]] + # otherwise, perform usual mask interpolation + else: + mask_downsample = F.interpolate(mask.unsqueeze(1), size=(mask_h, mask_w), mode="bicubic").squeeze(1) - # if we don't have enough masks repeat the last one until we reach the right size - if mask_downsample.shape[0] < batch_prompt: - mask_downsample = torch.cat((mask_downsample, mask_downsample[-1:, :, :].repeat((batch_prompt-mask_downsample.shape[0], 1, 1))), dim=0) - # if we have too many remove the exceeding - elif mask_downsample.shape[0] > batch_prompt: - mask_downsample = mask_downsample[:batch_prompt, :, :] - - # repeat the masks - mask_downsample = mask_downsample.repeat(len(cond_or_uncond), 1, 1) - mask_downsample = mask_downsample.view(mask_downsample.shape[0], -1, 1).repeat(1, 1, out.shape[2]) + # if we don't have enough masks repeat the last one until we reach the right size + if mask_downsample.shape[0] < batch_prompt: + mask_downsample = torch.cat((mask_downsample, mask_downsample[-1:, :, :].repeat((batch_prompt-mask_downsample.shape[0], 1, 1))), dim=0) + # if we have too many remove the exceeding + elif mask_downsample.shape[0] > batch_prompt: + mask_downsample = mask_downsample[:batch_prompt, :, :] + + # repeat the masks + mask_downsample = mask_downsample.repeat(len(cond_or_uncond), 1, 1) + mask_downsample = mask_downsample.view(mask_downsample.shape[0], -1, 1).repeat(1, 1, out.shape[2]) - out_ip = out_ip * mask_downsample + out_ip = out_ip * mask_downsample - out = out + out_ip + out = out + out_ip return out.to(dtype=org_dtype) @@ -424,6 +411,7 @@ class IPAdapterApply: def apply_ipadapter(self, ipadapter, model, weight, clip_vision=None, image=None, weight_type="original", noise=None, embeds=None, attn_mask=None, start_at=0.0, end_at=1.0, unfold_batch=False): self.dtype = model.model.diffusion_model.dtype + self.embeds_dtype = comfy.model_management.text_encoder_dtype(comfy.model_management.text_encoder_device()) # text and image embeds should have the same dtype self.device = comfy.model_management.get_torch_device() self.weight = weight self.is_full = "proj.0.weight" in ipadapter["image_proj"] @@ -473,9 +461,9 @@ class IPAdapterApply: self.ipadapter.to(self.device, dtype=self.dtype) - image_prompt_embeds, uncond_image_prompt_embeds = self.ipadapter.get_image_embeds(clip_embed.to(self.device, self.dtype), clip_embed_zeroed.to(self.device, self.dtype)) - image_prompt_embeds = image_prompt_embeds.to(self.device, dtype=self.dtype) - uncond_image_prompt_embeds = uncond_image_prompt_embeds.to(self.device, dtype=self.dtype) + image_prompt_embeds, uncond_image_prompt_embeds = self.ipadapter.get_image_embeds(clip_embed.to(self.device, dtype=self.embeds_dtype), clip_embed_zeroed.to(self.device, dtype=self.embeds_dtype)) + image_prompt_embeds = image_prompt_embeds.to(self.device, dtype=self.embeds_dtype) + uncond_image_prompt_embeds = uncond_image_prompt_embeds.to(self.device, dtype=self.embeds_dtype) work_model = model.clone() @@ -489,8 +477,6 @@ class IPAdapterApply: "number": 0, "weight": self.weight, "ipadapter": self.ipadapter, - "device": self.device, - "dtype": self.dtype, "cond": image_prompt_embeds, "uncond": uncond_image_prompt_embeds, "weight_type": weight_type, diff --git a/examples/IPAdapter_2_masks.json b/examples/IPAdapter_2_masks.json index 1e8105f..88a5851 100644 --- a/examples/IPAdapter_2_masks.json +++ b/examples/IPAdapter_2_masks.json @@ -331,69 +331,6 @@ "Node name for S&R": "PreviewImage" } }, - { - "id": 50, - "type": "IPAdapterApply", - "pos": [ - 1030, - -220 - ], - "size": { - "0": 210, - "1": 190 - }, - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 79 - }, - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 80 - }, - { - "name": "image", - "type": "IMAGE", - "link": 92 - }, - { - "name": "model", - "type": "MODEL", - "link": 90 - }, - { - "name": "attn_mask", - "type": "MASK", - "link": 83 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 84 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApply" - }, - "widgets_values": [ - 0.7000000000000001, - 0.5, - "channel penalty" - ], - "color": "#223", - "bgcolor": "#335" - }, { "id": 52, "type": "PrepImageForClipVision", @@ -777,69 +714,6 @@ "color": "#232", "bgcolor": "#353" }, - { - "id": 51, - "type": "IPAdapterApply", - "pos": [ - 468, - -169 - ], - "size": { - "0": 210, - "1": 190 - }, - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 85 - }, - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 86 - }, - { - "name": "image", - "type": "IMAGE", - "link": 87 - }, - { - "name": "model", - "type": "MODEL", - "link": 88 - }, - { - "name": "attn_mask", - "type": "MASK", - "link": 89 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 90 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApply" - }, - "widgets_values": [ - 0.7000000000000001, - 0.5, - "channel penalty" - ], - "color": "#223", - "bgcolor": "#335" - }, { "id": 27, "type": "LoadImage", @@ -975,6 +849,138 @@ "karras", 1 ] + }, + { + "id": 51, + "type": "IPAdapterApply", + "pos": [ + 523, + -214 + ], + "size": { + "0": 210, + "1": 258 + }, + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 85 + }, + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 86 + }, + { + "name": "image", + "type": "IMAGE", + "link": 87 + }, + { + "name": "model", + "type": "MODEL", + "link": 88 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": 89 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 90 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApply" + }, + "widgets_values": [ + 0.7000000000000001, + 0.5, + "channel penalty", + 0, + 1, + false + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 50, + "type": "IPAdapterApply", + "pos": [ + 1030, + -220 + ], + "size": { + "0": 210, + "1": 258 + }, + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 79 + }, + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 80 + }, + { + "name": "image", + "type": "IMAGE", + "link": 92 + }, + { + "name": "model", + "type": "MODEL", + "link": 90 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": 83 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 84 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApply" + }, + "widgets_values": [ + 0.7000000000000001, + 0.5, + "channel penalty", + 0, + 1, + false + ], + "color": "#223", + "bgcolor": "#335" } ], "links": [ diff --git a/examples/IPAdapter_batch_images.json b/examples/IPAdapter_batch_images.json index 16bd704..e166f6c 100644 --- a/examples/IPAdapter_batch_images.json +++ b/examples/IPAdapter_batch_images.json @@ -36,38 +36,6 @@ 1 ] }, - { - "id": 3, - "type": "IPAdapterModelLoader", - "pos": [ - 290, - 60 - ], - "size": { - "0": 300, - "1": 60 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IPADAPTER", - "type": "IPADAPTER", - "links": [ - 1 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterModelLoader" - }, - "widgets_values": [ - "ip-adapter_sd15.bin" - ] - }, { "id": 8, "type": "CLIPTextEncode", @@ -203,7 +171,7 @@ "1": 60 }, "flags": {}, - "order": 2, + "order": 1, "mode": 0, "outputs": [ { @@ -249,61 +217,6 @@ "IPAdapter" ] }, - { - "id": 5, - "type": "IPAdapterApply", - "pos": [ - 650, - 60 - ], - "size": { - "0": 210, - "1": 142 - }, - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 1 - }, - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 2 - }, - { - "name": "image", - "type": "IMAGE", - "link": 23 - }, - { - "name": "model", - "type": "MODEL", - "link": 4 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 7 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApply" - }, - "widgets_values": [ - 1, - 0 - ] - }, { "id": 9, "type": "KSampler", @@ -364,38 +277,6 @@ 1 ] }, - { - "id": 4, - "type": "CLIPVisionLoader", - "pos": [ - 290, - 170 - ], - "size": { - "0": 300, - "1": 60 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "CLIP_VISION", - "type": "CLIP_VISION", - "links": [ - 2 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPVisionLoader" - }, - "widgets_values": [ - "IPAdapter_image_encoder_sd15.safetensors" - ] - }, { "id": 6, "type": "LoadImage", @@ -408,7 +289,7 @@ "1": 320 }, "flags": {}, - "order": 4, + "order": 2, "mode": 0, "outputs": [ { @@ -447,7 +328,7 @@ "1": 320 }, "flags": {}, - "order": 5, + "order": 3, "mode": 0, "outputs": [ { @@ -527,7 +408,7 @@ "1": 100 }, "flags": {}, - "order": 6, + "order": 4, "mode": 0, "outputs": [ { @@ -562,6 +443,134 @@ "widgets_values": [ "sd15/absolutereality_v181.safetensors" ] + }, + { + "id": 5, + "type": "IPAdapterApply", + "pos": [ + 649, + -62 + ], + "size": { + "0": 210, + "1": 258 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 1 + }, + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 2 + }, + { + "name": "image", + "type": "IMAGE", + "link": 23 + }, + { + "name": "model", + "type": "MODEL", + "link": 4 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 7 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApply" + }, + "widgets_values": [ + 1, + 0, + "original", + 0, + 1, + false + ] + }, + { + "id": 3, + "type": "IPAdapterModelLoader", + "pos": [ + 291, + -35 + ], + "size": { + "0": 300, + "1": 60 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "IPADAPTER", + "type": "IPADAPTER", + "links": [ + 1 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterModelLoader" + }, + "widgets_values": [ + "ip-adapter_sd15.safetensors" + ] + }, + { + "id": 4, + "type": "CLIPVisionLoader", + "pos": [ + 297, + 82 + ], + "size": { + "0": 300, + "1": 60 + }, + "flags": {}, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "CLIP_VISION", + "type": "CLIP_VISION", + "links": [ + 2 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPVisionLoader" + }, + "widgets_values": [ + "IPAdapter_image_encoder_sd15.safetensors" + ] } ], "links": [ diff --git a/examples/IPAdapter_face.json b/examples/IPAdapter_face.json index 54731fb..ddb4a31 100644 --- a/examples/IPAdapter_face.json +++ b/examples/IPAdapter_face.json @@ -2,47 +2,6 @@ "last_node_id": 18, "last_link_id": 28, "nodes": [ - { - "id": 8, - "type": "CLIPTextEncode", - "pos": [ - 650, - 420 - ], - "size": { - "0": 210, - "1": 120 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 6 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 9 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, horror" - ], - "color": "#322", - "bgcolor": "#533" - }, { "id": 11, "type": "VAEDecode", @@ -110,86 +69,6 @@ "IPAdapter" ] }, - { - "id": 1, - "type": "CheckpointLoaderSimple", - "pos": [ - 290, - 280 - ], - "size": { - "0": 300, - "1": 100 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 4 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 5, - 6 - ], - "shape": 3, - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "realisticVisionV51_v51VAE.safetensors" - ] - }, - { - "id": 3, - "type": "IPAdapterModelLoader", - "pos": [ - 290, - 60 - ], - "size": { - "0": 300, - "1": 60 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IPADAPTER", - "type": "IPADAPTER", - "links": [ - 1 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterModelLoader" - }, - "widgets_values": [ - "ip-adapter-plus-face_sd15.bin" - ] - }, { "id": 2, "type": "VAELoader", @@ -202,7 +81,7 @@ "1": 60 }, "flags": {}, - "order": 2, + "order": 0, "mode": 0, "outputs": [ { @@ -234,7 +113,7 @@ "1": 120 }, "flags": {}, - "order": 6, + "order": 7, "mode": 0, "inputs": [ { @@ -275,7 +154,7 @@ "1": 110 }, "flags": {}, - "order": 3, + "order": 1, "mode": 0, "outputs": [ { @@ -309,7 +188,7 @@ "1": 320 }, "flags": {}, - "order": 4, + "order": 2, "mode": 0, "outputs": [ { @@ -348,7 +227,7 @@ "1": 60 }, "flags": {}, - "order": 5, + "order": 3, "mode": 0, "outputs": [ { @@ -368,61 +247,6 @@ "IPAdapter_image_encoder_sd15.safetensors" ] }, - { - "id": 5, - "type": "IPAdapterApply", - "pos": [ - 650, - 60 - ], - "size": { - "0": 210, - "1": 142 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 1 - }, - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 2 - }, - { - "name": "image", - "type": "IMAGE", - "link": 28 - }, - { - "name": "model", - "type": "MODEL", - "link": 4 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 7 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApply" - }, - "widgets_values": [ - 0.6000000000000001, - 0.3 - ] - }, { "id": 9, "type": "KSampler", @@ -482,6 +306,191 @@ "ddim_uniform", 1 ] + }, + { + "id": 5, + "type": "IPAdapterApply", + "pos": [ + 654, + -52 + ], + "size": { + "0": 210, + "1": 258 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 1 + }, + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 2 + }, + { + "name": "image", + "type": "IMAGE", + "link": 28 + }, + { + "name": "model", + "type": "MODEL", + "link": 4 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 7 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApply" + }, + "widgets_values": [ + 0.6000000000000001, + 0.3, + "original", + 0, + 1, + false + ] + }, + { + "id": 3, + "type": "IPAdapterModelLoader", + "pos": [ + 290, + 60 + ], + "size": { + "0": 300, + "1": 60 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "IPADAPTER", + "type": "IPADAPTER", + "links": [ + 1 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterModelLoader" + }, + "widgets_values": [ + "ip-adapter-plus-face_sd15.safetensors" + ] + }, + { + "id": 8, + "type": "CLIPTextEncode", + "pos": [ + 650, + 420 + ], + "size": { + "0": 210, + "1": 120 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 6 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 9 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "blurry, horror, distorted, malformed, monochrome" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 1, + "type": "CheckpointLoaderSimple", + "pos": [ + 290, + 280 + ], + "size": { + "0": 300, + "1": 100 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 4 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 5, + 6 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "sd15/realisticVisionV51_v51VAE.safetensors" + ] } ], "links": [ diff --git a/examples/IPAdapter_inpaint.json b/examples/IPAdapter_inpaint.json index 0e41cc6..2737d2b 100644 --- a/examples/IPAdapter_inpaint.json +++ b/examples/IPAdapter_inpaint.json @@ -14,7 +14,7 @@ "1": 120 }, "flags": {}, - "order": 9, + "order": 7, "mode": 0, "inputs": [ { @@ -122,7 +122,7 @@ "1": 120 }, "flags": {}, - "order": 8, + "order": 6, "mode": 0, "inputs": [ { @@ -190,61 +190,6 @@ "image" ] }, - { - "id": 5, - "type": "IPAdapterApply", - "pos": [ - 650, - 60 - ], - "size": { - "0": 210, - "1": 142 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 1 - }, - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 2 - }, - { - "name": "image", - "type": "IMAGE", - "link": 28 - }, - { - "name": "model", - "type": "MODEL", - "link": 4 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 7 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApply" - }, - "widgets_values": [ - 0.8, - 0 - ] - }, { "id": 2, "type": "VAELoader", @@ -338,38 +283,6 @@ 1 ] }, - { - "id": 3, - "type": "IPAdapterModelLoader", - "pos": [ - 290, - 60 - ], - "size": { - "0": 300, - "1": 60 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "IPADAPTER", - "type": "IPADAPTER", - "links": [ - 1 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterModelLoader" - }, - "widgets_values": [ - "ip-adapter-plus_sd15.bin" - ] - }, { "id": 20, "type": "VAEEncodeForInpaint", @@ -382,7 +295,7 @@ "1": 100 }, "flags": {}, - "order": 6, + "order": 9, "mode": 0, "inputs": [ { @@ -419,48 +332,6 @@ 12 ] }, - { - "id": 19, - "type": "LoadImage", - "pos": [ - 370, - 600 - ], - "size": { - "0": 220, - "1": 320 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 29 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": [ - 37 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "clipspace/clipspace-mask-8127362.png [input]", - "image" - ] - }, { "id": 4, "type": "CLIPVisionLoader", @@ -473,7 +344,7 @@ "1": 60 }, "flags": {}, - "order": 4, + "order": 2, "mode": 0, "outputs": [ { @@ -505,7 +376,7 @@ "1": 100 }, "flags": {}, - "order": 5, + "order": 3, "mode": 0, "outputs": [ { @@ -540,6 +411,144 @@ "widgets_values": [ "sd15/absolutereality_v181INPAINTING.safetensors" ] + }, + { + "id": 5, + "type": "IPAdapterApply", + "pos": [ + 654, + -60 + ], + "size": { + "0": 210, + "1": 258 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 1 + }, + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 2 + }, + { + "name": "image", + "type": "IMAGE", + "link": 28 + }, + { + "name": "model", + "type": "MODEL", + "link": 4 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 7 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApply" + }, + "widgets_values": [ + 0.8, + 0, + "original", + 0, + 1, + false + ] + }, + { + "id": 3, + "type": "IPAdapterModelLoader", + "pos": [ + 290, + 60 + ], + "size": { + "0": 300, + "1": 60 + }, + "flags": {}, + "order": 4, + "mode": 0, + "outputs": [ + { + "name": "IPADAPTER", + "type": "IPADAPTER", + "links": [ + 1 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterModelLoader" + }, + "widgets_values": [ + "ip-adapter-plus_sd15.safetensors" + ] + }, + { + "id": 19, + "type": "LoadImage", + "pos": [ + 370, + 600 + ], + "size": { + "0": 220, + "1": 320 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 29 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": [ + 37 + ], + "shape": 3, + "slot_index": 1 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "clipspace/clipspace-mask-1375556.png [input]", + "image" + ] } ], "links": [ diff --git a/examples/IPAdapter_mask.json b/examples/IPAdapter_mask.json index b82d79b..e2e5045 100644 --- a/examples/IPAdapter_mask.json +++ b/examples/IPAdapter_mask.json @@ -369,40 +369,6 @@ 1 ] }, - { - "id": 10, - "type": "IPAdapterModelLoader", - "pos": [ - 490, - -80 - ], - "size": { - "0": 300, - "1": 60 - }, - "flags": {}, - "order": 4, - "mode": 0, - "outputs": [ - { - "name": "IPADAPTER", - "type": "IPADAPTER", - "links": [ - 85 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterModelLoader" - }, - "widgets_values": [ - "ip-adapter-plus_sd15.bin" - ], - "color": "#223", - "bgcolor": "#335" - }, { "id": 12, "type": "LoadImage", @@ -410,12 +376,12 @@ 230, -80 ], - "size": [ - 230, - 320 - ], + "size": { + "0": 230, + "1": 320 + }, "flags": {}, - "order": 5, + "order": 4, "mode": 0, "outputs": [ { @@ -447,16 +413,41 @@ "color": "#223", "bgcolor": "#335" }, + { + "id": 8, + "type": "PreviewImage", + "pos": [ + 1365, + 369 + ], + "size": { + "0": 675.9465942382812, + "1": 480.1444091796875 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 9 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, { "id": 51, "type": "IPAdapterApply", "pos": [ - 830, - 40 + 829, + -23 ], "size": [ 210, - 190 + 258 ], "flags": {}, "order": 9, @@ -505,35 +496,47 @@ "widgets_values": [ 0.7000000000000001, 0, - "linear" + "linear", + 0, + 1, + false ], "color": "#223", "bgcolor": "#335" }, { - "id": 8, - "type": "PreviewImage", + "id": 10, + "type": "IPAdapterModelLoader", "pos": [ - 1365, - 369 - ], - "size": [ - 675.9466064453127, - 480.1444152832032 + 490, + -80 ], + "size": { + "0": 300, + "1": 60 + }, "flags": {}, - "order": 12, + "order": 5, "mode": 0, - "inputs": [ + "outputs": [ { - "name": "images", - "type": "IMAGE", - "link": 9 + "name": "IPADAPTER", + "type": "IPADAPTER", + "links": [ + 85 + ], + "shape": 3, + "slot_index": 0 } ], "properties": { - "Node name for S&R": "PreviewImage" - } + "Node name for S&R": "IPAdapterModelLoader" + }, + "widgets_values": [ + "ip-adapter-plus_sd15.safetensors" + ], + "color": "#223", + "bgcolor": "#335" } ], "links": [ diff --git a/examples/IPAdapter_prepped.json b/examples/IPAdapter_prepped.json index 85d5ad7..d346c3a 100644 --- a/examples/IPAdapter_prepped.json +++ b/examples/IPAdapter_prepped.json @@ -243,93 +243,6 @@ 1 ] }, - { - "id": 5, - "type": "IPAdapterApply", - "pos": [ - 650, - 60 - ], - "size": { - "0": 210, - "1": 142 - }, - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 1 - }, - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 2 - }, - { - "name": "image", - "type": "IMAGE", - "link": 45 - }, - { - "name": "model", - "type": "MODEL", - "link": 4 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 7 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApply" - }, - "widgets_values": [ - 1, - 0 - ] - }, - { - "id": 3, - "type": "IPAdapterModelLoader", - "pos": [ - 290, - 60 - ], - "size": { - "0": 300, - "1": 60 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IPADAPTER", - "type": "IPADAPTER", - "links": [ - 1 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterModelLoader" - }, - "widgets_values": [ - "ip-adapter_sdxl_vit-h.bin" - ] - }, { "id": 1, "type": "CheckpointLoaderSimple", @@ -342,7 +255,7 @@ "1": 100 }, "flags": {}, - "order": 2, + "order": 1, "mode": 0, "outputs": [ { @@ -390,7 +303,7 @@ "1": 110 }, "flags": {}, - "order": 3, + "order": 2, "mode": 0, "outputs": [ { @@ -424,7 +337,7 @@ "1": 60 }, "flags": {}, - "order": 4, + "order": 3, "mode": 0, "outputs": [ { @@ -456,7 +369,7 @@ "1": 320 }, "flags": {}, - "order": 5, + "order": 4, "mode": 0, "outputs": [ { @@ -495,7 +408,7 @@ "1": 320 }, "flags": {}, - "order": 6, + "order": 5, "mode": 0, "outputs": [ { @@ -570,10 +483,10 @@ 350, 510 ], - "size": [ - 240, - 110 - ], + "size": { + "0": 243.60000610351562, + "1": 110 + }, "flags": {}, "order": 9, "mode": 0, @@ -611,10 +524,10 @@ 350, 660 ], - "size": [ - 240, - 110 - ], + "size": { + "0": 243.60000610351562, + "1": 110 + }, "flags": {}, "order": 10, "mode": 0, @@ -644,6 +557,102 @@ "top", 0 ] + }, + { + "id": 5, + "type": "IPAdapterApply", + "pos": [ + 653, + -60 + ], + "size": { + "0": 210, + "1": 258 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 1 + }, + { + "name": "clip_vision", + "type": "CLIP_VISION", + "link": 2 + }, + { + "name": "image", + "type": "IMAGE", + "link": 45 + }, + { + "name": "model", + "type": "MODEL", + "link": 4 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 7 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApply" + }, + "widgets_values": [ + 1, + 0, + "original", + 0, + 1, + false + ] + }, + { + "id": 3, + "type": "IPAdapterModelLoader", + "pos": [ + 290, + 60 + ], + "size": { + "0": 300, + "1": 60 + }, + "flags": {}, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "IPADAPTER", + "type": "IPADAPTER", + "links": [ + 1 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterModelLoader" + }, + "widgets_values": [ + "ip-adapter_sdxl_vit-h.safetensors" + ] } ], "links": [ diff --git a/examples/IPAdapter_weighted.json b/examples/IPAdapter_weighted.json index b55ba3e..7eeb8c4 100644 --- a/examples/IPAdapter_weighted.json +++ b/examples/IPAdapter_weighted.json @@ -343,87 +343,6 @@ "image" ] }, - { - "id": 3, - "type": "IPAdapterModelLoader", - "pos": [ - 450, - -210 - ], - "size": [ - 260, - 60 - ], - "flags": {}, - "order": 5, - "mode": 0, - "outputs": [ - { - "name": "IPADAPTER", - "type": "IPADAPTER", - "links": [ - 17 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterModelLoader" - }, - "widgets_values": [ - "ip-adapter_sd15.bin" - ] - }, - { - "id": 13, - "type": "IPAdapterApplyEncoded", - "pos": [ - 790, - 30 - ], - "size": [ - 240, - 100 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "ipadapter", - "type": "IPADAPTER", - "link": 17 - }, - { - "name": "embeds", - "type": "EMBEDS", - "link": 18 - }, - { - "name": "model", - "type": "MODEL", - "link": 19 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 22 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "IPAdapterApplyEncoded" - }, - "widgets_values": [ - 1 - ] - }, { "id": 2, "type": "VAELoader", @@ -436,7 +355,7 @@ "1": 60 }, "flags": {}, - "order": 6, + "order": 5, "mode": 0, "outputs": [ { @@ -463,10 +382,10 @@ 500, -100 ], - "size": [ - 210, - 260 - ], + "size": { + "0": 210, + "1": 260 + }, "flags": {}, "order": 9, "mode": 0, @@ -579,6 +498,96 @@ "ddim_uniform", 1 ] + }, + { + "id": 3, + "type": "IPAdapterModelLoader", + "pos": [ + 450, + -210 + ], + "size": { + "0": 260, + "1": 60 + }, + "flags": {}, + "order": 6, + "mode": 0, + "outputs": [ + { + "name": "IPADAPTER", + "type": "IPADAPTER", + "links": [ + 17 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterModelLoader" + }, + "widgets_values": [ + "ip-adapter_sd15.safetensors" + ] + }, + { + "id": 13, + "type": "IPAdapterApplyEncoded", + "pos": [ + 804, + -87 + ], + "size": [ + 235.1999969482422, + 214 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "ipadapter", + "type": "IPADAPTER", + "link": 17 + }, + { + "name": "embeds", + "type": "EMBEDS", + "link": 18 + }, + { + "name": "model", + "type": "MODEL", + "link": 19 + }, + { + "name": "attn_mask", + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 22 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "IPAdapterApplyEncoded" + }, + "widgets_values": [ + 1, + "original", + 0, + 1, + false + ] } ], "links": [ diff --git a/models/put_ipadapter_models_here.txt b/models/legacy_models_location.txt similarity index 100% rename from models/put_ipadapter_models_here.txt rename to models/legacy_models_location.txt