diff --git a/example/Searge-SDXL-img2img.json b/example/Searge-SDXL-img2img.json index 6cf2cba..86c651d 100644 --- a/example/Searge-SDXL-img2img.json +++ b/example/Searge-SDXL-img2img.json @@ -1,6 +1,6 @@ { - "last_node_id": 57, - "last_link_id": 85, + "last_node_id": 64, + "last_link_id": 128, "nodes": [ { "id": 6, @@ -14,7 +14,7 @@ 26 ], "flags": {}, - "order": 24, + "order": 21, "mode": 0, "inputs": [ { @@ -49,7 +49,7 @@ 26 ], "flags": {}, - "order": 19, + "order": 18, "mode": 0, "inputs": [ { @@ -72,80 +72,6 @@ "horizontal": false } }, - { - "id": 8, - "type": "Reroute", - "pos": [ - 477, - 252 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 18, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 5 - } - ], - "outputs": [ - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 23, - 25 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, - { - "id": 5, - "type": "Reroute", - "pos": [ - 471, - 100 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 23, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 7 - } - ], - "outputs": [ - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 26, - 27 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, { "id": 7, "type": "Reroute", @@ -158,7 +84,7 @@ 26 ], "flags": {}, - "order": 17, + "order": 16, "mode": 0, "inputs": [ { @@ -194,7 +120,7 @@ 26 ], "flags": {}, - "order": 22, + "order": 19, "mode": 0, "inputs": [ { @@ -218,41 +144,6 @@ "horizontal": false } }, - { - "id": 19, - "type": "SeargePromptText", - "pos": [ - 0, - 450 - ], - "size": [ - 403, - 146 - ], - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 14 - ], - "shape": 3, - "slot_index": 0 - } - ], - "title": "Main Prompt", - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - "a fantastical faery on a grass field on a sunny summer day with blue sky and a few small clouds" - ], - "color": "#232", - "bgcolor": "#353" - }, { "id": 3, "type": "CheckpointLoaderSimple", @@ -265,7 +156,7 @@ "1": 98 }, "flags": {}, - "order": 1, + "order": 0, "mode": 0, "outputs": [ { @@ -302,300 +193,208 @@ ] }, { - "id": 12, - "type": "CLIPTextEncodeSDXLRefiner", + "id": 41, + "type": "Reroute", "pos": [ - 807, - 586 + 750, + 0 + ], + "size": [ + 75, + 26 ], - "size": { - "0": 226.92648315429688, - "1": 118 - }, "flags": {}, - "order": 26, + "order": 24, "mode": 0, "inputs": [ { - "name": "clip", - "type": "CLIP", - "link": 25 - }, + "name": "", + "type": "*", + "link": 64 + } + ], + "outputs": [ { - "name": "text", - "type": "STRING", - "link": 19, - "widget": { - "name": "text", - "config": [ - "STRING", - { - "multiline": true - } - ] - } - }, + "name": "", + "type": "VAE", + "links": [ + 65 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 43, + "type": "VAEDecode", + "pos": [ + 2400, + 50 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 32, + "mode": 0, + "inputs": [ { - "name": "width", - "type": "INT", - "link": 52, - "widget": { - "name": "width", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - } + "name": "samples", + "type": "LATENT", + "link": 66 }, { - "name": "height", - "type": "INT", - "link": 61, - "widget": { - "name": "height", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - } + "name": "vae", + "type": "VAE", + "link": 67 } ], "outputs": [ { - "name": "CONDITIONING", - "type": "CONDITIONING", + "name": "IMAGE", + "type": "IMAGE", "links": [ - 40 + 68 ], - "shape": 3, - "slot_index": 0 + "shape": 3 } ], "properties": { "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - 6, - 2048, - 2048, - "" - ], - "color": "#232", - "bgcolor": "#353" + } }, { - "id": 13, - "type": "CLIPTextEncodeSDXL", + "id": 42, + "type": "Reroute", "pos": [ - 807, - 786 + 2250, + 0 + ], + "size": [ + 75, + 26 ], - "size": { - "0": 220, - "1": 202 - }, "flags": {}, - "order": 29, + "order": 27, "mode": 0, "inputs": [ { - "name": "clip", - "type": "CLIP", - "link": 26 - }, - { - "name": "text_g", - "type": "STRING", - "link": 20, - "widget": { - "name": "text_g", - "config": [ - "STRING", - { - "multiline": true, - "default": "CLIP_G" - } - ] - } - }, - { - "name": "text_l", - "type": "STRING", - "link": 21, - "widget": { - "name": "text_l", - "config": [ - "STRING", - { - "multiline": true, - "default": "CLIP_L" - } - ] - } - }, + "name": "", + "type": "*", + "link": 65 + } + ], + "outputs": [ { - "name": "width", - "type": "INT", - "link": 58, - "widget": { - "name": "width", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - } - }, - { - "name": "height", - "type": "INT", - "link": 57, - "widget": { - "name": "height", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - } - }, - { - "name": "target_width", - "type": "INT", - "link": 59, - "widget": { - "name": "target_width", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - } - }, - { - "name": "target_height", - "type": "INT", - "link": 60, - "widget": { - "name": "target_height", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - } - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", + "name": "", + "type": "VAE", "links": [ - 42 + 67 ], - "shape": 3, "slot_index": 0 } ], "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - 4096, - 4096, - 0, - 0, - 4096, - 4096, - "CLIP_G", - "CLIP_L" - ], - "color": "#322", - "bgcolor": "#533" + "showOutputText": false, + "horizontal": false + } }, { - "id": 31, + "id": 46, "type": "Reroute", "pos": [ - 1151, - 186 + 1800, + 400 ], "size": [ 75, 26 ], "flags": {}, - "order": 32, + "order": 34, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 40 + "link": 69, + "pos": [ + 37.5, + 0 + ] } ], "outputs": [ { "name": "", - "type": "CONDITIONING", + "type": "IMAGE", "links": [ - 41 + 70 ], "slot_index": 0 } ], "properties": { "showOutputText": false, - "horizontal": false + "horizontal": true + } + }, + { + "id": 44, + "type": "PreviewImage", + "pos": [ + 1900, + 500 + ], + "size": { + "0": 1050, + "1": 1100 + }, + "flags": {}, + "order": 36, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 70 + } + ], + "properties": { + "Node name for S&R": "Searge SDXL Workflow" } }, { - "id": 32, + "id": 49, "type": "Reroute", "pos": [ - 1186, - 254 + 650, + -200 ], "size": [ 75, 26 ], "flags": {}, - "order": 35, + "order": 26, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 42 + "link": 75 } ], "outputs": [ { "name": "", - "type": "CONDITIONING", + "type": "VAE", "links": [ - 43 + 76 ], "slot_index": 0 } @@ -606,34 +405,74 @@ } }, { - "id": 30, + "id": 48, + "type": "VAEEncode", + "pos": [ + 1200, + -200 + ], + "size": { + "0": 300, + "1": 50 + }, + "flags": {}, + "order": 28, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 79 + }, + { + "name": "vae", + "type": "VAE", + "link": 76 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 74 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Searge SDXL Workflow" + } + }, + { + "id": 51, "type": "Reroute", "pos": [ - 1115, - 115 + 450, + -250 ], "size": [ 75, 26 ], "flags": {}, - "order": 36, + "order": 22, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 38 + "link": 78 } ], "outputs": [ { "name": "", - "type": "CONDITIONING", + "type": "IMAGE", "links": [ - 39 - ], - "slot_index": 0 + 79 + ] } ], "properties": { @@ -642,252 +481,363 @@ } }, { - "id": 33, + "id": 26, "type": "Reroute", "pos": [ - 1211, - 314 + 1750, + -150 ], "size": [ 75, 26 ], "flags": {}, - "order": 34, + "order": 30, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 44 + "link": 124, + "slot_index": 0 } ], "outputs": [ { "name": "", - "type": "CONDITIONING", + "type": "LATENT", "links": [ - 45 - ], - "slot_index": 0 + 34 + ] } ], + "title": "Input", "properties": { "showOutputText": false, "horizontal": false } }, { - "id": 34, - "type": "PrimitiveNode", + "id": 53, + "type": "Note", "pos": [ 1250, - 600 - ], - "size": [ - 300, - 100 + 1250 ], + "size": { + "0": 300, + "1": 100 + }, "flags": {}, - "order": 2, + "order": 1, "mode": 0, - "outputs": [ - { - "name": "INT", - "type": "INT", - "links": [ - 46 - ], - "widget": { - "name": "steps", - "config": [ - "INT", - { - "default": 30, - "min": 1, - "max": 10000 - } - ] - } - } - ], - "title": "Steps", - "properties": {}, + "properties": { + "text": "" + }, "widgets_values": [ - 30, - "fixed" + "Changing Denoise below 1.0 only makes sense in\nimg2img mode" ], - "color": "#432", - "bgcolor": "#653" + "color": "#222", + "bgcolor": "#000" }, { - "id": 37, - "type": "PrimitiveNode", + "id": 1, + "type": "CheckpointLoaderSimple", "pos": [ - 1250, - 900 - ], - "size": [ - 300, + 0, 100 ], + "size": { + "0": 385.23138427734375, + "1": 98 + }, "flags": {}, - "order": 3, + "order": 2, "mode": 0, "outputs": [ { - "name": "FLOAT", - "type": "FLOAT", + "name": "MODEL", + "type": "MODEL", "links": [ - 49 + 1 + ], + "shape": 3 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 7 + ], + "shape": 3 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 3 + ], + "shape": 3 + } + ], + "title": "Load BASE Checkpoint", + "properties": { + "Node name for S&R": "Searge SDXL Workflow" + }, + "widgets_values": [ + "sd_xl_base_0.9.safetensors" + ] + }, + { + "id": 50, + "type": "LoadImage", + "pos": [ + 0, + -600 + ], + "size": { + "0": 400, + "1": 500 + }, + "flags": {}, + "order": 3, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 78 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "Searge SDXL Workflow" + }, + "widgets_values": [ + "example.png", + "image" + ] + }, + { + "id": 52, + "type": "Note", + "pos": [ + 1550, + -400 + ], + "size": { + "0": 350, + "1": 150 + }, + "flags": {}, + "order": 4, + "mode": 0, + "properties": { + "text": "" + }, + "widgets_values": [ + "\nSDXL Workflow created by Searge Jul 12, 2023\nRequires extension: https://github.com/SeargeDP/SeargeSDXL\n\nConnect:\n- top left to right => img2img\n- bottom left to right => create a fresh image\n\nWhen img2img is enabled, the Denoise parameter can be\nlowered to a value below 1.0" + ], + "color": "#222", + "bgcolor": "#000" + }, + { + "id": 29, + "type": "PrimitiveNode", + "pos": [ + 1295.1872975781243, + 450 + ], + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 5, + "mode": 0, + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 37 ], "widget": { - "name": "base_ratio", + "name": "noise_seed", "config": [ - "FLOAT", + "INT", { - "default": 0.8, + "default": 0, "min": 0, - "max": 1, - "step": 0.01 + "max": 18446744073709552000 } ] } } ], - "title": "Base vs. Refiner Ratio", + "title": "SEED", "properties": {}, "widgets_values": [ - 0.8, + 4815162342, "fixed" ], - "color": "#2a363b", - "bgcolor": "#3f5159" + "color": "#232", + "bgcolor": "#353" }, { - "id": 11, - "type": "CLIPTextEncodeSDXL", + "id": 18, + "type": "SeargeSDXLSampler", "pos": [ - 807, - 336 + 1900, + 50 ], "size": { - "0": 220, - "1": 202 + "0": 315, + "1": 346 }, "flags": {}, - "order": 30, + "order": 31, "mode": 0, "inputs": [ { - "name": "clip", - "type": "CLIP", - "link": 27 + "name": "base_model", + "type": "MODEL", + "link": 33 }, { - "name": "text_g", - "type": "STRING", - "link": 17, - "widget": { - "name": "text_g", - "config": [ - "STRING", - { - "multiline": true, - "default": "CLIP_G" - } - ] - }, - "slot_index": 1 + "name": "base_positive", + "type": "CONDITIONING", + "link": 125 }, { - "name": "text_l", - "type": "STRING", - "link": 73, + "name": "base_negative", + "type": "CONDITIONING", + "link": 126 + }, + { + "name": "refiner_model", + "type": "MODEL", + "link": 32 + }, + { + "name": "refiner_positive", + "type": "CONDITIONING", + "link": 127 + }, + { + "name": "refiner_negative", + "type": "CONDITIONING", + "link": 128 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 34, + "slot_index": 6 + }, + { + "name": "noise_seed", + "type": "INT", + "link": 37, "widget": { - "name": "text_l", + "name": "noise_seed", "config": [ - "STRING", + "INT", { - "multiline": true, - "default": "CLIP_L" + "default": 0, + "min": 0, + "max": 18446744073709552000 } ] }, - "slot_index": 2 + "slot_index": 7 }, { - "name": "width", + "name": "steps", "type": "INT", - "link": 51, + "link": 46, "widget": { - "name": "width", + "name": "steps", "config": [ "INT", { - "default": 1024, - "min": 0, - "max": 8192 + "default": 30, + "min": 1, + "max": 10000 } ] }, - "slot_index": 3 + "slot_index": 8 }, { - "name": "height", - "type": "INT", - "link": 53, + "name": "cfg", + "type": "FLOAT", + "link": 48, "widget": { - "name": "height", + "name": "cfg", "config": [ - "INT", + "FLOAT", { - "default": 1024, + "default": 8, "min": 0, - "max": 8192 + "max": 100 } ] - } + }, + "slot_index": 9 }, { - "name": "target_width", - "type": "INT", - "link": 54, + "name": "base_ratio", + "type": "FLOAT", + "link": 49, "widget": { - "name": "target_width", + "name": "base_ratio", "config": [ - "INT", + "FLOAT", { - "default": 1024, + "default": 0.8, "min": 0, - "max": 8192 + "max": 1, + "step": 0.01 } ] - } + }, + "slot_index": 10 }, { - "name": "target_height", - "type": "INT", - "link": 55, + "name": "denoise", + "type": "FLOAT", + "link": 50, "widget": { - "name": "target_height", + "name": "denoise", "config": [ - "INT", + "FLOAT", { - "default": 1024, + "default": 1, "min": 0, - "max": 8192 + "max": 1, + "step": 0.01 } ] - } + }, + "slot_index": 11 } ], "outputs": [ { - "name": "CONDITIONING", - "type": "CONDITIONING", + "name": "LATENT", + "type": "LATENT", "links": [ - 38 + 66 ], "shape": 3, "slot_index": 0 @@ -897,663 +847,42 @@ "Node name for S&R": "Searge SDXL Workflow" }, "widgets_values": [ - 4096, - 4096, - 0, - 0, - 4096, - 4096, - "CLIP_G", - "CLIP_L" - ], - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 40, - "type": "PrimitiveNode", - "pos": [ - 0, - 1300 - ], - "size": [ - 400, - 100 - ], - "flags": {}, - "order": 4, - "mode": 0, - "outputs": [ - { - "name": "INT", - "type": "INT", - "links": [ - 52, - 61, - 62, - 63 - ], - "widget": { - "name": "width", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - }, - "slot_index": 0 - } - ], - "title": "REFINER Conditional Size", - "properties": {}, - "widgets_values": [ - 2048, - "fixed" - ], - "color": "#222", - "bgcolor": "#000" - }, - { - "id": 39, - "type": "PrimitiveNode", - "pos": [ - 0, - 1150 - ], - "size": [ - 400, - 100 - ], - "flags": {}, - "order": 5, - "mode": 0, - "outputs": [ - { - "name": "INT", - "type": "INT", - "links": [ - 51, - 53, - 54, - 55, - 57, - 58, - 59, - 60 - ], - "widget": { - "name": "width", - "config": [ - "INT", - { - "default": 1024, - "min": 0, - "max": 8192 - } - ] - }, - "slot_index": 0 - } - ], - "title": "BASE Conditional Size", - "properties": {}, - "widgets_values": [ - 4096, - "fixed" - ], - "color": "#222", - "bgcolor": "#000" - }, - { - "id": 41, - "type": "Reroute", - "pos": [ - 750, - 0 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 27, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 64 - } - ], - "outputs": [ - { - "name": "", - "type": "VAE", - "links": [ - 65 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 43, - "type": "VAEDecode", - "pos": [ - 2400, - 50 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 41, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 66 - }, - { - "name": "vae", - "type": "VAE", - "link": 67 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 68 - ], - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - } - }, - { - "id": 18, - "type": "SeargeSDXLSampler", - "pos": [ - 1900, - 50 - ], - "size": [ - 315, - 346 - ], - "flags": {}, - "order": 40, - "mode": 0, - "inputs": [ - { - "name": "base_model", - "type": "MODEL", - "link": 33 - }, - { - "name": "base_positive", - "type": "CONDITIONING", - "link": 39 - }, - { - "name": "base_negative", - "type": "CONDITIONING", - "link": 43 - }, - { - "name": "refiner_model", - "type": "MODEL", - "link": 32 - }, - { - "name": "refiner_positive", - "type": "CONDITIONING", - "link": 41 - }, - { - "name": "refiner_negative", - "type": "CONDITIONING", - "link": 45 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 34, - "slot_index": 6 - }, - { - "name": "noise_seed", - "type": "INT", - "link": 37, - "widget": { - "name": "noise_seed", - "config": [ - "INT", - { - "default": 0, - "min": 0, - "max": 18446744073709552000 - } - ] - }, - "slot_index": 7 - }, - { - "name": "steps", - "type": "INT", - "link": 46, - "widget": { - "name": "steps", - "config": [ - "INT", - { - "default": 30, - "min": 1, - "max": 10000 - } - ] - }, - "slot_index": 8 - }, - { - "name": "cfg", - "type": "FLOAT", - "link": 48, - "widget": { - "name": "cfg", - "config": [ - "FLOAT", - { - "default": 8, - "min": 0, - "max": 100 - } - ] - }, - "slot_index": 9 - }, - { - "name": "base_ratio", - "type": "FLOAT", - "link": 49, - "widget": { - "name": "base_ratio", - "config": [ - "FLOAT", - { - "default": 0.8, - "min": 0, - "max": 1, - "step": 0.01 - } - ] - }, - "slot_index": 10 - }, - { - "name": "denoise", - "type": "FLOAT", - "link": 50, - "widget": { - "name": "denoise", - "config": [ - "FLOAT", - { - "default": 1, - "min": 0, - "max": 1, - "step": 0.01 - } - ] - }, - "slot_index": 11 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 66 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - 4815162342, - "fixed", - 30, - 8.5, - "dpmpp_2m", - "karras", - 0.8, - 0.9000000000000002 - ] - }, - { - "id": 42, - "type": "Reroute", - "pos": [ - 2250, - 0 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 33, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 65 - } - ], - "outputs": [ - { - "name": "", - "type": "VAE", - "links": [ - 67 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 46, - "type": "Reroute", - "pos": [ - 1800, - 400 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 43, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 69, - "pos": [ - 37.5, - 0 - ] - } - ], - "outputs": [ - { - "name": "", - "type": "IMAGE", - "links": [ - 70 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": false, - "horizontal": true - } - }, - { - "id": 47, - "type": "EmptyLatentImage", - "pos": [ - 1200, - -100 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 6, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 71 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - 1024, - 1024, - 1 + 4815162342, + "fixed", + 30, + 6, + "dpmpp_2m", + "karras", + 0.8, + 0.8999999999999999 ] }, { - "id": 44, - "type": "PreviewImage", - "pos": [ - 1900, - 500 - ], - "size": [ - 1050, - 1100 - ], - "flags": {}, - "order": 45, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 70 - } - ], - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - } - }, - { - "id": 21, - "type": "SeargePromptText", - "pos": [ - 0, - 650 - ], - "size": { - "0": 403, - "1": 146 - }, - "flags": {}, - "order": 7, - "mode": 0, - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 73 - ], - "shape": 3, - "slot_index": 0 - } - ], - "title": "Secondary Prompt", - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - "fantasy, faery, grass, summer, sky, clouds" - ], - "color": "#233", - "bgcolor": "#355" - }, - { - "id": 25, - "type": "Reroute", - "pos": [ - 450, - 800 - ], - "size": [ - 90.4, - 26 - ], - "flags": {}, - "order": 21, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 16 - } - ], - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 20, - 21, - 22 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, - { - "id": 23, - "type": "Reroute", - "pos": [ - 450, - 400 - ], - "size": [ - 90.4, - 26 - ], - "flags": {}, - "order": 16, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 14 - } - ], - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 17, - 19 - ], - "slot_index": 0 - } - ], - "properties": { - "showOutputText": true, - "horizontal": false - } - }, - { - "id": 22, - "type": "SeargePromptText", - "pos": [ - 0, - 850 - ], - "size": { - "0": 403, - "1": 146 - }, - "flags": {}, - "order": 8, - "mode": 0, - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": [ - 16 - ], - "shape": 3, - "slot_index": 0 - } - ], - "title": "Negative Prompt", - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - "bad quality, old, deep-fried, bad eyes" - ], - "color": "#322", - "bgcolor": "#533" - }, - { - "id": 49, + "id": 27, "type": "Reroute", "pos": [ - 650, - -200 + 1600, + -100 ], "size": [ 75, 26 ], "flags": {}, - "order": 31, + "order": 23, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 75 + "link": 71 } ], "outputs": [ { "name": "", - "type": "VAE", - "links": [ - 76 - ], + "type": "LATENT", + "links": [], "slot_index": 0 } ], @@ -1563,265 +892,322 @@ } }, { - "id": 48, - "type": "VAEEncode", - "pos": [ - 1200, - -200 - ], - "size": [ - 300, - 50 - ], - "flags": {}, - "order": 37, - "mode": 0, - "inputs": [ - { - "name": "pixels", - "type": "IMAGE", - "link": 79 - }, - { - "name": "vae", - "type": "VAE", - "link": 76 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 74 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - } - }, - { - "id": 51, + "id": 5, "type": "Reroute", "pos": [ - 450, - -250 + 471, + 100 ], "size": [ 75, 26 ], "flags": {}, - "order": 25, + "order": 20, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 78 + "link": 7 } ], "outputs": [ { - "name": "", - "type": "IMAGE", + "name": "CLIP", + "type": "CLIP", "links": [ - 79 - ] + 101 + ], + "slot_index": 0 } ], "properties": { - "showOutputText": false, + "showOutputText": true, "horizontal": false } }, { - "id": 26, + "id": 8, "type": "Reroute", "pos": [ - 1750, - -150 + 477, + 252 ], "size": [ 75, 26 ], "flags": {}, - "order": 39, + "order": 17, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 85, - "slot_index": 0 + "link": 5 } ], "outputs": [ { - "name": "", - "type": "LATENT", + "name": "CLIP", + "type": "CLIP", "links": [ - 34 - ] + 102 + ], + "slot_index": 0 } ], - "title": "Input", "properties": { - "showOutputText": false, + "showOutputText": true, "horizontal": false } }, { - "id": 52, - "type": "Note", + "id": 21, + "type": "SeargePromptText", "pos": [ - 1550, - -400 - ], - "size": [ - 350, - 150 + 0, + 650 ], + "size": { + "0": 403, + "1": 146 + }, "flags": {}, - "order": 9, + "order": 6, "mode": 0, + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 104 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "Secondary Prompt", "properties": { - "text": "" + "Node name for S&R": "Searge SDXL Workflow" }, "widgets_values": [ - "\nSDXL Workflow created by Searge Jul 12, 2023\n\nConnect:\n- top left to right => img2img\n- bottom left to right => create a fresh image\n\nWhen img2img is enabled, the Denoise parameter can be\nlowered to a value below 1.0" + "masterpiece, intricate details, telephoto lens" ], - "color": "#222", - "bgcolor": "#000" + "color": "#233", + "bgcolor": "#355" }, { - "id": 53, - "type": "Note", + "id": 19, + "type": "SeargePromptText", "pos": [ - 1250, - 1250 - ], - "size": [ - 300, - 100 + 0, + 450 ], + "size": { + "0": 403, + "1": 146 + }, "flags": {}, - "order": 10, + "order": 7, "mode": 0, + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 117, + 118 + ], + "shape": 3, + "slot_index": 0 + } + ], + "title": "Main Prompt", "properties": { - "text": "" + "Node name for S&R": "Searge SDXL Workflow" }, "widgets_values": [ - "Changing Denoise below 1.0 only makes sense in\nimg2img mode" + "an old chinese man standing near The Temple of Apollo in waning light, Overdetailed Kingcore art with vivid colors, style of Luigi Loir and Jake Parker" ], - "color": "#222", - "bgcolor": "#000" + "color": "#232", + "bgcolor": "#353" }, { - "id": 1, - "type": "CheckpointLoaderSimple", + "id": 22, + "type": "SeargePromptText", "pos": [ 0, - 100 + 850 ], "size": { - "0": 385.23138427734375, - "1": 98 + "0": 403, + "1": 146 }, "flags": {}, - "order": 11, + "order": 8, "mode": 0, "outputs": [ { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "shape": 3 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 7 - ], - "shape": 3 - }, - { - "name": "VAE", - "type": "VAE", + "name": "STRING", + "type": "STRING", "links": [ - 3 + 121, + 122, + 123 ], - "shape": 3 + "shape": 3, + "slot_index": 0 } ], - "title": "Load BASE Checkpoint", + "title": "Negative Prompt", "properties": { "Node name for S&R": "Searge SDXL Workflow" }, "widgets_values": [ - "sd_xl_base_0.9.safetensors" - ] + "extra limbs, missing limbs, extra eyes, missing eyes, extra mouths, missing mouths, extra ears, missing ears, extra nose, missing nose, extra fingers, missing fingers, extra toes, missing toes, extra organs, missing organs, deep-fried" + ], + "color": "#322", + "bgcolor": "#533" }, { - "id": 27, - "type": "Reroute", + "id": 54, + "type": "SaveImage", "pos": [ - 1600, - -100 - ], - "size": [ - 75, - 26 + 800, + 900 ], + "size": { + "0": 350, + "1": 400 + }, "flags": {}, - "order": 20, + "order": 37, "mode": 0, "inputs": [ { - "name": "", - "type": "*", - "link": 71 + "name": "images", + "type": "IMAGE", + "link": 84 } ], + "properties": {}, + "widgets_values": [ + "SeargeSDXL" + ] + }, + { + "id": 39, + "type": "PrimitiveNode", + "pos": [ + 200, + 1100 + ], + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 9, + "mode": 0, "outputs": [ { - "name": "", - "type": "LATENT", - "links": [], + "name": "INT", + "type": "INT", + "links": [ + 111, + 112, + 113, + 114 + ], + "widget": { + "name": "width", + "config": [ + "INT", + { + "default": 1024, + "min": 0, + "max": 8192 + } + ] + }, "slot_index": 0 } ], - "properties": { - "showOutputText": false, - "horizontal": false - } + "title": "BASE Conditional Size", + "properties": {}, + "widgets_values": [ + 4096, + "fixed" + ], + "color": "#222", + "bgcolor": "#000" }, { - "id": 45, + "id": 40, + "type": "PrimitiveNode", + "pos": [ + 200, + 1250 + ], + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 10, + "mode": 0, + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 109, + 110 + ], + "widget": { + "name": "width", + "config": [ + "INT", + { + "default": 1024, + "min": 0, + "max": 8192 + } + ] + }, + "slot_index": 0 + } + ], + "title": "REFINER Conditional Size", + "properties": {}, + "widgets_values": [ + 2048, + "fixed" + ], + "color": "#222", + "bgcolor": "#000" + }, + { + "id": 55, "type": "Reroute", "pos": [ - 2650, - 100 + 650, + 850 ], "size": [ 75, 26 ], "flags": {}, - "order": 42, + "order": 35, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 68, + "link": 83, "pos": [ 37.5, 0 @@ -1833,8 +1219,7 @@ "name": "", "type": "IMAGE", "links": [ - 69, - 83 + 84 ], "slot_index": 0 } @@ -1845,24 +1230,24 @@ } }, { - "id": 55, + "id": 45, "type": "Reroute", "pos": [ - 428, - 1031 + 2650, + 100 ], "size": [ 75, 26 ], "flags": {}, - "order": 44, + "order": 33, "mode": 0, "inputs": [ { "name": "", "type": "*", - "link": 83, + "link": 68, "pos": [ 37.5, 0 @@ -1874,7 +1259,8 @@ "name": "", "type": "IMAGE", "links": [ - 84 + 69, + 83 ], "slot_index": 0 } @@ -1885,30 +1271,91 @@ } }, { - "id": 54, - "type": "SaveImage", + "id": 37, + "type": "PrimitiveNode", "pos": [ - 650, - 1250 + 1295.1872975781243, + 900 ], - "size": [ - 350, - 400 + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 11, + "mode": 0, + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 49 + ], + "widget": { + "name": "base_ratio", + "config": [ + "FLOAT", + { + "default": 0.8, + "min": 0, + "max": 1, + "step": 0.01 + } + ] + } + } + ], + "title": "Base vs. Refiner Ratio", + "properties": {}, + "widgets_values": [ + 0.8, + "fixed" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 34, + "type": "PrimitiveNode", + "pos": [ + 1295.1872975781243, + 600 ], + "size": { + "0": 210, + "1": 82 + }, "flags": {}, - "order": 46, + "order": 12, "mode": 0, - "inputs": [ + "outputs": [ { - "name": "images", - "type": "IMAGE", - "link": 84 + "name": "INT", + "type": "INT", + "links": [ + 46 + ], + "widget": { + "name": "steps", + "config": [ + "INT", + { + "default": 30, + "min": 1, + "max": 10000 + } + ] + } } ], + "title": "Steps", "properties": {}, "widgets_values": [ - "SeargeSDXL" - ] + 30, + "fixed" + ], + "color": "#432", + "bgcolor": "#653" }, { "id": 28, @@ -1922,7 +1369,7 @@ 26 ], "flags": {}, - "order": 38, + "order": 29, "mode": 0, "inputs": [ { @@ -1936,7 +1383,7 @@ "name": "", "type": "LATENT", "links": [ - 85 + 124 ], "slot_index": 0 } @@ -1947,131 +1394,194 @@ } }, { - "id": 50, - "type": "LoadImage", + "id": 63, + "type": "SeargeSDXLPromptEncoder", "pos": [ - 0, - -600 - ], - "size": [ - 400, - 500 + 750, + 350 ], + "size": { + "0": 228.39999389648438, + "1": 422 + }, "flags": {}, - "order": 12, + "order": 25, "mode": 0, - "outputs": [ + "inputs": [ { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 78 - ], - "shape": 3, - "slot_index": 0 + "name": "base_clip", + "type": "CLIP", + "link": 101 }, { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "Searge SDXL Workflow" - }, - "widgets_values": [ - "example.png", - "image" - ] - }, - { - "id": 29, - "type": "PrimitiveNode", - "pos": [ - 1250, - 450 - ], - "size": [ - 300, - 100 - ], - "flags": {}, - "order": 13, - "mode": 0, - "outputs": [ + "name": "refiner_clip", + "type": "CLIP", + "link": 102 + }, { - "name": "INT", + "name": "pos_g", + "type": "STRING", + "link": 117, + "widget": { + "name": "pos_g", + "config": [ + "STRING", + { + "multiline": true, + "default": "POS_G" + } + ] + } + }, + { + "name": "pos_l", + "type": "STRING", + "link": 104, + "widget": { + "name": "pos_l", + "config": [ + "STRING", + { + "multiline": true, + "default": "POS_L" + } + ] + } + }, + { + "name": "pos_r", + "type": "STRING", + "link": 118, + "widget": { + "name": "pos_r", + "config": [ + "STRING", + { + "multiline": true, + "default": "POS_R" + } + ] + } + }, + { + "name": "neg_g", + "type": "STRING", + "link": 123, + "widget": { + "name": "neg_g", + "config": [ + "STRING", + { + "multiline": true, + "default": "NEG_G" + } + ] + } + }, + { + "name": "neg_l", + "type": "STRING", + "link": 122, + "widget": { + "name": "neg_l", + "config": [ + "STRING", + { + "multiline": true, + "default": "NEG_L" + } + ] + } + }, + { + "name": "neg_r", + "type": "STRING", + "link": 121, + "widget": { + "name": "neg_r", + "config": [ + "STRING", + { + "multiline": true, + "default": "NEG_R" + } + ] + } + }, + { + "name": "base_width", "type": "INT", - "links": [ - 37 - ], + "link": 111, "widget": { - "name": "noise_seed", + "name": "base_width", "config": [ "INT", { - "default": 0, + "default": 4096, "min": 0, - "max": 18446744073709552000 + "max": 8192 } ] } - } - ], - "title": "SEED", - "properties": {}, - "widgets_values": [ - 4815162342, - "fixed" - ], - "color": "#232", - "bgcolor": "#353" - }, - { - "id": 10, - "type": "CLIPTextEncodeSDXLRefiner", - "pos": [ - 807, - 1036 - ], - "size": { - "0": 226.92648315429688, - "1": 118 - }, - "flags": {}, - "order": 28, - "mode": 0, - "inputs": [ + }, + { + "name": "base_height", + "type": "INT", + "link": 112, + "widget": { + "name": "base_height", + "config": [ + "INT", + { + "default": 4096, + "min": 0, + "max": 8192 + } + ] + } + }, { - "name": "clip", - "type": "CLIP", - "link": 23 + "name": "target_width", + "type": "INT", + "link": 113, + "widget": { + "name": "target_width", + "config": [ + "INT", + { + "default": 4096, + "min": 0, + "max": 8192 + } + ] + } }, { - "name": "text", - "type": "STRING", - "link": 22, + "name": "target_height", + "type": "INT", + "link": 114, "widget": { - "name": "text", + "name": "target_height", "config": [ - "STRING", + "INT", { - "multiline": true + "default": 4096, + "min": 0, + "max": 8192 } ] } }, { - "name": "width", + "name": "refiner_width", "type": "INT", - "link": 62, + "link": 109, "widget": { - "name": "width", + "name": "refiner_width", "config": [ "INT", { - "default": 1024, + "default": 2048, "min": 0, "max": 8192 } @@ -2079,15 +1589,15 @@ } }, { - "name": "height", + "name": "refiner_height", "type": "INT", - "link": 63, + "link": 110, "widget": { - "name": "height", + "name": "refiner_height", "config": [ "INT", { - "default": 1024, + "default": 2048, "min": 0, "max": 8192 } @@ -2100,35 +1610,106 @@ "name": "CONDITIONING", "type": "CONDITIONING", "links": [ - 44 + 125 ], "shape": 3, "slot_index": 0 + }, + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 126 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 127 + ], + "shape": 3, + "slot_index": 2 + }, + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 128 + ], + "shape": 3, + "slot_index": 3 } ], "properties": { "Node name for S&R": "Searge SDXL Workflow" }, "widgets_values": [ + "POS_G", + "POS_L", + "POS_R", + "NEG_G", + "NEG_L", + "NEG_R", + 4096, + 4096, + 0, + 0, + 4096, + 4096, + 6, 2.5, 2048, - 2048, - "" + 2048 + ] + }, + { + "id": 47, + "type": "EmptyLatentImage", + "pos": [ + 1200, + -100 ], - "color": "#322", - "bgcolor": "#533" + "size": { + "0": 315, + "1": 106 + }, + "flags": {}, + "order": 13, + "mode": 0, + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 71 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "Searge SDXL Workflow" + }, + "widgets_values": [ + 1024, + 1024, + 1 + ] }, { "id": 38, "type": "PrimitiveNode", "pos": [ - 1250, + 1295.1872975781243, 1050 ], - "size": [ - 300, - 100 - ], + "size": { + "0": 210, + "1": 82 + }, "flags": {}, "order": 14, "mode": 0, @@ -2156,7 +1737,7 @@ "title": "Denoise", "properties": {}, "widgets_values": [ - 0.9000000000000002, + 0.8999999999999999, "fixed" ], "color": "#223", @@ -2166,13 +1747,13 @@ "id": 36, "type": "PrimitiveNode", "pos": [ - 1250, + 1295.1872975781243, 750 ], - "size": [ - 300, - 100 - ], + "size": { + "0": 210, + "1": 82 + }, "flags": {}, "order": 15, "mode": 0, @@ -2199,7 +1780,7 @@ "title": "CFG Scale", "properties": {}, "widgets_values": [ - 8.5, + 6, "fixed" ], "color": "#332922", @@ -2247,197 +1828,45 @@ 0, "*" ], - [ - 7, - 1, - 1, - 5, - 0, - "*" - ], - [ - 14, - 19, - 0, - 23, - 0, - "*" - ], - [ - 16, - 22, - 0, - 25, - 0, - "*" - ], - [ - 17, - 23, - 0, - 11, - 1, - "STRING" - ], - [ - 19, - 23, - 0, - 12, - 1, - "STRING" - ], - [ - 20, - 25, - 0, - 13, - 1, - "STRING" - ], - [ - 21, - 25, - 0, - 13, - 2, - "STRING" - ], - [ - 22, - 25, - 0, - 10, - 1, - "STRING" - ], - [ - 23, - 8, - 0, - 10, - 0, - "CLIP" - ], - [ - 25, - 8, - 0, - 12, - 0, - "CLIP" - ], - [ - 26, - 5, - 0, - 13, - 0, - "CLIP" - ], - [ - 27, - 5, - 0, - 11, - 0, - "CLIP" - ], - [ - 32, - 7, - 0, - 18, - 3, - "MODEL" - ], - [ - 33, - 4, - 0, - 18, - 0, - "MODEL" - ], - [ - 34, - 26, - 0, - 18, - 6, - "LATENT" - ], - [ - 37, - 29, - 0, - 18, - 7, - "INT" - ], - [ - 38, - 11, - 0, - 30, - 0, - "*" - ], - [ - 39, - 30, - 0, - 18, - 1, - "CONDITIONING" - ], - [ - 40, - 12, - 0, - 31, - 0, - "*" - ], - [ - 41, - 31, - 0, - 18, - 4, - "CONDITIONING" - ], - [ - 42, - 13, - 0, - 32, + [ + 7, + 1, + 1, + 5, 0, "*" ], [ - 43, 32, + 7, 0, 18, - 2, - "CONDITIONING" + 3, + "MODEL" ], [ - 44, - 10, - 0, 33, + 4, 0, - "*" + 18, + 0, + "MODEL" ], [ - 45, - 33, + 34, + 26, 0, 18, - 5, - "CONDITIONING" + 6, + "LATENT" + ], + [ + 37, + 29, + 0, + 18, + 7, + "INT" ], [ 46, @@ -2471,102 +1900,6 @@ 11, "FLOAT" ], - [ - 51, - 39, - 0, - 11, - 3, - "INT" - ], - [ - 52, - 40, - 0, - 12, - 2, - "INT" - ], - [ - 53, - 39, - 0, - 11, - 4, - "INT" - ], - [ - 54, - 39, - 0, - 11, - 5, - "INT" - ], - [ - 55, - 39, - 0, - 11, - 6, - "INT" - ], - [ - 57, - 39, - 0, - 13, - 4, - "INT" - ], - [ - 58, - 39, - 0, - 13, - 3, - "INT" - ], - [ - 59, - 39, - 0, - 13, - 5, - "INT" - ], - [ - 60, - 39, - 0, - 13, - 6, - "INT" - ], - [ - 61, - 40, - 0, - 12, - 3, - "INT" - ], - [ - 62, - 40, - 0, - 10, - 2, - "INT" - ], - [ - 63, - 40, - 0, - 10, - 3, - "INT" - ], [ 64, 9, @@ -2631,14 +1964,6 @@ 0, "*" ], - [ - 73, - 21, - 0, - 11, - 2, - "STRING" - ], [ 74, 48, @@ -2696,12 +2021,156 @@ "IMAGE" ], [ - 85, + 101, + 5, + 0, + 63, + 0, + "CLIP" + ], + [ + 102, + 8, + 0, + 63, + 1, + "CLIP" + ], + [ + 104, + 21, + 0, + 63, + 3, + "STRING" + ], + [ + 109, + 40, + 0, + 63, + 12, + "INT" + ], + [ + 110, + 40, + 0, + 63, + 13, + "INT" + ], + [ + 111, + 39, + 0, + 63, + 8, + "INT" + ], + [ + 112, + 39, + 0, + 63, + 9, + "INT" + ], + [ + 113, + 39, + 0, + 63, + 10, + "INT" + ], + [ + 114, + 39, + 0, + 63, + 11, + "INT" + ], + [ + 117, + 19, + 0, + 63, + 2, + "STRING" + ], + [ + 118, + 19, + 0, + 63, + 4, + "STRING" + ], + [ + 121, + 22, + 0, + 63, + 7, + "STRING" + ], + [ + 122, + 22, + 0, + 63, + 6, + "STRING" + ], + [ + 123, + 22, + 0, + 63, + 5, + "STRING" + ], + [ + 124, 28, 0, 26, 0, "*" + ], + [ + 125, + 63, + 0, + 18, + 1, + "CONDITIONING" + ], + [ + 126, + 63, + 1, + 18, + 2, + "CONDITIONING" + ], + [ + 127, + 63, + 2, + 18, + 4, + "CONDITIONING" + ], + [ + 128, + 63, + 3, + 18, + 5, + "CONDITIONING" ] ], "groups": [ @@ -2728,20 +2197,20 @@ { "title": "CLIP Text Encoding", "bounding": [ - 793, - 255, - 259, - 919 + 724, + 247, + 280, + 565 ], "color": "#b58b2a" }, { "title": "Generation Parameters", "bounding": [ - 1232, + 1277, 371, - 340, - 802 + 263, + 792 ], "color": "#444" } diff --git a/example/Searge-SDXL_00002.png b/example/Searge-SDXL_00002.png new file mode 100644 index 0000000..491490c Binary files /dev/null and b/example/Searge-SDXL_00002.png differ diff --git a/searge_sdxl_sampler_node.py b/searge_sdxl_sampler_node.py index 818b195..cb94704 100644 --- a/searge_sdxl_sampler_node.py +++ b/searge_sdxl_sampler_node.py @@ -28,6 +28,10 @@ import comfy.samplers import nodes +import torch + +from nodes import MAX_RESOLUTION + class SeargeSDXLSampler: @classmethod @@ -69,6 +73,79 @@ def sample(self, base_model, base_positive, base_negative, refiner_model, refine return nodes.common_ksampler(refiner_model, noise_seed, steps, cfg, sampler_name, scheduler, refiner_positive, refiner_negative, base_result[0], denoise=1.0, disable_noise=True, start_step=base_steps, last_step=steps, force_full_denoise=True) +class SeargeSDXLPromptEncoder: + @classmethod + def INPUT_TYPES(s): + return {"required": { + "base_clip": ("CLIP", ), + "refiner_clip": ("CLIP", ), + "pos_g": ("STRING", {"multiline": True, "default": "POS_G"}), + "pos_l": ("STRING", {"multiline": True, "default": "POS_L"}), + "pos_r": ("STRING", {"multiline": True, "default": "POS_R"}), + "neg_g": ("STRING", {"multiline": True, "default": "NEG_G"}), + "neg_l": ("STRING", {"multiline": True, "default": "NEG_L"}), + "neg_r": ("STRING", {"multiline": True, "default": "NEG_R"}), + "base_width": ("INT", {"default": 4096.0, "min": 0, "max": MAX_RESOLUTION}), + "base_height": ("INT", {"default": 4096.0, "min": 0, "max": MAX_RESOLUTION}), + "crop_w": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION}), + "crop_h": ("INT", {"default": 0, "min": 0, "max": MAX_RESOLUTION}), + "target_width": ("INT", {"default": 4096.0, "min": 0, "max": MAX_RESOLUTION}), + "target_height": ("INT", {"default": 4096.0, "min": 0, "max": MAX_RESOLUTION}), + "pos_ascore": ("FLOAT", {"default": 6.0, "min": 0.0, "max": 1000.0, "step": 0.01}), + "neg_ascore": ("FLOAT", {"default": 2.5, "min": 0.0, "max": 1000.0, "step": 0.01}), + "refiner_width": ("INT", {"default": 2048.0, "min": 0, "max": MAX_RESOLUTION}), + "refiner_height": ("INT", {"default": 2048.0, "min": 0, "max": MAX_RESOLUTION}), + }, + } + + RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "CONDITIONING", "CONDITIONING", ) + FUNCTION = "encode" + + CATEGORY = "SeargeSDXL" + + def encode(self, base_clip, refiner_clip, pos_g, pos_l, pos_r, neg_g, neg_l, neg_r, base_width, base_height, crop_w, crop_h, target_width, target_height, pos_ascore, neg_ascore, refiner_width, refiner_height, ): + empty = base_clip.tokenize("") + + # positive base prompt + tokens1 = base_clip.tokenize(pos_g) + tokens1["l"] = base_clip.tokenize(pos_l)["l"] + + if len(tokens1["l"]) != len(tokens1["g"]): + while len(tokens1["l"]) < len(tokens1["g"]): + tokens1["l"] += empty["l"] + while len(tokens1["l"]) > len(tokens1["g"]): + tokens1["g"] += empty["g"] + + cond1, pooled1 = base_clip.encode_from_tokens(tokens1, return_pooled=True) + res1 = [[cond1, {"pooled_output": pooled1, "width": base_width, "height": base_height, "crop_w": crop_w, "crop_h": crop_h, "target_width": target_width, "target_height": target_height}]] + + # negative base prompt + tokens2 = base_clip.tokenize(neg_g) + tokens2["l"] = base_clip.tokenize(neg_l)["l"] + + if len(tokens2["l"]) != len(tokens2["g"]): + while len(tokens2["l"]) < len(tokens2["g"]): + tokens2["l"] += empty["l"] + while len(tokens2["l"]) > len(tokens2["g"]): + tokens2["g"] += empty["g"] + + cond2, pooled2 = base_clip.encode_from_tokens(tokens2, return_pooled=True) + res2 = [[cond2, {"pooled_output": pooled2, "width": base_width, "height": base_height, "crop_w": crop_w, "crop_h": crop_h, "target_width": target_width, "target_height": target_height}]] + + + # positive refiner prompt + tokens3 = refiner_clip.tokenize(pos_r) + cond3, pooled3 = refiner_clip.encode_from_tokens(tokens3, return_pooled=True) + res3 = [[cond3, {"pooled_output": pooled3, "aesthetic_score": pos_ascore, "width": refiner_width,"height": refiner_height}]] + + # negative refiner prompt + tokens4 = refiner_clip.tokenize(neg_r) + cond4, pooled4 = refiner_clip.encode_from_tokens(tokens4, return_pooled=True) + res4 = [[cond4, {"pooled_output": pooled4, "aesthetic_score": neg_ascore, "width": refiner_width,"height": refiner_height}]] + + return (res1, res2, res3, res4, ) + + class SeargePromptText: @classmethod def INPUT_TYPES(s): @@ -87,10 +164,12 @@ def get_value(self, prompt): NODE_CLASS_MAPPINGS = { "SeargeSDXLSampler": SeargeSDXLSampler, + "SeargeSDXLPromptEncoder": SeargeSDXLPromptEncoder, "SeargePromptText": SeargePromptText, } NODE_DISPLAY_NAME_MAPPINGS = { "SeargeSDXLSampler": "Sampler for SDXL (by Searge)", + "SeargeSDXLPromptEncoder": "SDXL Prompt Encoder (by Searge)", "SeargePromptText": "Prompt text input (by Searge)", }