diff --git a/.gitignore b/.gitignore index c18dd8d..e727b2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__/ +https/ \ No newline at end of file diff --git a/README.md b/README.md index 3301f11..d6ea7b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ## In progress. !! +![screenshare](./assets/screenshare.png) + ### ScreenShareNode & FloatingVideoNode > Now comfyui supports capturing screen pixel streams from any software and can be used for LCM-Lora integration. Let's get started with implementation and design! 💻🌐 @@ -11,28 +13,39 @@ https://github.com/shadowcz007/comfyui-mixlab-nodes/assets/12645064/e7e77f90-e43 [ScreenShareNode & FloatingVideoNode](./workflow/3-FloatVideo-workflow.json) +!! Please use the address with HTTPS (https://127.0.0.1). ## Installation -For the easiest install experience, install the [Comfyui Manager](https://github.com/ltdrdata/ComfyUI-Manager) and use that to automate the installation process. -Otherwise, to manually install, simply clone the repo into the custom_nodes directory with this command: +manually install, simply clone the repo into the custom_nodes directory with this command: + ``` +cd ComfyUI/custom_nodes + git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git -``` -and install the requirements using: -``` -.\python_embeded\python.exe -s -m pip install -r requirements.txt -``` -If you are using a venv, make sure you have it activated before installation and use: -``` -pip install -r requirements.txt + ``` -Run directly: +Install the requirements: + +run directly: ``` +cd ComfyUI_Mixlab install.bat ``` +or install the requirements using: +``` +../../../python_embeded/python.exe -s -m pip install -r requirements.txt +``` + +If you are using a venv, make sure you have it activated before installation and use: +``` +pip3 install -r requirements.txt +``` + + + ## Nodes ![main](./assets/all.png) @@ -65,7 +78,7 @@ Add edges to an image. ### Models -下载[CLIPSeg](https://huggingface.co/CIDAS/clipseg-rd64-refined/tree/main)到 model/clipseg +[Download CLIPSeg](https://huggingface.co/CIDAS/clipseg-rd64-refined/tree/main), move to : model/clipseg diff --git a/__init__.py b/__init__.py index ee7288c..dfe2189 100644 --- a/__init__.py +++ b/__init__.py @@ -7,6 +7,98 @@ import sys python = sys.executable +from server import PromptServer +try: + import aiohttp + from aiohttp import web +except ImportError: + print("Module 'aiohttp' not installed. Please install it via:") + print("pip install aiohttp") + print("or") + print("pip install -r requirements.txt") + sys.exit() + + +def create_key(key_p,crt_p): + import OpenSSL + # 生成自签名证书 + # 生成私钥 + private_key = OpenSSL.crypto.PKey() + private_key.generate_key(OpenSSL.crypto.TYPE_RSA, 2048) + + # 生成CSR + csr = OpenSSL.crypto.X509Req() + csr.get_subject().CN = "mixlab.com" # 设置证书的通用名称 + csr.set_pubkey(private_key) + csr.sign(private_key, "sha256") + # 生成证书 + certificate = OpenSSL.crypto.X509() + certificate.set_serial_number(1) + certificate.gmtime_adj_notBefore(0) + certificate.gmtime_adj_notAfter(365 * 24 * 60 * 60) # 设置证书的有效期 + certificate.set_issuer(csr.get_subject()) + certificate.set_subject(csr.get_subject()) + certificate.set_pubkey(csr.get_pubkey()) + certificate.sign(private_key, "sha256") + # 保存私钥到文件 + with open(key_p, "wb") as f: + f.write(OpenSSL.crypto.dump_privatekey(OpenSSL.crypto.FILETYPE_PEM, private_key)) + + # 保存证书到文件 + with open(crt_p, "wb") as f: + f.write(OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, certificate)) + return + +def create_for_https(): + current_path = os.path.abspath(os.path.dirname(__file__)) + # print("#####path::", current_path) + + # TODO 处理路径 + https_key_path=os.path.join(current_path, "https") + crt=os.path.join(https_key_path, "certificate.crt") + key=os.path.join(https_key_path, "private.key") + print("##https_key_path", crt,key) + if not os.path.exists(https_key_path): + # 使用mkdir()方法创建新目录 + os.mkdir(https_key_path) + if not os.path.exists(crt): + create_key(key,crt) + return (crt,key) + + +# https +async def new_start(self, address, port, verbose=True, call_on_start=None): + runner = web.AppRunner(self.app, access_log=None) + await runner.setup() + site = web.TCPSite(runner, address, port) + await site.start() + + import ssl + crt,key=create_for_https() + ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) + ssl_context.load_cert_chain(crt,key) + site2 = web.TCPSite(runner, address, 443,ssl_context=ssl_context) + await site2.start() + + if address == '': + address = '0.0.0.0' + if verbose: + print("Starting server\n") + print("To see the GUI go to: http://{}:{}".format(address, port)) + print("To see the GUI go to: https://{}".format(address)) + if call_on_start is not None: + call_on_start(address, port) + + # import webbrowser + # if os.name == 'nt' and address == '0.0.0.0': + # address = '127.0.0.1' + # webbrowser.open(f"https://{address}") + # webbrowser.open(f"http://{address}:{port}") + + +PromptServer.start=new_start + + def is_installed(package, package_overwrite=None): try: spec = importlib.util.find_spec(package) diff --git a/assets/https1.png b/assets/https1.png new file mode 100644 index 0000000..3f7cec1 Binary files /dev/null and b/assets/https1.png differ diff --git a/assets/screenshare.png b/assets/screenshare.png new file mode 100644 index 0000000..08027ca Binary files /dev/null and b/assets/screenshare.png differ diff --git a/nodes/ScreenShareNode.py b/nodes/ScreenShareNode.py index b64a5a2..8b3015c 100644 --- a/nodes/ScreenShareNode.py +++ b/nodes/ScreenShareNode.py @@ -104,5 +104,5 @@ class FloatingVideo: results.append(image_base64) - return { "ui": { "images": results } } + return { "ui": { "images_": results } } diff --git a/requirements.txt b/requirements.txt index 24ce15a..4434857 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ numpy +pyOpenSSL diff --git a/web/javascript/main.js b/web/javascript/main.js index 2ee0713..edd268f 100644 --- a/web/javascript/main.js +++ b/web/javascript/main.js @@ -3,9 +3,9 @@ import { api } from '../../../scripts/api.js' import { ComfyWidgets } from '../../../scripts/widgets.js' import { $el } from '../../../scripts/ui.js' -let api_host = '127.0.0.1:8188' +let api_host = `127.0.0.1:${window.location.port}` let api_base = '' -let url = `http://${api_host}${api_base}` +let url = `${window.location.protocol}//${api_host}${api_base}` async function getQueue () { try { @@ -467,14 +467,6 @@ app.registerExtension({ } else { window._mixlab_stopLive = await startLive(widget.liveBtn) console.log('window._mixlab_stopLive', window._mixlab_stopLive) - - var node = this.graph._nodes.filter(n => n.type == 'ScreenShare')[0] // for you to look it up like this - var w = node?.widgets.find(w => w.name === 'prompt') // and then it's just the same - console.log('####node?.widgets', node?.widgets) - if (w) { - w.value = 'a girl' - node.onResize?.(node.size) - } } }) @@ -654,6 +646,10 @@ app.registerExtension({ // widget.card.appendChild(widget.PictureInPicture) widget.PictureInPicture.addEventListener('click', async () => { + if (window.location.protocol != 'https:') { + window.alert('About to redirect to HTTPS access.https://127.0.0.1') + window.open('https://127.0.0.1') + } // Open a Picture-in-Picture window. let w = 360, s = widget.preview.videoWidth / widget.preview.videoHeight, @@ -667,30 +663,113 @@ app.registerExtension({ overflow: hidden; background: #2a2c34; border: 4px solid #878787; - outline: none;` + outline: none;background: black;` + + let div = document.createElement('div') + div.style = `display:flex;position: fixed; + bottom: 0px; + z-index: 9999; + left: 0px; + width: calc(100% - 24px); + margin: 12px;` + // console.log(pipWindow.document) // Move the player to the Picture-in-Picture window. let input = document.createElement('textarea') - input.style = `width: 100%; - margin: 12px; - background: rgb(249, 249, 249); - color: black; - font-size: 16px; + input.style = ` + min-width:90%; + max-width:100%; + background: #24283db3; + color: white; + font-size: 14px; padding: 8px; - font-weight: 800; + font-weight: 300; letter-spacing: 1px; + outline: none; + min-height: 98px; border-radius: 8px; - border: 1px solid rgb(221, 221, 221); - box-shadow: rgb(228, 228, 228) 1px 3px` + border: 1px solid rgb(91, 91, 91); + font-family: sans-serif; + ` + + window._mixlab_screen_prompt = + window._mixlab_screen_prompt || + 'beautiful scenery nature glass bottle landscape,under water' + input.value = window._mixlab_screen_prompt + + let btnDiv = document.createElement('div') + + btnDiv.style = `cursor: pointer; + display: flex; + flex-direction: column; + justify-content: start; + align-items: center; + width: 24px; + font-size: 16px; + margin-right: 6px;` + + let btn = document.createElement('butotn') + btn.innerText = '❤' + btn.style = `cursor: pointer;height: 24px;margin:4px; + color: red;` + btn.addEventListener('click', () => { + if (input.style.display == 'none') { + input.style.display = 'block' + } else { + input.style.display = 'none' + } + }) + + let pauseBtn = document.createElement('butotn') + pauseBtn.innerText = '⏸' + pauseBtn.style = `cursor: pointer;height: 24px;margin:4px; + color: #03A9F4;` + + pauseBtn.addEventListener('click', async () => { + if (window._mixlab_stopLive) { + pauseBtn.innerText = '▶' + + window._mixlab_stopLive() + window._mixlab_stopLive = null + + let node = this.graph._nodes.filter( + n => n.type === 'ScreenShare' + )[0] + + var w = node.widgets?.filter(w => w.name === 'sreen_share')[0] // see if it already exists + if (w) { + w.liveBtn.innerText = 'Live Run' + } + } else { + pauseBtn.innerText = '⏸' + let node = this.graph._nodes.filter( + n => n.type === 'ScreenShare' + )[0] + var w = node.widgets?.filter(w => w.name === 'sreen_share')[0] // see if it already exists + if (w) { + w.liveBtn.innerText = 'Stop Live' + window._mixlab_stopLive = await startLive(w.liveBtn) + console.log('window._mixlab_stopLive', window._mixlab_stopLive) + } + } + }) + pipWindow.document.body.append(widget.preview) - pipWindow.document.body.append(input) + pipWindow.document.body.append(div) + + div.appendChild(btnDiv) + btnDiv.appendChild(btn) + btnDiv.appendChild(pauseBtn) + div.appendChild(input) + input.addEventListener('input', () => { window._mixlab_screen_prompt = input.value }) // Move the player back when the Picture-in-Picture window closes. pipWindow.addEventListener('pagehide', event => { widget.card.appendChild(widget.preview) - pipWindow.remove() + // pipWindow.remove() + pipWindow.close() }) }) @@ -749,8 +828,8 @@ app.registerExtension({ const context = canvas.getContext('2d') - if (message?.images) { - const base64 = message.images[0] + if (message?.images_) { + const base64 = message.images_[0] const image = new Image() image.onload = function () { canvas.width = image.width @@ -762,7 +841,7 @@ app.registerExtension({ } const onRemoved = this.onRemoved this.onRemoved = () => { - cleanupNode(this) + // cleanupNode(this) return onRemoved?.() } } diff --git a/workflow/1-workflow.json b/workflow/1-workflow.json index b40ae91..cb85f11 100644 --- a/workflow/1-workflow.json +++ b/workflow/1-workflow.json @@ -1,6 +1,6 @@ { - "last_node_id": 38, - "last_link_id": 52, + "last_node_id": 40, + "last_link_id": 60, "nodes": [ { "id": 4, @@ -284,93 +284,6 @@ "horizontal": false } }, - { - "id": 14, - "type": "VAEDecode", - "pos": [ - 2277.0850690937427, - -468.5410711699221 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": { - "collapsed": false - }, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 18 - }, - { - "name": "vae", - "type": "VAE", - "link": 19 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 20, - 21, - 47 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 36, - "type": "ImagesCrop", - "pos": [ - 3217, - 81 - ], - "size": { - "0": 315, - "1": 154 - }, - "flags": {}, - "order": 22, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 49 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 50 - ], - "shape": 6, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ImagesCrop" - }, - "widgets_values": [ - 512, - 512, - 0, - 0, - "enable" - ] - }, { "id": 22, "type": "PrimitiveNode", @@ -457,84 +370,6 @@ "Node name for S&R": "PreviewImage" } }, - { - "id": 35, - "type": "TransparentImage", - "pos": [ - 2848, - 184 - ], - "size": { - "0": 315, - "1": 338 - }, - "flags": {}, - "order": 20, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 47 - }, - { - "name": "masks", - "type": "MASK", - "link": 46 - } - ], - "outputs": [ - { - "name": "STRING", - "type": "STRING", - "links": null, - "shape": 6 - }, - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 49 - ], - "shape": 6, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "TransparentImage" - }, - "widgets_values": [ - "no", - "yes", - "Mixlab_save" - ] - }, - { - "id": 31, - "type": "PreviewImage", - "pos": [ - 3603, - 87 - ], - "size": { - "0": 210, - "1": 246 - }, - "flags": {}, - "order": 23, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 50, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "PreviewImage" - } - }, { "id": 2, "type": "SAMLoader", @@ -915,7 +750,7 @@ 60 ], "size": { - "0": 210, + "0": 243.60000610351562, "1": 26 }, "flags": {}, @@ -942,6 +777,178 @@ "properties": { "Node name for S&R": "InvertMask (segment anything)" } + }, + { + "id": 40, + "type": "ImageCropByAlpha", + "pos": [ + 3365, + -68 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": {}, + "order": 22, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 60 + }, + { + "name": "RGBA", + "type": "RGBA", + "link": 56 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 57 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ImageCropByAlpha" + } + }, + { + "id": 14, + "type": "VAEDecode", + "pos": [ + 2277.0850690937427, + -468.5410711699221 + ], + "size": { + "0": 210, + "1": 46 + }, + "flags": { + "collapsed": false + }, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 18 + }, + { + "name": "vae", + "type": "VAE", + "link": 19 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20, + 21, + 47 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 31, + "type": "PreviewImage", + "pos": [ + 3667, + -93 + ], + "size": { + "0": 210, + "1": 246 + }, + "flags": {}, + "order": 23, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 57, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "PreviewImage" + } + }, + { + "id": 35, + "type": "TransparentImage", + "pos": [ + 2943, + -54 + ], + "size": [ + 315, + 358 + ], + "flags": {}, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 47 + }, + { + "name": "masks", + "type": "MASK", + "link": 46 + } + ], + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": null, + "shape": 6 + }, + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 60 + ], + "shape": 6, + "slot_index": 1 + }, + { + "name": "RGBA", + "type": "RGBA", + "links": [ + 56 + ], + "shape": 6, + "slot_index": 2 + } + ], + "properties": { + "Node name for S&R": "TransparentImage" + }, + "widgets_values": [ + "no", + "yes", + "Mixlab_save" + ] } ], "links": [ @@ -1137,22 +1144,6 @@ 0, "IMAGE" ], - [ - 49, - 35, - 1, - 36, - 0, - "IMAGE" - ], - [ - 50, - 36, - 0, - 31, - 0, - "IMAGE" - ], [ 51, 3, @@ -1168,6 +1159,30 @@ 16, 0, "MASK" + ], + [ + 56, + 35, + 2, + 40, + 1, + "RGBA" + ], + [ + 57, + 40, + 0, + 31, + 0, + "IMAGE" + ], + [ + 60, + 35, + 1, + 40, + 0, + "IMAGE" ] ], "groups": [], diff --git a/workflow/2-screeshare.json b/workflow/2-screeshare.json index 2569f18..0f9a8de 100644 --- a/workflow/2-screeshare.json +++ b/workflow/2-screeshare.json @@ -1,6 +1,6 @@ { - "last_node_id": 25, - "last_link_id": 27, + "last_node_id": 28, + "last_link_id": 30, "nodes": [ { "id": 7, @@ -14,7 +14,7 @@ "1": 180.6060791015625 }, "flags": {}, - "order": 7, + "order": 8, "mode": 0, "inputs": [ { @@ -52,7 +52,7 @@ "1": 98 }, "flags": {}, - "order": 9, + "order": 10, "mode": 0, "inputs": [ { @@ -103,7 +103,7 @@ "1": 164.31304931640625 }, "flags": {}, - "order": 6, + "order": 7, "mode": 0, "inputs": [ { @@ -245,7 +245,7 @@ "1": 58.083831787109375 }, "flags": {}, - "order": 5, + "order": 6, "mode": 0, "inputs": [ { @@ -272,41 +272,6 @@ "control_v11f1p_sd15_depth.pth" ] }, - { - "id": 24, - "type": "ScreenShare", - "pos": [ - -399, - 472 - ], - "size": { - "0": 315, - "1": 202 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 25 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "ScreenShare" - } - }, { "id": 5, "type": "EmptyLatentImage", @@ -319,7 +284,7 @@ "1": 106 }, "flags": {}, - "order": 2, + "order": 1, "mode": 0, "outputs": [ { @@ -358,7 +323,7 @@ { "name": "image", "type": "IMAGE", - "link": 25 + "link": 29 } ], "outputs": [ @@ -383,46 +348,6 @@ 512 ] }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1100, - -241 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 17 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, { "id": 3, "type": "KSampler", @@ -435,7 +360,7 @@ "1": 262 }, "flags": {}, - "order": 10, + "order": 11, "mode": 0, "inputs": [ { @@ -484,24 +409,131 @@ ] }, { - "id": 16, - "type": "PreviewImage", + "id": 8, + "type": "VAEDecode", "pos": [ - 1513, - -320 + 1100, + -241 ], "size": { - "0": 578.1627807617188, - "1": 544.9364013671875 + "0": 210, + "1": 46 }, "flags": {}, "order": 12, "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 28 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 26, + "type": "FloatingVideo", + "pos": [ + 1689, + -484 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 13, + "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", - "link": 17 + "link": 28 + } + ], + "properties": { + "Node name for S&R": "FloatingVideo" + } + }, + { + "id": 27, + "type": "ScreenShare", + "pos": [ + -387, + 454 + ], + "size": { + "0": 315, + "1": 154 + }, + "flags": {}, + "order": 2, + "mode": 0, + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 29, + 30 + ], + "shape": 3, + "slot_index": 0 + }, + { + "name": "MASK", + "type": "MASK", + "links": null, + "shape": 3 + }, + { + "name": "STRING", + "type": "STRING", + "links": null, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "ScreenShare" + } + }, + { + "id": 28, + "type": "PreviewImage", + "pos": [ + -393, + 975 + ], + "size": [ + 210, + 246 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 30 } ], "properties": { @@ -512,15 +544,15 @@ "id": 20, "type": "PreviewImage", "pos": [ - 1521, - 277 + 492, + 955 ], "size": { "0": 526.9624633789062, "1": 367.3833923339844 }, "flags": {}, - "order": 8, + "order": 9, "mode": 0, "inputs": [ { @@ -607,14 +639,6 @@ 0, "CLIP" ], - [ - 17, - 8, - 0, - 16, - 0, - "IMAGE" - ], [ 18, 19, @@ -647,14 +671,6 @@ 0, "MODEL" ], - [ - 25, - 24, - 0, - 25, - 0, - "IMAGE" - ], [ 26, 25, @@ -670,6 +686,30 @@ 20, 0, "IMAGE" + ], + [ + 28, + 8, + 0, + 26, + 0, + "IMAGE" + ], + [ + 29, + 27, + 0, + 25, + 0, + "IMAGE" + ], + [ + 30, + 27, + 0, + 28, + 0, + "IMAGE" ] ], "groups": [], diff --git a/workflow/3-FloatVideo-workflow.json b/workflow/3-FloatVideo-workflow.json index 092641e..22d8a26 100644 --- a/workflow/3-FloatVideo-workflow.json +++ b/workflow/3-FloatVideo-workflow.json @@ -1,99 +1,26 @@ { - "last_node_id": 27, - "last_link_id": 34, + "last_node_id": 21, + "last_link_id": 45, "nodes": [ - { - "id": 12, - "type": "PreviewImage", - "pos": [ - 254, - 784 - ], - "size": { - "0": 302.2487487792969, - "1": 246 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 32 - } - ], - "properties": { - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - -142, - 400 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 11 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 5, - 21 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "deliberate_v2.safetensors" - ] - }, { "id": 7, "type": "CLIPTextEncode", "pos": [ - 413, - 389 + 495, + 307 ], "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 + "0": 400, + "1": 200 }, "flags": {}, - "order": 4, + "order": 7, "mode": 0, "inputs": [ { "name": "clip", "type": "CLIP", - "link": 5 + "link": 33 } ], "outputs": [ @@ -101,8 +28,9 @@ "name": "CONDITIONING", "type": "CONDITIONING", "links": [ - 6 + 29 ], + "shape": 3, "slot_index": 0 } ], @@ -110,39 +38,77 @@ "Node name for S&R": "CLIPTextEncode" }, "widgets_values": [ - "text, watermark" + "" ] }, { - "id": 15, - "type": "ControlNetApply", + "id": 11, + "type": "VAEDecode", "pos": [ - 911, - 1258 + 1643, + 295 ], "size": { - "0": 317.4000244140625, - "1": 98 + "0": 210, + "1": 46 }, "flags": {}, - "order": 10, + "order": 11, "mode": 0, "inputs": [ { - "name": "conditioning", - "type": "CONDITIONING", - "link": 17 + "name": "samples", + "type": "LATENT", + "link": 35 }, { - "name": "control_net", - "type": "CONTROL_NET", - "link": 13, - "slot_index": 1 - }, + "name": "vae", + "type": "VAE", + "link": 34 + } + ], + "outputs": [ { - "name": "image", + "name": "IMAGE", "type": "IMAGE", - "link": 24 + "links": [ + 41 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + } + }, + { + "id": 8, + "type": "CLIPTextEncode", + "pos": [ + 504, + 33 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 32 + }, + { + "name": "text", + "type": "STRING", + "link": 43, + "widget": { + "name": "text" + } } ], "outputs": [ @@ -150,7 +116,88 @@ "name": "CONDITIONING", "type": "CONDITIONING", "links": [ - 16 + 39 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "" + ] + }, + { + "id": 16, + "type": "ControlNetLoader", + "pos": [ + 691, + 894 + ], + "size": { + "0": 315, + "1": 58 + }, + "flags": {}, + "order": 0, + "mode": 0, + "outputs": [ + { + "name": "CONTROL_NET", + "type": "CONTROL_NET", + "links": [ + 38 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "ControlNetLoader" + }, + "widgets_values": [ + "control_scribble-fp16.safetensors" + ] + }, + { + "id": 15, + "type": "ControlNetApply", + "pos": [ + 1047, + 820 + ], + "size": { + "0": 317.4000244140625, + "1": 98 + }, + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "conditioning", + "type": "CONDITIONING", + "link": 39 + }, + { + "name": "control_net", + "type": "CONTROL_NET", + "link": 38 + }, + { + "name": "image", + "type": "IMAGE", + "link": 27 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 40 ], "shape": 3, "slot_index": 0 @@ -164,55 +211,118 @@ ] }, { - "id": 16, - "type": "ControlNetLoader", + "id": 9, + "type": "EmptyLatentImage", "pos": [ - 426.6237370605468, - 1289.9310788574217 + 845, + 577 ], "size": { - "0": 391.38134765625, - "1": 60.375152587890625 + "0": 315, + "1": 106 }, "flags": {}, "order": 1, "mode": 0, "outputs": [ { - "name": "CONTROL_NET", - "type": "CONTROL_NET", + "name": "LATENT", + "type": "LATENT", "links": [ - 13 + 30 ], - "shape": 3 + "shape": 3, + "slot_index": 0 } ], "properties": { - "Node name for S&R": "ControlNetLoader" + "Node name for S&R": "EmptyLatentImage" }, "widgets_values": [ - "control_scribble-fp16.safetensors" + 512, + 512, + 1 ] }, { - "id": 20, - "type": "PreviewImage", + "id": 5, + "type": "KSampler", "pos": [ - 835.7129225297407, - 1469.574795809659 + 1267, + 277 ], "size": { - "0": 210, - "1": 246 + "0": 315, + "1": 262 }, "flags": {}, - "order": 9, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 44 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 40 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 29 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 30 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 35 + ], + "shape": 3, + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 613900833686415, + "randomize", + 4, + 1.6, + "lcm", + "karras", + 1 + ] + }, + { + "id": 2, + "type": "PreviewImage", + "pos": [ + 338, + 786 + ], + "size": [ + 210, + 246 + ], + "flags": {}, + "order": 4, "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", - "link": 23 + "link": 37 } ], "properties": { @@ -220,56 +330,15 @@ } }, { - "id": 18, - "type": "Scribble_XDoG_Preprocessor", - "pos": [ - 442, - 1421 - ], - "size": { - "0": 315, - "1": 82 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 33 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 23, - 24 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Scribble_XDoG_Preprocessor" - }, - "widgets_values": [ - 32, - 512 - ] - }, - { - "id": 27, + "id": 19, "type": "ScreenShare", "pos": [ - -188.69206556640614, - 912.8551921972658 + -55, + 512 ], "size": { - "0": 315, - "1": 202 + "0": 325.3117370605469, + "1": 459.7692565917969 }, "flags": {}, "order": 2, @@ -279,8 +348,8 @@ "name": "IMAGE", "type": "IMAGE", "links": [ - 32, - 33 + 37, + 42 ], "shape": 3, "slot_index": 0 @@ -290,6 +359,15 @@ "type": "MASK", "links": null, "shape": 3 + }, + { + "name": "STRING", + "type": "STRING", + "links": [ + 43 + ], + "shape": 3, + "slot_index": 2 } ], "properties": { @@ -297,87 +375,54 @@ } }, { - "id": 5, - "type": "EmptyLatentImage", + "id": 20, + "type": "FloatingVideo", "pos": [ - 473, - 609 + 2041, + 277 + ], + "size": [ + 315, + 106 ], - "size": { - "0": 315, - "1": 106 - }, "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 440, - 640, - 1 - ] - }, - { - "id": 17, - "type": "PreviewImage", - "pos": [ - 1674, - 502 - ], - "size": { - "0": 442.3127746582031, - "1": 507.9258117675781 - }, - "flags": {}, - "order": 13, + "order": 12, "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", - "link": 18 + "link": 41 } ], "properties": { - "Node name for S&R": "PreviewImage" + "Node name for S&R": "FloatingVideo" } }, { - "id": 13, + "id": 6, "type": "LoraLoader", "pos": [ - 136, - -35 + 112, + 5 ], "size": { "0": 315, "1": 126 }, "flags": {}, - "order": 5, + "order": 8, "mode": 0, "inputs": [ { "name": "model", "type": "MODEL", - "link": 11 + "link": 31 }, { "name": "clip", "type": "CLIP", - "link": 21 + "link": 45 } ], "outputs": [ @@ -385,7 +430,7 @@ "name": "MODEL", "type": "MODEL", "links": [ - 12 + 44 ], "shape": 3, "slot_index": 0 @@ -393,11 +438,8 @@ { "name": "CLIP", "type": "CLIP", - "links": [ - 20 - ], - "shape": 3, - "slot_index": 1 + "links": null, + "shape": 3 } ], "properties": { @@ -410,126 +452,76 @@ ] }, { - "id": 6, - "type": "CLIPTextEncode", + "id": 10, + "type": "CheckpointLoaderSimple", "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 20 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 17 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "car,mars,fat cat ,runing,fast," - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 954, - 61 + 98, + 261 ], "size": { "0": 315, - "1": 262 + "1": 98 }, "flags": {}, - "order": 11, + "order": 3, "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 12 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 16 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], "outputs": [ { - "name": "LATENT", - "type": "LATENT", + "name": "MODEL", + "type": "MODEL", "links": [ - 7 + 31 ], + "shape": 3, "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 32, + 33, + 45 + ], + "shape": 3, + "slot_index": 1 + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 34 + ], + "shape": 3, + "slot_index": 2 } ], "properties": { - "Node name for S&R": "KSampler" + "Node name for S&R": "CheckpointLoaderSimple" }, "widgets_values": [ - 983410116223113, - "fixed", - 4, - 1.6, - "lcm", - "karras", - 1 + "deliberate_v2.safetensors" ] }, { - "id": 8, - "type": "VAEDecode", + "id": 18, + "type": "ScribblePreprocessor", "pos": [ - 1359, - 182 + 690, + 782 ], "size": { - "0": 210, - "1": 46 + "0": 315, + "1": 58 }, "flags": {}, - "order": 12, + "order": 5, "mode": 0, "inputs": [ { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 + "name": "image", + "type": "IMAGE", + "link": 42 } ], "outputs": [ @@ -537,157 +529,151 @@ "name": "IMAGE", "type": "IMAGE", "links": [ - 18, - 34 + 27 ], + "shape": 3, "slot_index": 0 } ], "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 26, - "type": "FloatingVideo", - "pos": [ - 1666, - -6 - ], - "size": [ - 291.8542517734363, - 273.99499126367164 - ], - "flags": {}, - "order": 14, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 34 - } - ], - "properties": { - "Node name for S&R": "FloatingVideo" - } + "Node name for S&R": "ScribblePreprocessor" + }, + "widgets_values": [ + 512 + ] } ], "links": [ [ + 1, + 1, + 0, 2, + 0, + "IMAGE" + ], + [ + 3, + 6, + 0, 5, 0, - 3, + "MODEL" + ], + [ + 5, + 8, + 0, + 5, + 2, + "CONDITIONING" + ], + [ + 6, + 9, + 0, + 5, 3, "LATENT" ], [ + 7, + 10, + 0, + 6, + 0, + "MODEL" + ], + [ + 8, + 10, + 1, + 6, + 1, + "CLIP" + ], + [ + 9, 5, - 4, + 0, + 11, + 0, + "LATENT" + ], + [ + 10, + 10, + 2, + 11, + 1, + "VAE" + ], + [ + 11, + 6, 1, 7, 0, "CLIP" ], [ + 12, 6, - 7, + 1, + 8, + 0, + "CLIP" + ], + [ + 14, + 11, 0, 3, + 0, + "IMAGE" + ], + [ + 17, + 1, 2, + 7, + 1, + "STRING" + ], + [ + 18, + 7, + 0, + 15, + 0, "CONDITIONING" ], [ - 7, - 3, + 19, + 15, 0, - 8, - 0, - "LATENT" - ], - [ - 8, - 4, - 2, - 8, + 5, 1, - "VAE" + "CONDITIONING" ], [ - 11, - 4, - 0, - 13, - 0, - "MODEL" - ], - [ - 12, - 13, - 0, - 3, - 0, - "MODEL" - ], - [ - 13, + 20, 16, 0, 15, 1, "CONTROL_NET" ], - [ - 16, - 15, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 17, - 6, - 0, - 15, - 0, - "CONDITIONING" - ], - [ - 18, - 8, - 0, - 17, - 0, - "IMAGE" - ], - [ - 20, - 13, - 1, - 6, - 0, - "CLIP" - ], - [ - 21, - 4, - 1, - 13, - 1, - "CLIP" - ], - [ - 23, - 18, - 0, - 20, - 0, - "IMAGE" - ], [ 24, + 1, + 0, + 18, + 0, + "IMAGE" + ], + [ + 25, 18, 0, 15, @@ -695,28 +681,140 @@ "IMAGE" ], [ - 32, 27, + 18, 0, - 12, + 15, + 2, + "IMAGE" + ], + [ + 29, + 7, + 0, + 5, + 2, + "CONDITIONING" + ], + [ + 30, + 9, + 0, + 5, + 3, + "LATENT" + ], + [ + 31, + 10, + 0, + 6, + 0, + "MODEL" + ], + [ + 32, + 10, + 1, + 8, + 0, + "CLIP" + ], + [ + 33, + 10, + 1, + 7, + 0, + "CLIP" + ], + [ + 34, + 10, + 2, + 11, + 1, + "VAE" + ], + [ + 35, + 5, + 0, + 11, + 0, + "LATENT" + ], + [ + 37, + 19, + 0, + 2, 0, "IMAGE" ], [ - 33, - 27, + 38, + 16, + 0, + 15, + 1, + "CONTROL_NET" + ], + [ + 39, + 8, + 0, + 15, + 0, + "CONDITIONING" + ], + [ + 40, + 15, + 0, + 5, + 1, + "CONDITIONING" + ], + [ + 41, + 11, + 0, + 20, + 0, + "IMAGE" + ], + [ + 42, + 19, 0, 18, 0, "IMAGE" ], [ - 34, + 43, + 19, + 2, 8, + 1, + "STRING" + ], + [ + 44, + 6, 0, - 26, + 5, 0, - "IMAGE" + "MODEL" + ], + [ + 45, + 10, + 1, + 6, + 1, + "CLIP" ] ], "groups": [],