diff --git a/README.md b/README.md index 2dd2a87..70a8ab2 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,14 @@ https://github.com/user-attachments/assets/0f557d87-fd5e-422b-ab7e-dbdd4cab156c For a quick test of **LayerForge**, you can try the example workflow provided below. It demonstrates a basic compositing setup using the node. **šŸ”— Download Example Workflow** + ![šŸ“„ LayerForge\_Example](https://github.com/user-attachments/assets/7572149a-bd5e-4f3b-8379-18bcc9ea3874) + +![šŸ“„ LayerForge\_Example](https://github.com/user-attachments/assets/7e594ebf-a047-46e1-972d-516b0f541743) + + + **How to load the workflow:** Click on the image above, then drag and drop it into your ComfyUI workflow window in your browser. The workflow should load automatically. diff --git a/example_workflows/LayerForge_flux_fill_inpaint_example.json b/example_workflows/LayerForge_flux_fill_inpaint_example.json new file mode 100644 index 0000000..5d240b2 --- /dev/null +++ b/example_workflows/LayerForge_flux_fill_inpaint_example.json @@ -0,0 +1,797 @@ +{ + "id": "d26732fd-91ea-4503-8d0d-383544823cec", + "revision": 0, + "last_node_id": 49, + "last_link_id": 112, + "nodes": [ + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 307, + 282 + ], + "size": [ + 425.2799987792969, + 180.61000061035156 + ], + "flags": { + "collapsed": true + }, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 63 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "slot_index": 0, + "links": [ + 81 + ] + } + ], + "title": "CLIP Text Encode (Negative Prompt)", + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 26, + "type": "FluxGuidance", + "pos": [ + 593, + 44 + ], + "size": [ + 317.3999938964844, + 58 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "conditioning", + "type": "CONDITIONING", + "link": 41 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "slot_index": 0, + "links": [ + 80 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "FluxGuidance", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 30 + ] + }, + { + "id": 39, + "type": "DifferentialDiffusion", + "pos": [ + 1001, + -68 + ], + "size": [ + 277.20001220703125, + 26 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 85 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "slot_index": 0, + "links": [ + 86 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "DifferentialDiffusion", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 45, + "type": "MarkdownNote", + "pos": [ + -225, + 255 + ], + "size": [ + 225, + 88 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": { + "widget_ue_connectable": {} + }, + "widgets_values": [ + "šŸ›ˆ [Learn more about this workflow](https://comfyanonymous.github.io/ComfyUI_examples/flux/#fill-inpainting-model)" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 34, + "type": "DualCLIPLoader", + "pos": [ + -237, + 79 + ], + "size": [ + 315, + 130 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 62, + 63 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "DualCLIPLoader", + "models": [ + { + "name": "clip_l.safetensors", + "url": "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors?download=true", + "directory": "text_encoders" + }, + { + "name": "t5xxl_fp16.safetensors", + "url": "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors?download=true", + "directory": "text_encoders" + } + ], + "widget_ue_connectable": {} + }, + "widgets_values": [ + "SDV3\\clip_l.safetensors", + "FLUX\\t5xxl_fp16.safetensors", + "flux", + "default" + ] + }, + { + "id": 31, + "type": "UNETLoader", + "pos": [ + 602, + -120 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "slot_index": 0, + "links": [ + 85 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "UNETLoader", + "models": [ + { + "name": "flux1-fill-dev.safetensors", + "url": "https://huggingface.co/black-forest-labs/FLUX.1-Fill-dev/blob/main/flux1-fill-dev.safetensors", + "directory": "diffusion_models" + } + ], + "widget_ue_connectable": {} + }, + "widgets_values": [ + "FLUX\\flux1-fill-dev.safetensors", + "default" + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1685.0001220703125, + 69.49121856689453 + ], + "size": [ + 210, + 46 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 112 + }, + { + "name": "vae", + "type": "VAE", + "link": 60 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "slot_index": 0, + "links": [ + 95 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "VAEDecode", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 49, + "type": "CR Latent Batch Size", + "pos": [ + 959.2691040039062, + 354.2141418457031 + ], + "size": [ + 270, + 58 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "latent", + "type": "LATENT", + "link": 110 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 111 + ] + } + ], + "properties": { + "cnr_id": "ComfyUI_Comfyroll_CustomNodes", + "ver": "d78b780ae43fcf8c6b7c6505e6ffb4584281ceca", + "Node name for S&R": "CR Latent Batch Size", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 2 + ] + }, + { + "id": 38, + "type": "InpaintModelConditioning", + "pos": [ + 916.876953125, + 124.41231536865234 + ], + "size": [ + 302.3999938964844, + 138 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "link": 80 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 81 + }, + { + "name": "vae", + "type": "VAE", + "link": 82 + }, + { + "name": "pixels", + "type": "IMAGE", + "link": 106 + }, + { + "name": "mask", + "type": "MASK", + "link": 107 + } + ], + "outputs": [ + { + "name": "positive", + "type": "CONDITIONING", + "slot_index": 0, + "links": [ + 77 + ] + }, + { + "name": "negative", + "type": "CONDITIONING", + "slot_index": 1, + "links": [ + 78 + ] + }, + { + "name": "latent", + "type": "LATENT", + "slot_index": 2, + "links": [ + 110 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "InpaintModelConditioning", + "widget_ue_connectable": {} + }, + "widgets_values": [ + false + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 1280, + 100 + ], + "size": [ + 315, + 262 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 86 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 77 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 78 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 111 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "slot_index": 0, + "links": [ + 112 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "KSampler", + "widget_ue_connectable": {} + }, + "widgets_values": [ + 858769863184862, + "randomize", + 20, + 1, + "euler", + "normal", + 1 + ] + }, + { + "id": 32, + "type": "VAELoader", + "pos": [ + 1329.6622314453125, + 479.7701416015625 + ], + "size": [ + 315, + 58 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "slot_index": 0, + "links": [ + 60, + 82 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "VAELoader", + "models": [ + { + "name": "ae.safetensors", + "url": "https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors?download=true", + "directory": "vae" + } + ], + "widget_ue_connectable": {} + }, + "widgets_values": [ + "FLUX\\ae.safetensors" + ] + }, + { + "id": 9, + "type": "SaveImage", + "pos": [ + 1936.2982177734375, + 82.75439453125 + ], + "size": [ + 828.9500122070312, + 893.8499755859375 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 95 + } + ], + "outputs": [], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "SaveImage", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 23, + "type": "CLIPTextEncode", + "pos": [ + -835.4583129882812, + 878.8148193359375 + ], + "size": [ + 311.0955810546875, + 108.43277740478516 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 62 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "slot_index": 0, + "links": [ + 41 + ] + } + ], + "title": "CLIP Text Encode (Positive Prompt)", + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.44", + "Node name for S&R": "CLIPTextEncode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + "grass" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 48, + "type": "CanvasNode", + "pos": [ + -514.2837524414062, + 543.1272583007812 + ], + "size": [ + 1862.893798828125, + 1237.79638671875 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 106 + ] + }, + { + "name": "mask", + "type": "MASK", + "links": [ + 107 + ] + } + ], + "properties": { + "cnr_id": "Comfyui-Ycanvas", + "ver": "3941104bd59dd79c19d612da1b11c05d87c2ed1c", + "Node name for S&R": "CanvasNode", + "widget_ue_connectable": {} + }, + "widgets_values": [ + false, + false, + true, + 963, + "48", + "" + ] + } + ], + "links": [ + [ + 41, + 23, + 0, + 26, + 0, + "CONDITIONING" + ], + [ + 60, + 32, + 0, + 8, + 1, + "VAE" + ], + [ + 62, + 34, + 0, + 23, + 0, + "CLIP" + ], + [ + 63, + 34, + 0, + 7, + 0, + "CLIP" + ], + [ + 77, + 38, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 78, + 38, + 1, + 3, + 2, + "CONDITIONING" + ], + [ + 80, + 26, + 0, + 38, + 0, + "CONDITIONING" + ], + [ + 81, + 7, + 0, + 38, + 1, + "CONDITIONING" + ], + [ + 82, + 32, + 0, + 38, + 2, + "VAE" + ], + [ + 85, + 31, + 0, + 39, + 0, + "MODEL" + ], + [ + 86, + 39, + 0, + 3, + 0, + "MODEL" + ], + [ + 95, + 8, + 0, + 9, + 0, + "IMAGE" + ], + [ + 106, + 48, + 0, + 38, + 3, + "IMAGE" + ], + [ + 107, + 48, + 1, + 38, + 4, + "MASK" + ], + [ + 110, + 38, + 2, + 49, + 0, + "LATENT" + ], + [ + 111, + 49, + 0, + 3, + 3, + "LATENT" + ], + [ + 112, + 3, + 0, + 8, + 0, + "LATENT" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.6588450000000008, + "offset": [ + 1318.77716124466, + -32.39290875553955 + ] + }, + "ue_links": [], + "links_added_by_ue": [], + "frontendVersion": "1.23.4", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/example_workflows/LayerForge_flux_fill_inpaint_example.png b/example_workflows/LayerForge_flux_fill_inpaint_example.png new file mode 100644 index 0000000..644624c Binary files /dev/null and b/example_workflows/LayerForge_flux_fill_inpaint_example.png differ diff --git a/example_workflows/LayerForge_test_workflow.json b/example_workflows/LayerForge_test_simple_workflow.json similarity index 75% rename from example_workflows/LayerForge_test_workflow.json rename to example_workflows/LayerForge_test_simple_workflow.json index 2122c58..d6ad6f4 100644 --- a/example_workflows/LayerForge_test_workflow.json +++ b/example_workflows/LayerForge_test_simple_workflow.json @@ -1,64 +1,144 @@ { "id": "c7ba7096-c52c-4978-8843-e87ce219b6a8", "revision": 0, - "last_node_id": 705, - "last_link_id": 1497, + "last_node_id": 707, + "last_link_id": 1499, "nodes": [ { - "id": 368, - "type": "Mask To Image (mtb)", + "id": 369, + "type": "PreviewImage", "pos": [ - -1913.9735107421875, - -3351.5126953125 + -1699.1021728515625, + -3355.60498046875 ], "size": [ - 210, - 130 + 660.91162109375, + 400.2092590332031 ], "flags": {}, - "order": 3, + "order": 6, "mode": 0, "inputs": [ { - "name": "mask", - "type": "MASK", - "link": 1496 - } - ], - "outputs": [ - { - "name": "IMAGE", + "name": "images", "type": "IMAGE", - "links": [ - 612 - ] + "link": 1499 } ], + "outputs": [], "properties": { - "cnr_id": "comfy-mtb", - "ver": "7e36007933f42c29cca270ae55e0e6866e323633", - "Node name for S&R": "Mask To Image (mtb)", + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "PreviewImage", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 606, + "type": "PreviewImage", + "pos": [ + -1911.126708984375, + -2916.072998046875 + ], + "size": [ + 551.7399291992188, + 546.8018798828125 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 1495 + } + ], + "outputs": [], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "PreviewImage", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 603, + "type": "PreviewImage", + "pos": [ + -1344.1650390625, + -2915.117919921875 + ], + "size": [ + 601.4136962890625, + 527.1531372070312 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 1236 + } + ], + "outputs": [], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "PreviewImage", + "widget_ue_connectable": {} + }, + "widgets_values": [] + }, + { + "id": 680, + "type": "SaveImage", + "pos": [ + -1025.9984130859375, + -3357.975341796875 + ], + "size": [ + 278.8309020996094, + 395.84002685546875 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 1465 + } + ], + "outputs": [], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.34", + "Node name for S&R": "SaveImage", "widget_ue_connectable": {} }, "widgets_values": [ - "#ff0000", - "#000000", - false + "ComfyUI" ] }, { "id": 442, "type": "JoinImageWithAlpha", "pos": [ - -1907.2977294921875, - -3180.562744140625 + -1902.5858154296875, + -3187.159423828125 ], "size": [ 176.86483764648438, 46 ], "flags": {}, - "order": 4, + "order": 2, "mode": 0, "inputs": [ { @@ -91,152 +171,41 @@ "widgets_values": [] }, { - "id": 369, - "type": "PreviewImage", + "id": 706, + "type": "MaskToImage", "pos": [ - -1699.1021728515625, - -3355.60498046875 + -1901.433349609375, + -3332.2021484375 ], "size": [ - 660.91162109375, - 400.2092590332031 + 184.62362670898438, + 26 ], "flags": {}, - "order": 5, + "order": 3, "mode": 0, "inputs": [ { - "name": "images", - "type": "IMAGE", - "link": 612 + "name": "mask", + "type": "MASK", + "link": 1498 } ], - "outputs": [], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.34", - "Node name for S&R": "PreviewImage", - "widget_ue_connectable": {} - }, - "widgets_values": [] - }, - { - "id": 606, - "type": "PreviewImage", - "pos": [ - -1911.126708984375, - -2916.072998046875 - ], - "size": [ - 551.7399291992188, - 546.8018798828125 - ], - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ + "outputs": [ { - "name": "images", + "name": "IMAGE", "type": "IMAGE", - "link": 1495 + "links": [ + 1499 + ] } ], - "outputs": [], "properties": { "cnr_id": "comfy-core", - "ver": "0.3.34", - "Node name for S&R": "PreviewImage", - "widget_ue_connectable": {} - }, - "widgets_values": [] - }, - { - "id": 603, - "type": "PreviewImage", - "pos": [ - -1344.1650390625, - -2915.117919921875 - ], - "size": [ - 601.4136962890625, - 527.1531372070312 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 1236 - } - ], - "outputs": [], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.34", - "Node name for S&R": "PreviewImage", - "widget_ue_connectable": {} - }, - "widgets_values": [] - }, - { - "id": 680, - "type": "SaveImage", - "pos": [ - -1025.9984130859375, - -3357.975341796875 - ], - "size": [ - 278.8309020996094, - 395.84002685546875 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 1465 - } - ], - "outputs": [], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.34", - "Node name for S&R": "SaveImage", - "widget_ue_connectable": {} - }, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 701, - "type": "MarkdownNote", - "pos": [ - -3330.08984375, - -3347.998291015625 - ], - "size": [ - 347.055419921875, - 217.8630828857422 - ], - "flags": {}, - "order": 0, - "mode": 0, - "inputs": [], - "outputs": [], - "title": "Known Issue", - "properties": { - "widget_ue_connectable": {} - }, - "widgets_values": [ - "### `node_id` not auto-filled → black output\n\nIn some cases, **ComfyUI doesn't auto-fill the `node_id`** when adding a node.\nAs a result, the node may produce a **completely black image** or not work at all.\n\n**Workaround:**\n\n* Search node ID in ComfyUI settings.\n* In NodesMap check \"Enable node ID display\"\n* Manually enter the correct `node_id` (match the ID shown in the UI).\n\nāš ļø This is a known issue and not yet fixed.\nPlease follow the steps above if your output is black or broken." - ], - "color": "#432", - "bgcolor": "#653" + "ver": "0.3.44", + "widget_ue_connectable": {}, + "Node name for S&R": "MaskToImage" + } }, { "id": 697, @@ -250,7 +219,7 @@ 980.680908203125 ], "flags": {}, - "order": 1, + "order": 0, "mode": 0, "inputs": [], "outputs": [ @@ -266,8 +235,8 @@ "name": "mask", "type": "MASK", "links": [ - 1496, - 1497 + 1497, + 1498 ] } ], @@ -279,21 +248,15 @@ }, "widgets_values": [ true, - 17, + false, + "697", + 15, "697", "" ] } ], "links": [ - [ - 612, - 368, - 0, - 369, - 0, - "IMAGE" - ], [ 1236, 442, @@ -326,14 +289,6 @@ 0, "IMAGE" ], - [ - 1496, - 697, - 1, - 368, - 0, - "MASK" - ], [ 1497, 697, @@ -341,16 +296,32 @@ 442, 1, "MASK" + ], + [ + 1498, + 697, + 1, + 706, + 0, + "MASK" + ], + [ + 1499, + 706, + 0, + 369, + 0, + "IMAGE" ] ], "groups": [], "config": {}, "extra": { "ds": { - "scale": 0.7972024500000005, + "scale": 0.9646149645000008, "offset": [ - 3957.401300495613, - 3455.1487103849176 + 3002.5649125522764, + 3543.443319064718 ] }, "ue_links": [], diff --git a/example_workflows/LayerForge_test_simple_workflow.png b/example_workflows/LayerForge_test_simple_workflow.png new file mode 100644 index 0000000..1be3b96 Binary files /dev/null and b/example_workflows/LayerForge_test_simple_workflow.png differ diff --git a/example_workflows/LayerForge_test_workflow.png b/example_workflows/LayerForge_test_workflow.png deleted file mode 100644 index d173039..0000000 Binary files a/example_workflows/LayerForge_test_workflow.png and /dev/null differ