diff --git a/README.md b/README.md index 27eb18a..9942e39 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,14 @@ BMW with multi-alpha like [supermerger](https://github.com/hako-mikan/sd-webui-s ![multi merge block weighted](./examples/workflow_mbw_multi.png) +### Latent visualization + +visualization of 4-channel latent tensor + +[workflow link](./examples/workflow_lat2image.json) + +![latent visualization](./examples/workflow_lat2image.png) + ## Node List ### Latent nodes diff --git a/examples/workflow_lat2image.json b/examples/workflow_lat2image.json new file mode 100644 index 0000000..7f2edfa --- /dev/null +++ b/examples/workflow_lat2image.json @@ -0,0 +1,586 @@ +{ + "last_node_id": 22, + "last_link_id": 25, + "nodes": [ + { + "id": 4, + "type": "VAELoader", + "pos": [ + 120, + 610 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 2, + 3 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAELoader" + }, + "widgets_values": [ + "kl-f8-anime2.ckpt" + ] + }, + { + "id": 1, + "type": "LoadImage", + "pos": [ + 30, + 50 + ], + "size": { + "0": 414.53515625, + "1": 460.7965393066406 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 1, + 17 + ], + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "example.png", + "image" + ] + }, + { + "id": 3, + "type": "VAEEncode", + "pos": [ + 520, + 50 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 1 + }, + { + "name": "vae", + "type": "VAE", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 4, + 25 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncode" + } + }, + { + "id": 5, + "type": "VAEDecode", + "pos": [ + 800, + 50 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 4 + }, + { + "name": "vae", + "type": "VAE", + "link": 3 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 6, + 18 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 22, + "type": "Reroute", + "pos": [ + 735, + 506 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 25, + "pos": [ + 37.5, + 0 + ] + } + ], + "outputs": [ + { + "name": "", + "type": "LATENT", + "links": [ + 23, + 24 + ], + "slot_index": 0 + } + ], + "properties": { + "showOutputText": false, + "horizontal": true + } + }, + { + "id": 7, + "type": "PreviewImage", + "pos": [ + 1083, + 53 + ], + "size": { + "0": 451.5751647949219, + "1": 473.7965393066406 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 6 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 19, + "type": "ImageBlend2", + "pos": [ + 1090, + -100 + ], + "size": { + "0": 315, + "1": 102 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "image1", + "type": "IMAGE", + "link": 17 + }, + { + "name": "image2", + "type": "IMAGE", + "link": 18 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 19 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageBlend2" + }, + "widgets_values": [ + 1, + "abs_diff" + ] + }, + { + "id": 20, + "type": "PreviewImage", + "pos": [ + 1560, + 60 + ], + "size": [ + 570, + 480 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 19 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 8, + "type": "PreviewImage", + "pos": [ + 1330, + 590 + ], + "size": [ + 392.3702697753906, + 351.2933349609375 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 21 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 11, + "type": "PreviewImage", + "pos": [ + 1740, + 590 + ], + "size": { + "0": 482.4051208496094, + "1": 488.45654296875 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 12 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 9, + "type": "LatentToHist", + "pos": [ + 1090, + 760 + ], + "size": { + "0": 210, + "1": 226 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 24 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 12 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LatentToHist" + }, + "widgets_values": [ + "Specified", + -3, + "Specified", + 3, + "Specified", + 50, + "Auto", + 1 + ] + }, + { + "id": 21, + "type": "ImageScale", + "pos": [ + 1090, + 590 + ], + "size": [ + 210, + 130 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 21 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageScale" + }, + "widgets_values": [ + "nearest-exact", + 512, + 512, + "disabled" + ] + }, + { + "id": 6, + "type": "LatentToImage", + "pos": [ + 840, + 590 + ], + "size": { + "0": 210, + "1": 82 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 23 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "LatentToImage" + }, + "widgets_values": [ + -3, + 3 + ] + } + ], + "links": [ + [ + 1, + 1, + 0, + 3, + 0, + "IMAGE" + ], + [ + 2, + 4, + 0, + 3, + 1, + "VAE" + ], + [ + 3, + 4, + 0, + 5, + 1, + "VAE" + ], + [ + 4, + 3, + 0, + 5, + 0, + "LATENT" + ], + [ + 6, + 5, + 0, + 7, + 0, + "IMAGE" + ], + [ + 12, + 9, + 0, + 11, + 0, + "IMAGE" + ], + [ + 17, + 1, + 0, + 19, + 0, + "IMAGE" + ], + [ + 18, + 5, + 0, + 19, + 1, + "IMAGE" + ], + [ + 19, + 19, + 0, + 20, + 0, + "IMAGE" + ], + [ + 20, + 6, + 0, + 21, + 0, + "IMAGE" + ], + [ + 21, + 21, + 0, + 8, + 0, + "IMAGE" + ], + [ + 23, + 22, + 0, + 6, + 0, + "LATENT" + ], + [ + 24, + 22, + 0, + 9, + 0, + "LATENT" + ], + [ + 25, + 3, + 0, + 22, + 0, + "*" + ] + ], + "groups": [], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/workflow_lat2image.png b/examples/workflow_lat2image.png new file mode 100644 index 0000000..01db61b Binary files /dev/null and b/examples/workflow_lat2image.png differ