add scheduled weights

This commit is contained in:
matt3o
2024-04-12 15:17:15 +02:00
parent 1f38315efc
commit b5ee09e9d5
7 changed files with 1089 additions and 241 deletions
+40 -4
View File
@@ -82,31 +82,67 @@ class CrossAttentionPatch:
cond = cond_alt[t_idx]
del cond_alt
if weight == 0:
continue
#if isinstance(weight, torch.Tensor):
# weight = tensor_to_size(weight, batch_prompt)
# weight = weight.repeat(len(cond_or_uncond), 1, 1)
#elif weight == 0:
# 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 image length matches or exceeds full_length get sub_idx images
if cond.shape[0] >= ad_params["full_length"]:
if isinstance(weight, torch.Tensor):
weight = torch.Tensor(weight["sub_idxs"])
weight = weight.repeat(len(cond_or_uncond), 1, 1) # repeat for cond and uncond
if torch.all(weight == 0):
continue
elif weight == 0:
continue
cond = torch.Tensor(cond[ad_params["sub_idxs"]])
uncond = torch.Tensor(uncond[ad_params["sub_idxs"]])
# otherwise get sub_idxs images
else:
if isinstance(weight, torch.Tensor):
weight = tensor_to_size(weight, ad_params["full_length"])
weight = weight[ad_params["sub_idxs"]]
weight = weight.repeat(len(cond_or_uncond), 1, 1) # repeat for cond and uncond
if torch.all(weight == 0):
continue
elif weight == 0:
continue
cond = tensor_to_size(cond, ad_params["full_length"])
uncond = tensor_to_size(uncond, ad_params["full_length"])
cond = cond[ad_params["sub_idxs"]]
uncond = uncond[ad_params["sub_idxs"]]
else:
cond = tensor_to_size(cond, batch_prompt)
uncond = tensor_to_size(uncond, batch_prompt)
cond = tensor_to_size(cond, batch_prompt)
uncond = tensor_to_size(uncond, batch_prompt)
if isinstance(weight, torch.Tensor):
weight = tensor_to_size(weight, batch_prompt)
weight = weight.repeat(len(cond_or_uncond), 1, 1)
if torch.all(weight == 0):
continue
elif weight == 0:
continue
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:
# TODO: should we always convert the weights to a tensor?
if isinstance(weight, torch.Tensor):
weight = tensor_to_size(weight, batch_prompt)
weight = weight.repeat(len(cond_or_uncond), 1, 1)
if torch.all(weight == 0):
continue
elif weight == 0:
continue
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)
+68
View File
@@ -188,6 +188,9 @@ def ipadapter_execute(model,
if image is not None and image.shape[1] != image.shape[2]:
print("\033[33mINFO: the IPAdapter reference image is not a square, CLIPImageProcessor will resize and crop it at the center. If the main focus of the picture is not in the middle the result might not be what you are expecting.\033[0m")
if isinstance(weight, list):
weight = torch.tensor(weight).unsqueeze(-1).unsqueeze(-1).to(device, dtype=dtype) if unfold_batch else weight[0]
# special weight types
if layer_weights is not None and layer_weights != '':
weight = { int(k): float(v)*weight for k, v in [x.split(":") for x in layer_weights.split(",")] }
@@ -1282,6 +1285,69 @@ class IPAdapterLoadEmbeds:
path = folder_paths.get_annotated_filepath(embeds)
return (torch.load(path).cpu(), )
class IPAdapterWeights:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"weights": ("STRING", {"default": '1.0', "multiline": True }),
"timing": (["custom", "linear", "ease_in_out", "ease_in", "ease_out", "reverse_in_out", "random"], ),
"frames": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1 }),
"start_frame": ("INT", {"default": 0, "min": 0, "max": 9999, "step": 1 }),
"end_frame": ("INT", {"default": 9999, "min": 0, "max": 9999, "step": 1 }),
},
}
RETURN_TYPES = ("FLOAT",)
FUNCTION = "weights"
CATEGORY = "ipadapter/utils"
def weights(self, weights, timing, frames, start_frame, end_frame):
import random
# convert the string to a list of floats separated by commas or newlines
weights = weights.replace("\n", ",")
weights = [float(weight) for weight in weights.split(",") if weight.strip() != ""]
if timing != "custom":
start = 0.0
end = 1.0
if len(weights) > 0:
start = weights[0]
end = weights[-1]
weights = []
end_frame = min(end_frame, frames)
duration = end_frame - start_frame
if start_frame > 0:
weights.extend([start] * start_frame)
for i in range(duration):
n = duration - 1
if timing == "linear":
weights.append(start + (end - start) * i / n)
elif timing == "ease_in_out":
weights.append(start + (end - start) * (1 - math.cos(i / n * math.pi)) / 2)
elif timing == "ease_in":
weights.append(start + (end - start) * math.sin(i / n * math.pi / 2))
elif timing == "ease_out":
weights.append(start + (end - start) * (1 - math.cos(i / n * math.pi / 2)))
elif timing == "reverse_in_out":
weights.append(start + (end - start) * (1 - math.sin((1 - i / n) * math.pi / 2)))
elif timing == "random":
weights.append(random.uniform(start, end))
weights[-1] = end if timing != "random" else weights[-1]
if end_frame < frames:
weights.extend([end] * (frames - end_frame))
if len(weights) == 0:
weights = [0.0]
return (weights, )
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Register
@@ -1315,6 +1381,7 @@ NODE_CLASS_MAPPINGS = {
"PrepImageForClipVision": PrepImageForClipVision,
"IPAdapterSaveEmbeds": IPAdapterSaveEmbeds,
"IPAdapterLoadEmbeds": IPAdapterLoadEmbeds,
"IPAdapterWeights": IPAdapterWeights,
}
NODE_DISPLAY_NAME_MAPPINGS = {
@@ -1345,4 +1412,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"PrepImageForClipVision": "Prep Image For ClipVision",
"IPAdapterSaveEmbeds": "IPAdapter Save Embeds",
"IPAdapterLoadEmbeds": "IPAdapter Load Embeds",
"IPAdapterWeights": "IPAdapter Weights",
}
+50 -46
View File
@@ -38,40 +38,6 @@
1
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
650,
80
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
24,
96,
107,
118
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
@@ -143,7 +109,7 @@
"1": 98
},
"flags": {},
"order": 2,
"order": 1,
"mode": 0,
"outputs": [
{
@@ -197,7 +163,7 @@
"1": 314
},
"flags": {},
"order": 3,
"order": 2,
"mode": 0,
"outputs": [
{
@@ -274,7 +240,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 9,
@@ -332,7 +298,8 @@
"linear",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -499,7 +466,7 @@
"1": 58
},
"flags": {},
"order": 4,
"order": 3,
"mode": 0,
"outputs": [
{
@@ -577,7 +544,7 @@
"1": 314
},
"flags": {},
"order": 5,
"order": 4,
"mode": 0,
"outputs": [
{
@@ -613,7 +580,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 10,
@@ -671,7 +638,8 @@
"linear",
"add",
0,
1
1,
"V only"
]
},
{
@@ -881,7 +849,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 12,
@@ -939,7 +907,8 @@
"linear",
"norm average",
0,
1
1,
"V only"
]
},
{
@@ -951,7 +920,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 11,
@@ -1009,7 +978,8 @@
"linear",
"average",
0,
1
1,
"V only"
]
},
{
@@ -1143,6 +1113,40 @@
"widgets_values": [
"IPAdapter"
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
650,
80
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 5,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
24,
96,
107,
118
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors"
]
}
],
"links": [
+44 -43
View File
@@ -147,37 +147,6 @@
1
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
308,
161
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
24
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
]
},
{
"id": 15,
"type": "IPAdapterModelLoader",
@@ -190,7 +159,7 @@
"1": 58
},
"flags": {},
"order": 3,
"order": 2,
"mode": 0,
"outputs": [
{
@@ -259,7 +228,7 @@
"1": 314
},
"flags": {},
"order": 4,
"order": 3,
"mode": 0,
"outputs": [
{
@@ -293,10 +262,10 @@
728,
290
],
"size": [
210,
106
],
"size": {
"0": 210,
"1": 106
},
"flags": {},
"order": 7,
"mode": 0,
@@ -337,7 +306,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 9,
@@ -395,7 +364,8 @@
"linear",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -464,10 +434,10 @@
1019,
405
],
"size": [
210,
106
],
"size": {
"0": 210,
"1": 106
},
"flags": {},
"order": 8,
"mode": 0,
@@ -537,6 +507,37 @@
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
308,
161
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
24
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors"
]
}
],
"links": [
+68 -67
View File
@@ -205,38 +205,6 @@
"in a peaceful spring morning a woman wearing a white shirt is sitting in a park on a bench\n\nhigh quality, detailed, diffuse light"
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
250,
180
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
32
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
]
},
{
"id": 5,
"type": "EmptyLatentImage",
@@ -249,7 +217,7 @@
"1": 106
},
"flags": {},
"order": 3,
"order": 2,
"mode": 0,
"outputs": [
{
@@ -329,38 +297,6 @@
1
]
},
{
"id": 15,
"type": "IPAdapterModelLoader",
"pos": [
250,
70
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
31
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-plus_sd15.safetensors"
]
},
{
"id": 18,
"type": "IPAdapterTiled",
@@ -370,7 +306,7 @@
],
"size": {
"0": 315,
"1": 278
"1": 302
},
"flags": {},
"order": 7,
@@ -439,7 +375,8 @@
"concat",
0,
1,
0
0,
"V only"
]
},
{
@@ -467,6 +404,70 @@
"widgets_values": [
"IPAdapter"
]
},
{
"id": 15,
"type": "IPAdapterModelLoader",
"pos": [
250,
70
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
31
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-plus_sd15.safetensors"
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
250,
180
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
32
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors"
]
}
],
"links": [
+86 -81
View File
@@ -137,76 +137,6 @@
1
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
308,
161
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
24,
38,
49,
60,
71
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"IPAdapter_image_encoder_sd15.safetensors"
]
},
{
"id": 15,
"type": "IPAdapterModelLoader",
"pos": [
308,
52
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
21,
36,
47,
58,
69
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-plus_sd15.safetensors"
]
},
{
"id": 12,
"type": "LoadImage",
@@ -219,7 +149,7 @@
"1": 314
},
"flags": {},
"order": 4,
"order": 2,
"mode": 0,
"outputs": [
{
@@ -509,7 +439,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 7,
@@ -567,7 +497,8 @@
"linear",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -579,7 +510,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 8,
@@ -637,7 +568,8 @@
"ease in",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -748,7 +680,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 9,
@@ -806,7 +738,8 @@
"ease out",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -1094,7 +1027,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 10,
@@ -1152,7 +1085,8 @@
"ease in-out",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -1164,7 +1098,7 @@
],
"size": {
"0": 315,
"1": 254
"1": 278
},
"flags": {},
"order": 11,
@@ -1222,7 +1156,8 @@
"reverse in-out",
"concat",
0,
1
1,
"V only"
]
},
{
@@ -1266,6 +1201,76 @@
"widgets_values": [
"closeup of a fierce warrior woman wearing a full armor at the end of a battle. cherry blossoms\n\nhigh quality, detailed"
]
},
{
"id": 15,
"type": "IPAdapterModelLoader",
"pos": [
308,
52
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "IPADAPTER",
"type": "IPADAPTER",
"links": [
21,
36,
47,
58,
69
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "IPAdapterModelLoader"
},
"widgets_values": [
"ip-adapter-plus_sd15.safetensors"
]
},
{
"id": 16,
"type": "CLIPVisionLoader",
"pos": [
308,
161
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "CLIP_VISION",
"type": "CLIP_VISION",
"links": [
24,
38,
49,
60,
71
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "CLIPVisionLoader"
},
"widgets_values": [
"CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors"
]
}
],
"links": [
+733
View File
@@ -0,0 +1,733 @@
{
"last_node_id": 21,
"last_link_id": 37,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
690,
840
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"blurry, noisy, messy, lowres, jpeg, artifacts, ill, distorted, malformed"
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1570,
700
],
"size": {
"0": 140,
"1": 46
},
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
801,
1097
],
"size": [
315,
106
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "batch_size",
"type": "INT",
"link": 35,
"widget": {
"name": "batch_size"
}
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
512,
512,
6
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
690,
610
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"in a peaceful spring morning a woman wearing a white shirt is sitting in a park on a bench\n\nhigh quality, detailed, diffuse light"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
1210,
700
],
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 31
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
0,
"fixed",
30,
6.5,
"ddpm",
"karras",
1
]
},
{
"id": 12,
"type": "LoadImage",
"pos": [
311,
270
],
"size": {
"0": 315,
"1": 314
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
25
],
"shape": 3,
"slot_index": 0
},
{
"name": "MASK",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"warrior_woman.png",
"image"
]
},
{
"id": 17,
"type": "PrepImageForClipVision",
"pos": [
797,
87
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 25
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
30
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "PrepImageForClipVision"
},
"widgets_values": [
"LANCZOS",
"top",
0.15
]
},
{
"id": 20,
"type": "IPAdapterWeights",
"pos": [
757,
318
],
"size": [
263.5047280787487,
183.75987616018006
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "frames",
"type": "INT",
"link": 34,
"widget": {
"name": "frames"
},
"slot_index": 0
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": [
32
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterWeights"
},
"widgets_values": [
"1.0,0.0",
"linear",
6,
0,
9999
]
},
{
"id": 21,
"type": "PrimitiveNode",
"pos": [
340,
1093
],
"size": {
"0": 210,
"1": 82
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "INT",
"type": "INT",
"links": [
34,
35
],
"widget": {
"name": "frames"
},
"slot_index": 0
}
],
"title": "frames",
"properties": {
"Run widget replace on values": false
},
"widgets_values": [
6,
"fixed"
]
},
{
"id": 19,
"type": "IPAdapterBatch",
"pos": [
1173,
251
],
"size": [
315,
254
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 37
},
{
"name": "ipadapter",
"type": "IPADAPTER",
"link": 29
},
{
"name": "image",
"type": "IMAGE",
"link": 30
},
{
"name": "image_negative",
"type": "IMAGE",
"link": null
},
{
"name": "attn_mask",
"type": "MASK",
"link": null
},
{
"name": "clip_vision",
"type": "CLIP_VISION",
"link": null
},
{
"name": "weight",
"type": "FLOAT",
"link": 32,
"widget": {
"name": "weight"
},
"slot_index": 6
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
31
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "IPAdapterBatch"
},
"widgets_values": [
1,
"linear",
0,
1,
"V only"
]
},
{
"id": 18,
"type": "IPAdapterUnifiedLoader",
"pos": [
303,
132
],
"size": {
"0": 315,
"1": 78
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 36
},
{
"name": "ipadapter",
"type": "IPADAPTER",
"link": null
}
],
"outputs": [
{
"name": "model",
"type": "MODEL",
"links": [
37
],
"shape": 3,
"slot_index": 0
},
{
"name": "ipadapter",
"type": "IPADAPTER",
"links": [
29
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "IPAdapterUnifiedLoader"
},
"widgets_values": [
"PLUS (high strength)"
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
-79,
712
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
36
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"sd15/realisticVisionV51_v51VAE.safetensors"
]
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1770,
710
],
"size": [
556.2374508110479,
892.1895739499892
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"IPAdapter"
]
}
],
"links": [
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
25,
12,
0,
17,
0,
"IMAGE"
],
[
29,
18,
1,
19,
1,
"IPADAPTER"
],
[
30,
17,
0,
19,
2,
"IMAGE"
],
[
31,
19,
0,
3,
0,
"MODEL"
],
[
32,
20,
0,
19,
6,
"FLOAT"
],
[
34,
21,
0,
20,
0,
"INT"
],
[
35,
21,
0,
5,
0,
"INT"
],
[
36,
4,
0,
18,
0,
"MODEL"
],
[
37,
18,
0,
19,
0,
"MODEL"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}