From cfb3b237cf64b512414a17f71e6d89c3355aa8ef Mon Sep 17 00:00:00 2001 From: melMass Date: Sat, 5 Aug 2023 13:08:18 +0200 Subject: [PATCH] =?UTF-8?q?revertible:=20=F0=9F=92=84=20use=20BOOLEAN=20in?= =?UTF-8?q?stead=20of=20BOOL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since this commit: https://github.com/comfyanonymous/ComfyUI/commit/9534f0f8a5a026654492da378f84d2cdc589ed01 Input <-> widget is possible on booleans. Locally I edited it but forgot about it not being in comfy This commit is reversable since I'm not yet sure of all the impacts --- .../03-animation_builder-condition-lerp.json | 1249 +---------------- examples/04-animation_builder-deforum.json | 1190 +--------------- nodes/animation.py | 2 +- nodes/deep_bump.py | 2 +- nodes/faceenhance.py | 6 +- nodes/faceswap.py | 5 +- nodes/fun.py | 2 +- nodes/graph_utils.py | 2 +- nodes/image_interpolation.py | 4 +- nodes/image_processing.py | 6 +- nodes/io.py | 3 +- nodes/mask.py | 4 +- nodes/number.py | 2 +- web/mtb_widgets.js | 111 +- 14 files changed, 21 insertions(+), 2567 deletions(-) diff --git a/examples/03-animation_builder-condition-lerp.json b/examples/03-animation_builder-condition-lerp.json index 7262e17..531e312 100644 --- a/examples/03-animation_builder-condition-lerp.json +++ b/examples/03-animation_builder-condition-lerp.json @@ -1,1248 +1 @@ -{ - "last_node_id": 82, - "last_link_id": 171, - "nodes": [ - { - "id": 59, - "type": "Reroute", - "pos": [ - -150.35178124999982, - 644.4360633544919 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 13, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 124 - } - ], - "outputs": [ - { - "name": "", - "type": "VAE", - "links": [ - 139 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 56, - "type": "Reroute", - "pos": [ - -1580.8297949218763, - 644.7740239257807 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 117 - } - ], - "outputs": [ - { - "name": "", - "type": "VAE", - "links": [ - 124 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 57, - "type": "Reroute", - "pos": [ - -673.8297949218747, - -185.22597607421872 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 135 - } - ], - "outputs": [ - { - "name": "", - "type": "MODEL", - "links": [ - 120 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 65, - "type": "Reroute", - "pos": [ - -1512.8297949218763, - -181.22597607421872 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 134 - } - ], - "outputs": [ - { - "name": "", - "type": "MODEL", - "links": [ - 135 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 16, - "type": "CheckpointLoaderSimple", - "pos": [ - -2000.8297949218756, - 192.77402392578128 - ], - "size": [ - 315, - 98 - ], - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 134 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 116 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 117 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "revAnimated_v122.safetensors" - ] - }, - { - "id": 19, - "type": "CLIPSetLastLayer", - "pos": [ - -1597, - 209 - ], - "size": [ - 315, - 58 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 116 - } - ], - "outputs": [ - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 28, - 29, - 149 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPSetLastLayer" - }, - "widgets_values": [ - -2 - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - -839, - 335 - ], - "size": [ - 210, - 54 - ], - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 29 - }, - { - "name": "text", - "type": "STRING", - "link": 163, - "widget": { - "name": "text", - "config": [ - "STRING", - { - "multiline": true - } - ] - }, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "worst quality, hands, embedding:EasyNegative," - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - -969, - 484 - ], - "size": [ - 315, - 106 - ], - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 768, - 512, - 1 - ] - }, - { - "id": 80, - "type": "Text box", - "pos": [ - -1397, - 356 - ], - "size": [ - 294, - 93.11674499511719 - ], - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 163 - ], - "shape": 3, - "slot_index": 0 - } - ], - "title": "❌Mel Negatives (general) (Negative)", - "properties": { - "Node name for S&R": "Text box" - }, - "widgets_values": [ - "embedding:EasyNegative, embedding:EasyNegativeV2, watermark, text, deformed" - ] - }, - { - "id": 72, - "type": "ConditioningAverage ", - "pos": [ - -960, - 2 - ], - "size": [ - 380.4000244140625, - 78 - ], - "flags": {}, - "order": 16, - "mode": 0, - "inputs": [ - { - "name": "conditioning_to", - "type": "CONDITIONING", - "link": 151 - }, - { - "name": "conditioning_from", - "type": "CONDITIONING", - "link": 152, - "slot_index": 1 - }, - { - "name": "conditioning_to_strength", - "type": "FLOAT", - "link": 154, - "widget": { - "name": "conditioning_to_strength", - "config": [ - "FLOAT", - { - "default": 1, - "min": 0, - "max": 1, - "step": 0.01 - } - ] - }, - "slot_index": 2 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 153 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ConditioningAverage " - }, - "widgets_values": [ - 1 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - -1261, - -46 - ], - "size": [ - 210, - 54 - ], - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 28 - }, - { - "name": "text", - "type": "STRING", - "link": 145, - "widget": { - "name": "text", - "config": [ - "STRING", - { - "multiline": true - } - ] - }, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 151 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "A majestic Lion, fur in the wind, (smirk smile)" - ] - }, - { - "id": 70, - "type": "CLIPTextEncode", - "pos": [ - -1245, - 87 - ], - "size": [ - 210, - 54 - ], - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 149, - "slot_index": 0 - }, - { - "name": "text", - "type": "STRING", - "link": 150, - "widget": { - "name": "text", - "config": [ - "STRING", - { - "multiline": true - } - ] - }, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 152 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "A majestic Lion, fur in the wind, (smirk smile)" - ] - }, - { - "id": 69, - "type": "String Replace (mtb)", - "pos": [ - -1560, - -70 - ], - "size": [ - 210, - 82 - ], - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "string", - "type": "STRING", - "link": 141 - } - ], - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 145 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "String Replace (mtb)" - }, - "widgets_values": [ - "blue", - "yellow" - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 68, - "type": "Text box", - "pos": [ - -1950, - 10 - ], - "size": [ - 217.2119140625, - 122.18632507324219 - ], - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 141, - 150 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Text box" - }, - "widgets_values": [ - "A cinematic shot of a blue car, high speed, smoke whisps in the air, (at night), blue neon lighting" - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - -483, - -21 - ], - "size": [ - 315, - 474 - ], - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 120 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 153 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 138 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 5428233522, - "fixed", - 45, - 8, - "euler_ancestral", - "simple", - 1 - ] - }, - { - "id": 66, - "type": "VAEDecodeTiled", - "pos": [ - 197, - -20 - ], - "size": [ - 210, - 46 - ], - "flags": { - "collapsed": false - }, - "order": 20, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 138 - }, - { - "name": "vae", - "type": "VAE", - "link": 139, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 161 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecodeTiled" - } - }, - { - "id": 78, - "type": "SaveImage", - "pos": [ - 565, - -18 - ], - "size": [ - 315, - 270 - ], - "flags": {}, - "order": 21, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 161 - } - ], - "properties": {}, - "widgets_values": [ - "mtb_demo-conditional_blend" - ] - }, - { - "id": 81, - "type": "Get Batch From History (mtb)", - "pos": [ - -625, - 848 - ], - "size": [ - 235.1999969482422, - 118 - ], - "flags": {}, - "order": 15, - "mode": 0, - "inputs": [ - { - "name": "passthrough_image", - "type": "IMAGE", - "link": null - }, - { - "name": "count", - "type": "INT", - "link": 171, - "widget": { - "name": "count", - "config": [ - "INT", - { - "default": 1, - "min": 0 - } - ] - }, - "slot_index": 2 - }, - { - "name": "enable", - "type": "BOOL", - "link": 168, - "widget": { - "name": "enable", - "config": [ - "BOOL", - { - "default": true - } - ] - }, - "slot_index": 2 - } - ], - "outputs": [ - { - "name": "i", - "type": "IMAGE", - "links": [ - 166, - 167 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Get Batch From History (mtb)" - }, - "widgets_values": [ - true, - 24, - 0 - ] - }, - { - "id": 77, - "type": "Export To Prores (mtb)", - "pos": [ - -111, - 849 - ], - "size": [ - 315, - 82 - ], - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 166, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "VIDEO", - "type": "VIDEO", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "Export To Prores (mtb)" - }, - "widgets_values": [ - 12, - "export" - ] - }, - { - "id": 79, - "type": "Save Gif (mtb)", - "pos": [ - -104, - 1000 - ], - "size": [ - 210, - 356 - ], - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 167 - }, - { - "name": "pingpong", - "type": "BOOL", - "link": null - } - ], - "properties": { - "Node name for S&R": "Save Gif (mtb)" - }, - "widgets_values": [ - 12, - 1, - true, - "/view?filename=03031ebda0.gif&subfolder=&type=output" - ] - }, - { - "id": 73, - "type": "Animation Builder (mtb)", - "pos": [ - -1285, - 831 - ], - "size": [ - 211.60000610351562, - 294 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "total_frames", - "type": "INT", - "link": 170, - "widget": { - "name": "total_frames", - "config": [ - "INT", - { - "default": 100, - "min": 0 - } - ] - }, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "frame", - "type": "INT", - "links": null, - "shape": 3, - "slot_index": 0 - }, - { - "name": "0-1 (scaled)", - "type": "FLOAT", - "links": [ - 154 - ], - "shape": 3, - "slot_index": 1 - }, - { - "name": "count", - "type": "INT", - "links": null, - "shape": 3 - }, - { - "name": "loop_ended", - "type": "BOOL", - "links": [ - 168 - ], - "shape": 3, - "slot_index": 3 - } - ], - "properties": { - "Node name for S&R": "Animation Builder (mtb)" - }, - "widgets_values": [ - 24, - 1, - 1, - 0, - 0, - "Idle", - "Iteration: Idle", - "reset", - "queue" - ], - "color": "#232", - "bgcolor": "#353", - "shape": 1 - }, - { - "id": 82, - "type": "PrimitiveNode", - "pos": [ - -1663, - 1205 - ], - "size": [ - 210, - 82 - ], - "flags": {}, - "order": 4, - "mode": 0, - "outputs": [ - { - "name": "INT", - "type": "INT", - "links": [ - 170, - 171 - ], - "widget": { - "name": "total_frames", - "config": [ - "INT", - { - "default": 100, - "min": 0 - } - ] - }, - "slot_index": 0 - } - ], - "title": "total_frames", - "properties": {}, - "widgets_values": [ - 24, - "fixed" - ] - } - ], - "links": [ - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 28, - 19, - 0, - 6, - 0, - "CLIP" - ], - [ - 29, - 19, - 0, - 7, - 0, - "CLIP" - ], - [ - 116, - 16, - 1, - 19, - 0, - "CLIP" - ], - [ - 117, - 16, - 2, - 56, - 0, - "*" - ], - [ - 120, - 57, - 0, - 3, - 0, - "MODEL" - ], - [ - 124, - 56, - 0, - 59, - 0, - "*" - ], - [ - 134, - 16, - 0, - 65, - 0, - "*" - ], - [ - 135, - 65, - 0, - 57, - 0, - "*" - ], - [ - 138, - 3, - 0, - 66, - 0, - "LATENT" - ], - [ - 139, - 59, - 0, - 66, - 1, - "VAE" - ], - [ - 141, - 68, - 0, - 69, - 0, - "STRING" - ], - [ - 145, - 69, - 0, - 6, - 1, - "STRING" - ], - [ - 149, - 19, - 0, - 70, - 0, - "CLIP" - ], - [ - 150, - 68, - 0, - 70, - 1, - "STRING" - ], - [ - 151, - 6, - 0, - 72, - 0, - "CONDITIONING" - ], - [ - 152, - 70, - 0, - 72, - 1, - "CONDITIONING" - ], - [ - 153, - 72, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 154, - 73, - 1, - 72, - 2, - "FLOAT" - ], - [ - 161, - 66, - 0, - 78, - 0, - "IMAGE" - ], - [ - 163, - 80, - 0, - 7, - 1, - "STRING" - ], - [ - 166, - 81, - 0, - 77, - 0, - "IMAGE" - ], - [ - 167, - 81, - 0, - 79, - 0, - "IMAGE" - ], - [ - 168, - 73, - 3, - 81, - 2, - "BOOL" - ], - [ - 170, - 82, - 0, - 73, - 0, - "INT" - ], - [ - 171, - 82, - 0, - 81, - 1, - "INT" - ] - ], - "groups": [ - { - "title": "Txt2Img", - "bounding": [ - -2061, - -234, - 1932, - 973 - ], - "color": "#a1309b", - "locked": false - }, - { - "title": "Save Intermediate Image", - "bounding": [ - 150, - -116, - 303, - 213 - ], - "color": "#3f789e", - "locked": false - } - ], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"last_node_id":82,"last_link_id":171,"nodes":[{"id":59,"type":"Reroute","pos":[-150.35178124999982,644.4360633544919],"size":[75,26],"flags":{},"order":13,"mode":0,"inputs":[{"name":"","type":"*","link":124}],"outputs":[{"name":"","type":"VAE","links":[139],"slot_index":0}],"properties":{"showOutputText":false,"horizontal":false}},{"id":56,"type":"Reroute","pos":[-1580.8297949218763,644.7740239257807],"size":[75,26],"flags":{},"order":7,"mode":0,"inputs":[{"name":"","type":"*","link":117}],"outputs":[{"name":"","type":"VAE","links":[124]}],"properties":{"showOutputText":false,"horizontal":false}},{"id":57,"type":"Reroute","pos":[-673.8297949218747,-185.22597607421872],"size":[75,26],"flags":{},"order":10,"mode":0,"inputs":[{"name":"","type":"*","link":135}],"outputs":[{"name":"","type":"MODEL","links":[120],"slot_index":0}],"properties":{"showOutputText":false,"horizontal":false}},{"id":65,"type":"Reroute","pos":[-1512.8297949218763,-181.22597607421872],"size":[75,26],"flags":{},"order":5,"mode":0,"inputs":[{"name":"","type":"*","link":134}],"outputs":[{"name":"","type":"MODEL","links":[135]}],"properties":{"showOutputText":false,"horizontal":false}},{"id":16,"type":"CheckpointLoaderSimple","pos":[-2000.8297949218756,192.77402392578128],"size":[315,98],"flags":{},"order":0,"mode":0,"outputs":[{"name":"MODEL","type":"MODEL","links":[134],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[116],"slot_index":1},{"name":"VAE","type":"VAE","links":[117],"slot_index":2}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["revAnimated_v122.safetensors"]},{"id":19,"type":"CLIPSetLastLayer","pos":[-1597,209],"size":[315,58],"flags":{},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":116}],"outputs":[{"name":"CLIP","type":"CLIP","links":[28,29,149],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"CLIPSetLastLayer"},"widgets_values":[-2]},{"id":7,"type":"CLIPTextEncode","pos":[-839,335],"size":[210,54],"flags":{},"order":11,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":29},{"name":"text","type":"STRING","link":163,"widget":{"name":"text","config":["STRING",{"multiline":true}]},"slot_index":1}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["worst quality, hands, embedding:EasyNegative,"]},{"id":5,"type":"EmptyLatentImage","pos":[-969,484],"size":[315,106],"flags":{},"order":1,"mode":0,"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[768,512,1]},{"id":80,"type":"Text box","pos":[-1397,356],"size":[294,93.11674499511719],"flags":{},"order":2,"mode":0,"outputs":[{"name":"STRING","type":"STRING","links":[163],"shape":3,"slot_index":0}],"title":"❌Mel Negatives (general) (Negative)","properties":{"Node name for S&R":"Text box"},"widgets_values":["embedding:EasyNegative, embedding:EasyNegativeV2, watermark, text, deformed"]},{"id":72,"type":"ConditioningAverage ","pos":[-960,2],"size":[380.4000244140625,78],"flags":{},"order":16,"mode":0,"inputs":[{"name":"conditioning_to","type":"CONDITIONING","link":151},{"name":"conditioning_from","type":"CONDITIONING","link":152,"slot_index":1},{"name":"conditioning_to_strength","type":"FLOAT","link":154,"widget":{"name":"conditioning_to_strength","config":["FLOAT",{"default":1,"min":0,"max":1,"step":0.01}]},"slot_index":2}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[153],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"ConditioningAverage "},"widgets_values":[1]},{"id":6,"type":"CLIPTextEncode","pos":[-1261,-46],"size":[210,54],"flags":{},"order":14,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":28},{"name":"text","type":"STRING","link":145,"widget":{"name":"text","config":["STRING",{"multiline":true}]},"slot_index":1}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[151],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["A majestic Lion, fur in the wind, (smirk smile)"]},{"id":70,"type":"CLIPTextEncode","pos":[-1245,87],"size":[210,54],"flags":{},"order":12,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":149,"slot_index":0},{"name":"text","type":"STRING","link":150,"widget":{"name":"text","config":["STRING",{"multiline":true}]},"slot_index":1}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[152],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["A majestic Lion, fur in the wind, (smirk smile)"]},{"id":69,"type":"String Replace (mtb)","pos":[-1560,-70],"size":[210,82],"flags":{},"order":8,"mode":0,"inputs":[{"name":"string","type":"STRING","link":141}],"outputs":[{"name":"STRING","type":"STRING","links":[145],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"String Replace (mtb)"},"widgets_values":["blue","yellow"],"color":"#432","bgcolor":"#653"},{"id":68,"type":"Text box","pos":[-1950,10],"size":[217.2119140625,122.18632507324219],"flags":{},"order":3,"mode":0,"outputs":[{"name":"STRING","type":"STRING","links":[141,150],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"Text box"},"widgets_values":["A cinematic shot of a blue car, high speed, smoke whisps in the air, (at night), blue neon lighting"],"color":"#432","bgcolor":"#653"},{"id":3,"type":"KSampler","pos":[-483,-21],"size":[315,474],"flags":{},"order":19,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":120},{"name":"positive","type":"CONDITIONING","link":153},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[138],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[5428233522,"fixed",45,8,"euler_ancestral","simple",1]},{"id":66,"type":"VAEDecodeTiled","pos":[197,-20],"size":[210,46],"flags":{"collapsed":false},"order":20,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":138},{"name":"vae","type":"VAE","link":139,"slot_index":1}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[161],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"VAEDecodeTiled"}},{"id":78,"type":"SaveImage","pos":[565,-18],"size":[315,270],"flags":{},"order":21,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":161}],"properties":{},"widgets_values":["mtb_demo-conditional_blend"]},{"id":81,"type":"Get Batch From History (mtb)","pos":[-625,848],"size":[235.1999969482422,118],"flags":{},"order":15,"mode":0,"inputs":[{"name":"passthrough_image","type":"IMAGE","link":null},{"name":"count","type":"INT","link":171,"widget":{"name":"count","config":["INT",{"default":1,"min":0}]},"slot_index":2},{"name":"enable","type":"BOOLEAN","link":168,"widget":{"name":"enable","config":["BOOLEAN",{"default":true}]},"slot_index":2}],"outputs":[{"name":"i","type":"IMAGE","links":[166,167],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"Get Batch From History (mtb)"},"widgets_values":[true,24,0]},{"id":77,"type":"Export To Prores (mtb)","pos":[-111,849],"size":[315,82],"flags":{},"order":17,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":166,"slot_index":0}],"outputs":[{"name":"VIDEO","type":"VIDEO","links":null,"shape":3}],"properties":{"Node name for S&R":"Export To Prores (mtb)"},"widgets_values":[12,"export"]},{"id":79,"type":"Save Gif (mtb)","pos":[-104,1000],"size":[210,356],"flags":{},"order":18,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":167},{"name":"pingpong","type":"BOOLEAN","link":null}],"properties":{"Node name for S&R":"Save Gif (mtb)"},"widgets_values":[12,1,true,"/view?filename=03031ebda0.gif&subfolder=&type=output"]},{"id":73,"type":"Animation Builder (mtb)","pos":[-1285,831],"size":[211.60000610351562,294],"flags":{},"order":9,"mode":0,"inputs":[{"name":"total_frames","type":"INT","link":170,"widget":{"name":"total_frames","config":["INT",{"default":100,"min":0}]},"slot_index":0}],"outputs":[{"name":"frame","type":"INT","links":null,"shape":3,"slot_index":0},{"name":"0-1 (scaled)","type":"FLOAT","links":[154],"shape":3,"slot_index":1},{"name":"count","type":"INT","links":null,"shape":3},{"name":"loop_ended","type":"BOOLEAN","links":[168],"shape":3,"slot_index":3}],"properties":{"Node name for S&R":"Animation Builder (mtb)"},"widgets_values":[24,1,1,0,0,"Idle","Iteration: Idle","reset","queue"],"color":"#232","bgcolor":"#353","shape":1},{"id":82,"type":"PrimitiveNode","pos":[-1663,1205],"size":[210,82],"flags":{},"order":4,"mode":0,"outputs":[{"name":"INT","type":"INT","links":[170,171],"widget":{"name":"total_frames","config":["INT",{"default":100,"min":0}]},"slot_index":0}],"title":"total_frames","properties":{},"widgets_values":[24,"fixed"]}],"links":[[2,5,0,3,3,"LATENT"],[6,7,0,3,2,"CONDITIONING"],[28,19,0,6,0,"CLIP"],[29,19,0,7,0,"CLIP"],[116,16,1,19,0,"CLIP"],[117,16,2,56,0,"*"],[120,57,0,3,0,"MODEL"],[124,56,0,59,0,"*"],[134,16,0,65,0,"*"],[135,65,0,57,0,"*"],[138,3,0,66,0,"LATENT"],[139,59,0,66,1,"VAE"],[141,68,0,69,0,"STRING"],[145,69,0,6,1,"STRING"],[149,19,0,70,0,"CLIP"],[150,68,0,70,1,"STRING"],[151,6,0,72,0,"CONDITIONING"],[152,70,0,72,1,"CONDITIONING"],[153,72,0,3,1,"CONDITIONING"],[154,73,1,72,2,"FLOAT"],[161,66,0,78,0,"IMAGE"],[163,80,0,7,1,"STRING"],[166,81,0,77,0,"IMAGE"],[167,81,0,79,0,"IMAGE"],[168,73,3,81,2,"BOOLEAN"],[170,82,0,73,0,"INT"],[171,82,0,81,1,"INT"]],"groups":[{"title":"Txt2Img","bounding":[-2061,-234,1932,973],"color":"#a1309b","locked":false},{"title":"Save Intermediate Image","bounding":[150,-116,303,213],"color":"#3f789e","locked":false}],"config":{},"extra":{},"version":0.4} \ No newline at end of file diff --git a/examples/04-animation_builder-deforum.json b/examples/04-animation_builder-deforum.json index 99d3d0b..bd1ba9b 100644 --- a/examples/04-animation_builder-deforum.json +++ b/examples/04-animation_builder-deforum.json @@ -1,1189 +1 @@ -{ - "last_node_id": 42, - "last_link_id": 69, - "nodes": [ - { - "id": 11, - "type": "Get Batch From History (mtb)", - "pos": [ - -828, - 522 - ], - "size": [ - 235.1999969482422, - 118 - ], - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "name": "passthrough_image", - "type": "IMAGE", - "link": 10 - }, - { - "name": "enable", - "type": "BOOL", - "link": 9, - "widget": { - "name": "enable", - "config": [ - "BOOL", - { - "default": true - } - ] - }, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "i", - "type": "IMAGE", - "links": [ - 26 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Get Batch From History (mtb)" - }, - "widgets_values": [ - false, - 1, - 0 - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 24, - "type": "Note", - "pos": [ - -827, - 406 - ], - "size": [ - 233.25148010253906, - 82.53218841552734 - ], - "flags": {}, - "order": 0, - "mode": 0, - "properties": { - "text": "" - }, - "widgets_values": [ - "On first frame we get the init image, on all subsequent ones the feedback from the previous queue item" - ], - "color": "#223", - "bgcolor": "#335", - "shape": 1 - }, - { - "id": 12, - "type": "Int To Bool (mtb)", - "pos": [ - -1057, - 583 - ], - "size": [ - 210, - 36.366058349609375 - ], - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "int", - "type": "INT", - "link": 34, - "widget": { - "name": "int", - "config": [ - "INT", - { - "default": 0 - } - ] - }, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "BOOL", - "type": "BOOL", - "links": [ - 9 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Int To Bool (mtb)" - }, - "widgets_values": [ - 29 - ], - "color": "#222", - "bgcolor": "#000" - }, - { - "id": 10, - "type": "LoadImage", - "pos": [ - -1409, - 524 - ], - "size": [ - 315, - 314 - ], - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 10 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "example.png", - "image" - ], - "color": "#432", - "bgcolor": "#653", - "shape": 1 - }, - { - "id": 18, - "type": "Get Batch From History (mtb)", - "pos": [ - -960, - 1257 - ], - "size": [ - 235.1999969482422, - 118 - ], - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "passthrough_image", - "type": "IMAGE", - "link": null - }, - { - "name": "enable", - "type": "BOOL", - "link": 31, - "widget": { - "name": "enable", - "config": [ - "BOOL", - { - "default": true - } - ] - }, - "slot_index": 1 - }, - { - "name": "count", - "type": "INT", - "link": 44, - "widget": { - "name": "count", - "config": [ - "INT", - { - "default": 1, - "min": 0 - } - ] - } - } - ], - "outputs": [ - { - "name": "i", - "type": "IMAGE", - "links": [ - 17, - 18 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Get Batch From History (mtb)" - }, - "widgets_values": [ - true, - 30, - 0 - ] - }, - { - "id": 20, - "type": "Export To Prores (mtb)", - "pos": [ - -612, - 1818 - ], - "size": [ - 292.4239807128906, - 93.884033203125 - ], - "flags": {}, - "order": 13, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 17 - } - ], - "outputs": [ - { - "name": "VIDEO", - "type": "VIDEO", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "Export To Prores (mtb)" - }, - "widgets_values": [ - 12, - "export" - ] - }, - { - "id": 35, - "type": "CLIPTextEncode", - "pos": [ - -118, - 331 - ], - "size": [ - 210, - 54 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 60 - }, - { - "name": "text", - "type": "STRING", - "link": 66, - "widget": { - "name": "text", - "config": [ - "STRING", - { - "multiline": true - } - ] - } - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 54 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "" - ] - }, - { - "id": 9, - "type": "CheckpointLoaderSimple", - "pos": [ - -558, - 114 - ], - "size": [ - 301.2330322265625, - 98 - ], - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 62 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 59, - 60 - ], - "shape": 3, - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 58, - 69 - ], - "shape": 3, - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "revAnimated_v122.safetensors" - ] - }, - { - "id": 37, - "type": "VAEEncode", - "pos": [ - -125, - 236 - ], - "size": [ - 210, - 46 - ], - "flags": {}, - "order": 16, - "mode": 0, - "inputs": [ - { - "name": "pixels", - "type": "IMAGE", - "link": 57 - }, - { - "name": "vae", - "type": "VAE", - "link": 58, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 55 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEEncode" - } - }, - { - "id": 34, - "type": "CLIPTextEncode", - "pos": [ - -124, - 84 - ], - "size": [ - 210, - 96 - ], - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 59 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 53 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "A plastic Barbie doll with a pink dress sleeping, draping, wrinkles, shiny" - ] - }, - { - "id": 33, - "type": "Text box", - "pos": [ - -497, - 349 - ], - "size": [ - 294, - 95.1284408569336 - ], - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 66 - ], - "shape": 3, - "slot_index": 0 - } - ], - "title": "❌Mel Negatives (general) (Negative)", - "properties": { - "Node name for S&R": "Text box" - }, - "widgets_values": [ - "embedding:EasyNegative, embedding:EasyNegativeV2, watermark, text, deformed, NSFW, Cleavage, Pubic Hair, Nudity, Naked, censored" - ] - }, - { - "id": 39, - "type": "Reroute", - "pos": [ - -156, - 908 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 67 - } - ], - "outputs": [ - { - "name": "", - "type": "INT", - "links": [ - 68 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 14, - "type": "Transform Image (mtb)", - "pos": [ - -527, - 520 - ], - "size": [ - 315, - 178 - ], - "flags": {}, - "order": 15, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 26 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 57 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Transform Image (mtb)" - }, - "widgets_values": [ - 0, - 5, - 1.03, - 1, - 0, - "reflect" - ], - "color": "#223", - "bgcolor": "#335" - }, - { - "id": 36, - "type": "KSampler", - "pos": [ - 223, - 262 - ], - "size": [ - 315, - 442 - ], - "flags": {}, - "order": 17, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 62, - "slot_index": 0 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 53 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 54 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 55 - }, - { - "name": "denoise", - "type": "FLOAT", - "link": 63, - "widget": { - "name": "denoise", - "config": [ - "FLOAT", - { - "default": 1, - "min": 0, - "max": 1, - "step": 0.01 - } - ] - }, - "slot_index": 4 - }, - { - "name": "seed", - "type": "INT", - "link": 68, - "widget": { - "name": "seed", - "config": [ - "INT", - { - "default": 0, - "min": 0, - "max": 18446744073709552000 - } - ] - } - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 56 - ], - "shape": 3, - "slot_index": 0, - "color": "#FF9CF9" - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 61876307854624, - "randomize", - 15, - 8, - "euler_ancestral", - "normal", - 0.6 - ] - }, - { - "id": 15, - "type": "SaveImage", - "pos": [ - 782, - 259 - ], - "size": [ - 330.1112365722656, - 378.1239929199219 - ], - "flags": {}, - "order": 19, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 65 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 19, - "type": "Save Gif (mtb)", - "pos": [ - -613, - 1256 - ], - "size": [ - 356.1775817871094, - 471.8785705566406 - ], - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 18 - } - ], - "properties": { - "Node name for S&R": "Save Gif (mtb)" - }, - "widgets_values": [ - 12, - 1, - true - ] - }, - { - "id": 31, - "type": "PrimitiveNode", - "pos": [ - -2060, - 1291 - ], - "size": [ - 210, - 82 - ], - "flags": {}, - "order": 4, - "mode": 0, - "outputs": [ - { - "name": "INT", - "type": "INT", - "links": [ - 43, - 44 - ], - "widget": { - "name": "total_frames", - "config": [ - "INT", - { - "default": 100, - "min": 0 - } - ] - }, - "slot_index": 0 - } - ], - "title": "total_frames", - "properties": {}, - "widgets_values": [ - 30, - "fixed" - ], - "color": "#432", - "bgcolor": "#653" - }, - { - "id": 38, - "type": "VAEDecode", - "pos": [ - 556, - 260 - ], - "size": [ - 210, - 46 - ], - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 56 - }, - { - "name": "vae", - "type": "VAE", - "link": 69, - "slot_index": 1 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 65 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 22, - "type": "Fit Number (mtb)", - "pos": [ - -647, - 882 - ], - "size": [ - 232.28509521484375, - 166 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "value", - "type": "FLOAT", - "link": 27 - } - ], - "outputs": [ - { - "name": "FLOAT", - "type": "FLOAT", - "links": [ - 63 - ], - "shape": 3, - "slot_index": 0 - } - ], - "title": "Fit Number (mtb) - Denoise", - "properties": { - "Node name for S&R": "Fit Number (mtb)" - }, - "widgets_values": [ - true, - 0, - 1, - 0.3, - 0.6 - ] - }, - { - "id": 17, - "type": "Animation Builder (mtb)", - "pos": [ - -1310, - 883 - ], - "size": [ - 211.60000610351562, - 318 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "total_frames", - "type": "INT", - "link": 43, - "widget": { - "name": "total_frames", - "config": [ - "INT", - { - "default": 100, - "min": 0 - } - ] - }, - "slot_index": 0 - } - ], - "outputs": [ - { - "name": "frame", - "type": "INT", - "links": [ - 34 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "0-1 (scaled)", - "type": "FLOAT", - "links": [ - 27 - ], - "shape": 3, - "slot_index": 1 - }, - { - "name": "count", - "type": "INT", - "links": [ - 67 - ], - "shape": 3, - "slot_index": 2 - }, - { - "name": "loop_ended", - "type": "BOOL", - "links": [ - 31 - ], - "shape": 3, - "slot_index": 3 - } - ], - "properties": { - "Node name for S&R": "Animation Builder (mtb)" - }, - "widgets_values": [ - 30, - 1, - 1, - 0, - 0, - "Idle", - "Iteration: Idle", - "reset", - "queue" - ], - "color": "#232", - "bgcolor": "#353", - "shape": 1 - } - ], - "links": [ - [ - 9, - 12, - 0, - 11, - 1, - "BOOL" - ], - [ - 10, - 10, - 0, - 11, - 0, - "IMAGE" - ], - [ - 17, - 18, - 0, - 20, - 0, - "IMAGE" - ], - [ - 18, - 18, - 0, - 19, - 0, - "IMAGE" - ], - [ - 26, - 11, - 0, - 14, - 0, - "IMAGE" - ], - [ - 27, - 17, - 1, - 22, - 0, - "FLOAT" - ], - [ - 31, - 17, - 3, - 18, - 1, - "BOOL" - ], - [ - 34, - 17, - 0, - 12, - 0, - "INT" - ], - [ - 43, - 31, - 0, - 17, - 0, - "INT" - ], - [ - 44, - 31, - 0, - 18, - 2, - "INT" - ], - [ - 53, - 34, - 0, - 36, - 1, - "CONDITIONING" - ], - [ - 54, - 35, - 0, - 36, - 2, - "CONDITIONING" - ], - [ - 55, - 37, - 0, - 36, - 3, - "LATENT" - ], - [ - 56, - 36, - 0, - 38, - 0, - "LATENT" - ], - [ - 57, - 14, - 0, - 37, - 0, - "IMAGE" - ], - [ - 58, - 9, - 2, - 37, - 1, - "VAE" - ], - [ - 59, - 9, - 1, - 34, - 0, - "CLIP" - ], - [ - 60, - 9, - 1, - 35, - 0, - "CLIP" - ], - [ - 62, - 9, - 0, - 36, - 0, - "MODEL" - ], - [ - 63, - 22, - 0, - 36, - 4, - "FLOAT" - ], - [ - 65, - 38, - 0, - 15, - 0, - "IMAGE" - ], - [ - 66, - 33, - 0, - 35, - 1, - "STRING" - ], - [ - 67, - 17, - 2, - 39, - 0, - "*" - ], - [ - 68, - 39, - 0, - 36, - 5, - "INT" - ], - [ - 69, - 9, - 2, - 38, - 1, - "VAE" - ] - ], - "groups": [ - { - "title": "Video Output", - "bounding": [ - -702, - 1161, - 516, - 773 - ], - "color": "#3f789e", - "locked": false - }, - { - "title": "START THE QUEUE BY CLICKLING HERE 👆", - "bounding": [ - -1612, - 1219, - 521, - 80 - ], - "color": "#8A8", - "locked": false - } - ], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"last_node_id":42,"last_link_id":69,"nodes":[{"id":11,"type":"Get Batch From History (mtb)","pos":[-828,522],"size":[235.1999969482422,118],"flags":{},"order":12,"mode":0,"inputs":[{"name":"passthrough_image","type":"IMAGE","link":10},{"name":"enable","type":"BOOLEAN","link":9,"widget":{"name":"enable","config":["BOOLEAN",{"default":true}]},"slot_index":1}],"outputs":[{"name":"i","type":"IMAGE","links":[26],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"Get Batch From History (mtb)"},"widgets_values":[false,1,0],"color":"#223","bgcolor":"#335"},{"id":24,"type":"Note","pos":[-827,406],"size":[233.25148010253906,82.53218841552734],"flags":{},"order":0,"mode":0,"properties":{"text":""},"widgets_values":["On first frame we get the init image, on all subsequent ones the feedback from the previous queue item"],"color":"#223","bgcolor":"#335","shape":1},{"id":12,"type":"Int To Bool (mtb)","pos":[-1057,583],"size":[210,36.366058349609375],"flags":{},"order":8,"mode":0,"inputs":[{"name":"int","type":"INT","link":34,"widget":{"name":"int","config":["INT",{"default":0}]},"slot_index":0}],"outputs":[{"name":"BOOLEAN","type":"BOOLEAN","links":[9],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"Int To Bool (mtb)"},"widgets_values":[29],"color":"#222","bgcolor":"#000"},{"id":10,"type":"LoadImage","pos":[-1409,524],"size":[315,314],"flags":{},"order":1,"mode":0,"outputs":[{"name":"IMAGE","type":"IMAGE","links":[10],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["example.png","image"],"color":"#432","bgcolor":"#653","shape":1},{"id":18,"type":"Get Batch From History (mtb)","pos":[-960,1257],"size":[235.1999969482422,118],"flags":{},"order":11,"mode":0,"inputs":[{"name":"passthrough_image","type":"IMAGE","link":null},{"name":"enable","type":"BOOLEAN","link":31,"widget":{"name":"enable","config":["BOOLEAN",{"default":true}]},"slot_index":1},{"name":"count","type":"INT","link":44,"widget":{"name":"count","config":["INT",{"default":1,"min":0}]}}],"outputs":[{"name":"i","type":"IMAGE","links":[17,18],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"Get Batch From History (mtb)"},"widgets_values":[true,30,0]},{"id":20,"type":"Export To Prores (mtb)","pos":[-612,1818],"size":[292.4239807128906,93.884033203125],"flags":{},"order":13,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":17}],"outputs":[{"name":"VIDEO","type":"VIDEO","links":null,"shape":3}],"properties":{"Node name for S&R":"Export To Prores (mtb)"},"widgets_values":[12,"export"]},{"id":35,"type":"CLIPTextEncode","pos":[-118,331],"size":[210,54],"flags":{},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":60},{"name":"text","type":"STRING","link":66,"widget":{"name":"text","config":["STRING",{"multiline":true}]}}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[54],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""]},{"id":9,"type":"CheckpointLoaderSimple","pos":[-558,114],"size":[301.2330322265625,98],"flags":{},"order":2,"mode":0,"outputs":[{"name":"MODEL","type":"MODEL","links":[62],"shape":3,"slot_index":0},{"name":"CLIP","type":"CLIP","links":[59,60],"shape":3,"slot_index":1},{"name":"VAE","type":"VAE","links":[58,69],"shape":3,"slot_index":2}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["revAnimated_v122.safetensors"]},{"id":37,"type":"VAEEncode","pos":[-125,236],"size":[210,46],"flags":{},"order":16,"mode":0,"inputs":[{"name":"pixels","type":"IMAGE","link":57},{"name":"vae","type":"VAE","link":58,"slot_index":1}],"outputs":[{"name":"LATENT","type":"LATENT","links":[55],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"VAEEncode"}},{"id":34,"type":"CLIPTextEncode","pos":[-124,84],"size":[210,96],"flags":{},"order":5,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":59}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[53],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["A plastic Barbie doll with a pink dress sleeping, draping, wrinkles, shiny"]},{"id":33,"type":"Text box","pos":[-497,349],"size":[294,95.1284408569336],"flags":{},"order":3,"mode":0,"outputs":[{"name":"STRING","type":"STRING","links":[66],"shape":3,"slot_index":0}],"title":"❌Mel Negatives (general) (Negative)","properties":{"Node name for S&R":"Text box"},"widgets_values":["embedding:EasyNegative, embedding:EasyNegativeV2, watermark, text, deformed, NSFW, Cleavage, Pubic Hair, Nudity, Naked, censored"]},{"id":39,"type":"Reroute","pos":[-156,908],"size":[75,26],"flags":{},"order":10,"mode":0,"inputs":[{"name":"","type":"*","link":67}],"outputs":[{"name":"","type":"INT","links":[68]}],"properties":{"showOutputText":false,"horizontal":false}},{"id":14,"type":"Transform Image (mtb)","pos":[-527,520],"size":[315,178],"flags":{},"order":15,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":26}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[57],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"Transform Image (mtb)"},"widgets_values":[0,5,1.03,1,0,"reflect"],"color":"#223","bgcolor":"#335"},{"id":36,"type":"KSampler","pos":[223,262],"size":[315,442],"flags":{},"order":17,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":62,"slot_index":0},{"name":"positive","type":"CONDITIONING","link":53},{"name":"negative","type":"CONDITIONING","link":54},{"name":"latent_image","type":"LATENT","link":55},{"name":"denoise","type":"FLOAT","link":63,"widget":{"name":"denoise","config":["FLOAT",{"default":1,"min":0,"max":1,"step":0.01}]},"slot_index":4},{"name":"seed","type":"INT","link":68,"widget":{"name":"seed","config":["INT",{"default":0,"min":0,"max":18446744073709552000}]}}],"outputs":[{"name":"LATENT","type":"LATENT","links":[56],"shape":3,"slot_index":0,"color":"#FF9CF9"}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[61876307854624,"randomize",15,8,"euler_ancestral","normal",0.6]},{"id":15,"type":"SaveImage","pos":[782,259],"size":[330.1112365722656,378.1239929199219],"flags":{},"order":19,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":65}],"properties":{},"widgets_values":["ComfyUI"]},{"id":19,"type":"Save Gif (mtb)","pos":[-613,1256],"size":[356.1775817871094,471.8785705566406],"flags":{},"order":14,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":18}],"properties":{"Node name for S&R":"Save Gif (mtb)"},"widgets_values":[12,1,true]},{"id":31,"type":"PrimitiveNode","pos":[-2060,1291],"size":[210,82],"flags":{},"order":4,"mode":0,"outputs":[{"name":"INT","type":"INT","links":[43,44],"widget":{"name":"total_frames","config":["INT",{"default":100,"min":0}]},"slot_index":0}],"title":"total_frames","properties":{},"widgets_values":[30,"fixed"],"color":"#432","bgcolor":"#653"},{"id":38,"type":"VAEDecode","pos":[556,260],"size":[210,46],"flags":{},"order":18,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":56},{"name":"vae","type":"VAE","link":69,"slot_index":1}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[65],"shape":3,"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"}},{"id":22,"type":"Fit Number (mtb)","pos":[-647,882],"size":[232.28509521484375,166],"flags":{},"order":9,"mode":0,"inputs":[{"name":"value","type":"FLOAT","link":27}],"outputs":[{"name":"FLOAT","type":"FLOAT","links":[63],"shape":3,"slot_index":0}],"title":"Fit Number (mtb) - Denoise","properties":{"Node name for S&R":"Fit Number (mtb)"},"widgets_values":[true,0,1,0.3,0.6]},{"id":17,"type":"Animation Builder (mtb)","pos":[-1310,883],"size":[211.60000610351562,318],"flags":{},"order":7,"mode":0,"inputs":[{"name":"total_frames","type":"INT","link":43,"widget":{"name":"total_frames","config":["INT",{"default":100,"min":0}]},"slot_index":0}],"outputs":[{"name":"frame","type":"INT","links":[34],"shape":3,"slot_index":0},{"name":"0-1 (scaled)","type":"FLOAT","links":[27],"shape":3,"slot_index":1},{"name":"count","type":"INT","links":[67],"shape":3,"slot_index":2},{"name":"loop_ended","type":"BOOLEAN","links":[31],"shape":3,"slot_index":3}],"properties":{"Node name for S&R":"Animation Builder (mtb)"},"widgets_values":[30,1,1,0,0,"Idle","Iteration: Idle","reset","queue"],"color":"#232","bgcolor":"#353","shape":1}],"links":[[9,12,0,11,1,"BOOLEAN"],[10,10,0,11,0,"IMAGE"],[17,18,0,20,0,"IMAGE"],[18,18,0,19,0,"IMAGE"],[26,11,0,14,0,"IMAGE"],[27,17,1,22,0,"FLOAT"],[31,17,3,18,1,"BOOLEAN"],[34,17,0,12,0,"INT"],[43,31,0,17,0,"INT"],[44,31,0,18,2,"INT"],[53,34,0,36,1,"CONDITIONING"],[54,35,0,36,2,"CONDITIONING"],[55,37,0,36,3,"LATENT"],[56,36,0,38,0,"LATENT"],[57,14,0,37,0,"IMAGE"],[58,9,2,37,1,"VAE"],[59,9,1,34,0,"CLIP"],[60,9,1,35,0,"CLIP"],[62,9,0,36,0,"MODEL"],[63,22,0,36,4,"FLOAT"],[65,38,0,15,0,"IMAGE"],[66,33,0,35,1,"STRING"],[67,17,2,39,0,"*"],[68,39,0,36,5,"INT"],[69,9,2,38,1,"VAE"]],"groups":[{"title":"Video Output","bounding":[-702,1161,516,773],"color":"#3f789e","locked":false},{"title":"START THE QUEUE BY CLICKLING HERE 👆","bounding":[-1612,1219,521,80],"color":"#8A8","locked":false}],"config":{},"extra":{},"version":0.4} \ No newline at end of file diff --git a/nodes/animation.py b/nodes/animation.py index da22df1..9822685 100644 --- a/nodes/animation.py +++ b/nodes/animation.py @@ -17,7 +17,7 @@ class AnimationBuilder: }, } - RETURN_TYPES = ("INT", "FLOAT", "INT", "BOOL") + RETURN_TYPES = ("INT", "FLOAT", "INT", "BOOLEAN") RETURN_NAMES = ("frame", "0-1 (scaled)", "count", "loop_ended") CATEGORY = "mtb/animation" FUNCTION = "build_animation" diff --git a/nodes/deep_bump.py b/nodes/deep_bump.py index 1444d35..47a4d26 100644 --- a/nodes/deep_bump.py +++ b/nodes/deep_bump.py @@ -261,7 +261,7 @@ class DeepBump: "LARGEST", ], ), - "normals_to_height_seamless": ("BOOL", {"default": False}), + "normals_to_height_seamless": ("BOOLEAN", {"default": False}), }, } diff --git a/nodes/faceenhance.py b/nodes/faceenhance.py index 4dafd39..0155514 100644 --- a/nodes/faceenhance.py +++ b/nodes/faceenhance.py @@ -143,12 +143,12 @@ class RestoreFace: "image": ("IMAGE",), "model": ("FACEENHANCE_MODEL",), # Input are aligned faces - "aligned": ("BOOL", {"default": False}), + "aligned": ("BOOLEAN", {"default": False}), # Only restore the center face - "only_center_face": ("BOOL", {"default": False}), + "only_center_face": ("BOOLEAN", {"default": False}), # Adjustable weights "weight": ("FLOAT", {"default": 0.5}), - "save_tmp_steps": ("BOOL", {"default": True}), + "save_tmp_steps": ("BOOLEAN", {"default": True}), } } diff --git a/nodes/faceswap.py b/nodes/faceswap.py index 4f0eba9..83074d7 100644 --- a/nodes/faceswap.py +++ b/nodes/faceswap.py @@ -2,14 +2,13 @@ import onnxruntime from pathlib import Path from PIL import Image -from typing import List, Set, Tuple, Union, Optional +from typing import List, Set, Union, Optional import cv2 import folder_paths import glob import insightface import numpy as np import os -import tempfile import torch from insightface.model_zoo.inswapper import INSwapper from ..utils import pil2tensor, tensor2pil @@ -120,7 +119,6 @@ class FaceSwap: "faces_index": ("STRING", {"default": "0"}), "faceanalysis_model": ("FACE_ANALYSIS_MODEL", {"default": "None"}), "faceswap_model": ("FACESWAP_MODEL", {"default": "None"}), - "debug": ("BOOL", {"default": False}), }, "optional": {}, } @@ -136,7 +134,6 @@ class FaceSwap: faces_index: str, faceanalysis_model, faceswap_model, - debug=False, ): def do_swap(img): model_management.throw_exception_if_processing_interrupted() diff --git a/nodes/fun.py b/nodes/fun.py index d12af8f..332e11a 100644 --- a/nodes/fun.py +++ b/nodes/fun.py @@ -121,7 +121,7 @@ class QrCode: "error_correct": (("L", "M", "Q", "H"), {"default": "L"}), "box_size": ("INT", {"default": 10, "max": 8096, "min": 0, "step": 1}), "border": ("INT", {"default": 4, "max": 8096, "min": 0, "step": 1}), - "invert": (("BOOL",), {"default": False}), + "invert": (("BOOLEAN",), {"default": False}), } } diff --git a/nodes/graph_utils.py b/nodes/graph_utils.py index e191fbc..0288a99 100644 --- a/nodes/graph_utils.py +++ b/nodes/graph_utils.py @@ -38,7 +38,7 @@ class FitNumber: return { "required": { "value": ("FLOAT", {"default": 0, "forceInput": True}), - "clamp": ("BOOL", {"default": False}), + "clamp": ("BOOLEAN", {"default": False}), "source_min": ("FLOAT", {"default": 0.0}), "source_max": ("FLOAT", {"default": 1.0}), "target_min": ("FLOAT", {"default": 0.0}), diff --git a/nodes/image_interpolation.py b/nodes/image_interpolation.py index 2fcb3f7..b8e71ef 100644 --- a/nodes/image_interpolation.py +++ b/nodes/image_interpolation.py @@ -6,9 +6,9 @@ import folder_paths from ..log import log import torch from frame_interpolation.eval import util, interpolator -from ..utils import tensor2np import numpy as np import comfy +import comfy.utils from PIL import Image import urllib.request import urllib.parse @@ -39,7 +39,7 @@ class GetBatchFromHistory: def INPUT_TYPES(cls): return { "required": { - "enable": ("BOOL", {"default": True}), + "enable": ("BOOLEAN", {"default": True}), "count": ("INT", {"default": 1, "min": 0}), "offset": ("INT", {"default": 0, "min": -1e9, "max": 1e9}), }, diff --git a/nodes/image_processing.py b/nodes/image_processing.py index 04f04e1..de43c9a 100644 --- a/nodes/image_processing.py +++ b/nodes/image_processing.py @@ -377,7 +377,7 @@ class ImagePremultiply: "required": { "image": ("IMAGE",), "mask": ("MASK",), - "invert": ("BOOL", {"default": False}), + "invert": ("BOOLEAN", {"default": False}), } } @@ -425,7 +425,7 @@ class ImageResizeFactor: "FLOAT", {"default": 2, "min": 0.01, "max": 16.0, "step": 0.01}, ), - "supersample": ("BOOL", {"default": True}), + "supersample": ("BOOLEAN", {"default": True}), "resampling": ( ["lanczos", "nearest", "bilinear", "bicubic"], {"default": "lanczos"}, @@ -546,7 +546,7 @@ class SaveImageGrid: "required": { "images": ("IMAGE",), "filename_prefix": ("STRING", {"default": "ComfyUI"}), - "save_intermediate": ("BOOL", {"default": False}), + "save_intermediate": ("BOOLEAN", {"default": False}), }, "hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"}, } diff --git a/nodes/io.py b/nodes/io.py index d31d27e..e8a07bd 100644 --- a/nodes/io.py +++ b/nodes/io.py @@ -101,7 +101,8 @@ class SaveGif: "image": ("IMAGE",), "fps": ("INT", {"default": 12, "min": 1, "max": 120}), "resize_by": ("FLOAT", {"default": 1.0, "min": 0.1}), - "pingpong": ("BOOL", {"default": False}), + "optimize": ("BOOLEAN", {"default": False}), + "pingpong": ("BOOLEAN", {"default": False}), } } diff --git a/nodes/mask.py b/nodes/mask.py index 64e5119..fe80fc4 100644 --- a/nodes/mask.py +++ b/nodes/mask.py @@ -13,7 +13,7 @@ class ImageRemoveBackgroundRembg: "required": { "image": ("IMAGE",), "alpha_matting": ( - "BOOL", + "BOOLEAN", {"default": False}, ), "alpha_matting_foreground_threshold": ( @@ -29,7 +29,7 @@ class ImageRemoveBackgroundRembg: {"default": 10, "min": 0, "max": 255}, ), "post_process_mask": ( - "BOOL", + "BOOLEAN", {"default": False}, ), "bgcolor": ( diff --git a/nodes/number.py b/nodes/number.py index dc1be4b..6881194 100644 --- a/nodes/number.py +++ b/nodes/number.py @@ -14,7 +14,7 @@ class IntToBool: } } - RETURN_TYPES = ("BOOL",) + RETURN_TYPES = ("BOOLEAN",) FUNCTION = "int_to_bool" CATEGORY = "mtb/number" diff --git a/web/mtb_widgets.js b/web/mtb_widgets.js index c5f36b4..30283b5 100644 --- a/web/mtb_widgets.js +++ b/web/mtb_widgets.js @@ -13,7 +13,7 @@ import * as shared from '/extensions/mtb/comfy_shared.js' import { log } from '/extensions/mtb/comfy_shared.js' import { api } from '/scripts/api.js' -const newTypes = ['BOOL', 'COLOR', 'BBOX'] +const newTypes = [, /*'BOOL'*/ 'COLOR', 'BBOX'] export const MtbWidgets = { BBOX: (key, val) => { @@ -204,116 +204,7 @@ export const MtbWidgets = { widget.desc = 'Represents a Bounding Box with x, y, width, and height.' return widget }, - BOOL: (key, val, compute = false) => { - /** @type {import("/types/litegraph").IWidget} */ - const widget = { - name: key, - type: 'BOOL', - options: { default: false }, - y: 0, - draw: function (ctx, node, widget_width, widgetY, height) { - const hide = this.type !== 'BOOL' && app.canvas.ds.scale > 0.5 - if (hide) { - return - } - const outline_color = LiteGraph.WIDGET_OUTLINE_COLOR - const background_color = LiteGraph.WIDGET_BGCOLOR - const text_color = LiteGraph.WIDGET_TEXT_COLOR - const H = LiteGraph.NODE_WIDGET_HEIGHT - // const arrowSize = 8 - - let margin = 15 - if (hide) return - - let currentY = widgetY - - ctx.textAlign = 'left' - ctx.strokeStyle = outline_color - ctx.fillStyle = background_color - ctx.beginPath() - // ctx.roundRect(margin, currentY, widget_width - margin * 2, H, [H * 0.5]); - ctx.rect(margin, currentY, H, H) // Draw checkbox square - - ctx.fill() - ctx.stroke() - - ctx.fillStyle = text_color - // ctx.fillText(this.label || this.name, margin * 2 + 5, currentY + H * 0.7); - ctx.fillText( - this.label || this.name, - H + margin * 2, - currentY + H * 0.7 - ) - - // Draw arrow if the value is true - // Draw checkmark if the value is true - if (this.value) { - ctx.fillStyle = text_color - ctx.beginPath() - ctx.moveTo(margin + H * 0.15, currentY + H * 0.5) - ctx.lineTo(margin + H * 0.4, currentY + H * 0.8) - ctx.lineTo(margin + H * 0.85, currentY + H * 0.2) - ctx.stroke() - } - }, - get value() { - return this.inputEl.value === 'true' - }, - set value(x) { - this.inputEl.value = x - }, - computeSize: function (width) { - return [width, 32] - }, - mouse: function (event, pos, node) { - // let x = pos[0] - node.pos[0]; - // let y = pos[1] - node.pos[1]; - // let width = node.size[0]; - // let H = LiteGraph.NODE_WIDGET_HEIGHT; - // let margin = 15; - - // if (event.type == LiteGraph.pointerevents_method + "down") { - // if (x > margin && x < widget_width - margin && y > widgetY && y < widgetY + H) { - // this.value = !this.value; // Toggle checkbox value - // shared.inner_value_change(this, this.value, event); - // app.canvas.setDirty(true); - // } - // } - if (event.type === 'pointerdown') { - // get widgets of type type : "COLOR" - const widgets = node.widgets.filter((w) => w.type === 'BOOL') - - for (const w of widgets) { - // color picker - const rect = [w.last_y, w.last_y + 32] - if (pos[1] > rect[0] && pos[1] < rect[1]) { - // picker.style.position = "absolute"; - // picker.style.left = ( pos[0]) + "px"; - // picker.style.top = ( pos[1]) + "px"; - - // place at screen center - // picker.style.position = "absolute"; - // picker.style.left = (window.innerWidth / 2) + "px"; - // picker.style.top = (window.innerHeight / 2) + "px"; - // picker.style.transform = "translate(-50%, -50%)"; - // picker.style.zIndex = 1000; - - this.value = this.value ? false : true - } - } - } - }, - } - - // create a checkbox - widget.inputEl = document.createElement('input') - widget.inputEl.type = 'checkbox' - widget.value = val || false - - document.body.appendChild(widget.inputEl) - return widget - }, COLOR: (key, val, compute = false) => { /** @type {import("/types/litegraph").IWidget} */ const widget = {}