From 6f9daa7321bdc9c28fe8e364c24125a2416c344a Mon Sep 17 00:00:00 2001 From: BordedDev <> Date: Tue, 8 Jul 2025 23:05:50 +0200 Subject: [PATCH] Update --- deno.json | 6 +- deno.lock | 702 ++++++++------ src/ai/remote-functions.ts | 96 ++ src/msg-handlers/base-handler.ts | 23 +- src/msg-handlers/img-gen-handler.ts | 163 +++- src/msg-handlers/llama-func-handler.ts | 440 +++++++++ src/msg-handlers/llama-handler.ts | 304 ++++-- src/snek/snek-socket.ts | 146 ++- src/util/img-gen.ts | 164 +++- src/util/logging.ts | 19 +- src/ws-snek-basic-bot.ts | 18 + src/ws-snek-image-bot.ts | 12 +- src/ws-snek-llama-bot.ts | 8 +- src/ws-snek-llama-func-bot.ts | 28 + src/ws-snek-perf-check.ts | 39 + templates/img-gen/RandomAnime.eta | 219 +++++ templates/img-gen/SD3.5-large-alt-improv.eta | 495 ++++++++++ templates/img-gen/SD3.5-large-alt.eta | 10 +- templates/img-gen/SD3.5-large-turbo.eta | 6 +- templates/img-gen/SD3.5-large.eta | 6 +- templates/img-gen/SD3.5-medium-alt-improv.eta | 495 ++++++++++ templates/img-gen/crow-pony-detailed.eta | 533 +++++++++++ templates/img-gen/cyber-illust-detailed.eta | 533 +++++++++++ templates/img-gen/ddmv4.eta | 734 +++++++++++++++ templates/img-gen/hidream-abli.eta | 164 ++++ templates/img-gen/hidream.eta | 164 ++++ templates/img-gen/plant-milk.eta | 889 ++++++++++++++++++ templates/img-gen/pony-realism-detailed.eta | 533 +++++++++++ 28 files changed, 6444 insertions(+), 505 deletions(-) create mode 100644 src/ai/remote-functions.ts create mode 100644 src/msg-handlers/llama-func-handler.ts create mode 100644 src/ws-snek-basic-bot.ts create mode 100644 src/ws-snek-llama-func-bot.ts create mode 100644 src/ws-snek-perf-check.ts create mode 100644 templates/img-gen/RandomAnime.eta create mode 100644 templates/img-gen/SD3.5-large-alt-improv.eta create mode 100644 templates/img-gen/SD3.5-medium-alt-improv.eta create mode 100644 templates/img-gen/crow-pony-detailed.eta create mode 100644 templates/img-gen/cyber-illust-detailed.eta create mode 100644 templates/img-gen/ddmv4.eta create mode 100644 templates/img-gen/hidream-abli.eta create mode 100644 templates/img-gen/hidream.eta create mode 100644 templates/img-gen/plant-milk.eta create mode 100644 templates/img-gen/pony-realism-detailed.eta diff --git a/deno.json b/deno.json index a51a05a..0fe56eb 100644 --- a/deno.json +++ b/deno.json @@ -11,11 +11,11 @@ "@std/collections": "jsr:@std/collections@^1.0.10", "@std/dotenv": "jsr:@std/dotenv@^0.225.3", "@std/path": "jsr:@std/path@^1.0.8", - "@types/node": "npm:@types/node@^22.13.9", + "@types/node": "npm:@types/node@^22.15.29", "jmespath": "npm:jmespath@^0.16.0", "lodash-es": "npm:lodash-es@^4.17.21", - "node-llama-cpp": "npm:node-llama-cpp@^3.6.0", - "octokit": "npm:octokit@^4.1.0" + "node-llama-cpp": "npm:node-llama-cpp@^3.10.0", + "octokit": "npm:octokit@^5.0.3" }, "fmt": { "semiColons": false diff --git a/deno.lock b/deno.lock index fff14f9..a58789f 100644 --- a/deno.lock +++ b/deno.lock @@ -3,56 +3,53 @@ "specifiers": { "jsr:@eta-dev/eta@*": "3.5.0", "jsr:@eta-dev/eta@^3.5.0": "3.5.0", - "jsr:@logtape/logtape@~0.8.1": "0.8.1", - "jsr:@std/assert@1": "1.0.11", - "jsr:@std/cli@^1.0.12": "1.0.12", - "jsr:@std/collections@^1.0.10": "1.0.10", - "jsr:@std/dotenv@~0.225.3": "0.225.3", - "jsr:@std/internal@^1.0.5": "1.0.5", - "jsr:@std/path@*": "1.0.8", - "jsr:@std/path@^1.0.8": "1.0.8", - "npm:@types/node@^22.13.9": "22.13.9", - "npm:jmespath@*": "0.16.0", + "jsr:@logtape/logtape@~0.8.1": "0.8.2", + "jsr:@std/assert@1": "1.0.13", + "jsr:@std/cli@^1.0.12": "1.0.20", + "jsr:@std/collections@^1.0.10": "1.1.1", + "jsr:@std/dotenv@~0.225.3": "0.225.5", + "jsr:@std/internal@^1.0.6": "1.0.8", + "jsr:@std/path@^1.0.8": "1.1.0", + "npm:@types/node@^22.15.29": "22.15.31", "npm:jmespath@0.16": "0.16.0", "npm:lodash-es@*": "4.17.21", "npm:lodash-es@^4.17.21": "4.17.21", - "npm:node-llama-cpp@*": "3.6.0", - "npm:node-llama-cpp@^3.6.0": "3.6.0", - "npm:octokit@*": "4.1.0_@octokit+core@6.1.3", - "npm:octokit@^4.1.0": "4.1.0_@octokit+core@6.1.3" + "npm:node-llama-cpp@*": "3.10.0", + "npm:node-llama-cpp@^3.10.0": "3.10.0", + "npm:octokit@^5.0.3": "5.0.3_@octokit+core@7.0.2" }, "jsr": { "@eta-dev/eta@3.5.0": { "integrity": "6b70827efc14c7cbf08498ac7a922ecab003641caf3852a6cb5b1b12ee58fb37" }, - "@logtape/logtape@0.8.1": { - "integrity": "deb3b276d4be0a697e94f6a79ddb309f993e1870166a6d43d8eca86cd00871a8" + "@logtape/logtape@0.8.2": { + "integrity": "e2ae1fc2561e8d010359b9894efb39bdb559dae44f5824540cbb26a78eee36bc" }, - "@std/assert@1.0.11": { - "integrity": "2461ef3c368fe88bc60e186e7744a93112f16fd110022e113a0849e94d1c83c1", + "@std/assert@1.0.13": { + "integrity": "ae0d31e41919b12c656c742b22522c32fb26ed0cba32975cb0de2a273cb68b29", "dependencies": [ "jsr:@std/internal" ] }, - "@std/cli@1.0.12": { - "integrity": "e5cfb7814d189da174ecd7a34fbbd63f3513e24a1b307feb2fcd5da47a070d90" + "@std/cli@1.0.20": { + "integrity": "a8c384a2c98cec6ec6a2055c273a916e2772485eb784af0db004c5ab8ba52333" }, - "@std/collections@1.0.10": { - "integrity": "903af106a3d92970d74e20f7ebff77d9658af9bef4403f1dc42a7801c0575899" + "@std/collections@1.1.1": { + "integrity": "eff6443fbd9d5a6697018fb39c5d13d5f662f0045f21392d640693d0008ab2af" }, - "@std/dotenv@0.225.3": { - "integrity": "a95e5b812c27b0854c52acbae215856d9cce9d4bbf774d938c51d212711e8d4a" + "@std/dotenv@0.225.5": { + "integrity": "9ce6f9d0ec3311f74a32535aa1b8c62ed88b1ab91b7f0815797d77a6f60c922f" }, - "@std/internal@1.0.5": { - "integrity": "54a546004f769c1ac9e025abd15a76b6671ddc9687e2313b67376125650dc7ba" + "@std/internal@1.0.8": { + "integrity": "fc66e846d8d38a47cffd274d80d2ca3f0de71040f855783724bb6b87f60891f5" }, - "@std/path@1.0.8": { - "integrity": "548fa456bb6a04d3c1a1e7477986b6cffbce95102d0bb447c67c4ee70e0364be" + "@std/path@1.1.0": { + "integrity": "ddc94f8e3c275627281cbc23341df6b8bcc874d70374f75fec2533521e3d6886" } }, "npm": { - "@huggingface/jinja@0.3.3": { - "integrity": "sha512-vQQr2JyWvVFba3Lj9es4q9vCl1sAc74fdgnEMoX8qHrXtswap9ge9uO3ONDzQB0cQ0PUyaKY2N6HaVbTBvSXvw==" + "@huggingface/jinja@0.5.0": { + "integrity": "sha512-Ptc03/jGRiYRoi0bUYKZ14MkDslsBRT24oxmsvUlfYrvQMldrxCevhPnT+hfX8awKTT8/f/0ZBBWldoeAcMHdQ==" }, "@kwsites/file-exists@1.1.1": { "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", @@ -63,89 +60,143 @@ "@kwsites/promise-deferred@1.1.1": { "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" }, - "@node-llama-cpp/linux-arm64@3.6.0": { - "integrity": "sha512-hE/hqxtr5DQyY1DohwOcY742NQZtEFag8H/FQP2Y7fnlNQYhiOe45PcAJDiqmEUMmlCGVvHZaCWbaNVoTMYdWg==" + "@node-llama-cpp/linux-arm64@3.10.0": { + "integrity": "sha512-FMVMU9dlBzG3p/v99UwTAH1UIqtpbhbxTzlpopqpWmjOqXc+QP1ryukqyVwvjllJFtYOkdns0V2k8bSF/4qW/w==" }, - "@node-llama-cpp/linux-armv7l@3.6.0": { - "integrity": "sha512-aRyDVf8szfJJWHnNWG56Ir3LtfXxj9vwLXbXy4XwfHlMTuBHWhmrRXyB8f3A/aJ8h6u48wMVxqxdmwnXigSKWg==" + "@node-llama-cpp/linux-armv7l@3.10.0": { + "integrity": "sha512-VwWdkww6on/X1RAfyWhxy94u1q0yw3oSw3upJkvCed9zFx2VRC9WGws13mmLsjAZXzJ5c8CJhtirgv4/U2MF7g==" }, - "@node-llama-cpp/linux-x64-cuda@3.6.0": { - "integrity": "sha512-lS9F+aX2cGV1I/pAuCNeQm9bGELNmnvKqbF4k4ZjNk64ZT2sE74o2S/uN6GvMJETG+rgQiKRuKb1l/yIm0LOfA==" + "@node-llama-cpp/linux-x64-cuda@3.10.0": { + "integrity": "sha512-FnTXEArNUAUkNO8x+Zd3tojvkPfIC1HlShx7x60eWm+pnBr7VFk6SWzuqllcm+GqD+Uy/5y6P7ey5Q3FnFEy0g==" }, - "@node-llama-cpp/linux-x64-vulkan@3.6.0": { - "integrity": "sha512-1Wc6e1YJRpjllD6MRfwYPxE7z8qvmaYrEFyVPzTe9sghKXUswpBmmb0mM/yOzwT/mUBygSwOEBvTkp3nG+pWhg==" + "@node-llama-cpp/linux-x64-vulkan@3.10.0": { + "integrity": "sha512-t+QBM80hYX4zJpePbHQiKDdy9MgicoxPTGQyXvF63gcRvmfUTgYqajgSP/4vRA5ZoWOpdcNnuPzUmhZt/44+lQ==" }, - "@node-llama-cpp/linux-x64@3.6.0": { - "integrity": "sha512-lUzTTY7AwRz5j/f6rss6fPc2u3YNOmo4k8Zap38kzy9H6rL+U2nlanN+4STs5j/7gcx5f/VHRnPrYDl5OPcmTw==" + "@node-llama-cpp/linux-x64@3.10.0": { + "integrity": "sha512-FbhcI5vfte5usxL4VOU+VmVSaA8QQ+Y3lqWym22PtB3BbLpvDbUK5NF060RvApOBUcLdHM08de8Cu91ta87zhQ==" }, - "@node-llama-cpp/mac-arm64-metal@3.6.0": { - "integrity": "sha512-bOtZkJ6dCWHnZ1SP8EJ+LOdIFKo/7clb0ck+IwD/Bn/2ePzObVBsq30IxpRnUXx8pZ54+CzmTQuS2NOMHXS0PQ==" + "@node-llama-cpp/mac-arm64-metal@3.10.0": { + "integrity": "sha512-2ck6oM17XzR4ZVezLl5RxsYacGWDgoiHTwOwbV7ZZ2TynNuhvXioBgITZttTMyzUbXOmr43mf5r0Pa6UtMhZGQ==" }, - "@node-llama-cpp/mac-x64@3.6.0": { - "integrity": "sha512-xjyEAsOXQ6i3VuXoQYB5llYuNz0sP9YnrDzAJ8sqovXXYkSyXPRyTCF5/PaAFc6QMkpsFIw3fSbavJeSzR5IGw==" + "@node-llama-cpp/mac-x64@3.10.0": { + "integrity": "sha512-ujq2wh+bX6uqy3+SEhHyxBQSwq+lJO4cKIRVqX9FQThUylnN2PM8Ahp1oAhg741/jlo6K+FR9TaJ2Oc2+uVSJw==" }, - "@node-llama-cpp/win-arm64@3.6.0": { - "integrity": "sha512-o4gEUBVMZ1R3Oy1f642UA1vJtnVLAJq2W+diPUxJVqXs9KYDOf7+JuxVcTEzSj6+wBsN3ZRtt36Xst41Jwp6FQ==" + "@node-llama-cpp/win-arm64@3.10.0": { + "integrity": "sha512-ZONkUz39lNhqT0+EjunbKF8AIwUicx9hUUMOQeVafZ0uvYqbScg6AdLagblXonbhEwo3M5DVFfl6Ffp+0Mgf6A==" }, - "@node-llama-cpp/win-x64-cuda@3.6.0": { - "integrity": "sha512-vxNrz4BwMNgmfbRxALdTnb7RlJnO6p5uXlZP8fxpaD0zyBllenURTTzEo3Wobpa98af5DWEY1AueH9RFixvscA==" + "@node-llama-cpp/win-x64-cuda@3.10.0": { + "integrity": "sha512-tuhkdrZnIyuWda5OoYQ85zj0MhxwV04sUkNfcJiTbzkGbsyfWY+a/u7L0TMNKJD8nleYK+Meu22EYezNkP5ZRg==" }, - "@node-llama-cpp/win-x64-vulkan@3.6.0": { - "integrity": "sha512-2XhzVQaRw5QxMqtg+517W+tn0fgDqvo12I0/wVpaBctwIaX+yOcj+njGlVUbMBFzhR9VM9wo5N2bjfRYI6y+PA==" + "@node-llama-cpp/win-x64-vulkan@3.10.0": { + "integrity": "sha512-C9KVZOLWFzYzSeGmSdMGrNRbe90rnT/8FZqRl9w3fNRMmNSKaSMYBwdf6Z15MUBz/wGvw3qpVCePgtgq2wD9Yg==" }, - "@node-llama-cpp/win-x64@3.6.0": { - "integrity": "sha512-JDJoDeBkJhvFlINwi7tyTuOjSTJoBF6yyf7o89iMZ2xniyo6BzhI2d/79PGLkXht/1+sGNoCyzbuz3cBgP06Fg==" + "@node-llama-cpp/win-x64@3.10.0": { + "integrity": "sha512-aVnop9EvRN6nXD0OGtFAFITmNPA30ZezUib0N5hRgYJeJpHr0MQMVirO9OOP5FkaMyS7P3Y55bilfvNiEykqug==" }, - "@octokit/app@15.1.2_@octokit+core@6.1.3": { - "integrity": "sha512-6aKmKvqnJKoVK+kx0mLlBMKmQYoziPw4Rd/PWr0j65QVQlrDXlu6hGU8fmTXt7tNkf/DsubdIaTT4fkoWzCh5g==", + "@octokit/app@15.1.6_@octokit+core@6.1.5": { + "integrity": "sha512-WELCamoCJo9SN0lf3SWZccf68CF0sBNPQuLYmZ/n87p5qvBJDe9aBtr5dHkh7T9nxWZ608pizwsUbypSzZAiUw==", "dependencies": [ - "@octokit/auth-app", - "@octokit/auth-unauthenticated", - "@octokit/core", - "@octokit/oauth-app", - "@octokit/plugin-paginate-rest", + "@octokit/auth-app@7.2.1", + "@octokit/auth-unauthenticated@6.1.3", + "@octokit/core@6.1.5", + "@octokit/oauth-app@7.1.6", + "@octokit/plugin-paginate-rest@12.0.0_@octokit+core@6.1.5", "@octokit/types", - "@octokit/webhooks" + "@octokit/webhooks@13.9.0" ] }, - "@octokit/auth-app@7.1.4": { - "integrity": "sha512-5F+3l/maq9JfWQ4bV28jT2G/K8eu9OJ317yzXPTGe4Kw+lKDhFaS4dQ3Ltmb6xImKxfCQdqDqMXODhc9YLipLw==", + "@octokit/app@16.0.1_@octokit+core@7.0.2": { + "integrity": "sha512-kgTeTsWmpUX+s3Fs4EK4w1K+jWCDB6ClxLSWUWTyhlw7+L3jHtuXDR4QtABu2GsmCMdk67xRhruiXotS3ay3Yw==", "dependencies": [ - "@octokit/auth-oauth-app", - "@octokit/auth-oauth-user", - "@octokit/request", - "@octokit/request-error", + "@octokit/auth-app@8.0.1", + "@octokit/auth-unauthenticated@7.0.1", + "@octokit/core@7.0.2", + "@octokit/oauth-app@8.0.1", + "@octokit/plugin-paginate-rest@13.0.1_@octokit+core@7.0.2", + "@octokit/types", + "@octokit/webhooks@14.0.2" + ] + }, + "@octokit/auth-app@7.2.1": { + "integrity": "sha512-4jaopCVOtWN0V8qCx/1s2pkRqC6tcvIQM3kFB99eIpsP53GfsoIKO08D94b83n/V3iGihHmxWR2lXzE0NicUGg==", + "dependencies": [ + "@octokit/auth-oauth-app@8.1.4", + "@octokit/auth-oauth-user@5.1.6", + "@octokit/request-error@6.1.8", + "@octokit/request@9.2.3", "@octokit/types", "toad-cache", "universal-github-app-jwt", "universal-user-agent" ] }, - "@octokit/auth-oauth-app@8.1.2": { - "integrity": "sha512-3woNZgq5/S6RS+9ZTq+JdymxVr7E0s4EYxF20ugQvgX3pomdPUL5r/XdTY9wALoBM2eHVy4ettr5fKpatyTyHw==", + "@octokit/auth-app@8.0.1": { + "integrity": "sha512-P2J5pB3pjiGwtJX4WqJVYCtNkcZ+j5T2Wm14aJAEIC3WJOrv12jvBley3G1U/XI8q9o1A7QMG54LiFED2BiFlg==", "dependencies": [ - "@octokit/auth-oauth-device", - "@octokit/auth-oauth-user", - "@octokit/request", + "@octokit/auth-oauth-app@9.0.1", + "@octokit/auth-oauth-user@6.0.0", + "@octokit/request-error@7.0.0", + "@octokit/request@10.0.2", + "@octokit/types", + "toad-cache", + "universal-github-app-jwt", + "universal-user-agent" + ] + }, + "@octokit/auth-oauth-app@8.1.4": { + "integrity": "sha512-71iBa5SflSXcclk/OL3lJzdt4iFs56OJdpBGEBl1wULp7C58uiswZLV6TdRaiAzHP1LT8ezpbHlKuxADb+4NkQ==", + "dependencies": [ + "@octokit/auth-oauth-device@7.1.5", + "@octokit/auth-oauth-user@5.1.6", + "@octokit/request@9.2.3", "@octokit/types", "universal-user-agent" ] }, - "@octokit/auth-oauth-device@7.1.2": { - "integrity": "sha512-gTOIzDeV36OhVfxCl69FmvJix7tJIiU6dlxuzLVAzle7fYfO8UDyddr9B+o4CFQVaMBLMGZ9ak2CWMYcGeZnPw==", + "@octokit/auth-oauth-app@9.0.1": { + "integrity": "sha512-TthWzYxuHKLAbmxdFZwFlmwVyvynpyPmjwc+2/cI3cvbT7mHtsAW9b1LvQaNnAuWL+pFnqtxdmrU8QpF633i1g==", "dependencies": [ - "@octokit/oauth-methods", - "@octokit/request", + "@octokit/auth-oauth-device@8.0.1", + "@octokit/auth-oauth-user@6.0.0", + "@octokit/request@10.0.2", "@octokit/types", "universal-user-agent" ] }, - "@octokit/auth-oauth-user@5.1.2": { - "integrity": "sha512-PgVDDPJgZYb3qSEXK4moksA23tfn68zwSAsQKZ1uH6IV9IaNEYx35OXXI80STQaLYnmEE86AgU0tC1YkM4WjsA==", + "@octokit/auth-oauth-device@7.1.5": { + "integrity": "sha512-lR00+k7+N6xeECj0JuXeULQ2TSBB/zjTAmNF2+vyGPDEFx1dgk1hTDmL13MjbSmzusuAmuJD8Pu39rjp9jH6yw==", "dependencies": [ - "@octokit/auth-oauth-device", - "@octokit/oauth-methods", - "@octokit/request", + "@octokit/oauth-methods@5.1.5", + "@octokit/request@9.2.3", + "@octokit/types", + "universal-user-agent" + ] + }, + "@octokit/auth-oauth-device@8.0.1": { + "integrity": "sha512-TOqId/+am5yk9zor0RGibmlqn4V0h8vzjxlw/wYr3qzkQxl8aBPur384D1EyHtqvfz0syeXji4OUvKkHvxk/Gw==", + "dependencies": [ + "@octokit/oauth-methods@6.0.0", + "@octokit/request@10.0.2", + "@octokit/types", + "universal-user-agent" + ] + }, + "@octokit/auth-oauth-user@5.1.6": { + "integrity": "sha512-/R8vgeoulp7rJs+wfJ2LtXEVC7pjQTIqDab7wPKwVG6+2v/lUnCOub6vaHmysQBbb45FknM3tbHW8TOVqYHxCw==", + "dependencies": [ + "@octokit/auth-oauth-device@7.1.5", + "@octokit/oauth-methods@5.1.5", + "@octokit/request@9.2.3", + "@octokit/types", + "universal-user-agent" + ] + }, + "@octokit/auth-oauth-user@6.0.0": { + "integrity": "sha512-GV9IW134PHsLhtUad21WIeP9mlJ+QNpFd6V9vuPWmaiN25HEJeEQUcS4y5oRuqCm9iWDLtfIs+9K8uczBXKr6A==", + "dependencies": [ + "@octokit/auth-oauth-device@8.0.1", + "@octokit/oauth-methods@6.0.0", + "@octokit/request@10.0.2", "@octokit/types", "universal-user-agent" ] @@ -153,49 +204,99 @@ "@octokit/auth-token@5.1.2": { "integrity": "sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==" }, - "@octokit/auth-unauthenticated@6.1.1": { - "integrity": "sha512-bGXqdN6RhSFHvpPq46SL8sN+F3odQ6oMNLWc875IgoqcC3qus+fOL2th6Tkl94wvdSTy8/OeHzWy/lZebmnhog==", + "@octokit/auth-token@6.0.0": { + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==" + }, + "@octokit/auth-unauthenticated@6.1.3": { + "integrity": "sha512-d5gWJla3WdSl1yjbfMpET+hUSFCE15qM0KVSB0H1shyuJihf/RL1KqWoZMIaonHvlNojkL9XtLFp8QeLe+1iwA==", "dependencies": [ - "@octokit/request-error", + "@octokit/request-error@6.1.8", "@octokit/types" ] }, - "@octokit/core@6.1.3": { - "integrity": "sha512-z+j7DixNnfpdToYsOutStDgeRzJSMnbj8T1C/oQjB6Aa+kRfNjs/Fn7W6c8bmlt6mfy3FkgeKBRnDjxQow5dow==", + "@octokit/auth-unauthenticated@7.0.1": { + "integrity": "sha512-qVq1vdjLLZdE8kH2vDycNNjuJRCD1q2oet1nA/GXWaYlpDxlR7rdVhX/K/oszXslXiQIiqrQf+rdhDlA99JdTQ==", "dependencies": [ - "@octokit/auth-token", - "@octokit/graphql", - "@octokit/request", - "@octokit/request-error", + "@octokit/request-error@7.0.0", + "@octokit/types" + ] + }, + "@octokit/core@6.1.5": { + "integrity": "sha512-vvmsN0r7rguA+FySiCsbaTTobSftpIDIpPW81trAmsv9TGxg3YCujAxRYp/Uy8xmDgYCzzgulG62H7KYUFmeIg==", + "dependencies": [ + "@octokit/auth-token@5.1.2", + "@octokit/graphql@8.2.2", + "@octokit/request-error@6.1.8", + "@octokit/request@9.2.3", "@octokit/types", - "before-after-hook", + "before-after-hook@3.0.2", "universal-user-agent" ] }, - "@octokit/endpoint@10.1.2": { - "integrity": "sha512-XybpFv9Ms4hX5OCHMZqyODYqGTZ3H6K6Vva+M9LR7ib/xr1y1ZnlChYv9H680y77Vd/i/k+thXApeRASBQkzhA==", + "@octokit/core@7.0.2": { + "integrity": "sha512-ODsoD39Lq6vR6aBgvjTnA3nZGliknKboc9Gtxr7E4WDNqY24MxANKcuDQSF0jzapvGb3KWOEDrKfve4HoWGK+g==", + "dependencies": [ + "@octokit/auth-token@6.0.0", + "@octokit/graphql@9.0.1", + "@octokit/request-error@7.0.0", + "@octokit/request@10.0.2", + "@octokit/types", + "before-after-hook@4.0.0", + "universal-user-agent" + ] + }, + "@octokit/endpoint@10.1.4": { + "integrity": "sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==", "dependencies": [ "@octokit/types", "universal-user-agent" ] }, - "@octokit/graphql@8.2.0": { - "integrity": "sha512-gejfDywEml/45SqbWTWrhfwvLBrcGYhOn50sPOjIeVvH6i7D16/9xcFA8dAJNp2HMcd+g4vru41g4E2RBiZvfQ==", + "@octokit/endpoint@11.0.0": { + "integrity": "sha512-hoYicJZaqISMAI3JfaDr1qMNi48OctWuOih1m80bkYow/ayPw6Jj52tqWJ6GEoFTk1gBqfanSoI1iY99Z5+ekQ==", "dependencies": [ - "@octokit/request", "@octokit/types", "universal-user-agent" ] }, - "@octokit/oauth-app@7.1.5": { - "integrity": "sha512-/Y2MiwWDlGUK4blKKfjJiwjzu/FzwKTTTfTZAAQ0QbdBIDEGJPWhOFH6muSN86zaa4tNheB4YS3oWIR2e4ydzA==", + "@octokit/graphql@8.2.2": { + "integrity": "sha512-Yi8hcoqsrXGdt0yObxbebHXFOiUA+2v3n53epuOg1QUgOB6c4XzvisBNVXJSl8RYA5KrDuSL2yq9Qmqe5N0ryA==", "dependencies": [ - "@octokit/auth-oauth-app", - "@octokit/auth-oauth-user", - "@octokit/auth-unauthenticated", - "@octokit/core", - "@octokit/oauth-authorization-url", - "@octokit/oauth-methods", + "@octokit/request@9.2.3", + "@octokit/types", + "universal-user-agent" + ] + }, + "@octokit/graphql@9.0.1": { + "integrity": "sha512-j1nQNU1ZxNFx2ZtKmL4sMrs4egy5h65OMDmSbVyuCzjOcwsHq6EaYjOTGXPQxgfiN8dJ4CriYHk6zF050WEULg==", + "dependencies": [ + "@octokit/request@10.0.2", + "@octokit/types", + "universal-user-agent" + ] + }, + "@octokit/oauth-app@7.1.6": { + "integrity": "sha512-OMcMzY2WFARg80oJNFwWbY51TBUfLH4JGTy119cqiDawSFXSIBujxmpXiKbGWQlvfn0CxE6f7/+c6+Kr5hI2YA==", + "dependencies": [ + "@octokit/auth-oauth-app@8.1.4", + "@octokit/auth-oauth-user@5.1.6", + "@octokit/auth-unauthenticated@6.1.3", + "@octokit/core@6.1.5", + "@octokit/oauth-authorization-url@7.1.1", + "@octokit/oauth-methods@5.1.5", + "@types/aws-lambda", + "universal-user-agent" + ] + }, + "@octokit/oauth-app@8.0.1": { + "integrity": "sha512-QnhMYEQpnYbEPn9cae+wXL2LuPMFglmfeuDJXXsyxIXdoORwkLK8y0cHhd/5du9MbO/zdG/BXixzB7EEwU63eQ==", + "dependencies": [ + "@octokit/auth-oauth-app@9.0.1", + "@octokit/auth-oauth-user@6.0.0", + "@octokit/auth-unauthenticated@7.0.1", + "@octokit/core@7.0.2", + "@octokit/oauth-authorization-url@8.0.0", + "@octokit/oauth-methods@6.0.0", "@types/aws-lambda", "universal-user-agent" ] @@ -203,89 +304,168 @@ "@octokit/oauth-authorization-url@7.1.1": { "integrity": "sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA==" }, - "@octokit/oauth-methods@5.1.3": { - "integrity": "sha512-M+bDBi5H8FnH0xhCTg0m9hvcnppdDnxUqbZyOkxlLblKpLAR+eT2nbDPvJDp0eLrvJWA1I8OX0KHf/sBMQARRA==", + "@octokit/oauth-authorization-url@8.0.0": { + "integrity": "sha512-7QoLPRh/ssEA/HuHBHdVdSgF8xNLz/Bc5m9fZkArJE5bb6NmVkDm3anKxXPmN1zh6b5WKZPRr3697xKT/yM3qQ==" + }, + "@octokit/oauth-methods@5.1.5": { + "integrity": "sha512-Ev7K8bkYrYLhoOSZGVAGsLEscZQyq7XQONCBBAl2JdMg7IT3PQn/y8P0KjloPoYpI5UylqYrLeUcScaYWXwDvw==", "dependencies": [ - "@octokit/oauth-authorization-url", - "@octokit/request", - "@octokit/request-error", + "@octokit/oauth-authorization-url@7.1.1", + "@octokit/request-error@6.1.8", + "@octokit/request@9.2.3", "@octokit/types" ] }, - "@octokit/openapi-types@23.0.1": { - "integrity": "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==" + "@octokit/oauth-methods@6.0.0": { + "integrity": "sha512-Q8nFIagNLIZgM2odAraelMcDssapc+lF+y3OlcIPxyAU+knefO8KmozGqfnma1xegRDP4z5M73ABsamn72bOcA==", + "dependencies": [ + "@octokit/oauth-authorization-url@8.0.0", + "@octokit/request-error@7.0.0", + "@octokit/request@10.0.2", + "@octokit/types" + ] }, - "@octokit/openapi-webhooks-types@8.5.1": { - "integrity": "sha512-i3h1b5zpGSB39ffBbYdSGuAd0NhBAwPyA3QV3LYi/lx4lsbZiu7u2UHgXVUR6EpvOI8REOuVh1DZTRfHoJDvuQ==" + "@octokit/openapi-types@25.1.0": { + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==" }, - "@octokit/plugin-paginate-graphql@5.2.4_@octokit+core@6.1.3": { + "@octokit/openapi-webhooks-types@11.0.0": { + "integrity": "sha512-ZBzCFj98v3SuRM7oBas6BHZMJRadlnDoeFfvm1olVxZnYeU6Vh97FhPxyS5aLh5pN51GYv2I51l/hVUAVkGBlA==" + }, + "@octokit/openapi-webhooks-types@12.0.3": { + "integrity": "sha512-90MF5LVHjBedwoHyJsgmaFhEN1uzXyBDRLEBe7jlTYx/fEhPAk3P3DAJsfZwC54m8hAIryosJOL+UuZHB3K3yA==" + }, + "@octokit/plugin-paginate-graphql@5.2.4_@octokit+core@6.1.5": { "integrity": "sha512-pLZES1jWaOynXKHOqdnwZ5ULeVR6tVVCMm+AUbp0htdcyXDU95WbkYdU4R2ej1wKj5Tu94Mee2Ne0PjPO9cCyA==", "dependencies": [ - "@octokit/core" + "@octokit/core@6.1.5" ] }, - "@octokit/plugin-paginate-rest@11.4.0_@octokit+core@6.1.3": { - "integrity": "sha512-ttpGck5AYWkwMkMazNCZMqxKqIq1fJBNxBfsFwwfyYKTf914jKkLF0POMS3YkPBwp5g1c2Y4L79gDz01GhSr1g==", + "@octokit/plugin-paginate-graphql@6.0.0_@octokit+core@7.0.2": { + "integrity": "sha512-crfpnIoFiBtRkvPqOyLOsw12XsveYuY2ieP6uYDosoUegBJpSVxGwut9sxUgFFcll3VTOTqpUf8yGd8x1OmAkQ==", "dependencies": [ - "@octokit/core", + "@octokit/core@7.0.2" + ] + }, + "@octokit/plugin-paginate-rest@12.0.0_@octokit+core@6.1.5": { + "integrity": "sha512-MPd6WK1VtZ52lFrgZ0R2FlaoiWllzgqFHaSZxvp72NmoDeZ0m8GeJdg4oB6ctqMTYyrnDYp592Xma21mrgiyDA==", + "dependencies": [ + "@octokit/core@6.1.5", "@octokit/types" ] }, - "@octokit/plugin-rest-endpoint-methods@13.3.0_@octokit+core@6.1.3": { - "integrity": "sha512-LUm44shlmkp/6VC+qQgHl3W5vzUP99ZM54zH6BuqkJK4DqfFLhegANd+fM4YRLapTvPm4049iG7F3haANKMYvQ==", + "@octokit/plugin-paginate-rest@13.0.1_@octokit+core@7.0.2": { + "integrity": "sha512-m1KvHlueScy4mQJWvFDCxFBTIdXS0K1SgFGLmqHyX90mZdCIv6gWBbKRhatxRjhGlONuTK/hztYdaqrTXcFZdQ==", "dependencies": [ - "@octokit/core", + "@octokit/core@7.0.2", "@octokit/types" ] }, - "@octokit/plugin-retry@7.1.3_@octokit+core@6.1.3": { - "integrity": "sha512-8nKOXvYWnzv89gSyIvgFHmCBAxfQAOPRlkacUHL9r5oWtp5Whxl8Skb2n3ACZd+X6cYijD6uvmrQuPH/UCL5zQ==", + "@octokit/plugin-rest-endpoint-methods@14.0.0_@octokit+core@6.1.5": { + "integrity": "sha512-iQt6ovem4b7zZYZQtdv+PwgbL5VPq37th1m2x2TdkgimIDJpsi2A6Q/OI/23i/hR6z5mL0EgisNR4dcbmckSZQ==", "dependencies": [ - "@octokit/core", - "@octokit/request-error", + "@octokit/core@6.1.5", + "@octokit/types" + ] + }, + "@octokit/plugin-rest-endpoint-methods@16.0.0_@octokit+core@7.0.2": { + "integrity": "sha512-kJVUQk6/dx/gRNLWUnAWKFs1kVPn5O5CYZyssyEoNYaFedqZxsfYs7DwI3d67hGz4qOwaJ1dpm07hOAD1BXx6g==", + "dependencies": [ + "@octokit/core@7.0.2", + "@octokit/types" + ] + }, + "@octokit/plugin-retry@7.2.1_@octokit+core@6.1.5": { + "integrity": "sha512-wUc3gv0D6vNHpGxSaR3FlqJpTXGWgqmk607N9L3LvPL4QjaxDgX/1nY2mGpT37Khn+nlIXdljczkRnNdTTV3/A==", + "dependencies": [ + "@octokit/core@6.1.5", + "@octokit/request-error@6.1.8", "@octokit/types", "bottleneck" ] }, - "@octokit/plugin-throttling@9.4.0_@octokit+core@6.1.3": { - "integrity": "sha512-IOlXxXhZA4Z3m0EEYtrrACkuHiArHLZ3CvqWwOez/pURNqRuwfoFlTPbN5Muf28pzFuztxPyiUiNwz8KctdZaQ==", + "@octokit/plugin-retry@8.0.1_@octokit+core@7.0.2": { + "integrity": "sha512-KUoYR77BjF5O3zcwDQHRRZsUvJwepobeqiSSdCJ8lWt27FZExzb0GgVxrhhfuyF6z2B2zpO0hN5pteni1sqWiw==", "dependencies": [ - "@octokit/core", + "@octokit/core@7.0.2", + "@octokit/request-error@7.0.0", "@octokit/types", "bottleneck" ] }, - "@octokit/request-error@6.1.6": { - "integrity": "sha512-pqnVKYo/at0NuOjinrgcQYpEbv4snvP3bKMRqHaD9kIsk9u1LCpb2smHZi8/qJfgeNqLo5hNW4Z7FezNdEo0xg==", + "@octokit/plugin-throttling@10.0.0_@octokit+core@6.1.5": { + "integrity": "sha512-Kuq5/qs0DVYTHZuBAzCZStCzo2nKvVRo/TDNhCcpC2TKiOGz/DisXMCvjt3/b5kr6SCI1Y8eeeJTHBxxpFvZEg==", + "dependencies": [ + "@octokit/core@6.1.5", + "@octokit/types", + "bottleneck" + ] + }, + "@octokit/plugin-throttling@11.0.1_@octokit+core@7.0.2": { + "integrity": "sha512-S+EVhy52D/272L7up58dr3FNSMXWuNZolkL4zMJBNIfIxyZuUcczsQAU4b5w6dewJXnKYVgSHSV5wxitMSW1kw==", + "dependencies": [ + "@octokit/core@7.0.2", + "@octokit/types", + "bottleneck" + ] + }, + "@octokit/request-error@6.1.8": { + "integrity": "sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==", "dependencies": [ "@octokit/types" ] }, - "@octokit/request@9.2.0": { - "integrity": "sha512-kXLfcxhC4ozCnAXy2ff+cSxpcF0A1UqxjvYMqNuPIeOAzJbVWQ+dy5G2fTylofB/gTbObT8O6JORab+5XtA1Kw==", + "@octokit/request-error@7.0.0": { + "integrity": "sha512-KRA7VTGdVyJlh0cP5Tf94hTiYVVqmt2f3I6mnimmaVz4UG3gQV/k4mDJlJv3X67iX6rmN7gSHCF8ssqeMnmhZg==", "dependencies": [ - "@octokit/endpoint", - "@octokit/request-error", + "@octokit/types" + ] + }, + "@octokit/request@10.0.2": { + "integrity": "sha512-iYj4SJG/2bbhh+iIpFmG5u49DtJ4lipQ+aPakjL9OKpsGY93wM8w06gvFbEQxcMsZcCvk5th5KkIm2m8o14aWA==", + "dependencies": [ + "@octokit/endpoint@11.0.0", + "@octokit/request-error@7.0.0", "@octokit/types", - "fast-content-type-parse", + "fast-content-type-parse@3.0.0", "universal-user-agent" ] }, - "@octokit/types@13.8.0": { - "integrity": "sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==", + "@octokit/request@9.2.3": { + "integrity": "sha512-Ma+pZU8PXLOEYzsWf0cn/gY+ME57Wq8f49WTXA8FMHp2Ps9djKw//xYJ1je8Hm0pR2lU9FUGeJRWOtxq6olt4w==", + "dependencies": [ + "@octokit/endpoint@10.1.4", + "@octokit/request-error@6.1.8", + "@octokit/types", + "fast-content-type-parse@2.0.1", + "universal-user-agent" + ] + }, + "@octokit/types@14.1.0": { + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", "dependencies": [ "@octokit/openapi-types" ] }, - "@octokit/webhooks-methods@5.1.0": { - "integrity": "sha512-yFZa3UH11VIxYnnoOYCVoJ3q4ChuSOk2IVBBQ0O3xtKX4x9bmKb/1t+Mxixv2iUhzMdOl1qeWJqEhouXXzB3rQ==" + "@octokit/webhooks-methods@5.1.1": { + "integrity": "sha512-NGlEHZDseJTCj8TMMFehzwa9g7On4KJMPVHDSrHxCQumL6uSQR8wIkP/qesv52fXqV1BPf4pTxwtS31ldAt9Xg==" }, - "@octokit/webhooks@13.5.0": { - "integrity": "sha512-uSO/TCCfi9vaZHOBsGWsRNBXYYKtLnSDbHI+std0M80AaEd7AnVfLqvk+9V3GP1faPcOx06ADx+h8UWwvemIGw==", + "@octokit/webhooks-methods@6.0.0": { + "integrity": "sha512-MFlzzoDJVw/GcbfzVC1RLR36QqkTLUf79vLVO3D+xn7r0QgxnFoLZgtrzxiQErAjFUOdH6fas2KeQJ1yr/qaXQ==" + }, + "@octokit/webhooks@13.9.0": { + "integrity": "sha512-5Kva+/Gi7c+39d0/0MM/v/5RCZuwqm75fUD+t7Es3Iz/adui54GnjfNmJpkkPkXGC+5IWnEvgqwY6gstK/JlUQ==", "dependencies": [ - "@octokit/openapi-webhooks-types", - "@octokit/request-error", - "@octokit/webhooks-methods" + "@octokit/openapi-webhooks-types@11.0.0", + "@octokit/request-error@6.1.8", + "@octokit/webhooks-methods@5.1.1" + ] + }, + "@octokit/webhooks@14.0.2": { + "integrity": "sha512-16TtZXNOfH8RaRsV+iag5dTYeJvdOdZDBcpEPCULdKS3eTRJqAYxBNZPFaDJ3cx3WNyvbaQ0IxsPpnaR/tgGFA==", + "dependencies": [ + "@octokit/openapi-webhooks-types@12.0.3", + "@octokit/request-error@7.0.0", + "@octokit/webhooks-methods@6.0.0" ] }, "@reflink/reflink-darwin-arm64@0.1.19": { @@ -328,11 +508,11 @@ "@tinyhttp/content-disposition@2.2.2": { "integrity": "sha512-crXw1txzrS36huQOyQGYFvhTeLeG0Si1xu+/l6kXUVYpE0TjFjEZRqTbuadQLfKGZ0jaI+jJoRyqaWwxOSHW2g==" }, - "@types/aws-lambda@8.10.147": { - "integrity": "sha512-nD0Z9fNIZcxYX5Mai2CTmFD7wX7UldCkW2ezCF8D1T5hdiLsnTWDGRpfRYntU6VjTdLQjOvyszru7I1c1oCQew==" + "@types/aws-lambda@8.10.149": { + "integrity": "sha512-NXSZIhfJjnXqJgtS7IwutqIF/SOy1Wz5Px4gUY1RWITp3AYTyuJS4xaXr/bIJY1v15XMzrJ5soGnPM+7uigZjA==" }, - "@types/node@22.13.9": { - "integrity": "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==", + "@types/node@22.15.31": { + "integrity": "sha512-jnVe5ULKl6tijxUhvQeNbQG/84fHfg+yMak02cT8QVhBx/F05rAVxCGBYYTh2EKz22D6JF5ktXuNwdx7b9iEGw==", "dependencies": [ "undici-types" ] @@ -374,8 +554,8 @@ "asynckit@0.4.0": { "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "axios@1.8.1": { - "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", + "axios@1.9.0": { + "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", "dependencies": [ "follow-redirects", "form-data", @@ -385,6 +565,9 @@ "before-after-hook@3.0.2": { "integrity": "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==" }, + "before-after-hook@4.0.0": { + "integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==" + }, "bottleneck@2.19.5": { "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" }, @@ -407,8 +590,8 @@ "chownr@2.0.0": { "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" }, - "ci-info@4.1.0": { - "integrity": "sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A==" + "ci-info@4.2.0": { + "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==" }, "cli-cursor@5.0.0": { "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", @@ -427,13 +610,12 @@ "wrap-ansi" ] }, - "cmake-js@7.3.0": { - "integrity": "sha512-dXs2zq9WxrV87bpJ+WbnGKv8WUBXDw8blNiwNHoRe/it+ptscxhQHKB1SJXa1w+kocLMeP28Tk4/eTCezg4o+w==", + "cmake-js@7.3.1": { + "integrity": "sha512-aJtHDrTFl8qovjSSqXT9aC2jdGfmP8JQsPtjdLAXFfH1BF4/ImZ27Jx0R61TFg8Apc3pl6e2yBKMveAeRXx2Rw==", "dependencies": [ "axios", "debug", "fs-extra", - "lodash.isplainobject", "memory-stream", "node-api-headers", "npmlog", @@ -483,8 +665,8 @@ "which@2.0.2" ] }, - "debug@4.4.0": { - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "debug@4.4.1": { + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dependencies": [ "ms" ] @@ -545,6 +727,9 @@ "fast-content-type-parse@2.0.1": { "integrity": "sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==" }, + "fast-content-type-parse@3.0.0": { + "integrity": "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==" + }, "filename-reserved-regex@3.0.0": { "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==" }, @@ -557,12 +742,13 @@ "follow-redirects@1.15.9": { "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==" }, - "form-data@4.0.2": { - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "form-data@4.0.3": { + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", "dependencies": [ "asynckit", "combined-stream", "es-set-tostringtag", + "hasown", "mime-types" ] }, @@ -648,8 +834,8 @@ "function-bind" ] }, - "ignore@7.0.3": { - "integrity": "sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==" + "ignore@7.0.5": { + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==" }, "inherits@2.0.4": { "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" @@ -719,8 +905,8 @@ "lifecycle-utils@1.7.3": { "integrity": "sha512-T7zs7J6/sgsqwVyG34Sfo5LTQmlPmmqaUe3yBhdF8nq24RtR/HtbkNZRhNbr9BEaKySdSgH+P9H5U9X+p0WjXw==" }, - "lifecycle-utils@2.0.0": { - "integrity": "sha512-KIkV6NeD2n0jZnO+fdIGKI5Or7alyhb6UTFzeaqf6EnE5y3pdK821+kd7yOMBUL/sPYhHU5ny74J0QKslLikGw==" + "lifecycle-utils@2.0.1": { + "integrity": "sha512-jVso5WXIHfDL7Lf9sCRbLbPwgpoha5qUPgi+RMNVIMuOcb0nJ9Qr0r1OXbqLaxzBUQBhN8jYy92RLSk2OGJ6Cg==" }, "lodash-es@4.17.21": { "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" @@ -728,9 +914,6 @@ "lodash.debounce@4.0.8": { "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, - "lodash.isplainobject@4.0.6": { - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, "log-symbols@6.0.0": { "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", "dependencies": [ @@ -738,8 +921,8 @@ "is-unicode-supported@1.3.0" ] }, - "log-symbols@7.0.0": { - "integrity": "sha512-zrc91EDk2M+2AXo/9BTvK91pqb7qrPg2nX/Hy+u8a5qQlbaOflCKO+6SqgZ+M+xUFxGdKTgwnGiL96b1W3ikRA==", + "log-symbols@7.0.1": { + "integrity": "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==", "dependencies": [ "is-unicode-supported@2.1.0", "yoctocolors" @@ -797,17 +980,17 @@ "ms@2.1.3": { "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "nanoid@5.1.2": { - "integrity": "sha512-b+CiXQCNMUGe0Ri64S9SXFcP9hogjAJ2Rd6GdVxhPLRm7mhGaM7VgOvCAJ1ZshfHbqVDI3uqTI5C8/GaKuLI7g==" + "nanoid@5.1.5": { + "integrity": "sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==" }, - "node-addon-api@8.3.1": { - "integrity": "sha512-lytcDEdxKjGJPTLEfW4mYMigRezMlyJY8W4wxJK8zE533Jlb8L8dRuObJFWg2P+AuOIxoCgKF+2Oq4d4Zd0OUA==" + "node-addon-api@8.4.0": { + "integrity": "sha512-D9DI/gXHvVmjHS08SVch0Em8G5S1P+QWtU31appcKT/8wFSPRcdHadIFSAntdMMVM5zz+/DL+bL/gz3UDppqtg==" }, "node-api-headers@1.5.0": { "integrity": "sha512-Yi/FgnN8IU/Cd6KeLxyHkylBUvDTsSScT0Tna2zTrz8klmc8qF2ppj6Q1LHsmOueJWhigQwR4cO2p0XBGW5IaQ==" }, - "node-llama-cpp@3.6.0": { - "integrity": "sha512-SzjsZLuG2pQPPkgMniTgK4sCcslA6ion5L55L8qeGnIb0cAhzVDbJ0Lxl5NhuTMm8KkxVZXF2yTihyulPMSLhw==", + "node-llama-cpp@3.10.0": { + "integrity": "sha512-/l8p+cYzBaw7YNl/xxFR2Q1sqL07LDia5+7ZQ704THbbB2BAHyUGWHg1U3N7PZCw7FlQn50XDHBx2qbDVtbKnQ==", "dependencies": [ "@huggingface/jinja", "@node-llama-cpp/linux-arm64", @@ -834,11 +1017,11 @@ "ignore", "ipull", "is-unicode-supported@2.1.0", - "lifecycle-utils@2.0.0", - "log-symbols@7.0.0", + "lifecycle-utils@2.0.1", + "log-symbols@7.0.1", "nanoid", "node-addon-api", - "octokit", + "octokit@4.1.4_@octokit+core@6.1.5", "ora", "pretty-ms@9.2.0", "proper-lockfile", @@ -861,19 +1044,36 @@ "set-blocking" ] }, - "octokit@4.1.0_@octokit+core@6.1.3": { - "integrity": "sha512-/UrQAOSvkc+lUUWKNzy4ByAgYU9KpFzZQt8DnC962YmQuDiZb1SNJ90YukCCK5aMzKqqCA+z1kkAlmzYvdYKag==", + "octokit@4.1.4_@octokit+core@6.1.5": { + "integrity": "sha512-cRvxRte6FU3vAHRC9+PMSY3D+mRAs2Rd9emMoqp70UGRvJRM3sbAoim2IXRZNNsf8wVfn4sGxVBHRAP+JBVX/g==", "dependencies": [ - "@octokit/app", - "@octokit/core", - "@octokit/oauth-app", - "@octokit/plugin-paginate-graphql", - "@octokit/plugin-paginate-rest", - "@octokit/plugin-rest-endpoint-methods", - "@octokit/plugin-retry", - "@octokit/plugin-throttling", - "@octokit/request-error", - "@octokit/types" + "@octokit/app@15.1.6_@octokit+core@6.1.5", + "@octokit/core@6.1.5", + "@octokit/oauth-app@7.1.6", + "@octokit/plugin-paginate-graphql@5.2.4_@octokit+core@6.1.5", + "@octokit/plugin-paginate-rest@12.0.0_@octokit+core@6.1.5", + "@octokit/plugin-rest-endpoint-methods@14.0.0_@octokit+core@6.1.5", + "@octokit/plugin-retry@7.2.1_@octokit+core@6.1.5", + "@octokit/plugin-throttling@10.0.0_@octokit+core@6.1.5", + "@octokit/request-error@6.1.8", + "@octokit/types", + "@octokit/webhooks@13.9.0" + ] + }, + "octokit@5.0.3_@octokit+core@7.0.2": { + "integrity": "sha512-+bwYsAIRmYv30NTmBysPIlgH23ekVDriB07oRxlPIAH5PI0yTMSxg5i5Xy0OetcnZw+nk/caD4szD7a9YZ3QyQ==", + "dependencies": [ + "@octokit/app@16.0.1_@octokit+core@7.0.2", + "@octokit/core@7.0.2", + "@octokit/oauth-app@8.0.1", + "@octokit/plugin-paginate-graphql@6.0.0_@octokit+core@7.0.2", + "@octokit/plugin-paginate-rest@13.0.1_@octokit+core@7.0.2", + "@octokit/plugin-rest-endpoint-methods@16.0.0_@octokit+core@7.0.2", + "@octokit/plugin-retry@8.0.1_@octokit+core@7.0.2", + "@octokit/plugin-throttling@11.0.1_@octokit+core@7.0.2", + "@octokit/request-error@7.0.0", + "@octokit/types", + "@octokit/webhooks@14.0.2" ] }, "onetime@7.0.0": { @@ -967,8 +1167,8 @@ "safe-buffer@5.2.1": { "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, - "semver@7.7.1": { - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==" + "semver@7.7.2": { + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==" }, "set-blocking@2.0.0": { "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" @@ -988,8 +1188,8 @@ "signal-exit@4.1.0": { "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" }, - "simple-git@3.27.0": { - "integrity": "sha512-ivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+RVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA==", + "simple-git@3.28.0": { + "integrity": "sha512-Rs/vQRwsn1ILH1oBUy8NucJlXmnnLeLCfcvbSehkPzbv3wwoFWIdtfd6Ndo6ZPhlPsCZ60CPI4rxurnwAa+a2w==", "dependencies": [ "@kwsites/file-exists", "@kwsites/promise-deferred", @@ -1072,14 +1272,14 @@ "toad-cache@3.7.0": { "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==" }, - "undici-types@6.20.0": { - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" + "undici-types@6.21.0": { + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" }, - "universal-github-app-jwt@2.2.0": { - "integrity": "sha512-G5o6f95b5BggDGuUfKDApKaCgNYy2x7OdHY0zSMF081O0EJobw+1130VONhrA7ezGSV2FNOGyM+KQpQZAr9bIQ==" + "universal-github-app-jwt@2.2.2": { + "integrity": "sha512-dcmbeSrOdTnsjGjUfAlqNDJrhxXizjAz94ija9Qw8YkZ1uu0d+GoZzyH+Jb9tIIqvGsadUfwg+22k5aDqqwzbw==" }, - "universal-user-agent@7.0.2": { - "integrity": "sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==" + "universal-user-agent@7.0.3": { + "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==" }, "universalify@2.0.1": { "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==" @@ -1090,8 +1290,8 @@ "util-deprecate@1.0.2": { "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, - "validate-npm-package-name@6.0.0": { - "integrity": "sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==" + "validate-npm-package-name@6.0.1": { + "integrity": "sha512-OaI//3H0J7ZkR1OqlhGA8cA+Cbk/2xFOQpJOt5+s27/ta9eZwpeervh4Mxh4w0im/kdgktowaqVNR7QOrUd7Yg==" }, "which@2.0.2": { "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", @@ -1144,102 +1344,6 @@ "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==" } }, - "redirects": { - "https://esm.sh/@octokit/app@^15.1.2?target=denonext": "https://esm.sh/@octokit/app@15.1.2?target=denonext", - "https://esm.sh/@octokit/auth-app@^7.1.4?target=denonext": "https://esm.sh/@octokit/auth-app@7.1.4?target=denonext", - "https://esm.sh/@octokit/auth-oauth-app@^8.1.2?target=denonext": "https://esm.sh/@octokit/auth-oauth-app@8.1.2?target=denonext", - "https://esm.sh/@octokit/auth-oauth-device@^7.1.2?target=denonext": "https://esm.sh/@octokit/auth-oauth-device@7.1.2?target=denonext", - "https://esm.sh/@octokit/auth-oauth-user@^5.1.2?target=denonext": "https://esm.sh/@octokit/auth-oauth-user@5.1.2?target=denonext", - "https://esm.sh/@octokit/auth-token@^5.0.0?target=denonext": "https://esm.sh/@octokit/auth-token@5.1.2?target=denonext", - "https://esm.sh/@octokit/auth-unauthenticated@^6.1.1?target=denonext": "https://esm.sh/@octokit/auth-unauthenticated@6.1.1?target=denonext", - "https://esm.sh/@octokit/core@^6.1.3?target=denonext": "https://esm.sh/@octokit/core@6.1.3?target=denonext", - "https://esm.sh/@octokit/endpoint@^10.0.0?target=denonext": "https://esm.sh/@octokit/endpoint@10.1.2?target=denonext", - "https://esm.sh/@octokit/graphql@^8.1.2?target=denonext": "https://esm.sh/@octokit/graphql@8.2.0?target=denonext", - "https://esm.sh/@octokit/oauth-app@^7.1.4?target=denonext": "https://esm.sh/@octokit/oauth-app@7.1.5?target=denonext", - "https://esm.sh/@octokit/oauth-app@^7.1.5?target=denonext": "https://esm.sh/@octokit/oauth-app@7.1.5?target=denonext", - "https://esm.sh/@octokit/oauth-authorization-url@^7.0.0?target=denonext": "https://esm.sh/@octokit/oauth-authorization-url@7.1.1?target=denonext", - "https://esm.sh/@octokit/oauth-methods@^5.1.2?target=denonext": "https://esm.sh/@octokit/oauth-methods@5.1.3?target=denonext", - "https://esm.sh/@octokit/oauth-methods@^5.1.3?target=denonext": "https://esm.sh/@octokit/oauth-methods@5.1.3?target=denonext", - "https://esm.sh/@octokit/plugin-paginate-graphql@^5.2.4?target=denonext": "https://esm.sh/@octokit/plugin-paginate-graphql@5.2.4?target=denonext", - "https://esm.sh/@octokit/plugin-paginate-rest@^11.3.6?target=denonext": "https://esm.sh/@octokit/plugin-paginate-rest@11.4.0?target=denonext", - "https://esm.sh/@octokit/plugin-paginate-rest@^11.4.0?target=denonext": "https://esm.sh/@octokit/plugin-paginate-rest@11.4.0?target=denonext", - "https://esm.sh/@octokit/plugin-rest-endpoint-methods@^13.3.0?target=denonext": "https://esm.sh/@octokit/plugin-rest-endpoint-methods@13.3.0?target=denonext", - "https://esm.sh/@octokit/plugin-retry@^7.1.3?target=denonext": "https://esm.sh/@octokit/plugin-retry@7.1.3?target=denonext", - "https://esm.sh/@octokit/plugin-throttling@^9.4.0?target=denonext": "https://esm.sh/@octokit/plugin-throttling@9.4.0?target=denonext", - "https://esm.sh/@octokit/request-error@^6.0.1?target=denonext": "https://esm.sh/@octokit/request-error@6.1.6?target=denonext", - "https://esm.sh/@octokit/request-error@^6.1.6?target=denonext": "https://esm.sh/@octokit/request-error@6.1.6?target=denonext", - "https://esm.sh/@octokit/request@^9.1.4?target=denonext": "https://esm.sh/@octokit/request@9.2.0?target=denonext", - "https://esm.sh/@octokit/webhooks-methods@^5.0.0?target=denonext": "https://esm.sh/@octokit/webhooks-methods@5.1.0?target=denonext", - "https://esm.sh/@octokit/webhooks@^13.4.2?target=denonext": "https://esm.sh/@octokit/webhooks@13.5.0?target=denonext", - "https://esm.sh/before-after-hook@^3.0.2?target=denonext": "https://esm.sh/before-after-hook@3.0.2?target=denonext", - "https://esm.sh/bottleneck@^2.15.3/light?target=denonext": "https://esm.sh/bottleneck@2.19.5/light?target=denonext", - "https://esm.sh/fast-content-type-parse@^2.0.0?target=denonext": "https://esm.sh/fast-content-type-parse@2.0.1?target=denonext", - "https://esm.sh/octokit?dts": "https://esm.sh/octokit@4.1.0?dts", - "https://esm.sh/toad-cache@^3.7.0?target=denonext": "https://esm.sh/toad-cache@3.7.0?target=denonext", - "https://esm.sh/universal-github-app-jwt@^2.2.0?target=denonext": "https://esm.sh/universal-github-app-jwt@2.2.0?target=denonext", - "https://esm.sh/universal-user-agent@^7.0.0?target=denonext": "https://esm.sh/universal-user-agent@7.0.2?target=denonext", - "https://esm.sh/universal-user-agent@^7.0.2?target=denonext": "https://esm.sh/universal-user-agent@7.0.2?target=denonext" - }, - "remote": { - "https://esm.sh/@octokit/app@15.1.2/denonext/app.mjs": "21c4fdfecfc4540b17c21b3c0cf1e0a5c7eb55bab034978af33d7dd7a06ab4ab", - "https://esm.sh/@octokit/app@15.1.2?target=denonext": "51ad31b108532bc255a43647574518580d5e95d5ad7a968df7bb477b71b59e79", - "https://esm.sh/@octokit/auth-app@7.1.4/denonext/auth-app.mjs": "c2c8bc96d4760e5a0af7535c1aa669ebc8b490764b575d8113632515f11760c6", - "https://esm.sh/@octokit/auth-app@7.1.4?target=denonext": "a4632ee3c6af2cfde6e6249c13d5d7706575649ac570389f6117bd37eab0b523", - "https://esm.sh/@octokit/auth-oauth-app@8.1.2/denonext/auth-oauth-app.mjs": "1803a9d024ec1d9b53c9fdc5d386d05990ee6b6715d2ad79619f8452fd9d5d13", - "https://esm.sh/@octokit/auth-oauth-app@8.1.2?target=denonext": "8c48ca11c1b9e2d08c56555fa61b13cb5050366b3e0412ceb19a1e314f355015", - "https://esm.sh/@octokit/auth-oauth-device@7.1.2/denonext/auth-oauth-device.mjs": "24ac890f2a933a5532ea37f9e94b1185c24dfd163339300fce36a132f2ccd6d3", - "https://esm.sh/@octokit/auth-oauth-device@7.1.2?target=denonext": "f2d03bf3a4208a0cabd8e4b85c98d633f857678e811bf6de4429d1d9439da0eb", - "https://esm.sh/@octokit/auth-oauth-user@5.1.2/denonext/auth-oauth-user.mjs": "4f1ce58465e50c7f79d58794976da1853f9785bf5434b19d81a50c400a9ed858", - "https://esm.sh/@octokit/auth-oauth-user@5.1.2?target=denonext": "54d806f7a2b19086b880d27cbbf863985c9f9f26914c031a99ad849a85cdbcbe", - "https://esm.sh/@octokit/auth-token@5.1.2/denonext/auth-token.mjs": "360feb2cb940bfa2e20ba6e5b7c366b207e7b8cb3a2ff983f3d33b19087cdc50", - "https://esm.sh/@octokit/auth-token@5.1.2?target=denonext": "0e5dc846d0c00da36580f08e0d4115526daf6256acf07fabedc06716dfbf72c9", - "https://esm.sh/@octokit/auth-unauthenticated@6.1.1/denonext/auth-unauthenticated.mjs": "1cd86628013b6444922993cd740ed0a327dd220ac465595ccad05de8fb2f80f8", - "https://esm.sh/@octokit/auth-unauthenticated@6.1.1?target=denonext": "a00a18f165e48e1d98e6d5e4266aee4a0bde051b7342c54ebd838d2547538ae4", - "https://esm.sh/@octokit/core@6.1.3/denonext/core.mjs": "27711bac5522d962bca6513035a3ab2e55c001f49e050175bb67bbedd4049535", - "https://esm.sh/@octokit/core@6.1.3?target=denonext": "48e4022a4e8ae6df3eec7b9028bfc452b113f1746c81737861b06d44c6791f03", - "https://esm.sh/@octokit/endpoint@10.1.2/denonext/endpoint.mjs": "10aa9cb55330d89ef4392f710c7f1132b30d3018d1a548af90d50837ad8d8640", - "https://esm.sh/@octokit/endpoint@10.1.2?target=denonext": "e44433015f71eb9ebf694f7e66880a96505b503e0d6f172c63267259cf7810e7", - "https://esm.sh/@octokit/graphql@8.2.0/denonext/graphql.mjs": "a26719a9e0adfc72773caaca5857a67ddf54b7824efd0f4585c4a14bba66a566", - "https://esm.sh/@octokit/graphql@8.2.0?target=denonext": "f1f248a1461a1c8a230e0d45dd6979a21205c29941ee790ef9d779da05259305", - "https://esm.sh/@octokit/oauth-app@7.1.5/denonext/oauth-app.mjs": "946907b1ce34610a973305985d4861e2377b83cb463dcd1724ffb917af8188c9", - "https://esm.sh/@octokit/oauth-app@7.1.5?target=denonext": "373b5044d98bccffa8aa0dc180c9f013a5e6ae95eba0b4481feb7204458d4c1b", - "https://esm.sh/@octokit/oauth-authorization-url@7.1.1/denonext/oauth-authorization-url.mjs": "209de15074485c12e6bffaed0f33d857c789df4a577b19ddbd78caa9646b77dc", - "https://esm.sh/@octokit/oauth-authorization-url@7.1.1?target=denonext": "fdaed10ede57c5e5a3ae67b487331336916d5401d366bed1425515e104b95de1", - "https://esm.sh/@octokit/oauth-methods@5.1.3/denonext/oauth-methods.mjs": "9043d6ed33f54207cab9966eb6f984f87e62c5c4ed3e019aa3b28d02ea738eac", - "https://esm.sh/@octokit/oauth-methods@5.1.3?target=denonext": "d185bf52b6cd01f4d13fcf25ca7bce03e8534b06835c0ad6783366c6676311a6", - "https://esm.sh/@octokit/plugin-paginate-graphql@5.2.4/denonext/plugin-paginate-graphql.mjs": "a2b0869cb5eb1e14516d1d2ba227e2b968afe05ed9b3895f005ac196e7b5c5a1", - "https://esm.sh/@octokit/plugin-paginate-graphql@5.2.4?target=denonext": "1512bade9daddb1ffe8fc46693db5dd3df429d51264e6848e3de3ea0cd16bc61", - "https://esm.sh/@octokit/plugin-paginate-rest@11.4.0/denonext/plugin-paginate-rest.mjs": "3bb02e7f514dee857103ceb9d922621bed80115bfe0fb1d7197a7a7cd44cfa6f", - "https://esm.sh/@octokit/plugin-paginate-rest@11.4.0?target=denonext": "b4e0d949bdd6a34257cddde0262ca67e82a158aba5bbfeb00f54e6939770c17b", - "https://esm.sh/@octokit/plugin-rest-endpoint-methods@13.3.0/denonext/plugin-rest-endpoint-methods.mjs": "8254da50e1460596143fb2d49314f97fc0b9bae60d0259594c3a6b98bca5c266", - "https://esm.sh/@octokit/plugin-rest-endpoint-methods@13.3.0?target=denonext": "b54fb93130dea1a56de1d434e6c900793ab05281c0086129cbd60411a07039bd", - "https://esm.sh/@octokit/plugin-retry@7.1.3/denonext/plugin-retry.mjs": "b55a731984d30e256309ef0ad6eca64d34ea4cc61c747f711b7c45b0e4e1b086", - "https://esm.sh/@octokit/plugin-retry@7.1.3?target=denonext": "5f0e94e59f4a593ef911c8c10796a73d9ef5289505c129a647f90fdf3405d833", - "https://esm.sh/@octokit/plugin-throttling@9.4.0/denonext/plugin-throttling.mjs": "50c4a67edc2bba79d81f5ea8966175a3acffbffe3403b5815da172e0c12ab686", - "https://esm.sh/@octokit/plugin-throttling@9.4.0?target=denonext": "d40a7eb26c4897bb17e4cddd341a25f85ea0607798d5ee3e48014693f07e98b5", - "https://esm.sh/@octokit/request-error@6.1.6/denonext/request-error.mjs": "a3bb74761fbdc7b1fbc406f0a2ace10f82f64706ffc9596a90badef765414c5e", - "https://esm.sh/@octokit/request-error@6.1.6?target=denonext": "bfebd513aea83d3df72e2f0b70f9e2dcd7aafed463c095f7388ca3dd10621e7d", - "https://esm.sh/@octokit/request@9.2.0/denonext/request.mjs": "662411deed3a6c54a960c802b24795bc8ce65649e0a941ba848fa6f68e7d0070", - "https://esm.sh/@octokit/request@9.2.0?target=denonext": "550f4054c2e0eba7174dd21aa9117e6934f3bb3d3b3c43f6d4a1471cef3a04d9", - "https://esm.sh/@octokit/webhooks-methods@5.1.0/denonext/webhooks-methods.mjs": "fdaefa3e104afcf645fb3a35a1bb557c31e7d069342f1518df72fd5662c28932", - "https://esm.sh/@octokit/webhooks-methods@5.1.0?target=denonext": "5a77eef071b9134be9a6ed9358b553195aae275b36e7b7e7c146f0b90d1baa92", - "https://esm.sh/@octokit/webhooks@13.5.0/denonext/webhooks.mjs": "b94ff89a92ac22f1cd0307314d976fa5a34a0a731d7e79bf8962201fb3ecd013", - "https://esm.sh/@octokit/webhooks@13.5.0?target=denonext": "6e3bc47e2034b2421d1c5e4cf652aa0a330c887aa69c6bf704923eda42722ae7", - "https://esm.sh/before-after-hook@3.0.2/denonext/before-after-hook.mjs": "1a862839e15e4816de946c11023cbec3cb1d276e3a86073adfaac9dca6871aca", - "https://esm.sh/before-after-hook@3.0.2?target=denonext": "923592fc40b4609eac335800f88c890d81c5f5f12e0b22fd8fd0646313c634f7", - "https://esm.sh/bottleneck@2.19.5/denonext/light.mjs": "943b72d08b33e678a4f64bf2ce9a0468f9356ee65092af9c893fa25d3be6518b", - "https://esm.sh/bottleneck@2.19.5/light?target=denonext": "c53ee9007926e5a49e291e0a0f2e1113735d65271a33eb609ac9ad309def4878", - "https://esm.sh/fast-content-type-parse@2.0.1/denonext/fast-content-type-parse.mjs": "436d0ff6ce4508efcb9023892d25cc9d7eb321e9321a0d3aaf870300dc2e8578", - "https://esm.sh/fast-content-type-parse@2.0.1?target=denonext": "7170ebd0186887d73afc67050a28e5350171e5e842e82a10309e829eabdf138a", - "https://esm.sh/octokit@4.1.0/denonext/octokit.mjs": "0e522b2239c7f7d673022e81dd55b2dcb6ce42b905f1cfc82a5dfbbd2c24af28", - "https://esm.sh/octokit@4.1.0?dts": "094de1c868d2aaa8be65d7135d3feeee8006a5e2d76683f5bfcc32243557cdfc", - "https://esm.sh/toad-cache@3.7.0/denonext/toad-cache.mjs": "63b78525dcc99d8f736de244e46b306b2b5f6c72db75bf1d230230d46a06ab37", - "https://esm.sh/toad-cache@3.7.0?target=denonext": "e17c2f2729b3268a6ecb412b975002ebaa66894c2e5e0a657a38d1176a1f02d4", - "https://esm.sh/universal-github-app-jwt@2.2.0/denonext/universal-github-app-jwt.mjs": "c7cb04f796b43f163b1bcaf2b85c742d11ae724ae5ea82dbe517617c33bd0467", - "https://esm.sh/universal-github-app-jwt@2.2.0?target=denonext": "75d402511284eb488f2f2c0f39cc5122ec91c3de1a18eebe1360f2935a0e577a", - "https://esm.sh/universal-user-agent@7.0.2/denonext/universal-user-agent.mjs": "c5370728870841e1061776d12f5776929bb04945b0f8d5e4251207eab57d35ea", - "https://esm.sh/universal-user-agent@7.0.2?target=denonext": "1c7589a3ed835be8bf13e6c78c7d507af65b7945b92edbf3ad25428e60e072f4" - }, "workspace": { "dependencies": [ "jsr:@eta-dev/eta@^3.5.0", @@ -1249,11 +1353,11 @@ "jsr:@std/collections@^1.0.10", "jsr:@std/dotenv@~0.225.3", "jsr:@std/path@^1.0.8", - "npm:@types/node@^22.13.9", + "npm:@types/node@^22.15.29", "npm:jmespath@0.16", "npm:lodash-es@^4.17.21", - "npm:node-llama-cpp@^3.6.0", - "npm:octokit@^4.1.0" + "npm:node-llama-cpp@^3.10.0", + "npm:octokit@^5.0.3" ] } } diff --git a/src/ai/remote-functions.ts b/src/ai/remote-functions.ts new file mode 100644 index 0000000..7bf3ae3 --- /dev/null +++ b/src/ai/remote-functions.ts @@ -0,0 +1,96 @@ +import { getLogger } from "@logtape/logtape" +import { + ChatSessionModelFunctions, + defineChatSessionFunction, + GbnfJsonSchema, +} from "npm:node-llama-cpp" + +type RemoteFunction = { + name: string + description: string + parameters?: Readonly + [key: string]: unknown +} + +const remoteLogger = getLogger(["remote-functions"]) + +export async function fetchRemoteFunctions( + host = Deno.env.get("REMOTE_FUNCTIONS_HOST") || + "http://localhost:1337/", +): Promise { + const url = new URL(host) + url.pathname = url.pathname.replace(/\/$/, "") + "/client/functions.json" + const response = await fetch(url.toString(), { + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${Deno.env.get("REMOTE_FUNCTIONS_TOKEN") || ""}`, + }, + }) + + if (!response.ok) { + throw new Error(`Failed to call remote function: ${response.statusText}`) + } + + const functions = await response.json() as RemoteFunction[] + + if (!Array.isArray(functions)) { + throw new Error("Invalid response format, expected an array of functions") + } + + return functions.reduce((acc, func) => { + if (!func.name || !func.description) { + throw new Error( + `Function ${JSON.stringify(func)} is missing required fields`, + ) + } + acc[func.name] = defineChatSessionFunction({ + description: func.description, + params: func.parameters, + handler: async (args) => { + try { + const url = new URL(host) + url.pathname = url.pathname.replace(/\/$/, "") + + "/client/remote-function/" + func.name + const requestBody = { + arguments: args, + } + const requestHeaders = { + "Content-Type": "application/json", + Authorization: `Bearer ${ + Deno.env.get("REMOTE_FUNCTIONS_TOKEN") || "" + }`, + } + remoteLogger.info("Calling backend:", { + url: url.toString(), + headers: requestHeaders, + body: requestBody, + }) + const response = await fetch(url.toString(), { + method: "POST", + headers: requestHeaders, + body: JSON.stringify(requestBody), + }) + remoteLogger.info("Response status:", { status: response.status }) + + if (!response.ok) { + return ( + `Failed to call remote function: ${response.statusText} ${await response + .text()}` + ) + } + + const responseText = await response.text() + remoteLogger.info("Response text:", { responseText }) + return responseText + } catch (error) { + console.error( + `Error calling remote function ${func.name}: \n`, + error, + ) + throw error + } + }, + }) + return acc + }, {} as Record>) +} diff --git a/src/msg-handlers/base-handler.ts b/src/msg-handlers/base-handler.ts index e4fa0b1..d6193df 100644 --- a/src/msg-handlers/base-handler.ts +++ b/src/msg-handlers/base-handler.ts @@ -1,10 +1,12 @@ import { EventEmitter } from "node:events" -import {Bot, Message, User} from "../snek/snek-socket.ts" +import { Bot, Message, User } from "../snek/snek-socket.ts" import { trim } from "npm:lodash-es" export abstract class BaseHandler extends EventEmitter { prefix = "msg-handler" - user: User|null = null + user: User | null = null + + autoTyping = true constructor(prefix: string) { super() @@ -16,22 +18,31 @@ export abstract class BaseHandler extends EventEmitter { bot.on("message", async (message) => { try { if (await this.isMatch(message)) { + let typingIndicator: number | undefined = undefined + if (this.autoTyping) { + typingIndicator = setInterval(() => { + bot.setTyping(message.channelUID).catch(console.error) + }, 2000) + } try { await this.handleMessage(message, bot) } catch (e) { message.reply("An error occurred while handling your message") - console.error("Error handling message", e) + console.error("Error handling message", e, message) + } finally { + clearInterval(typingIndicator) } } } catch (e) { - console.error("Error checking message", e) + console.error("Error checking message", e, message) } }) } async isMatch(message: Message): Promise { - return message.userUID !== this.user?.uid && - trim(message?.message, ' `').toLowerCase().startsWith(this.prefix) + return message.message && message.userUID !== this.user?.uid && + message.isFinal && + trim(message?.message, " `").toLowerCase().startsWith(this.prefix) } abstract handleMessage( diff --git a/src/msg-handlers/img-gen-handler.ts b/src/msg-handlers/img-gen-handler.ts index b88e1f6..cc489cb 100644 --- a/src/msg-handlers/img-gen-handler.ts +++ b/src/msg-handlers/img-gen-handler.ts @@ -1,10 +1,10 @@ -import {Bot, Message} from "../snek/snek-socket.ts" -import {BaseHandler} from "./base-handler.ts" -import {ImgGen} from "../util/img-gen.ts" -import {Eta} from "jsr:@eta-dev/eta" +import { Bot, Message } from "../snek/snek-socket.ts" +import { BaseHandler } from "./base-handler.ts" +import { ImgGen } from "../util/img-gen.ts" +import { Eta } from "jsr:@eta-dev/eta" +import { trim } from "npm:lodash-es" import { getLogger } from "@logtape/logtape" import * as path from "node:path" -import {randomUUID} from "node:crypto"; const TEMPLATES = new Eta({ views: path.join(Deno.cwd(), "templates/img-gen") }) @@ -15,7 +15,7 @@ const logger = getLogger(["img-gen-handler"]) const parsePrompt = (prompt: string): Record => { try { return JSON.parse(prompt) - } catch (e) { + } catch (_e) { prompt = prompt.replace(FORMATTING_WRAPPER, "$1") return JSON.parse(prompt) } @@ -23,12 +23,12 @@ const parsePrompt = (prompt: string): Record => { export class ImgGenHandler extends BaseHandler { #imageGenerator = new ImgGen() - #activeTemplate = "ultra-real.eta" + #activeTemplate = "ddmv4.eta" #templateVariables: Record = { - steps: 20, + steps: 0, seed: 0, - cfg: 3.0, - sampler: "euler", + cfg: 0, + sampler: "", negativePrompt: "", batchSize: 1, width: 1024, @@ -39,6 +39,12 @@ export class ImgGenHandler extends BaseHandler { "prompt": this.prompt.bind(this), "template": this.template.bind(this), "variables": this.variables.bind(this), + "status": this.status.bind(this), + "clear": this.clear.bind(this), + "interrupt": this.interrupt.bind(this), + "delete": this.delete.bind(this), + "free": this.free.bind(this), + "help": this.help.bind(this), } as Record void> constructor() { @@ -46,11 +52,15 @@ export class ImgGenHandler extends BaseHandler { } override async handleMessage(message: Message, bot: Bot) { - const newMessage = message.message.substring(this.prefix.length).trim() - if (!newMessage) { + const newMessage = message.message.substring( + message.message.indexOf(" "), + message.message.length, + ).trim() + if (!newMessage || !message.message.includes(" ")) { message.reply( - "No command given, try one of: " + - Object.keys(this.#subCommands).join(", "), + `No command given, try one of: ${ + Object.keys(this.#subCommands).join(", ") + }`, ) return } @@ -58,16 +68,16 @@ export class ImgGenHandler extends BaseHandler { const [[_, command, rest]] = newMessage.matchAll(/^(\S+)\s*(.*)$/gs) if (command in this.#subCommands) { - this.#subCommands[command]?.(rest.trim(), message, bot) - return + return this.#subCommands[command]?.(rest.trim(), message, bot) } - message.reply( - "Invalid command, assuming prompt. Otherwise these are the correct ones: " + - Object.keys(this.#subCommands).join(", "), - ) + // message.reply( + // `Invalid command, assuming prompt. Otherwise these are the correct ones: ${ + // Object.keys(this.#subCommands).join(", ") + // }`, + // ) - await this.prompt(newMessage, message, bot) + return this.prompt(newMessage, message, bot) } async prompt(command: string, message: Message, bot: Bot) { @@ -75,44 +85,69 @@ export class ImgGenHandler extends BaseHandler { message.reply("No prompt given") return } + + let messageId: string | undefined = undefined + try { - logger.info("Generating image", { command, variables: this.#templateVariables, message }) + logger.info("Generating image", { + command, + variables: this.#templateVariables, + message, + }) + const randomSeed = ( + min: number = 0, + max: number = Number.MAX_SAFE_INTEGER, + ) => Math.floor(Math.random() * (max - min + 1)) + min + + const basePrompt = trim(command.replaceAll("\n", " "), " `.,\"'") const prompt = parsePrompt( await TEMPLATES.renderAsync(this.#activeTemplate, { ...this.#templateVariables, - randomSeed: ( - min: number = 0, - max: number = Number.MAX_SAFE_INTEGER, - ) => Math.floor(Math.random() * (max - min + 1)) + min, - prompt: command.replaceAll("\n", " "), + randomSeed, + iterationSeed: randomSeed(), + prompt: basePrompt, }), ) - message.reply("image generated called") - const promptResults = await this.#imageGenerator.dispatchPrompt( prompt, + (promptResponse) => { + messageId = promptResponse.prompt_id + message.reply(`Started generating the image with ID: ${messageId}`) + }, ) const blob = promptResults.filter((result) => result instanceof Blob) if (blob.length === 0) { - console.log("Prompt Results: ", promptResults) - message.reply("Failed to generate image") + console.error("No images for ", promptResults) + message.reply(`No images were generated for ${messageId}`) return } const files = await Promise.all( blob.map(async (blob) => - new File([(await blob.arrayBuffer()).slice(8)], `${randomUUID()}.png`) + new File([(await blob.arrayBuffer()).slice(8)], `${messageId}.png`) ), ) - await bot.uploadFiles(message.channelUID, ...files) + const upload = await bot.uploadFiles(message.channelUID, ...files) + const res = await upload.json() + + message.messageChannel( + res.files.map((file) => + `[${file.name}](/channel/attachment/${file.relative_url})` + ).join("\n\n"), + ) + message.reply( + `Finished generating image ${messageId} of \`${basePrompt}\``, + ) } catch (e) { - console.error(e) - message.reply(`Failed to generate image: ${e.message}`) + logger.error("Failed to generate image", { error: e }) + message.reply( + `Failed to generate image (${messageId}): ${(e as Error).message}`, + ) } } @@ -151,7 +186,7 @@ export class ImgGenHandler extends BaseHandler { this.#activeTemplate = template message.reply(`Template set to ${template}`) } catch (e) { - message.reply(`Failed to load template: ${e.message}`) + message.reply(`Failed to load template: ${(e as Error).message}`) return } } @@ -184,4 +219,60 @@ export class ImgGenHandler extends BaseHandler { this.#templateVariables[variable] = value message.reply(`Variable set: ${variable} = ${value}`) } + + async status(command: string, message: Message, bot: Bot) { + message.reply(`Status: ${this.#imageGenerator.lastMessage}`) + } + + override async isMatch(message: Message): Promise { + if (!message.message || !message.isFinal) { + return false + } + + const botName = (await message.bot.user)?.username.toLowerCase() + + return await super.isMatch(message) || + (!!message.message && + message.message.toLowerCase().startsWith(`@${botName}`) && + !message.message.toLowerCase().startsWith(`@${botName}:`)) + } + + async clear(command: string, message: Message, bot: Bot) { + await this.#imageGenerator.clearPromptQueue() + message.reply("Cleared prompt queue") + } + + async interrupt(command: string, message: Message, bot: Bot) { + await this.#imageGenerator.interruptActivePrompt() + message.reply("Interrupted active prompt") + } + + async free(command: string, message: Message, bot: Bot) { + await this.#imageGenerator.freeVRAM() + message.reply("vram freed") + } + + async delete(command: string, message: Message, bot: Bot) { + if (!command) { + message.reply("No id given to delete") + return + } + + const ids = command.split(/\s+/g) + + if (ids.length === 0) { + message.reply("No IDs found") + return + } + + await this.#imageGenerator.cancelPrompts(...ids) + message.reply(`Deleted prompt(s) ${ids.join(", ")}`) + } + + async help(command: string, message: Message, bot: Bot) { + message.reply( + `Commands: ${Object.keys(this.#subCommands).join(", ")}\n\n` + + `Use \`${this.prefix} \` to use the commands.\n\n`, + ) + } } diff --git a/src/msg-handlers/llama-func-handler.ts b/src/msg-handlers/llama-func-handler.ts new file mode 100644 index 0000000..de4e440 --- /dev/null +++ b/src/msg-handlers/llama-func-handler.ts @@ -0,0 +1,440 @@ +import { BaseHandler } from "./base-handler.ts" +import { Bot, Channel, Message } from "../snek/snek-socket.ts" +import { trim, trimStart } from "npm:lodash-es" +import { + ChatSessionModelFunctions, + ChatWrapper, + defineChatSessionFunction, + GemmaChatWrapper, + GeneralChatWrapper, + getLlama, + LLamaChatPromptOptions, + LlamaChatSession, + LlamaContext, + LlamaModel, + resolveChatWrapper, + Token, +} from "npm:node-llama-cpp" +import { getLogger } from "@logtape/logtape" +import { deepMerge } from "@std/collections/deep-merge" +import { fetchRemoteFunctions } from "../ai/remote-functions.ts" + +const llama = await getLlama() + +const textEncoder = new TextEncoder() + +function printSync(input: string | Uint8Array, to = Deno.stdout) { + let bytesWritten = 0 + const bytes = typeof input === "string" ? textEncoder.encode(input) : input + while (bytesWritten < bytes.length) { + bytesWritten += to.writeSync(bytes.subarray(bytesWritten)) + } +} +const logger = getLogger(["llama-gen-handler"]) + +const optionsGenerator = < + const Functions extends ChatSessionModelFunctions | undefined = + | ChatSessionModelFunctions + | undefined, + LLamaOptions extends LLamaChatPromptOptions = + LLamaChatPromptOptions, +>( + model: LlamaModel, + debugOutput: boolean = true, + defaultTimeout = 5 * 60 * 1000, + options?: LLamaOptions, +): LLamaOptions => { + const manager = AbortSignal.timeout(defaultTimeout) + + const defaultOptions = { + repeatPenalty: { + lastTokens: 24, + penalty: 1.12, + penalizeNewLine: true, + frequencyPenalty: 0.02, + presencePenalty: 0.02, + punishTokensFilter: (tokens: Token[]) => { + return tokens.filter((token) => { + const text = model.detokenize([token]) + + // allow the model to repeat tokens + // that contain the word "better" + return !text.toLowerCase().includes("@") + // TODO: Exclude usernames + }) + }, + }, + temperature: 0.7, + minP: 0.03, + + // topK: 64, + // topP: 0.95, + // minP: 0.01, + signal: manager, + stopOnAbortSignal: true, + } as LLamaOptions + + if (debugOutput) { + defaultOptions.onResponseChunk = (chunk) => { + options?.onResponseChunk?.(chunk) + const isThoughtSegment = chunk.type === "segment" && + chunk.segmentType === "thought" + + if ( + chunk.type === "segment" && chunk.segmentStartTime != null + ) { + printSync(` [segment start: ${chunk.segmentType}] `) + } + + printSync(chunk.text) + + if (chunk.type === "segment" && chunk.segmentEndTime != null) { + printSync(` [segment end: ${chunk.segmentType}] `) + } + } + } + + return deepMerge(defaultOptions, options ?? {}) +} + +export class LLamaFuncHandler extends BaseHandler { + joinMode = new Map() + streamMode = false + debugLogResponses = true + + systemPrompt: string + + #activeModel: string + + #model: LlamaModel | null = null + #context: LlamaContext | null = null + + #chatWrapper: ChatWrapper | null = null + + #session: LlamaChatSession | null = null + #subCommands = { + "prompt": this.prompt.bind(this), + "join": this.join.bind(this), + "stream": this.stream.bind(this), + "reset": this.reset.bind(this), + } as Record void> + + constructor( + activeModel: string, + systemPrompt: string = "You are an AI chatbot.", + ) { + super("") + this.#activeModel = activeModel + this.systemPrompt = systemPrompt + this.autoTyping = false + } + + async calculateSystemPrompt(): Promise { + return this.systemPrompt + } + + override async bind(bot: Bot): Promise { + await super.bind(bot) + this.prefix = this.user!.username.toLowerCase() + + this.#model = await llama.loadModel({ + modelPath: this.#activeModel, + defaultContextFlashAttention: true, + }) + + this.#context = await this.#model.createContext({ + flashAttention: true, + }) + + logger.info("Model loaded", { + batchSize: this.#context.batchSize, + contextSize: this.#context.contextSize, + }) + + this.#chatWrapper = //new Llama3ChatWrapper() + resolveChatWrapper(this.#model) ?? new GeneralChatWrapper() + + this.#session = new LlamaChatSession({ + contextSequence: this.#context.getSequence(), + chatWrapper: this.#chatWrapper, + systemPrompt: await this.calculateSystemPrompt(), + }) + + // const channels = await bot.channels + + // const channel = channels.find((v) => v.tag === "public") || channels[0] + + // if (channel) { + // await bot.sendMessage( + // channel.uid, + // await this.cleanResponse( + // await this.#session.prompt( + // "Welcome to chat, greet everyone\n", + // optionsGenerator(this.#model, this.debugLogResponses), + // ), + // null, + // bot, + // ), + // ) + // this.#session.resetChatHistory() + // } + + // logger.info("LLamaHandler bound to bot") + } + + cachedChannels: Channel[] | null = null + async isInJoinMode(channelUID: string, bot: Bot): Promise { + if (!this.joinMode.has(channelUID)) { + if (!this.cachedChannels) { + this.cachedChannels = await bot.channels + } + const channel = this.cachedChannels?.find((c) => c.uid === channelUID) + if (channel) { + this.joinMode.set(channelUID, channel.tag === "dm") + } else { + logger.warn("Channel not found in cached channels", { channelUID }) + this.cachedChannels = await bot.channels + } + } + return this.joinMode.get(channelUID) ?? false + } + + override async isMatch(message: Message): Promise { + return message + .userUID !== this.user?.uid && + message.isFinal && + (await this.isInJoinMode(message.channelUID, message.bot) || + trim(message?.message, " `").toLowerCase().includes(this.prefix)) + } + + async cleanResponse( + response: string, + message: Message | null, + bot: Bot, + ): Promise { + const session = this.#session + const user = this.user + + response = trim(response.replace(/.*?<\/think>/gs, ""), '" \t') + let lwResponse = response.toLowerCase() + + if (lwResponse.startsWith("ai")) { + response = response.substring(2).trim() + lwResponse = response.toLowerCase() + } + + if (user && lwResponse.startsWith(`@${user.username.toLowerCase()}:`)) { + response = response.substring(user.username.length + 2).trim() + lwResponse = response.toLowerCase() + } + + if ( + message && lwResponse.startsWith(`@${message.username.toLowerCase()}:`) + ) { + response = response.substring(message.username.length + 2).trim() + lwResponse = response.toLowerCase() + } + + if (user && lwResponse.startsWith(`${user.username.toLowerCase()}:`)) { + response = response.substring(user.username.length + 2).trim() + lwResponse = response.toLowerCase() + } + + if ( + message && lwResponse.startsWith(`${message.username.toLowerCase()}:`) + ) { + response = response.substring(message.username.length + 2).trim() + lwResponse = response.toLowerCase() + } + + response = trimStart(response, ":").trim() + response = trim(response, '"') + return response + } + + async join(command: string, message: Message, bot: Bot): Promise { + this.joinMode.set( + message.channelUID, + !await this.isInJoinMode(message.channelUID, bot), + ) + } + + async stream(command: string, message: Message, bot: Bot): Promise { + this.streamMode = !this.streamMode + } + + async reset(command: string, message: Message, bot: Bot): Promise { + const session = this.#session + if (!session) { + return + } + + await session.resetChatHistory() + bot.sendMessage( + message.channelUID, + await this.cleanResponse( + await session.prompt( + "Your memory was just reset. Welcome to chat, greet everyone\n", + optionsGenerator(this.#model!, this.debugLogResponses), + ), + message, + bot, + ), + ) + await session.resetChatHistory() + } + + async prompt(command: string, message: Message, bot: Bot): Promise { + const session = this.#session + const user = this.user + if (!session || !user) { + return + } + + let msgSoFar = "" + + let sentMessageInfo: Promise | null = null + + let streamId: number | undefined = undefined + if (this.streamMode) { + streamId = setInterval(async () => { + if ( + msgSoFar.length < 1 || + (msgSoFar.startsWith("@") && !msgSoFar.includes(" ")) + ) { + return + } + sentMessageInfo = sentMessageInfo?.then(async (msgInfo) => { + const msg = await this.cleanResponse(msgSoFar, message, bot) + try { + const msgRes = await bot.updateMessageText( + msgInfo as string, + msg, + ) + if ("error" in msgRes) { + console.error("Error updating message text", msgRes) + msgSoFar = "" + return bot.sendMessage(message.channelUID, msg) + } + } catch (data) { + console.error(data) + } + return msgInfo + }) ?? + bot.sendMessage( + message.channelUID, + await this.cleanResponse(msgSoFar, message, bot), + ) + }, 50) + } + + console.log("Prompting model", { + model: this.#activeModel, + command, + message, + user: user.username, + }) + let response = await session.prompt( + `@${message.username}: ${message.message}`, + optionsGenerator(this.#model!, this.debugLogResponses, 5 * 60 * 1000, { + onTextChunk: (text) => { + bot.setTyping(message.channelUID).catch(() => {}) + + msgSoFar += text + + if (this.streamMode) { + // sentMessageInfo = sentMessageInfo + // ? sentMessageInfo.then(([msgInfo, msg]) => { + // const newMsg = msg + text + // return this.cleanResponse(newMsg, message, bot).then((msg) => { + // return bot.updateMessageText( + // msgInfo, + // msg, + // ).catch(console.error).then(() => [msgInfo, newMsg]) + // }) + // }) + // : bot.sendMessage( + // message.channelUID, + // text, + // ).then((msg) => [msg as string, text]) + } + }, + functions: { + generateImage: defineChatSessionFunction({ + description: "Generate an image from a prompt", + params: { + type: "object", + properties: { + prompt: { + type: "string", + description: "The prompt to generate the image from", + }, + }, + required: ["prompt"], + }, + handler: async ({ prompt }) => { + bot.sendMessage(message.channelUID, "@abot prompt " + prompt) + }, + }), + now: defineChatSessionFunction({ + description: "Get the current time", + params: { + type: "object", + properties: {}, + }, + handler: async () => { + const now = new Date() + return now.toLocaleString() + }, + }), + ...(await fetchRemoteFunctions().catch((e) => { + logger.error("Failed to fetch remote functions", { error: e }) + return ({}) + })), + }, + }), + ) + + response = await this.cleanResponse(response, message, bot) + + clearInterval(streamId) + + if (sentMessageInfo) { + const msgInfo = await sentMessageInfo + + bot.updateMessageText( + msgInfo, + response, + ) + } else { + bot.sendMessage(message.channelUID, response) + } + } + + override async handleMessage(message: Message, bot: Bot): Promise { + const user = this.user + if (!user) { + return + } + + if ( + message.message.toLowerCase().startsWith( + `@${user.username.toLowerCase()}`, + ) + ) { + const newMessage = message.message.substring( + message.message.indexOf(" "), + message.message.length, + ).trim() + if (newMessage && message.message.includes(" ")) { + const [[_, command, rest]] = newMessage.matchAll(/^(\S+)\s*(.*)$/gs) + + if (command in this.#subCommands) { + return this.#subCommands[command]?.(rest.trim(), message, bot) + } + } + } + + return this.prompt(message.message, message, bot) + } +} diff --git a/src/msg-handlers/llama-handler.ts b/src/msg-handlers/llama-handler.ts index a6bff7e..cdd1193 100644 --- a/src/msg-handlers/llama-handler.ts +++ b/src/msg-handlers/llama-handler.ts @@ -1,20 +1,21 @@ -import {BaseHandler} from "./base-handler.ts" -import {Bot, Message} from "../snek/snek-socket.ts" -import {trim, trimStart} from "npm:lodash-es" +import { BaseHandler } from "./base-handler.ts" +import { Bot, Message } from "../snek/snek-socket.ts" +import { trim, trimStart } from "npm:lodash-es" import { - ChatSessionModelFunctions, - ChatWrapper, - GeneralChatWrapper, - getLlama, - LLamaChatPromptOptions, - LlamaChatSession, - LlamaContext, - LlamaModel, - resolveChatWrapper, - Token, + ChatSessionModelFunctions, + ChatWrapper, + defineChatSessionFunction, + GeneralChatWrapper, + getLlama, + LLamaChatPromptOptions, + LlamaChatSession, + LlamaContext, + LlamaModel, + resolveChatWrapper, + Token, } from "npm:node-llama-cpp" -import {getLogger} from "@logtape/logtape" -import {deepMerge} from "@std/collections/deep-merge" +import { getLogger } from "@logtape/logtape" +import { deepMerge } from "@std/collections/deep-merge" const llama = await getLlama() @@ -30,17 +31,20 @@ function printSync(input: string | Uint8Array, to = Deno.stdout) { const logger = getLogger(["llama-gen-handler"]) const optionsGenerator = < - const Functions extends ChatSessionModelFunctions | undefined = undefined, - LLamaOptions = LLamaChatPromptOptions + const Functions extends ChatSessionModelFunctions | undefined = + | ChatSessionModelFunctions + | undefined, + LLamaOptions extends LLamaChatPromptOptions = + LLamaChatPromptOptions, >( model: LlamaModel, debugOutput: boolean = true, defaultTimeout = 5 * 60 * 1000, options?: LLamaOptions, -): LLamaChatPromptOptions => { +): LLamaOptions => { const manager = AbortSignal.timeout(defaultTimeout) - const defaultOptions: LLamaChatPromptOptions = { + const defaultOptions = { repeatPenalty: { lastTokens: 24, penalty: 1.12, @@ -54,18 +58,20 @@ const optionsGenerator = < // allow the model to repeat tokens // that contain the word "better" return !text.toLowerCase().includes("@") - // TODO: Exclude usernames + // TODO: Exclude usernames }) }, }, - temperature: 0.6, + temperature: 0.7, + minP: 0.03, signal: manager, stopOnAbortSignal: true, - } + } as LLamaOptions if (debugOutput) { defaultOptions.onResponseChunk = (chunk) => { + options?.onResponseChunk?.(chunk) const isThoughtSegment = chunk.type === "segment" && chunk.segmentType === "thought" @@ -83,11 +89,12 @@ const optionsGenerator = < } } - return deepMerge(defaultOptions, options ?? {}) + return deepMerge(defaultOptions, options ?? {}) } export class LLamaHandler extends BaseHandler { joinMode = false + streamMode = false debugLogResponses = true systemPrompt: string @@ -100,14 +107,23 @@ export class LLamaHandler extends BaseHandler { #chatWrapper: ChatWrapper | null = null #session: LlamaChatSession | null = null + #subCommands = { + "prompt": this.prompt.bind(this), + "join": this.join.bind(this), + "stream": this.stream.bind(this), + "reset": this.reset.bind(this), + } as Record void> constructor( activeModel: string, systemPrompt: string = "You are an AI chatbot.", + joinMode: boolean = false, ) { super("") this.#activeModel = activeModel this.systemPrompt = systemPrompt + this.joinMode = joinMode + this.autoTyping = false } async calculateSystemPrompt(): Promise { @@ -116,7 +132,7 @@ export class LLamaHandler extends BaseHandler { override async bind(bot: Bot): Promise { await super.bind(bot) - this.prefix = "@" + this.user?.username.toLowerCase() + this.prefix = this.user!.username.toLowerCase() this.#model = await llama.loadModel({ modelPath: this.#activeModel, @@ -131,23 +147,9 @@ export class LLamaHandler extends BaseHandler { batchSize: this.#context.batchSize, contextSize: this.#context.contextSize, }) - console.log("Model loaded", { - batchSize: this.#context.batchSize, - contextSize: this.#context.contextSize, - }) this.#chatWrapper = //new Llama3ChatWrapper() - resolveChatWrapper({ - bosString: this.#model - .tokens - .bosString, - filename: this.#model - .filename, - fileInfo: this.#model - .fileInfo, - tokenizer: this.#model - .tokenizer, - }) ?? new GeneralChatWrapper() + resolveChatWrapper(this.#model) ?? new GeneralChatWrapper() this.#session = new LlamaChatSession({ contextSequence: this.#context.getSequence(), @@ -160,35 +162,38 @@ export class LLamaHandler extends BaseHandler { const channel = channels.find((v) => v.tag === "public") || channels[0] if (channel) { - await bot.sendMessage( - channel.uid, - await this.#session.prompt( - "Welcome to chat, greet everyone\n", - optionsGenerator(this.#model, this.debugLogResponses), - ), - ) - this.#session.resetChatHistory() + // await bot.sendMessage( + // channel.uid, + // await this.cleanResponse( + // await this.#session.prompt( + // "Welcome to chat, greet everyone\n", + // optionsGenerator(this.#model, this.debugLogResponses), + // ), + // null, + // bot, + // ), + // ) + // this.#session.resetChatHistory() } + + logger.info("LLamaHandler bound to bot") } override async isMatch(message: Message): Promise { - return message.userUID !== this.user?.uid && (this.joinMode || - trim(message?.message, " `").toLowerCase().includes(this.prefix)) + return message.userUID !== this.user?.uid && message.isFinal && + (this.joinMode || + trim(message?.message, " `").toLowerCase().includes(this.prefix)) } - override async handleMessage(message: Message, bot: Bot): Promise { + async cleanResponse( + response: string, + message: Message | null, + bot: Bot, + ): Promise { const session = this.#session const user = this.user - if (!session || !user) { - return - } - let response = await session.prompt( - `@${message.username}: ${message.message}`, - optionsGenerator(this.#model!, this.debugLogResponses), - ) - - response = response.replace(/.*?<\/think>/gs, "") + response = trim(response.replace(/.*?<\/think>/gs, ""), '" \t') let lwResponse = response.toLowerCase() if (lwResponse.startsWith("ai")) { @@ -196,17 +201,192 @@ export class LLamaHandler extends BaseHandler { lwResponse = response.toLowerCase() } - if (lwResponse.startsWith(`@${user.username.toLowerCase()}`)) { + if (user && lwResponse.startsWith(`@${user.username.toLowerCase()}`)) { response = response.substring(user.username.length + 1).trim() lwResponse = response.toLowerCase() } - if (lwResponse.startsWith(`@${message.username.toLowerCase()}`)) { + if ( + message && lwResponse.startsWith(`@${message.username.toLowerCase()}`) + ) { + response = response.substring(message.username.length + 1).trim() + lwResponse = response.toLowerCase() + } + + if (user && lwResponse.startsWith(`${user.username.toLowerCase()}`)) { + response = response.substring(user.username.length + 1).trim() + lwResponse = response.toLowerCase() + } + + if (message && lwResponse.startsWith(`${message.username.toLowerCase()}`)) { response = response.substring(message.username.length + 1).trim() lwResponse = response.toLowerCase() } response = trimStart(response, ":").trim() - bot.send("send_message", message.channelUID, response) + response = trim(response, '"') + return response + } + + async join(command: string, message: Message, bot: Bot): Promise { + this.joinMode = !this.joinMode + } + + async stream(command: string, message: Message, bot: Bot): Promise { + this.streamMode = !this.streamMode + } + + async reset(command: string, message: Message, bot: Bot): Promise { + const session = this.#session + if (!session) { + return + } + + await session.resetChatHistory() + bot.sendMessage( + message.channelUID, + await this.cleanResponse( + await session.prompt( + "Your memory was just reset. Welcome to chat, greet everyone\n", + optionsGenerator(this.#model!, this.debugLogResponses), + ), + message, + bot, + ), + ) + await session.resetChatHistory() + } + + async prompt(command: string, message: Message, bot: Bot): Promise { + const session = this.#session + const user = this.user + if (!session || !user) { + return + } + + let msgSoFar = "" + + let sentMessageInfo: Promise | null = null + + let streamId: number | undefined = undefined + if (this.streamMode) { + streamId = setInterval(async () => { + if ( + msgSoFar.length < 1 || + (msgSoFar.startsWith("@") && !msgSoFar.includes(" ")) + ) { + return + } + sentMessageInfo = sentMessageInfo?.then(async (msgInfo) => { + const msg = await this.cleanResponse(msgSoFar, message, bot) + try { + const msgRes = await bot.updateMessageText( + msgInfo as string, + msg, + ) + if ("error" in msgRes) { + console.error("Error updating message text", msgRes) + msgSoFar = "" + return bot.sendMessage(message.channelUID, msg) + } + } catch (data) { + console.error(data) + } + return msgInfo + }) + ?? bot.sendMessage( + message.channelUID, + await this.cleanResponse(msgSoFar, message, bot), + ) + }, 50) + } + + let response = await session.prompt( + `@${message.username}: ${message.message}`, + optionsGenerator(this.#model!, this.debugLogResponses, 5 * 60 * 1000, { + onTextChunk: (text) => { + bot.setTyping(message.channelUID).catch(() => {}) + + msgSoFar += text + + if (this.streamMode) { + // sentMessageInfo = sentMessageInfo + // ? sentMessageInfo.then(([msgInfo, msg]) => { + // const newMsg = msg + text + // return this.cleanResponse(newMsg, message, bot).then((msg) => { + // return bot.updateMessageText( + // msgInfo, + // msg, + // ).catch(console.error).then(() => [msgInfo, newMsg]) + // }) + // }) + // : bot.sendMessage( + // message.channelUID, + // text, + // ).then((msg) => [msg as string, text]) + } + }, + functions: { + generateImage: defineChatSessionFunction({ + description: "Generate an image from a prompt", + params: { + type: "object", + properties: { + prompt: { + type: "string", + description: "The prompt to generate the image from", + }, + }, + required: ["prompt"], + }, + handler: async ({ prompt }) => { + bot.sendMessage(message.channelUID, "@abot prompt " + prompt) + }, + }), + }, + }), + ) + + response = await this.cleanResponse(response, message, bot) + + clearInterval(streamId) + + if (sentMessageInfo) { + const msgInfo = await sentMessageInfo + + bot.updateMessageText( + msgInfo, + response, + ) + } else { + bot.sendMessage(message.channelUID, response) + } + } + + override async handleMessage(message: Message, bot: Bot): Promise { + const user = this.user + if (!user) { + return + } + + if ( + message.message.toLowerCase().startsWith( + `@${user.username.toLowerCase()}`, + ) + ) { + const newMessage = message.message.substring( + message.message.indexOf(" "), + message.message.length, + ).trim() + if (newMessage && message.message.includes(" ")) { + const [[_, command, rest]] = newMessage.matchAll(/^(\S+)\s*(.*)$/gs) + + if (command in this.#subCommands) { + return this.#subCommands[command]?.(rest.trim(), message, bot) + } + } + } + + return this.prompt(message.message, message, bot) } } diff --git a/src/snek/snek-socket.ts b/src/snek/snek-socket.ts index f61cb9e..4e29608 100644 --- a/src/snek/snek-socket.ts +++ b/src/snek/snek-socket.ts @@ -1,8 +1,8 @@ -import {EventEmitter} from "node:events" -import {debounce} from "npm:lodash-es" -import {getLogger} from "@logtape/logtape" +import { EventEmitter } from "node:events" +import { debounce, isString } from "npm:lodash-es" +import { getLogger } from "@logtape/logtape" -const logger = getLogger(["ws-socket"]) +const logger = getLogger(["snek-socket"]) export const BASE_URL = "https://molodetz.online/login.json" @@ -12,7 +12,7 @@ const baseRequest = async ( password: string, ) => { const loginPayloadRed = await fetch(BASE_URL) - console.log(loginPayloadRed) + // console.log(loginPayloadRed) const basePayload = await loginPayloadRed.json() basePayload.fields.username.value = username @@ -75,9 +75,11 @@ export interface Channel { tag: string } +const SILENT_MESSAGES = ["set_typing", "ping", "pong", 'is_final": false'] + export class Message { message: string - html: string + html: string | undefined userUID: string color: string channelUID: string @@ -86,6 +88,7 @@ export class Message { username: string uid: string userNick: string + isFinal: boolean | undefined bot: Bot @@ -100,10 +103,15 @@ export class Message { this.username = data.username this.uid = data.uid this.userNick = data.user_nick + this.isFinal = data.is_final this.bot = bot } reply(message: string) { + return this.messageChannel(`@${this.username}: ${message}`) + } + + messageChannel(message: string) { return this.bot.send("send_message", this.channelUID, message) } } @@ -141,9 +149,21 @@ export class Bot extends EventEmitter< return this.send("get_channels") } + cachedUserPromise: Promise | null = null + cachedUserTime: number | null = null + get user() { - return this.send("get_user", null) + if (this.cachedUserPromise && this.cachedUserTime) { + const now = new Date().getTime() + if (now - this.cachedUserTime < 1000 * 60 * 30) { + return this.cachedUserPromise + } + } + this.cachedUserPromise = this.send("get_user", null) + this.cachedUserTime = new Date().getTime() + return this.cachedUserPromise } + get messages() { return this.send("get_messages", null) } @@ -173,7 +193,10 @@ export class Bot extends EventEmitter< const ws = this.#ws if (ws && ws.readyState === ws.OPEN) { const callId = Math.random().toString(36).slice(2) - logger.debug("Sending message", { name, args, callId }) + const silentMessage = SILENT_MESSAGES.some((v) => name.includes(v)) + if (!silentMessage) { + logger.debug("Sending message", { name, args, callId }) + } const res = Promise.withResolvers() this.#processingMessages.set(callId, { data: res as PromiseWithResolvers, @@ -195,30 +218,42 @@ export class Bot extends EventEmitter< }) return new Promise((resolve, reject) => { - setTimeout(() => { - this.connect().then(() => this.send(name, ...args)).catch(reject).then(resolve) + setTimeout(async () => { + try { + await this.connect() + resolve(await this.send(name, ...args)) + } catch (e) { + reject(e) + } }, 1000) }) }) } - return Promise.reject(new Error("Connection not open")) + return this.connect().then(() => { + return this.send(name, ...args) + }) } receive(data: string) { + const silentMessages = (SILENT_MESSAGES.some((v) => data.includes(v))) && + !data.includes("error") + if (!silentMessages) { + // logger.debug("Received message", { data }) + } const parsedData = JSON.parse(data) const callId = parsedData.callId const message = this.#processingMessages.get(callId) if (message) { - logger.debug("Resolving message", { - data: parsedData.data, - callId, - raw: parsedData, - }) + if (!silentMessages && !(parsedData?.success && !parsedData?.data)) { + logger.debug("Resolving remote call", parsedData) + } message.data.resolve(parsedData.data) this.#processingMessages.delete(callId) - } else { - logger.debug("Emitting message", parsedData) + } else if (parsedData?.message) { + if (!silentMessages) { + logger.debug("Received message", parsedData) + } this.emit("message", new Message(parsedData, this)) } } @@ -226,7 +261,9 @@ export class Bot extends EventEmitter< connect = debounce( function (this: Bot) { if (this.#ws) { - return this.send("get_user", null) + return this.send("get_user", null).catch(() => { + return this.connect() + }) } logger.debug("Connecting to", { url: this.#url }) const connectedPromise = Promise.withResolvers() @@ -239,8 +276,9 @@ export class Bot extends EventEmitter< ) } this.#ws.onmessage = (event) => { - logger.debug("Received message", { data: event.data }) - this.receive(event.data) + if (isString(event.data)) { + this.receive(event.data) + } } this.#ws.onclose = (event) => { @@ -259,7 +297,9 @@ export class Bot extends EventEmitter< this.#processingMessages.clear() if (this.autoReconnect) { - this.connect() + setTimeout(() => { + this.connect().catch(() => {}) + }, 1000) } } @@ -273,23 +313,71 @@ export class Bot extends EventEmitter< { leading: true, trailing: true }, ) + stop() { + if (this.#ws) { + this.#ws.close() + this.#ws = null + } + } + sendMessage(channelUID: string, message: string) { return this.send("send_message", channelUID, message) } + updateMessageText( + messageUID: string, + message: string, + ) { + return this.send("update_message_text", messageUID, message) + } + + async setTyping(channelUID: string, colour?: string) { + if (!colour) { + const user = await this.user + colour = user.color + } + return this.send("set_typing", channelUID, colour) + } + async uploadFiles(channelUID: string, ...files: File[]) { + if (files.length === 0) { + throw new Error("No files to upload") + } + const imageForm = new FormData() - imageForm.append("channel_uid", channelUID) + // imageForm.append("channel_uid", channelUID) for (const file of files) { imageForm.append("files[]", file) } - return await fetch("https://molodetz.online/drive.bin", { - method: "POST", - body: imageForm, - headers: { - "Cookie": await this.authCookie, + return await fetch( + `https://molodetz.online/channel/${channelUID}/attachment.bin`, + { + method: "POST", + body: imageForm, + headers: { + "Cookie": await this.authCookie as string, + }, }, - }) + ) + } + + ping() { + return this.send("ping", "online") + } + + _pingInterval: number | null = null + startAppearingOnline() { + this.ping().catch(() => {}) + this._pingInterval = setInterval(() => { + this.ping().catch(() => {}) + }, 1000 * 60) + } + + stopAppearingOnline() { + if (this._pingInterval) { + clearInterval(this._pingInterval) + this._pingInterval = null + } } } diff --git a/src/util/img-gen.ts b/src/util/img-gen.ts index bf454ab..406d840 100644 --- a/src/util/img-gen.ts +++ b/src/util/img-gen.ts @@ -1,15 +1,24 @@ -import {randomUUID} from "node:crypto" -import {getLogger} from "@logtape/logtape" +import { randomUUID } from "node:crypto" +import { getLogger } from "@logtape/logtape" const logger = getLogger(["img-gen"]) + +type PromptResponse = { + prompt_id: string + number: number + node_error: Record +} + export class ImgGen { #host: string #clientId = randomUUID() - #ws: WebSocket + #ws: WebSocket | null = null + + lastMessage: string | null = null #promptQueue = new Map< string, - { promise: PromiseWithResolvers; msgs: unknown[] } + { promise: PromiseWithResolvers; msgs: unknown[]; id: string } >() constructor(host: string = "127.0.0.1:8188") { @@ -17,7 +26,7 @@ export class ImgGen { this.#initiateWebSocket() } - async queuePrompt(prompt: string) { + async queuePrompt(prompt: string): Promise { const response = await fetch(`http://${this.#host}/prompt`, { method: "POST", headers: { "Content-Type": "application/json" }, @@ -43,8 +52,8 @@ export class ImgGen { #initiateWebSocket() { if ( - !this.#ws || this.#ws.readyState === this.#ws.CLOSED || - this.#ws.readyState === this.#ws.CLOSING + !this.#ws || this.#ws.readyState === WebSocket.CLOSED || + this.#ws.readyState === WebSocket.CLOSING ) { const res = Promise.withResolvers() this.#ws = new WebSocket( @@ -52,33 +61,43 @@ export class ImgGen { ) let lastExportId: string | null = null this.#ws.addEventListener("message", (event) => { - if (typeof event.data === "string") { - console.log("Received message", event, event.data) - const data = JSON.parse(event.data) - const res = this.#promptQueue.get(data.data.prompt_id) - if (res) { - res.msgs.push(data) - if (data.type === "execution_success") { - res.promise.resolve(res.msgs) - this.#promptQueue.delete(data.data.prompt_id) - } else if (data.type === "executing") { - if (data.data.node === "save_image_websocket_node") { - lastExportId = data.data.prompt_id + try { + if (typeof event.data === "string") { + this.lastMessage = event.data + const data = JSON.parse(event.data) + logger.info("Received message", { data }) + const res = this.#promptQueue.get(data.data.prompt_id) + if (res) { + res.msgs.push(data) + if (data.type === "execution_success") { + res.promise.resolve(res.msgs) + this.#promptQueue.delete(data.data.prompt_id) + } else if (data.type === "executing") { + if (data.data.node === "save_image_websocket_node") { + lastExportId = data.data.prompt_id + } + } + } + } else { + logger.info("Received img message, assuming part of image export", { + lastExportId, + }) + this.lastMessage = + `Received binary data (assuming image) for ${lastExportId}` + if (lastExportId) { + const res = this.#promptQueue.get(lastExportId) + if (res) { + res.msgs.push(event.data) } } } - } else { - console.error( - "Received img message", + } catch (e) { + logger.error("Error processing WebSocket message", { event, - "assuming is part of", - lastExportId, - ) - if (lastExportId) { - const res = this.#promptQueue.get(lastExportId) - if (res) { - res.msgs.push(event.data) - } + error: e, + }) + for (const [_, { promise }] of this.#promptQueue) { + promise.reject(e) } } }) @@ -100,34 +119,91 @@ export class ImgGen { }) this.#ws.addEventListener("error", (e) => { - logger.error("WebSocket error", {e}) + logger.error("WebSocket error", { e }) }) return res.promise - } else if (this.#ws.readyState === this.#ws.CONNECTING) { - return new Promise((resolve) => { - this.#ws.addEventListener("open", () => { - resolve() - }, { once: true }) - }) + } else if (this.#ws.readyState === WebSocket.CONNECTING) { + const res = Promise.withResolvers() + this.#ws.addEventListener("open", () => { + res.resolve() + }, { once: true }) + return res.promise } return Promise.resolve() } - async dispatchPrompt(prompt: Record | string) { + async dispatchPrompt( + prompt: Record | string, + enqueueCallback: (promptResponse: PromptResponse) => Promise | void = + () => {}, + ): Promise { const res = Promise.withResolvers() - await this.#initiateWebSocket() - - if (this.#ws.readyState !== this.#ws.OPEN) { + if (this.#ws?.readyState !== WebSocket.OPEN) { return Promise.reject(new Error("WebSocket not open")) } - const promptData = await this.queuePrompt(prompt as string) - console.log("Prompt data", promptData) - this.#promptQueue.set(promptData.prompt_id, { promise: res, msgs: [] }) + await this.#initiateWebSocket() + + let promptData: Awaited> + try { + promptData = await this.queuePrompt(prompt as string) + logger.info("Prompt data", promptData) + } catch (e) { + logger.error("Failed to enqueue prompt", { e }) + res.reject(e) + return res.promise + } + this.#promptQueue.set(promptData.prompt_id, { + promise: res, + msgs: [], + id: promptData.prompt_id, + }) + + try { + await enqueueCallback(promptData) + } catch (e) { + logger.error("Callback errored", { e }) + } return res.promise } + + async interruptActivePrompt() { + const response = await fetch(`http://${this.#host}/interrupt`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ client_id: this.#clientId }), + }) + return response.ok + } + + async clearPromptQueue() { + const response = await fetch(`http://${this.#host}/queue`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ client_id: this.#clientId, clear: true }), + }) + return response.ok + } + + async cancelPrompts(...ids: string[]) { + const response = await fetch(`http://${this.#host}/queue`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ client_id: this.#clientId, delete: ids }), + }) + return response.ok + } + + async freeVRAM() { + const response = await fetch(`http://${this.#host}/free`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ client_id: this.#clientId }), + }) + return response.ok + } } diff --git a/src/util/logging.ts b/src/util/logging.ts index 5e06077..c8fc95d 100644 --- a/src/util/logging.ts +++ b/src/util/logging.ts @@ -1,16 +1,18 @@ -import {configure, getConsoleSink} from "@logtape/logtape"; +import { + configure, + defaultConsoleFormatter, + getConsoleSink, +} from "@logtape/logtape" +import { isEmpty } from "lodash-es" await configure({ sinks: { console: getConsoleSink( { formatter: (logEvent) => { - const { timestamp, level, category, message, properties } = logEvent - return `${timestamp} [${level.toUpperCase()}] [${category}] ${message} ${ - properties && Object.keys(properties).length - ? JSON.stringify(properties) - : "" - }` + const { properties } = logEvent + const baseLog = defaultConsoleFormatter(logEvent) + return [...baseLog, isEmpty(properties) ? "" : properties] }, }, ), @@ -20,6 +22,7 @@ await configure({ { category: "img-gen", lowestLevel: "debug", sinks: ["console"] }, { category: "img-gen-handler", lowestLevel: "debug", sinks: ["console"] }, { category: "llama-gen-handler", lowestLevel: "debug", sinks: ["console"] }, - { category: "ws-socket", lowestLevel: "debug", sinks: ["console"] }, + { category: "snek-socket", lowestLevel: "debug", sinks: ["console"] }, + { category: "remote-functions", lowestLevel: "debug", sinks: ["console"] }, ], }) diff --git a/src/ws-snek-basic-bot.ts b/src/ws-snek-basic-bot.ts new file mode 100644 index 0000000..1ee86fe --- /dev/null +++ b/src/ws-snek-basic-bot.ts @@ -0,0 +1,18 @@ +import "@std/dotenv/load" +import "./util/logging.ts" +import { Bot } from "./snek/snek-socket.ts" + +const bot = new Bot( + Deno.env.get("SNEK_USERNAME")!, + Deno.env.get("SNEK_PASSWORD")!, +) + +await bot.connect() + +const user = await bot.user + +console.log("We are user: ", user, await bot.authCookie) + +await Promise.all([]) + +bot.startAppearingOnline() \ No newline at end of file diff --git a/src/ws-snek-image-bot.ts b/src/ws-snek-image-bot.ts index af2e83e..a484bb4 100644 --- a/src/ws-snek-image-bot.ts +++ b/src/ws-snek-image-bot.ts @@ -1,9 +1,11 @@ import "@std/dotenv/load" import "./util/logging.ts" -import {Bot} from "./snek/snek-socket.ts" -import {PingHandler} from "./msg-handlers/ping-handler.ts"; -import {ImgGenHandler} from "./msg-handlers/img-gen-handler.ts"; +import { Bot } from "./snek/snek-socket.ts" +import { PingHandler } from "./msg-handlers/ping-handler.ts" +import { ImgGenHandler } from "./msg-handlers/img-gen-handler.ts" +import { getLogger } from "@logtape/logtape" +const logger = getLogger("ws-snek-llama-func-bot") const bot = new Bot( Deno.env.get("SNEK_USERNAME")!, Deno.env.get("SNEK_PASSWORD")!, @@ -13,7 +15,9 @@ await bot.connect() const user = await bot.user -console.log("We are user: ", user, await bot.authCookie) +logger.info("We are user: ", { user, authCookie: await bot.authCookie }) new PingHandler().bind(bot) new ImgGenHandler().bind(bot) + +bot.startAppearingOnline() diff --git a/src/ws-snek-llama-bot.ts b/src/ws-snek-llama-bot.ts index 78b170c..cac976a 100644 --- a/src/ws-snek-llama-bot.ts +++ b/src/ws-snek-llama-bot.ts @@ -1,8 +1,8 @@ import "@std/dotenv/load" import "./util/logging.ts" -import {Bot} from "./snek/snek-socket.ts" -import {PingHandler} from "./msg-handlers/ping-handler.ts"; -import {LLamaHandler} from "./msg-handlers/llama-handler.ts"; +import { Bot } from "./snek/snek-socket.ts" +import { PingHandler } from "./msg-handlers/ping-handler.ts" +import { LLamaHandler } from "./msg-handlers/llama-handler.ts" const bot = new Bot( Deno.env.get("SNEK_USERNAME")!, @@ -22,3 +22,5 @@ await Promise.all([ Deno.env.get("SNEK_LLAMA_SYSTEM_PROMPT")!, ).bind(bot), ]) + +bot.startAppearingOnline() diff --git a/src/ws-snek-llama-func-bot.ts b/src/ws-snek-llama-func-bot.ts new file mode 100644 index 0000000..1edef78 --- /dev/null +++ b/src/ws-snek-llama-func-bot.ts @@ -0,0 +1,28 @@ +import "@std/dotenv/load" +import "./util/logging.ts" +import { Bot } from "./snek/snek-socket.ts" +import { PingHandler } from "./msg-handlers/ping-handler.ts" +import { LLamaFuncHandler } from "./msg-handlers/llama-func-handler.ts" + +import { getLogger } from "@logtape/logtape" +const logger = getLogger("ws-snek-llama-func-bot") +const bot = new Bot( + Deno.env.get("SNEK_USERNAME")!, + Deno.env.get("SNEK_PASSWORD")!, +) + +await bot.connect() + +const user = await bot.user + +logger.info("We are user: ", { user, authCookie: await bot.authCookie }) + +await Promise.all([ + new PingHandler().bind(bot), + new LLamaFuncHandler( + Deno.env.get("SNEK_LLAMA_MODEL")!, + Deno.env.get("SNEK_LLAMA_SYSTEM_PROMPT")!, + ).bind(bot), +]) + +bot.startAppearingOnline() diff --git a/src/ws-snek-perf-check.ts b/src/ws-snek-perf-check.ts new file mode 100644 index 0000000..66aa56a --- /dev/null +++ b/src/ws-snek-perf-check.ts @@ -0,0 +1,39 @@ +import "@std/dotenv/load" +import "./util/logging.ts" +import { Bot } from "./snek/snek-socket.ts" + +const bot = new Bot( + Deno.env.get("SNEK_USERNAME")!, + Deno.env.get("SNEK_PASSWORD")!, +) + +await bot.connect() + +const user = await bot.user + +console.log("We are user: ", user, await bot.authCookie) + +const channel = await bot.channels +console.log("We are in channel: ", channel) + +const activeChannel = channel.find((c) => c.tag != "dm")!.uid + +const endTime = new Date() +// 5 seconds +endTime.setSeconds(endTime.getSeconds() + 5) + +let counter = 0 + +let messageCollect = [] + +while (new Date() < endTime) { + messageCollect.push( + bot.sendMessage(activeChannel, `Test message ${counter++}`), + ) +} + +await Promise.all(messageCollect) + +console.log("Finished sending messages", counter) + +bot.stop() diff --git a/templates/img-gen/RandomAnime.eta b/templates/img-gen/RandomAnime.eta new file mode 100644 index 0000000..46409c6 --- /dev/null +++ b/templates/img-gen/RandomAnime.eta @@ -0,0 +1,219 @@ +{ + "6": { + "inputs": { + "ckpt_name": "randomanime_Illust.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "7": { + "inputs": { + "text": "<%= it.negativePrompt || 'score_4_up, score_5_up, worst quality,bad quality,very displeasing,extra digit,fewer digits,jpeg artifacts,signature,username,reference,mutated,lineup,manga,comic,disembodied,turnaround,2koma,4koma,monster,cropped,amputee,text,bad foreshortening,what,logo,bad anatomy,bad perspective,bad proportions,artistic error,anatomical nonsense,amateur,out of frame,multiple views, non detailed eyes' %>" + }, + "class_type": "Text Multiline", + "_meta": { + "title": "Negative" + } + }, + "8": { + "inputs": { + "prompt": "<%= it.prompt || 'masterpiece, best quality, score_9, score_8_up' %>", + "seed": [ + "9", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "9": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "Seed Everywhere", + "_meta": { + "title": "Seed Everywhere" + } + }, + "12": { + "inputs": { + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 8 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "beta", + "denoise": 1, + "model": [ + "16", + 0 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "latent_image": [ + "23", + 0 + ], + "seed": [ + "9", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "13": { + "inputs": { + "samples": [ + "12", + 0 + ], + "vae": [ + "6", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "16": { + "inputs": { + "text": [ + "8", + 0 + ], + "model": [ + "6", + 0 + ], + "clip": [ + "6", + 1 + ] + }, + "class_type": "LoraTagLoader", + "_meta": { + "title": "Load LoRA Tag" + } + }, + "17": { + "inputs": { + "text": [ + "16", + 2 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "18": { + "inputs": { + "stop_at_clip_layer": -2, + "clip": [ + "16", + 1 + ] + }, + "class_type": "CLIPSetLastLayer", + "_meta": { + "title": "CLIP Set Last Layer" + } + }, + "19": { + "inputs": { + "text": [ + "7", + 0 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "21": { + "inputs": { + "images": [ + "13", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "22": { + "inputs": { + "filename_prefix": "RandomAnime", + "images": [ + "13", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "23": { + "inputs": { + "batch_size": <%= it.batchSize || 1 %>, + "seed": [ + "9", + 0 + ] + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "24": { + "inputs": { + "text": [ + "8", + 0 + ], + "text2": "masterpiece, best quality, score_9, score_8_up" + }, + "class_type": "ShowText|pysssss", + "_meta": { + "title": "Show Text 🐍" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "13", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/SD3.5-large-alt-improv.eta b/templates/img-gen/SD3.5-large-alt-improv.eta new file mode 100644 index 0000000..527b9d9 --- /dev/null +++ b/templates/img-gen/SD3.5-large-alt-improv.eta @@ -0,0 +1,495 @@ +{ + "4": { + "inputs": { + "ckpt_name": "stableDiffusion35_large.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "6": { + "inputs": { + "text": "<%= it.prompt %>", + "clip": [ + "11", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "8": { + "inputs": { + "samples": [ + "294", + 0 + ], + "vae": [ + "4", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "11": { + "inputs": { + "clip_name1": "long_clip/ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors", + "clip_name2": "clip_g.safetensors", + "clip_name3": "t5/google_t5-v1_1-xxl_encoderonly-fp8_e4m3fn.safetensors" + }, + "class_type": "TripleCLIPLoader", + "_meta": { + "title": "TripleCLIPLoader" + } + }, + "13": { + "inputs": { + "shift": 3, + "model": [ + "4", + 0 + ] + }, + "class_type": "ModelSamplingSD3", + "_meta": { + "title": "ModelSamplingSD3" + } + }, + "67": { + "inputs": { + "conditioning": [ + "71", + 0 + ] + }, + "class_type": "ConditioningZeroOut", + "_meta": { + "title": "ConditioningZeroOut" + } + }, + "68": { + "inputs": { + "start": 0.1, + "end": 1, + "conditioning": [ + "67", + 0 + ] + }, + "class_type": "ConditioningSetTimestepRange", + "_meta": { + "title": "ConditioningSetTimestepRange" + } + }, + "69": { + "inputs": { + "conditioning_1": [ + "68", + 0 + ], + "conditioning_2": [ + "70", + 0 + ] + }, + "class_type": "ConditioningCombine", + "_meta": { + "title": "Conditioning (Combine)" + } + }, + "70": { + "inputs": { + "start": 0, + "end": 0.1, + "conditioning": [ + "71", + 0 + ] + }, + "class_type": "ConditioningSetTimestepRange", + "_meta": { + "title": "ConditioningSetTimestepRange" + } + }, + "71": { + "inputs": { + "text": "<%= it.negativePrompt ||'' %>", + "clip": [ + "11", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "294": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "model": [ + "13", + 0 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "69", + 0 + ], + "latent_image": [ + "302", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "301": { + "inputs": { + "filename_prefix": "SD3.5_Large_improved_", + "images": [ + "325", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "302": { + "inputs": { + "batch_size": <%= it.batchSize || 1 %>, + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "304": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "CPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "305": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "306": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "308": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "309": { + "inputs": { + "images": [ + "324", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "310": { + "inputs": { + "images": [ + "324", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "311": { + "inputs": { + "images": [ + "324", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "312": { + "inputs": { + "images": [ + "324", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "314": { + "inputs": { + "images": [ + "325", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "315": { + "inputs": { + "images": [ + "325", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "316": { + "inputs": { + "images": [ + "325", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "317": { + "inputs": { + "images": [ + "325", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "321": { + "inputs": { + "images": [ + "8", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "324": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 0.5, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "8", + 0 + ], + "model": [ + "13", + 0 + ], + "clip": [ + "11", + 0 + ], + "vae": [ + "4", + 2 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "69", + 0 + ], + "bbox_detector": [ + "305", + 0 + ], + "sam_model_opt": [ + "304", + 0 + ], + "segm_detector_opt": [ + "305", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "325": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 0.5, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "324", + 0 + ], + "model": [ + "13", + 0 + ], + "clip": [ + "11", + 0 + ], + "vae": [ + "4", + 2 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "69", + 0 + ], + "bbox_detector": [ + "308", + 0 + ], + "sam_model_opt": [ + "304", + 0 + ], + "segm_detector_opt": [ + "306", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "325", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/SD3.5-large-alt.eta b/templates/img-gen/SD3.5-large-alt.eta index ad1fc9d..f4d1083 100644 --- a/templates/img-gen/SD3.5-large-alt.eta +++ b/templates/img-gen/SD3.5-large-alt.eta @@ -39,9 +39,9 @@ }, "11": { "inputs": { - "clip_name1": "long_clip\\ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors", + "clip_name1": "long_clip/ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors", "clip_name2": "clip_g.safetensors", - "clip_name3": "t5\\google_t5-v1_1-xxl_encoderonly-fp8_e4m3fn.safetensors" + "clip_name3": "t5/google_t5-v1_1-xxl_encoderonly-fp8_e4m3fn.safetensors" }, "class_type": "TripleCLIPLoader", "_meta": { @@ -144,10 +144,10 @@ "294": { "inputs": { "seed": <%= it.seed || it.randomSeed() %>, - "steps": <%= it.steps || 2 %>, - "cfg": <%= it.cfg || 1 %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, "sampler_name": "<%= it.sampler || "euler" %>", - "scheduler": "beta", + "scheduler": "<%= it.scheduler || 'beta' %>", "denoise": 1, "model": [ "13", diff --git a/templates/img-gen/SD3.5-large-turbo.eta b/templates/img-gen/SD3.5-large-turbo.eta index 123822f..9756651 100644 --- a/templates/img-gen/SD3.5-large-turbo.eta +++ b/templates/img-gen/SD3.5-large-turbo.eta @@ -144,10 +144,10 @@ "294": { "inputs": { "seed": <%= it.seed || it.randomSeed() %>, - "steps": <%= it.steps || 2 %>, - "cfg": <%= it.cfg || 1 %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, "sampler_name": "<%= it.sampler || "euler" %>", - "scheduler": "beta", + "scheduler": "<%= it.scheduler || 'beta' %>", "denoise": 1, "model": [ "13", diff --git a/templates/img-gen/SD3.5-large.eta b/templates/img-gen/SD3.5-large.eta index 27c21c5..a3ef7e8 100644 --- a/templates/img-gen/SD3.5-large.eta +++ b/templates/img-gen/SD3.5-large.eta @@ -144,10 +144,10 @@ "294": { "inputs": { "seed": <%= it.seed || it.randomSeed() %>, - "steps": <%= it.steps || 2 %>, - "cfg": <%= it.cfg || 1 %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, "sampler_name": "<%= it.sampler || "euler" %>", - "scheduler": "beta", + "scheduler": "<%= it.scheduler || 'beta' %>", "denoise": 1, "model": [ "13", diff --git a/templates/img-gen/SD3.5-medium-alt-improv.eta b/templates/img-gen/SD3.5-medium-alt-improv.eta new file mode 100644 index 0000000..cc4ac8d --- /dev/null +++ b/templates/img-gen/SD3.5-medium-alt-improv.eta @@ -0,0 +1,495 @@ +{ + "4": { + "inputs": { + "ckpt_name": "stableDiffusion35_medium.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "6": { + "inputs": { + "text": "<%= it.prompt %>", + "clip": [ + "11", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "8": { + "inputs": { + "samples": [ + "294", + 0 + ], + "vae": [ + "4", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "11": { + "inputs": { + "clip_name1": "long_clip/ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors", + "clip_name2": "clip_g.safetensors", + "clip_name3": "t5/google_t5-v1_1-xxl_encoderonly-fp8_e4m3fn.safetensors" + }, + "class_type": "TripleCLIPLoader", + "_meta": { + "title": "TripleCLIPLoader" + } + }, + "13": { + "inputs": { + "shift": 3, + "model": [ + "4", + 0 + ] + }, + "class_type": "ModelSamplingSD3", + "_meta": { + "title": "ModelSamplingSD3" + } + }, + "67": { + "inputs": { + "conditioning": [ + "71", + 0 + ] + }, + "class_type": "ConditioningZeroOut", + "_meta": { + "title": "ConditioningZeroOut" + } + }, + "68": { + "inputs": { + "start": 0.1, + "end": 1, + "conditioning": [ + "67", + 0 + ] + }, + "class_type": "ConditioningSetTimestepRange", + "_meta": { + "title": "ConditioningSetTimestepRange" + } + }, + "69": { + "inputs": { + "conditioning_1": [ + "68", + 0 + ], + "conditioning_2": [ + "70", + 0 + ] + }, + "class_type": "ConditioningCombine", + "_meta": { + "title": "Conditioning (Combine)" + } + }, + "70": { + "inputs": { + "start": 0, + "end": 0.1, + "conditioning": [ + "71", + 0 + ] + }, + "class_type": "ConditioningSetTimestepRange", + "_meta": { + "title": "ConditioningSetTimestepRange" + } + }, + "71": { + "inputs": { + "text": "<%= it.negativePrompt ||'' %>", + "clip": [ + "11", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "294": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "model": [ + "13", + 0 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "69", + 0 + ], + "latent_image": [ + "302", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "301": { + "inputs": { + "filename_prefix": "SD3.5_Medium_improved_", + "images": [ + "325", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "302": { + "inputs": { + "batch_size": <%= it.batchSize || 1 %>, + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "304": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "CPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "305": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "306": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "308": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "309": { + "inputs": { + "images": [ + "324", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "310": { + "inputs": { + "images": [ + "324", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "311": { + "inputs": { + "images": [ + "324", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "312": { + "inputs": { + "images": [ + "324", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "314": { + "inputs": { + "images": [ + "325", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "315": { + "inputs": { + "images": [ + "325", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "316": { + "inputs": { + "images": [ + "325", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "317": { + "inputs": { + "images": [ + "325", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "321": { + "inputs": { + "images": [ + "8", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "324": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 0.5, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "8", + 0 + ], + "model": [ + "13", + 0 + ], + "clip": [ + "11", + 0 + ], + "vae": [ + "4", + 2 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "69", + 0 + ], + "bbox_detector": [ + "305", + 0 + ], + "sam_model_opt": [ + "304", + 0 + ], + "segm_detector_opt": [ + "305", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "325": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 20 %>, + "cfg": <%= it.cfg || 2 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 0.5, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "324", + 0 + ], + "model": [ + "13", + 0 + ], + "clip": [ + "11", + 0 + ], + "vae": [ + "4", + 2 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "69", + 0 + ], + "bbox_detector": [ + "308", + 0 + ], + "sam_model_opt": [ + "304", + 0 + ], + "segm_detector_opt": [ + "306", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "325", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/crow-pony-detailed.eta b/templates/img-gen/crow-pony-detailed.eta new file mode 100644 index 0000000..d5249dd --- /dev/null +++ b/templates/img-gen/crow-pony-detailed.eta @@ -0,0 +1,533 @@ +{ + "6": { + "inputs": { + "ckpt_name": "CrowPonyQp_ponyV7.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "7": { + "inputs": { + "text": "<%= it.negativePrompt || 'score_4_up, score_5_up, worst quality,bad quality,very displeasing,extra digit,fewer digits,jpeg artifacts,signature,username,reference,mutated,lineup,manga,comic,disembodied,turnaround,2koma,4koma,monster,cropped,amputee,text,bad foreshortening,what,logo,bad anatomy,bad perspective,bad proportions,artistic error,anatomical nonsense,amateur,out of frame,multiple views, non detailed eyes' %>" + }, + "class_type": "Text Multiline", + "_meta": { + "title": "Negative" + } + }, + "8": { + "inputs": { + "prompt": "<%= it.prompt %>", + "seed": [ + "9", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "9": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "Seed Everywhere", + "_meta": { + "title": "Seed Everywhere" + } + }, + "12": { + "inputs": { + "seed": [ + "9", + 0 + ], + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 6 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 1, + "model": [ + "16", + 0 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "latent_image": [ + "23", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "13": { + "inputs": { + "samples": [ + "12", + 0 + ], + "vae": [ + "6", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "16": { + "inputs": { + "text": [ + "8", + 0 + ], + "model": [ + "25", + 0 + ], + "clip": [ + "25", + 1 + ] + }, + "class_type": "LoraTagLoader", + "_meta": { + "title": "Load LoRA Tag" + } + }, + "17": { + "inputs": { + "text": [ + "16", + 2 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "18": { + "inputs": { + "stop_at_clip_layer": -2, + "clip": [ + "16", + 1 + ] + }, + "class_type": "CLIPSetLastLayer", + "_meta": { + "title": "CLIP Set Last Layer" + } + }, + "19": { + "inputs": { + "text": [ + "7", + 0 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "21": { + "inputs": { + "images": [ + "13", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "22": { + "inputs": { + "filename_prefix": "crow_pony_", + "images": [ + "33", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "23": { + "inputs": { + "batch_size": 1, + "seed": [ + "9", + 0 + ] + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "24": { + "inputs": { + "text": [ + "8", + 0 + ], + "text2": "<%= it.prompt %>" + }, + "class_type": "ShowText|pysssss", + "_meta": { + "title": "Show Text 🐍" + } + }, + "25": { + "inputs": { + "lora_name": "zy_Realism_Enhancer_v2.safetensors", + "strength_model": 0.9000000000000001, + "strength_clip": 0.9000000000000001, + "model": [ + "6", + 0 + ], + "clip": [ + "6", + 1 + ] + }, + "class_type": "LoraLoader", + "_meta": { + "title": "Load LoRA" + } + }, + "26": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "27": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "28": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 6 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "13", + 0 + ], + "model": [ + "16", + 0 + ], + "clip": [ + "18", + 0 + ], + "vae": [ + "6", + 2 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "bbox_detector": [ + "27", + 0 + ], + "sam_model_opt": [ + "26", + 0 + ], + "segm_detector_opt": [ + "27", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "30": { + "inputs": { + "images": [ + "28", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "31": { + "inputs": { + "images": [ + "28", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "32": { + "inputs": { + "images": [ + "28", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "33": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 6 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "28", + 0 + ], + "model": [ + "16", + 0 + ], + "clip": [ + "18", + 0 + ], + "vae": [ + "6", + 2 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "bbox_detector": [ + "39", + 0 + ], + "sam_model_opt": [ + "40", + 0 + ], + "segm_detector_opt": [ + "41", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "34": { + "inputs": { + "images": [ + "33", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "35": { + "inputs": { + "images": [ + "33", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "36": { + "inputs": { + "images": [ + "33", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "37": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "38": { + "inputs": { + "images": [ + "28", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "39": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "40": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "41": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/cyber-illust-detailed.eta b/templates/img-gen/cyber-illust-detailed.eta new file mode 100644 index 0000000..c625c70 --- /dev/null +++ b/templates/img-gen/cyber-illust-detailed.eta @@ -0,0 +1,533 @@ +{ + "6": { + "inputs": { + "ckpt_name": "cyberrealisticXL_v53.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "7": { + "inputs": { + "text": "<%= it.negativePrompt || 'score_4_up, score_5_up, worst quality,bad quality,very displeasing,extra digit,fewer digits,jpeg artifacts,signature,username,reference,mutated,lineup,manga,comic,disembodied,turnaround,2koma,4koma,monster,cropped,amputee,text,bad foreshortening,what,logo,bad anatomy,bad perspective,bad proportions,artistic error,anatomical nonsense,amateur,out of frame,multiple views, non detailed eyes, embedding:CyberRealistic_Negative_SDXL-neg' %>" + }, + "class_type": "Text Multiline", + "_meta": { + "title": "Negative" + } + }, + "8": { + "inputs": { + "prompt": "<%= it.prompt %>", + "seed": [ + "9", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "9": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "Seed Everywhere", + "_meta": { + "title": "Seed Everywhere" + } + }, + "12": { + "inputs": { + "seed": [ + "9", + 0 + ], + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 1, + "model": [ + "16", + 0 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "latent_image": [ + "23", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "13": { + "inputs": { + "samples": [ + "12", + 0 + ], + "vae": [ + "6", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "16": { + "inputs": { + "text": [ + "8", + 0 + ], + "model": [ + "25", + 0 + ], + "clip": [ + "25", + 1 + ] + }, + "class_type": "LoraTagLoader", + "_meta": { + "title": "Load LoRA Tag" + } + }, + "17": { + "inputs": { + "text": [ + "16", + 2 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "18": { + "inputs": { + "stop_at_clip_layer": -2, + "clip": [ + "16", + 1 + ] + }, + "class_type": "CLIPSetLastLayer", + "_meta": { + "title": "CLIP Set Last Layer" + } + }, + "19": { + "inputs": { + "text": [ + "7", + 0 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "21": { + "inputs": { + "images": [ + "13", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "22": { + "inputs": { + "filename_prefix": "cyber_illust_", + "images": [ + "33", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "23": { + "inputs": { + "batch_size": 1, + "seed": [ + "9", + 0 + ] + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "24": { + "inputs": { + "text": [ + "8", + 0 + ], + "text2": "<%= it.prompt %>" + }, + "class_type": "ShowText|pysssss", + "_meta": { + "title": "Show Text 🐍" + } + }, + "25": { + "inputs": { + "lora_name": "Add_Details_v1.2.safetensors", + "strength_model": 2.5, + "strength_clip": 2.5, + "model": [ + "6", + 0 + ], + "clip": [ + "6", + 1 + ] + }, + "class_type": "LoraLoader", + "_meta": { + "title": "Load LoRA" + } + }, + "26": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "27": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "28": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "13", + 0 + ], + "model": [ + "16", + 0 + ], + "clip": [ + "18", + 0 + ], + "vae": [ + "6", + 2 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "bbox_detector": [ + "27", + 0 + ], + "sam_model_opt": [ + "26", + 0 + ], + "segm_detector_opt": [ + "27", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "30": { + "inputs": { + "images": [ + "28", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "31": { + "inputs": { + "images": [ + "28", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "32": { + "inputs": { + "images": [ + "28", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "33": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "28", + 0 + ], + "model": [ + "16", + 0 + ], + "clip": [ + "18", + 0 + ], + "vae": [ + "6", + 2 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "bbox_detector": [ + "39", + 0 + ], + "sam_model_opt": [ + "40", + 0 + ], + "segm_detector_opt": [ + "41", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "34": { + "inputs": { + "images": [ + "33", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "35": { + "inputs": { + "images": [ + "33", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "36": { + "inputs": { + "images": [ + "33", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "37": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "38": { + "inputs": { + "images": [ + "28", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "39": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "40": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "41": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/ddmv4.eta b/templates/img-gen/ddmv4.eta new file mode 100644 index 0000000..ba14f1d --- /dev/null +++ b/templates/img-gen/ddmv4.eta @@ -0,0 +1,734 @@ +{ + "2": { + "inputs": { + "filename_prefix": "DDMv4_", + "images": [ + "36", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "3": { + "inputs": { + "batch_size": 1, + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "4": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 1, + "model": [ + "13", + 0 + ], + "positive": [ + "7", + 0 + ], + "negative": [ + "5", + 0 + ], + "latent_image": [ + "3", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "5": { + "inputs": { + "text": "<%= it.negativePrompt || 'score_4_up, score_5_up, worst quality,bad quality,very displeasing,extra digit,fewer digits,jpeg artifacts,signature,username,reference,mutated,lineup,manga,comic,disembodied,turnaround,2koma,4koma,cropped,amputee,bad foreshortening,what,bad anatomy,bad perspective,bad proportions,artistic error,anatomical nonsense,amateur,out of frame,multiple views, non detailed eyes, ugly, airbrushed, simple background, cgi, cartoon, anime, bad, ugly' %>", + "clip": [ + "17", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Negative Prompt" + } + }, + "7": { + "inputs": { + "text": [ + "49", + 0 + ], + "clip": [ + "17", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Positive Prompt" + } + }, + "10": { + "inputs": { + "images": [ + "36", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "11": { + "inputs": { + "samples": [ + "4", + 0 + ], + "vae": [ + "13", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "36", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + }, + "13": { + "inputs": { + "ckpt_name": "donutsdeliverymixV4_v41.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "15": { + "inputs": { + "images": [ + "11", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "17": { + "inputs": { + "clip_name": "longclip-L.pt", + "clip": [ + "13", + 1 + ] + }, + "class_type": "SeaArtLongXLClipMerge", + "_meta": { + "title": "SeaArtLongXLClipMerge" + } + }, + "20": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "21": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "22": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "24": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "25": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "27": { + "inputs": { + "images": [ + "39", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "28": { + "inputs": { + "images": [ + "39", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "29": { + "inputs": { + "images": [ + "39", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "30": { + "inputs": { + "images": [ + "39", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "31": { + "inputs": { + "images": [ + "36", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "32": { + "inputs": { + "images": [ + "36", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "33": { + "inputs": { + "images": [ + "36", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "34": { + "inputs": { + "images": [ + "36", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "35": { + "inputs": { + "model": [ + "13", + 0 + ], + "clip": [ + "17", + 0 + ], + "vae": [ + "13", + 2 + ], + "positive": [ + "7", + 0 + ], + "negative": [ + "5", + 0 + ] + }, + "class_type": "ToBasicPipe", + "_meta": { + "title": "ToBasicPipe" + } + }, + "36": { + "inputs": { + "guide_size": 1024, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": 8, + "cfg": 3, + "sampler_name": "<%= it.sampler || 'dpmpp_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.45, + "feather": 10, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "refiner_ratio": 0.2, + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "42", + 0 + ], + "detailer_pipe": [ + "58", + 0 + ] + }, + "class_type": "FaceDetailerPipe", + "_meta": { + "title": "FaceDetailer (pipe)" + } + }, + "37": { + "inputs": { + "wildcard": [ + "52", + 0 + ], + "Select to add LoRA": "Select the LoRA to add to the text", + "Select to add Wildcard": "Select the Wildcard to add to the text", + "basic_pipe": [ + "35", + 0 + ], + "bbox_detector": [ + "24", + 0 + ], + "sam_model_opt": [ + "25", + 0 + ], + "segm_detector_opt": [ + "24", + 1 + ] + }, + "class_type": "BasicPipeToDetailerPipe", + "_meta": { + "title": "BasicPipe -> DetailerPipe" + } + }, + "39": { + "inputs": { + "guide_size": 1024, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": 8, + "cfg": 3, + "sampler_name": "<%= it.sampler || 'dpmpp_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.45000000000000007, + "feather": 10, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "refiner_ratio": 0.2, + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "11", + 0 + ], + "detailer_pipe": [ + "55", + 0 + ] + }, + "class_type": "FaceDetailerPipe", + "_meta": { + "title": "FaceDetailer (pipe)" + } + }, + "40": { + "inputs": { + "wildcard": [ + "59", + 0 + ], + "Select to add LoRA": "Select the LoRA to add to the text", + "Select to add Wildcard": "Select the Wildcard to add to the text", + "basic_pipe": [ + "35", + 0 + ], + "bbox_detector": [ + "22", + 0 + ], + "sam_model_opt": [ + "21", + 0 + ], + "segm_detector_opt": [ + "20", + 1 + ] + }, + "class_type": "BasicPipeToDetailerPipe", + "_meta": { + "title": "BasicPipe -> DetailerPipe" + } + }, + "42": { + "inputs": { + "guide_size": 1024, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": 8, + "cfg": 3, + "sampler_name": "<%= it.sampler || 'dpmpp_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.45000000000000007, + "feather": 10, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "refiner_ratio": 0.2, + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "39", + 0 + ], + "detailer_pipe": [ + "43", + 0 + ] + }, + "class_type": "FaceDetailerPipe", + "_meta": { + "title": "FaceDetailer (pipe)" + } + }, + "43": { + "inputs": { + "wildcard": "", + "Select to add LoRA": "Select the LoRA to add to the text", + "Select to add Wildcard": "Select the Wildcard to add to the text", + "basic_pipe": [ + "35", + 0 + ], + "bbox_detector": [ + "45", + 0 + ], + "sam_model_opt": [ + "25", + 0 + ], + "segm_detector_opt": [ + "45", + 1 + ] + }, + "class_type": "BasicPipeToDetailerPipe", + "_meta": { + "title": "BasicPipe -> DetailerPipe" + } + }, + "44": { + "inputs": { + "images": [ + "42", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "45": { + "inputs": { + "max_faces": 10, + "face": false, + "mouth": false, + "left_eyebrow": false, + "left_eye": true, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": true, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "46": { + "inputs": { + "images": [ + "42", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "47": { + "inputs": { + "images": [ + "42", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "48": { + "inputs": { + "images": [ + "42", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "49": { + "inputs": { + "string": "<%= it.prompt %>" + }, + "class_type": "Simple String", + "_meta": { + "title": "Simple String" + } + }, + "52": { + "inputs": { + "text1": "The face of", + "text2": [ + "49", + 0 + ], + "operation": "text1 + text2 to output1, text1 + text2 to output2", + "delimiter": " ", + "use_seed": "false", + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "TextCombinations", + "_meta": { + "title": "Text Combinations 2 (Mikey)" + } + }, + "55": { + "inputs": { + "wildcard": "", + "Select to add LoRA": "Select the LoRA to add to the text", + "Select to add Wildcard": "Select the Wildcard to add to the text", + "detailer_pipe": [ + "37", + 0 + ], + "positive": [ + "56", + 0 + ] + }, + "class_type": "EditDetailerPipe", + "_meta": { + "title": "Edit DetailerPipe" + } + }, + "56": { + "inputs": { + "text": [ + "52", + 0 + ], + "clip": [ + "17", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Positive Prompt" + } + }, + "58": { + "inputs": { + "wildcard": "", + "Select to add LoRA": "Select the LoRA to add to the text", + "Select to add Wildcard": "Select the Wildcard to add to the text", + "detailer_pipe": [ + "40", + 0 + ], + "positive": [ + "60", + 0 + ] + }, + "class_type": "EditDetailerPipe", + "_meta": { + "title": "Edit DetailerPipe" + } + }, + "59": { + "inputs": { + "text1": "The hand of", + "text2": [ + "49", + 0 + ], + "operation": "text1 + text2 to output1, text1 + text2 to output2", + "delimiter": " ", + "use_seed": "false", + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "TextCombinations", + "_meta": { + "title": "Text Combinations 2 (Mikey)" + } + }, + "60": { + "inputs": { + "text": [ + "59", + 0 + ], + "clip": [ + "17", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Positive Prompt" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/hidream-abli.eta b/templates/img-gen/hidream-abli.eta new file mode 100644 index 0000000..ecad6ae --- /dev/null +++ b/templates/img-gen/hidream-abli.eta @@ -0,0 +1,164 @@ +{ + "1": { + "inputs": { + "text": "<%= it.negativePrompt ||'bad ugly jpeg artifacts' %>", + "clip": [ + "12", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Negative Prompt" + } + }, + "2": { + "inputs": { + "vae_name": "HiDream-ae.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "4": { + "inputs": { + "unet_name": "hidreamI1FP8Uncensored_fullV02AlphaNude.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "5": { + "inputs": { + "shift": 3, + "model": [ + "4", + 0 + ] + }, + "class_type": "ModelSamplingSD3", + "_meta": { + "title": "ModelSamplingSD3" + } + }, + "6": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 30 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "model": [ + "5", + 0 + ], + "positive": [ + "10", + 0 + ], + "negative": [ + "1", + 0 + ], + "latent_image": [ + "11", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "7": { + "inputs": { + "samples": [ + "6", + 0 + ], + "vae": [ + "2", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "8": { + "inputs": { + "images": [ + "7", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "9": { + "inputs": { + "filename_prefix": "HiDream_uncen_", + "images": [ + "7", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "10": { + "inputs": { + "text": "<%= it.prompt %>", + "clip": [ + "12", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Positive Prompt" + } + }, + "11": { + "inputs": { + "batch_size": <%= it.batchSize || 1 %>, + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "12": { + "inputs": { + "clip_name": "llama_3.1_8b_instruct_abli.safetensors", + "type": "hidream", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "7", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/hidream.eta b/templates/img-gen/hidream.eta new file mode 100644 index 0000000..68cfe76 --- /dev/null +++ b/templates/img-gen/hidream.eta @@ -0,0 +1,164 @@ +{ + "1": { + "inputs": { + "text": "<%= it.negativePrompt ||'bad ugly jpeg artifacts' %>", + "clip": [ + "12", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Negative Prompt" + } + }, + "2": { + "inputs": { + "vae_name": "HiDream-ae.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "4": { + "inputs": { + "unet_name": "hidreamI1FP8Uncensored_fullV02AlphaNude.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "5": { + "inputs": { + "shift": 3, + "model": [ + "4", + 0 + ] + }, + "class_type": "ModelSamplingSD3", + "_meta": { + "title": "ModelSamplingSD3" + } + }, + "6": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 30 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || "euler" %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "model": [ + "5", + 0 + ], + "positive": [ + "10", + 0 + ], + "negative": [ + "1", + 0 + ], + "latent_image": [ + "11", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "7": { + "inputs": { + "samples": [ + "6", + 0 + ], + "vae": [ + "2", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "8": { + "inputs": { + "images": [ + "7", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "9": { + "inputs": { + "filename_prefix": "HiDream_uncen_", + "images": [ + "7", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "10": { + "inputs": { + "text": "<%= it.prompt %>", + "clip": [ + "12", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "Positive Prompt" + } + }, + "11": { + "inputs": { + "batch_size": <%= it.batchSize || 1 %>, + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "12": { + "inputs": { + "clip_name": "llama_3.1_8b_instruct_fp8_scaled.safetensors", + "type": "hidream", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "7", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/plant-milk.eta b/templates/img-gen/plant-milk.eta new file mode 100644 index 0000000..839b610 --- /dev/null +++ b/templates/img-gen/plant-milk.eta @@ -0,0 +1,889 @@ +{ + "1": { + "inputs": { + "samples": [ + "27", + 0 + ], + "vae": [ + "31", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "2": { + "inputs": { + "text_0": "<%= it.prompt %>", + "text": [ + "30", + 2 + ] + }, + "class_type": "ShowText|pysssss", + "_meta": { + "title": "Show Text 🐍" + } + }, + "3": { + "inputs": { + "images": [ + "1", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "4": { + "inputs": { + "images": [ + "25", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "5": { + "inputs": { + "images": [ + "25", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "6": { + "inputs": { + "images": [ + "26", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "7": { + "inputs": { + "images": [ + "26", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "8": { + "inputs": { + "images": [ + "26", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "9": { + "inputs": { + "images": [ + "26", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "10": { + "inputs": { + "images": [ + "25", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "11": { + "inputs": { + "images": [ + "25", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "14": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "15": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "16": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "17": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "18": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "19": { + "inputs": { + "batch_size": 1, + "seed": [ + "22", + 0 + ] + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "20": { + "inputs": { + "text": [ + "30", + 2 + ], + "clip": [ + "30", + 1 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "21": { + "inputs": { + "text": [ + "29", + 0 + ], + "clip": [ + "30", + 1 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "22": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "Seed Everywhere", + "_meta": { + "title": "Seed Everywhere" + } + }, + "23": { + "inputs": { + "prompt": "<%= it.prompt %>", + "seed": [ + "22", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "26", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + }, + "25": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps":<%= it.steps || 28 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'euler_ancestral' %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 0.0001, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "1", + 0 + ], + "model": [ + "30", + 0 + ], + "clip": [ + "30", + 1 + ], + "vae": [ + "31", + 2 + ], + "positive": [ + "20", + 0 + ], + "negative": [ + "21", + 0 + ], + "bbox_detector": [ + "17", + 0 + ], + "sam_model_opt": [ + "18", + 0 + ], + "segm_detector_opt": [ + "17", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "26": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps":<%= it.steps || 28 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'euler_ancestral' %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "43", + 0 + ], + "model": [ + "30", + 0 + ], + "clip": [ + "30", + 1 + ], + "vae": [ + "31", + 2 + ], + "positive": [ + "53", + 0 + ], + "negative": [ + "21", + 0 + ], + "bbox_detector": [ + "14", + 0 + ], + "sam_model_opt": [ + "15", + 0 + ], + "segm_detector_opt": [ + "16", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "27": { + "inputs": { + "seed": [ + "22", + 0 + ], + "steps":<%= it.steps || 28 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'euler_ancestral' %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "model": [ + "30", + 0 + ], + "positive": [ + "20", + 0 + ], + "negative": [ + "21", + 0 + ], + "latent_image": [ + "19", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "28": { + "inputs": { + "filename_prefix": "plant_milk_", + "images": [ + "26", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "29": { + "inputs": { + "text": "<%= it.negativePrompt || 'embedding:lazyhand, embedding:lazyneg, bad quality, worst quality, lowres, jpeg artifacts, bad anatomy, bad hands, multiple views, signature, watermark, censored, ugly, messy' %>" + }, + "class_type": "Text Multiline", + "_meta": { + "title": "Negative" + } + }, + "30": { + "inputs": { + "text": [ + "23", + 0 + ], + "model": [ + "31", + 0 + ], + "clip": [ + "31", + 1 + ] + }, + "class_type": "LoraTagLoader", + "_meta": { + "title": "Load LoRA Tag" + } + }, + "31": { + "inputs": { + "ckpt_name": "plantMilkModelSuite_walnut.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "33": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps":<%= it.steps || 28 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'euler_ancestral' %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "25", + 0 + ], + "model": [ + "30", + 0 + ], + "clip": [ + "30", + 1 + ], + "vae": [ + "31", + 2 + ], + "positive": [ + "20", + 0 + ], + "negative": [ + "21", + 0 + ], + "bbox_detector": [ + "34", + 0 + ], + "sam_model_opt": [ + "18", + 0 + ], + "segm_detector_opt": [ + "34", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "34": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": true, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": true, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "35": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "36": { + "inputs": { + "images": [ + "33", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "37": { + "inputs": { + "images": [ + "33", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "38": { + "inputs": { + "images": [ + "33", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "39": { + "inputs": { + "text": [ + "40", + 0 + ], + "clip": [ + "30", + 1 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "40": { + "inputs": { + "prompt": "(perfect hands)", + "seed": [ + "22", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "41": { + "inputs": { + "prompt": "face", + "seed": [ + "22", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "42": { + "inputs": { + "text": [ + "41", + 0 + ], + "clip": [ + "30", + 1 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "43": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps":<%= it.steps || 28 %>, + "cfg": <%= it.cfg || 5 %>, + "sampler_name": "<%= it.sampler || 'euler_ancestral' %>", + "scheduler": "<%= it.scheduler || 'beta' %>", + "denoise": 1, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "33", + 0 + ], + "model": [ + "30", + 0 + ], + "clip": [ + "30", + 1 + ], + "vae": [ + "31", + 2 + ], + "positive": [ + "51", + 0 + ], + "negative": [ + "21", + 0 + ], + "bbox_detector": [ + "44", + 0 + ], + "sam_model_opt": [ + "49", + 0 + ], + "segm_detector_opt": [ + "50", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "44": { + "inputs": { + "model_name": "bbox/face_yolov8m.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "45": { + "inputs": { + "images": [ + "43", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "46": { + "inputs": { + "images": [ + "43", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "47": { + "inputs": { + "images": [ + "43", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "48": { + "inputs": { + "images": [ + "43", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "49": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "50": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "51": { + "inputs": { + "conditioning1": [ + "42", + 0 + ], + "conditioning2": [ + "20", + 0 + ] + }, + "class_type": "ImpactCombineConditionings", + "_meta": { + "title": "Combine Conditionings" + } + }, + "53": { + "inputs": { + "conditioning_1": [ + "39", + 0 + ], + "conditioning_2": [ + "20", + 0 + ] + }, + "class_type": "ConditioningCombine", + "_meta": { + "title": "Conditioning (Combine)" + } + }, + "54": { + "inputs": { + "text_0": "embedding:lazyhand, embedding:lazyneg, bad quality, worst quality, lowres, jpeg artifacts, bad anatomy, bad hands, multiple views, signature, watermark, censored, ugly, messy", + "text": [ + "29", + 0 + ] + }, + "class_type": "ShowText|pysssss", + "_meta": { + "title": "Show Text 🐍" + } + } +} \ No newline at end of file diff --git a/templates/img-gen/pony-realism-detailed.eta b/templates/img-gen/pony-realism-detailed.eta new file mode 100644 index 0000000..7e8e751 --- /dev/null +++ b/templates/img-gen/pony-realism-detailed.eta @@ -0,0 +1,533 @@ +{ + "6": { + "inputs": { + "ckpt_name": "ponyRealism_V23.safetensors" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "7": { + "inputs": { + "text": "<%= it.negativePrompt || 'score_4_up, score_5_up, worst quality,bad quality,very displeasing,extra digit,fewer digits,jpeg artifacts,signature,username,reference,mutated,lineup,manga,comic,disembodied,turnaround,2koma,4koma,cropped,amputee,text,bad foreshortening,what,logo,bad anatomy,bad perspective,bad proportions,artistic error,anatomical nonsense,amateur,out of frame,multiple views, non detailed eyes' %>" + }, + "class_type": "Text Multiline", + "_meta": { + "title": "Negative" + } + }, + "8": { + "inputs": { + "prompt": "<%= it.prompt %>", + "seed": [ + "9", + 0 + ] + }, + "class_type": "Wildcard Processor", + "_meta": { + "title": "wildcard processor(Pos prompt)" + } + }, + "9": { + "inputs": { + "seed": <%= it.seed || it.randomSeed() %> + }, + "class_type": "Seed Everywhere", + "_meta": { + "title": "Seed Everywhere" + } + }, + "12": { + "inputs": { + "seed": [ + "9", + 0 + ], + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 6 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 1, + "model": [ + "16", + 0 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "latent_image": [ + "23", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "13": { + "inputs": { + "samples": [ + "12", + 0 + ], + "vae": [ + "6", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "16": { + "inputs": { + "text": [ + "8", + 0 + ], + "model": [ + "25", + 0 + ], + "clip": [ + "25", + 1 + ] + }, + "class_type": "LoraTagLoader", + "_meta": { + "title": "Load LoRA Tag" + } + }, + "17": { + "inputs": { + "text": [ + "16", + 2 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "18": { + "inputs": { + "stop_at_clip_layer": -2, + "clip": [ + "16", + 1 + ] + }, + "class_type": "CLIPSetLastLayer", + "_meta": { + "title": "CLIP Set Last Layer" + } + }, + "19": { + "inputs": { + "text": [ + "7", + 0 + ], + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "21": { + "inputs": { + "images": [ + "13", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "22": { + "inputs": { + "filename_prefix": "pony_realism", + "images": [ + "33", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "23": { + "inputs": { + "batch_size": 1, + "seed": [ + "9", + 0 + ] + }, + "class_type": "RandomEmptyLatentImageFromPresetsSDXL", + "_meta": { + "title": "Random Empty Latent Image From Presets (SDXL)" + } + }, + "24": { + "inputs": { + "text": [ + "8", + 0 + ], + "text2": "<%= it.prompt %>" + }, + "class_type": "ShowText|pysssss", + "_meta": { + "title": "Show Text 🐍" + } + }, + "25": { + "inputs": { + "lora_name": "zy_Realism_Enhancer_v2.safetensors", + "strength_model": 0.9000000000000001, + "strength_clip": 0.9000000000000001, + "model": [ + "6", + 0 + ], + "clip": [ + "6", + 1 + ] + }, + "class_type": "LoraLoader", + "_meta": { + "title": "Load LoRA" + } + }, + "26": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "27": { + "inputs": { + "max_faces": 10, + "face": true, + "mouth": false, + "left_eyebrow": false, + "left_eye": false, + "left_pupil": false, + "right_eyebrow": false, + "right_eye": false, + "right_pupil": false + }, + "class_type": "MediaPipeFaceMeshDetectorProvider //Inspire", + "_meta": { + "title": "MediaPipeFaceMesh Detector Provider" + } + }, + "28": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 6 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "13", + 0 + ], + "model": [ + "16", + 0 + ], + "clip": [ + "18", + 0 + ], + "vae": [ + "6", + 2 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "bbox_detector": [ + "27", + 0 + ], + "sam_model_opt": [ + "26", + 0 + ], + "segm_detector_opt": [ + "27", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "30": { + "inputs": { + "images": [ + "28", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "31": { + "inputs": { + "images": [ + "28", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "32": { + "inputs": { + "images": [ + "28", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "33": { + "inputs": { + "guide_size": 512, + "guide_size_for": true, + "max_size": 1024, + "seed": <%= it.seed || it.randomSeed() %>, + "steps": <%= it.steps || 40 %>, + "cfg": <%= it.cfg || 6 %>, + "sampler_name": "<%= it.sampler || 'dpmpp_2m_sde_gpu' %>", + "scheduler": "<%= it.scheduler || 'karras' %>", + "denoise": 0.35000000000000003, + "feather": 5, + "noise_mask": true, + "force_inpaint": true, + "bbox_threshold": 0.5, + "bbox_dilation": 10, + "bbox_crop_factor": 3, + "sam_detection_hint": "center-1", + "sam_dilation": 0, + "sam_threshold": 0.93, + "sam_bbox_expansion": 0, + "sam_mask_hint_threshold": 0.7, + "sam_mask_hint_use_negative": "False", + "drop_size": 10, + "wildcard": "", + "cycle": 1, + "inpaint_model": false, + "noise_mask_feather": 20, + "tiled_encode": false, + "tiled_decode": false, + "image": [ + "28", + 0 + ], + "model": [ + "16", + 0 + ], + "clip": [ + "18", + 0 + ], + "vae": [ + "6", + 2 + ], + "positive": [ + "17", + 0 + ], + "negative": [ + "19", + 0 + ], + "bbox_detector": [ + "39", + 0 + ], + "sam_model_opt": [ + "40", + 0 + ], + "segm_detector_opt": [ + "41", + 1 + ] + }, + "class_type": "FaceDetailer", + "_meta": { + "title": "FaceDetailer" + } + }, + "34": { + "inputs": { + "images": [ + "33", + 5 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "35": { + "inputs": { + "images": [ + "33", + 2 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "36": { + "inputs": { + "images": [ + "33", + 1 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "37": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "38": { + "inputs": { + "images": [ + "28", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "39": { + "inputs": { + "model_name": "bbox/hand_yolov8s.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "40": { + "inputs": { + "model_name": "sam_vit_h_4b8939.pth", + "device_mode": "Prefer GPU" + }, + "class_type": "SAMLoader", + "_meta": { + "title": "SAMLoader (Impact)" + } + }, + "41": { + "inputs": { + "model_name": "segm/person_yolov8m-seg.pt" + }, + "class_type": "UltralyticsDetectorProvider", + "_meta": { + "title": "UltralyticsDetectorProvider" + } + }, + "save_image_websocket_node": { + "inputs": { + "images": [ + "33", + 0 + ] + }, + "class_type": "SaveImageWebsocket", + "_meta": { + "title": "SaveImageWebsocket" + } + } +} \ No newline at end of file