From 187502ed7d710dbf0175eb9d46cfb9fe5ad3d726 Mon Sep 17 00:00:00 2001 From: gameltb Date: Fri, 1 Mar 2024 02:41:41 +0800 Subject: [PATCH] add turbo example --- README.md | 11 + ...ablesr_turbo_todo_w_UltimateSDUpscale.json | 600 +++++++++++++ examples/stablesr_turbo_todo_w_color_fix.json | 791 ++++++++++++++++++ examples/stablesr_w_color_fix.json | 2 +- 4 files changed, 1403 insertions(+), 1 deletion(-) create mode 100644 examples/stablesr_turbo_todo_w_UltimateSDUpscale.json create mode 100644 examples/stablesr_turbo_todo_w_color_fix.json diff --git a/README.md b/README.md index 19bb7ea..2bfce80 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,14 @@ Put the StableSR stablesr_768v_000139.ckpt model into Comyfui/models/checkpoints Download the ckpt from HuggingFace https://huggingface.co/Iceclear/StableSR/ There is a setup json in /examples/ to load the workflow into Comfyui + +# Turbo setting + +Reference link https://github.com/pkuliyi2015/sd-webui-stablesr/issues/57 you can significally increase speed with sd 2.1 turbo. + +Put the [sd_turbo.safetensors](https://huggingface.co/stabilityai/sd-turbo/blob/main/sd_turbo.safetensors) model into Comyfui/models/checkpoints/ +Put the stablesr_webui_sd-v2-1-512-ema-000117.ckpt in [webui_512v_models.zip](https://huggingface.co/Iceclear/StableSR/blob/main/webui_512v_models.zip) into Comyfui/models/stablesr/ + +Yon can try turbo workflow in /examples/. + +The example uses https://github.com/ethansmith2000/comfy-todo node for faster speeds. diff --git a/examples/stablesr_turbo_todo_w_UltimateSDUpscale.json b/examples/stablesr_turbo_todo_w_UltimateSDUpscale.json new file mode 100644 index 0000000..96baf4f --- /dev/null +++ b/examples/stablesr_turbo_todo_w_UltimateSDUpscale.json @@ -0,0 +1,600 @@ +{ + "last_node_id": 44, + "last_link_id": 102, + "nodes": [ + { + "id": 34, + "type": "StableSRColorFix", + "pos": [ + 1034, + 9 + ], + "size": { + "0": 315, + "1": 78 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 88 + }, + { + "name": "color_map_image", + "type": "IMAGE", + "link": 82 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 74 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "StableSRColorFix" + }, + "widgets_values": [ + "Wavelet" + ] + }, + { + "id": 35, + "type": "PreviewImage", + "pos": [ + 1001, + 141 + ], + "size": { + "0": 423.5451965332031, + "1": 530.3379516601562 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 74 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 29, + "type": "ImageScaleBy", + "pos": [ + 639, + -41 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 54 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 82, + 87 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageScaleBy" + }, + "widgets_values": [ + "lanczos", + 2 + ] + }, + { + "id": 12, + "type": "LoadImage", + "pos": [ + 109, + -356 + ], + "size": { + "0": 453.4217529296875, + "1": 469.52587890625 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 54 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "example_lowres.png", + "image" + ] + }, + { + "id": 15, + "type": "CLIPTextEncode", + "pos": [ + 164, + 846 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 22 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 92 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "3d, cartoon, anime, sketches, (worst quality), (low quality)" + ] + }, + { + "id": 31, + "type": "ApplyStableSRUpscaler", + "pos": [ + 120, + 160 + ], + "size": [ + 437.2647460937501, + 105.51814575195317 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 63 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": null + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 100 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ApplyStableSRUpscaler" + }, + "widgets_values": [ + "stablesr_webui_sd-v2-1-512-ema-000117.ckpt" + ] + }, + { + "id": 14, + "type": "CLIPTextEncode", + "pos": [ + 163, + 590 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 19 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 93 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(masterpiece), (best quality), (realistic),(very clear)" + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + -315, + 424 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 63 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 19, + 22 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 94 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "sd_turbo.safetensors" + ] + }, + { + "id": 43, + "type": "ModelSamplingDiscrete", + "pos": [ + 187, + 313 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 100 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 101 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ModelSamplingDiscrete" + }, + "widgets_values": [ + "lcm", + false + ] + }, + { + "id": 44, + "type": "ToDoPatchModel", + "pos": [ + 188, + 451 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 101 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 102 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ToDoPatchModel" + }, + "widgets_values": [ + 2, + 1 + ] + }, + { + "id": 39, + "type": "UltimateSDUpscaleNoUpscale", + "pos": [ + 645, + 111 + ], + "size": { + "0": 315, + "1": 570 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "upscaled_image", + "type": "IMAGE", + "link": 87 + }, + { + "name": "model", + "type": "MODEL", + "link": 102 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 93 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 92 + }, + { + "name": "vae", + "type": "VAE", + "link": 94 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 88 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "UltimateSDUpscaleNoUpscale" + }, + "widgets_values": [ + 999736751376351, + "randomize", + 4, + 1, + "lcm", + "sgm_uniform", + 1, + "Linear", + 704, + 704, + 32, + 32, + "None", + 1, + 64, + 8, + 16, + true, + false + ] + } + ], + "links": [ + [ + 19, + 4, + 1, + 14, + 0, + "CLIP" + ], + [ + 22, + 4, + 1, + 15, + 0, + "CLIP" + ], + [ + 54, + 12, + 0, + 29, + 0, + "IMAGE" + ], + [ + 63, + 4, + 0, + 31, + 0, + "MODEL" + ], + [ + 74, + 34, + 0, + 35, + 0, + "IMAGE" + ], + [ + 82, + 29, + 0, + 34, + 1, + "IMAGE" + ], + [ + 87, + 29, + 0, + 39, + 0, + "IMAGE" + ], + [ + 88, + 39, + 0, + 34, + 0, + "IMAGE" + ], + [ + 92, + 15, + 0, + 39, + 3, + "CONDITIONING" + ], + [ + 93, + 14, + 0, + 39, + 2, + "CONDITIONING" + ], + [ + 94, + 4, + 2, + 39, + 4, + "VAE" + ], + [ + 100, + 31, + 0, + 43, + 0, + "MODEL" + ], + [ + 101, + 43, + 0, + 44, + 0, + "MODEL" + ], + [ + 102, + 44, + 0, + 39, + 1, + "MODEL" + ] + ], + "groups": [], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/stablesr_turbo_todo_w_color_fix.json b/examples/stablesr_turbo_todo_w_color_fix.json new file mode 100644 index 0000000..6a5aa92 --- /dev/null +++ b/examples/stablesr_turbo_todo_w_color_fix.json @@ -0,0 +1,791 @@ +{ + "last_node_id": 38, + "last_link_id": 79, + "nodes": [ + { + "id": 26, + "type": "PreviewImage", + "pos": [ + 1247, + 498 + ], + "size": { + "0": 426.760009765625, + "1": 541.3356323242188 + }, + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 41 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 35, + "type": "PreviewImage", + "pos": [ + 1740, + 502 + ], + "size": { + "0": 423.5451965332031, + "1": 530.3379516601562 + }, + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 74 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 13, + "type": "VAEEncode", + "pos": [ + 39, + 14 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 56 + }, + { + "name": "vae", + "type": "VAE", + "link": 15 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 67, + 68, + 70 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEEncode" + } + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + -345, + 303 + ], + "size": { + "0": 315, + "1": 98 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 63 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 19, + 22 + ], + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 8, + 15, + 71 + ], + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "sd_turbo.safetensors" + ] + }, + { + "id": 31, + "type": "ApplyStableSRUpscaler", + "pos": [ + 264, + 116 + ], + "size": [ + 445.666748046875, + 107.66665649414062 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 63 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 67 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 76 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ApplyStableSRUpscaler" + }, + "widgets_values": [ + "stablesr_webui_sd-v2-1-512-ema-000117.ckpt" + ] + }, + { + "id": 15, + "type": "CLIPTextEncode", + "pos": [ + 302, + 587 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 22 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 66 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "3d, cartoon, anime, sketches, (worst quality), (low quality)" + ] + }, + { + "id": 14, + "type": "CLIPTextEncode", + "pos": [ + 299, + 326 + ], + "size": { + "0": 400, + "1": 200 + }, + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 19 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 65 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(masterpiece), (best quality), (realistic),(very clear)" + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1481, + 182 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 60 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 41, + 73 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 33, + "type": "VAEDecode", + "pos": [ + 1488, + 74 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 70 + }, + { + "name": "vae", + "type": "VAE", + "link": 71 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 72 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 34, + "type": "StableSRColorFix", + "pos": [ + 1740, + 116 + ], + "size": { + "0": 315, + "1": 78 + }, + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 73 + }, + { + "name": "color_map_image", + "type": "IMAGE", + "link": 72 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 74 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "StableSRColorFix" + }, + "widgets_values": [ + "Wavelet" + ] + }, + { + "id": 30, + "type": "KSampler", + "pos": [ + 1123, + -1 + ], + "size": { + "0": 315, + "1": 262 + }, + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 79 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 65 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 66 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 68, + "slot_index": 3 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 60 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 893951289664650, + "randomize", + 4, + 1, + "lcm", + "sgm_uniform", + 1 + ] + }, + { + "id": 37, + "type": "ToDoPatchModel", + "pos": [ + 712, + -44 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 76 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 78 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ToDoPatchModel" + }, + "widgets_values": [ + 2, + 1 + ] + }, + { + "id": 38, + "type": "ModelSamplingDiscrete", + "pos": [ + 709, + -174 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 78 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 79 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ModelSamplingDiscrete" + }, + "widgets_values": [ + "lcm", + false + ] + }, + { + "id": 12, + "type": "LoadImage", + "pos": [ + -923, + -53 + ], + "size": { + "0": 453.4217529296875, + "1": 469.52587890625 + }, + "flags": {}, + "order": 1, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 54 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "example_lowres.png", + "image" + ] + }, + { + "id": 29, + "type": "ImageScaleBy", + "pos": [ + -367, + -15 + ], + "size": { + "0": 315, + "1": 82 + }, + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 54 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 56 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageScaleBy" + }, + "widgets_values": [ + "lanczos", + 2 + ] + } + ], + "links": [ + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 15, + 4, + 2, + 13, + 1, + "VAE" + ], + [ + 19, + 4, + 1, + 14, + 0, + "CLIP" + ], + [ + 22, + 4, + 1, + 15, + 0, + "CLIP" + ], + [ + 41, + 8, + 0, + 26, + 0, + "IMAGE" + ], + [ + 54, + 12, + 0, + 29, + 0, + "IMAGE" + ], + [ + 56, + 29, + 0, + 13, + 0, + "IMAGE" + ], + [ + 60, + 30, + 0, + 8, + 0, + "LATENT" + ], + [ + 63, + 4, + 0, + 31, + 0, + "MODEL" + ], + [ + 65, + 14, + 0, + 30, + 1, + "CONDITIONING" + ], + [ + 66, + 15, + 0, + 30, + 2, + "CONDITIONING" + ], + [ + 67, + 13, + 0, + 31, + 1, + "LATENT" + ], + [ + 68, + 13, + 0, + 30, + 3, + "LATENT" + ], + [ + 70, + 13, + 0, + 33, + 0, + "LATENT" + ], + [ + 71, + 4, + 2, + 33, + 1, + "VAE" + ], + [ + 72, + 33, + 0, + 34, + 1, + "IMAGE" + ], + [ + 73, + 8, + 0, + 34, + 0, + "IMAGE" + ], + [ + 74, + 34, + 0, + 35, + 0, + "IMAGE" + ], + [ + 76, + 31, + 0, + 37, + 0, + "MODEL" + ], + [ + 78, + 37, + 0, + 38, + 0, + "MODEL" + ], + [ + 79, + 38, + 0, + 30, + 0, + "MODEL" + ] + ], + "groups": [], + "config": {}, + "extra": {}, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/stablesr_w_color_fix.json b/examples/stablesr_w_color_fix.json index 5714297..6a885f0 100644 --- a/examples/stablesr_w_color_fix.json +++ b/examples/stablesr_w_color_fix.json @@ -530,7 +530,7 @@ "Node name for S&R": "LoadImage" }, "widgets_values": [ - "1111.jpg", + "example_lowres.png", "image" ] }