diff --git a/examples/mediapipe_vision/two-hands-upscale-workflow-batch-iterator.json b/examples/mediapipe_vision/two-hands-upscale-workflow-batch-iterator.json new file mode 100644 index 0000000..619d26e --- /dev/null +++ b/examples/mediapipe_vision/two-hands-upscale-workflow-batch-iterator.json @@ -0,0 +1,3070 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "revision": 0, + "last_node_id": 92, + "last_link_id": 200, + "nodes": [ + { + "id": 35, + "type": "Display Any (rgthree)", + "pos": [ + 2938.571533203125, + 1661.1204833984375 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 78 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 13, + "type": "CLIPTextEncode", + "pos": [ + 2513.712890625, + 711.9216918945312 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 51 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 57 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 30, + "type": "HandLandmarkPositionNode", + "pos": [ + 1534.582275390625, + 1117.733642578125 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 68 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 97, + 133 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 98, + 134 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 99 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 4, + 0, + false + ] + }, + { + "id": 34, + "type": "Display Any (rgthree)", + "pos": [ + 2592.819580078125, + 1564.373046875 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 104 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 44, + "type": "CoordinateProximityNode", + "pos": [ + 2093.6845703125, + 1207.534423828125 + ], + "size": [ + 428.4000244140625, + 178 + ], + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "name": "x1", + "type": "FLOAT", + "link": 97 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 98 + }, + { + "name": "z1", + "type": "FLOAT", + "link": 99 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 100 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 101 + }, + { + "name": "z2", + "type": "FLOAT", + "link": 102 + } + ], + "outputs": [ + { + "name": "distance", + "type": "FLOAT", + "links": [ + 103, + 104 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "CoordinateProximityNode", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 25, + "type": "CLIPTextEncode", + "pos": [ + 2503.712890625, + 131.9213104248047 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 65 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 63, + 127 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "paint abstract humanoid paint sculpture multicolored masterpiece" + ] + }, + { + "id": 1, + "type": "TorchCompileLoadControlNet", + "pos": [ + 3675.09326171875, + 542.0851440429688 + ], + "size": [ + 327.5999755859375, + 106 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "controlnet", + "type": "CONTROL_NET", + "link": 44 + } + ], + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 58 + ] + } + ], + "properties": { + "cnr_id": "comfyui-torch-compile", + "ver": "5de6422c8be8931930e4118b1457f8592e93dbce", + "Node name for S&R": "TorchCompileLoadControlNet", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "inductor", + false, + "reduce-overhead" + ] + }, + { + "id": 31, + "type": "HandLandmarkPositionNode", + "pos": [ + 1567.415771484375, + 1407.9090576171875 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 69 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 100, + 135 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 101, + 136 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 102 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 8, + 0, + false + ] + }, + { + "id": 49, + "type": "Display Any (rgthree)", + "pos": [ + 2610, + 2300 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 107 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 50, + "type": "CoordinateProximityNode", + "pos": [ + 2110, + 1940 + ], + "size": [ + 428.4000244140625, + 178 + ], + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "x1", + "type": "FLOAT", + "link": 113 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 108 + }, + { + "name": "z1", + "type": "FLOAT", + "link": 109 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 110 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 111 + }, + { + "name": "z2", + "type": "FLOAT", + "link": 112 + } + ], + "outputs": [ + { + "name": "distance", + "type": "FLOAT", + "links": [ + 106, + 107 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "CoordinateProximityNode", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 28, + "type": "MediaPipeHandLandmarkerNode", + "pos": [ + 910.3226928710938, + 1311.845947265625 + ], + "size": [ + 504, + 198 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 157 + }, + { + "name": "model_info", + "type": "HAND_LANDMARKER_MODEL_INFO", + "link": 67 + } + ], + "outputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "links": [ + 68, + 69, + 116, + 117 + ] + }, + { + "name": "handedness", + "type": "HANDEDNESS_LIST", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "MediaPipeHandLandmarkerNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "video", + "cpu", + 2, + 0.5000000000000001, + 0.5000000000000001, + 0.5000000000000001 + ] + }, + { + "id": 47, + "type": "HandLandmarkPositionNode", + "pos": [ + 1550, + 1850 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 116 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 113, + 139 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 108, + 140 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 109 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 4, + 1, + false + ] + }, + { + "id": 45, + "type": "HandLandmarkPositionNode", + "pos": [ + 1580, + 2140 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 117 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 110, + 141 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 111, + 142 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 112 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 8, + 1, + false + ] + }, + { + "id": 12, + "type": "CLIPTextEncode", + "pos": [ + 2503.712890625, + 411.9210510253906 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 50 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 128 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "beautiful pencil sketch, masterpiece, greyscale" + ] + }, + { + "id": 16, + "type": "ControlNetApplyAdvanced", + "pos": [ + 4100.34228515625, + 496.12384033203125 + ], + "size": [ + 315, + 186 + ], + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "link": 56 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 57 + }, + { + "name": "control_net", + "type": "CONTROL_NET", + "link": 58 + }, + { + "name": "image", + "type": "IMAGE", + "link": 59 + }, + { + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + }, + { + "name": "strength", + "type": "FLOAT", + "widget": { + "name": "strength" + }, + "link": 126 + } + ], + "outputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "links": [ + 53, + 167 + ] + }, + { + "name": "negative", + "type": "CONDITIONING", + "links": [ + 54, + 168 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ControlNetApplyAdvanced", + "widget_ue_connectable": { + "strength": true + } + }, + "widgets_values": [ + 0.7000000000000002, + 0, + 1 + ] + }, + { + "id": 48, + "type": "RenormalizeFloat", + "pos": [ + 2666.854248046875, + 1929.827880859375 + ], + "size": [ + 327.5999755859375, + 178 + ], + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "value", + "type": "FLOAT", + "link": 106 + } + ], + "outputs": [ + { + "name": "renormalized", + "type": "FLOAT", + "links": [ + 105, + 130 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RenormalizeFloat", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 0.20000000000000004, + 0.3500000000000001, + 0.15000000000000002, + 1.0000000000000002, + true + ] + }, + { + "id": 46, + "type": "Display Any (rgthree)", + "pos": [ + 3027.0009765625, + 2287.699951171875 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 105 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 23, + "type": "FeatureBankAttentionProcessor", + "pos": [ + 4036.46240234375, + 205.65631103515625 + ], + "size": [ + 403.1999816894531, + 154 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 61 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 52, + 166 + ] + } + ], + "properties": { + "aux_id": "livepeer/ComfyUI-Stream-Pack", + "ver": "f6e199090594bad1a604b45ed28ea4914c3db288", + "Node name for S&R": "FeatureBankAttentionProcessor", + "widget_ue_connectable": {} + }, + "widgets_values": [ + false, + 0.8000000000000002, + 0.9800000000000002, + 4, + 4 + ] + }, + { + "id": 6, + "type": "EmptyLatentImage", + "pos": [ + 4114.64404296875, + 785.8204956054688 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 55 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "EmptyLatentImage", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 24, + "type": "ConditioningAverage", + "pos": [ + 3323.712890625, + 361.92108154296875 + ], + "size": [ + 380.4000244140625, + 78 + ], + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "conditioning_to", + "type": "CONDITIONING", + "link": 128 + }, + { + "name": "conditioning_from", + "type": "CONDITIONING", + "link": 127 + }, + { + "name": "conditioning_to_strength", + "type": "FLOAT", + "widget": { + "name": "conditioning_to_strength" + }, + "link": 62 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 56 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ConditioningAverage", + "widget_ue_connectable": { + "conditioning_to_strength": true + } + }, + "widgets_values": [ + 1 + ] + }, + { + "id": 32, + "type": "RenormalizeFloat", + "pos": [ + 2612.785400390625, + 1181.9354248046875 + ], + "size": [ + 327.5999755859375, + 178 + ], + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "name": "value", + "type": "FLOAT", + "link": 103 + } + ], + "outputs": [ + { + "name": "renormalized", + "type": "FLOAT", + "links": [ + 78, + 131 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RenormalizeFloat", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 0.20000000000000004, + 0.3500000000000001, + 0, + 1.0000000000000002, + true + ] + }, + { + "id": 51, + "type": "RoundNode", + "pos": [ + 3090.375732421875, + 1927.33740234375 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "int_or_float", + "type": "*", + "link": 130 + } + ], + "outputs": [ + { + "name": "rounded_value", + "type": "FLOAT", + "links": [ + 115, + 126 + ] + }, + { + "name": "rounded_int", + "type": "INT", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RoundNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2 + ] + }, + { + "id": 38, + "type": "RoundNode", + "pos": [ + 3062.66357421875, + 1290.6689453125 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "int_or_float", + "type": "*", + "link": 131 + } + ], + "outputs": [ + { + "name": "rounded_value", + "type": "FLOAT", + "links": [ + 62, + 86 + ] + }, + { + "name": "rounded_int", + "type": "INT", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RoundNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2 + ] + }, + { + "id": 8, + "type": "ControlNetLoader", + "pos": [ + 3347.576904296875, + 713.297119140625 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 44 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ControlNetLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "control_v11f1p_sd15_depth_fp16.safetensors" + ] + }, + { + "id": 11, + "type": "CLIPLoader", + "pos": [ + 1700.8089599609375, + -0.39290204644203186 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 60 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "sd15\\dreamshaper8\\model.fp16.safetensors", + "stable_diffusion", + "default" + ] + }, + { + "id": 19, + "type": "CLIPSetLastLayer", + "pos": [ + 1772.606201171875, + 473.113525390625 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 60 + } + ], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 50, + 51, + 65 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPSetLastLayer", + "widget_ue_connectable": {} + }, + "widgets_values": [ + -2 + ] + }, + { + "id": 52, + "type": "ToString", + "pos": [ + 3480, + 2150 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "any", + "type": "*", + "link": 115 + } + ], + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 145 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "ToString", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "{}", + "", + "" + ] + }, + { + "id": 41, + "type": "ToString", + "pos": [ + 3493.54296875, + 1486.6871337890625 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "any", + "type": "*", + "link": 86 + } + ], + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 144 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "ToString", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "{}", + "", + "" + ] + }, + { + "id": 10, + "type": "DepthAnythingTensorrt", + "pos": [ + 975.6404418945312, + 691.5492553710938 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 156 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 59 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-Depth-Anything-Tensorrt", + "ver": "6c3d65023df3f106679ff4522aeea502dd964a3a", + "Node name for S&R": "DepthAnythingTensorrt", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "depth_anything_vitl14-fp16.engine" + ] + }, + { + "id": 55, + "type": "RTDrawLinesNode", + "pos": [ + 7645.1640625, + 933.1624755859375 + ], + "size": [ + 340.20001220703125, + 402 + ], + "flags": {}, + "order": 46, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 198 + }, + { + "name": "x1", + "type": "FLOAT", + "link": 133 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 134 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 135 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 136 + }, + { + "name": "label_values", + "shape": 7, + "type": "STRING", + "widget": { + "name": "label_values" + }, + "link": 144 + } + ], + "outputs": [ + { + "name": "image_out", + "type": "IMAGE", + "links": [ + 138 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RTDrawLinesNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2, + "#00FF00", + true, + "one-to-one", + false, + 3, + true, + "subject:", + "", + "Midpoint", + 0.5, + "Index-based" + ] + }, + { + "id": 22, + "type": "TensorRTLoader", + "pos": [ + 3446.06201171875, + 110.99031066894531 + ], + "size": [ + 555.0654907226562, + 82 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 61 + ] + } + ], + "properties": { + "aux_id": "yondonfu/ComfyUI_TensorRT", + "ver": "11b623be6f89300250af14e73eeeb2c1db9e48c7", + "Node name for S&R": "TensorRTLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "dynamic-dreamshaper8_SD15_$dyn-b-1-1-1-h-448-768-512-w-448-768-512_00001_.engine", + "SD15" + ] + }, + { + "id": 56, + "type": "RTDrawLinesNode", + "pos": [ + 8106.7734375, + 1303.162109375 + ], + "size": [ + 340.20001220703125, + 402 + ], + "flags": {}, + "order": 47, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 138 + }, + { + "name": "x1", + "type": "FLOAT", + "link": 139 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 140 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 141 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 142 + }, + { + "name": "label_values", + "shape": 7, + "type": "STRING", + "widget": { + "name": "label_values" + }, + "link": 145 + } + ], + "outputs": [ + { + "name": "image_out", + "type": "IMAGE", + "links": [ + 160 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RTDrawLinesNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2, + "#00FF00", + true, + "one-to-one", + false, + 3, + true, + "dream:", + "", + "Midpoint", + 0.5, + "Index-based" + ] + }, + { + "id": 63, + "type": "UpscaleModelLoader", + "pos": [ + 8080.5361328125, + 724.2318725585938 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "UPSCALE_MODEL", + "type": "UPSCALE_MODEL", + "links": [ + 161 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "UpscaleModelLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "RealESRGAN_x2.pth" + ] + }, + { + "id": 14, + "type": "KSampler", + "pos": [ + 4739.78564453125, + 440.3196105957031 + ], + "size": [ + 315, + 262 + ], + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 52 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 53 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 54 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 55 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 165 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "KSampler", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 603918565485061, + "fixed", + 4, + 1.2, + "lcm", + "sgm_uniform", + 1 + ] + }, + { + "id": 3, + "type": "TorchCompileLoadVAE", + "pos": [ + 5053.7998046875, + 779.5272216796875 + ], + "size": [ + 315, + 154 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "vae", + "type": "VAE", + "link": 45 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 172 + ] + } + ], + "properties": { + "cnr_id": "comfyui-torch-compile", + "ver": "5de6422c8be8931930e4118b1457f8592e93dbce", + "Node name for S&R": "TorchCompileLoadVAE", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "inductor", + true, + "reduce-overhead", + true, + true + ] + }, + { + "id": 69, + "type": "KSampler", + "pos": [ + 5855.634765625, + 467.65655517578125 + ], + "size": [ + 315, + 262 + ], + "flags": {}, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 166 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 167 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 168 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 170 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 173 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "KSampler", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 603918565485061, + "fixed", + 4, + 1.2, + "lcm", + "sgm_uniform", + 0.5000000000000001 + ] + }, + { + "id": 68, + "type": "NNLatentUpscale", + "pos": [ + 5864.68701171875, + 800.9833374023438 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "latent", + "type": "LATENT", + "link": 165 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 170 + ] + } + ], + "properties": { + "cnr_id": "comfyui_nnlatentupscale", + "ver": "1.0.0", + "Node name for S&R": "NNLatentUpscale", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "SD 1.x", + 1.5 + ] + }, + { + "id": 74, + "type": "Note", + "pos": [ + 5870.3876953125, + 284.3726806640625 + ], + "size": [ + 234.39193725585938, + 88 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": { + "widget_ue_connectable": {} + }, + "widgets_values": [ + "this is one of the reasons i pushed for dynamic res in comfystream" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 2, + "type": "VAELoader", + "pos": [ + 4644.08740234375, + 816.1616821289062 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 45 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "VAELoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "taesd" + ] + }, + { + "id": 75, + "type": "Note", + "pos": [ + 4752.13525390625, + 952.3453979492188 + ], + "size": [ + 234.39193725585938, + 88 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": { + "widget_ue_connectable": {} + }, + "widgets_values": [ + "you could use a regular vae here for better quality" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 62, + "type": "ImageUpscaleWithModel", + "pos": [ + 8458.0048828125, + 1096.490966796875 + ], + "size": [ + 340.20001220703125, + 46 + ], + "flags": {}, + "order": 48, + "mode": 0, + "inputs": [ + { + "name": "upscale_model", + "type": "UPSCALE_MODEL", + "link": 161 + }, + { + "name": "image", + "type": "IMAGE", + "link": 160 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 196 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ImageUpscaleWithModel", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 29, + "type": "MediaPipeHandLandmarkerModelLoaderNode", + "pos": [ + 930.4356079101562, + 1580.140380859375 + ], + "size": [ + 445.20001220703125, + 58 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "model_info", + "type": "HAND_LANDMARKER_MODEL_INFO", + "links": [ + 67 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "MediaPipeHandLandmarkerModelLoaderNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "default" + ] + }, + { + "id": 61, + "type": "Reroute", + "pos": [ + 683.5003662109375, + 826.1774291992188 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 195 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 156, + 157 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false, + "widget_ue_connectable": {} + } + }, + { + "id": 70, + "type": "VAEDecode", + "pos": [ + 6278.03466796875, + 480.0000305175781 + ], + "size": [ + 210, + 46 + ], + "flags": {}, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 173 + }, + { + "name": "vae", + "type": "VAE", + "link": 172 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 197 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "VAEDecode", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 76, + "type": "VHS_LoadVideo", + "pos": [ + -650, + 2500 + ], + "size": [ + 247.455078125, + 452.2566223144531 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "meta_batch", + "shape": 7, + "type": "VHS_BatchManager", + "link": null + }, + { + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 199 + ] + }, + { + "name": "frame_count", + "type": "INT", + "links": null + }, + { + "name": "audio", + "type": "AUDIO", + "links": null + }, + { + "name": "video_info", + "type": "VHS_VIDEOINFO", + "links": [] + } + ], + "properties": { + "cnr_id": "comfyui-videohelpersuite", + "ver": "1.6.1", + "Node name for S&R": "VHS_LoadVideo", + "widget_ue_connectable": {} + }, + "widgets_values": { + "video": "pinching.mp4", + "force_rate": 0, + "custom_width": 0, + "custom_height": 0, + "frame_load_cap": 100, + "skip_first_frames": 0, + "select_every_nth": 1, + "format": "AnimateDiff", + "choose video to upload": "image", + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "pinching.mp4", + "type": "input", + "format": "video/mp4", + "force_rate": 0, + "custom_width": 0, + "custom_height": 0, + "frame_load_cap": 100, + "skip_first_frames": 0, + "select_every_nth": 1 + } + } + } + }, + { + "id": 84, + "type": "BatchResultCollector", + "pos": [ + 8981.9296875, + 2056.58984375 + ], + "size": [ + 390.5999755859375, + 174 + ], + "flags": {}, + "order": 49, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 196 + }, + { + "name": "batch_info", + "type": "BATCH_INFO", + "link": 188 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91017f76d80e829738853f366c2f89b7f21f8de8", + "Node name for S&R": "BatchResultCollector", + "widget_ue_connectable": {} + }, + "widgets_values": [ + true, + "batch_video/batch", + 30, + "mp4", + false + ] + }, + { + "id": 85, + "type": "BatchImageProcessor", + "pos": [ + 181.67674255371094, + 2532.96630859375 + ], + "size": [ + 378, + 102 + ], + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 200 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 195 + ] + }, + { + "name": "batch_info", + "type": "BATCH_INFO", + "links": [ + 188 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91017f76d80e829738853f366c2f89b7f21f8de8", + "Node name for S&R": "BatchImageProcessor", + "widget_ue_connectable": {} + }, + "widgets_values": [ + true, + false + ] + }, + { + "id": 92, + "type": "ImageScale", + "pos": [ + -270, + 2490 + ], + "size": [ + 315, + 130 + ], + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 199 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 200 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "widget_ue_connectable": {}, + "Node name for S&R": "ImageScale" + }, + "widgets_values": [ + "lanczos", + 512, + 512, + "center" + ] + }, + { + "id": 89, + "type": "ImageScale", + "pos": [ + 6885.9033203125, + 547.5502319335938 + ], + "size": [ + 315, + 130 + ], + "flags": {}, + "order": 45, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 197 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 198 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "widget_ue_connectable": {}, + "Node name for S&R": "ImageScale" + }, + "widgets_values": [ + "lanczos", + 512, + 512, + "disabled" + ] + }, + { + "id": 90, + "type": "Note", + "pos": [ + 6882.451171875, + 371.4168701171875 + ], + "size": [ + 336.03369140625, + 124.8360366821289 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "until i have time to update mediapipe nodes to scale, they need the input image to be the same size " + ], + "color": "#432", + "bgcolor": "#653" + } + ], + "links": [ + [ + 44, + 8, + 0, + 1, + 0, + "CONTROL_NET" + ], + [ + 45, + 2, + 0, + 3, + 0, + "VAE" + ], + [ + 50, + 19, + 0, + 12, + 0, + "CLIP" + ], + [ + 51, + 19, + 0, + 13, + 0, + "CLIP" + ], + [ + 52, + 23, + 0, + 14, + 0, + "MODEL" + ], + [ + 53, + 16, + 0, + 14, + 1, + "CONDITIONING" + ], + [ + 54, + 16, + 1, + 14, + 2, + "CONDITIONING" + ], + [ + 55, + 6, + 0, + 14, + 3, + "LATENT" + ], + [ + 56, + 24, + 0, + 16, + 0, + "CONDITIONING" + ], + [ + 57, + 13, + 0, + 16, + 1, + "CONDITIONING" + ], + [ + 58, + 1, + 0, + 16, + 2, + "CONTROL_NET" + ], + [ + 59, + 10, + 0, + 16, + 3, + "IMAGE" + ], + [ + 60, + 11, + 0, + 19, + 0, + "CLIP" + ], + [ + 61, + 22, + 0, + 23, + 0, + "MODEL" + ], + [ + 62, + 38, + 0, + 24, + 2, + "FLOAT" + ], + [ + 65, + 19, + 0, + 25, + 0, + "CLIP" + ], + [ + 67, + 29, + 0, + 28, + 1, + "HAND_LANDMARKER_MODEL_INFO" + ], + [ + 68, + 28, + 0, + 30, + 0, + "HAND_LANDMARKS" + ], + [ + 69, + 28, + 0, + 31, + 0, + "HAND_LANDMARKS" + ], + [ + 78, + 32, + 0, + 35, + 0, + "*" + ], + [ + 86, + 38, + 0, + 41, + 0, + "*" + ], + [ + 97, + 30, + 0, + 44, + 0, + "FLOAT" + ], + [ + 98, + 30, + 1, + 44, + 1, + "FLOAT" + ], + [ + 99, + 30, + 2, + 44, + 2, + "FLOAT" + ], + [ + 100, + 31, + 0, + 44, + 3, + "FLOAT" + ], + [ + 101, + 31, + 1, + 44, + 4, + "FLOAT" + ], + [ + 102, + 31, + 2, + 44, + 5, + "FLOAT" + ], + [ + 103, + 44, + 0, + 32, + 0, + "FLOAT" + ], + [ + 104, + 44, + 0, + 34, + 0, + "*" + ], + [ + 105, + 48, + 0, + 46, + 0, + "*" + ], + [ + 106, + 50, + 0, + 48, + 0, + "FLOAT" + ], + [ + 107, + 50, + 0, + 49, + 0, + "*" + ], + [ + 108, + 47, + 1, + 50, + 1, + "FLOAT" + ], + [ + 109, + 47, + 2, + 50, + 2, + "FLOAT" + ], + [ + 110, + 45, + 0, + 50, + 3, + "FLOAT" + ], + [ + 111, + 45, + 1, + 50, + 4, + "FLOAT" + ], + [ + 112, + 45, + 2, + 50, + 5, + "FLOAT" + ], + [ + 113, + 47, + 0, + 50, + 0, + "FLOAT" + ], + [ + 115, + 51, + 0, + 52, + 0, + "*" + ], + [ + 116, + 28, + 0, + 47, + 0, + "HAND_LANDMARKS" + ], + [ + 117, + 28, + 0, + 45, + 0, + "HAND_LANDMARKS" + ], + [ + 126, + 51, + 0, + 16, + 5, + "FLOAT" + ], + [ + 127, + 25, + 0, + 24, + 1, + "CONDITIONING" + ], + [ + 128, + 12, + 0, + 24, + 0, + "CONDITIONING" + ], + [ + 130, + 48, + 0, + 51, + 0, + "*" + ], + [ + 131, + 32, + 0, + 38, + 0, + "*" + ], + [ + 133, + 30, + 0, + 55, + 1, + "FLOAT" + ], + [ + 134, + 30, + 1, + 55, + 2, + "FLOAT" + ], + [ + 135, + 31, + 0, + 55, + 3, + "FLOAT" + ], + [ + 136, + 31, + 1, + 55, + 4, + "FLOAT" + ], + [ + 138, + 55, + 0, + 56, + 0, + "IMAGE" + ], + [ + 139, + 47, + 0, + 56, + 1, + "FLOAT" + ], + [ + 140, + 47, + 1, + 56, + 2, + "FLOAT" + ], + [ + 141, + 45, + 0, + 56, + 3, + "FLOAT" + ], + [ + 142, + 45, + 1, + 56, + 4, + "FLOAT" + ], + [ + 144, + 41, + 0, + 55, + 5, + "STRING" + ], + [ + 145, + 52, + 0, + 56, + 5, + "STRING" + ], + [ + 156, + 61, + 0, + 10, + 0, + "IMAGE" + ], + [ + 157, + 61, + 0, + 28, + 0, + "IMAGE" + ], + [ + 160, + 56, + 0, + 62, + 1, + "IMAGE" + ], + [ + 161, + 63, + 0, + 62, + 0, + "UPSCALE_MODEL" + ], + [ + 165, + 14, + 0, + 68, + 0, + "LATENT" + ], + [ + 166, + 23, + 0, + 69, + 0, + "MODEL" + ], + [ + 167, + 16, + 0, + 69, + 1, + "CONDITIONING" + ], + [ + 168, + 16, + 1, + 69, + 2, + "CONDITIONING" + ], + [ + 170, + 68, + 0, + 69, + 3, + "LATENT" + ], + [ + 172, + 3, + 0, + 70, + 1, + "VAE" + ], + [ + 173, + 69, + 0, + 70, + 0, + "LATENT" + ], + [ + 188, + 85, + 1, + 84, + 1, + "BATCH_INFO" + ], + [ + 195, + 85, + 0, + 61, + 0, + "*" + ], + [ + 196, + 62, + 0, + 84, + 0, + "IMAGE" + ], + [ + 197, + 70, + 0, + 89, + 0, + "IMAGE" + ], + [ + 198, + 89, + 0, + 55, + 0, + "IMAGE" + ], + [ + 199, + 76, + 0, + 92, + 0, + "IMAGE" + ], + [ + 200, + 92, + 0, + 85, + 0, + "IMAGE" + ] + ], + "groups": [ + { + "id": 1, + "title": "Hand Tracking 1 hand", + "bounding": [ + 873.1765747070312, + 1022.9521484375, + 2974.574462890625, + 770.6577758789062 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 2, + "title": "Prompts", + "bounding": [ + 1573.782470703125, + -148.70542907714844, + 4037.425048828125, + 1132.17919921875 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 4, + "title": "Hand Tracking 2 hand", + "bounding": [ + 867.7586059570312, + 1834.1785888671875, + 2983.684814453125, + 671.8448486328125 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 5, + "title": "Add Labels", + "bounding": [ + 7438.16552734375, + 242.9441680908203, + 1674.5372314453125, + 1570.057861328125 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 6, + "title": "upscale ", + "bounding": [ + 5819.65771484375, + 29.27171516418457, + 703.9764404296875, + 914.8126831054688 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + } + ], + "config": {}, + "extra": { + "ds": { + "scale": 0.12100000000000163, + "offset": [ + 2342.9131356596554, + 2264.162347066301 + ] + }, + "ue_links": [], + "links_added_by_ue": [], + "frontendVersion": "1.17.11", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/mediapipe_vision/two-hands-upscale-workflow.json b/examples/mediapipe_vision/two-hands-upscale-workflow.json new file mode 100644 index 0000000..1c662a0 --- /dev/null +++ b/examples/mediapipe_vision/two-hands-upscale-workflow.json @@ -0,0 +1,2800 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "revision": 0, + "last_node_id": 75, + "last_link_id": 183, + "nodes": [ + { + "id": 35, + "type": "Display Any (rgthree)", + "pos": [ + 2938.571533203125, + 1661.1204833984375 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 30, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 78 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 13, + "type": "CLIPTextEncode", + "pos": [ + 2513.712890625, + 711.9216918945312 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 51 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 57 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 30, + "type": "HandLandmarkPositionNode", + "pos": [ + 1534.582275390625, + 1117.733642578125 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 68 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 97, + 133 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 98, + 134 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 99 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 4, + 0, + false + ] + }, + { + "id": 34, + "type": "Display Any (rgthree)", + "pos": [ + 2592.819580078125, + 1564.373046875 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 27, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 104 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 44, + "type": "CoordinateProximityNode", + "pos": [ + 2093.6845703125, + 1207.534423828125 + ], + "size": [ + 428.4000244140625, + 178 + ], + "flags": {}, + "order": 24, + "mode": 0, + "inputs": [ + { + "name": "x1", + "type": "FLOAT", + "link": 97 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 98 + }, + { + "name": "z1", + "type": "FLOAT", + "link": 99 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 100 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 101 + }, + { + "name": "z2", + "type": "FLOAT", + "link": 102 + } + ], + "outputs": [ + { + "name": "distance", + "type": "FLOAT", + "links": [ + 103, + 104 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "CoordinateProximityNode", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 25, + "type": "CLIPTextEncode", + "pos": [ + 2503.712890625, + 131.9213104248047 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 65 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 63, + 127 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "paint abstract humanoid paint sculpture multicolored masterpiece" + ] + }, + { + "id": 1, + "type": "TorchCompileLoadControlNet", + "pos": [ + 3675.09326171875, + 542.0851440429688 + ], + "size": [ + 327.5999755859375, + 106 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "controlnet", + "type": "CONTROL_NET", + "link": 44 + } + ], + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 58 + ] + } + ], + "properties": { + "cnr_id": "comfyui-torch-compile", + "ver": "5de6422c8be8931930e4118b1457f8592e93dbce", + "Node name for S&R": "TorchCompileLoadControlNet", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "inductor", + false, + "reduce-overhead" + ] + }, + { + "id": 31, + "type": "HandLandmarkPositionNode", + "pos": [ + 1567.415771484375, + 1407.9090576171875 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 69 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 100, + 135 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 101, + 136 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 102 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 8, + 0, + false + ] + }, + { + "id": 49, + "type": "Display Any (rgthree)", + "pos": [ + 2610, + 2300 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 29, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 107 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 50, + "type": "CoordinateProximityNode", + "pos": [ + 2110, + 1940 + ], + "size": [ + 428.4000244140625, + 178 + ], + "flags": {}, + "order": 25, + "mode": 0, + "inputs": [ + { + "name": "x1", + "type": "FLOAT", + "link": 113 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 108 + }, + { + "name": "z1", + "type": "FLOAT", + "link": 109 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 110 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 111 + }, + { + "name": "z2", + "type": "FLOAT", + "link": 112 + } + ], + "outputs": [ + { + "name": "distance", + "type": "FLOAT", + "links": [ + 106, + 107 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "CoordinateProximityNode", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 28, + "type": "MediaPipeHandLandmarkerNode", + "pos": [ + 910.3226928710938, + 1311.845947265625 + ], + "size": [ + 504, + 198 + ], + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 157 + }, + { + "name": "model_info", + "type": "HAND_LANDMARKER_MODEL_INFO", + "link": 67 + } + ], + "outputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "links": [ + 68, + 69, + 116, + 117 + ] + }, + { + "name": "handedness", + "type": "HANDEDNESS_LIST", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "MediaPipeHandLandmarkerNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "video", + "cpu", + 2, + 0.5000000000000001, + 0.5000000000000001, + 0.5000000000000001 + ] + }, + { + "id": 47, + "type": "HandLandmarkPositionNode", + "pos": [ + 1550, + 1850 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 116 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 113, + 139 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 108, + 140 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 109 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 4, + 1, + false + ] + }, + { + "id": 45, + "type": "HandLandmarkPositionNode", + "pos": [ + 1580, + 2140 + ], + "size": [ + 453.5999755859375, + 206 + ], + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "landmarks", + "type": "HAND_LANDMARKS", + "link": 117 + } + ], + "outputs": [ + { + "name": "x", + "type": "FLOAT", + "links": [ + 110, + 141 + ] + }, + { + "name": "y", + "type": "FLOAT", + "links": [ + 111, + 142 + ] + }, + { + "name": "z", + "type": "FLOAT", + "links": [ + 112 + ] + }, + { + "name": "visibility", + "type": "FLOAT", + "links": null + }, + { + "name": "presence", + "type": "FLOAT", + "links": null + }, + { + "name": "is_valid", + "type": "BOOLEAN", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "HandLandmarkPositionNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 8, + 1, + false + ] + }, + { + "id": 12, + "type": "CLIPTextEncode", + "pos": [ + 2503.712890625, + 411.9210510253906 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 50 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 128 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "beautiful pencil sketch, masterpiece, greyscale" + ] + }, + { + "id": 16, + "type": "ControlNetApplyAdvanced", + "pos": [ + 4100.34228515625, + 496.12384033203125 + ], + "size": [ + 315, + 186 + ], + "flags": {}, + "order": 37, + "mode": 0, + "inputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "link": 56 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 57 + }, + { + "name": "control_net", + "type": "CONTROL_NET", + "link": 58 + }, + { + "name": "image", + "type": "IMAGE", + "link": 59 + }, + { + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + }, + { + "name": "strength", + "type": "FLOAT", + "widget": { + "name": "strength" + }, + "link": 126 + } + ], + "outputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "links": [ + 53, + 167 + ] + }, + { + "name": "negative", + "type": "CONDITIONING", + "links": [ + 54, + 168 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ControlNetApplyAdvanced", + "widget_ue_connectable": { + "strength": true + } + }, + "widgets_values": [ + 0.7000000000000002, + 0, + 1 + ] + }, + { + "id": 48, + "type": "RenormalizeFloat", + "pos": [ + 2666.854248046875, + 1929.827880859375 + ], + "size": [ + 327.5999755859375, + 178 + ], + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "value", + "type": "FLOAT", + "link": 106 + } + ], + "outputs": [ + { + "name": "renormalized", + "type": "FLOAT", + "links": [ + 105, + 130 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RenormalizeFloat", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 0.20000000000000004, + 0.3500000000000001, + 0.15000000000000002, + 1.0000000000000002, + true + ] + }, + { + "id": 46, + "type": "Display Any (rgthree)", + "pos": [ + 3027.0009765625, + 2287.699951171875 + ], + "size": [ + 264.5999755859375, + 88 + ], + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ + { + "dir": 3, + "name": "source", + "type": "*", + "link": 105 + } + ], + "outputs": [], + "properties": { + "cnr_id": "rgthree-comfy", + "ver": "6c5f7c95ed8487fe08e42bd0341cae6dc9c0f0ad", + "Node name for S&R": "Display Any (rgthree)", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ] + }, + { + "id": 23, + "type": "FeatureBankAttentionProcessor", + "pos": [ + 4036.46240234375, + 205.65631103515625 + ], + "size": [ + 403.1999816894531, + 154 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 61 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 52, + 166 + ] + } + ], + "properties": { + "aux_id": "livepeer/ComfyUI-Stream-Pack", + "ver": "f6e199090594bad1a604b45ed28ea4914c3db288", + "Node name for S&R": "FeatureBankAttentionProcessor", + "widget_ue_connectable": {} + }, + "widgets_values": [ + false, + 0.8000000000000002, + 0.9800000000000002, + 4, + 4 + ] + }, + { + "id": 6, + "type": "EmptyLatentImage", + "pos": [ + 4114.64404296875, + 785.8204956054688 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 55 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "EmptyLatentImage", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 24, + "type": "ConditioningAverage", + "pos": [ + 3323.712890625, + 361.92108154296875 + ], + "size": [ + 380.4000244140625, + 78 + ], + "flags": {}, + "order": 34, + "mode": 0, + "inputs": [ + { + "name": "conditioning_to", + "type": "CONDITIONING", + "link": 128 + }, + { + "name": "conditioning_from", + "type": "CONDITIONING", + "link": 127 + }, + { + "name": "conditioning_to_strength", + "type": "FLOAT", + "widget": { + "name": "conditioning_to_strength" + }, + "link": 62 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 56 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ConditioningAverage", + "widget_ue_connectable": { + "conditioning_to_strength": true + } + }, + "widgets_values": [ + 1 + ] + }, + { + "id": 32, + "type": "RenormalizeFloat", + "pos": [ + 2612.785400390625, + 1181.9354248046875 + ], + "size": [ + 327.5999755859375, + 178 + ], + "flags": {}, + "order": 26, + "mode": 0, + "inputs": [ + { + "name": "value", + "type": "FLOAT", + "link": 103 + } + ], + "outputs": [ + { + "name": "renormalized", + "type": "FLOAT", + "links": [ + 78, + 131 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RenormalizeFloat", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 0.20000000000000004, + 0.3500000000000001, + 0, + 1.0000000000000002, + true + ] + }, + { + "id": 51, + "type": "RoundNode", + "pos": [ + 3090.375732421875, + 1927.33740234375 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 33, + "mode": 0, + "inputs": [ + { + "name": "int_or_float", + "type": "*", + "link": 130 + } + ], + "outputs": [ + { + "name": "rounded_value", + "type": "FLOAT", + "links": [ + 115, + 126 + ] + }, + { + "name": "rounded_int", + "type": "INT", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RoundNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2 + ] + }, + { + "id": 38, + "type": "RoundNode", + "pos": [ + 3062.66357421875, + 1290.6689453125 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 31, + "mode": 0, + "inputs": [ + { + "name": "int_or_float", + "type": "*", + "link": 131 + } + ], + "outputs": [ + { + "name": "rounded_value", + "type": "FLOAT", + "links": [ + 62, + 86 + ] + }, + { + "name": "rounded_int", + "type": "INT", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RoundNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2 + ] + }, + { + "id": 8, + "type": "ControlNetLoader", + "pos": [ + 3347.576904296875, + 713.297119140625 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 44 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ControlNetLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "control_v11f1p_sd15_depth_fp16.safetensors" + ] + }, + { + "id": 11, + "type": "CLIPLoader", + "pos": [ + 1700.8089599609375, + -0.39290204644203186 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 60 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "sd15\\dreamshaper8\\model.fp16.safetensors", + "stable_diffusion", + "default" + ] + }, + { + "id": 19, + "type": "CLIPSetLastLayer", + "pos": [ + 1772.606201171875, + 473.113525390625 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 60 + } + ], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 50, + 51, + 65 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "CLIPSetLastLayer", + "widget_ue_connectable": {} + }, + "widgets_values": [ + -2 + ] + }, + { + "id": 61, + "type": "Reroute", + "pos": [ + 570.2681274414062, + 836.7106323242188 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 183 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 156, + 157 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false, + "widget_ue_connectable": {} + } + }, + { + "id": 52, + "type": "ToString", + "pos": [ + 3480, + 2150 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "any", + "type": "*", + "link": 115 + } + ], + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 145 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "ToString", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "{}", + "", + "" + ] + }, + { + "id": 41, + "type": "ToString", + "pos": [ + 3493.54296875, + 1486.6871337890625 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 35, + "mode": 0, + "inputs": [ + { + "name": "any", + "type": "*", + "link": 86 + } + ], + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 144 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "ToString", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "{}", + "", + "" + ] + }, + { + "id": 10, + "type": "DepthAnythingTensorrt", + "pos": [ + 975.6404418945312, + 691.5492553710938 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 156 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 59 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI-Depth-Anything-Tensorrt", + "ver": "6c3d65023df3f106679ff4522aeea502dd964a3a", + "Node name for S&R": "DepthAnythingTensorrt", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "depth_anything_vitl14-fp16.engine" + ] + }, + { + "id": 55, + "type": "RTDrawLinesNode", + "pos": [ + 6844.59765625, + 961.8391723632812 + ], + "size": [ + 340.20001220703125, + 402 + ], + "flags": {}, + "order": 42, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 182 + }, + { + "name": "x1", + "type": "FLOAT", + "link": 133 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 134 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 135 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 136 + }, + { + "name": "label_values", + "shape": 7, + "type": "STRING", + "widget": { + "name": "label_values" + }, + "link": 144 + } + ], + "outputs": [ + { + "name": "image_out", + "type": "IMAGE", + "links": [ + 138 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RTDrawLinesNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2, + "#00FF00", + true, + "one-to-one", + false, + 3, + true, + "subject:", + "", + "Midpoint", + 0.5, + "Index-based" + ] + }, + { + "id": 22, + "type": "TensorRTLoader", + "pos": [ + 3446.06201171875, + 110.99031066894531 + ], + "size": [ + 555.0654907226562, + 82 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 61 + ] + } + ], + "properties": { + "aux_id": "yondonfu/ComfyUI_TensorRT", + "ver": "11b623be6f89300250af14e73eeeb2c1db9e48c7", + "Node name for S&R": "TensorRTLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "dynamic-dreamshaper8_SD15_$dyn-b-1-1-1-h-448-768-512-w-448-768-512_00001_.engine", + "SD15" + ] + }, + { + "id": 56, + "type": "RTDrawLinesNode", + "pos": [ + 7306.20703125, + 1331.8394775390625 + ], + "size": [ + 340.20001220703125, + 402 + ], + "flags": {}, + "order": 43, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 138 + }, + { + "name": "x1", + "type": "FLOAT", + "link": 139 + }, + { + "name": "y1", + "type": "FLOAT", + "link": 140 + }, + { + "name": "x2", + "type": "FLOAT", + "link": 141 + }, + { + "name": "y2", + "type": "FLOAT", + "link": 142 + }, + { + "name": "label_values", + "shape": 7, + "type": "STRING", + "widget": { + "name": "label_values" + }, + "link": 145 + } + ], + "outputs": [ + { + "name": "image_out", + "type": "IMAGE", + "links": [ + 160 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "RTDrawLinesNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2, + "#00FF00", + true, + "one-to-one", + false, + 3, + true, + "dream:", + "", + "Midpoint", + 0.5, + "Index-based" + ] + }, + { + "id": 60, + "type": "PreviewImage", + "pos": [ + 8099.62548828125, + 793.7354125976562 + ], + "size": [ + 210, + 246 + ], + "flags": {}, + "order": 45, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 162 + } + ], + "outputs": [], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "PreviewImage", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 62, + "type": "ImageUpscaleWithModel", + "pos": [ + 7657.44091796875, + 1125.1676025390625 + ], + "size": [ + 340.20001220703125, + 46 + ], + "flags": {}, + "order": 44, + "mode": 0, + "inputs": [ + { + "name": "upscale_model", + "type": "UPSCALE_MODEL", + "link": 161 + }, + { + "name": "image", + "type": "IMAGE", + "link": 160 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 162 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "ImageUpscaleWithModel", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 63, + "type": "UpscaleModelLoader", + "pos": [ + 7279.9697265625, + 752.9086303710938 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "UPSCALE_MODEL", + "type": "UPSCALE_MODEL", + "links": [ + 161 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "UpscaleModelLoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "RealESRGAN_x2.pth" + ] + }, + { + "id": 29, + "type": "MediaPipeHandLandmarkerModelLoaderNode", + "pos": [ + 380.9790344238281, + 1370.185546875 + ], + "size": [ + 445.20001220703125, + 58 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "model_info", + "type": "HAND_LANDMARKER_MODEL_INFO", + "links": [ + 67 + ] + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "91b155a115c2e34f95b9e8e4180ef4d36fe62c87", + "Node name for S&R": "MediaPipeHandLandmarkerModelLoaderNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "default" + ] + }, + { + "id": 14, + "type": "KSampler", + "pos": [ + 4739.78564453125, + 440.3196105957031 + ], + "size": [ + 315, + 262 + ], + "flags": {}, + "order": 38, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 52 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 53 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 54 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 55 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 165 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "KSampler", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 603918565485061, + "fixed", + 4, + 1.2, + "lcm", + "sgm_uniform", + 1 + ] + }, + { + "id": 3, + "type": "TorchCompileLoadVAE", + "pos": [ + 5053.7998046875, + 779.5272216796875 + ], + "size": [ + 315, + 154 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "vae", + "type": "VAE", + "link": 45 + } + ], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 172 + ] + } + ], + "properties": { + "cnr_id": "comfyui-torch-compile", + "ver": "5de6422c8be8931930e4118b1457f8592e93dbce", + "Node name for S&R": "TorchCompileLoadVAE", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "inductor", + true, + "reduce-overhead", + true, + true + ] + }, + { + "id": 69, + "type": "KSampler", + "pos": [ + 5855.634765625, + 467.65655517578125 + ], + "size": [ + 315, + 262 + ], + "flags": {}, + "order": 40, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 166 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 167 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 168 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 170 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 173 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "widget_ue_connectable": {}, + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 603918565485061, + "fixed", + 4, + 1.2, + "lcm", + "sgm_uniform", + 0.5000000000000001 + ] + }, + { + "id": 68, + "type": "NNLatentUpscale", + "pos": [ + 5864.68701171875, + 800.9833374023438 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 39, + "mode": 0, + "inputs": [ + { + "name": "latent", + "type": "LATENT", + "link": 165 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 170 + ] + } + ], + "properties": { + "cnr_id": "comfyui_nnlatentupscale", + "ver": "1.0.0", + "widget_ue_connectable": {}, + "Node name for S&R": "NNLatentUpscale" + }, + "widgets_values": [ + "SD 1.x", + 1.5 + ] + }, + { + "id": 70, + "type": "VAEDecode", + "pos": [ + 6278.03466796875, + 480.0000305175781 + ], + "size": [ + 210, + 46 + ], + "flags": {}, + "order": 41, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 173 + }, + { + "name": "vae", + "type": "VAE", + "link": 172 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 182 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "widget_ue_connectable": {}, + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 74, + "type": "Note", + "pos": [ + 5870.3876953125, + 284.3726806640625 + ], + "size": [ + 234.39193725585938, + 88 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "this is one of the reasons i pushed for dynamic res in comfystream" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 2, + "type": "VAELoader", + "pos": [ + 4644.08740234375, + 816.1616821289062 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 45 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "VAELoader", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "taesd" + ] + }, + { + "id": 75, + "type": "Note", + "pos": [ + 4752.13525390625, + 952.3453979492188 + ], + "size": [ + 234.39193725585938, + 88 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "you could use a regular vae here for better quality" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 66, + "type": "LoadImageB64", + "pos": [ + 147.16946411132812, + 833.0152587890625 + ], + "size": [ + 315, + 78 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 183 + ] + }, + { + "name": "mask", + "type": "MASK", + "links": null + } + ], + "properties": { + "aux_id": "ryanontheinside/ComfyUI_RealtimeNodes", + "ver": "bb8b7b41669339dbc33130b264abae7bfa8db0c0", + "widget_ue_connectable": {}, + "Node name for S&R": "LoadImageB64" + }, + "widgets_values": [ + "" + ] + } + ], + "links": [ + [ + 44, + 8, + 0, + 1, + 0, + "CONTROL_NET" + ], + [ + 45, + 2, + 0, + 3, + 0, + "VAE" + ], + [ + 50, + 19, + 0, + 12, + 0, + "CLIP" + ], + [ + 51, + 19, + 0, + 13, + 0, + "CLIP" + ], + [ + 52, + 23, + 0, + 14, + 0, + "MODEL" + ], + [ + 53, + 16, + 0, + 14, + 1, + "CONDITIONING" + ], + [ + 54, + 16, + 1, + 14, + 2, + "CONDITIONING" + ], + [ + 55, + 6, + 0, + 14, + 3, + "LATENT" + ], + [ + 56, + 24, + 0, + 16, + 0, + "CONDITIONING" + ], + [ + 57, + 13, + 0, + 16, + 1, + "CONDITIONING" + ], + [ + 58, + 1, + 0, + 16, + 2, + "CONTROL_NET" + ], + [ + 59, + 10, + 0, + 16, + 3, + "IMAGE" + ], + [ + 60, + 11, + 0, + 19, + 0, + "CLIP" + ], + [ + 61, + 22, + 0, + 23, + 0, + "MODEL" + ], + [ + 62, + 38, + 0, + 24, + 2, + "FLOAT" + ], + [ + 65, + 19, + 0, + 25, + 0, + "CLIP" + ], + [ + 67, + 29, + 0, + 28, + 1, + "HAND_LANDMARKER_MODEL_INFO" + ], + [ + 68, + 28, + 0, + 30, + 0, + "HAND_LANDMARKS" + ], + [ + 69, + 28, + 0, + 31, + 0, + "HAND_LANDMARKS" + ], + [ + 78, + 32, + 0, + 35, + 0, + "*" + ], + [ + 86, + 38, + 0, + 41, + 0, + "*" + ], + [ + 97, + 30, + 0, + 44, + 0, + "FLOAT" + ], + [ + 98, + 30, + 1, + 44, + 1, + "FLOAT" + ], + [ + 99, + 30, + 2, + 44, + 2, + "FLOAT" + ], + [ + 100, + 31, + 0, + 44, + 3, + "FLOAT" + ], + [ + 101, + 31, + 1, + 44, + 4, + "FLOAT" + ], + [ + 102, + 31, + 2, + 44, + 5, + "FLOAT" + ], + [ + 103, + 44, + 0, + 32, + 0, + "FLOAT" + ], + [ + 104, + 44, + 0, + 34, + 0, + "*" + ], + [ + 105, + 48, + 0, + 46, + 0, + "*" + ], + [ + 106, + 50, + 0, + 48, + 0, + "FLOAT" + ], + [ + 107, + 50, + 0, + 49, + 0, + "*" + ], + [ + 108, + 47, + 1, + 50, + 1, + "FLOAT" + ], + [ + 109, + 47, + 2, + 50, + 2, + "FLOAT" + ], + [ + 110, + 45, + 0, + 50, + 3, + "FLOAT" + ], + [ + 111, + 45, + 1, + 50, + 4, + "FLOAT" + ], + [ + 112, + 45, + 2, + 50, + 5, + "FLOAT" + ], + [ + 113, + 47, + 0, + 50, + 0, + "FLOAT" + ], + [ + 115, + 51, + 0, + 52, + 0, + "*" + ], + [ + 116, + 28, + 0, + 47, + 0, + "HAND_LANDMARKS" + ], + [ + 117, + 28, + 0, + 45, + 0, + "HAND_LANDMARKS" + ], + [ + 126, + 51, + 0, + 16, + 5, + "FLOAT" + ], + [ + 127, + 25, + 0, + 24, + 1, + "CONDITIONING" + ], + [ + 128, + 12, + 0, + 24, + 0, + "CONDITIONING" + ], + [ + 130, + 48, + 0, + 51, + 0, + "*" + ], + [ + 131, + 32, + 0, + 38, + 0, + "*" + ], + [ + 133, + 30, + 0, + 55, + 1, + "FLOAT" + ], + [ + 134, + 30, + 1, + 55, + 2, + "FLOAT" + ], + [ + 135, + 31, + 0, + 55, + 3, + "FLOAT" + ], + [ + 136, + 31, + 1, + 55, + 4, + "FLOAT" + ], + [ + 138, + 55, + 0, + 56, + 0, + "IMAGE" + ], + [ + 139, + 47, + 0, + 56, + 1, + "FLOAT" + ], + [ + 140, + 47, + 1, + 56, + 2, + "FLOAT" + ], + [ + 141, + 45, + 0, + 56, + 3, + "FLOAT" + ], + [ + 142, + 45, + 1, + 56, + 4, + "FLOAT" + ], + [ + 144, + 41, + 0, + 55, + 5, + "STRING" + ], + [ + 145, + 52, + 0, + 56, + 5, + "STRING" + ], + [ + 156, + 61, + 0, + 10, + 0, + "IMAGE" + ], + [ + 157, + 61, + 0, + 28, + 0, + "IMAGE" + ], + [ + 160, + 56, + 0, + 62, + 1, + "IMAGE" + ], + [ + 161, + 63, + 0, + 62, + 0, + "UPSCALE_MODEL" + ], + [ + 162, + 62, + 0, + 60, + 0, + "IMAGE" + ], + [ + 165, + 14, + 0, + 68, + 0, + "LATENT" + ], + [ + 166, + 23, + 0, + 69, + 0, + "MODEL" + ], + [ + 167, + 16, + 0, + 69, + 1, + "CONDITIONING" + ], + [ + 168, + 16, + 1, + 69, + 2, + "CONDITIONING" + ], + [ + 170, + 68, + 0, + 69, + 3, + "LATENT" + ], + [ + 172, + 3, + 0, + 70, + 1, + "VAE" + ], + [ + 173, + 69, + 0, + 70, + 0, + "LATENT" + ], + [ + 182, + 70, + 0, + 55, + 0, + "IMAGE" + ], + [ + 183, + 66, + 0, + 61, + 0, + "*" + ] + ], + "groups": [ + { + "id": 1, + "title": "Hand Tracking 1 hand", + "bounding": [ + 873.1765747070312, + 1022.9521484375, + 2974.574462890625, + 770.6577758789062 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 2, + "title": "Prompts", + "bounding": [ + 1573.782470703125, + -148.70542907714844, + 4037.425048828125, + 1132.17919921875 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 4, + "title": "Hand Tracking 2 hand", + "bounding": [ + 867.7586059570312, + 1834.1785888671875, + 2983.684814453125, + 671.8448486328125 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 5, + "title": "Add Labels", + "bounding": [ + 6637.59912109375, + 271.6209716796875, + 1674.5372314453125, + 1570.057861328125 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + } + ], + "config": {}, + "extra": { + "ds": { + "scale": 0.13719212021148774, + "offset": [ + 995.8401791270961, + 1397.0383976232424 + ] + }, + "ue_links": [], + "links_added_by_ue": [], + "frontendVersion": "1.17.11", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/node_wrappers/realtimenodes/media/batch_processor.py b/node_wrappers/realtimenodes/media/batch_processor.py new file mode 100644 index 0000000..87252b3 --- /dev/null +++ b/node_wrappers/realtimenodes/media/batch_processor.py @@ -0,0 +1,401 @@ +import torch +import os +import numpy as np +import sys +import traceback +import cv2 +import datetime + +from ....src.realtimenodes.control_base import ControlNodeBase + +#NOTE: this is a rudimentary spike, and will be brittle + +#TODO: use base class state management + +class BatchInfo: + """Custom class to hold batch processing information""" + def __init__(self, current_index, total_frames, is_last_frame): + self.current_index = current_index + self.total_frames = total_frames + self.is_last_frame = is_last_frame + + +class BatchImageProcessor(ControlNodeBase): + """Node that feeds images one by one from a batch into the workflow""" + + # Static variables to persist state across executions + _global_state = {} + + @classmethod + def INPUT_TYPES(cls): + inputs = super().INPUT_TYPES() + inputs["required"].update({ + "images": ("IMAGE",), + "reset": ("BOOLEAN", {"default": False, "tooltip": "Reset the batch processing"}), + }) + return inputs + + RETURN_TYPES = ("IMAGE", "BATCH_INFO") + RETURN_NAMES = ("image", "batch_info") + FUNCTION = "update" + CATEGORY = "Realtime Nodes/media/batch" + DESCRIPTION = "Feeds images one by one from a batch into the workflow. Must be used in conjunction with BatchResultCollector node." + def update(self, images, reset, always_execute=True, unique_id=None): + print(f"[BatchImageProcessor] Unique ID: {unique_id}") + print(f"[BatchImageProcessor] Input images tensor shape: {images.shape}") + + # Use class static variable to persist state + if unique_id not in self.__class__._global_state: + self.__class__._global_state[unique_id] = {"current_index": 0, "total_frames": 0} + + state = self.__class__._global_state[unique_id] + + # Get batch size (first dimension of tensor) + batch_size = images.size(0) + + # Reset if requested or if new batch size + if reset or state["total_frames"] != batch_size: + print(f"[BatchImageProcessor] Resetting state. Was at index {state['current_index']}/{state['total_frames']}, new total frames: {batch_size}") + state["current_index"] = 0 + state["total_frames"] = batch_size + + # Get current image (preserving batch dimension) + current_index = state["current_index"] + current_image = images[current_index:current_index+1] + print(f"[BatchImageProcessor] Current image tensor shape: {current_image.shape}") + + # Prepare batch info + is_last_frame = current_index == state["total_frames"] - 1 + batch_info = BatchInfo( + current_index=current_index, + total_frames=state["total_frames"], + is_last_frame=is_last_frame + ) + + # Update index for next run + state["current_index"] = (current_index + 1) % state["total_frames"] + print(f"[BatchImageProcessor] Processing frame {current_index+1}/{state['total_frames']} (is_last_frame: {is_last_frame})") + print(f"[BatchImageProcessor] Next frame index will be: {state['current_index']}") + + return (current_image, batch_info) + + +class BatchResultCollector(ControlNodeBase): + """Node that collects batch results and saves to video when complete""" + + # Static variables to persist state across executions + _global_state = {} + + @classmethod + def INPUT_TYPES(cls): + inputs = super().INPUT_TYPES() + inputs["required"].update({ + "image": ("IMAGE",), + "batch_info": ("BATCH_INFO",), + "filename_prefix": ("STRING", {"default": "batch_video"}), + "fps": ("FLOAT", {"default": 30.0, "min": 1.0, "max": 120.0}), + "format": (["mp4", "webm", "gif"], {"default": "mp4"}), + "reset": ("BOOLEAN", {"default": False}), + }) + return inputs + + RETURN_TYPES = ("IMAGE",) + FUNCTION = "update" + CATEGORY = "Realtime Nodes/media/batch" + OUTPUT_NODE = True + DESCRIPTION = "Collects frames from a batch and saves them as a video when the last frame is received. If the last frame is not received, the node will block execution until it is received. Must be used in conjunction with BatchImageProcessor node." + def update(self, image, batch_info, filename_prefix, fps, format, reset, always_execute=True, unique_id=None): + print(f"[BatchResultCollector] Unique ID: {unique_id}") + print(f"[BatchResultCollector] Received frame {batch_info.current_index+1}/{batch_info.total_frames} (is_last_frame: {batch_info.is_last_frame})") + print(f"[BatchResultCollector] Input image tensor shape: {image.shape}") + + # Create default state structure + default_state = { + "collected_frames": [], + "current_index": -1, + "total_frames": 0 + } + + # Use class static variable to persist state + if unique_id not in self.__class__._global_state: + self.__class__._global_state[unique_id] = default_state.copy() + + state = self.__class__._global_state[unique_id] + + # Ensure all required keys exist in state + for key in default_state: + if key not in state: + state[key] = default_state[key] + + # Reset if requested + if reset: + print(f"[BatchResultCollector] Resetting state due to reset flag") + state.clear() + state.update(default_state.copy()) + + current_index = batch_info.current_index + total_frames = batch_info.total_frames + + # Update state if new batch + if state["total_frames"] != total_frames: + print(f"[BatchResultCollector] New batch detected. Updating total_frames from {state['total_frames']} to {total_frames}") + state["total_frames"] = total_frames + state["collected_frames"] = [None] * total_frames + + # Store the frame + if state["current_index"] != current_index: + state["current_index"] = current_index + # Ensure the array is large enough + if len(state["collected_frames"]) <= current_index: + print(f"[BatchResultCollector] Extending collected_frames array from {len(state['collected_frames'])} to {current_index+1}") + state["collected_frames"].extend([None] * (current_index - len(state["collected_frames"]) + 1)) + # Make a copy and store the frame + state["collected_frames"][current_index] = image.clone().cpu() + print(f"[BatchResultCollector] Stored frame {current_index+1}/{total_frames}, shape: {state['collected_frames'][current_index].shape}") + + # Debug info for collected frames + frame_status = ["✓" if f is not None else "✗" for f in state["collected_frames"]] + print(f"[BatchResultCollector] Frame collection status: {frame_status}") + + # Check if all frames collected + collected_count = sum(1 for frame in state["collected_frames"] if frame is not None) + all_frames_collected = all(frame is not None for frame in state["collected_frames"]) + print(f"[BatchResultCollector] Collected {collected_count}/{total_frames} frames. All frames collected: {all_frames_collected}") + + # If last frame and all collected, save video + if batch_info.is_last_frame and all_frames_collected: + print(f"[BatchResultCollector] Last frame received and all frames collected. Saving video...") + success = self._save_video(state["collected_frames"], filename_prefix, fps, format) + + # Reset state after save + state.clear() + state.update(default_state.copy()) + + if success: + # Stop auto-queue with a deliberate exception to notify the user + print(f"[BatchResultCollector] Successfully saved video. Stopping auto-queue.") + raise Exception("Processing complete. Disable auto-queue.") + + else: + if batch_info.is_last_frame: + print(f"[BatchResultCollector] Last frame received but not all frames collected yet") + if all_frames_collected: + print(f"[BatchResultCollector] All frames collected but not receiving last frame yet") + + return (image,) + + def _save_frames_as_images(self, frames, filename_prefix, output_dir): + """Save each frame as an individual image for debugging""" + try: + import folder_paths + from PIL import Image + + # Print details of the first frame for debugging + print(f"[BatchResultCollector] SaveFrames: First frame type: {type(frames[0])}") + print(f"[BatchResultCollector] SaveFrames: First frame tensor shape: {frames[0].shape}") + + # Get video dimensions from the first frame + first_frame = frames[0] + if len(first_frame.shape) == 4: # Handle [B,H,W,C] format + height, width = first_frame.shape[1], first_frame.shape[2] + else: # Handle [H,W,C] format + height, width = first_frame.shape[0], first_frame.shape[1] + + print(f"[BatchResultCollector] SaveFrames dimensions determined: {width}x{height}") + + # Generate timestamp for unique filename + timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + + # Get save path + full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path( + f"{filename_prefix}_{timestamp}", output_dir, width, height + ) + + print(f"[BatchResultCollector] Saving {len(frames)} individual frames to {full_output_folder}") + + for i, frame_tensor in enumerate(frames): + print(f"[BatchResultCollector] Saving individual frame {i+1}/{len(frames)}") + + # Remove batch dimension if present (B,H,W,C) -> (H,W,C) + if len(frame_tensor.shape) == 4: + frame_tensor = frame_tensor.squeeze(0) + + # Convert tensor to numpy + frame_np = torch.clamp(frame_tensor * 255, min=0, max=255).to(torch.uint8).cpu().numpy() + + # Create PIL image and save + img = Image.fromarray(frame_np) + img_path = os.path.join(full_output_folder, f"{filename}_{counter:05}_{i:04}.png") + img.save(img_path) + + print(f"[BatchResultCollector] Successfully saved {len(frames)} individual frames") + return True + except Exception as e: + print(f"[BatchResultCollector] Error saving individual frames: {str(e)}") + traceback.print_exc() + return False + + def _save_as_gif(self, frames, filename_prefix, fps, output_dir): + """Save frames as animated GIF using PIL""" + try: + import folder_paths + from PIL import Image + + # Print details of the first frame for debugging + print(f"[BatchResultCollector] GIF: First frame type: {type(frames[0])}") + print(f"[BatchResultCollector] GIF: First frame tensor shape: {frames[0].shape}") + + # Get video dimensions from the first frame + first_frame = frames[0] + if len(first_frame.shape) == 4: # Handle [B,H,W,C] format + height, width = first_frame.shape[1], first_frame.shape[2] + else: # Handle [H,W,C] format + height, width = first_frame.shape[0], first_frame.shape[1] + + print(f"[BatchResultCollector] GIF dimensions determined: {width}x{height}") + + # Generate timestamp for unique filename + timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + + # Get save path + full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path( + f"{filename_prefix}_{timestamp}", output_dir, width, height + ) + + file = f"{filename}_{counter:05}.gif" + file_path = os.path.join(full_output_folder, file) + + print(f"[BatchResultCollector] Saving GIF to {file_path}") + + # Convert tensors to PIL images + pil_frames = [] + for i, frame_tensor in enumerate(frames): + print(f"[BatchResultCollector] Processing GIF frame {i+1}/{len(frames)}") + + # Remove batch dimension if present (B,H,W,C) -> (H,W,C) + if len(frame_tensor.shape) == 4: + frame_tensor = frame_tensor.squeeze(0) + + # Convert tensor to numpy + frame_np = torch.clamp(frame_tensor * 255, min=0, max=255).to(torch.uint8).cpu().numpy() + pil_frames.append(Image.fromarray(frame_np)) + + # Save as GIF + duration = int(1000 / fps) # Duration per frame in milliseconds + pil_frames[0].save( + file_path, + save_all=True, + append_images=pil_frames[1:], + optimize=False, + duration=duration, + loop=0 + ) + + print(f"[BatchResultCollector] Successfully saved GIF with {len(frames)} frames to {file_path}") + return True + except Exception as e: + print(f"[BatchResultCollector] Error saving GIF: {str(e)}") + traceback.print_exc() + return False + + def _save_video(self, frames, filename_prefix, fps, format): + """Save collected frames as video file using OpenCV""" + import folder_paths + + # Get output directory + output_dir = folder_paths.get_output_directory() + + if format == "gif": + return self._save_as_gif(frames, filename_prefix, fps, output_dir) + + try: + # Generate timestamp for unique filename + timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + + # Print details of the first frame for debugging + print(f"[BatchResultCollector] First frame type: {type(frames[0])}") + print(f"[BatchResultCollector] First frame tensor shape: {frames[0].shape}") + + # Get video dimensions from the first frame + first_frame = frames[0] + if len(first_frame.shape) == 4: # Handle [B,H,W,C] format + height, width = first_frame.shape[1], first_frame.shape[2] + else: # Handle [H,W,C] format + height, width = first_frame.shape[0], first_frame.shape[1] + + print(f"[BatchResultCollector] Video dimensions determined: {width}x{height}") + + # Get save path + full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path( + f"{filename_prefix}_{timestamp}", output_dir, width, height + ) + + file = f"{filename}_{counter:05}.{format}" + file_path = os.path.join(full_output_folder, file) + + print(f"[BatchResultCollector] Saving video to {file_path}") + + # Ensure output directory exists + os.makedirs(os.path.dirname(file_path), exist_ok=True) + + # Try with avc1 codec first (H.264) + fourcc = cv2.VideoWriter_fourcc(*'avc1') + out = cv2.VideoWriter(file_path, fourcc, fps, (width, height)) + + # Fall back to mp4v if avc1 fails + if not out.isOpened(): + print(f"[BatchResultCollector] Warning: Failed to create video with avc1 codec, trying mp4v instead") + out.release() + + if format == 'mp4': + fourcc = cv2.VideoWriter_fourcc(*'mp4v') + else: + fourcc = cv2.VideoWriter_fourcc(*'vp90') + + out = cv2.VideoWriter(file_path, fourcc, fps, (width, height)) + + if not out.isOpened(): + raise Exception(f"Failed to open video writer with any codec for format {format}") + + print(f"[BatchResultCollector] Created video writer with dimensions {width}x{height} at {fps} fps") + + # Write frames + frames_encoded = 0 + for i, frame_tensor in enumerate(frames): + print(f"[BatchResultCollector] Processing frame {i+1}/{len(frames)}") + print(f"[BatchResultCollector] Frame tensor shape: {frame_tensor.shape}") + + # Remove batch dimension if present (B,H,W,C) -> (H,W,C) + if len(frame_tensor.shape) == 4: + frame_tensor = frame_tensor.squeeze(0) + print(f"[BatchResultCollector] After removing batch dimension: {frame_tensor.shape}") + + # Convert tensor to numpy array with values in [0-255] + frame_np = torch.clamp(frame_tensor * 255, min=0, max=255).to(torch.uint8).cpu().numpy() + print(f"[BatchResultCollector] NumPy array shape: {frame_np.shape}") + + # Make sure we have the expected dimensions + if frame_np.shape[0] != height or frame_np.shape[1] != width: + print(f"[BatchResultCollector] Warning: Frame dimensions don't match expected {height}x{width}") + + # Convert RGB to BGR for OpenCV + frame_bgr = cv2.cvtColor(frame_np, cv2.COLOR_RGB2BGR) + + # Write frame + out.write(frame_bgr) + frames_encoded += 1 + + if frames_encoded % 10 == 0: + print(f"[BatchResultCollector] Encoded {frames_encoded}/{len(frames)} frames") + + # Release video writer + out.release() + + print(f"[BatchResultCollector] Video saved successfully with {frames_encoded} frames to {file_path}") + return True + + except Exception as e: + print(f"[BatchResultCollector] Error saving video: {str(e)}") + traceback.print_exc() + print("[BatchResultCollector] Falling back to saving individual frames") + return self._save_frames_as_images(frames, filename_prefix, output_dir) \ No newline at end of file