Compare commits
424
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77a3fe1ff8 | ||
|
|
95ab5f6e0e | ||
|
|
aadfcb88ec | ||
|
|
e8da2a52a2 | ||
|
|
5fec58ace9 | ||
|
|
f91c8e48d5 | ||
|
|
c5ad611bee | ||
|
|
f71088b958 | ||
|
|
fec84b928c | ||
|
|
4b1ef024b8 | ||
|
|
71c1ec2071 | ||
|
|
0991ef27bb | ||
|
|
170885cb73 | ||
|
|
a4354a47dd | ||
|
|
cb612c777f | ||
|
|
c0e348bedd | ||
|
|
722878d0c1 | ||
|
|
0f4a156c6b | ||
|
|
78e696ad8b | ||
|
|
6effc61e2d | ||
|
|
2b03710023 | ||
|
|
df5ee8bb08 | ||
|
|
da10e98b43 | ||
|
|
6308a7257f | ||
|
|
14298c6d7e | ||
|
|
9a7b8ee5b1 | ||
|
|
acbbb032ef | ||
|
|
a8321bccad | ||
|
|
a0b3c2ea95 | ||
|
|
d6a7c630b2 | ||
|
|
03ddbc9ef7 | ||
|
|
060c40a195 | ||
|
|
9f3ac5a498 | ||
|
|
c7fe70dde9 | ||
|
|
d28ce0ebb6 | ||
|
|
72f8830ebd | ||
|
|
2477b758a0 | ||
|
|
84515ebd97 | ||
|
|
d19e6661b2 | ||
|
|
2e8a10ec10 | ||
|
|
f0f5134c7e | ||
|
|
174d4a81b1 | ||
|
|
c30b124178 | ||
|
|
37e13da2ae | ||
|
|
8520951187 | ||
|
|
7f13daead7 | ||
|
|
1fca384aff | ||
|
|
f39396c5d4 | ||
|
|
98dced9d2f | ||
|
|
369702d22a | ||
|
|
f453bacf5e | ||
|
|
48c0bc0000 | ||
|
|
e76d475eb3 | ||
|
|
b33ea15575 | ||
|
|
2f080686f9 | ||
|
|
c020e53435 | ||
|
|
0632c104ff | ||
|
|
62413eef53 | ||
|
|
9943a60e63 | ||
|
|
050723f245 | ||
|
|
c5bfdcfe93 | ||
|
|
5cdb560c0c | ||
|
|
6640478428 | ||
|
|
067e5e946a | ||
|
|
af923711a2 | ||
|
|
7766dad425 | ||
|
|
4f54298cac | ||
|
|
e2cef8e75c | ||
|
|
ce672777c5 | ||
|
|
b9abadc011 | ||
|
|
7315c9bd30 | ||
|
|
cf5e5a832b | ||
|
|
4c1d25d81f | ||
|
|
3f248d1b98 | ||
|
|
839e00bbac | ||
|
|
2a367a90cc | ||
|
|
9c2fa1e454 | ||
|
|
57672d9058 | ||
|
|
365050aa8c | ||
|
|
b9c5898285 | ||
|
|
b90ee3bf14 | ||
|
|
f3fd30e965 | ||
|
|
4186db0a26 | ||
|
|
1749792457 | ||
|
|
0ba8b5664b | ||
|
|
9136fe88d3 | ||
|
|
9cd87d4778 | ||
|
|
f0ef22c01c | ||
|
|
98e4ddf1ff | ||
|
|
c478c86e73 | ||
|
|
bbd1841e42 | ||
|
|
50897144bd | ||
|
|
84115ca26e | ||
|
|
699c435955 | ||
|
|
017788a2d9 | ||
|
|
6bfbfcbf29 | ||
|
|
7a34c917ae | ||
|
|
e3871d624c | ||
|
|
538698d2b2 | ||
|
|
be9db84962 | ||
|
|
ad7bf01cbc | ||
|
|
254be062ba | ||
|
|
1d4d619649 | ||
|
|
d9a143b98e | ||
|
|
f6d01458a8 | ||
|
|
60dca17f4a | ||
|
|
94b1ab1def | ||
|
|
f7fe1ceac8 | ||
|
|
e21c06591d | ||
|
|
39af045ecd | ||
|
|
043025107d | ||
|
|
32b42832fc | ||
|
|
7ab5b333a0 | ||
|
|
62e5d26e14 | ||
|
|
36d5ee3604 | ||
|
|
6ec510f5e0 | ||
|
|
95350d1d77 | ||
|
|
f6f9fb4525 | ||
|
|
3399f6c4f2 | ||
|
|
e9864c02cb | ||
|
|
ccce4073a6 | ||
|
|
5389db5ce5 | ||
|
|
e8be47102e | ||
|
|
ac9817945e | ||
|
|
1068b3fb75 | ||
|
|
1bf9f0bbb8 | ||
|
|
201cd54508 | ||
|
|
4ce99c7254 | ||
|
|
be078c7da3 | ||
|
|
533fede3b9 | ||
|
|
f8ce7c03b7 | ||
|
|
6e9651613a | ||
|
|
e382402bea | ||
|
|
676c810538 | ||
|
|
780177f118 | ||
|
|
1f11996210 | ||
|
|
b5481a6bbd | ||
|
|
07bb4d792b | ||
|
|
34995f9fdb | ||
|
|
8e00fd07fc | ||
|
|
c47b4bd36e | ||
|
|
41260de5b3 | ||
|
|
e82fdddfb9 | ||
|
|
3213c6a4c1 | ||
|
|
b6266d1f13 | ||
|
|
fbabc5de42 | ||
|
|
6f2a39502e | ||
|
|
c33fc9a968 | ||
|
|
eb1be4f36c | ||
|
|
0a16f4da32 | ||
|
|
89a8e2d05d | ||
|
|
0d1f6cf246 | ||
|
|
f9b142bb76 | ||
|
|
d0ce322d7c | ||
|
|
9a52cd8a04 | ||
|
|
20f5ea273d | ||
|
|
f4c123cffb | ||
|
|
148edbd741 | ||
|
|
d31377a939 | ||
|
|
3942e7d9dc | ||
|
|
28936dbe7e | ||
|
|
f75f7456b0 | ||
|
|
52e1e81838 | ||
|
|
6c41677b36 | ||
|
|
33555abf0f | ||
|
|
6a891d185c | ||
|
|
199a618a94 | ||
|
|
62a3fcbacc | ||
|
|
09bf3e9908 | ||
|
|
2e713a4f10 | ||
|
|
0b84c467c7 | ||
|
|
2ec0c6c425 | ||
|
|
80d056fc55 | ||
|
|
84c346c250 | ||
|
|
3fb2f028e3 | ||
|
|
d9c5a9e758 | ||
|
|
04e4d71a73 | ||
|
|
5f6ba96174 | ||
|
|
b1f9b9ab21 | ||
|
|
762b84886d | ||
|
|
1321486537 | ||
|
|
6e3ced5f2d | ||
|
|
841d82dff1 | ||
|
|
3d3a0d1a51 | ||
|
|
515bb90afb | ||
|
|
e8df529c76 | ||
|
|
b40e19cf35 | ||
|
|
e40f1075b9 | ||
|
|
c74c4877c3 | ||
|
|
0a23673a5a | ||
|
|
852af46786 | ||
|
|
63790c2e10 | ||
|
|
2289ef77aa | ||
|
|
7d09daeb39 | ||
|
|
7c61ae226d | ||
|
|
52cb5d8493 | ||
|
|
bfa7c35a64 | ||
|
|
916197fb28 | ||
|
|
286866fa0f | ||
|
|
a9fe941b03 | ||
|
|
f684af1273 | ||
|
|
734e88af1f | ||
|
|
a3a5cf2826 | ||
|
|
2fa296fe89 | ||
|
|
07461b5972 | ||
|
|
952f72bedf | ||
|
|
3792649ae5 | ||
|
|
5b00d85094 | ||
|
|
09b8c499e7 | ||
|
|
d2782a2a90 | ||
|
|
3ef50e0262 | ||
|
|
f9cd259a3e | ||
|
|
9f3a6f2010 | ||
|
|
2f31463af8 | ||
|
|
9ab4365245 | ||
|
|
5dfbcdd99c | ||
|
|
20f860d5ff | ||
|
|
44edcc633c | ||
|
|
c99425cef1 | ||
|
|
dcb9be2bdc | ||
|
|
9304be69a8 | ||
|
|
743126d86f | ||
|
|
fb430afca1 | ||
|
|
c636d73223 | ||
|
|
6db92cdd28 | ||
|
|
3c6cbd3a41 | ||
|
|
a606d34b97 | ||
|
|
6d1ca0055d | ||
|
|
aaf3ae6ae6 | ||
|
|
d62d263725 | ||
|
|
ffd4e66654 | ||
|
|
7f97d84a88 | ||
|
|
acfe587691 | ||
|
|
f87d710d14 | ||
|
|
85da4a4d0e | ||
|
|
4832789b48 | ||
|
|
9e9121accb | ||
|
|
905ee4033f | ||
|
|
3ef9e5f51d | ||
|
|
05628b7834 | ||
|
|
c1c1a5e054 | ||
|
|
a3eb72a30c | ||
|
|
cacadcf3b1 | ||
|
|
467505748d | ||
|
|
c100ef82c4 | ||
|
|
fa695038ce | ||
|
|
30cc27b985 | ||
|
|
081379ae97 | ||
|
|
21f97580e9 | ||
|
|
8c6599d2d4 | ||
|
|
78312c7bf5 | ||
|
|
16796566c4 | ||
|
|
3f36952095 | ||
|
|
0f4bd5b135 | ||
|
|
8a5fbfe1fb | ||
|
|
f6503cc7af | ||
|
|
51993c0a2c | ||
|
|
b043f6f1a7 | ||
|
|
29c986cfdc | ||
|
|
171ad422b9 | ||
|
|
f4061f4255 | ||
|
|
9d7bcfbfb6 | ||
|
|
8d139cdfc5 | ||
|
|
fae68ecb77 | ||
|
|
661c33a926 | ||
|
|
9b27bc9c4c | ||
|
|
2b5d5de853 | ||
|
|
de530e2eac | ||
|
|
7d81a43133 | ||
|
|
0067575b0c | ||
|
|
8cc90794d8 | ||
|
|
d82ed510b9 | ||
|
|
3f06362f9c | ||
|
|
d37e0cd026 | ||
|
|
38bdddded8 | ||
|
|
f0f6ca9f0c | ||
|
|
d47a6743e3 | ||
|
|
ab8389d598 | ||
|
|
5b10b3a23f | ||
|
|
f2d966afd1 | ||
|
|
182abca56f | ||
|
|
c1c9831378 | ||
|
|
6418940761 | ||
|
|
72af858975 | ||
|
|
80e5221403 | ||
|
|
f658ac58b0 | ||
|
|
adb1eaacc4 | ||
|
|
b0f8b5ec55 | ||
|
|
a3984bf656 | ||
|
|
72543c0b35 | ||
|
|
b2afb6c7a7 | ||
|
|
232e1dcdb7 | ||
|
|
ab67a1f77f | ||
|
|
2af3fd9c83 | ||
|
|
9986ded109 | ||
|
|
197ac04a8c | ||
|
|
be2a2a1444 | ||
|
|
76eb4fc7e7 | ||
|
|
057f2bd05a | ||
|
|
172252ab02 | ||
|
|
ebc81ea57e | ||
|
|
bc235e96e5 | ||
|
|
6572b49386 | ||
|
|
d593e01fc9 | ||
|
|
009aa95d98 | ||
|
|
b61b3efc94 | ||
|
|
6cfed25a8e | ||
|
|
27e175aa08 | ||
|
|
6224bae13c | ||
|
|
bd49afae19 | ||
|
|
13e4d73dbd | ||
|
|
37584519e8 | ||
|
|
1ed921b6fb | ||
|
|
15e5803a06 | ||
|
|
a0327f6ddd | ||
|
|
e65612bb28 | ||
|
|
11d79b252d | ||
|
|
7e5cadaa06 | ||
|
|
94d302e112 | ||
|
|
fb26f3ae06 | ||
|
|
11638b0557 | ||
|
|
ad81fbcca1 | ||
|
|
9cc91ffba8 | ||
|
|
0450466422 | ||
|
|
d5442cd659 | ||
|
|
9a1096149a | ||
|
|
0401d9dd34 | ||
|
|
8961827079 | ||
|
|
dea2eac8cd | ||
|
|
3c1eeaa486 | ||
|
|
cf0eec8d31 | ||
|
|
8618d8ca56 | ||
|
|
46dde36185 | ||
|
|
a29ca76fe8 | ||
|
|
2908eac20c | ||
|
|
1276d95708 | ||
|
|
39a7599fd9 | ||
|
|
c4e519565b | ||
|
|
f18b8f6ca3 | ||
|
|
64ab3e9761 | ||
|
|
065f2cb14c | ||
|
|
3d99ddd35a | ||
|
|
224b4af1da | ||
|
|
0a7177b151 | ||
|
|
b31561d1a0 | ||
|
|
ba4ab486c3 | ||
|
|
4603256ebf | ||
|
|
52b23691dc | ||
|
|
df773658da | ||
|
|
d4636bb5e3 | ||
|
|
83f59cac93 | ||
|
|
431941fc9d | ||
|
|
f5eab116c0 | ||
|
|
6008d31653 | ||
|
|
434817bc76 | ||
|
|
cdd98b13a3 | ||
|
|
f9683347be | ||
|
|
a2853a0ae1 | ||
|
|
b2eb11996b | ||
|
|
36fcf9db4f | ||
|
|
cb21a14424 | ||
|
|
f9ca96f648 | ||
|
|
2d7dd74fe2 | ||
|
|
8a379940bd | ||
|
|
a87ffb84b7 | ||
|
|
89bda6ba11 | ||
|
|
e191f0fc40 | ||
|
|
090dcdad62 | ||
|
|
47d1c4f739 | ||
|
|
a92017cff4 | ||
|
|
cfbc42799a | ||
|
|
799d731ab5 | ||
|
|
5fc8cffc9f | ||
|
|
4dffaf3991 | ||
|
|
bc474f1532 | ||
|
|
c206d9e9da | ||
|
|
b4657e2b58 | ||
|
|
eba880cdee | ||
|
|
b6a67a4c34 | ||
|
|
27525ffdd8 | ||
|
|
eb668c448c | ||
|
|
9b3cd7c769 | ||
|
|
13c303178b | ||
|
|
f945feabb6 | ||
|
|
24ce4ffb06 | ||
|
|
980ed5db8b | ||
|
|
bf59887643 | ||
|
|
60be0ee865 | ||
|
|
146e3cfa8b | ||
|
|
e22ddb90d5 | ||
|
|
db9a033f11 | ||
|
|
442656c712 | ||
|
|
b17f8c0355 | ||
|
|
92a4ae8c56 | ||
|
|
51a2aebf40 | ||
|
|
28fbd321c7 | ||
|
|
144884fae3 | ||
|
|
935741b43d | ||
|
|
c1b620d448 | ||
|
|
4b1dc7ccb7 | ||
|
|
c963657b6e | ||
|
|
5b4651df45 | ||
|
|
1b1fca961c | ||
|
|
1568a56874 | ||
|
|
989a0e32d6 | ||
|
|
2ce4d7c9f0 | ||
|
|
25b293513e | ||
|
|
a5190b3c6b | ||
|
|
9c58b5a9ed | ||
|
|
8d38e53b3a | ||
|
|
ef6b10a380 | ||
|
|
3f7759aa79 | ||
|
|
95b69ce4af | ||
|
|
28340ded7e | ||
|
|
da3072a7de | ||
|
|
475d6e19ea | ||
|
|
b3df628a60 | ||
|
|
2a2b31721b | ||
|
|
68a36d99e1 | ||
|
|
f4d42734fe | ||
|
|
7d9e972f77 | ||
|
|
a6e2b65e97 | ||
|
|
d513723bb0 | ||
|
|
9f8bf4d803 |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"attribution": {
|
||||
"commit": "",
|
||||
"pr": ""
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,10 @@ SECURITY.md
|
||||
.claude/
|
||||
/docs/
|
||||
|
||||
# the skill an AI agent installs from the repository (npx skills add);
|
||||
# nothing in the pack loads it
|
||||
/skills/
|
||||
|
||||
# README media: GitHub shows it on the repository page, nothing in the
|
||||
# pack loads it
|
||||
/assets/
|
||||
|
||||
@@ -13,7 +13,11 @@ name: ComfyUI updates
|
||||
# and required input the example workflows use.
|
||||
# 4. scripts/dev/face_smoke.mjs puts every node on a graph in headless
|
||||
# Chrome, in the classic node view and in Nodes 2.0: its face comes up
|
||||
# and nothing throws.
|
||||
# and nothing throws. A third run acts like a privacy browser that
|
||||
# blanks canvas pixel reads: a node that loads a picture must still
|
||||
# draw it.
|
||||
# scripts/dev/h3_sockets_check.mjs then checks that H3 Prompt Writer
|
||||
# still draws only the sockets in use, in both views.
|
||||
#
|
||||
# A failure on the release opens an issue (or adds to the open one) and fails
|
||||
# the run. The development head breaks and mends itself often, so that job
|
||||
@@ -31,6 +35,7 @@ on:
|
||||
- "tests/test_comfy_core_contract.py"
|
||||
- "scripts/compat_boot.py"
|
||||
- "scripts/dev/face_smoke.mjs"
|
||||
- "scripts/dev/h3_sockets_check.mjs"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -117,7 +122,7 @@ jobs:
|
||||
echo "ComfyUI did not come up"; tail -60 "$GITHUB_WORKSPACE/comfyui.log"; exit 1
|
||||
- name: Every node is offered and every example still fits
|
||||
run: python ComfyUI-AusBoss/scripts/compat_boot.py --url http://127.0.0.1:8188 --log comfyui.log
|
||||
- name: Every node's face comes up, classic and Nodes 2.0
|
||||
- name: Every node's face comes up, classic, Nodes 2.0 and a privacy browser
|
||||
run: |
|
||||
google-chrome --headless=new --remote-debugging-port=9333 --no-sandbox --disable-gpu --disable-dev-shm-usage \
|
||||
--user-data-dir="$RUNNER_TEMP/chrome" about:blank > "$GITHUB_WORKSPACE/chrome.log" 2>&1 &
|
||||
@@ -125,6 +130,9 @@ jobs:
|
||||
status=0
|
||||
node ComfyUI-AusBoss/scripts/dev/face_smoke.mjs 9333 || status=1
|
||||
node ComfyUI-AusBoss/scripts/dev/face_smoke.mjs 9333 --vue || status=1
|
||||
node ComfyUI-AusBoss/scripts/dev/face_smoke.mjs 9333 --blocked-reads || status=1
|
||||
node ComfyUI-AusBoss/scripts/dev/h3_sockets_check.mjs 9333 || status=1
|
||||
node ComfyUI-AusBoss/scripts/dev/h3_sockets_check.mjs 9333 --vue || status=1
|
||||
exit "$status"
|
||||
- name: ComfyUI's log
|
||||
if: ${{ always() }}
|
||||
|
||||
@@ -7,6 +7,10 @@ on:
|
||||
description: Full commit SHA from ComfyUI-AusBoss-Model-Downloader main
|
||||
required: true
|
||||
type: string
|
||||
changelog:
|
||||
description: Release note for this version, shown in the Registry's Updates section
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# The existing AusBoss publisher credential stays in this repository. This
|
||||
# manual job publishes only the separately maintained Model Downloader addon.
|
||||
@@ -62,12 +66,16 @@ jobs:
|
||||
id: publish
|
||||
env:
|
||||
REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||
COMFY_NODE_CHANGELOG: 'Initial release: model downloads from Civitai and Hugging Face, installed-file checks, saved model lists, and AusBoss Workflow Note integration.'
|
||||
COMFY_NODE_CHANGELOG: ${{ inputs.changelog }}
|
||||
run: |
|
||||
if [ -z "$REGISTRY_ACCESS_TOKEN" ]; then
|
||||
echo '::error::REGISTRY_ACCESS_TOKEN is not configured.'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${COMFY_NODE_CHANGELOG// /}" ]; then
|
||||
echo '::error::The changelog input is empty; the Registry shows it as the release note.'
|
||||
exit 1
|
||||
fi
|
||||
comfy --skip-prompt --no-enable-telemetry node publish --token "$REGISTRY_ACCESS_TOKEN"
|
||||
- name: Report Registry review status
|
||||
if: always() && steps.publish.outcome != 'skipped'
|
||||
|
||||
+924
-2
@@ -2,7 +2,930 @@
|
||||
|
||||
All notable changes to ComfyUI-AusBoss are documented here.
|
||||
|
||||
## Unreleased
|
||||
## 2.30.0 - 2026-11-28
|
||||
|
||||
- **H3 Prompt Writer 🆎 has a gear menu.** The gear at the top right of the
|
||||
node holds two things. Sockets picks whether the node shows only the
|
||||
sockets in use or all of them. Under it are the four things the model on
|
||||
clip is asked: describe a new person, fill in the next moments, hear the
|
||||
place, and tidy up my lines. Each can be edited, and the edit is saved in
|
||||
the node, so a shared workflow asks the same. Back to built-in undoes it,
|
||||
and Reset puts the sockets and all four back. The editor checks with you
|
||||
before Esc throws away your typing, and before Save keeps a wording that
|
||||
lost a name the node fills in, such as {lines}.
|
||||
- **Mask by Touch 🆎 can use RMBG-3.0 for soft edges.** With Bria's
|
||||
RMBG-3.0 files in place, Fine edges offers RMBG-3.0 next to BiRefNet, and
|
||||
Subject and Background use it too. It keeps loose hair, fur and lace that
|
||||
BiRefNet cuts hard, at about 14 GB of files and about 2 seconds a picture
|
||||
once loaded. Its licence is non-commercial. Fine edges still starts at off,
|
||||
and Subject and Background then use BiRefNet. The ? page says where to get
|
||||
the files.
|
||||
- **H3 Prompt Writer 🆎 shows how it read a swap.** A small "Read as" line
|
||||
under the script says who each new person replaces, as you type. Click it
|
||||
to open the full reading: the Ref2VA tab lists the cast lines the writer
|
||||
sends to H3, and the Plain tab says the same in everyday words. Words a
|
||||
swap can't use, such as "make the camera spin", show in amber as not
|
||||
used, and a line the writer would refuse says why before you run it. The
|
||||
writer also reads more ways of saying it: a description right after the
|
||||
picture ("replaced by @1, a game character with orange hair"), names
|
||||
("Elon is @1"), clothes after "and wears", and one line per person when
|
||||
two people swap. Before, some of those words were dropped or the wrong
|
||||
person was replaced.
|
||||
- **Undo takes back a drag on a node's face as its own step.** Moving a
|
||||
moment on H3 Prompt Writer's timeline, picking a picture's job from its
|
||||
chip, dragging Strength Curve's points, and picking the crop side or the
|
||||
next file on Load Image's strip were never kept as steps of their own.
|
||||
One Ctrl+Z took back the change before them too, and the drag could not
|
||||
be brought back. Each one is its own step now.
|
||||
- **H3 Prompt Writer 🆎 shows the script's problems when the clip sets the
|
||||
length.** With copy its moves, swap the person, new voice or change
|
||||
something, a mistake such as `@5` now shows under the script, as it does
|
||||
for the other jobs. Before, the node said nothing and the run stopped.
|
||||
- **H3 Prompt Writer 🆎 speaks a line whose closing quote is missing.**
|
||||
`He says "Wait for me` is spoken to the end of the line, the way the
|
||||
script box already colours it. Before, the words went in as plain action.
|
||||
- **H3 Prompt Writer 🆎 asks you to change a second start or end picture.**
|
||||
Two pictures set to start on it, or two set to end on it, now say which
|
||||
one to change. Before, the second one was left out of the prompt without
|
||||
a word.
|
||||
- **H3 Prompt Writer 🆎's picture chips stay on one line.** With four
|
||||
pictures and a video plugged in, the video chip dropped onto the Length
|
||||
row, where it was hard to click. The chips now share their row: on a
|
||||
narrow node the longest jobs are cut short first, and pointing at a chip
|
||||
shows its whole job.
|
||||
- **H3 Prompt Writer 🆎 says when a style picture is used like a thing.** A
|
||||
line such as "@1 wears @3" with Picture 3 set to style now shows a note
|
||||
under the timeline: a style is a look, so write "in the style of @3" or
|
||||
give the picture another job. The run still goes ahead.
|
||||
- **H3 Prompt Writer 🆎 gives each person named in words their own line.**
|
||||
With `A barista … says "…"` and `The customer … says "…"`, both lines
|
||||
went to the person in the picture. Each one now says their own line.
|
||||
- **H3 Prompt Writer 🆎 says a shout typed without quotes.** `he yells wait`
|
||||
is spoken now. Before, it was read as something that happens, and nothing
|
||||
was said.
|
||||
- **H3 Prompt Writer 🆎 keeps how a line is said.** `@1 whispers "Stay
|
||||
quiet."`, `shouts`, `sings`, `yells`, `mutters` and `asks` all reached
|
||||
the model as "says". The word you typed is kept now, and so are words
|
||||
between it and the line, as in `says quietly "Hello."`.
|
||||
- **H3 Prompt Writer 🆎 reads "Close-up of her boots" as a framing.** After
|
||||
a blank line, a framing typed without "a" in front ("Close-up of...",
|
||||
"Wide shot of...", "POV from...") was sent to H3 as a cut to a new place,
|
||||
and the person could come back in other clothes. It is now a cut to that
|
||||
framing in the same place, as "a close-up of..." already was.
|
||||
- **H3 Prompt Writer 🆎 ignores chat talk from its small model.** When the
|
||||
model on clip answered "Sure! Here are the next moments:" or "I'm sorry,
|
||||
but I can't help with that", those words became a moment in the clip or
|
||||
its sound. They are left out now, and so are labels such as "Moment 2:"
|
||||
in front of a line.
|
||||
- **H3 Prompt Writer 🆎 keeps what someone does after they speak.** A line
|
||||
such as `@1 says "Hi" and waves.` went to H3 as "and waves." with nobody
|
||||
doing it. The writer now puts the person back and keeps the order: the
|
||||
line is said, then @1 waves. Words about how a line is said, like
|
||||
"slowly" or "to the camera", stay with the speaker too. A sign's words
|
||||
("a sign reading "CLOSED"") end their sentence, and bold or italic marks
|
||||
pasted with a script (`**@1**`) no longer reach the prompt.
|
||||
- **H3 Prompt Writer 🆎 hears a line in single quotes with an apostrophe.**
|
||||
"She says 'I don't know.'" was written as plain text, so nobody spoke it.
|
||||
The words are now a spoken line, as they are in double quotes.
|
||||
- **H3 Prompt Writer 🆎: "none" in Sound turns the sound off.** Typing none,
|
||||
off, silent or no sound in Sound wrote the word "None." as the clip's
|
||||
sound. It now means no sound of the place, and the music you typed stays.
|
||||
The same words in Music mean no music.
|
||||
- **H3 Prompt Writer 🆎: clearer timeline and messages.** A 4 s clip shows a
|
||||
4 s bar. The note under a clip that H3 shortens says how much is left
|
||||
out. `@5` says there are four pictures, and a line that names a missing
|
||||
picture says to connect it or turn it on.
|
||||
- **Long text boxes scroll with the mouse wheel in Nodes 2.0.** In the new
|
||||
node view, turning the wheel over a text box with more lines than fit
|
||||
zoomed the graph and the text stayed put, even while typing in it. The
|
||||
box now scrolls first, and the graph zooms once the text is at its top or
|
||||
bottom, as in the classic view. This covers Text 🆎, Text Lines 🆎,
|
||||
Prompt Variations 🆎, Krea 2 Encode 🆎 and H3 Prompt Writer 🆎.
|
||||
- **Mask Refine 🆎's guided and matting edges follow the picture.** Both
|
||||
edge modes now look further from the mask's edge and snap to the real
|
||||
edge in the guide image, so hair and thin parts a rough mask missed come
|
||||
back. Two new settings under More, Detail range and Fix threshold, tune
|
||||
them. Workflows that use guided or matting will give a cleaner, different
|
||||
edge after updating. The node can also run on its own now, to check a
|
||||
mask before the rest of the graph. Thanks to kajan988.
|
||||
- **LoRA Loader 🆎 leaves out a skipped LoRA's trigger words on a flat
|
||||
curve too.** With Stop on missing LoRA off, a row whose file is missing is
|
||||
skipped and its trigger words stay out of `triggers`. That broke when the
|
||||
row followed a Strength Curve that holds one value the whole run: the LoRA
|
||||
was skipped, but its words still reached the prompt. They stay out now,
|
||||
as they already did with no curve or a curve that moves.
|
||||
- **H3 Prompt Writer 🆎 shows only the sockets you use.** A new node has
|
||||
five inputs and four outputs, where it had nine and fourteen. Connect a
|
||||
picture and the next picture socket appears, and an output appears once
|
||||
its input is connected. The picture chips under the words do the same: a
|
||||
chip shows for each picture or video you plugged in. Saved workflows are
|
||||
unchanged: every wire stays where it was and the node sends the same
|
||||
things. To see every socket and chip all the time, turn on **Settings →
|
||||
🆎 AusBoss → H3 Prompt Writer → Show every socket**.
|
||||
- **H3 Prompt Writer 🆎: the grey hints in Sound and Music read as examples.**
|
||||
They now say `(e.g. rain on a window)` and `(e.g. slow piano)` in
|
||||
italics, so an empty box no longer looks filled in. Every one-line text
|
||||
box in the pack shows its hint in italics.
|
||||
|
||||
## 2.29.0 - 2026-11-27
|
||||
|
||||
- **H3 Prompt Writer 🆎 can tidy up your lines.** Turn on **More → Tidy up
|
||||
my lines** with a small text model such as Qwen3-VL 8B on `clip`, and it
|
||||
fixes spelling, writes short sentences, and puts each spoken line right
|
||||
after whoever says it before the node reads them. Your quoted words are
|
||||
never rewritten: they stay exactly as typed. Off by default.
|
||||
- **Load Audio 🆎: Clean up.** Turn on **Clean up** for a voice recording
|
||||
and it comes out as one channel, with the quiet bits at the start and end
|
||||
cut, less hum and hiss, and an even volume that never clips. A video model
|
||||
that copies the sound it is given copies its noise too, so this helps a
|
||||
phone recording. It is off by default, so saved workflows are unchanged.
|
||||
- **H3 Prompt Writer 🆎 keeps to what you wrote.** It lays your notes out
|
||||
for H3 and adds no sounds or settings you didn't type. Notes are read more
|
||||
carefully too: "muted colours" no longer turns the sound off, "First
|
||||
person view" keeps its first word, a shirt or sign that says something
|
||||
stays written on it, and a "no music" said inside quotes stays part of
|
||||
the line.
|
||||
- **H3 Prompt Writer 🆎 follows your layout more closely.** A `camera:` or
|
||||
`sound:` line belongs to the shot it is typed under, `Shot 2:` on its own
|
||||
line starts the next shot, and two people quoted in one sentence each get
|
||||
their line. Single quotes after "says" count as speech, "in voiceover"
|
||||
after a quote keeps the lips closed, `Cut back to` returns to a place,
|
||||
and `Start on black.` works. A number such as "7 seconds remain" stays
|
||||
part of the action, and two people are no longer placed left and right
|
||||
unless the script says where they stand. With two or more people, a
|
||||
spoken line reaches H3 as you typed it.
|
||||
- **New node: Strength Curve 🆎.** Draw how strong something should be
|
||||
from the start of a run to the end, and wire it into a node that follows
|
||||
it step by step. Drag the points or start from a preset (flat, fade out,
|
||||
fade in, ease out, ease in); Top and Bottom set the strength range.
|
||||
- **LoRA Loader 🆎 rows can follow a strength curve.** A new `curve` input
|
||||
takes a Strength Curve, and each row gets a curve mark: rows you mark run
|
||||
at their strength times the curve at every step, so a style LoRA can fade
|
||||
out before the last steps. It works with every model file, fp8 and int8
|
||||
included.
|
||||
- **Krea 2 Encode 🆎 can change the reference's strength over the run.** A
|
||||
new `reference_curve` input takes a Strength Curve: 1 follows the
|
||||
reference as before, 0 ignores it. It also works with Krea 2 Outpaint
|
||||
Model Patch 🆎.
|
||||
- **New node: Film Grain 🆎.** Adds film grain to a picture or a video.
|
||||
The grain is strongest in the midtones and gentler in deep shadows and
|
||||
highlights, as on film. Size, roughness and colour set its look, it moves
|
||||
from frame to frame on a video (or stays put), an optional mask limits
|
||||
where, and the same seed gives the same grain.
|
||||
- **Film Grain has an Auto switch.** With Auto on, the node picks the grain
|
||||
for the picture: the same look on a small or a big one (the size follows the
|
||||
picture's size), and an amount that matches the grain the picture already
|
||||
has. A clean render starts at the normal 0.25. Amount and Size then count as
|
||||
multipliers ("1 × = Auto's pick"), with the real value in small type beside
|
||||
each box. Auto on and Auto off keep their own numbers, and Auto starts off,
|
||||
so saved workflows behave as before.
|
||||
- **Film Grain can copy another picture's grain.** Wire a picture whose grain
|
||||
you like into `grain_from` and switch Auto on (it reads "match"). The node
|
||||
reads that picture's grain, how strong, how big and how colourful, and adds
|
||||
grain like it; Amount, Size and Color then count from the match ("1 × = the
|
||||
match"), with the real value beside each box. The picture to copy from is
|
||||
scaled to your picture's size first, so the grain matches at the same
|
||||
viewing size, and only its plainest patches are read. Roughness stays yours.
|
||||
- **Film Grain, Keep Detail and Cut Out show a live preview.** After one run,
|
||||
the picture on the node redraws while you drag a value, with a "not run yet"
|
||||
tag until you queue. A Fit | 100% switch left of Preview shows the whole
|
||||
picture or real pixels; at 100% dragging the picture moves around it.
|
||||
- **New node: Cut Out 🆎.** Turns a picture and a mask into a cut-out with a
|
||||
see-through background, ready to save as a PNG. Clean edges takes the old
|
||||
background's colour out of hair and soft edges so there is no halo, and
|
||||
fully kept pixels stay exactly as they were. Grow, feather, haze and
|
||||
solid-core levels, and smoothing over video frames, are on the card.
|
||||
- **New node: Keep Detail 🆎.** Puts the original picture's fine detail
|
||||
back on an edit that came out too smooth. The edit keeps its shapes,
|
||||
light and colour; Light only never shifts a colour. The two pictures must
|
||||
line up.
|
||||
- **Check layout 🆎 shows what makes a workflow hard to read.** Right-click
|
||||
the canvas or use the command palette. It lists overlapping nodes and
|
||||
groups, wires that run backwards or hide behind a node, nodes just under a
|
||||
preview that grows when it runs, nodes outside every group, a saved zoom
|
||||
too small to read and a missing Workflow Note, inside subgraphs too. Click
|
||||
an entry to jump to it. Nothing is moved.
|
||||
- **The example workflows are tidied so Check layout finds nothing.** Only
|
||||
node and group positions and sizes, and reroute spots, changed. What each
|
||||
workflow does is the same.
|
||||
- **Frame Interpolate 🆎 holds cuts between two shots of the same place.**
|
||||
It used to count a cut only when the frame changed more than **Scene
|
||||
cut**, and two shots of one place in the same light can change less
|
||||
than fast movement inside one shot, so it mixed those shots together
|
||||
for a frame or two. A change that jumps out from the frames around it
|
||||
now counts as a cut too. **Scene cut** still works as before, and `0`
|
||||
still turns cut finding off.
|
||||
- **Latent Size 🆎: pick which ratio chips show.** The gear's Ratio chips
|
||||
row opens a list of every ratio with its size. Switch each on or off,
|
||||
remove one, add your own such as 21:9, or reset to the shipped list.
|
||||
5:4 and 21:9 now come in the list, switched off. A chip keeps the name
|
||||
it was given, so 21:9 no longer reads 7:3.
|
||||
- **Edit Lock 🆎 says what is wrong when the VAE and model don't match.**
|
||||
The readout used to blame the VAE alone. It now says either file can be
|
||||
the wrong one, gives the two channel counts it compared, and points to
|
||||
the model and VAE in the workflow's notes. A GGUF or other converted
|
||||
model is a common cause.
|
||||
|
||||
## 2.28.1 - 2026-11-25
|
||||
|
||||
- **Image Resize 🆎 shows Fit only when it is used.** Fit, and Fill under
|
||||
pad, now show only for a Width × height target. The other targets take
|
||||
their shape from the picture and always fit it, so those rows did
|
||||
nothing there.
|
||||
- **Photo Camera 🆎's More fold opens.** Crop margin and 360 width sat in
|
||||
a fold with no header, so nothing could open them. The card now has a
|
||||
More row that shows them.
|
||||
|
||||
## 2.28.0 - 2026-11-24
|
||||
|
||||
- **New node: Photo Camera 🆎.** It works out the camera your photo was
|
||||
taken with, so a 3D model of the person lines up with the photo. Wire in
|
||||
the photo, the person's mask and the photo's lens width (MoGe measures
|
||||
it). It hands Pixal3D the crop's lens, the 3D viewer your photo's own
|
||||
view, and where the photo goes on a 360 canvas so the 360 lines up
|
||||
behind the model.
|
||||
- **The 3D viewer can cut the front or back off a model.** Cut front and
|
||||
Cut back on the 360 strip's Model tab take away part of the model as the
|
||||
camera sees it, such as the inside of a hat that should sit behind the
|
||||
head. Pause for Shot 🆎 gets an optional `mesh` input and output that cut
|
||||
the run's model the same way, so the shot matches the viewer.
|
||||
- **Pause for Shot 🆎 keeps the viewer's 360 settings on runs that don't
|
||||
pause.** With Pause on *run through*, the backdrop now uses the Turn,
|
||||
Tilt, Shadow and the rest saved on the viewer, as a paused run does.
|
||||
Before, such a run used the 360 unturned.
|
||||
|
||||
- **Layout Boxes 🆎 says the boxes as sentences for any prompt.** A new
|
||||
`placement` output writes each box as a plain sentence: what goes there
|
||||
and where, such as `The words "FRESH" in bold black letters, placed top
|
||||
left, from 6% to 52% across and 6% to 25% down.` Add it to the prompt of
|
||||
a model that has no box input, and the things land where you drew them.
|
||||
|
||||
- **Color Match 🆎 can fix an edit that looks pasted on.** A new method,
|
||||
`kept`, takes the picture from before the edit as reference. It learns how
|
||||
the model shifted the parts it was meant to keep (darker, more contrast,
|
||||
more colour) and undoes that, so a new word or object sits in the same
|
||||
tone as the rest. New things keep their own colours.
|
||||
|
||||
- **Save Image 🆎 can write Civitai info.** Pick **Civitai** in the Embed
|
||||
switch (Off | On | Civitai) and a saved picture also carries its prompt,
|
||||
settings and the fingerprints of its model and LoRAs in the form
|
||||
civitai.com reads first.
|
||||
An upload then shows its prompt, lists its resources and gets the ComfyUI
|
||||
tool and txt2img or img2img technique tags, including for
|
||||
Krea 2, Qwen Image 2.1 and prompts inside subgraphs, where Civitai found no
|
||||
prompt and flagged the upload "Unable to Verify AI Generation". It is off
|
||||
by default, because Civitai then shows those settings in place of the
|
||||
ComfyUI workflow; the workflow stays in the file and still drags back into
|
||||
ComfyUI. The first save with a new model takes a moment while its file is
|
||||
fingerprinted.
|
||||
- **WebP pictures from Save Image 🆎 and Save Video 🆎 carry the workflow the
|
||||
way ComfyUI's own WebP does.** ComfyUI could not read the workflow back
|
||||
out of Save Image's WebP files, and civitai.com did not see them as
|
||||
ComfyUI pictures at all. They now use core ComfyUI's layout, so a WebP
|
||||
drags back into ComfyUI with its full graph and Civitai reads its prompt.
|
||||
Save Video's animated `webp` now embeds the workflow too, as core's
|
||||
animated WebP does; its Embed workflow row shows for `webp`.
|
||||
|
||||
- **LoRA Loader 🆎 can fetch Civitai info for every LoRA at once.** A new
|
||||
**Fetch all LoRAs** button in a LoRA's info card (also in the gear menu) looks
|
||||
up each LoRA in the stack that has no Civitai info yet, one at a time
|
||||
with a short pause, and saves its info and picture the same way the
|
||||
one-LoRA button does. The bottom of the node shows how far it is
|
||||
(`Civitai 12 / 44 · Stop`); click it to stop. It follows the Civitai
|
||||
picture setting, never replaces a picture, and slows down or stops when
|
||||
Civitai asks it to.
|
||||
|
||||
- **Image Toolbox can cut a piece of your own size.** Pick the new job
|
||||
**cut a piece**, set the width and height in pixels, pick where it sits
|
||||
(a corner, an edge or the centre) and move it right or down from there.
|
||||
The piece comes out of the first output, and the rest of the picture out
|
||||
of a new second output, `rest`. A piece as tall as the picture, against
|
||||
its left or right edge, leaves the strip beside it, so one node splits a
|
||||
picture into two parts of different sizes. Width or height 0 takes the
|
||||
picture's full width or height.
|
||||
|
||||
## 2.27.0 - 2026-11-23
|
||||
|
||||
- **Video Crop + Rotate + Pad → Clip 🆎 can put a clip window in an App-mode
|
||||
form.** List the node's `clip_window` field and the form shows the video,
|
||||
playing only the part that gets used, over a strip of pictures with a box
|
||||
over that part: drag the box to pick where the clip starts, drag an edge to
|
||||
shorten it. Two new inputs, `min_seconds` and `max_seconds`, keep the clip's
|
||||
length in a range; the edges stop there, on the node's timeline too, and a
|
||||
run keeps to them. A video shorter than the minimum is used whole. Both are
|
||||
0 (no limit) by default and are set in a new **Clip length limits** fold
|
||||
under Crop, pad & resize, closed unless you open it.
|
||||
|
||||
- **New node: Pause for Shot 🆎.** It stops a run right after the 3D
|
||||
viewer so you can frame your shot on the model that run just made, then
|
||||
**Continue** carries on with the camera exactly as the viewer shows it.
|
||||
Nothing before the pause runs again. Wire in a 360 picture and it shows
|
||||
behind the model while you frame, and the node hands on the part of it
|
||||
the camera sees, with an optional floor shadow under the model.
|
||||
- **ComfyUI's 3D viewers get Blender keys, shape chips and a 360 strip.**
|
||||
With the mouse over a viewer, G, R and S move, turn and size the model,
|
||||
as in Blender. Preview 3D (Advanced) and Save 3D (Advanced) get the shape
|
||||
chips from Latent Size above their width and height. Press N for a strip
|
||||
that turns the 360 background and changes the model's light and colours.
|
||||
The axis gizmo moves to the top-right corner, with zoom, pan and grid
|
||||
tools under it.
|
||||
- **The 3D viewer's floor grid is under the model's feet.** It used to run
|
||||
through the middle of many models, such as a person built by TRELLIS 2.
|
||||
Now it sits at the model's lowest point, where the floor shadow goes.
|
||||
The pictures a run takes from the viewer stay exactly as before.
|
||||
|
||||
- **The step preview of a video now moves.** With **Preview steps** on in
|
||||
Save Video, or a Step Preview node in the workflow, a video model such as
|
||||
MiniMax H3 shows a few frames of the clip after each step, about one per
|
||||
second, playing in a loop. You see the motion and the shots take shape,
|
||||
not only the first frame, and can stop a clip that is going wrong. It
|
||||
costs next to nothing: a 5 second H3 clip took 53.8 s with it, 53.6 s
|
||||
with no step pictures at all.
|
||||
|
||||
- **The picture and video picker shows every file, in folders.** The list
|
||||
used to stop at 400 files and ask you to type to narrow it. Now you can
|
||||
scroll through all of them, open folders, and go back up with `..`.
|
||||
Typing still searches every folder. The picker opens in the folder of the
|
||||
file you picked, with that file highlighted. Thanks to TWIISTED-STUDIOS.
|
||||
- **Switch names show in full again.** Workflow Switches cut its names down to
|
||||
a letter or two ("Per…" for "Blur the person"), and other node cards lost
|
||||
their row layout, once a Callout had been on the canvas. The Callout now
|
||||
keeps its styles to its own cards.
|
||||
|
||||
## 2.26.7 - 2026-11-21
|
||||
|
||||
- **An old copy of the pack that keeps loading now says so in the browser.**
|
||||
With an old git clone in `custom_nodes/ComfyUI-AusBoss` and a newer
|
||||
Manager install in `custom_nodes/ausboss-nodes`, the old clone loads,
|
||||
because copies from before 2.24.0 cannot step aside. Every node added
|
||||
since, such as Edit Lock, then shows as missing, and updating does not
|
||||
help. The newer copy now shows a message in ComfyUI that names the old
|
||||
folder to delete. Before, the only sign was a line in the console.
|
||||
- **Workflow Note: a missing AusBoss node asks for an update, not a GitHub
|
||||
clone.** When a workflow needs an AusBoss node your version doesn't have,
|
||||
the note's AusBoss row now shows **Update**. It opens ComfyUI-Manager's
|
||||
updates list and says to restart afterwards. Before, the row showed
|
||||
**Get it**, which opened GitHub, and cloning from there added a second
|
||||
copy of the pack. **Detect from this workflow** now lists the pack as
|
||||
AusBoss nodes with its Comfy Registry link, whatever folder it is in.
|
||||
- **LoRA Loader: set a LoRA's strength with a wire.** Drag a number wire,
|
||||
from a slider or a Float node, onto any row and that row's strength follows
|
||||
it. The row's box turns dashed teal and shows the number coming in; click
|
||||
it to find the source, or right-click the row to unlink. The CLIP strength
|
||||
keeps its ratio to the model strength (#388).
|
||||
- **Node faces show Chinese when ComfyUI's language is Chinese.** The
|
||||
labels, buttons, choices and tooltips the pack draws on its nodes, such as
|
||||
the cards on FlashVSR and Image Resize, H3 Prompt Writer, Workflow Switches
|
||||
and the video and image crop faces, now follow Settings > Language
|
||||
(Chinese, in Simplified characters). Reload the page after changing the language. Nothing
|
||||
saved in a workflow changes, and text with no Chinese yet stays English.
|
||||
H3 Prompt Writer's socket names are translated too.
|
||||
- **H3 Prompt Writer: see and change the full prompt.** A new **Full
|
||||
prompt** tab at the top of the node shows the prompt it wrote on its last
|
||||
run. Edit it there, for example to take out one camera move, and H3 gets
|
||||
your text as it is. An amber dot shows an edit is being sent, and **Reset
|
||||
to written** goes back to the node's own prompt. The **Simple** tab works
|
||||
as before and stays the default.
|
||||
- **Latent Size's ratio chips keep your megapixels.** Clicking a ratio chip
|
||||
now changes the shape at the size you set, instead of jumping back to about
|
||||
one megapixel. The old jump is still in the gear: turn off **Chips keep
|
||||
current budget**. The setting is kept in the browser, so a private window
|
||||
forgot it every time; it now starts on.
|
||||
- **The pack loads on Python 3.10 again.** On a 3.10 install, such as some
|
||||
Stability Matrix setups, the whole pack failed to load with
|
||||
`No module named 'tomllib'`. It now loads there with nothing extra to
|
||||
install (#387).
|
||||
- **Workflow Note finds models in Stability Matrix's shared folders.**
|
||||
A row whose folder uses an old name, `clip` or `unet`, was never checked
|
||||
("This install has no model folder") even with the file in place. Those
|
||||
rows are now checked like `text_encoders` and `diffusion_models`, the
|
||||
names ComfyUI files them under. When the install also reads a kind of
|
||||
model from a folder with a different name, such as Stability Matrix's
|
||||
`Data/Models/Lora`, the card names that folder under the usual one, so
|
||||
you know where your files are found and where a new one can go (#386).
|
||||
|
||||
## 2.26.6 - 2026-11-20
|
||||
|
||||
- **Image Toolbox's help page says what happens with too many pieces.**
|
||||
Asking for more pieces than the picture is wide in pixels gives one piece
|
||||
per pixel column, so fewer pieces than asked for. The page now says so.
|
||||
|
||||
## 2.26.5 - 2026-11-20
|
||||
|
||||
- **New node: Image Toolbox.** Small picture jobs in one node: pick the job
|
||||
from a list. Its first job, split sheet at gaps, cuts a row of pictures
|
||||
such as a character sheet's four views into separate pictures. Each cut
|
||||
goes to the gap between two pictures instead of an equal share of the
|
||||
width, so no piece gets part of its neighbour's sleeve. The pieces come out
|
||||
as one batch of the same size, padded with the sheet's backdrop colour.
|
||||
- **Box edits on big photos start much sooner.** Crop For Inpaint,
|
||||
Image Crop + Rotate + Pad and Stitch Inpaint grew and softened their
|
||||
masks across the whole picture, even when the box was small or there was
|
||||
nothing to do. On a 17 MP photo that took about 5 seconds before the
|
||||
model started. The work now covers only the area around the mask:
|
||||
Crop For Inpaint went from 3.1 s to 0.14 s, and Image Crop + Rotate + Pad
|
||||
with nothing to do from 2.2 s to 0.5 s. The results are the same pixels.
|
||||
|
||||
- **Stitch Inpaint can paste past the box.** Edit models that redraw the
|
||||
whole crop, such as MiniMax H3 Image, often draw a new boot, a plate rim
|
||||
or a collar a little past the box, and the paste cut it off at the box's
|
||||
edge. Turn on the new **Follow changes** switch: the paste then grows to
|
||||
every change that touches the box, and fades out before the edge of the
|
||||
crop. It first undoes the small zoom or shift such a model can draw, so
|
||||
the wall or table around the edit lines up again. When the model redrew
|
||||
nearly everything around the box, the paste stays the box. It is off by
|
||||
default, so saved workflows paste exactly as before.
|
||||
|
||||
- **LoRA Loader's + LoRA list opens with its folders folded.** A big LoRA
|
||||
folder now opens as a short list of top folders. **Open all** and
|
||||
**Fold all** beside the search box open or fold every folder at once,
|
||||
and **Alt**- or **Shift**-click on a folder's arrow does the same for
|
||||
that folder and every folder inside it. **Left** on a highlighted file
|
||||
folds the folder it is in and moves up to it. To keep the old way, where
|
||||
the list opens as you left it, set **Settings → 🆎 AusBoss → LoRA Loader
|
||||
→ Picker folders** to **Remember my folds**.
|
||||
|
||||
## 2.26.4 - 2026-11-18
|
||||
|
||||
- **A video upload stops at 4 GB.** Dropping a video on Load Video had no
|
||||
size limit, so a huge file could fill the input folder. An upload over
|
||||
4 GB is now refused with a message, and the partly saved file is removed.
|
||||
|
||||
- **Image Crop + Rotate + Pad shows your picture in every browser.** Some
|
||||
browsers and privacy add-ons (Firefox's fingerprint protection, Brave
|
||||
Shields, canvas blockers) blank a picture when a page reads its pixels.
|
||||
The node read that as a fully see-through picture and drew an empty stage,
|
||||
although the size line and the run were right. It now checks first and,
|
||||
where reads are blocked, draws the picture as it is; only the teal tint
|
||||
over see-through parts is missing there.
|
||||
|
||||
- **Image Compare A/B always rests on the same picture.** While the
|
||||
pointer is away, a new node shows B, the "after" picture. To show A
|
||||
instead, right-click the node; the choice is saved with the workflow.
|
||||
Earlier versions worked the side out from the links on every run, and a
|
||||
workflow whose "before" came out of a switch showed the before. A
|
||||
workflow saved by an earlier version keeps showing the picture it did.
|
||||
|
||||
- **Layout Boxes 🆎 places people for MiniMax H3 Image.** A new
|
||||
`h3_prompt` output says the boxes in words: who goes where, how big, and
|
||||
who stands beside whom. Describe each person in their box by their
|
||||
picture and what they do, such as "the man from <Picture 2>, sitting on
|
||||
the couch"; the scene on `background` is `<Picture 1>`. Places are said in
|
||||
words only, because H3 Image draws numbers from a prompt onto the picture.
|
||||
|
||||
- **H3 Prompt Writer's Camera says "from the video" when the video sets
|
||||
the camera.** With a clip wired to copy its moves, swap the person, give it
|
||||
a new voice or change something, the first Camera choice now reads "from
|
||||
the video": the camera does what it does in the clip. It is the same
|
||||
choice as "as typed", so saved workflows are unchanged.
|
||||
|
||||
- **A picture whose name starts with a space now shows its preview.** The
|
||||
name was trimmed before the preview was asked for, so Image Crop + Rotate
|
||||
+ Pad and the other nodes that share that code looked for a file that
|
||||
did not exist.
|
||||
|
||||
## 2.26.3 - 2026-11-17
|
||||
|
||||
- **Tone match now works on inpaints.** On a Crop For Inpaint 🆎 crop,
|
||||
Stitch Inpaint 🆎 read the colour shift in the soft edge around the
|
||||
painted area. Workflows such as Krea 2 Inpaint Masked let the model paint
|
||||
a little wider than that edge, so the edge came back close to your picture
|
||||
and the slider hardly did anything: in a test on skin it took off a
|
||||
third of the shift at 1. It is now read just inside the painted area and
|
||||
takes off more than half, on a picture of any size. A workflow that already had Tone match on for
|
||||
an inpaint gives a slightly different picture, closer to the original's
|
||||
colour. When the painted area holds something new, it is matched to your
|
||||
picture right beside it where the two look alike, such as new skin where
|
||||
a shirt was. Something different from what is beside it, such as a
|
||||
swimsuit over skin, is left as painted; before, Tone match could tint the
|
||||
whole patch with the opposite colour. Outpaints, blend in and Tone match 0
|
||||
are unchanged.
|
||||
|
||||
- **Copy a crop node's picture without its handles.** Right-click the picture
|
||||
on Image Crop + Rotate + Pad and choose Copy image. By default it copies
|
||||
the original picture. To include crop, rotation, padding and resize, turn
|
||||
on Copy with crop, rotation and padding in the gear menu. Editing controls
|
||||
and guides are never copied. Open image provides a clean
|
||||
picture to copy with the browser on plain HTTP addresses too.
|
||||
|
||||
- **H3 Prompt Writer: a swap reads the new person's looks however you type
|
||||
them.** `@1 looks like ...` on the same line as the swap sentence, and
|
||||
clothes on a line of their own (`@1 is wearing a black suit.`), were
|
||||
left out of the prompt without a word, and the clip often came back
|
||||
unchanged. Both are now used.
|
||||
|
||||
- **H3 Prompt Writer no longer drops lines.** When one line held two
|
||||
people talking, like `The phone says: "Get a job." @1 looks up and says:
|
||||
"What?"`, only the first words reached the prompt. Each quote is its own
|
||||
moment now. A swap's `@1 looks like` line also keeps only the looks: a
|
||||
sentence after it that names an `@` again, like `The trees behind @1 stay
|
||||
the same.`, is read as its own line instead of going into the description
|
||||
with a raw `@1`. `"Hi," she says` is spoken as "Hi." instead of "Hi,.",
|
||||
and a Chinese or Japanese line keeps its own full stop: "。", not "。.".
|
||||
|
||||
- **H3 Prompt Writer can carry a line across a cut.** End the words with
|
||||
`...` and the person keeps talking into the next shot, without saying the
|
||||
words twice. On the last line, `...` lets the clip end mid-sentence. A line
|
||||
too long for its shot carries on the same way instead of a warning.
|
||||
|
||||
- **H3 Prompt Writer makes 4-second clips.** The shortest length went from
|
||||
5 to 4 seconds.
|
||||
|
||||
- **H3 Prompt Writer can put the person from your video somewhere new.** With
|
||||
Copy its moves and no person picture, the person in the video keeps their
|
||||
own look and moves. Give a picture the job place and type `He dances in @1.`
|
||||
Before, the node asked for a person picture and stopped. Copy its moves
|
||||
also takes its length from the video now, like Swap, Change something and
|
||||
New voice.
|
||||
|
||||
- **H3 Prompt Writer can restyle a video from a picture.** With Change
|
||||
something and a style or place picture, the look comes from the picture
|
||||
instead of the video. Type `It looks like @1.` A clip with nobody in it,
|
||||
like an empty hallway, no longer gets a made-up person in its prompt.
|
||||
|
||||
- **H3 Prompt Writer can make a thing do the moves.** With Copy its moves or
|
||||
Swap the person and no person picture, a thing picture your lines make do
|
||||
the action (a cartoon hand, a toy) takes the moves in its own look. A thing
|
||||
that is held or worn stays a prop.
|
||||
|
||||
- **H3 Prompt Writer's job lists take a click again.** Picking a job from a
|
||||
chip's list closed the list without changing the job.
|
||||
|
||||
- **H3 Prompt Writer's job lists match the node.** The pick list on each
|
||||
picture and on the video opens under its chip in the node's own colours
|
||||
and grows with the zoom. Before, it was the browser's small plain list.
|
||||
|
||||
- **An AI agent can now learn the video workflows from the repository.**
|
||||
`npx skills add ausboss/ComfyUI-AusBoss` gives your agent a skill for the
|
||||
MiniMax H3 Pika Person Swap and Pika Remix workflows: how to write the
|
||||
words, which model files to get, and how to run a workflow in your
|
||||
ComfyUI. The same page is at https://ausboss-examples.vercel.app/skill.md.
|
||||
|
||||
- **The "AusBoss was updated" message no longer asks for a reload by
|
||||
mistake.** After the Manager switched the pack to another version, a
|
||||
page reload before ComfyUI restarted brought up the message, telling you
|
||||
the page was older than the pack when it was newer. A restart was what
|
||||
was needed. Now the message only comes up when the pack really is newer
|
||||
than the page, and versions such as 2.25.10 and 2.25.9 are compared as
|
||||
numbers.
|
||||
|
||||
- **LoRA routes only open files on ComfyUI's LoRA list.** The LoRA
|
||||
Loader's info, hash and preview routes used to hand the name they were
|
||||
given to ComfyUI's file lookup and check the answer afterwards. Now the
|
||||
name is matched against the list first, and a name that is not on it is
|
||||
refused before anything on disk is looked up.
|
||||
- **Image Folder 🆎 checks a folder or picture name as text before the
|
||||
disk.** A drive letter in the middle of a name, or a control character,
|
||||
is refused like `..`, and the joined path is checked before it is
|
||||
resolved as well as after. The list no longer sends each picture's size
|
||||
and time; the thumbnail's cache tag is a short hash instead.
|
||||
- **Error messages no longer pass on server paths.** When a model,
|
||||
decoder or encoder fails, its message can name a file on the server's
|
||||
disk. SAM 3 masks, LoRA loading and video saving now keep the kind of
|
||||
error and drop its words when they name a path, since node errors reach
|
||||
the browser and stay in the history.
|
||||
|
||||
## 2.26.2 - 2026-11-14
|
||||
|
||||
- **Loaders never look up a file name they refused.** Before each run,
|
||||
Load Image 🆎, Load Image + Pad 🆎, Image Crop + Rotate + Pad 🆎 and both
|
||||
Video Crop + Rotate + Pad nodes check whether their file changed. When the
|
||||
name was one they do not accept, such as a whole path or a network share,
|
||||
that check still looked it up on disk. On Windows, looking up a share
|
||||
contacts its server and hands it the computer's login. Now a refused name
|
||||
is only compared as text.
|
||||
- **The pack's scripts are found without looking up the address.** The pack
|
||||
tags its scripts with a version as the browser asks for them. It found
|
||||
each one by joining the address the browser sent to its own folder and
|
||||
looking the result up on disk, and only then checked that the file was
|
||||
its own. Now it looks the address up in a list of its scripts made when
|
||||
ComfyUI starts, so no address reaches the disk.
|
||||
- **Save Image's Save button copies only pictures it holds.** With Auto
|
||||
save off, the list of a run's held pictures was a file in ComfyUI's temp
|
||||
folder. That folder takes uploads, so a planted list could copy another
|
||||
file on the server into the output folder. The list now stays in
|
||||
ComfyUI's memory, and a held picture is found only by its run, its number
|
||||
and one of Save Image's formats. The Save button works for the last 256
|
||||
runs, up to 10,000 pictures each; held pictures still go when ComfyUI
|
||||
restarts, as before.
|
||||
|
||||
## 2.26.1 - 2026-11-14
|
||||
|
||||
- **A path that starts with `~` is no longer expanded.** Image Folder used
|
||||
to turn a pasted `~/...` path into a full one before checking that it sits
|
||||
inside ComfyUI's folders; now only a path written out in full is checked.
|
||||
LaMa Inpaint only opens a model from ComfyUI's `models/lama` list. Nothing
|
||||
outside those folders could be read before either; this removes the code
|
||||
that looked as if it could.
|
||||
|
||||
## 2.26.0 - 2026-11-14
|
||||
|
||||
- **Missing LoRAs show in ComfyUI's missing-models list.** When a workflow
|
||||
needs a LoRA you don't have, ComfyUI's Issues panel now lists it with the
|
||||
other missing models, so **Download all** fetches it too. Before, the
|
||||
list skipped every LoRA in a LoRA Loader 🆎, and Run then stopped on
|
||||
"missing LoRA file". A LoRA that moved to another folder, or a row that is
|
||||
switched off, is not listed.
|
||||
|
||||
- **Link tiles and title tiles snap by the edge you see.** A tile draws a
|
||||
card inside a wider see-through frame, and Snap into line used that frame,
|
||||
so tiles lined up with a gap around them, and a tile you dragged never
|
||||
snapped at all. Now a dragged tile lines up, and other nodes line up with
|
||||
it, by the card's own edges.
|
||||
|
||||
- **Cards work in App mode.** App mode is ComfyUI's simple form view of a
|
||||
workflow: a few labelled fields and a Run button. A field from a node
|
||||
with a card (a picture or video loader, H3 Prompt Writer) used to show
|
||||
as an empty row there. Now it shows a real control: a file list with an
|
||||
upload button, a video list, a text box. Back in the graph, the node
|
||||
looks the same as before.
|
||||
- **The video crop nodes take uploads in App mode.** Video Crop + Rotate +
|
||||
Pad and its Clip version now tell ComfyUI that their video list takes
|
||||
uploads, as the picture nodes do. In App mode the clip field gets the same
|
||||
picker as a picture field: your videos as thumbnails, an Upload button and
|
||||
a folder button. On the node itself nothing changes.
|
||||
|
||||
- **Models you already have are picked for you.** When a workflow asks for
|
||||
a model file you keep in a subfolder (`minimax-h3/model.safetensors`),
|
||||
ComfyUI used to mark its loader red until you clicked **Use it** on the
|
||||
workflow's Guide. Now the Guide switches the loader to your copy as the
|
||||
workflow opens and says so in a short message. That matters most in App
|
||||
mode, which shows no Guide to click. With two copies in different
|
||||
subfolders it still asks. Turn it off in Settings, 🆎 AusBoss, Models.
|
||||
|
||||
- **The video clip's timing is three boxes: Start, Duration, Ends at.** On
|
||||
Video Crop + Rotate + Pad (Clip), the Length on/off switch is gone. Drag
|
||||
the start to move the clip, drag the end or type a Duration to change how
|
||||
long it is, and switch between seconds and frames. Details sit in hover
|
||||
text; a short note shows only when something needs fixing, with a button
|
||||
to fix it. Saved workflows open with the same values and run the same.
|
||||
- **A linked frame rate no longer stops the clip's start too early.** With
|
||||
a rate wired in, a typed start of frame 60 used to settle on frame 7; it
|
||||
now lands where you put it, and the start handle stops only where the
|
||||
Duration no longer fits. A rate set inside a subgraph now counts as
|
||||
known, so the clip shows its length before you run.
|
||||
- **Linked clip lengths say where they come from.** A box set by another
|
||||
node shows a **linked** button that jumps to that node. A cap that the
|
||||
video cannot fill says how many frames you get, and a count only known
|
||||
when the graph runs shows the room left after the start.
|
||||
- **H3 Prompt Writer says how much of the clip H3 uses.** When the video
|
||||
comes from the clip node, it shows how many of the clip's frames H3
|
||||
makes and where in the video that stops, and which Durations use all of
|
||||
it.
|
||||
- **Crop + Rotate + Pad panels fill the node's width.** The rows under the
|
||||
picture used to stop at 460 px and sit in the middle of a wide node.
|
||||
- **Load Video uses the same timing boxes as the clip node.** Start,
|
||||
Duration and Ends at replace the IN and OUT fields and the separate
|
||||
Limit row, with the same seconds | frames switch. Saved workflows open
|
||||
with the same values and run the same.
|
||||
- **Load Video counts the frames the file really has.** The face used to
|
||||
work the count out from the length and could say one frame too many (248
|
||||
for a 247-frame clip); it now reads it from the file.
|
||||
- **Load Audio has Start, Duration and Ends at boxes.** They replace the IN
|
||||
and OUT times and the separate Max length row, so the red "cut" stripe is
|
||||
gone: the Duration is the length you get.
|
||||
- **A number wired through a Reroute or a subgraph now shows on the face.**
|
||||
The clip node, Load Video, Load Audio and Layout Boxes read a linked
|
||||
number the same way, so it no longer drops out behind a Reroute, a
|
||||
subgraph or an older Primitive node.
|
||||
|
||||
## 2.25.3 - 2026-11-13
|
||||
|
||||
- **The video clip's frame readout explains itself.** On Video Crop + Rotate
|
||||
+ Pad (Clip), the small `fr 52 · 0:02.17` beside Play now says in plain
|
||||
words, when you point at it, which frame the picture shows and how many
|
||||
seconds into the video it is. The help page explains it too.
|
||||
|
||||
## 2.25.2 - 2026-11-13
|
||||
|
||||
- **The video clip's IN handle always drags.** On Video Crop + Rotate + Pad
|
||||
(Clip), a Length as long as the clip or longer used to lock IN, and the
|
||||
only way to trim the start was to turn Length off. Now IN drags anyway:
|
||||
the Length then only caps the clip, and the clip's own end is OUT. A
|
||||
Length shorter than the clip works as before.
|
||||
|
||||
## 2.25.1 - 2026-11-13
|
||||
|
||||
- **Edit Lock Restore 🆎 takes out the pink tint.** MiniMax H3 Image gives
|
||||
every edit a faint pink, slightly lighter tint over the whole picture.
|
||||
Edit Lock already removed it wherever it locked, but when it stepped
|
||||
aside (a new hair color, a new background, rain) the tint stayed. A new
|
||||
**Remove tint** switch, on by default, reads the tint from the part of
|
||||
the picture the edit left alone and takes it out of the whole picture.
|
||||
Edits meant to recolor everything, such as golden hour or red light, are
|
||||
left as they are. Turn it off to get the old behavior.
|
||||
|
||||
## 2.25.0 - 2026-11-12
|
||||
|
||||
- **New node: Load Image.** Loads a picture and sets its size in the same
|
||||
node, so a workflow needs no resize node after its loader. Size can be a
|
||||
megapixel count, a longest side, a scale, a box the picture fits inside, or
|
||||
a box it fills by cropping, rounded to a multiple you choose. It can also
|
||||
cut a piece or a shape such as 16:9 out of the picture without resizing,
|
||||
and you pick which part is kept: the center, a side or a corner. Arrows
|
||||
step through the pictures in the input folder. Two small pictures on the
|
||||
node show what goes in and what comes out, with both sizes and what is
|
||||
cut off, before you run. It also gives the file's name and its original
|
||||
size. With Size off the picture comes out exactly as the file has it.
|
||||
|
||||
- **Clear VRAM from the right-click menu.** Right-click the empty canvas
|
||||
and pick **Clear VRAM 🆎** to unload every model and free memory on the
|
||||
ComfyUI server, the same as ComfyUI's own "Unload Models and Execution
|
||||
Cache". A short message says when it is done. Turn the entry off in
|
||||
Settings, 🆎 AusBoss, Memory.
|
||||
|
||||
- **Callout 🆎: Info card.** Right-click a Callout and pick **Info card**
|
||||
for a small card with a title, a list of labels and values, and small
|
||||
print, such as a table of run times. Write a row as `label | value`; a
|
||||
row in **bold** is drawn in teal so the one to pick stands out. The first
|
||||
line is the title, and a ⏱️ ℹ️ ⚠️ 💡 or ✅ at its start becomes a small
|
||||
icon. An older pack shows the card as a plain note with its rows written
|
||||
out.
|
||||
|
||||
- **Save Image shows big pictures at once.** The node now shows a small
|
||||
copy of each picture, a few hundred kilobytes, where it used to load the
|
||||
whole file. A 30 MB sheet on a ComfyUI opened from another computer took
|
||||
half a minute to show, or never did; it now shows as the run ends. The
|
||||
saved file is the same full-size file as before.
|
||||
|
||||
- **Save Image: the Save button is hard to miss.** With **Auto save** off,
|
||||
a row over the picture now says **Not saved yet** and holds a solid
|
||||
**Save picture** button. Before, it was a small SAVE label in the corner.
|
||||
With several pictures the button reads **Save all 4**, or **Save this
|
||||
one** when the arrows are on one picture. After a save the row says the
|
||||
name the picture was saved under.
|
||||
|
||||
- **A picture that loads slowly no longer leaves the old one up.** When a
|
||||
result took more than about 16 seconds to reach the browser, the node
|
||||
kept the picture from the run before. Now the new picture always shows,
|
||||
and the old one dims while the new one loads. This fixes Select Frame,
|
||||
Mask Refine, Mask by Name and LaMa Inpaint as well as Save Image.
|
||||
|
||||
## 2.24.0 - 2026-11-12
|
||||
|
||||
- **New node: Edit Lock.** Keeps every part of your picture that an edit
|
||||
did not change exactly where it was, with the colors it had. Edit models
|
||||
redraw the whole picture, so untouched parts often come back a little
|
||||
zoomed, shifted or tinted. Put Edit Lock between the model and the
|
||||
sampler and give it the picture you are editing. It needs no mask. It
|
||||
steps aside when the edit changes the whole picture, and lets rain,
|
||||
snow and haze through while holding the picture in place. Tested on
|
||||
MiniMax-H3-Image.
|
||||
|
||||
- **New node: Edit Lock Restore.** Puts your picture's own pixels back in
|
||||
every part the edit did not change. Add it after the VAE Decode with
|
||||
Edit Lock's `edit_lock` output. It also gives a mask of what the edit
|
||||
changed and a one-line report.
|
||||
|
||||
- **New node: Text Lines.** It runs what comes after once for each line of
|
||||
your text. Type five prompts, one on each line, and one run makes five
|
||||
pictures. It also takes a list a text model wrote: empty lines are
|
||||
skipped, a leading number or bullet comes off, and **Limit** stops a list
|
||||
that ran long.
|
||||
|
||||
- **Save Image shows every picture of a run at once.** When a run saves
|
||||
several pictures, they now show side by side in the node, the way the
|
||||
core Save Image does. The arrows still go to each picture by itself, and
|
||||
round again to all of them. Select Frame, Mask Refine, Mask by Name and
|
||||
LaMa Inpaint show a batch the same way.
|
||||
|
||||
- **Save Image can wait for a click before it saves.** Switch **Auto save**
|
||||
off and a run only shows its pictures on the node. **SAVE ALL** over them
|
||||
keeps every one; step to one picture with the arrows and **SAVE** keeps
|
||||
just that one. Good for making a batch and keeping the best. Auto save is
|
||||
on unless you switch it off, so nothing changes for workflows you have.
|
||||
|
||||
- **New node: Prompt Variations.** A prompt box that picks one choice from
|
||||
each set in curly brackets, such as `a {red|blue|green} {sweater|jacket}`,
|
||||
on every run. The seed decides the picks, so the same seed gives the same
|
||||
prompt again. Queue 50 runs with a random seed and get 50 different
|
||||
prompts, with no wildcard pack.
|
||||
|
||||
- **Mask by Touch: type a name to take it out of the mask.** The name field
|
||||
under the picture now has a sign in front. Click it to switch between **+**
|
||||
(add by name) and **−** (take away by name), then type "face" or "hair" and
|
||||
press Enter. Typing "-face" takes it away whatever the sign says. Before,
|
||||
a typed name was only taken away while Erase was chosen, which nothing on
|
||||
the node said.
|
||||
|
||||
- **Mask by Touch: Ctrl-click only takes away what you point at.** With a
|
||||
sweater picked, a Ctrl-click on the face offered the whole person, and the
|
||||
sweater went with it. Now a spot where nothing is picked says so and
|
||||
changes nothing.
|
||||
|
||||
- **Mask by Touch works on big pictures.** A look at a 3840 pixel picture took
|
||||
twice as long as at 2048, and at 8192 pixels it ran a 32 GB graphics card
|
||||
out of memory. The node now asks SAM 3 about a copy of at most 2048 pixels
|
||||
and brings the answer back to full size. Pictures up to 2048 pixels come
|
||||
out exactly as before. On bigger ones a mask's edge can sit a pixel or two
|
||||
differently.
|
||||
|
||||
- **Mask by Touch no longer fills the queue.** With Image Crop + Rotate + Pad
|
||||
or Load Image + Pad wired in, every change to the loader (each step of its
|
||||
megapixels, for one) queued one more look at a picture that was already
|
||||
replaced. Now only the newest look waits. The button that pauses the
|
||||
looking also says **Pause** and **Look on**.
|
||||
|
||||
- **New node: FlashVSR Upscale 🆎.** Makes a video larger and sharper with
|
||||
the FlashVSR v1.1 model, from 1x to 4x. It needs one model file and no
|
||||
other pack: the help page has the download link. A long clip needs no more
|
||||
graphics memory than a short one, and a result too large for the free
|
||||
memory is made in tiles.
|
||||
The new example `FlashVSR Video Upscale (AusBoss)` shows it between Load
|
||||
Video and Save Video.
|
||||
|
||||
- **Two errors from outside a workflow now say what to do.** When a MiniMax H3
|
||||
run stops with `KeyError: 'latent'` because the Muse MiniMax Director pack is
|
||||
installed, a message names that pack and says to turn it off. When an older
|
||||
ComfyUI cannot read a `w6a8` model file, a message says to update ComfyUI.
|
||||
ComfyUI's own error report stays as it is.
|
||||
|
||||
- **ComfyUI starts when the pack is installed twice.** A Manager install
|
||||
(`custom_nodes/ausboss-nodes`) beside a git clone
|
||||
(`custom_nodes/ComfyUI-AusBoss`) stopped ComfyUI while it started. Now one
|
||||
copy loads and the other steps aside, and the console says which folder to
|
||||
delete. A copy from 2.23.0 or older is the one that loads when it sits
|
||||
beside a newer one, so delete the older folder.
|
||||
|
||||
- **A Workflow Note popup closes when you click outside it.** Opening an
|
||||
info tile (a Tips note, say) showed the full note, and only its Close
|
||||
button or Escape put it away. A click on the dark area around it now
|
||||
closes it too. Selecting text in the note, or a drag that starts on it,
|
||||
keeps it open, and the Edit form still asks before it drops a change.
|
||||
|
||||
## 2.23.0 - 2026-11-09
|
||||
|
||||
- **Mask by Touch keeps your picks when the picture changes.** Your clicks
|
||||
and paint move onto the new picture, in the same places, so an edit before
|
||||
the node no longer means picking everything again. On a picture of another
|
||||
size they are scaled to fit. A click finds whatever is at that spot now;
|
||||
paint stays exactly as painted. For the old way, set **New picture**, under
|
||||
More, to **start over**.
|
||||
|
||||
- **Workflow Switches: a switch that changes a setting no longer turns its
|
||||
node off.** The node it sets keeps running. LoRA choices keep every field
|
||||
that differs between them, and the add-choice button shows as soon as a
|
||||
node is selected.
|
||||
|
||||
- **Mask by Touch clears a stopped run's message once a run works.** When
|
||||
a run stopped at the node, its message stayed on the picture after the
|
||||
next run from the Run button had worked. It now goes as soon as the new
|
||||
result comes in.
|
||||
|
||||
- **Video Crop + Rotate + Pad → Clip: the fixed_frames input sits on its own
|
||||
row again.** In workflows saved by an earlier release, newer ComfyUI drew
|
||||
fixed_frames on top of force_rate, so a link could not be dropped on it.
|
||||
Every input the pack moves into the input column now gets its own row.
|
||||
|
||||
- **Node colours stay after a save and reload.** A colour picked from the
|
||||
right-click menu now survives saving, reloading and pasting. In Nodes 2.0,
|
||||
About this node is in the right-click menu, and dragging a node's corner
|
||||
snaps to nearby lines (hold Shift to skip the snap).
|
||||
|
||||
- **Image Folder shows the right pictures when you change folders.**
|
||||
Switching folders or reloading a workflow no longer shows old or mixed-up
|
||||
results, a very large folder keeps its newest files, and thumbnails refresh
|
||||
when a picture is saved over.
|
||||
|
||||
- **Crop for Inpaint keeps the whole soft edge inside the crop.** The blend
|
||||
at the seam is now complete. Crops and blend masks can come out slightly
|
||||
different from earlier releases for the same inputs.
|
||||
|
||||
- **Compare, the preview bar and Save Image no longer show a stale picture.**
|
||||
A late reply is ignored once the picture has changed, and Save Image
|
||||
forgets its old saved file when the folder changes. Save Image also takes
|
||||
bfloat16 and one-channel images, and a blank linked caption writes no
|
||||
caption file.
|
||||
|
||||
- **Color Match leaves a picture alone when matched to itself.** When the
|
||||
reference is the same picture, or the same colours at another size, the
|
||||
picture now comes back unchanged instead of shifting colour. Other matches
|
||||
can differ from earlier releases by less than one shade step.
|
||||
|
||||
- **Krea 2 Outpaint Model Patch no longer reuses an old reference.** On a
|
||||
fresh server's first run, its reference cache could hand back a stale
|
||||
reference, so the new area came out different from a run without the
|
||||
cache. Now both match exactly. Other model patches on the same model also
|
||||
apply alongside it.
|
||||
|
||||
- **Three example workflow notes now match their graphs.** Krea 2 Rotate +
|
||||
Outpaint says its tone match is on, Qwen Image 2.1 Inpaint says its seed is
|
||||
fixed, and Qwen Image 2.1 Upscale + Restore says the redraw is at least
|
||||
about 2 MP.
|
||||
|
||||
- **The pack's own checks are stricter.** They read pyproject.toml properly
|
||||
and catch more ways a node could be hidden from the Registry's scanners.
|
||||
Nothing changes in your workflows.
|
||||
|
||||
## 2.22.0 - 2026-11-07
|
||||
|
||||
- **Node cards have a calmer, easier-to-read look.** Number boxes, choices,
|
||||
switches, fields and buttons are now one solid gray with no outlines, on a
|
||||
dark card. Labels, units and section names are lighter and easier to read,
|
||||
and every control in a card row is the same height. The bar above a result
|
||||
picture (the picture arrows, the Preview steps and Preview switches, and
|
||||
buttons such as AUTO) and the picture's frame match the cards. The colors
|
||||
live in one shared file, so the rest of the pack can follow.
|
||||
|
||||
- **Mask by Touch 🆎 no longer fills holes unless you ask.** Fill small
|
||||
holes, under More, now starts off, so a hole you pick stays a hole. Saved
|
||||
@@ -19,7 +942,6 @@ All notable changes to ComfyUI-AusBoss are documented here.
|
||||
the old one, the new picture now shows on the node, ready to pick from. A
|
||||
new reload button beside Undo shows it any time, without running the
|
||||
workflow.
|
||||
|
||||
- **Save Image and Save Video: the Steps switch is now called Preview steps.** It
|
||||
shows the picture or the clip's first frame while it is being made, and "Steps"
|
||||
read like a sampler's step count. It works the same, and saved workflows keep
|
||||
|
||||
+20
-5
@@ -150,6 +150,13 @@ example_workflows/ # example workflows (regular workflow JSON, not API JSON)
|
||||
- Category: `🆎 AusBoss/<Group>`. The emoji is safe here — categories reach
|
||||
the frontend as JSON and are never printed to the console at import time.
|
||||
- Every node gets `DESCRIPTION`, input `tooltip`s, and `OUTPUT_TOOLTIPS`.
|
||||
- Words a node face draws itself (card labels, buttons, choices, tooltips)
|
||||
are translated for a Chinese ComfyUI by `js/i18n/index.js`: add the English
|
||||
text and its Chinese to `js/shared/i18n_zh.mjs`, or to `STAYS_ENGLISH` there
|
||||
when it should not change. Text with no entry stays English, and a widget's
|
||||
name and value are never translated. Never read a label back from the DOM
|
||||
to decide something; keep that in state (the translator changes the text).
|
||||
`tests/i18n.test.mjs` fails on a card word with no entry.
|
||||
- IMAGE tensors are BHWC float batches; MASK is BHW. Return tuples always,
|
||||
even for one output: `(value,)`.
|
||||
- Console output at import time must stay ASCII — ComfyUI on Windows often
|
||||
@@ -193,7 +200,7 @@ example_workflows/ # example workflows (regular workflow JSON, not API JSON)
|
||||
drag). Messages to the user go through `showToast`, never `alert()`.
|
||||
- The mouse wheel over a node zooms the graph, on every part of its face.
|
||||
`js/canvas_passthrough/` hands the wheel on from the pack's panels, and
|
||||
keeps it only for a box that can still scroll or a field being typed in,
|
||||
keeps it only for a box that can still scroll, typed in or not,
|
||||
so a panel adds no wheel listener of its own
|
||||
(`tests/canvas_passthrough.test.mjs` lists the few that exist). After a
|
||||
change to a node face, `scripts/dev/wheel_sweep.mjs` turns the wheel at
|
||||
@@ -210,8 +217,7 @@ example_workflows/ # example workflows (regular workflow JSON, not API JSON)
|
||||
never a classic canvas number widget on a finished node face. Units
|
||||
(`px`, `MP`, `×`) ride inside the box in a fixed-width slot that every
|
||||
single-field row reserves, so the numbers down a card share one centre
|
||||
line. Known, deliberate exceptions: the Seed card's seed (typed) and Load
|
||||
Video's trim timecodes (typed).
|
||||
line. Known, deliberate exception: the Seed card's seed (typed).
|
||||
- **Node faces are widget cards.** A node whose face would be classic
|
||||
LiteGraph widgets (full-width rows with an arrow at each end) gets an
|
||||
entry in `js/widget_cards/index.js` instead: `mountWidgetCard` from
|
||||
@@ -234,6 +240,13 @@ example_workflows/ # example workflows (regular workflow JSON, not API JSON)
|
||||
widget per row. A value that is meant to be wired rather than typed is a
|
||||
backend `forceInput: True` socket (Math Expression `a`/`b`/`c`), and a
|
||||
multi-type string such as `"FLOAT,INT"` accepts either kind of link.
|
||||
- **App mode** is ComfyUI's form view of a workflow (fields and a Run
|
||||
button). A file list from the input folder declares its upload flag
|
||||
(`image_upload`, `video_upload`, `audio_upload`): the form builds the
|
||||
field's Upload button from it, and without it the field is a bare list.
|
||||
`tests/test_video_upload_flag.py` holds the video lists to it. A card's
|
||||
hidden widgets reach the form through `js/app_mode/`, so a card needs
|
||||
nothing of its own for App mode.
|
||||
- Preview-carrying nodes (Select Frame, Mask Refine, Mask by Name, LaMa
|
||||
Inpaint, Save Image) share
|
||||
`js/input_preview/`: a thin bar (node tools left, a small `preview`
|
||||
@@ -324,7 +337,7 @@ run by hand against any ComfyUI:
|
||||
```bash
|
||||
AUSBOSS_COMFY_ROOT=<ComfyUI> python tests/test_comfy_core_contract.py
|
||||
python scripts/compat_boot.py --url http://127.0.0.1:8188
|
||||
node scripts/dev/face_smoke.mjs <chrome port> # and again with --vue
|
||||
node scripts/dev/face_smoke.mjs <chrome port> # and again with --vue, and --blocked-reads
|
||||
```
|
||||
|
||||
- `test_comfy_core_contract.py` reads the pack's own source for everything
|
||||
@@ -335,7 +348,9 @@ node scripts/dev/face_smoke.mjs <chrome port> # and again with --vue
|
||||
- `compat_boot.py` asks a running ComfyUI which nodes it offers: every public
|
||||
node of the pack, and every node and required input the examples use.
|
||||
- `face_smoke.mjs` puts every node on a graph and fails when a face does not
|
||||
come up or something throws.
|
||||
come up or something throws. With `--blocked-reads` it acts like a privacy
|
||||
browser that blanks pixel reads, and fails when a node that loads a
|
||||
picture then draws none.
|
||||
|
||||
A failure on the release opens an issue labelled `comfyui-update`. What these
|
||||
cannot see is anything that needs a model: run the real thing on a GPU
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<a href="https://github.com/ausboss/ComfyUI-AusBoss/releases/latest"><img src="assets/readme/release.svg" alt="Latest release"></a>
|
||||
<a href="https://www.youtube.com/@ausbossdev"><img src="https://img.shields.io/badge/YouTube-%40ausbossdev-00b4aa?style=flat-square&logo=youtube&logoColor=white" alt="YouTube @ausbossdev"></a>
|
||||
<a href="https://discord.gg/RwVxY9Fuaj"><img src="https://img.shields.io/badge/Discord-AusBoss-00b4aa?style=flat-square&logo=discord&logoColor=white" alt="Discord: AusBoss"></a>
|
||||
<a href="https://huggingface.co/ausboss"><img src="https://img.shields.io/badge/Hugging%20Face-ausboss-00b4aa?style=flat-square&logo=huggingface&logoColor=white" alt="Hugging Face: ausboss"></a>
|
||||
<a href="https://x.com/Zanzibased"><img src="https://img.shields.io/badge/X-%40Zanzibased-00b4aa?style=flat-square&logo=x&logoColor=white" alt="X @Zanzibased"></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -18,6 +20,7 @@ Most of them are for image and video work. ComfyUI's core nodes already cover th
|
||||
- **[Mask by Touch](#mask-by-touch):** click a thing on the picture and get its mask. Hover shows what a click would take, and **Fine edges** follows hair and fur.
|
||||
- **[Mask by Name](#mask-by-name):** type "the red jacket" and get its mask and a cut-out.
|
||||
- **[Image Crop + Rotate + Pad](#image-crop--rotate--pad):** turn, crop and pad a picture by dragging handles on the node, for outpainting.
|
||||
- **[Edit Lock](#edit-lock):** an edit changes what you asked for, and the rest of the picture stays exactly where it was. No mask needed.
|
||||
- **[Stitch Inpaint](#stitch-inpaint):** after an inpaint or outpaint, everything you didn't ask to change is your original pixels again.
|
||||
- **[Video Crop + Rotate + Pad → Clip](#video-crop--rotate--pad--clip):** trim a clip on a timeline, and pad or crop it to a new shape.
|
||||
- **[Tiled Upscale](#tiled-upscale):** upscale a picture in tiles to the megapixels you set.
|
||||
@@ -27,7 +30,7 @@ Most of them are for image and video work. ComfyUI's core nodes already cover th
|
||||
- **[LoRA Loader](#lora-loader):** a whole LoRA stack in one node, each row with its own switch and strength.
|
||||
- **[Workflow Switches](#workflow-switches):** turn parts of a workflow off and on from one small card.
|
||||
|
||||
The **?** in a node's title bar opens a short card with its inputs and outputs, and every node has a longer help page in ComfyUI's node help panel. I post the workflows I make with them on [Civitai](https://civitai.com/user/AusBoss) and [X @Zanzibased](https://x.com/Zanzibased), and videos of them on [YouTube @ausbossdev](https://www.youtube.com/@ausbossdev). Can't open Civitai? All my workflows are on [my Discord](https://discord.gg/RwVxY9Fuaj) too. If a node saves you time, a star on the repo helps other people find it.
|
||||
The **?** in a classic node's title bar opens a short card with its inputs and outputs. In Nodes 2.0, right-click the node and choose **About this node**. Every node also has a longer help page in ComfyUI's node help panel. I post the workflows I make with them on [Civitai](https://civitai.com/user/AusBoss) and [X @Zanzibased](https://x.com/Zanzibased), and videos of them on [YouTube @ausbossdev](https://www.youtube.com/@ausbossdev). Can't open Civitai? All my workflows are on [my Discord](https://discord.gg/RwVxY9Fuaj) too. If a node saves you time, a star on the repo helps other people find it.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -35,15 +38,27 @@ In **ComfyUI-Manager**, open the Custom Nodes Manager, search for **AusBoss** an
|
||||
|
||||
```bash
|
||||
cd ComfyUI/custom_nodes
|
||||
git clone https://github.com/ausboss/ComfyUI-AusBoss.git
|
||||
git clone https://github.com/ausboss/ComfyUI-AusBoss.git ausboss-nodes
|
||||
```
|
||||
|
||||
Restart ComfyUI and search the node library for **AusBoss**.
|
||||
|
||||
Clone into `ausboss-nodes`, the folder ComfyUI-Manager uses, so Manager sees the same copy and updates it instead of adding a second one. If you also have a `custom_nodes/ComfyUI-AusBoss` folder from an older clone, delete it: with two copies, an old one can keep loading after every update, and its newer nodes show as missing. ComfyUI shows a message naming the folder when this happens.
|
||||
|
||||
After an update, through Manager or `git pull`, restart ComfyUI and hard-refresh the browser with **Ctrl+Shift+R**. Otherwise the browser keeps the old JavaScript, and the pack warns you about it. Manager can install a version or two behind while the Comfy Registry reviews a new release. To get the newest one, pick it in Manager's version list, or update by hand: delete the pack's folder in `ComfyUI/custom_nodes` and clone the repository as shown above.
|
||||
|
||||
The pack uses the Pillow, NumPy, Torch and PyAV that come with ComfyUI. Each example lists the models it needs on its Workflow Note. LaMa Inpaint also needs [`big-lama.pt`](https://github.com/Sanster/models/releases/download/add_big_lama/big-lama.pt) in `ComfyUI/models/lama/`. The pack never downloads weights by itself.
|
||||
|
||||
### Using an AI agent
|
||||
|
||||
Your agent (Claude Code, Codex, Cursor or another one) can learn the video workflows: how to write the words for them, set them up, and run them on your computer.
|
||||
|
||||
```bash
|
||||
npx skills add ausboss/ComfyUI-AusBoss
|
||||
```
|
||||
|
||||
Or tell it: "Read https://ausboss-examples.vercel.app/skill.md and help me use these workflows." The skill is [skills/ausboss-workflows/SKILL.md](skills/ausboss-workflows/SKILL.md). For picking and wiring single nodes, point it at the [agent guide](js/docs/agents/README.md).
|
||||
|
||||
### Upgrading from 1.x
|
||||
|
||||
2.0 removed **LM Studio Chat** (use **Text** for a fixed prompt) and Align Image's `offset_x` and `offset_y` outputs. Math Expression's `a`, `b` and `c` are sockets now instead of typed boxes, so put constants in the expression itself. 1.2 removed **Drop Shadow**, **Pad Image** (use **Load Image + Pad**) and **Frame Chooser**. Save Image writes only inside ComfyUI's output folder. The [changelog](CHANGELOG.md) has the details.
|
||||
@@ -75,6 +90,12 @@ It returns the `image`, a `mask` of everything the model paints (padding, see-th
|
||||
|
||||
Krea 2 Rotate + Outpaint turns a photo, pads it and paints the new area in one pass. [Try the Krea 2 Rotate + Outpaint example →](example_workflows/Krea%202%20Rotate%20%2B%20Outpaint%20%28AusBoss%29.json)
|
||||
|
||||
### Load Image
|
||||
|
||||
Loads a picture and sets its size in one node. Pick a file, upload one, or step through the input folder with the arrows. **Size** can stay off, or bring the picture to a megapixel count, a longest side, a scale, a box it must fit inside, or a box it fills by cropping. It can also cut a piece or a shape such as 16:9 out of the picture without resizing, and **Keep** picks which part stays: the center, a side or a corner. **Round to** keeps the result on a multiple of 8, 16 or whatever the model wants. The node shows the picture going in and coming out, with both sizes, before you run, such as `912 × 1632 → 1144 × 2048`.
|
||||
|
||||
It returns the `image`, a `mask` of its see-through parts, the new `width` and `height`, the `filename` for a save prefix, and the file's `original_width` and `original_height`.
|
||||
|
||||
### Load Image + Pad
|
||||
|
||||
Makes a canvas for outpainting: drag the edges out to add room around a picture. The Source list shows the picture under the pointer. The new area can be a solid color, the average color of the nearest edge, the edge pixels smeared outward, a blurred copy of the picture, or a mirror of it. The card also has a seam feather, a canvas multiple and a megapixel budget, and **Exact padding** opens one control per side. A budget of 0 keeps the picture's size, and anything higher resizes the picture before padding. A picture wired into `source_image` is padded instead of the chosen file.
|
||||
@@ -115,10 +136,26 @@ Rounds a picture's size to a multiple you choose, by resizing, cropping or paddi
|
||||
|
||||
Reads a picture's `width`, `height`, `longest_edge`, `shortest_edge` and batch `count` as whole numbers. Wire them into a resize, a latent, a frame count or Math Expression, so the rest of the graph follows the source's size. After a run the node shows each number beside its output.
|
||||
|
||||
### Image Toolbox
|
||||
|
||||
Small picture jobs in one node, picked from a list. **split sheet at gaps** cuts a row of pictures, such as a character sheet's views, into separate pictures, cutting at the gaps between them so no piece gets part of its neighbour. **cut a piece** cuts out one piece of the width and height you set, at the place you pick, and gives back the rest of the picture too.
|
||||
|
||||
### Color Match
|
||||
|
||||
Matches a picture's colors to a reference, with LAB, RGB, MKL or histogram transfer. Strength sets how much, and an optional mask (with invert) limits where. With `reference_mode` set to first frame, every frame of a batch matches the batch's first frame. That can cut down color drift in a clip, but it does not steady motion.
|
||||
|
||||
### Film Grain
|
||||
|
||||
Adds film grain to a picture or a video. The grain is strongest in the midtones and gentler in deep shadows and bright highlights, as on film. **Size** is the grain's size in pixels, **Roughness** mixes in finer grain that bunches up unevenly, and **Color** goes from black-and-white grain to colour film's. On a video the grain moves from frame to frame, or stays put with **Video grain** on *still*. An optional mask adds grain only where it is white, and the same seed always gives the same grain. **Auto** picks the grain for the picture's size, or copies the grain of a picture wired into `grain_from`. The preview shows the result.
|
||||
|
||||
### Cut Out
|
||||
|
||||
Turns a picture and a mask into a cut-out with a see-through background, ready to save as a PNG (Save Image keeps the transparency) or lay on a new background. Keep the white or the black part of the mask, grow or shrink it and soften its edge. **Clean edges** takes the old background's colour out of hair and soft edges, so the cut-out has no halo; fully kept pixels stay exactly as they were. It also returns the final mask, and works on video. The preview shows the cut-out on a checkerboard.
|
||||
|
||||
### Keep Detail
|
||||
|
||||
Puts the original picture's fine detail (skin, fabric, grain) back on an edited version that came out too smooth. Wire the edit and the original, which must line up (Realign to Source fixes an edit that drifted). The edit keeps its shapes, light and colour, and only detail smaller than **Detail size** comes from the original. **Light only** never shifts the edit's colours; **color + light** brings the detail's colour too. An optional mask limits where.
|
||||
|
||||
### Realign to Source (EXPERIMENTAL 🧪)
|
||||
|
||||
Lines an edited picture back up with the original. Qwen Image 2.1 often draws an edit, especially a style change, a little bigger or shifted: up to about 12% taller, by a different amount every seed. Wire in the edit and the picture it was made from. The node measures how far the edit moved and moves it back, at the original's size. It fixes the zoom and shift of the whole picture, not shapes the edit redrew in a new place, so the result lines up closely rather than pixel for pixel.
|
||||
@@ -135,6 +172,18 @@ The same watercolor edit without and with Realign to Source: 61 px off before, 0
|
||||
|
||||
Qwen drew this watercolor 5.6% taller, and Realign to Source lined it back up with the original.
|
||||
|
||||
### Edit Lock
|
||||
|
||||
Keeps every part of your picture that an edit did not change exactly where it was, with the colors it had. An edit model redraws the whole picture, so the parts you did not ask about often come back a little zoomed in, shifted or tinted, and the picture jumps when you flip between before and after. Put Edit Lock between the model and the sampler and give it the picture you are editing. It needs no mask: it sees what the edit changes while the picture is being made, and holds on to everything else.
|
||||
|
||||
When the edit changes the whole picture (a new style, new light), there is nothing to keep, so the node steps aside and the edit runs as usual. A soft effect over the whole picture, such as rain or falling snow, is let through as well: the node then only holds the picture in place. **Lock** (`lock`) set to `off` does nothing at all, `always` locks even a whole-picture edit, and an optional `mask` says where the edit may happen. **Tolerance** (`tolerance`) sets how big a change must be to count as part of the edit.
|
||||
|
||||
On MiniMax-H3-Image, 4 megapixel edits moved the picture by up to 14 px without the lock (measured at 1 megapixel) and by 0.2 px or less with it (0.08 px or less on 35 of the 36 locked runs), on 19 local edits at two seeds each. After five edits in a row on one picture the plain chain had drifted 1.65 px and turned visibly pink; the locked chain sat at 0.04 px with no tint.
|
||||
|
||||
### Edit Lock Restore
|
||||
|
||||
Puts your picture's own pixels back in every part the edit did not change. Edit Lock keeps those parts in place, but they still pass through the VAE, which softens fine detail a little. Add this right after the VAE Decode and wire in Edit Lock's `edit_lock` output. **Feather** (`feather`) sets how softly the original fades into the edit. It also returns `edit_mask`, white where the edit changed the picture, and a one-line `report` of how much was kept.
|
||||
|
||||
### Image Compare A/B
|
||||
|
||||
Compares two pictures with a slider, or flips between them whole. Nothing covers the picture, and its size shows underneath. The panel grows with the node, and images A and B pass through, so you can put it anywhere on an image wire. **Erase** mixes the two by hand: rub parts of one picture away with a brush so the other shows through, then save the mix as a PNG under a name you type, with a layered PSD for Photoshop or GIMP if you want it.
|
||||
@@ -157,13 +206,13 @@ The example keeps the clip's audio when there is any. The outpaint LoRA needs a
|
||||
|
||||
### Load Video
|
||||
|
||||
Upload a video, or pick one from the Source list, which plays the clip under the pointer. Trim it with IN and OUT handles or typed timecodes. The player plays the part you kept and can loop it. Width and height resize while decoding, and setting only one keeps the shape. `every_nth` skips frames and lowers the reported fps so the timing stays right, and `max_frames` caps how many frames load.
|
||||
Upload a video, or pick one from the Source list, which plays the clip under the pointer. Set the part you want with Start, Duration and Ends at, in seconds or frames, or drag the handles under the player. The player plays the part you kept and can loop it. Width and height resize while decoding, and setting only one keeps the shape. `every_nth` skips frames and lowers the reported fps so the timing stays right, and the Duration caps how many frames load.
|
||||
|
||||
It returns the frames, audio, frame count, fps, width, height, duration and a core `VIDEO`. Only the part you kept is decoded, and it checks memory before a large load. When you save the frames, wire its fps into the save node.
|
||||
|
||||
### Load Audio
|
||||
|
||||
Upload a sound file, or pick one from the Source list, and the node shows it as a wave. Drag the IN and OUT handles to keep only the part you want, or type the times. Press play to hear just that part. Set **Max length** to the longest sound the next step can take, such as a video's length: anything past it turns red and is cut off, so you see what comes out before you run. Click the red length next to OUT to move OUT to the cut.
|
||||
Upload a sound file, or pick one from the Source list, and the node shows it as a wave. Drag the two handles to keep only the part you want, or type a Start, a Duration or an Ends at. Press play to hear just that part. Set the Duration to the length the next step needs, such as a video's length.
|
||||
|
||||
It returns the `audio` you kept and its length in `seconds`. Only that part is decoded. [Help page](js/docs/AUSBOSS_NODES_LoadAudio.md).
|
||||
|
||||
@@ -173,7 +222,7 @@ Picks one frame from a video, then gives you the same rotate, crop and pad contr
|
||||
|
||||
### Video Crop + Rotate + Pad → Clip
|
||||
|
||||
Applies one rotate, crop and pad to every frame of a trimmed clip. It has the source picker, a timeline with a playhead and frame-accurate IN and OUT handles, frame skipping, a frame limit, the transform handles and output resizing. While you drag a trim handle, the node shows the exact first or last frame the run keeps. The bright part of the selection is what gets output.
|
||||
Applies one rotate, crop and pad to every frame of a trimmed clip. It has the source picker, a timeline with a playhead and frame-accurate start and end handles, Start, Duration and Ends at boxes, frame skipping, the transform handles and output resizing. While you drag a trim handle, the node shows the exact first or last frame the run keeps. The bright part of the selection is what gets output.
|
||||
|
||||
Fill, feather and the resize budget are in **Crop, pad & resize** below the timeline, and a new clip keeps them. That matters for video outpainting, because the black, hard-edged canvas the model needs survives a source swap. A fresh Clip node starts with that canvas, and the editor's **Reset transform** goes back to it. **Frames for** trims the end to the frame count the next video model takes: LTX (8n+1) or Wan (4n+1). Tap a ratio to pad the clip to it; a new clip is padded to the lit ratio too. The padlock keeps the shape while you drag a handle.
|
||||
|
||||
@@ -191,10 +240,16 @@ Picks one frame from a batch, unchanged: `1` is the first, `-1` the last and `-2
|
||||
|
||||
### Frame Interpolate
|
||||
|
||||
Changes a clip's frame rate by making in-between frames. You set the source and target fps, so 24 to 30 works as well as doubling. The blend method crossfades frames, and optical flow uses RAFT weights you put in place yourself. At a hard cut it holds the frame instead of blending two unrelated shots. It works in chunks to keep memory down.
|
||||
Changes a clip's frame rate by making in-between frames. You set the source and target fps, so 24 to 30 works as well as doubling. The blend method crossfades frames, and optical flow uses RAFT weights you put in place yourself. At a hard cut it holds the frame instead of blending two shots together, even when both shots show the same place. It works in chunks to keep memory down.
|
||||
|
||||
It returns the new frames and their fps. It doesn't touch audio, so carry the source audio to Save Video separately. The [help page](js/docs/AUSBOSS_NODES_FrameInterpolate.md) covers the weights and timing.
|
||||
|
||||
### FlashVSR Upscale
|
||||
|
||||
Makes a video larger and sharper with the FlashVSR model. Set **Scale** from 1 to 4 and it returns every frame at the new size, with fine detail drawn back in. It reads the clip a few frames at a time, so a long clip needs no more graphics memory than a short one, and a result too large for the free memory is made in tiles.
|
||||
|
||||
It needs one model file in `ComfyUI/models/diffusion_models` and no other pack. The [help page](js/docs/AUSBOSS_NODES_FlashVSRUpscale.md) has the download link, the memory it needs and the speed. [Try the FlashVSR Video Upscale example →](example_workflows/FlashVSR%20Video%20Upscale%20%28AusBoss%29.json)
|
||||
|
||||
### Save Video
|
||||
|
||||
Saves a frame batch or a core `VIDEO` as MP4 (H.264 or H.265), WebM (VP9 or AV1), ProRes MOV, lossless FFV1 MKV, GIF or WebP. Which encoders you get depends on your FFmpeg and PyAV build, and H.264 and H.265 come in CPU and NVENC versions. The videos carry color tags, and optionally audio and the workflow.
|
||||
@@ -277,12 +332,16 @@ In the **+ LoRA** list, tick several files to add them at once. Rows can be gath
|
||||
|
||||
When a file has moved, the node finds it by name if only one file matches. A missing LoRA that is switched on stops the run by default. Turn off **Stop on missing LoRA** to warn and skip it instead. A LoRA that changes nothing in the model gets a warning with its file name.
|
||||
|
||||
Wire a [Strength Curve](#strength-curve) into the `curve` input and click the curve mark on a row, and that row's strength changes over the run: fade a style LoRA out so the last steps come out clean. It works with every model file, fp8 and int8 included.
|
||||
|
||||
### Krea 2 Encode
|
||||
|
||||
Krea 2's positive and negative prompts in one card. Connect a VAE and reference pictures, and it adds them as references too, resized for the model first. **VLM reference** sets whether the text encoder also looks at them. Leave the references empty for plain text to image. For an outpaint, connect the pad node's mask too: the model then sees the new area in your picture's own colour instead of gray, so it paints it rather than keeping a gray frame.
|
||||
|
||||
The prompt box takes several lines and a linked text. The [help page](js/docs/AUSBOSS_NODES_Krea2Encode.md) covers preparing references. With an outpaint LoRA, copy the wiring from the matching example.
|
||||
|
||||
Wire a [Strength Curve](#strength-curve) into `reference_curve` and the picture follows the references as strongly as the curve says at each step, from 1 (as today) to 0 (ignored): hold the layout early and let go late.
|
||||
|
||||
### Krea 2 Outpaint Model Patch
|
||||
|
||||
Tells Krea 2 where a reference picture sits on the canvas. It's made for Krea 2 outpaint LoRAs, and the two that exist want different placements. Put it after the LoRAs and before the sampler, and connect a stitcher and the reference conditioning from Krea 2 Encode.
|
||||
@@ -298,6 +357,29 @@ Here Krea 2 Outpaint takes a 16:9 photo to 4:5 in one pass. [Open the Krea 2 Out
|
||||
|
||||
The patch relies on ComfyUI's internal attention code. Its [help page](js/docs/AUSBOSS_NODES_Krea2OutpaintModelPatch.md) explains both setups and what happens without reference conditioning.
|
||||
|
||||
### Strength Curve
|
||||
|
||||
Draw how strong something should be from the first step of a run to the last: drag the points, or start from flat, fade out, fade in, ease out or ease in. **Top** and **Bottom** set the strength at the top and bottom of the curve box. Wire the curve into LoRA Loader's `curve` (rows you mark follow it) or Krea 2 Encode's `reference_curve`. The output is ComfyUI's list of numbers (`FLOATS`), so it also feeds ComfyUI's own hook keyframe nodes.
|
||||
|
||||
## 3D viewer
|
||||
|
||||
### Pause for Shot
|
||||
|
||||
Stops a run right after a **Preview 3D (Advanced)** viewer, so you can frame your shot on the model that run just made. Turn the camera, zoom, move the model, then press **Continue**: the run goes on with the shot exactly as the viewer shows it, and nothing before the pause runs again. **Stop** ends the run there. Wire a 360 picture into `panorama` and it shows behind the model while you frame, and `backdrop` hands on the part of it the camera sees, with an optional floor shadow. Set **Pause** to *run through* for runs nobody is watching.
|
||||
|
||||
### Photo Camera
|
||||
|
||||
Works out the camera your photo was taken with, so a 3D model of the person lines up with the photo. Made for **Pixal3D**, the TRELLIS 2 model that builds the model lined up with the photo. Wire in the photo, the person's mask and the photo's lens width (**Get FoV from MoGe** measures it). It hands Pixal3D the crop's lens, the 3D viewer your photo's own view (so the viewer opens where the photo was taken), and where the photo goes on a 360 canvas so the 360 lines up behind the model.
|
||||
|
||||
### Extras in ComfyUI's 3D viewers
|
||||
|
||||
The pack also adds to ComfyUI's own 3D viewers, with no new node:
|
||||
|
||||
- **Shape chips** above the width and height of Preview 3D (Advanced) and Save 3D (Advanced): pick a shape and the frame follows.
|
||||
- **Blender keys** with the mouse over a viewer: G move, R rotate, S scale, X / Y / Z to lock an axis, a typed number for an exact amount, the number keys for front, side and top views, and Home to frame the model.
|
||||
- **Viewport tools** in the top-right corner: drag the axis gizmo to orbit, the magnifier to zoom, the hand to pan, and a grid switch.
|
||||
- **A 360 strip** (press N, or the small 360 tab): spin and tip the model, cut its front or back away, turn, tilt and roll the 360 background, its brightness and blur, the light and the model's colours. The settings save with the workflow.
|
||||
|
||||
## Workflow utilities
|
||||
|
||||
Core ComfyUI has its own nodes for most of these jobs, and they work fine. These versions add the extras described under each one.
|
||||
@@ -318,6 +400,8 @@ Drag to draw a box, drag it to move it and its handles to size it; under the can
|
||||
|
||||
The `mask` output is white inside every box: load a picture, draw a box over the words on a sign, and an inpaint chain can write new words there while the rest of the picture stays as it was. For words at a slant, drag the round handle over a box to turn it: the mask turns with it, and a turned text box tells the model its slant.
|
||||
|
||||
For a model that reads only a prompt and has no box input, the `placement` output says the boxes as plain sentences, what goes in each box and where, to add to your prompt.
|
||||
|
||||

|
||||
|
||||
### Seed
|
||||
@@ -340,6 +424,14 @@ Puts batch `b` after `a`. When the sizes match, nothing is resized. When they di
|
||||
|
||||
A text box that grows with the node and sends its text, unchanged, down a `STRING` wire. Use it for a prompt, caption, path or other text that several nodes share. Spaces and line breaks are kept. Ctrl + Up and Ctrl + Down change the weight of the selected words, as in ComfyUI's own prompt boxes.
|
||||
|
||||
### Text Lines
|
||||
|
||||
Runs what comes after once for each line of your text. Type five prompts, one on each line, and one run makes five pictures. It also takes a list another node wrote, skips empty lines, and can take a leading `1.` or `-` off each line. `number` counts the lines from 1, to give each its own seed.
|
||||
|
||||
### Prompt Variations
|
||||
|
||||
A prompt box that changes on every run. Write choices in curly brackets, split by `|`, such as `a {red|blue|green} {sweater|jacket}`, and the node picks one from each set. Wire in the seed your sampler uses: a new seed gives a new mix, and the same seed gives the same prompt again. Set the seed to randomize and queue 50 runs to get 50 different prompts. Text without brackets comes out exactly as typed, so a JSON prompt is safe.
|
||||
|
||||
### H3 Prompt Writer
|
||||
|
||||
Type what happens, one line for each moment, and leave a blank line to cut to a new place. Connect up to four pictures and give each one a job: a person, a place, an outfit, a thing or a style. Copy the moves from a video, keep a clip going, or add a voice or a song. A timeline on the node shows when each moment plays before you run it. It needs no extra model and you never see H3's prompt format. Connect a small text model and it fills in a one-line idea.
|
||||
@@ -392,7 +484,7 @@ Turns parts of a workflow off and on from one small card. Select the nodes of on
|
||||
|
||||
## Example workflows
|
||||
|
||||
These are the workflows where the nodes do something core ComfyUI doesn't do by itself: outpainting and inpainting that put your original picture back, lining an edit back up with its source, upscaling a picture in tiles, masking a thing by its name or with a click, and removing a watermark from a clip. Open a JSON file from [`example_workflows/`](example_workflows), or find them under this pack in ComfyUI's template browser. Each one has a thumbnail, numbered groups and a Workflow Note with the setup steps and model downloads.
|
||||
These are the workflows where the nodes do something core ComfyUI doesn't do by itself: outpainting and inpainting that put your original picture back, lining an edit back up with its source, upscaling a picture in tiles, masking a thing by its name or with a click, removing a watermark from a clip, and making a clip larger and sharper. Open a JSON file from [`example_workflows/`](example_workflows), or find them under this pack in ComfyUI's template browser. Each one has a thumbnail, numbered groups and a Workflow Note with the setup steps and model downloads.
|
||||
|
||||

|
||||
|
||||
@@ -413,6 +505,7 @@ The workflows open with their image and video loaders empty, so you load your ow
|
||||
| [Mask by Name](example_workflows/Mask%20by%20Name%20%28AusBoss%29.json) | Type what to find in a picture, and get its mask and a cut-out with a see-through background | ComfyUI's own SAM 3.1 (ComfyUI 0.20 or newer) |
|
||||
| [Mask by Touch](example_workflows/Mask%20by%20Touch%20%28AusBoss%29.json) | Click a thing in a picture, or its whole subject, and get its mask and a cut-out with hair-fine edges | ComfyUI's own SAM 3.1 and its background-removal model (ComfyUI 0.21 or newer) |
|
||||
| [Simple Video Watermark Remover](example_workflows/Simple%20Video%20Watermark%20Remover%20%28AusBoss%29.json) | Find an overlay in a clip and remove it, with a one-frame comparison branch | ComfyUI's own SAM 3.1 (ComfyUI 0.20 or newer), plus `big-lama.pt` |
|
||||
| [FlashVSR Video Upscale](example_workflows/FlashVSR%20Video%20Upscale%20%28AusBoss%29.json) | Make a clip larger and sharper with one node | `flashvsr_v1.1_fp16.safetensors` |
|
||||
|
||||
Every example uses only core nodes and this pack. Speed and memory use depend on the models, the sizes, the frame count and whatever else is using the GPU.
|
||||
|
||||
@@ -422,6 +515,7 @@ If you share workflows, a few of these nodes help the people who download them:
|
||||
|
||||
- **Workflow Note** puts a setup card on the canvas with each model's download link, folder and size, the node packs it needs and your links, and checks them against the reader's install.
|
||||
- **Callout** is a note with big readable text and teal arrows you type with an emoji.
|
||||
- **Check layout 🆎** lists overlaps, hidden and backwards wires and nodes outside the groups before you share.
|
||||
- **Image Compare A/B** shows the result against its source with a slider.
|
||||
- **Seed** keeps runs repeatable, and **Use last run** brings back the seed the last run used.
|
||||
- **Run Timer** shows how long the whole run took, so a speed note is measured.
|
||||
@@ -433,9 +527,10 @@ People who download your workflow get the nodes through ComfyUI-Manager's missin
|
||||
|
||||
## Pack-wide tools
|
||||
|
||||
- **Help cards:** the **?** in a node's title bar opens its description, inputs and outputs. Run Timer has no title bar, so it has **About this node** in its right-click menu.
|
||||
- **Help cards:** the **?** in a classic node's title bar opens its description, inputs and outputs. Nodes 2.0 and titleless nodes such as Run Timer have **About this node** in their right-click menu.
|
||||
- **Recreate node 🆎** (right-click an AusBoss node) rebuilds a node saved by an older version from the current definition. It keeps the values, links, position and colors.
|
||||
- **Replace with AusBoss nodes 🆎** (canvas right-click or the command palette) finds third-party nodes this pack can stand in for, such as VideoHelperSuite's Load Video and Video Combine or KJNodes' Color Match. It previews each swap and replaces the ones you leave ticked.
|
||||
- **Check layout 🆎** (canvas right-click or the command palette) lists what makes a workflow hard to read: overlapping nodes and groups (title bars included), wires that run backwards or hide behind a node, a node just under one that grows when it shows a picture, nodes outside every group, a saved zoom too small for the text to draw, and a missing Workflow Note. It checks inside every subgraph too. Click an entry to jump to it and select it. It moves nothing.
|
||||
- **Snap into line:** a node, group or selection you drag lines up with the nodes and groups around it, edge to edge or middle to middle, and a teal line shows what it lines up with. Pulling a corner to resize lines up the same way. Hold Shift while you drag to skip it, or turn it off in Settings → 🆎 AusBoss → Canvas.
|
||||
- **Line up:** select two or more nodes or groups and the selection toolbar gets a Line up button: line up edges or middles, match widths or heights, or space them evenly. With two or more nodes selected, pulling the edge or corner of one resizes them all: a column gets one width, a row one height, a grid both (turn it off in Settings → 🆎 AusBoss → Canvas → Resize together).
|
||||
- **Node colors:** Settings → 🆎 AusBoss → Appearance sets the scheme for every AusBoss node (AusBoss, Graphite, Slate, Teal, Moss, Plum, Rust, Navy, Custom or Theme default). A node's right-click **AusBoss color** menu recolors just that node, and nodes you colored by hand keep their colors.
|
||||
@@ -448,7 +543,7 @@ People who download your workflow get the nodes through ComfyUI-Manager's missin
|
||||
- Hold Shift while you turn the green rotation handle to snap to 15° steps.
|
||||
- In the full-screen editor, the mouse wheel zooms, and the middle mouse button or Alt-drag pans. On the node itself, the wheel and middle mouse button still move the graph.
|
||||
- **Alt+E** opens the selected node's transform editor. Change the key in Settings → Keybindings.
|
||||
- The video editors have frame stepping, playback and exact timeline seeking, on the node face as well as in the editor. The Clip node's IN and OUT handles sit on the source's own frames, so the frame shown for IN is the first one decoded and the frame shown for OUT is the last.
|
||||
- The video editors have frame stepping, playback and exact timeline seeking, on the node face as well as in the editor. The Clip node's start and end handles sit on the source's own frames, so the frame shown at the start is the first one decoded and the frame shown at the end is the last.
|
||||
- Your own aspect presets go in `ausboss_presets.json` beside the pack. Copy [`ausboss_presets_example.json`](ausboss_presets_example.json) to start. Your file survives updates.
|
||||
|
||||
LoRA Loader and Latent Size have their own gear menus for per-node preferences.
|
||||
|
||||
+61
-12
@@ -11,7 +11,6 @@ of taking the whole pack down, so one broken node never hides the rest.
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import re
|
||||
import traceback
|
||||
|
||||
# One entry per file in nodes/, kept alphabetical. The order has no
|
||||
@@ -22,6 +21,10 @@ NODE_MODULES = [
|
||||
"node_callout",
|
||||
"node_color_match",
|
||||
"node_compare",
|
||||
"node_cut_out",
|
||||
"node_edit_lock",
|
||||
"node_film_grain",
|
||||
"node_flashvsr_upscale",
|
||||
"node_frame_interpolate",
|
||||
"node_free_memory",
|
||||
"node_h3_prompt_writer",
|
||||
@@ -29,12 +32,15 @@ NODE_MODULES = [
|
||||
"node_image_folder",
|
||||
"node_image_resize",
|
||||
"node_image_size",
|
||||
"node_image_toolbox",
|
||||
"node_inpaint_crop_stitch",
|
||||
"node_keep_detail",
|
||||
"node_krea2_encode",
|
||||
"node_krea2_model_patch",
|
||||
"node_lama_inpaint",
|
||||
"node_layout_boxes",
|
||||
"node_literals",
|
||||
"node_load_image",
|
||||
"node_load_image_pad",
|
||||
"node_load_audio",
|
||||
"node_load_video",
|
||||
@@ -42,6 +48,9 @@ NODE_MODULES = [
|
||||
"node_mask_by_name",
|
||||
"node_mask_by_touch",
|
||||
"node_math",
|
||||
"node_pause_shot",
|
||||
"node_photo_camera",
|
||||
"node_prompt_variations",
|
||||
"node_realign_to_source",
|
||||
"node_refine_mask",
|
||||
"node_resolution",
|
||||
@@ -52,6 +61,8 @@ NODE_MODULES = [
|
||||
"node_select_frame",
|
||||
"node_show_text",
|
||||
"node_step_preview",
|
||||
"node_strength_curve",
|
||||
"node_text_lines",
|
||||
"node_tiled_upscale",
|
||||
"node_video_crop_rotate_pad",
|
||||
"node_video_crop_rotate_pad_clip",
|
||||
@@ -63,7 +74,19 @@ NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
_failed_modules = []
|
||||
|
||||
# Two copies of the pack (a Manager install beside a git clone) add every
|
||||
# route twice and ComfyUI stops while starting. Only one copy loads.
|
||||
_other_copy = None
|
||||
try:
|
||||
from .nodes._single_copy import other_copy_that_loads
|
||||
|
||||
_other_copy = other_copy_that_loads(os.path.dirname(__file__))
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
for _module_name in NODE_MODULES:
|
||||
if _other_copy:
|
||||
break
|
||||
try:
|
||||
_module = importlib.import_module(f".nodes.{_module_name}", __name__)
|
||||
NODE_CLASS_MAPPINGS.update(getattr(_module, "NODE_CLASS_MAPPINGS", {}))
|
||||
@@ -75,8 +98,10 @@ for _module_name in NODE_MODULES:
|
||||
traceback.print_exc()
|
||||
|
||||
# Folder ComfyUI serves to the browser; every .js file in it is loaded as a
|
||||
# frontend extension. Shared modules use .mjs so they are import-only.
|
||||
WEB_DIRECTORY = "./js"
|
||||
# frontend extension. Shared modules use .mjs so they are import-only. A copy
|
||||
# that steps aside serves only the script that warns about it in the browser,
|
||||
# since the console line alone is easy to miss.
|
||||
WEB_DIRECTORY = "./web_second_copy" if _other_copy else "./js"
|
||||
|
||||
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
|
||||
|
||||
@@ -84,10 +109,11 @@ __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
|
||||
def _read_version():
|
||||
"""Version straight from pyproject.toml so it is never duplicated."""
|
||||
try:
|
||||
from .nodes._pyproject import read_project
|
||||
|
||||
pyproject = os.path.join(os.path.dirname(__file__), "pyproject.toml")
|
||||
with open(pyproject, "r", encoding="utf-8") as f:
|
||||
match = re.search(r'^version\s*=\s*"([^"]+)"', f.read(), re.MULTILINE)
|
||||
return match.group(1) if match else "unknown"
|
||||
version = read_project(pyproject).get("version")
|
||||
return version if isinstance(version, str) and version.strip() else "unknown"
|
||||
except Exception:
|
||||
return "unknown"
|
||||
|
||||
@@ -112,11 +138,34 @@ def _print_banner():
|
||||
print(bar)
|
||||
|
||||
|
||||
try:
|
||||
from .nodes._frontend_cache import register_frontend_cache_guard
|
||||
def _print_second_copy():
|
||||
# ASCII only, as in the banner.
|
||||
red = "\033[0;31m"
|
||||
reset = "\033[0m"
|
||||
own = os.path.basename(os.path.dirname(os.path.realpath(__file__)))
|
||||
other = os.path.basename(_other_copy["folder"])
|
||||
print(f"{red}AusBoss: this pack is installed twice.{reset}")
|
||||
print(f" Using: custom_nodes/{other} (v{_other_copy['version']})")
|
||||
print(f" Skipping: custom_nodes/{own} (v{_read_version()})")
|
||||
print(" Delete one of the two folders, then restart ComfyUI.")
|
||||
|
||||
register_frontend_cache_guard()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
_print_banner()
|
||||
if _other_copy:
|
||||
_print_second_copy()
|
||||
try:
|
||||
from .nodes._single_copy import register_second_copy_notice, second_copy_notice
|
||||
|
||||
register_second_copy_notice(
|
||||
second_copy_notice(os.path.dirname(__file__), _read_version(), _other_copy)
|
||||
)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
else:
|
||||
try:
|
||||
from .nodes._frontend_cache import register_frontend_cache_guard
|
||||
|
||||
register_frontend_cache_guard()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
|
||||
_print_banner()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="105" height="20" role="img" aria-label="release: v2.21.2">
|
||||
<title>release: v2.21.2</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="105" height="20" role="img" aria-label="release: v2.30.0">
|
||||
<title>release: v2.30.0</title>
|
||||
<path fill="#555" d="M0 0h48v20H0z"/>
|
||||
<path fill="#00b4aa" d="M48 0h57v20H48z"/>
|
||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="24" y="14">release</text>
|
||||
<text x="76.5" y="14">v2.21.2</text>
|
||||
<text x="76.5" y="14">v2.30.0</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 425 B |
@@ -42,7 +42,8 @@ recipe.
|
||||
| `cdp_drag.mjs <port> <setup.js> <mid.png\|-> <after.png\|-> [check.js]` | `setup.js` returns `{from, to, __clip}` in client pixels; presses at `from`, moves to `to`, screenshots mid-drag, releases, evaluates `check.js`, screenshots again |
|
||||
| `audit_workflows.mjs <port> <output-dir> [workflow.json ...]` | loads every example (or selected files), exports API and loaded graphs, captures screenshots, and fails on overlaps, missing nodes, browser exceptions, or exposed AusBoss number widgets |
|
||||
| `wheel_sweep.mjs <port> [--vue] [--only=Type,Type] [--workflow=file.json] [--shots=dir]` | turns the mouse wheel at every point of every node of the pack (or of the nodes in one workflow) and fails on any spot where the graph does not zoom, naming the element that took the wheel; `--real` sends real wheel turns, slower and on a coarser grid |
|
||||
| `face_smoke.mjs <port> [--vue] [--only=Type,Type]` | puts one of each node of the pack on an empty graph and fails when a face does not come up: no node, a panel that is not on the page or has no size, an error thrown, a file of the pack that did not load. Needs no model, so it also runs in the nightly ComfyUI check |
|
||||
| `face_smoke.mjs <port> [--vue] [--blocked-reads] [--only=Type,Type]` | puts one of each node of the pack on an empty graph and fails when a face does not come up: no node, a panel that is not on the page or has no size, an error thrown, a file of the pack that did not load. `--blocked-reads` acts like a privacy browser that blanks canvas pixel reads, gives every node that loads a picture a sample picture, and fails when its face then draws no picture. Needs no model, so it also runs in the nightly ComfyUI check |
|
||||
| `h3_sockets_check.mjs <port> [--vue]` | puts H3 Prompt Writer on a graph and reads the screen: which socket rows are drawn fresh, wired, unwired, after undo, a paste, a collapse and a switch of renderer, what a run would send, and what a save would write. Fails when a row shows or hides against the rule in `js/shared/h3_sockets.mjs`. `H3_LIVE_WORKFLOWS` adds saved workflows to open. Needs no model, so it also runs in the nightly ComfyUI check |
|
||||
| `cdp_nav_debug.mjs <port>` | navigates the tab in place and logs every CDP event, for when a tab stops answering |
|
||||
| `cdp_hang.mjs <port>` | pre-arms the debugger on a fresh tab, loads ComfyUI, and pauses to print the stack if the page stops answering |
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
@@ -0,0 +1,993 @@
|
||||
{
|
||||
"id": "aba7bd0c-8de6-4044-a89e-cada288c8911",
|
||||
"revision": 0,
|
||||
"last_node_id": 15,
|
||||
"last_link_id": 11,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "AUSBOSS_NODES_WorkflowNote",
|
||||
"pos": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"size": [
|
||||
440,
|
||||
640
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_WorkflowNote"
|
||||
},
|
||||
"widgets_values": [
|
||||
"{\"v\":1,\"title\":\"Film Grain, Cut Out and Keep Detail\",\"subtitle\":\"Finish a picture: add film grain, cut it out, or put back detail an edit smoothed away.\",\"author\":\"AusBoss\",\"layout\":\"card\",\"accent\":\"\",\"body\":\"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your picture.\\n2. Press **Run**. Each node shows its result, and Save Image keeps it.\\n\\n### Good to know\\n\\n- **Film Grain** works on video too: new grain on every frame, or the same grain with **Video grain** on *still*.\\n- **Cut Out** gets its mask from two core nodes, Convert Image to Mask and Threshold Mask, so it needs no model. Wire Mask by Name or Mask by Touch for a real subject. The PNG keeps the transparency.\\n- **Keep Detail** needs the two pictures to line up. Image Blur here stands in for an edit; wire your own edit and the original.\\n\\nRuns on the CPU, with nothing to download. Needs AusBoss nodes newer than 2.28.1.\",\"models\":[],\"packs\":[{\"name\":\"ComfyUI-AusBoss\",\"url\":\"https://github.com/ausboss/ComfyUI-AusBoss\",\"node\":\"AUSBOSS_NODES_KeepDetail\"}],\"links\":[{\"label\":\"YouTube · ausbossdev\",\"url\":\"https://www.youtube.com/@ausbossdev\"},{\"label\":\"GitHub · ausboss\",\"url\":\"https://github.com/ausboss\"},{\"label\":\"Civitai · AusBoss\",\"url\":\"https://civitai.com/user/AusBoss\"},{\"label\":\"X · Zanzibased\",\"url\":\"https://x.com/Zanzibased\"}]}"
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"note": "{\"v\":1,\"title\":\"Film Grain, Cut Out and Keep Detail\",\"subtitle\":\"Finish a picture: add film grain, cut it out, or put back detail an edit smoothed away.\",\"author\":\"AusBoss\",\"layout\":\"card\",\"accent\":\"\",\"body\":\"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your picture.\\n2. Press **Run**. Each node shows its result, and Save Image keeps it.\\n\\n### Good to know\\n\\n- **Film Grain** works on video too: new grain on every frame, or the same grain with **Video grain** on *still*.\\n- **Cut Out** gets its mask from two core nodes, Convert Image to Mask and Threshold Mask, so it needs no model. Wire Mask by Name or Mask by Touch for a real subject. The PNG keeps the transparency.\\n- **Keep Detail** needs the two pictures to line up. Image Blur here stands in for an edit; wire your own edit and the original.\\n\\nRuns on the CPU, with nothing to download. Needs AusBoss nodes newer than 2.28.1.\",\"models\":[],\"packs\":[{\"name\":\"ComfyUI-AusBoss\",\"url\":\"https://github.com/ausboss/ComfyUI-AusBoss\",\"node\":\"AUSBOSS_NODES_KeepDetail\"}],\"links\":[{\"label\":\"YouTube · ausbossdev\",\"url\":\"https://www.youtube.com/@ausbossdev\"},{\"label\":\"GitHub · ausboss\",\"url\":\"https://github.com/ausboss\"},{\"label\":\"Civitai · AusBoss\",\"url\":\"https://civitai.com/user/AusBoss\"},{\"label\":\"X · Zanzibased\",\"url\":\"https://x.com/Zanzibased\"}]}"
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "LoadImage",
|
||||
"pos": [
|
||||
500,
|
||||
272
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
760
|
||||
],
|
||||
"flags": {},
|
||||
"order": 1,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
1,
|
||||
3,
|
||||
5,
|
||||
8,
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "MASK",
|
||||
"type": "MASK",
|
||||
"links": null
|
||||
}
|
||||
],
|
||||
"title": "Your picture",
|
||||
"properties": {
|
||||
"Node name for S&R": "LoadImage"
|
||||
},
|
||||
"widgets_values": [
|
||||
"",
|
||||
"image"
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"image": "",
|
||||
"upload": "image"
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "AUSBOSS_NODES_Callout",
|
||||
"pos": [
|
||||
500,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
122
|
||||
],
|
||||
"flags": {},
|
||||
"order": 2,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"title": "Callout",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_Callout"
|
||||
},
|
||||
"widgets_values": [
|
||||
"⬇️#2 Load your **picture** here."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "⬇️#2 Load your **picture** here."
|
||||
},
|
||||
"color": "#07090a",
|
||||
"bgcolor": "#07090a"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "AUSBOSS_NODES_FilmGrain",
|
||||
"pos": [
|
||||
984,
|
||||
272
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
449
|
||||
],
|
||||
"flags": {},
|
||||
"order": 6,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"link": 1
|
||||
},
|
||||
{
|
||||
"name": "mask",
|
||||
"shape": 7,
|
||||
"type": "MASK",
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_FilmGrain"
|
||||
},
|
||||
"widgets_values": [
|
||||
0.3,
|
||||
1.2,
|
||||
0.5,
|
||||
0.2,
|
||||
true,
|
||||
0,
|
||||
true
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"amount": 0.3,
|
||||
"size": 1.2,
|
||||
"roughness": 0.5,
|
||||
"color": 0.2,
|
||||
"moving": true,
|
||||
"seed": 0,
|
||||
"preview": true
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "AUSBOSS_NODES_Callout",
|
||||
"pos": [
|
||||
984,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
122
|
||||
],
|
||||
"flags": {},
|
||||
"order": 3,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"title": "Callout",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_Callout"
|
||||
},
|
||||
"widgets_values": [
|
||||
"⬇️#4 Set the **grain**.\n###### Amount is how strong, Size how big each grain is in pixels. Color 0 is black-and-white grain."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "⬇️#4 Set the **grain**.\n###### Amount is how strong, Size how big each grain is in pixels. Color 0 is black-and-white grain."
|
||||
},
|
||||
"color": "#07090a",
|
||||
"bgcolor": "#07090a"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"type": "AUSBOSS_NODES_SaveImage",
|
||||
"pos": [
|
||||
984,
|
||||
791
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
422
|
||||
],
|
||||
"flags": {},
|
||||
"order": 9,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 2
|
||||
},
|
||||
{
|
||||
"name": "filename",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"name": "caption_text",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "file_path",
|
||||
"type": "STRING",
|
||||
"links": null
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"links": null
|
||||
}
|
||||
],
|
||||
"title": "Save Image - With grain",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_SaveImage"
|
||||
},
|
||||
"widgets_values": {
|
||||
"filename_prefix": "film_grain",
|
||||
"format": "png",
|
||||
"save_metadata": true,
|
||||
"exact_name": "",
|
||||
"on_existing": "overwrite",
|
||||
"output_dir": "",
|
||||
"caption": "",
|
||||
"name_counter": true,
|
||||
"name_date": false,
|
||||
"name_time": false,
|
||||
"name_size": false,
|
||||
"name_batch": false,
|
||||
"preview": false,
|
||||
"step_preview": false,
|
||||
"autosave": true,
|
||||
"civitai_info": false
|
||||
},
|
||||
"widgets_values_named": {
|
||||
"filename_prefix": "film_grain",
|
||||
"format": "png",
|
||||
"save_metadata": true,
|
||||
"exact_name": "",
|
||||
"on_existing": "overwrite",
|
||||
"output_dir": "",
|
||||
"caption": "",
|
||||
"name_counter": true,
|
||||
"name_date": false,
|
||||
"name_time": false,
|
||||
"name_size": false,
|
||||
"name_batch": false,
|
||||
"preview": false,
|
||||
"step_preview": false,
|
||||
"autosave": true,
|
||||
"civitai_info": false
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"type": "AUSBOSS_NODES_Callout",
|
||||
"pos": [
|
||||
1468,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
122
|
||||
],
|
||||
"flags": {},
|
||||
"order": 4,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"title": "Callout",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_Callout"
|
||||
},
|
||||
"widgets_values": [
|
||||
"The mask is the picture's blue channel, with no model.\n###### Wire your own mask here, such as one from Mask by Name."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "The mask is the picture's blue channel, with no model.\n###### Wire your own mask here, such as one from Mask by Name."
|
||||
},
|
||||
"color": "#07090a",
|
||||
"bgcolor": "#07090a"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"type": "ImageToMask",
|
||||
"pos": [
|
||||
1468,
|
||||
272
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
58
|
||||
],
|
||||
"flags": {},
|
||||
"order": 7,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"link": 3
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "MASK",
|
||||
"type": "MASK",
|
||||
"links": [
|
||||
4
|
||||
]
|
||||
}
|
||||
],
|
||||
"title": "Convert Image to Mask - Blue channel",
|
||||
"properties": {
|
||||
"Node name for S&R": "ImageToMask"
|
||||
},
|
||||
"widgets_values": [
|
||||
"blue"
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"channel": "blue"
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"type": "ThresholdMask",
|
||||
"pos": [
|
||||
1468,
|
||||
400
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
58
|
||||
],
|
||||
"flags": {},
|
||||
"order": 10,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "mask",
|
||||
"type": "MASK",
|
||||
"link": 4
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "MASK",
|
||||
"type": "MASK",
|
||||
"links": [
|
||||
6
|
||||
]
|
||||
}
|
||||
],
|
||||
"title": "Threshold Mask - Sky and mist",
|
||||
"properties": {
|
||||
"Node name for S&R": "ThresholdMask"
|
||||
},
|
||||
"widgets_values": [
|
||||
0.55
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"value": 0.55
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"type": "AUSBOSS_NODES_CutOut",
|
||||
"pos": [
|
||||
1468,
|
||||
528
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
418
|
||||
],
|
||||
"flags": {},
|
||||
"order": 12,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"link": 5
|
||||
},
|
||||
{
|
||||
"name": "mask",
|
||||
"type": "MASK",
|
||||
"link": 6
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
7
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "alpha",
|
||||
"type": "MASK",
|
||||
"links": null
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_CutOut"
|
||||
},
|
||||
"widgets_values": [
|
||||
"black",
|
||||
0,
|
||||
1,
|
||||
true,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
true
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"keep": "black",
|
||||
"grow": 0,
|
||||
"feather": 1,
|
||||
"clean_edges": true,
|
||||
"clear_haze": 0,
|
||||
"solid_above": 1,
|
||||
"smooth_frames": 0,
|
||||
"preview": true
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"type": "AUSBOSS_NODES_SaveImage",
|
||||
"pos": [
|
||||
1468,
|
||||
1016
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
422
|
||||
],
|
||||
"flags": {},
|
||||
"order": 14,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 7
|
||||
},
|
||||
{
|
||||
"name": "filename",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"name": "caption_text",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "file_path",
|
||||
"type": "STRING",
|
||||
"links": null
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"links": null
|
||||
}
|
||||
],
|
||||
"title": "Save Image - The cut-out",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_SaveImage"
|
||||
},
|
||||
"widgets_values": {
|
||||
"filename_prefix": "cut_out",
|
||||
"format": "png",
|
||||
"save_metadata": true,
|
||||
"exact_name": "",
|
||||
"on_existing": "overwrite",
|
||||
"output_dir": "",
|
||||
"caption": "",
|
||||
"name_counter": true,
|
||||
"name_date": false,
|
||||
"name_time": false,
|
||||
"name_size": false,
|
||||
"name_batch": false,
|
||||
"preview": false,
|
||||
"step_preview": false,
|
||||
"autosave": true,
|
||||
"civitai_info": false
|
||||
},
|
||||
"widgets_values_named": {
|
||||
"filename_prefix": "cut_out",
|
||||
"format": "png",
|
||||
"save_metadata": true,
|
||||
"exact_name": "",
|
||||
"on_existing": "overwrite",
|
||||
"output_dir": "",
|
||||
"caption": "",
|
||||
"name_counter": true,
|
||||
"name_date": false,
|
||||
"name_time": false,
|
||||
"name_size": false,
|
||||
"name_batch": false,
|
||||
"preview": false,
|
||||
"step_preview": false,
|
||||
"autosave": true,
|
||||
"civitai_info": false
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"type": "AUSBOSS_NODES_Callout",
|
||||
"pos": [
|
||||
1952,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
122
|
||||
],
|
||||
"flags": {},
|
||||
"order": 5,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"title": "Callout",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_Callout"
|
||||
},
|
||||
"widgets_values": [
|
||||
"Image Blur stands in for an edit that came out too smooth.\n###### Edge safe is off under More, because a blur softens strong edges too. Wire your own edit to image and the original to detail_from."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "Image Blur stands in for an edit that came out too smooth.\n###### Edge safe is off under More, because a blur softens strong edges too. Wire your own edit to image and the original to detail_from."
|
||||
},
|
||||
"color": "#07090a",
|
||||
"bgcolor": "#07090a"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"type": "ImageBlur",
|
||||
"pos": [
|
||||
1952,
|
||||
272
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
82
|
||||
],
|
||||
"flags": {},
|
||||
"order": 8,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"link": 8
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "IMAGE",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
9
|
||||
]
|
||||
}
|
||||
],
|
||||
"title": "Image Blur - Stands in for a smooth edit",
|
||||
"properties": {
|
||||
"Node name for S&R": "ImageBlur"
|
||||
},
|
||||
"widgets_values": [
|
||||
4,
|
||||
2
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"blur_radius": 4,
|
||||
"sigma": 2
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"type": "AUSBOSS_NODES_KeepDetail",
|
||||
"pos": [
|
||||
1952,
|
||||
424
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
407
|
||||
],
|
||||
"flags": {},
|
||||
"order": 11,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"link": 9
|
||||
},
|
||||
{
|
||||
"name": "detail_from",
|
||||
"type": "IMAGE",
|
||||
"link": 10
|
||||
},
|
||||
{
|
||||
"name": "mask",
|
||||
"shape": 7,
|
||||
"type": "MASK",
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "image",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
11
|
||||
]
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_KeepDetail"
|
||||
},
|
||||
"widgets_values": [
|
||||
4,
|
||||
1,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"detail_size": 4,
|
||||
"strength": 1,
|
||||
"color_detail": false,
|
||||
"edge_safe": false,
|
||||
"preview": true
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"type": "AUSBOSS_NODES_SaveImage",
|
||||
"pos": [
|
||||
1952,
|
||||
901
|
||||
],
|
||||
"size": [
|
||||
424,
|
||||
422
|
||||
],
|
||||
"flags": {},
|
||||
"order": 13,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"link": 11
|
||||
},
|
||||
{
|
||||
"name": "filename",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"name": "caption_text",
|
||||
"shape": 7,
|
||||
"type": "STRING",
|
||||
"link": null
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "file_path",
|
||||
"type": "STRING",
|
||||
"links": null
|
||||
},
|
||||
{
|
||||
"name": "images",
|
||||
"type": "IMAGE",
|
||||
"links": null
|
||||
}
|
||||
],
|
||||
"title": "Save Image - With the detail back",
|
||||
"properties": {
|
||||
"Node name for S&R": "AUSBOSS_NODES_SaveImage"
|
||||
},
|
||||
"widgets_values": {
|
||||
"filename_prefix": "keep_detail",
|
||||
"format": "png",
|
||||
"save_metadata": true,
|
||||
"exact_name": "",
|
||||
"on_existing": "overwrite",
|
||||
"output_dir": "",
|
||||
"caption": "",
|
||||
"name_counter": true,
|
||||
"name_date": false,
|
||||
"name_time": false,
|
||||
"name_size": false,
|
||||
"name_batch": false,
|
||||
"preview": false,
|
||||
"step_preview": false,
|
||||
"autosave": true,
|
||||
"civitai_info": false
|
||||
},
|
||||
"widgets_values_named": {
|
||||
"filename_prefix": "keep_detail",
|
||||
"format": "png",
|
||||
"save_metadata": true,
|
||||
"exact_name": "",
|
||||
"on_existing": "overwrite",
|
||||
"output_dir": "",
|
||||
"caption": "",
|
||||
"name_counter": true,
|
||||
"name_date": false,
|
||||
"name_time": false,
|
||||
"name_size": false,
|
||||
"name_batch": false,
|
||||
"preview": false,
|
||||
"step_preview": false,
|
||||
"autosave": true,
|
||||
"civitai_info": false
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
[
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
2,
|
||||
4,
|
||||
0,
|
||||
6,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
3,
|
||||
2,
|
||||
0,
|
||||
8,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
4,
|
||||
8,
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
"MASK"
|
||||
],
|
||||
[
|
||||
5,
|
||||
2,
|
||||
0,
|
||||
10,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
6,
|
||||
9,
|
||||
0,
|
||||
10,
|
||||
1,
|
||||
"MASK"
|
||||
],
|
||||
[
|
||||
7,
|
||||
10,
|
||||
0,
|
||||
11,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
8,
|
||||
2,
|
||||
0,
|
||||
13,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
9,
|
||||
13,
|
||||
0,
|
||||
14,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
10,
|
||||
2,
|
||||
0,
|
||||
14,
|
||||
1,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
11,
|
||||
14,
|
||||
0,
|
||||
15,
|
||||
0,
|
||||
"IMAGE"
|
||||
]
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "1 · Your picture",
|
||||
"bounding": [
|
||||
480,
|
||||
0,
|
||||
464,
|
||||
1458
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "2 · Film Grain",
|
||||
"bounding": [
|
||||
964,
|
||||
0,
|
||||
464,
|
||||
1458
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "3 · Cut Out",
|
||||
"bounding": [
|
||||
1448,
|
||||
0,
|
||||
464,
|
||||
1458
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"title": "4 · Keep Detail",
|
||||
"bounding": [
|
||||
1932,
|
||||
0,
|
||||
464,
|
||||
1458
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
"config": {},
|
||||
"extra": {
|
||||
"ds": {
|
||||
"scale": 0.6,
|
||||
"offset": [
|
||||
20,
|
||||
60
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.58.5",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
954,
|
||||
222
|
||||
],
|
||||
"linkIds": [
|
||||
3,
|
||||
5,
|
||||
8,
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1438,
|
||||
222
|
||||
],
|
||||
"linkIds": [
|
||||
3,
|
||||
5,
|
||||
8,
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"parentId": 2,
|
||||
"pos": [
|
||||
1922,
|
||||
222
|
||||
],
|
||||
"linkIds": [
|
||||
8,
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 3,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"parentId": 3
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"parentId": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
@@ -0,0 +1,561 @@
|
||||
{
|
||||
"id": "0b455c1f-6b0c-4f69-8a7e-86f8de61df5c",
|
||||
"revision": 0,
|
||||
"last_node_id": 5,
|
||||
"last_link_id": 4,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "AUSBOSS_NODES_WorkflowNote",
|
||||
"pos": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"size": [
|
||||
440,
|
||||
640
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "note",
|
||||
"type": "STRING",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "note"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"title": "🆎 AusBoss",
|
||||
"properties": {
|
||||
"cnr_id": "ausboss-nodes",
|
||||
"ver": "2.24.0",
|
||||
"Node name for S&R": "AUSBOSS_NODES_WorkflowNote"
|
||||
},
|
||||
"widgets_values": [
|
||||
"{\"v\": 1, \"title\": \"FlashVSR Video Upscale\", \"subtitle\": \"Make a video larger and sharper with one node and one model file.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your video.\\n2. Set **Scale**: how many times larger each side gets. At 1 the video keeps its size and is only sharpened.\\n3. Press **Run**, then play the result in **Save Video**.\\n\\nTo try a short piece first, drag the right end of the bar under the player in Load Video.\\n\\nA long video needs no more graphics memory than a short one. A large result is made in tiles, so it fits the memory you have and takes longer.\\n\\nNeeds AusBoss nodes 2.24.0 or newer. No other pack is needed.\", \"models\": [{\"name\": \"flashvsr_v1.1_fp16.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"3.5 GB\", \"url\": \"https://huggingface.co/ausboss/FlashVSR-v1.1-ComfyUI/resolve/main/flashvsr_v1.1_fp16.safetensors\", \"note\": \"FlashVSR v1.1 by Junhao Zhuang and the OpenImagingLab team, in one file\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_FlashVSRUpscale\"}], \"links\": [{\"label\": \"YouTube · ausbossdev\", \"url\": \"https://www.youtube.com/@ausbossdev\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}",
|
||||
""
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"note": "{\"v\": 1, \"title\": \"FlashVSR Video Upscale\", \"subtitle\": \"Make a video larger and sharper with one node and one model file.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your video.\\n2. Set **Scale**: how many times larger each side gets. At 1 the video keeps its size and is only sharpened.\\n3. Press **Run**, then play the result in **Save Video**.\\n\\nTo try a short piece first, drag the right end of the bar under the player in Load Video.\\n\\nA long video needs no more graphics memory than a short one. A large result is made in tiles, so it fits the memory you have and takes longer.\\n\\nNeeds AusBoss nodes 2.24.0 or newer. No other pack is needed.\", \"models\": [{\"name\": \"flashvsr_v1.1_fp16.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"3.5 GB\", \"url\": \"https://huggingface.co/ausboss/FlashVSR-v1.1-ComfyUI/resolve/main/flashvsr_v1.1_fp16.safetensors\", \"note\": \"FlashVSR v1.1 by Junhao Zhuang and the OpenImagingLab team, in one file\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_FlashVSRUpscale\"}], \"links\": [{\"label\": \"YouTube · ausbossdev\", \"url\": \"https://www.youtube.com/@ausbossdev\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}",
|
||||
"ausboss_workflow_note_panel": ""
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "AUSBOSS_NODES_LoadVideo",
|
||||
"pos": [
|
||||
500,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
420,
|
||||
760
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "video",
|
||||
"type": "COMBO",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "video"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "start_seconds",
|
||||
"type": "FLOAT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "start_seconds"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "end_seconds",
|
||||
"type": "FLOAT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "end_seconds"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "custom_width",
|
||||
"type": "INT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "custom_width"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "custom_height",
|
||||
"type": "INT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "custom_height"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "every_nth",
|
||||
"type": "INT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "every_nth"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "max_frames",
|
||||
"type": "INT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "max_frames"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "single_frame",
|
||||
"type": "BOOLEAN",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "single_frame"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "upload",
|
||||
"type": "IMAGEUPLOAD",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "upload"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "frames",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "audio",
|
||||
"type": "AUDIO",
|
||||
"links": [
|
||||
3
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "frame_count",
|
||||
"type": "INT",
|
||||
"links": []
|
||||
},
|
||||
{
|
||||
"name": "fps",
|
||||
"type": "FLOAT",
|
||||
"links": [
|
||||
4
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "INT",
|
||||
"links": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "INT",
|
||||
"links": []
|
||||
},
|
||||
{
|
||||
"name": "duration",
|
||||
"type": "FLOAT",
|
||||
"links": []
|
||||
},
|
||||
{
|
||||
"name": "video",
|
||||
"type": "VIDEO",
|
||||
"links": []
|
||||
}
|
||||
],
|
||||
"title": "Load Video - Your video",
|
||||
"properties": {
|
||||
"cnr_id": "ausboss-nodes",
|
||||
"ver": "2.24.0",
|
||||
"Node name for S&R": "AUSBOSS_NODES_LoadVideo",
|
||||
"ausboss_load_video_loop": true
|
||||
},
|
||||
"widgets_values": {
|
||||
"video": "",
|
||||
"start_seconds": 0,
|
||||
"end_seconds": 0,
|
||||
"custom_width": 0,
|
||||
"custom_height": 0,
|
||||
"every_nth": 1,
|
||||
"max_frames": 0,
|
||||
"single_frame": false
|
||||
},
|
||||
"widgets_values_named": {
|
||||
"video": "",
|
||||
"start_seconds": 0,
|
||||
"end_seconds": 0,
|
||||
"custom_width": 0,
|
||||
"custom_height": 0,
|
||||
"every_nth": 1,
|
||||
"max_frames": 0,
|
||||
"single_frame": false,
|
||||
"upload": "image",
|
||||
"ausboss_widget_card": "",
|
||||
"ausboss_load_video_viewer": ""
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"type": "AUSBOSS_NODES_FlashVSRUpscale",
|
||||
"pos": [
|
||||
980,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
360,
|
||||
190
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "frames",
|
||||
"type": "IMAGE",
|
||||
"link": 1
|
||||
},
|
||||
{
|
||||
"name": "vae",
|
||||
"type": "VAE",
|
||||
"shape": 7,
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"name": "model",
|
||||
"type": "COMBO",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "model"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "scale",
|
||||
"type": "FLOAT",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "scale"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "color_match",
|
||||
"type": "BOOLEAN",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "color_match"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "frames",
|
||||
"type": "IMAGE",
|
||||
"links": [
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"title": "FlashVSR Upscale",
|
||||
"properties": {
|
||||
"cnr_id": "ausboss-nodes",
|
||||
"ver": "2.24.0",
|
||||
"Node name for S&R": "AUSBOSS_NODES_FlashVSRUpscale",
|
||||
"models": [
|
||||
{
|
||||
"name": "flashvsr_v1.1_fp16.safetensors",
|
||||
"url": "https://huggingface.co/ausboss/FlashVSR-v1.1-ComfyUI/resolve/main/flashvsr_v1.1_fp16.safetensors",
|
||||
"directory": "diffusion_models"
|
||||
}
|
||||
]
|
||||
},
|
||||
"widgets_values": [
|
||||
"flashvsr_v1.1_fp16.safetensors",
|
||||
2,
|
||||
true,
|
||||
""
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"model": "flashvsr_v1.1_fp16.safetensors",
|
||||
"scale": 2,
|
||||
"color_match": true,
|
||||
"ausboss_widget_card": ""
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"type": "AUSBOSS_NODES_SaveVideo",
|
||||
"pos": [
|
||||
1400,
|
||||
80
|
||||
],
|
||||
"size": [
|
||||
440,
|
||||
640
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "frames",
|
||||
"type": "IMAGE",
|
||||
"link": 2
|
||||
},
|
||||
{
|
||||
"name": "audio",
|
||||
"type": "AUDIO",
|
||||
"link": 3
|
||||
},
|
||||
{
|
||||
"name": "video",
|
||||
"type": "VIDEO",
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"name": "fps",
|
||||
"type": "FLOAT",
|
||||
"link": 4
|
||||
},
|
||||
{
|
||||
"name": "filename_prefix",
|
||||
"type": "STRING",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "filename_prefix"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "crf",
|
||||
"type": "INT",
|
||||
"link": null
|
||||
},
|
||||
{
|
||||
"name": "format",
|
||||
"type": "COMBO",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "format"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pingpong",
|
||||
"type": "BOOLEAN",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "pingpong"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "save_metadata",
|
||||
"type": "BOOLEAN",
|
||||
"link": null,
|
||||
"widget": {
|
||||
"name": "save_metadata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "file_path",
|
||||
"type": "STRING",
|
||||
"links": []
|
||||
}
|
||||
],
|
||||
"title": "Save Video",
|
||||
"properties": {
|
||||
"cnr_id": "ausboss-nodes",
|
||||
"ver": "2.24.0",
|
||||
"Node name for S&R": "AUSBOSS_NODES_SaveVideo",
|
||||
"ausboss_save_video_loop": true
|
||||
},
|
||||
"widgets_values": {
|
||||
"fps": 24,
|
||||
"filename_prefix": "flashvsr_upscaled",
|
||||
"crf": 19,
|
||||
"format": "mp4 h264",
|
||||
"pingpong": false,
|
||||
"save_metadata": true
|
||||
},
|
||||
"widgets_values_named": {
|
||||
"fps": 24,
|
||||
"filename_prefix": "flashvsr_upscaled",
|
||||
"crf": 19,
|
||||
"format": "mp4 h264",
|
||||
"pingpong": false,
|
||||
"save_metadata": true,
|
||||
"ausboss_widget_card": "",
|
||||
"ausboss_save_video_viewer": ""
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"type": "AUSBOSS_NODES_RunTimer",
|
||||
"pos": [
|
||||
1515,
|
||||
770
|
||||
],
|
||||
"size": [
|
||||
210,
|
||||
67
|
||||
],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"title": "Run Timer",
|
||||
"properties": {
|
||||
"cnr_id": "ausboss-nodes",
|
||||
"ver": "2.24.0",
|
||||
"Node name for S&R": "AUSBOSS_NODES_RunTimer"
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
[
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
2,
|
||||
3,
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
"IMAGE"
|
||||
],
|
||||
[
|
||||
3,
|
||||
2,
|
||||
1,
|
||||
4,
|
||||
1,
|
||||
"AUDIO"
|
||||
],
|
||||
[
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
"FLOAT"
|
||||
]
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "1 · Your video",
|
||||
"bounding": [
|
||||
480,
|
||||
0,
|
||||
460,
|
||||
880
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "2 · Make it larger",
|
||||
"bounding": [
|
||||
960,
|
||||
0,
|
||||
400,
|
||||
880
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "3 · Result",
|
||||
"bounding": [
|
||||
1380,
|
||||
0,
|
||||
480,
|
||||
880
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"subgraphs": []
|
||||
},
|
||||
"config": {},
|
||||
"extra": {
|
||||
"ds": {
|
||||
"scale": 0.73,
|
||||
"offset": [
|
||||
137,
|
||||
20
|
||||
]
|
||||
},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
950,
|
||||
310
|
||||
],
|
||||
"linkIds": [
|
||||
3,
|
||||
4
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1370,
|
||||
310
|
||||
],
|
||||
"linkIds": [
|
||||
3,
|
||||
4
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 3,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"parentId": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -1706,7 +1706,7 @@
|
||||
"type": "SetLatentNoiseMask",
|
||||
"pos": [
|
||||
20,
|
||||
354
|
||||
398
|
||||
],
|
||||
"size": [
|
||||
460,
|
||||
@@ -1947,7 +1947,7 @@
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
1100,
|
||||
304
|
||||
338
|
||||
],
|
||||
"size": [
|
||||
460,
|
||||
@@ -2325,7 +2325,7 @@
|
||||
0,
|
||||
0,
|
||||
500,
|
||||
428
|
||||
470
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -2349,7 +2349,7 @@
|
||||
1080,
|
||||
0,
|
||||
500,
|
||||
586
|
||||
620
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -2361,7 +2361,7 @@
|
||||
1620,
|
||||
0,
|
||||
500,
|
||||
529
|
||||
620
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -2446,7 +2446,8 @@
|
||||
"origin_slot": 0,
|
||||
"target_id": 11,
|
||||
"target_slot": 0,
|
||||
"type": "CONDITIONING"
|
||||
"type": "CONDITIONING",
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 34,
|
||||
@@ -2553,7 +2554,19 @@
|
||||
"type": "IMAGE"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1060,
|
||||
540
|
||||
],
|
||||
"linkIds": [
|
||||
33
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2566,7 +2579,92 @@
|
||||
20
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1040,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
14
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1580,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
14
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
1580,
|
||||
325
|
||||
],
|
||||
"linkIds": [
|
||||
4
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"pos": [
|
||||
1562,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"pos": [
|
||||
1580,
|
||||
425
|
||||
],
|
||||
"linkIds": [
|
||||
11
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"pos": [
|
||||
1604,
|
||||
400
|
||||
],
|
||||
"linkIds": [
|
||||
12
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 14,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"parentId": 3
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"parentId": 4
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"parentId": 5
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"parentId": 6
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
|
||||
@@ -1913,7 +1913,7 @@
|
||||
"The painted area, grown a little, is filled with flat gray, so Krea 2 knows where to paint. The plain crop goes along too."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "The painted area, grown a little, is filled with flat gray. Krea 2 never sees what you are replacing."
|
||||
"text": "The painted area, grown a little, is filled with flat gray, so Krea 2 knows where to paint. The plain crop goes along too."
|
||||
},
|
||||
"color": "#1f2c38",
|
||||
"bgcolor": "#2a3b4a"
|
||||
@@ -2769,7 +2769,7 @@
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
1100,
|
||||
546
|
||||
646
|
||||
],
|
||||
"size": [
|
||||
460,
|
||||
@@ -3052,7 +3052,7 @@
|
||||
"The gray-filled crop is the reference. Painting starts from the plain crop, inside the noise mask: the painted area, widened by 24 px."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "The gray-filled crop is the reference. The noise mask is the grown painted area, widened by 24 px. Krea 2 paints only inside it."
|
||||
"text": "The gray-filled crop is the reference. Painting starts from the plain crop, inside the noise mask: the painted area, widened by 24 px."
|
||||
},
|
||||
"color": "#1f2c38",
|
||||
"bgcolor": "#2a3b4a"
|
||||
@@ -3088,8 +3088,8 @@
|
||||
"id": 37,
|
||||
"type": "Reroute",
|
||||
"pos": [
|
||||
1100,
|
||||
450
|
||||
1082,
|
||||
510
|
||||
],
|
||||
"size": [
|
||||
75,
|
||||
@@ -3150,7 +3150,7 @@
|
||||
"id": 47,
|
||||
"type": "Reroute",
|
||||
"pos": [
|
||||
1200,
|
||||
1118,
|
||||
450
|
||||
],
|
||||
"size": [
|
||||
@@ -3214,7 +3214,7 @@
|
||||
1080,
|
||||
0,
|
||||
500,
|
||||
828
|
||||
928
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -3226,7 +3226,7 @@
|
||||
1620,
|
||||
0,
|
||||
500,
|
||||
529
|
||||
600
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -3466,7 +3466,8 @@
|
||||
"type": "FLOAT"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3479,7 +3480,117 @@
|
||||
96
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
964,
|
||||
350
|
||||
],
|
||||
"linkIds": [
|
||||
70
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"pos": [
|
||||
976,
|
||||
410
|
||||
],
|
||||
"linkIds": [
|
||||
79
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
952,
|
||||
860
|
||||
],
|
||||
"linkIds": [
|
||||
71
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"parentId": 3,
|
||||
"pos": [
|
||||
964,
|
||||
430
|
||||
],
|
||||
"linkIds": [
|
||||
71
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"pos": [
|
||||
1556,
|
||||
420
|
||||
],
|
||||
"linkIds": [
|
||||
73
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"pos": [
|
||||
1576,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
74
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"pos": [
|
||||
955,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
42
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"parentId": 7,
|
||||
"pos": [
|
||||
1564,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
42
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 70,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 79,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 71,
|
||||
"parentId": 4
|
||||
},
|
||||
{
|
||||
"id": 73,
|
||||
"parentId": 5
|
||||
},
|
||||
{
|
||||
"id": 74,
|
||||
"parentId": 6
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"parentId": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2183,7 +2183,7 @@
|
||||
1080,
|
||||
0,
|
||||
500,
|
||||
529
|
||||
600
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -2375,7 +2375,8 @@
|
||||
"type": "MASK"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2388,7 +2389,78 @@
|
||||
20
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
950,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1462,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
1468,
|
||||
325
|
||||
],
|
||||
"linkIds": [
|
||||
43
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"pos": [
|
||||
1444,
|
||||
475
|
||||
],
|
||||
"linkIds": [
|
||||
50
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"pos": [
|
||||
1468,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
51
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 31,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"parentId": 3
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
"parentId": 4
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"parentId": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -612,7 +612,7 @@
|
||||
"type": "2f8cb72f-ebab-4ed9-bb0c-328a4e6493d9",
|
||||
"pos": [
|
||||
1020,
|
||||
238
|
||||
380
|
||||
],
|
||||
"size": [
|
||||
240,
|
||||
@@ -2139,10 +2139,10 @@
|
||||
"title": "Note",
|
||||
"properties": {},
|
||||
"widgets_values": [
|
||||
"Blend in fades the model's picture into yours just inside its edge, with no tone shift. The new area stays as painted."
|
||||
"Blend in fades the model's picture into yours just inside its edge. Tone match is fully on, so the new area is adjusted to your picture's tone."
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"text": "Blend in fades the model's picture into yours just inside its edge, with no tone shift. The new area stays as painted."
|
||||
"text": "Blend in fades the model's picture into yours just inside its edge. Tone match is fully on, so the new area is adjusted to your picture's tone."
|
||||
},
|
||||
"color": "#1f2c38",
|
||||
"bgcolor": "#2a3b4a"
|
||||
@@ -2180,7 +2180,7 @@
|
||||
1080,
|
||||
0,
|
||||
500,
|
||||
529
|
||||
600
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -2372,7 +2372,8 @@
|
||||
"type": "MASK"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2385,7 +2386,131 @@
|
||||
20
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
950,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1580,
|
||||
188
|
||||
],
|
||||
"linkIds": [
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
968,
|
||||
900
|
||||
],
|
||||
"linkIds": [
|
||||
48
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"parentId": 3,
|
||||
"pos": [
|
||||
984,
|
||||
350
|
||||
],
|
||||
"linkIds": [
|
||||
48
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"pos": [
|
||||
1564,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
50
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"pos": [
|
||||
1596,
|
||||
400
|
||||
],
|
||||
"linkIds": [
|
||||
51
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"pos": [
|
||||
955,
|
||||
182
|
||||
],
|
||||
"linkIds": [
|
||||
44
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"pos": [
|
||||
955,
|
||||
194
|
||||
],
|
||||
"linkIds": [
|
||||
45
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"pos": [
|
||||
955,
|
||||
206
|
||||
],
|
||||
"linkIds": [
|
||||
46
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 31,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 48,
|
||||
"parentId": 4
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
"parentId": 5
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"parentId": 6
|
||||
},
|
||||
{
|
||||
"id": 44,
|
||||
"parentId": 7
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
"parentId": 8
|
||||
},
|
||||
{
|
||||
"id": 46,
|
||||
"parentId": 9
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -2785,7 +2785,7 @@
|
||||
1080,
|
||||
0,
|
||||
500,
|
||||
719
|
||||
780
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {}
|
||||
@@ -2990,7 +2990,8 @@
|
||||
"origin_slot": 0,
|
||||
"target_id": 19,
|
||||
"target_slot": 0,
|
||||
"type": "CONDITIONING"
|
||||
"type": "CONDITIONING",
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 147,
|
||||
@@ -2998,7 +2999,8 @@
|
||||
"origin_slot": 1,
|
||||
"target_id": 19,
|
||||
"target_slot": 1,
|
||||
"type": "CONDITIONING"
|
||||
"type": "CONDITIONING",
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 148,
|
||||
@@ -3065,7 +3067,29 @@
|
||||
"type": "FLOAT"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1080,
|
||||
900
|
||||
],
|
||||
"linkIds": [
|
||||
146
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"pos": [
|
||||
1090,
|
||||
900
|
||||
],
|
||||
"linkIds": [
|
||||
147
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3078,7 +3102,53 @@
|
||||
25
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1508,
|
||||
325
|
||||
],
|
||||
"linkIds": [
|
||||
63
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"pos": [
|
||||
1476,
|
||||
475
|
||||
],
|
||||
"linkIds": [
|
||||
59
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
1508,
|
||||
400
|
||||
],
|
||||
"linkIds": [
|
||||
60
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 63,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 59,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 60,
|
||||
"parentId": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -1280,7 +1280,36 @@
|
||||
60
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1464,
|
||||
205
|
||||
],
|
||||
"linkIds": [
|
||||
5
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1924,
|
||||
205
|
||||
],
|
||||
"linkIds": [
|
||||
5
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 5,
|
||||
"parentId": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
|
||||
@@ -1135,7 +1135,64 @@
|
||||
60
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1504,
|
||||
205
|
||||
],
|
||||
"linkIds": [
|
||||
5
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1964,
|
||||
205
|
||||
],
|
||||
"linkIds": [
|
||||
5
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
1508,
|
||||
441
|
||||
],
|
||||
"linkIds": [
|
||||
2
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"pos": [
|
||||
1516,
|
||||
451
|
||||
],
|
||||
"linkIds": [
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 5,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 3
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"parentId": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -1679,7 +1679,8 @@
|
||||
"origin_slot": 0,
|
||||
"target_id": 72,
|
||||
"target_slot": 1,
|
||||
"type": "IMAGE"
|
||||
"type": "IMAGE",
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
@@ -1706,7 +1707,19 @@
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1048,
|
||||
676
|
||||
],
|
||||
"linkIds": [
|
||||
6
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fe7eddff-ee33-40d2-98aa-e25b894fc34e",
|
||||
@@ -2713,7 +2726,8 @@
|
||||
"origin_slot": 4,
|
||||
"target_id": 66,
|
||||
"target_slot": 2,
|
||||
"type": "AUSBOSS_STITCHER"
|
||||
"type": "AUSBOSS_STITCHER",
|
||||
"parentId": 4
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
@@ -2729,7 +2743,8 @@
|
||||
"origin_slot": 0,
|
||||
"target_id": 68,
|
||||
"target_slot": 1,
|
||||
"type": "IMAGE"
|
||||
"type": "IMAGE",
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
@@ -2780,7 +2795,51 @@
|
||||
"type": "STRING"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
522,
|
||||
248
|
||||
],
|
||||
"linkIds": [
|
||||
29
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1600,
|
||||
248
|
||||
],
|
||||
"linkIds": [
|
||||
29
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
522,
|
||||
262
|
||||
],
|
||||
"linkIds": [
|
||||
27
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"parentId": 3,
|
||||
"pos": [
|
||||
1600,
|
||||
262
|
||||
],
|
||||
"linkIds": [
|
||||
27
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2793,7 +2852,53 @@
|
||||
27
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1460,
|
||||
360
|
||||
],
|
||||
"linkIds": [
|
||||
35
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"pos": [
|
||||
1444,
|
||||
500
|
||||
],
|
||||
"linkIds": [
|
||||
40
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
1476,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
41
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 35,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 40,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 41,
|
||||
"parentId": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -37,10 +37,10 @@
|
||||
"Node name for S&R": "AUSBOSS_NODES_WorkflowNote"
|
||||
},
|
||||
"widgets_values": [
|
||||
"{\"v\": 1, \"title\": \"Qwen Image 2.1 Inpaint\", \"subtitle\": \"Click a thing in your picture and say what to change. Only that part is repainted.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"1. Load your image. You can crop it right there with the blue handles.\\n2. On **Mask by Touch**, click the thing you want to change. It lights up before you click.\\n3. In **What to change**, say it the way you would ask a person: \\\"Replace the cup with a glass of orange juice.\\\"\\n4. Press **Run**.\\n\\nOnly the picked part is repainted. Everything outside it stays your own picture.\\n\\n### Tips\\n- Wrong thing picked? The arrows under the picture swap it for the next thing it could mean.\\n- Name everything that should go: \\\"the iced coffee and its straw\\\". What you do not name can stay.\\n- To remove something, pick it and write \\\"Remove the cup.\\\" Pick its shadow too, or the shadow stays.\\n- To add something, switch to **Paint** and paint where it should go, with some room. Say how big: \\\"Add small black sunglasses on her eyes.\\\"\\n- Not what you wanted? Run it again. The seed changes each run.\\n\\n### Switches\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA from the list below. Off: 25 steps without it, about twice as long.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.12.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"sam3.1_multiplex_fp16.safetensors\", \"dir\": \"checkpoints\", \"size\": \"1.75 GB\", \"url\": \"https://huggingface.co/Comfy-Org/sam3.1/resolve/main/checkpoints/sam3.1_multiplex_fp16.safetensors\", \"note\": \"by Meta, packaged by Comfy-Org\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"optional, for Fast · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_MaskByTouch\"}], \"links\": [{\"label\": \"YouTube · this workflow\", \"url\": \"https://youtu.be/iMgaiXoB0v4\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
"{\"v\": 1, \"title\": \"Qwen Image 2.1 Inpaint\", \"subtitle\": \"Click a thing in your picture and say what to change. Only that part is repainted.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"1. Load your image. You can crop it right there with the blue handles.\\n2. On **Mask by Touch**, click the thing you want to change. It lights up before you click.\\n3. In **What to change**, say it the way you would ask a person: \\\"Replace the cup with a glass of orange juice.\\\"\\n4. Press **Run**.\\n\\nOnly the picked part is repainted. Everything outside it stays your own picture.\\n\\n### Tips\\n- Wrong thing picked? The arrows under the picture swap it for the next thing it could mean.\\n- Name everything that should go: \\\"the iced coffee and its straw\\\". What you do not name can stay.\\n- To remove something, pick it and write \\\"Remove the cup.\\\" Pick its shadow too, or the shadow stays.\\n- To add something, switch to **Paint** and paint where it should go, with some room. Say how big: \\\"Add small black sunglasses on her eyes.\\\"\\n- Not what you wanted? Change **Seed** and run it again. It stays fixed between runs.\\n\\n### Switches\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA from the list below. Off: 25 steps without it, about twice as long.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.12.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"sam3.1_multiplex_fp16.safetensors\", \"dir\": \"checkpoints\", \"size\": \"1.75 GB\", \"url\": \"https://huggingface.co/Comfy-Org/sam3.1/resolve/main/checkpoints/sam3.1_multiplex_fp16.safetensors\", \"note\": \"by Meta, packaged by Comfy-Org\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"optional, for Fast · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_MaskByTouch\"}], \"links\": [{\"label\": \"YouTube · this workflow\", \"url\": \"https://youtu.be/iMgaiXoB0v4\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"note": "{\"v\": 1, \"title\": \"Qwen Image 2.1 Inpaint\", \"subtitle\": \"Click a thing in your picture and say what to change. Only that part is repainted.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"1. Load your image. You can crop it right there with the blue handles.\\n2. On **Mask by Touch**, click the thing you want to change. It lights up before you click.\\n3. In **What to change**, say it the way you would ask a person: \\\"Replace the cup with a glass of orange juice.\\\"\\n4. Press **Run**.\\n\\nOnly the picked part is repainted. Everything outside it stays your own picture.\\n\\n### Tips\\n- Wrong thing picked? The arrows under the picture swap it for the next thing it could mean.\\n- Name everything that should go: \\\"the iced coffee and its straw\\\". What you do not name can stay.\\n- To remove something, pick it and write \\\"Remove the cup.\\\" Pick its shadow too, or the shadow stays.\\n- To add something, switch to **Paint** and paint where it should go, with some room. Say how big: \\\"Add small black sunglasses on her eyes.\\\"\\n- Not what you wanted? Run it again. The seed changes each run.\\n\\n### Switches\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA from the list below. Off: 25 steps without it, about twice as long.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.12.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"sam3.1_multiplex_fp16.safetensors\", \"dir\": \"checkpoints\", \"size\": \"1.75 GB\", \"url\": \"https://huggingface.co/Comfy-Org/sam3.1/resolve/main/checkpoints/sam3.1_multiplex_fp16.safetensors\", \"note\": \"by Meta, packaged by Comfy-Org\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"optional, for Fast · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_MaskByTouch\"}], \"links\": [{\"label\": \"YouTube · this workflow\", \"url\": \"https://youtu.be/iMgaiXoB0v4\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
"note": "{\"v\": 1, \"title\": \"Qwen Image 2.1 Inpaint\", \"subtitle\": \"Click a thing in your picture and say what to change. Only that part is repainted.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"1. Load your image. You can crop it right there with the blue handles.\\n2. On **Mask by Touch**, click the thing you want to change. It lights up before you click.\\n3. In **What to change**, say it the way you would ask a person: \\\"Replace the cup with a glass of orange juice.\\\"\\n4. Press **Run**.\\n\\nOnly the picked part is repainted. Everything outside it stays your own picture.\\n\\n### Tips\\n- Wrong thing picked? The arrows under the picture swap it for the next thing it could mean.\\n- Name everything that should go: \\\"the iced coffee and its straw\\\". What you do not name can stay.\\n- To remove something, pick it and write \\\"Remove the cup.\\\" Pick its shadow too, or the shadow stays.\\n- To add something, switch to **Paint** and paint where it should go, with some room. Say how big: \\\"Add small black sunglasses on her eyes.\\\"\\n- Not what you wanted? Change **Seed** and run it again. It stays fixed between runs.\\n\\n### Switches\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA from the list below. Off: 25 steps without it, about twice as long.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.12.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"sam3.1_multiplex_fp16.safetensors\", \"dir\": \"checkpoints\", \"size\": \"1.75 GB\", \"url\": \"https://huggingface.co/Comfy-Org/sam3.1/resolve/main/checkpoints/sam3.1_multiplex_fp16.safetensors\", \"note\": \"by Meta, packaged by Comfy-Org\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"optional, for Fast · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_MaskByTouch\"}], \"links\": [{\"label\": \"YouTube · this workflow\", \"url\": \"https://youtu.be/iMgaiXoB0v4\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
@@ -1025,7 +1025,7 @@
|
||||
"type": "AUSBOSS_NODES_LoraLoader",
|
||||
"pos": [
|
||||
2288,
|
||||
1040.0
|
||||
1290
|
||||
],
|
||||
"size": [
|
||||
440,
|
||||
@@ -2005,9 +2005,9 @@
|
||||
"title": "3 · Models",
|
||||
"bounding": [
|
||||
1968,
|
||||
960.0,
|
||||
960,
|
||||
780,
|
||||
500.0
|
||||
540
|
||||
],
|
||||
"color": "#1d5560",
|
||||
"flags": {
|
||||
@@ -2550,7 +2550,7 @@
|
||||
"type": "Reroute",
|
||||
"pos": [
|
||||
560,
|
||||
676.0
|
||||
640
|
||||
],
|
||||
"size": [
|
||||
75,
|
||||
@@ -2587,8 +2587,8 @@
|
||||
"id": 25,
|
||||
"type": "Reroute",
|
||||
"pos": [
|
||||
560,
|
||||
772.0
|
||||
580,
|
||||
784
|
||||
],
|
||||
"size": [
|
||||
75,
|
||||
@@ -3094,7 +3094,8 @@
|
||||
"origin_slot": 0,
|
||||
"target_id": 26,
|
||||
"target_slot": 3,
|
||||
"type": "LATENT"
|
||||
"type": "LATENT",
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
@@ -3241,7 +3242,19 @@
|
||||
"type": "IMAGE"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1060,
|
||||
640
|
||||
],
|
||||
"linkIds": [
|
||||
25
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f03669a3-61c2-44c8-ad63-bad928a695fa",
|
||||
@@ -3828,7 +3841,8 @@
|
||||
"type": "MASK"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3841,7 +3855,106 @@
|
||||
60
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
954,
|
||||
36
|
||||
],
|
||||
"linkIds": [
|
||||
46,
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1945,
|
||||
36
|
||||
],
|
||||
"linkIds": [
|
||||
46,
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"parentId": 2,
|
||||
"pos": [
|
||||
2768,
|
||||
36
|
||||
],
|
||||
"linkIds": [
|
||||
31
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"pos": [
|
||||
2768,
|
||||
300
|
||||
],
|
||||
"linkIds": [
|
||||
45
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"parentId": 4,
|
||||
"pos": [
|
||||
3208,
|
||||
300
|
||||
],
|
||||
"linkIds": [
|
||||
45
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"pos": [
|
||||
956,
|
||||
1030
|
||||
],
|
||||
"linkIds": [
|
||||
2
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"pos": [
|
||||
962,
|
||||
980
|
||||
],
|
||||
"linkIds": [
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 46,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 31,
|
||||
"parentId": 3
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
"parentId": 5
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 6
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"parentId": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -37,10 +37,10 @@
|
||||
"ver": "2.9.0"
|
||||
},
|
||||
"widgets_values": [
|
||||
"{\"v\": 1, \"title\": \"Qwen Image 2.1 Upscale + Restore\", \"subtitle\": \"Load a small, soft or worn picture. Qwen Image 2.1 redraws it sharp at the megapixels you set, in its own colors.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your image. You can crop it right there with the blue handles.\\n2. Set **Megapixels**: the size of the result.\\n3. Press **Run**.\\n4. Slide **Before and after** to compare. The result is saved as a PNG.\\n\\n### What you get\\n\\n- Your picture redrawn sharp, at the size you asked for.\\n- Its own colors, also on a noisy or faded photo.\\n\\n### Megapixels\\n\\n- Up to about 2: one pass.\\n- Over that: redrawn in tiles of about 2 megapixels and joined. 4 takes two tiles, 8 takes four.\\n- A small picture is redrawn at up to 8 times its own megapixels, then enlarged the plain way.\\n- A picture of 1 megapixel or more only looks better when it grows about 1.6 times per side.\\n\\n### Switches\\n\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA. Off: 25 steps without it, about three times as long.\\n\\n### Tips\\n\\n- It is a redraw. Fine detail is made up to fit, so a face stays the same person, not the same pixels.\\n- Small lettering on signs and labels can come back misspelled.\\n- Each tile is matched to your picture's colors. To let Qwen's own colors through, lower **Keep colors** inside the box.\\n- If the run stops at a red **LoRA Loader**, a LoRA that is switched on is missing. Download it from the list below.\\n- Not tested on blur from a moving camera or missed focus.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.9.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"qwen-image-2.1-restore.safetensors\", \"dir\": \"loras\", \"size\": \"159 MB\", \"url\": \"https://huggingface.co/ausboss/Qwen-Image-2.1-Restore-LoRA/resolve/main/qwen-image-2.1-restore.safetensors\", \"note\": \"keeps the result close to your picture\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"for Fast on · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_TiledUpscale\"}], \"links\": [{\"label\": \"YouTube · ausbossdev\", \"url\": \"https://www.youtube.com/@ausbossdev\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
"{\"v\": 1, \"title\": \"Qwen Image 2.1 Upscale + Restore\", \"subtitle\": \"Load a small, soft or worn picture. Qwen Image 2.1 redraws it sharp at the megapixels you set, in its own colors.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your image. You can crop it right there with the blue handles.\\n2. Set **Megapixels**: the size of the result.\\n3. Press **Run**.\\n4. Slide **Before and after** to compare. The result is saved as a PNG.\\n\\n### What you get\\n\\n- Your picture redrawn sharp, at the size you asked for.\\n- Its own colors, also on a noisy or faded photo.\\n\\n### Megapixels\\n\\n- Up to about 2: one pass.\\n- Over that: redrawn in tiles of about 2 megapixels and joined. 4 takes two tiles, 8 takes four.\\n- The redraw limit for a small picture is 8 times its own megapixels or one roughly 2 megapixel tile, whichever is larger. The rest is enlarged the plain way.\\n- A picture of 1 megapixel or more only looks better when it grows about 1.6 times per side.\\n\\n### Switches\\n\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA. Off: 25 steps without it, about three times as long.\\n\\n### Tips\\n\\n- It is a redraw. Fine detail is made up to fit, so a face stays the same person, not the same pixels.\\n- Small lettering on signs and labels can come back misspelled.\\n- Each tile is matched to your picture's colors. To let Qwen's own colors through, lower **Keep colors** inside the box.\\n- If the run stops at a red **LoRA Loader**, a LoRA that is switched on is missing. Download it from the list below.\\n- Not tested on blur from a moving camera or missed focus.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.9.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"qwen-image-2.1-restore.safetensors\", \"dir\": \"loras\", \"size\": \"159 MB\", \"url\": \"https://huggingface.co/ausboss/Qwen-Image-2.1-Restore-LoRA/resolve/main/qwen-image-2.1-restore.safetensors\", \"note\": \"keeps the result close to your picture\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"for Fast on · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_TiledUpscale\"}], \"links\": [{\"label\": \"YouTube · ausbossdev\", \"url\": \"https://www.youtube.com/@ausbossdev\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
],
|
||||
"widgets_values_named": {
|
||||
"note": "{\"v\": 1, \"title\": \"Qwen Image 2.1 Upscale + Restore\", \"subtitle\": \"Load a small, soft or worn picture. Qwen Image 2.1 redraws it sharp at the megapixels you set, in its own colors.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your image. You can crop it right there with the blue handles.\\n2. Set **Megapixels**: the size of the result.\\n3. Press **Run**.\\n4. Slide **Before and after** to compare. The result is saved as a PNG.\\n\\n### What you get\\n\\n- Your picture redrawn sharp, at the size you asked for.\\n- Its own colors, also on a noisy or faded photo.\\n\\n### Megapixels\\n\\n- Up to about 2: one pass.\\n- Over that: redrawn in tiles of about 2 megapixels and joined. 4 takes two tiles, 8 takes four.\\n- A small picture is redrawn at up to 8 times its own megapixels, then enlarged the plain way.\\n- A picture of 1 megapixel or more only looks better when it grows about 1.6 times per side.\\n\\n### Switches\\n\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA. Off: 25 steps without it, about three times as long.\\n\\n### Tips\\n\\n- It is a redraw. Fine detail is made up to fit, so a face stays the same person, not the same pixels.\\n- Small lettering on signs and labels can come back misspelled.\\n- Each tile is matched to your picture's colors. To let Qwen's own colors through, lower **Keep colors** inside the box.\\n- If the run stops at a red **LoRA Loader**, a LoRA that is switched on is missing. Download it from the list below.\\n- Not tested on blur from a moving camera or missed focus.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.9.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"qwen-image-2.1-restore.safetensors\", \"dir\": \"loras\", \"size\": \"159 MB\", \"url\": \"https://huggingface.co/ausboss/Qwen-Image-2.1-Restore-LoRA/resolve/main/qwen-image-2.1-restore.safetensors\", \"note\": \"keeps the result close to your picture\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"for Fast on · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_TiledUpscale\"}], \"links\": [{\"label\": \"YouTube · ausbossdev\", \"url\": \"https://www.youtube.com/@ausbossdev\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
"note": "{\"v\": 1, \"title\": \"Qwen Image 2.1 Upscale + Restore\", \"subtitle\": \"Load a small, soft or worn picture. Qwen Image 2.1 redraws it sharp at the megapixels you set, in its own colors.\", \"author\": \"AusBoss\", \"layout\": \"card\", \"accent\": \"\", \"body\": \"[▶ AusBoss on YouTube](https://www.youtube.com/@ausbossdev) · videos on these nodes and workflows\\n\\n---\\n\\n1. Load your image. You can crop it right there with the blue handles.\\n2. Set **Megapixels**: the size of the result.\\n3. Press **Run**.\\n4. Slide **Before and after** to compare. The result is saved as a PNG.\\n\\n### What you get\\n\\n- Your picture redrawn sharp, at the size you asked for.\\n- Its own colors, also on a noisy or faded photo.\\n\\n### Megapixels\\n\\n- Up to about 2: one pass.\\n- Over that: redrawn in tiles of about 2 megapixels and joined. 4 takes two tiles, 8 takes four.\\n- The redraw limit for a small picture is 8 times its own megapixels or one roughly 2 megapixel tile, whichever is larger. The rest is enlarged the plain way.\\n- A picture of 1 megapixel or more only looks better when it grows about 1.6 times per side.\\n\\n### Switches\\n\\n- **Fast** on: 8 steps with the Viggle Turbo LoRA. Off: 25 steps without it, about three times as long.\\n\\n### Tips\\n\\n- It is a redraw. Fine detail is made up to fit, so a face stays the same person, not the same pixels.\\n- Small lettering on signs and labels can come back misspelled.\\n- Each tile is matched to your picture's colors. To let Qwen's own colors through, lower **Keep colors** inside the box.\\n- If the run stops at a red **LoRA Loader**, a LoRA that is switched on is missing. Download it from the list below.\\n- Not tested on blur from a moving camera or missed focus.\\n\\nNeeds ComfyUI 0.38 or newer and AusBoss nodes 2.9.0 or newer (update first).\", \"models\": [{\"name\": \"qwen_image_2.1_int8_convrot.safetensors\", \"dir\": \"diffusion_models\", \"size\": \"7.26 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen3vl_8b_int8_convrot.safetensors\", \"dir\": \"text_encoders\", \"size\": \"9.35 GB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors\", \"note\": \"\"}, {\"name\": \"qwen_image_2.1_vae_bf16.safetensors\", \"dir\": \"vae\", \"size\": \"676 MB\", \"url\": \"https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors\", \"note\": \"\"}, {\"name\": \"qwen-image-2.1-restore.safetensors\", \"dir\": \"loras\", \"size\": \"159 MB\", \"url\": \"https://huggingface.co/ausboss/Qwen-Image-2.1-Restore-LoRA/resolve/main/qwen-image-2.1-restore.safetensors\", \"note\": \"keeps the result close to your picture\"}, {\"name\": \"Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"dir\": \"loras\", \"size\": \"680 MB\", \"url\": \"https://huggingface.co/Viggle/Qwen-Image-2.1-viggle-turbo/resolve/main/Qwen-Image-2.1-viggle-turbo-v0.3-6step-lora-r128.safetensors\", \"note\": \"for Fast on · Qwen Research License, research use\"}], \"packs\": [{\"name\": \"ComfyUI-AusBoss\", \"url\": \"https://github.com/ausboss/ComfyUI-AusBoss\", \"node\": \"AUSBOSS_NODES_TiledUpscale\"}], \"links\": [{\"label\": \"YouTube · ausbossdev\", \"url\": \"https://www.youtube.com/@ausbossdev\"}, {\"label\": \"GitHub · ausboss\", \"url\": \"https://github.com/ausboss\"}, {\"label\": \"Civitai · AusBoss\", \"url\": \"https://civitai.com/user/AusBoss\"}, {\"label\": \"X · Zanzibased\", \"url\": \"https://x.com/Zanzibased\"}]}"
|
||||
},
|
||||
"color": "#14424d",
|
||||
"bgcolor": "#161f21"
|
||||
@@ -921,8 +921,8 @@
|
||||
"id": 11,
|
||||
"type": "AUSBOSS_NODES_LoraLoader",
|
||||
"pos": [
|
||||
1808,
|
||||
608
|
||||
1468,
|
||||
1072
|
||||
],
|
||||
"size": [
|
||||
400,
|
||||
@@ -2021,7 +2021,7 @@
|
||||
"type": "Reroute",
|
||||
"pos": [
|
||||
560,
|
||||
394
|
||||
430
|
||||
],
|
||||
"size": [
|
||||
75,
|
||||
@@ -2059,7 +2059,7 @@
|
||||
"type": "Reroute",
|
||||
"pos": [
|
||||
560,
|
||||
460
|
||||
360
|
||||
],
|
||||
"size": [
|
||||
75,
|
||||
@@ -2096,11 +2096,11 @@
|
||||
"id": 20,
|
||||
"type": "KSampler",
|
||||
"pos": [
|
||||
560,
|
||||
640,
|
||||
546
|
||||
],
|
||||
"size": [
|
||||
460,
|
||||
380,
|
||||
262
|
||||
],
|
||||
"flags": {},
|
||||
@@ -2607,7 +2607,8 @@
|
||||
"type": "IMAGE"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2620,7 +2621,64 @@
|
||||
60
|
||||
]
|
||||
},
|
||||
"frontendVersion": "1.53.6"
|
||||
"frontendVersion": "1.53.6",
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
1428,
|
||||
210
|
||||
],
|
||||
"linkIds": [
|
||||
21
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
2248,
|
||||
210
|
||||
],
|
||||
"linkIds": [
|
||||
21
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
1820,
|
||||
400
|
||||
],
|
||||
"linkIds": [
|
||||
27
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"pos": [
|
||||
1860,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
28
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 21,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 27,
|
||||
"parentId": 3
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"parentId": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1816,7 +1816,8 @@
|
||||
"type": "IMAGE"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
},
|
||||
{
|
||||
"id": "a988ba93-208b-4af3-b721-61365d1292ac",
|
||||
@@ -2612,7 +2613,8 @@
|
||||
"type": "IMAGE"
|
||||
}
|
||||
],
|
||||
"extra": {}
|
||||
"extra": {},
|
||||
"reroutes": []
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2624,7 +2626,111 @@
|
||||
137,
|
||||
20
|
||||
]
|
||||
}
|
||||
},
|
||||
"reroutes": [
|
||||
{
|
||||
"id": 1,
|
||||
"pos": [
|
||||
940,
|
||||
34
|
||||
],
|
||||
"linkIds": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"parentId": 1,
|
||||
"pos": [
|
||||
1420,
|
||||
34
|
||||
],
|
||||
"linkIds": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"pos": [
|
||||
940,
|
||||
38
|
||||
],
|
||||
"linkIds": [
|
||||
13
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"parentId": 3,
|
||||
"pos": [
|
||||
1780,
|
||||
38
|
||||
],
|
||||
"linkIds": [
|
||||
13
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"pos": [
|
||||
940,
|
||||
42
|
||||
],
|
||||
"linkIds": [
|
||||
14
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"parentId": 5,
|
||||
"pos": [
|
||||
1780,
|
||||
42
|
||||
],
|
||||
"linkIds": [
|
||||
14
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"pos": [
|
||||
934,
|
||||
450
|
||||
],
|
||||
"linkIds": [
|
||||
15
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"parentId": 7,
|
||||
"pos": [
|
||||
942,
|
||||
700
|
||||
],
|
||||
"linkIds": [
|
||||
15
|
||||
]
|
||||
}
|
||||
],
|
||||
"linkExtensions": [
|
||||
{
|
||||
"id": 1,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"parentId": 4
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"parentId": 6
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"parentId": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
// App mode for nodes with cards: the simple form view shows a real control
|
||||
// for each field instead of an empty row. The logic is in
|
||||
// js/shared/app_mode.mjs; this file watches which mode the open workflow is
|
||||
// in and hands the fields over.
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { APP_MODE, appFields, createAppModeSync, formHostSelector, workflowMode } from "../shared/app_mode.mjs";
|
||||
|
||||
const sync = createAppModeSync({
|
||||
find(nodeId, name) {
|
||||
const graph = app.rootGraph ?? app.graph;
|
||||
const node = graph?.getNodeById?.(/^\d+$/.test(nodeId) ? Number(nodeId) : nodeId);
|
||||
const widget = node?.widgets?.find((entry) => entry.name === name);
|
||||
return widget ? { node, widget } : null;
|
||||
},
|
||||
changed(node) {
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
},
|
||||
});
|
||||
|
||||
function findWidget(nodeId, name) {
|
||||
const graph = app.rootGraph ?? app.graph;
|
||||
const node = graph?.getNodeById?.(/^\d+$/.test(nodeId) ? Number(nodeId) : nodeId);
|
||||
return node?.widgets?.find((entry) => entry.name === name) ?? null;
|
||||
}
|
||||
|
||||
// A DOM widget the form lists goes into its row, and back again if the
|
||||
// graph's widget layer took it (see formHostSelector). Rows mount whenever
|
||||
// the form draws, which can be well after the mode changes, so while a
|
||||
// workflow is in App mode the page is watched and an empty row is filled
|
||||
// on the next frame.
|
||||
function rehomeDomWidgets() {
|
||||
const workflow = app.extensionManager?.workflow?.activeWorkflow;
|
||||
if (workflowMode(workflow) !== APP_MODE) return;
|
||||
for (const { nodeId, widget: name } of appFields((app.rootGraph ?? app.graph)?.extra?.linearData)) {
|
||||
const element = findWidget(nodeId, name)?.element;
|
||||
if (!(element instanceof HTMLElement)) continue;
|
||||
const host = document.querySelector(formHostSelector(nodeId, name));
|
||||
if (!host || host.contains(element)) continue;
|
||||
// Something that keeps taking it back: stop rather than fight.
|
||||
const now = Date.now();
|
||||
moves = moves.filter((at) => now - at < 3000);
|
||||
if (moves.length >= 30) return;
|
||||
moves.push(now);
|
||||
host.replaceChildren(element);
|
||||
}
|
||||
}
|
||||
|
||||
let moves = [];
|
||||
let watcher = null;
|
||||
let framed = false;
|
||||
function watchForm(on) {
|
||||
if (!on) {
|
||||
watcher?.disconnect();
|
||||
watcher = null;
|
||||
return;
|
||||
}
|
||||
if (!watcher) {
|
||||
watcher = new MutationObserver(() => {
|
||||
if (framed) return;
|
||||
framed = true;
|
||||
requestAnimationFrame(() => {
|
||||
framed = false;
|
||||
try { rehomeDomWidgets(); } catch (error) { console.warn("[AusBoss] App mode fields:", error); }
|
||||
});
|
||||
});
|
||||
watcher.observe(document.body, { childList: true, subtree: true });
|
||||
}
|
||||
rehomeDomWidgets();
|
||||
}
|
||||
|
||||
let queued = false;
|
||||
// After the current task: a card hides its widgets in a microtask once the
|
||||
// node has loaded, and the form's fields are shown after that.
|
||||
function schedule() {
|
||||
if (queued) return;
|
||||
queued = true;
|
||||
setTimeout(() => {
|
||||
queued = false;
|
||||
try {
|
||||
const workflow = app.extensionManager?.workflow?.activeWorkflow;
|
||||
const mode = workflowMode(workflow);
|
||||
sync(mode, (app.rootGraph ?? app.graph)?.extra?.linearData);
|
||||
watchForm(mode === APP_MODE);
|
||||
} catch (error) {
|
||||
console.warn("[AusBoss] App mode fields:", error);
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "ausboss.app.mode",
|
||||
setup() {
|
||||
app.extensionManager?.workflow?.$subscribe?.(schedule);
|
||||
},
|
||||
afterConfigureGraph() {
|
||||
schedule();
|
||||
},
|
||||
});
|
||||
+28
-14
@@ -23,6 +23,7 @@ import { openInfoCard } from "../shared/settings_menu.mjs";
|
||||
|
||||
const SETTING_ID = "AusBoss.Appearance.NodeColor";
|
||||
const CUSTOM_SETTING_ID = "AusBoss.Appearance.CustomColor";
|
||||
const COLOR_OVERRIDE = "ausbossColor";
|
||||
|
||||
// Stored bare (no "#") to match the color setting's storage contract.
|
||||
const DEFAULT_CUSTOM_COLOR = "00b4aa";
|
||||
@@ -40,6 +41,7 @@ let activeCustomColor = DEFAULT_CUSTOM_COLOR;
|
||||
let activeCustomTitle = normalizeHexColor(DEFAULT_CUSTOM_COLOR);
|
||||
|
||||
function setActiveCustomColor(value) {
|
||||
if (!normalizeHexColor(value)) return;
|
||||
activeCustomColor = value;
|
||||
activeCustomTitle = normalizeHexColor(value);
|
||||
}
|
||||
@@ -56,6 +58,7 @@ function applyScheme(node, colors) {
|
||||
function repaintAll(next, previous) {
|
||||
for (const node of collectGraphNodes(app.graph)) {
|
||||
if (!isAusbossNode(node)) continue;
|
||||
if (Object.hasOwn(node.properties ?? {}, COLOR_OVERRIDE)) continue;
|
||||
if (!shouldRecolor(node, previous)) continue;
|
||||
applyScheme(node, next);
|
||||
}
|
||||
@@ -149,8 +152,8 @@ app.registerExtension({
|
||||
},
|
||||
getNodeMenuItems(node) {
|
||||
if (!isAusbossNode(node)) return [];
|
||||
// A title-less node has no bar for the "?" badge; its card opens here.
|
||||
const about = isTitleless(node)
|
||||
// Vue nodes skip the canvas badge callbacks; title-less nodes have no bar.
|
||||
const about = isTitleless(node) || globalThis.LiteGraph?.vueNodesMode === true
|
||||
? [{ content: "About this node", callback: () => openHelpCard(node, null) }]
|
||||
: [];
|
||||
return [
|
||||
@@ -162,12 +165,14 @@ app.registerExtension({
|
||||
options: SCHEME_NAMES.map((name) => ({
|
||||
content: name,
|
||||
callback: () => {
|
||||
// A menu pick writes the colors directly; shouldRecolor then
|
||||
// treats them as the user's choice during setting sweeps.
|
||||
// Keep an explicit choice, including no colors, through saves
|
||||
// and setting changes. Custom stores the pair picked today.
|
||||
const colors = schemeColors(name, activeCustomColor);
|
||||
// Custom with an unusable stored color resolves to null, which
|
||||
// would wrongly read as "Theme default" — do nothing instead.
|
||||
if (name === CUSTOM_SCHEME && !colors) return;
|
||||
node.properties ??= {};
|
||||
node.properties[COLOR_OVERRIDE] = colors ? { ...colors } : null;
|
||||
applyScheme(node, colors);
|
||||
app.graph?.setDirtyCanvas?.(true, true);
|
||||
},
|
||||
@@ -179,16 +184,26 @@ app.registerExtension({
|
||||
nodeCreated(node) {
|
||||
if (!isAusbossNode(node)) return;
|
||||
installHelpBadge(node);
|
||||
// Colors restored from a saved workflow (and manual picks) land before
|
||||
// this hook runs — an already-colored node is left alone, unless it
|
||||
// wears a retired flagship pair: those colors were ours, so the node
|
||||
// upgrades to the active scheme instead of keeping them forever.
|
||||
if ((node.color || node.bgcolor) && !wearsLegacyScheme(node)) return;
|
||||
const colors = schemeColors(activeScheme, activeCustomColor);
|
||||
if (colors) applyScheme(node, colors);
|
||||
restoreAppearance(node);
|
||||
// Construction precedes saved fields; reload, paste and undo restore
|
||||
// their colors and properties before this callback runs.
|
||||
chainCallback(node, "onConfigure", function (saved) {
|
||||
restoreAppearance(this, saved);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
function restoreAppearance(node, saved) {
|
||||
if (Object.hasOwn(node.properties ?? {}, COLOR_OVERRIDE)) {
|
||||
// A later pick in ComfyUI's own color menu is saved in the native fields.
|
||||
if (saved?.color || saved?.bgcolor) return;
|
||||
applyScheme(node, node.properties[COLOR_OVERRIDE]);
|
||||
return;
|
||||
}
|
||||
if ((node.color || node.bgcolor) && !wearsLegacyScheme(node)) return;
|
||||
applyScheme(node, schemeColors(activeScheme, activeCustomColor));
|
||||
}
|
||||
|
||||
function isTitleless(node) {
|
||||
return (node.title_mode ?? node.constructor?.title_mode) === (globalThis.LiteGraph?.NO_TITLE ?? 1);
|
||||
}
|
||||
@@ -204,9 +219,8 @@ function openHelpCard(node, event) {
|
||||
});
|
||||
}
|
||||
|
||||
// Every AusBoss node gets a quiet "?" in the title bar; clicking it opens a
|
||||
// card built from the node's own DESCRIPTION and tooltips, so the docs on
|
||||
// screen are exactly the docs in the source.
|
||||
// Classic nodes get a quiet "?" in the title bar. Vue nodes open the same
|
||||
// card from their context menu. Its text comes from DESCRIPTION and tooltips.
|
||||
function installHelpBadge(node) {
|
||||
// A title-less node (Run Timer) has no bar to hang the badge on; its
|
||||
// card opens from the node's context menu instead.
|
||||
|
||||
+20
-1
@@ -49,6 +49,25 @@ function askForReload(installed) {
|
||||
}
|
||||
}
|
||||
|
||||
// "2.26.2" -> [2, 26, 2]. Anything else, such as "unknown", is null.
|
||||
function parseVersion(version) {
|
||||
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(typeof version === "string" ? version : "");
|
||||
return match ? match.slice(1).map(Number) : null;
|
||||
}
|
||||
|
||||
// Only a server newer than the page means this tab runs old files. The page
|
||||
// is newer when the Manager switched the pack on disk and the page was
|
||||
// reloaded before ComfyUI restarted, and then a restart is what is needed.
|
||||
// Two version numbers cannot tell that apart from a downgrade with the tab
|
||||
// left open, which needs a reload, so in that case the guard says nothing.
|
||||
function serverIsNewer(installed, running) {
|
||||
const server = parseVersion(installed);
|
||||
const page = parseVersion(running);
|
||||
if (!server || !page) return false;
|
||||
const step = server.findIndex((part, index) => part !== page[index]);
|
||||
return step >= 0 && server[step] > page[step];
|
||||
}
|
||||
|
||||
// The installed version this page already asked a reload for. A server that
|
||||
// drops and comes back several times must not stack the same message.
|
||||
let asked = null;
|
||||
@@ -58,7 +77,7 @@ async function check() {
|
||||
try {
|
||||
const installed = (await (await api.fetchApi("/ausboss/pack_version")).json())?.version;
|
||||
const running = await runningVersion();
|
||||
if (!installed || installed === "unknown" || !running || installed === running || installed === asked) return;
|
||||
if (!serverIsNewer(installed, running) || installed === asked) return;
|
||||
asked = installed;
|
||||
const listing = await (await api.fetchApi("/ausboss/pack_modules")).json();
|
||||
await refreshModules(Array.isArray(listing?.modules) ? listing.modules : []);
|
||||
|
||||
+115
-23
@@ -13,10 +13,12 @@ import { BRAND, chainCallback, keepDomWidgetWidthAuto } from "../shared/index.mj
|
||||
import {
|
||||
ARROW_ANGLE,
|
||||
ARROW_CHOICES,
|
||||
CARD_TEMPLATE,
|
||||
DOUBLE_ARROWS,
|
||||
arrowText,
|
||||
fitFontSize,
|
||||
parseBlocks,
|
||||
parseCard,
|
||||
pastedLink,
|
||||
repointLinks,
|
||||
targetId,
|
||||
@@ -45,6 +47,10 @@ const LINK_TILES = {
|
||||
youtube: { label: "Watch Me on YouTube", url: "https://www.youtube.com/@ausbossdev" },
|
||||
discord: { label: "Join for Help or More Workflows", url: "https://discord.gg/RwVxY9Fuaj" },
|
||||
};
|
||||
// A new Info card opens at this size, which shows its starter text whole.
|
||||
const CARD_SIZE = [300, 230];
|
||||
// The card's text grows with the node like a note's, but a card stays a card.
|
||||
const CARD_FONT_MAX = 20;
|
||||
const FRAME_FILL = 0.8; // the share of the view a node brought into view takes, as in Workflow Switches
|
||||
const FONT = '"IBM Plex Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif';
|
||||
|
||||
@@ -81,6 +87,20 @@ ${TILE_FACE_CSS}
|
||||
.ausboss-callout-card[data-tile] .ausboss-callout-url svg{width:36px;height:28px;flex:none}
|
||||
.ausboss-callout-card[data-tile] .ausboss-callout-out{margin-left:auto}
|
||||
.ausboss-callout-card[data-tile] .ausboss-callout-tools{right:27px;}
|
||||
.ausboss-callout-card[data-card]{background:#111818;border:1px solid #2e3c3b;}
|
||||
.ausboss-callout-card[data-card] .ausboss-callout-inner{padding:.8em 1em;color:#d9e4e3;font-weight:400;line-height:1.45;}
|
||||
.ausboss-callout-card[data-card] b{color:#f2f7f6;font-weight:650;}
|
||||
.ausboss-callout-block{margin:0 0 .85em;}
|
||||
.ausboss-callout-block:last-child{margin-bottom:0;}
|
||||
.ausboss-callout-block>*+*{margin-top:.3em;}
|
||||
.ausboss-callout-title{display:flex;align-items:center;gap:.4em;color:#f2f7f6;font-size:1.08em;font-weight:650;}
|
||||
.ausboss-callout-icon{flex:none;width:1em;height:1em;color:#c9d6d4;}
|
||||
.ausboss-callout-icon svg{display:block;width:100%;height:100%;}
|
||||
.ausboss-callout-row{display:flex;justify-content:space-between;align-items:baseline;gap:1em;}
|
||||
.ausboss-callout-row>span:last-child{flex:none;text-align:right;white-space:nowrap;}
|
||||
.ausboss-callout-row.is-mark,.ausboss-callout-row.is-mark b{color:#6fe0d6;font-weight:500;}
|
||||
.ausboss-card-small,.ausboss-card-small b{color:#93a6a4;}
|
||||
.ausboss-card-small{font-size:.92em;}
|
||||
.ausboss-callout-empty{color:#6f8987;font-size:14px;font-weight:400;}
|
||||
.ausboss-callout-arrow{display:inline-block;width:1.2em;height:1.2em;margin:0 .1em;vertical-align:-.26em;filter:drop-shadow(0 0 .3em rgba(0,180,170,.55));}
|
||||
.ausboss-callout-arrow svg{display:block;width:100%;height:100%;overflow:visible;}
|
||||
@@ -154,6 +174,25 @@ function arrowIcon(kind) {
|
||||
return root;
|
||||
}
|
||||
|
||||
// The small line icons an Info card's title can start with.
|
||||
const CARD_ICON_PATHS = {
|
||||
clock: ["M12 7v5l3.2 2"],
|
||||
info: ["M12 11v6", "M12 7.6v.01"],
|
||||
warning: ["M12 3.5 2.8 19.5h18.4Z", "M12 10v4", "M12 16.9v.01"],
|
||||
tip: ["M9.5 18h5", "M10.5 21h3", "M12 3a6 6 0 0 0-3.6 10.8c.7.6 1.1 1.3 1.1 2.2h5c0-.9.4-1.6 1.1-2.2A6 6 0 0 0 12 3Z"],
|
||||
check: ["M8 12.4l2.8 2.8 5.2-5.6"],
|
||||
};
|
||||
const CARD_ICON_RING = new Set(["clock", "info", "check"]);
|
||||
|
||||
function cardIcon(kind) {
|
||||
const span = el("span", "ausboss-callout-icon");
|
||||
const root = svg("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" });
|
||||
if (CARD_ICON_RING.has(kind)) root.append(svg("circle", { cx: 12, cy: 12, r: 9 }));
|
||||
for (const d of CARD_ICON_PATHS[kind] ?? []) root.append(svg("path", { d }));
|
||||
span.append(root);
|
||||
return span;
|
||||
}
|
||||
|
||||
// The node a link names, looked up in the graph the note sits in.
|
||||
function linkedNode(state, id) {
|
||||
const graph = state.node.graph ?? app.graph;
|
||||
@@ -262,17 +301,79 @@ function bringIntoView(target) {
|
||||
}
|
||||
}
|
||||
|
||||
// One line's pieces into an element. The pieces of one link sit in one
|
||||
// element; a link that leaves ComfyUI ends with a small ↗.
|
||||
function appendPieces(state, into, line) {
|
||||
let run = null;
|
||||
let wrap = null;
|
||||
const close = () => {
|
||||
if (wrap?.classList.contains("ausboss-callout-url")) wrap.append(el("span", "ausboss-callout-out", "↗"));
|
||||
};
|
||||
for (const piece of line) {
|
||||
if (piece.run !== run) {
|
||||
close();
|
||||
run = piece.run;
|
||||
wrap = run === undefined ? null : linkRun(state, piece);
|
||||
if (wrap) into.append(wrap);
|
||||
}
|
||||
const target = wrap ?? into;
|
||||
if (piece.arrow) target.append(arrowSpan(state, piece.arrow, piece));
|
||||
else target.append(piece.bold ? el("b", "", piece.text) : document.createTextNode(piece.text));
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
// An Info card: a title, rows of label and value, and small print.
|
||||
function renderCard(state, blocks) {
|
||||
for (const lines of blocks) {
|
||||
const block = el("div", "ausboss-callout-block");
|
||||
for (const line of lines) {
|
||||
let row;
|
||||
if (line.kind === "title") {
|
||||
row = el("div", "ausboss-callout-title");
|
||||
if (line.icon) row.append(cardIcon(line.icon));
|
||||
const words = el("span");
|
||||
appendPieces(state, words, line.pieces);
|
||||
row.append(words);
|
||||
} else if (line.kind === "row") {
|
||||
row = el("div", `ausboss-callout-row${line.highlight ? " is-mark" : ""}`);
|
||||
for (const cell of line.cells) {
|
||||
const side = el("span");
|
||||
appendPieces(state, side, cell);
|
||||
row.append(side);
|
||||
}
|
||||
} else {
|
||||
row = el("div", "ausboss-card-text");
|
||||
appendPieces(state, row, line.pieces);
|
||||
}
|
||||
if (line.small) row.classList.add("ausboss-card-small");
|
||||
block.append(row);
|
||||
}
|
||||
state.inner.append(block);
|
||||
}
|
||||
}
|
||||
|
||||
function renderText(state) {
|
||||
const style = state.node.properties?.ausbossCalloutTile;
|
||||
if (["youtube","discord","title"].includes(style)) state.card.dataset.tile = style;
|
||||
else delete state.card.dataset.tile;
|
||||
setTileFace(state.node, state.root, Boolean(state.card.dataset.tile), () => startEdit(state));
|
||||
const blocks = parseBlocks(state.valueWidget.value);
|
||||
// An Info card has no title bar, like a tile, but keeps the full editor
|
||||
// and saves as a plain Callout: an older pack shows its text as a note.
|
||||
if (style === "card") state.card.dataset.card = "";
|
||||
else delete state.card.dataset.card;
|
||||
const isCard = style === "card";
|
||||
setTileFace(state.node, state.root, Boolean(state.card.dataset.tile) || isCard, () => startEdit(state));
|
||||
const blocks = isCard ? parseCard(state.valueWidget.value) : parseBlocks(state.valueWidget.value);
|
||||
state.inner.replaceChildren();
|
||||
state.empty = blocks.length === 0;
|
||||
if (state.empty) {
|
||||
state.inner.append(el("div", "ausboss-callout-empty", "Double-click to write a note"));
|
||||
}
|
||||
if (isCard) {
|
||||
renderCard(state, blocks);
|
||||
fit(state);
|
||||
return;
|
||||
}
|
||||
for (const lines of blocks) {
|
||||
const point = el("div", "ausboss-callout-point");
|
||||
lines.forEach((line, index) => {
|
||||
@@ -280,21 +381,7 @@ function renderText(state) {
|
||||
// lines are told apart by a break, as before; a block needs none.
|
||||
const into = line.small ? el("div", "ausboss-callout-small") : point;
|
||||
if (index && !line.small && !lines[index - 1].small) point.append(document.createElement("br"));
|
||||
let run = null;
|
||||
let wrap = null;
|
||||
for (const piece of line) {
|
||||
// The pieces of one link sit in one element.
|
||||
if (piece.run !== run) {
|
||||
if (wrap?.classList.contains("ausboss-callout-url")) wrap.append(el("span", "ausboss-callout-out", "↗"));
|
||||
run = piece.run;
|
||||
wrap = run === undefined ? null : linkRun(state, piece);
|
||||
if (wrap) into.append(wrap);
|
||||
}
|
||||
const target = wrap ?? into;
|
||||
if (piece.arrow) target.append(arrowSpan(state, piece.arrow, piece));
|
||||
else target.append(piece.bold ? el("b", "", piece.text) : document.createTextNode(piece.text));
|
||||
}
|
||||
if (wrap?.classList.contains("ausboss-callout-url")) wrap.append(el("span", "ausboss-callout-out", "↗"));
|
||||
appendPieces(state, into, line);
|
||||
if (line.small) point.append(into);
|
||||
});
|
||||
state.inner.append(point);
|
||||
@@ -364,7 +451,7 @@ function fit(state) {
|
||||
inner.style.fontSize = `${px}px`;
|
||||
return inner.offsetHeight <= height && inner.scrollWidth <= width + 1;
|
||||
};
|
||||
const size = fitFontSize(fits);
|
||||
const size = fitFontSize(fits, undefined, card.dataset.card === undefined ? undefined : CARD_FONT_MAX);
|
||||
const social = card.dataset.tile === "youtube" || card.dataset.tile === "discord";
|
||||
inner.style.fontSize = `${social ? Math.min(size, 16) : size}px`;
|
||||
}
|
||||
@@ -453,7 +540,9 @@ function startEdit(state) {
|
||||
const wrap = el("div", "ausboss-callout-editor");
|
||||
const area = el("textarea", "ausboss-callout-edit");
|
||||
area.value = state.valueWidget.value ?? "";
|
||||
area.placeholder = "One idea per paragraph. **Bold** a word to stress it. The buttons below add an arrow, make a line small or make words a link.";
|
||||
area.placeholder = state.card.dataset.card === undefined
|
||||
? "One idea per paragraph. **Bold** a word to stress it. The buttons below add an arrow, make a line small or make words a link."
|
||||
: "The first line is the title. Write label | value for a row. **Bold** a whole row to make it teal. Small makes a line small print.";
|
||||
area.spellcheck = true;
|
||||
const bar = el("div", "ausboss-callout-arrowbar");
|
||||
bar.append(el("span", "", "Arrow"));
|
||||
@@ -560,7 +649,6 @@ function startEdit(state) {
|
||||
if (event.target !== area) event.preventDefault();
|
||||
});
|
||||
wrap.addEventListener("pointerdown", (event) => event.stopPropagation());
|
||||
wrap.addEventListener("wheel", (event) => event.stopPropagation(), { passive: true });
|
||||
// Clicking another node on the canvas takes the keyboard from the text box.
|
||||
// That is how the link is picked, so the edit stays open then; a click on
|
||||
// empty canvas, or on the note itself, ends it.
|
||||
@@ -687,7 +775,7 @@ app.registerExtension({
|
||||
const state = buildPanel(this);
|
||||
if (!state) return;
|
||||
renderText(state);
|
||||
if (state.card.dataset.tile && Number.isFinite(saved?.size?.[1])) {
|
||||
if ((state.card.dataset.tile || state.card.dataset.card !== undefined) && Number.isFinite(saved?.size?.[1])) {
|
||||
this.setSize?.([this.size[0], saved.size[1]]);
|
||||
}
|
||||
});
|
||||
@@ -699,14 +787,18 @@ app.registerExtension({
|
||||
chainCallback(nodeType.prototype, "getExtraMenuOptions", function (_canvas, options) {
|
||||
const state = this.__ausbossCallout;
|
||||
if (!state || !Array.isArray(options)) return;
|
||||
for (const [style, label] of [["plain","Plain callout"],["title","Title tile"],["youtube","Set YouTube link tile"],["discord","Set Discord link tile"]]) {
|
||||
for (const [style, label] of [["plain","Plain callout"],["card","Info card"],["title","Title tile"],["youtube","Set YouTube link tile"],["discord","Set Discord link tile"]]) {
|
||||
options.unshift({ content: label, callback: () => {
|
||||
this.properties ??= {};
|
||||
this.properties.ausbossCalloutTile = style;
|
||||
const preset = LINK_TILES[style];
|
||||
if (preset) commitWidgetValue(this, state.valueWidget, `[${preset.label}](${preset.url})`, app.canvas);
|
||||
// An empty card starts with text that shows how one is written.
|
||||
const starter = style === "card" && !String(state.valueWidget.value ?? "").trim();
|
||||
if (starter) commitWidgetValue(this, state.valueWidget, CARD_TEMPLATE, app.canvas);
|
||||
renderText(state);
|
||||
if (style !== "plain") this.setSize?.([this.size[0], style === "title" ? 86 : 78]);
|
||||
if (starter) this.setSize?.([Math.max(this.size[0], CARD_SIZE[0]), CARD_SIZE[1]]);
|
||||
else if (style !== "plain" && style !== "card") this.setSize?.([this.size[0], style === "title" ? 86 : 78]);
|
||||
markChanged();
|
||||
}});
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// zooming stopped over Compare, the crop previews, the video viewers and every
|
||||
// control on a card. One listener here hands those gestures back, the same way
|
||||
// ComfyUI does for its own text boxes. A panel that wants the wheel for itself
|
||||
// (a scrolling list, a focused text field, an editor) still keeps it.
|
||||
// (a scrolling list, a long text box) keeps it while it can still scroll.
|
||||
//
|
||||
// A file dragged in from the desktop, or a picture's card from the Assets
|
||||
// panel, has the same problem in the classic renderer: dropped on a node's
|
||||
@@ -14,7 +14,7 @@
|
||||
// under the pointer.
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import {
|
||||
dragCarriesFiles, graphDragStarts, panelHost, panelKeepsWheel, panelNeedsDropHelp, panelRoot,
|
||||
dragCarriesFiles, graphDragStarts, panelHost, panelKeepsWheel, panelNeedsDropHelp, panelRoot, vueBoxKeepsWheel,
|
||||
} from "../shared/canvas_passthrough.mjs";
|
||||
import { showToast } from "../shared/index.mjs";
|
||||
|
||||
@@ -26,12 +26,20 @@ function canvas() {
|
||||
return app.canvas ?? null;
|
||||
}
|
||||
|
||||
// Nodes 2.0 hands every wheel turn over a node to the graph before the node
|
||||
// sees it. This runs first, on the way down: a box of the pack's that can
|
||||
// still scroll keeps the wheel, the event stops here, and the browser
|
||||
// scrolls the box.
|
||||
function onWheelFirst(event) {
|
||||
if (vueBoxKeepsWheel(event.target, event, { styleOf: (el) => getComputedStyle(el) })) event.stopPropagation();
|
||||
}
|
||||
|
||||
function onWheel(event) {
|
||||
const target = event.target;
|
||||
const root = panelRoot(target);
|
||||
const lgCanvas = canvas();
|
||||
if (!root || !lgCanvas || event.defaultPrevented) return;
|
||||
if (panelKeepsWheel(target, event, { root, host: panelHost(target), styleOf: (el) => getComputedStyle(el), activeElement: document.activeElement })) return;
|
||||
if (panelKeepsWheel(target, event, { root, host: panelHost(target), styleOf: (el) => getComputedStyle(el) })) return;
|
||||
event.preventDefault();
|
||||
lgCanvas.processMouseWheel(event);
|
||||
}
|
||||
@@ -128,6 +136,7 @@ app.registerExtension({
|
||||
// The wheel listener sits in the bubble phase so a panel's own handler
|
||||
// (stopPropagation / preventDefault) always gets the first say.
|
||||
window.addEventListener("wheel", onWheel, { passive: false });
|
||||
window.addEventListener("wheel", onWheelFirst, { capture: true, passive: true });
|
||||
window.addEventListener("pointerdown", onPointerDown, true);
|
||||
window.addEventListener("pointermove", onPointerMove, true);
|
||||
window.addEventListener("pointerup", onPointerEnd, true);
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// Clear VRAM 🆎 — a right-click entry on the empty canvas that unloads every
|
||||
// model and frees memory on the ComfyUI server this page is connected to.
|
||||
//
|
||||
// It sends the same request as ComfyUI's own "Unload Models and Execution
|
||||
// Cache" command (top menu, Edit): POST /free with unload_models and
|
||||
// free_memory. That command is not on the right-click menu, so this entry
|
||||
// puts it one click away. A setting hides the entry; a ComfyUI that turns
|
||||
// manual unloading off (Comfy.Memory.AllowManualUnload) hides it too.
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { showToast } from "../shared/index.mjs";
|
||||
|
||||
const SETTING_ID = "AusBoss.Memory.ClearVramMenu";
|
||||
const MENU_LABEL = "Clear VRAM 🆎";
|
||||
|
||||
function setting(id) {
|
||||
return app.ui?.settings?.getSettingValue?.(id);
|
||||
}
|
||||
|
||||
async function clearVram() {
|
||||
try {
|
||||
const response = await api.fetchApi("/free", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ unload_models: true, free_memory: true }),
|
||||
});
|
||||
if (!response.ok) throw new Error(`the server answered ${response.status}`);
|
||||
showToast({ severity: "success", summary: MENU_LABEL, detail: "Models unloaded and memory freed.", life: 3000 });
|
||||
} catch (error) {
|
||||
showToast({ severity: "error", summary: MENU_LABEL, detail: `Could not clear VRAM: ${error?.message ?? error}` });
|
||||
}
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "ausboss.clear.vram",
|
||||
settings: [
|
||||
{
|
||||
id: SETTING_ID,
|
||||
name: "Clear VRAM on the right-click menu",
|
||||
type: "boolean",
|
||||
defaultValue: true,
|
||||
category: ["🆎 AusBoss", "Memory", "Clear VRAM menu"],
|
||||
tooltip:
|
||||
"Right-click the empty canvas for Clear VRAM: it unloads every model and frees "
|
||||
+ "memory on the ComfyUI server. Off hides the entry.",
|
||||
},
|
||||
],
|
||||
getCanvasMenuItems() {
|
||||
if (setting(SETTING_ID) === false) return [];
|
||||
if (setting("Comfy.Memory.AllowManualUnload") === false) return [];
|
||||
return [{ content: MENU_LABEL, callback: clearVram }];
|
||||
},
|
||||
});
|
||||
+62
-10
@@ -14,6 +14,10 @@ import {
|
||||
compareBadges,
|
||||
compareClip,
|
||||
compareResultSide,
|
||||
REST_PROPERTY,
|
||||
savedRestSide,
|
||||
SWITCH_CONTROL_INPUTS,
|
||||
SWITCH_NODE_TYPES,
|
||||
compareSizeLabel,
|
||||
compareSwitchValue,
|
||||
findComparePairs,
|
||||
@@ -182,9 +186,15 @@ function linkView(graph) {
|
||||
const link = lookupLink(graph, linkId);
|
||||
return link ? { id: String(link.origin_id), slot: link.origin_slot } : null;
|
||||
};
|
||||
const inputs = (id) => graph?.getNodeById?.(id)?.inputs ?? [];
|
||||
return {
|
||||
origin,
|
||||
feeds: (id) => (graph?.getNodeById?.(id)?.inputs ?? []).map((input) => origin(input?.link)?.id),
|
||||
feeds: (id) => inputs(id).map((input) => origin(input?.link)?.id),
|
||||
branches(id) {
|
||||
const node = graph?.getNodeById?.(id);
|
||||
if (!SWITCH_NODE_TYPES.has(node?.comfyClass ?? node?.type)) return null;
|
||||
return inputs(id).filter((input) => !SWITCH_CONTROL_INPUTS.has(input?.name)).map((input) => origin(input?.link)?.id);
|
||||
},
|
||||
inside(id) {
|
||||
const subgraph = graph?.getNodeById?.(id)?.subgraph;
|
||||
if (!subgraph) return null;
|
||||
@@ -195,18 +205,40 @@ function linkView(graph) {
|
||||
}
|
||||
|
||||
// Which input holds the result, read from the graph the panel sits in.
|
||||
function resultSide(node) {
|
||||
function guessResultSide(node) {
|
||||
const view = linkView(node.graph);
|
||||
const source = (name) => view.origin(node.inputs?.find((input) => input?.name === name)?.link);
|
||||
return compareResultSide(source("image_a"), source("image_b"), view);
|
||||
}
|
||||
|
||||
// Slide mode rests on the result while the pointer is away.
|
||||
// The picture the panel rests on, saved with the node. A node from a
|
||||
// workflow saved before the choice existed has none: its side is worked out
|
||||
// from the links, as earlier versions did, and held in memory only. Writing
|
||||
// it into the node would mark every older workflow as changed when it opens;
|
||||
// it is written when someone picks a side in the menu.
|
||||
function restSide(node) {
|
||||
const saved = savedRestSide(node.properties?.[REST_PROPERTY]);
|
||||
if (saved) return saved;
|
||||
node.__ausbossRestGuess ??= guessResultSide(node);
|
||||
return node.__ausbossRestGuess;
|
||||
}
|
||||
|
||||
// Slide mode rests on its saved picture while the pointer is away.
|
||||
function showResult(state) {
|
||||
state.fraction = resultSide(state.node) === "B" ? 0 : 1;
|
||||
state.fraction = restSide(state.node) === "B" ? 0 : 1;
|
||||
applyClip(state);
|
||||
}
|
||||
|
||||
// The right-click choice: rest on the other picture from now on.
|
||||
function setRestSide(node, side) {
|
||||
node.properties ??= {};
|
||||
node.properties[REST_PROPERTY] = side;
|
||||
const state = node.__ausbossCompare;
|
||||
if (state && getMode(node) === "slide" && !state.stage.matches(":hover")) showResult(state);
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
notifyAusbossChange();
|
||||
}
|
||||
|
||||
// A click on the mode switch. The mode saves with the workflow; a flip
|
||||
// between A and B within the lock does too, through the side it stores.
|
||||
function pickMode(state, value) {
|
||||
@@ -433,10 +465,11 @@ app.registerExtension({
|
||||
defaultValue: true,
|
||||
category: ["🆎 AusBoss", "Image Compare", "Rest on the result"],
|
||||
tooltip:
|
||||
"While the pointer is away, Image Compare A/B shows the result: "
|
||||
+ "after every run, and again each time the pointer leaves the "
|
||||
+ "picture. Off: it stays on the picture nearest to where the "
|
||||
+ "pointer left, and a new run does not change it.",
|
||||
"While the pointer is away, Image Compare A/B shows the picture it "
|
||||
+ "rests on: B on a new node, or the one picked in the node's "
|
||||
+ "right-click menu. It does after every run, and again each time "
|
||||
+ "the pointer leaves the picture. Off: it stays on the picture "
|
||||
+ "nearest to where the pointer left, and a new run does not change it.",
|
||||
onChange(value) {
|
||||
restOnResult = value !== false;
|
||||
},
|
||||
@@ -454,6 +487,9 @@ app.registerExtension({
|
||||
beforeRegisterNodeDef(nodeType, nodeData) {
|
||||
if (nodeData?.name !== NODE_NAME) return;
|
||||
chainCallback(nodeType.prototype, "onNodeCreated", function () {
|
||||
// A new node rests on B. A loaded one gets its saved side back in onConfigure.
|
||||
this.properties ??= {};
|
||||
this.properties[REST_PROPERTY] = "B";
|
||||
buildPanel(this);
|
||||
// Only for a genuinely new node: onConfigure restores a saved size after
|
||||
// this runs, so a workflow's own dimensions still win.
|
||||
@@ -462,9 +498,14 @@ app.registerExtension({
|
||||
Math.max(DEFAULT_NODE_SIZE[1], this.size?.[1] ?? 0),
|
||||
]);
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onConfigure", function () {
|
||||
chainCallback(nodeType.prototype, "onConfigure", function (info) {
|
||||
const state = this.__ausbossCompare;
|
||||
// Saved before the choice existed: drop the new node's B, so the side
|
||||
// is worked out from the links.
|
||||
if (!savedRestSide(info?.properties?.[REST_PROPERTY])) delete this.properties?.[REST_PROPERTY];
|
||||
this.__ausbossRestGuess = undefined;
|
||||
queueMicrotask(() => {
|
||||
const state = buildPanel(this);
|
||||
if (!state || this.__ausbossCompare !== state || state.abort.signal.aborted) return;
|
||||
state.showingB = this.properties?.ausboss_compare_side === "B";
|
||||
syncErase(state);
|
||||
// The saved paint, if the pictures are already up.
|
||||
@@ -481,8 +522,19 @@ app.registerExtension({
|
||||
if (!pairs.length) setEmpty(state, "Execution finished without compare previews");
|
||||
app.canvas?.setDirty?.(true, true);
|
||||
});
|
||||
// Which picture the panel rests on, kept with the workflow.
|
||||
chainCallback(nodeType.prototype, "getExtraMenuOptions", function (_canvas, options) {
|
||||
if (!Array.isArray(options)) return;
|
||||
const side = restSide(this);
|
||||
const other = side === "A" ? "B" : "A";
|
||||
options.unshift(
|
||||
{ content: `Show ${other} when the pointer is away (now ${side})`, callback: () => setRestSide(this, other) },
|
||||
null,
|
||||
);
|
||||
});
|
||||
// A link on the filename input decides whether the name is typed here.
|
||||
chainCallback(nodeType.prototype, "onConnectionsChange", function () {
|
||||
this.__ausbossRestGuess = undefined; // an older node's side follows its links
|
||||
this.__ausbossCompare?.eraser?.refresh();
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onRemoved", function () {
|
||||
|
||||
@@ -15,7 +15,38 @@ Right-click the Callout and choose **Title tile** to give your existing text a b
|
||||
- Double-click a title to edit it. **Save** or `Ctrl+Enter` keeps the change; **Cancel** or `Esc` leaves the original text.
|
||||
- Drag the visible bottom-right grip to resize. You can also focus the grip and use arrow keys; hold **Shift** for smaller changes. Resizing keeps the tile in place and supports Undo.
|
||||
|
||||
## Writing
|
||||
## Info card
|
||||
|
||||
A small card for facts people look up: run times, settings, what each choice
|
||||
does. Right-click the Callout and choose **Info card**. An empty note starts
|
||||
with sample text that shows each part.
|
||||
|
||||
Write it like this:
|
||||
|
||||
```text
|
||||
⏱️ Too slow?
|
||||
###### Redraw time on an RTX 5090. Smaller cards take longer.
|
||||
|
||||
2x, 18 steps | ~4 min
|
||||
2x, 10 steps | ~3 min
|
||||
1.5x, 18 steps | ~2.5 min
|
||||
**1.5x, 10 steps (default) | ~2 min**
|
||||
|
||||
###### 1.5x is a 4608-wide sheet, 2x is 6144.
|
||||
```
|
||||
|
||||
- The first line is the card's title. Start it with ⏱️ ℹ️ ⚠️ 💡 or ✅ and
|
||||
that emoji is drawn as a small icon.
|
||||
- A line with a `|` in it is a row: the words before the `|` on the left,
|
||||
the rest on the right.
|
||||
- Put the whole row in two stars, `**like this | value**`, and it is drawn
|
||||
in teal. Use it for the default or the one to pick.
|
||||
- Small print (the **Small** button) is a grey line, for a subtitle or a note
|
||||
at the bottom.
|
||||
- A blank line leaves a gap. Arrows and links work as in any callout.
|
||||
- Double-click the card to edit it. Choose **Plain callout** to turn it back
|
||||
into a note; the text stays.
|
||||
|
||||
|
||||
- On a plain callout, double-click the note, or press **Edit**, to type. Click outside the box to
|
||||
keep the text. **Esc** drops what you typed.
|
||||
@@ -90,5 +121,13 @@ In the text a link is written `[the words](https://example.com)`, or
|
||||
it to read the address before you click.
|
||||
- An older version of the pack shows a link as typed, brackets and address
|
||||
included, so the address can still be read and copied there.
|
||||
- An Info card is saved as an ordinary Callout with the text you typed.
|
||||
The card look is a setting on the node, so an older version of the pack
|
||||
shows the same text as a plain note, rows written out as `label | value`.
|
||||
A plain callout never reads `|` as a row, so notes written before look
|
||||
the same.
|
||||
- A row splits at its first `|` that is not inside a link. A row pasted
|
||||
from a Markdown table loses its outer pipes, and the table's `---` line
|
||||
is skipped. An Info card's text grows with the card, up to 20 px.
|
||||
- The font is IBM Plex Sans when the computer has it, otherwise the system
|
||||
font. The node loads no fonts and makes no network requests.
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
Makes one picture's colors match another's. Use it when an inpainted or
|
||||
stitched area comes back a little too warm, cool, dark or bright next to the
|
||||
original. Four methods go from a gentle fix to an exact match, and a
|
||||
first-frame mode matches every frame of a video to its first, which can
|
||||
original. Four methods go from a gentle fix to an exact match. A fifth,
|
||||
**kept**, is for edits whose new part looks too crisp and colourful next to
|
||||
the rest of the picture. A first-frame mode matches every frame of a video to its first, which can
|
||||
reduce color drift between frames.
|
||||
|
||||
## Controls
|
||||
@@ -15,7 +16,7 @@ reduce color drift between frames.
|
||||
inpaint, feed the original image here. A single reference broadcasts
|
||||
across a batch; a matched batch pairs frame to frame. Required unless
|
||||
**Reference** (`reference_mode`) is **first frame**.
|
||||
- **Method** (`method`): How the colors move.
|
||||
- **Method** (`method`): How the colors move. A line under it says what the picked one does.
|
||||
- **lab** — per-channel mean/std shift in LAB. Perceptual and the safe
|
||||
default: corrects overall casts and contrast without shifting
|
||||
individual hues around.
|
||||
@@ -24,6 +25,13 @@ reduce color drift between frames.
|
||||
not just shifted.
|
||||
- **hist** (`histogram`) — matches each channel's distribution exactly.
|
||||
The strongest and least subtle.
|
||||
- **kept** — for an edit, with the picture from before the edit as
|
||||
**reference**. Edit models often hand back the parts they were asked
|
||||
to keep a little darker, with more contrast and colour, so a new sign or
|
||||
word looks pasted on. This method learns that shift from the parts the
|
||||
model kept and undoes it everywhere. New things keep their own colours:
|
||||
green apples that replaced oranges stay green. The reference must be the
|
||||
same size as the image.
|
||||
- **mask** (optional): Restricts the match to the white area — both the
|
||||
statistics measured on the image and where the correction lands. Black
|
||||
pixels pass through **bit-identical**. Reference statistics always come
|
||||
@@ -43,6 +51,11 @@ reduce color drift between frames.
|
||||
|
||||
## Notes
|
||||
|
||||
- For an edit in a box, put **kept** between the model and **Stitch Inpaint
|
||||
🆎**: the model's crop into **image**, Crop For Inpaint's crop into
|
||||
**reference**, its mask into **mask**. The fix is learned and applied
|
||||
inside the box only.
|
||||
|
||||
- The node takes a mask but outputs none on purpose: the mask only scopes
|
||||
the fix and passes through your graph unchanged — wire your original
|
||||
mask onward.
|
||||
|
||||
@@ -20,10 +20,9 @@ middle of a graph without breaking anything downstream.
|
||||
Run the workflow once to load the previews. The switch under the picture
|
||||
picks what the panel does, and its marker slides to your choice:
|
||||
|
||||
- **Slide** (default): the panel shows the result. Move the pointer across
|
||||
it to compare: A appears on the left of the line and B on the right. Move
|
||||
the pointer away and the result is back. Every new run shows its result
|
||||
too.
|
||||
- **Slide** (default): the panel shows B, the result. Move the pointer
|
||||
across it to compare: A appears on the left of the line and B on the
|
||||
right. Move the pointer away and B is back. Every new run shows it too.
|
||||
- **A** / **B**: show that picture and hold it, whatever the pointer does.
|
||||
- **Erase**: mix the two pictures by hand. One picture is on top; paint on
|
||||
it and it rubs away, so the other one shows through. Then save the mix.
|
||||
@@ -132,11 +131,12 @@ Your paint is kept with the workflow. A new run keeps it while the picture
|
||||
keeps its size, so you can change a seed and look again; press **CLEAR**
|
||||
to start over. Pictures of another size start clean.
|
||||
|
||||
## Which picture is the result
|
||||
## Which picture shows when the pointer is away
|
||||
|
||||
B, the "after" picture. If your graph makes A out of B's picture (B is the
|
||||
picture you loaded and A is the edited one), the result is A. To keep one
|
||||
picture up whatever happens, use the **A** or **B** button.
|
||||
B, the "after" picture, on a new node. If your result is wired to A,
|
||||
right-click the node and choose **Show A when the pointer is away**. The
|
||||
choice is saved with the workflow. To keep one picture up whatever the
|
||||
pointer does, use the **A** or **B** button.
|
||||
|
||||
## Outputs
|
||||
|
||||
@@ -152,12 +152,13 @@ network requests are made.
|
||||
## Technical details
|
||||
|
||||
- While sliding, the outer 6% on either side snaps to a full image.
|
||||
- The result is found from the links: when the node that feeds `image_b` is
|
||||
somewhere upstream of the node that feeds `image_a`, A was made from B and
|
||||
A is the result. When both pictures come out of one subgraph, the same
|
||||
check is made inside it. In every other case it is B: two unrelated
|
||||
pictures, both pictures out of one plain node, or a link the node cannot
|
||||
follow (a Set and Get pair, for example).
|
||||
- The side is saved in the node's `ausboss_compare_rest` property. A
|
||||
workflow saved by an earlier version has none, so its side is worked out
|
||||
from the links, the way earlier versions did, until a side is picked in
|
||||
the menu: when A is made from B's picture, A is the result. A switch
|
||||
counts only when it cannot hand on the picture B started from. When both
|
||||
pictures come out of one subgraph, the same check is made inside it. In
|
||||
every other case it is B.
|
||||
- Settings → AusBoss → Image Compare → **Rest on the result** switches this
|
||||
off. The panel then stays on the picture nearest to where the pointer
|
||||
left, and a new run does not change it.
|
||||
|
||||
@@ -110,7 +110,7 @@ parts back.
|
||||
|
||||
## Technical details
|
||||
|
||||
- Starting values: Context `1.2`, Blend `16` px, Multiple `8`; Grow, Blur,
|
||||
- Starting values: Context `1.2`, Blend `16` px, Multiple `32`; Grow, Blur,
|
||||
Extra context, the Target rows and the Extend rows start at `0`.
|
||||
- With no Target size set, the crop is still rounded up to **Multiple**, so
|
||||
with **Stay in picture** on it can still reach a few pixels (at most
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
# Cut Out
|
||||
|
||||
Turns a picture and a mask into a cut-out with a see-through background.
|
||||
Use it to save a subject as a transparent PNG, or to lay it on a new
|
||||
background. It goes after the node that makes the mask, such as Mask by
|
||||
Name or Mask by Touch. In a Qwen Image cut-out workflow, where SAM 3 finds a
|
||||
thing and Qwen paints it out of the picture, Cut Out turns the same mask and
|
||||
the original picture into the transparent PNG.
|
||||
|
||||
**Clean edges** fixes the rim of old background colour that a cut-out
|
||||
usually carries in hair and soft edges, so it sits cleanly on any new
|
||||
background. Parts of the picture that are fully kept stay exactly as they
|
||||
were.
|
||||
|
||||
Save Image keeps the transparency when it saves a PNG (or WebP). JPEG has no
|
||||
transparency, so a JPEG shows the clear parts black.
|
||||
|
||||
The panel under the card shows the cut-out over a checkerboard once the
|
||||
node has run (the first frame for a video). The small **preview** switch at
|
||||
the right of the bar turns it off.
|
||||
|
||||
## Live preview
|
||||
|
||||
Once the node has a picture, the picture on the node redraws while you drag a
|
||||
value, before you queue anything. Run the graph once to give the node its
|
||||
picture (run once to get the picture and the mask); after that it changes as you drag. A small "not run yet" tag
|
||||
shows while the picture is a preview and not a real result.
|
||||
|
||||
The **Fit | 100%** switch sits on the bar above the picture, left of Preview.
|
||||
Fit shows the whole picture. 100% shows real pixels, and dragging on the
|
||||
picture moves around it instead of moving the node. The cut-out shows over a checker, so see-through parts read as see-through.
|
||||
|
||||
|
||||
## Controls
|
||||
|
||||
- **Keep** (`keep`): **white part** keeps what is under the white of the
|
||||
mask, **black part** keeps what is under the black. Pick black part when
|
||||
your mask covers the background rather than the subject.
|
||||
- **Grow** (`grow`): grows the kept part by this many pixels, or shrinks it
|
||||
with a negative number. Shrink by 1 or 2 when a thin line of old
|
||||
background shows around the edge.
|
||||
- **Feather** (`feather`): how soft the edge is, in pixels. `0` keeps the
|
||||
mask's own edge. `1` takes the jagged steps off a hard mask.
|
||||
- **Clean edges** (`clean_edges`): on by default. Works out the subject's
|
||||
own colour where the edge is see-through (hair, fur, motion blur) and
|
||||
puts it back, so the old background does not show as a halo. Turn it off
|
||||
to keep the picture's colours everywhere.
|
||||
|
||||
### Behind **More**
|
||||
|
||||
- **Clear haze** (`clear_haze`): parts this see-through or more become fully
|
||||
clear. Raise it a little (`0.05`) when a faint haze surrounds the cut-out.
|
||||
- **Solid above** (`solid_above`): parts at least this solid become fully
|
||||
solid. Lower it a little (`0.95`) to fill thin see-through spots inside
|
||||
the subject.
|
||||
- **Smooth video** (`smooth_frames`): for a video, blends each frame's edge
|
||||
with this many frames before and after it, which calms an edge that
|
||||
flickers from frame to frame. `0` is off. Keep it low (`1` or `2`) on
|
||||
fast motion, or the edge lags behind the subject.
|
||||
|
||||
### Inputs and outputs
|
||||
|
||||
- **image**: the picture or video frames.
|
||||
- **mask**: what to keep. One mask can cover every frame, or give one per
|
||||
frame. A mask of another size is stretched to the picture.
|
||||
- **image** (output): the cut-out as an RGBA picture with straight (not
|
||||
premultiplied) alpha. If the input already had a transparent background,
|
||||
both are kept.
|
||||
- **alpha** (output): how solid each pixel is, as a mask: white is kept,
|
||||
black is clear. Wire it to any node that wants the final mask.
|
||||
|
||||
## Technical details
|
||||
|
||||
- The alpha is made in a fixed order: pick the white or black part, grow or
|
||||
shrink (whole pixels), feather (a Gaussian blur of that many pixels),
|
||||
average over neighbouring frames, then the levels (Clear haze and Solid
|
||||
above). Values within 0.0001 of solid or clear are made exactly solid or
|
||||
clear.
|
||||
- Clean edges uses blur-fusion foreground estimation (Forte and Pitie,
|
||||
"Approximate Fast Foreground Colour Estimation", ICIP 2021), written in
|
||||
torch for this pack and shared with Mask by Touch's fine edges: around
|
||||
each pixel it averages the subject's colour and the background's from the
|
||||
pixels nearby, corrects the subject's by what the pixel shows, and does
|
||||
this once wide and once narrow. The widths follow the picture's size. It
|
||||
needs no extra package. Pixels with an alpha of exactly 1 keep their
|
||||
original colours to the bit.
|
||||
- Frames are worked on eight at a time.
|
||||
|
||||
### Live preview
|
||||
|
||||
The preview runs the node's own maths in the browser: on a copy shrunk to the
|
||||
size it is shown at in Fit, and on a real-pixel crop of the picture in 100%.
|
||||
It is checked against the Python node on recorded values (`tests/test_live_parity.py`);
|
||||
results agree to within 5e-5 on a 0 to 1 scale. The picture is the one the
|
||||
last run kept, or a Load Image read through ComfyUI's own view route. When
|
||||
the values match the last run, the real result is drawn instead.
|
||||
@@ -0,0 +1,142 @@
|
||||
# Edit Lock
|
||||
|
||||
Keeps every part of your picture that an edit did not change exactly where
|
||||
it was, with the colors it had.
|
||||
|
||||
An edit model redraws the whole picture, also the parts you did not ask it
|
||||
to change. Those parts often come back a little zoomed in, shifted or
|
||||
tinted. Flip between the original and the edit and the whole picture
|
||||
jumps. Edit Lock stops that: only the edit is new.
|
||||
|
||||
It needs no mask. It sees what the edit changes while the picture is being
|
||||
made, and holds on to everything else.
|
||||
|
||||
## Quick start
|
||||
|
||||
1. Put **Edit Lock 🆎** between the model and the sampler: the model (after
|
||||
any LoRA loader) goes in, and its `model` output goes to the sampler or
|
||||
guider.
|
||||
2. Wire the VAE into `vae` and the picture you are editing into `image`.
|
||||
Use the same picture the edit model gets, at the size of the result.
|
||||
3. After the VAE Decode, add **Edit Lock Restore 🆎**. Wire the decoded
|
||||
picture into `image` and Edit Lock's `edit_lock` output into
|
||||
`edit_lock`. This puts your own pixels back in the untouched parts.
|
||||
4. Wire Restore's `report` into **Show Text 🆎** to read how much was kept.
|
||||
|
||||
Run your edit as usual. Prompt, steps and seed stay as they were.
|
||||
|
||||
## What it does with each kind of edit
|
||||
|
||||
- **A local edit** (add glasses, repaint the car, change the sign): the
|
||||
edit happens, and the rest of the picture stays put.
|
||||
- **An edit of the whole picture** (a new style, new light, fog):
|
||||
there is nothing to keep, so Edit Lock steps aside and the edit runs as
|
||||
if the node were not there. The report says so.
|
||||
- **A soft effect over the whole picture** (rain, falling snow, haze):
|
||||
it touches everything a little, so there is no untouched part to put
|
||||
back. Edit Lock lets the effect through and only holds the picture in
|
||||
place, so it does not come back zoomed or shifted. The report says so.
|
||||
- **A soft effect and a clear change in one edit** (rain and an umbrella):
|
||||
the node may lock on the umbrella and hold the rain back everywhere
|
||||
else. If the effect is missing outside the changed part, set **Lock** to
|
||||
`off`.
|
||||
- **Something in between** (a new hair color on a close-up, a new
|
||||
background behind a person): it may lock or step aside. The report says
|
||||
which. These edits often change the light on the face too. `auto` steps
|
||||
aside for most of them, so the new light comes with the new hair.
|
||||
`always` keeps the old light on everything it keeps, which can look
|
||||
wrong on a face. A mask settles it: paint the hair and the face, and
|
||||
the rest is locked.
|
||||
- **The model ignores your picture and draws a new one:** that reads as a
|
||||
whole-picture edit, so `auto` steps aside. `always` holds the model to
|
||||
your picture.
|
||||
|
||||
## Controls
|
||||
|
||||
- **model**: the edit model. Patch last, after any LoRAs.
|
||||
- **vae**: the same VAE the workflow decodes with.
|
||||
- **image**: the picture you are editing, at the size of the result. If
|
||||
the sizes differ by more than a few percent the lock does nothing, and
|
||||
the report says so.
|
||||
- **Lock** (`lock`): `auto` (the default) locks the untouched parts and
|
||||
steps aside when the whole picture changes. `always` locks even then.
|
||||
`off` does nothing, which makes a quick before and after.
|
||||
- **Tolerance** (`tolerance`): how big a change must be to count as part of
|
||||
the edit. 1 is the default. Raise it if small unwanted changes get
|
||||
through. Lower it if the lock holds back part of your edit.
|
||||
- **mask** (optional): white marks where the edit may happen; everything
|
||||
else is locked. With a mask the node does not look for the change
|
||||
itself. A mask from **Mask by Touch 🆎** or **Mask by Name 🆎** works.
|
||||
|
||||
## Outputs
|
||||
|
||||
- **model**: the model with the lock on.
|
||||
- **edit_lock**: what the lock kept, for Edit Lock Restore 🆎.
|
||||
|
||||
## Good to know
|
||||
|
||||
- The lock belongs to one picture. For an edit with two pictures, give it
|
||||
the one the result should line up with.
|
||||
- It works on single pictures, not video.
|
||||
- The node watches the first steps of a run and locks for the rest, so
|
||||
the model finishes the edit on top of your real picture. Shadows and
|
||||
reflections the edit adds next to the changed part still come through.
|
||||
- If your edit is missing and the report says nearly all of the picture
|
||||
was kept, set **Lock** to `off`.
|
||||
- Tested on MiniMax-H3-Image. The lock itself is not tied to one model, but
|
||||
the line between "local edit" and "whole picture" was measured there.
|
||||
|
||||
## Technical details
|
||||
|
||||
At every step an edit model predicts the finished picture. Edit Lock
|
||||
compares that prediction with your picture in latent space.
|
||||
|
||||
**Watching.** The first prediction of a run is a blur, and rain, snow or
|
||||
the light a new hair color throws on a face only show a few steps in. So
|
||||
the node watches until the noise is down to 0.8 of where it began: step 4
|
||||
of a 6-step MiniMax-H3-Image run. A run that never gets that low decides
|
||||
at its last step. While it watches, the model draws its own picture and
|
||||
only one thing is corrected. The model often draws the whole picture about
|
||||
one percent larger, or a little shifted. The node measures that zoom and
|
||||
shift at every step, on the calmer half of the picture, and moves the
|
||||
prediction back so it sits where your picture does.
|
||||
|
||||
**Deciding.** Change is measured against the quiet part of the picture:
|
||||
the tenth where the prediction differs least. An even tint over the whole
|
||||
picture is taken out first, so a color cast is not read as a change. A
|
||||
spot counts as changed when it differs by 3 times the quiet level, or by 2
|
||||
times while it touches a spot that does. So a faint change beside a clear
|
||||
one belongs to the edit, and a faint change alone is redraw noise.
|
||||
**Tolerance** multiplies both numbers.
|
||||
|
||||
**Locking.** From the decision on, wherever the picture did not change,
|
||||
the original latent is put back before the sampler takes its next step. A
|
||||
part once read as changed stays changed for the rest of the run. The last
|
||||
step ends on the original there, so what was kept is the original itself,
|
||||
not a redrawn copy.
|
||||
|
||||
**Stepping aside.** `auto` does not lock in three cases:
|
||||
|
||||
- At the first step the whole picture is already changing (a new style,
|
||||
new light). The node reads the calmest fifth of a smoothed copy, where a
|
||||
slightly larger redraw nearly vanishes and a new style does not. On
|
||||
MiniMax-H3-Image, local edits at 1, 4 and 16 megapixels read 0.22 or
|
||||
less there and whole-picture edits 0.27 or more; the line sits at 0.243.
|
||||
The model then runs untouched.
|
||||
- At the decision no place has changed clearly: the strongest spot of the
|
||||
picture is under 4 times the quiet level. That is light rain or fog.
|
||||
Local edits read 4.7 or more there, glasses and makeup included.
|
||||
- At the decision the lock would hand a tenth of the picture or more to
|
||||
the edit, yet the strongest hundredth of the picture is under 4 times
|
||||
the quiet level. That is heavier rain or snow, and a lock would let it
|
||||
through in patches. Local edits that wide read 4.4 or more; rain and
|
||||
snow read 3.6 or less.
|
||||
|
||||
In the last two cases the node keeps undoing the zoom and shift to the end
|
||||
of the run, and puts nothing back. An edit close to one of these lines (a
|
||||
hair color change on a close-up, a new background, smoke) can fall on
|
||||
either side. The report says which, and **Lock** overrides it.
|
||||
|
||||
This is the target the TailSteer paper trains a model toward (the source
|
||||
where nothing changed, the model's own edit elsewhere), applied while
|
||||
sampling. It needs no LoRA and no training.
|
||||
@@ -0,0 +1,73 @@
|
||||
# Edit Lock Restore
|
||||
|
||||
Puts your picture's own pixels back in every part the edit did not change,
|
||||
and takes out the faint pink tint some edit models add to the whole picture.
|
||||
|
||||
**Edit Lock 🆎** keeps the untouched parts in place while the picture is
|
||||
made. They still pass through the VAE, which softens fine detail a little.
|
||||
This node swaps your original pixels in for those parts, so they match
|
||||
your picture pixel for pixel. Only the edit is new.
|
||||
|
||||
## Quick start
|
||||
|
||||
1. Add it right after the VAE Decode, before any upscaler.
|
||||
2. Wire the decoded picture into `image`.
|
||||
3. Wire the `edit_lock` output of Edit Lock 🆎 into `edit_lock`.
|
||||
4. Wire `report` into **Show Text 🆎** to read what was kept.
|
||||
|
||||
## Controls
|
||||
|
||||
- **image**: the edited picture, straight from the VAE Decode.
|
||||
- **edit_lock**: from Edit Lock 🆎. It carries your original picture and
|
||||
the map of what the edit changed, so there is nothing else to wire.
|
||||
- **Feather** (`feather`): how softly your original fades into the edit,
|
||||
in pixels. 16 is the default. The fade lies outside the edit, so the
|
||||
edit itself is never mixed with the old picture.
|
||||
- **Remove tint** (`remove_tint`): on by default. MiniMax H3 Image makes
|
||||
every edit a little pinker and lighter all over. This reads that tint
|
||||
from the part of the picture the edit left alone and takes it out of the
|
||||
whole picture, the edit included. It matters most when Edit Lock stepped
|
||||
aside, such as for a new hair color, a new background or rain, because
|
||||
then nothing else removes it. Edits meant to recolor everything (golden
|
||||
hour, red light, a new art style) are left alone. Turn it off if a color
|
||||
change you asked for comes out weaker.
|
||||
|
||||
## Outputs
|
||||
|
||||
- **image**: the edit, with your original pixels in the untouched parts.
|
||||
- **edit_mask**: white where the edit changed the picture. Use it to see
|
||||
what the lock decided, or for a later step that should only touch the
|
||||
edit.
|
||||
- **report**: one line, such as "Edit Lock kept 82% of your picture as it
|
||||
was and left 18% to the edit". When the tint was taken out it adds a
|
||||
sentence that says so.
|
||||
|
||||
## When nothing was locked
|
||||
|
||||
Your original pixels are not pasted back, the mask is all white, and the
|
||||
report says why: the edit changed the whole picture, the lock was off, or
|
||||
the picture and the result were different sizes. Remove tint still works
|
||||
here, so the picture can come out with the tint taken out.
|
||||
|
||||
## Technical details
|
||||
|
||||
The map of what changed is made while sampling, on the latent grid. Here
|
||||
it is enlarged to the picture's size, widened by the feather and blurred
|
||||
by the same amount, and used to blend the decoded picture with your
|
||||
original. If the decoded picture is not the size of your original (after
|
||||
an upscale), the original is resized to fit first, which costs it some
|
||||
sharpness. That is why this node goes before an upscaler.
|
||||
|
||||
**Remove tint.** The edit is lined up with your original (edits often come
|
||||
back about one percent larger or a little shifted), both are averaged
|
||||
into coarse cells of about 8 px at 1 megapixel, and their difference is
|
||||
taken in Lab color. The tint is the even shift most cells share: it starts
|
||||
at the median and keeps only cells within 4 Lab units of it, five times
|
||||
over, so a new background or new hair drops out of the count. It is taken
|
||||
out only when it looks like the model's own tint: a between +0.5 and +10,
|
||||
b between -8 and 0, L between -1 and +6, read on at least 15% of the
|
||||
picture. On 21 test edits at 16 megapixels it took out the tint on the 5
|
||||
it should (a +2.6 to +6.5 down to +0.4 or less) and left the other 16
|
||||
alone, golden hour, red light and an anime restyle included. It cannot
|
||||
tell this tint from an edit that asks for a slightly pinker, lighter look
|
||||
over the whole picture; turn it off for one of those.
|
||||
@@ -0,0 +1,171 @@
|
||||
# Film Grain
|
||||
|
||||
Adds film grain to a picture or a video. Use it at the end of a workflow to
|
||||
give a clean render the texture of a photo shot on film, or to make a fake
|
||||
look less smooth and plastic.
|
||||
|
||||
The grain is strongest in the midtones and gentler in deep shadows and bright
|
||||
highlights, the way it is on film. On a video it moves from frame to frame
|
||||
like real film grain, or stays put if you want a still texture. An optional
|
||||
mask puts grain only where it is white.
|
||||
|
||||
The panel under the card shows the result once the node has run (the first
|
||||
frame for a video). The small **preview** switch at the right of the bar
|
||||
turns it off, which also skips writing the preview file.
|
||||
|
||||
## Auto
|
||||
|
||||
Switch **Auto** on and the node picks the grain for the picture. The grain
|
||||
looks the same on a small picture and on a big one, and it matches the grain
|
||||
the picture already has. A clean render, with no grain of its own, starts at
|
||||
the normal amount of `0.25`.
|
||||
|
||||
With Auto on, **Amount** and **Size** become multipliers. `1 ×` is Auto's
|
||||
pick, `1.5 ×` is half as much again, `2 ×` is twice as big. The small number
|
||||
beside each box is what you get ("= 0.27", "= 1.0 px"). It shows once the
|
||||
node knows the picture: right away from a Load Image, or after one run when
|
||||
the picture comes from another node. Until then it shows a dash.
|
||||
|
||||
Auto on and Auto off each keep their own numbers, so switching back loses
|
||||
nothing. Auto starts off, so workflows saved before it behave as they did.
|
||||
|
||||
## Copy the grain of another picture
|
||||
|
||||
Wire a picture whose grain you like into **grain_from** and switch Auto on.
|
||||
Its switch now reads **match**: the node reads how strong, how big and how
|
||||
colourful that picture's grain is, and adds grain like it. A film scan, a
|
||||
still from a film or a photo you like all work.
|
||||
|
||||
- **Amount**, **Size** and **Color** count from the match, the same way as
|
||||
Auto's pick: `1 ×` is the match, and the small number beside each box is
|
||||
what you get. **Roughness** stays yours; the match does not read it.
|
||||
- Grain is matched at the same viewing size. The picture to copy from is
|
||||
scaled to your picture's size first, so grain from a big photo comes out
|
||||
finer on a small picture, as it would look side by side on screen.
|
||||
- Only the plainest patches are read: a sky, a wall, skin. A picture that is
|
||||
all busy texture (gravel, leaves, a tiled floor) reads stronger grain than
|
||||
it has; turn **Amount** down, or copy from a plainer picture.
|
||||
- Grain your picture already has counts. A grainy picture gets only the
|
||||
grain it is missing, and a reference with less grain than yours adds none.
|
||||
- The match is worked out when the node runs. Until the first run the
|
||||
numbers show a dash and the picture asks for a run; after it, the live
|
||||
preview uses the match while you drag. A video is read from its first
|
||||
frame, and so is a video wired in to copy from.
|
||||
- The node remembers the match for each pair of pictures it ran, and saves
|
||||
it with the workflow. A reopened workflow shows it at once, and so does a
|
||||
run ComfyUI skips because nothing changed.
|
||||
- Without a picture on grain_from, Auto picks the grain as above. Auto off
|
||||
ignores grain_from.
|
||||
|
||||
## Live preview
|
||||
|
||||
Once the node has a picture, the picture on the node redraws while you drag a
|
||||
value, before you queue anything. Run the graph once to give the node its
|
||||
picture (an image connected is enough once it has run; a Load Image shows at once); after that it changes as you drag. A small "not run yet" tag
|
||||
shows while the picture is a preview and not a real result.
|
||||
|
||||
The **Fit | 100%** switch sits on the bar above the picture, left of Preview.
|
||||
Fit shows the whole picture. 100% shows real pixels, and dragging on the
|
||||
picture moves around it instead of moving the node. At 100% you see the grain at the size it will have in the saved picture.
|
||||
|
||||
|
||||
## Controls
|
||||
|
||||
- **Auto** (`auto`): off uses the Amount and Size you set. On, the node
|
||||
picks them for the picture, or reads **match** and copies the grain of the
|
||||
picture on grain_from.
|
||||
- **Amount** (`amount`): how strong the grain is. `0` adds none, `0.25` is a
|
||||
clearly visible film look, `1` is very heavy.
|
||||
- **Size** (`size`): how big each grain is, in pixels of this picture. `1` is
|
||||
fine 35 mm grain on a picture of about 1 megapixel. Raise it on a big
|
||||
picture, or for a coarse, fast-film look. Below `1` the grain is smaller
|
||||
than a pixel, so it also gets quieter.
|
||||
- **Roughness** (`roughness`): `0` is soft, even grain. Higher mixes in finer
|
||||
grain that bunches up in some places and thins out in others, like real
|
||||
film.
|
||||
- **Color** while matching (`auto_color`): a multiplier of the matched
|
||||
colour. `0` turns the copied grain black-and-white.
|
||||
- **Color** (`color`): `0` is black-and-white grain, the same in red, green
|
||||
and blue. Higher gives each colour its own grain, like the dye clouds of
|
||||
colour film. A little (`0.2` to `0.4`) looks most natural on colour
|
||||
pictures.
|
||||
- **Video grain** (`moving`): **moving** gives every frame of a video new
|
||||
grain, so it moves like film. **still** puts the same grain on every
|
||||
frame, which looks like a texture on the lens. A single picture looks the
|
||||
same either way.
|
||||
|
||||
### Behind **More**
|
||||
|
||||
- **Seed** (`seed`): picks the grain pattern. The same seed always gives
|
||||
the same grain, so a re-run gives the same picture. Change it for another
|
||||
pattern.
|
||||
|
||||
### Inputs and output
|
||||
|
||||
- **image**: the picture or video frames.
|
||||
- **grain_from** (optional): a picture whose grain to copy while Auto is
|
||||
on. It can be any size and shape.
|
||||
- **mask** (optional): grain goes only where the mask is white, and fades
|
||||
in with a soft mask. One mask can cover every frame, or give one per
|
||||
frame. A mask of another size is stretched to the picture.
|
||||
- **image** (output): the picture or frames with grain, at the same size. A
|
||||
picture with a transparent background keeps its transparency.
|
||||
|
||||
## Technical details
|
||||
|
||||
- Auto's size is `1` pixel at 1 megapixel and follows the square root of the
|
||||
picture's megapixels, so a 4 MP picture gets `2` px (kept between 0.5 and
|
||||
16 px). Its amount is `0.25` plus the picture's own grain divided by
|
||||
`0.15`, kept between `0.05` and `1`.
|
||||
- The picture's own grain is measured in its flat areas: a Laplacian-
|
||||
difference filter (Immerkaer, 1996) removes shapes and leaves fine noise,
|
||||
and the median of what is left, read from a histogram, gives the noise as
|
||||
one standard deviation. Edges and texture are a small part of a picture, so
|
||||
the median ignores them. Below `0.0015` (what 8-bit rounding alone
|
||||
measures) counts as no grain. A clip is measured on up to four frames.
|
||||
The browser measures a Load Image's picture with the same filter, so the
|
||||
note beside the boxes agrees with the node's result.
|
||||
- `auto_amount` and `auto_size` are separate inputs from `amount` and
|
||||
`size`, which is why each mode keeps its own numbers.
|
||||
- The grain match (`nodes/_grain_match_helpers.py`) scales the picture to
|
||||
copy from to the target's megapixels, its shape kept, and reads both
|
||||
pictures' first frames. Each is shrunk by 1 to 12 times; at each size the
|
||||
fine detail (mean absolute Laplacian, as a standard deviation) of the
|
||||
plainest fifth of the mid-tone 16 px blocks gives the brightness grain, and
|
||||
the same blocks of two colour-difference channels give the colour grain.
|
||||
The target's own grain at each size is taken off (in quadrature). How the
|
||||
grain falls off over the sizes is fitted, in log space, to a stored table
|
||||
of Film Grain's own grain at sizes 1 to 16 px and colours 0 to 1
|
||||
(`nodes/_grain_match_table.py`), with a mild pull toward size 1; grain
|
||||
smaller than a pixel reads as size 1 and a lower amount, which looks the
|
||||
same. The colour comes from the colour grain against the brightness grain,
|
||||
and the amount is checked twice by adding the grain to the target and
|
||||
correcting it. On Film Grain's own grain the match reads back its settings
|
||||
(0.40 / 2.0 px / 0.3 reads 0.41 / 2.0 px / 0.3); a 1 MP pair takes about
|
||||
a third of a second on the CPU.
|
||||
|
||||
- Grain is random noise drawn on a grid `size` pixels apart and smoothed up
|
||||
to the picture with a bicubic filter, then scaled back to the same
|
||||
strength. Below 1 pixel it is drawn finer and averaged down to the
|
||||
picture, so its strength falls with its size.
|
||||
- Roughness adds a second layer at half the size whose strength is varied by
|
||||
a slow noise four grains wide, mixed so the total strength stays the same.
|
||||
Extreme values are rounded off softly at three standard deviations, so no
|
||||
lone white or black speck appears.
|
||||
- At **Amount** `1` one standard deviation of the grain is `0.15` (on a
|
||||
`0` to `1` scale) at mid grey, falling to a fifth of that at black and
|
||||
white. The weight follows the picture's own brightness, `4 L (1 - L)`.
|
||||
- Every frame's grain has its own seed, worked out from the node's seed and
|
||||
the frame number, so a frame's grain does not depend on how long the clip
|
||||
is. Frames are worked on eight at a time: 81 frames at 1920 x 1080 take
|
||||
about 12 seconds on a desktop CPU, with only a few frames' worth of extra
|
||||
memory.
|
||||
|
||||
### Live preview
|
||||
|
||||
The preview runs the node's own maths in the browser: on a copy shrunk to the
|
||||
size it is shown at in Fit, and on a real-pixel crop of the picture in 100%.
|
||||
It is checked against the Python node on recorded values (`tests/test_live_parity.py`);
|
||||
results agree to within 5e-5 on a 0 to 1 scale. The picture is the one the
|
||||
last run kept, or a Load Image read through ComfyUI's own view route. When
|
||||
the values match the last run, the real result is drawn instead.
|
||||
@@ -0,0 +1,69 @@
|
||||
# FlashVSR Upscale
|
||||
|
||||
Makes a video larger and sharper. Give it the frames of a clip, set how much
|
||||
larger, and it returns the same clip with more detail. Use it as the last
|
||||
step before Save Video, for a generated clip or one you loaded.
|
||||
|
||||
It needs one model file and no other pack.
|
||||
|
||||
## The model file
|
||||
|
||||
Download `flashvsr_v1.1_fp16.safetensors` (3.5 GB) from
|
||||
[ausboss/FlashVSR-v1.1-ComfyUI](https://huggingface.co/ausboss/FlashVSR-v1.1-ComfyUI)
|
||||
and put it in `ComfyUI/models/diffusion_models`. Then refresh the page, or
|
||||
press `R`, and pick it under **Model**.
|
||||
|
||||
The file holds the official FlashVSR v1.1 weights in one piece. Another
|
||||
FlashVSR file will not load here: the node stops and says which part is
|
||||
missing.
|
||||
|
||||
## Controls
|
||||
|
||||
- **frames**: The clip, as a batch of frames. Load Video's frames output
|
||||
goes here.
|
||||
- **Model** (`model`): The model file above. The list shows the files in
|
||||
`diffusion_models` that have FlashVSR in their name.
|
||||
- **Scale** (`scale`, starts at `2`): How many times larger each side gets,
|
||||
from 1 to 4. At `1` the clip keeps its size and is only sharpened.
|
||||
- **Keep colors** (`color_match`, starts on): Brings each frame's colours
|
||||
back to those of your clip. Leave it on unless you want the model's own
|
||||
colours.
|
||||
- **vae** (optional): Connect the Wan 2.1 VAE for a slower, finer finish.
|
||||
With nothing connected, the fast decoder inside the model file makes the
|
||||
picture.
|
||||
|
||||
## Outputs
|
||||
|
||||
- **frames**: The larger frames, as many as went in, in the same order.
|
||||
The frame rate and the sound are not touched, so wire those from Load
|
||||
Video to Save Video as before.
|
||||
|
||||
## What to expect
|
||||
|
||||
FlashVSR redraws fine detail: skin, hair, cloth and edges come back
|
||||
sharper than the clip had them. It keeps the scene, the motion and the
|
||||
timing.
|
||||
|
||||
A long clip needs no more graphics memory than a short one. The node reads
|
||||
the clip a few frames at a time and keeps only the last few in memory.
|
||||
|
||||
## Technical details
|
||||
|
||||
- **Size.** The result is exactly your size times **Scale**, rounded to
|
||||
even numbers. Inside, the model works at a multiple of 128 pixels each
|
||||
way; the node pads the picture for that and cuts the padding off again,
|
||||
so nothing of your picture is cropped.
|
||||
- **Graphics memory.** About 10 GB for a 576 x 1024 result. A result too
|
||||
large for the free memory is made in overlapping tiles and blended, and
|
||||
the tile size is chosen from the memory that is free when the node runs.
|
||||
1152 x 2048 ran in two tiles at about 16 GB. On an 8 GB card (RTX 3070
|
||||
Laptop) the same result ran in smaller tiles at about 6.5 GB, at about 3
|
||||
seconds a frame.
|
||||
- **Speed.** On an RTX 5090: about 7 frames a second for a 576 x 1024
|
||||
result and about 2 frames a second for 1152 x 2048.
|
||||
- **One step.** The model runs once per group of frames. There are no
|
||||
steps, sampler, prompt or seed to set.
|
||||
- **The model.** FlashVSR v1.1 by Junhao Zhuang and the OpenImagingLab
|
||||
team, released under Apache-2.0. It is built on the Wan 2.1 1.3B video
|
||||
model. This node is the pack's own code in plain PyTorch.
|
||||
- The node makes no network requests and writes no files.
|
||||
@@ -24,12 +24,16 @@ frame are copied untouched, and only the true in-betweens are synthesized.
|
||||
|
||||
## Scene cuts
|
||||
|
||||
Interpolating across a hard cut produces morph artifacts: two unrelated
|
||||
shots smeared into each other for a frame or two. When the mean absolute
|
||||
difference between adjacent source frames rises above **Scene cut**
|
||||
(`scene_cut_threshold`), the node treats that pair as a cut and holds the
|
||||
last frame before it instead of morphing. Set the threshold to `0` to
|
||||
disable detection and interpolate everything.
|
||||
Making in-betweens across a hard cut mixes two shots into each other for a
|
||||
frame or two. The node finds each cut and holds the last frame before it
|
||||
instead.
|
||||
|
||||
A cut is a change between two frames that jumps out from the frames around
|
||||
it. That works even when both shots show the same place in the same light,
|
||||
where the change at a cut can be smaller than fast movement inside one
|
||||
shot. Any change above **Scene cut** (`scene_cut_threshold`) also counts as
|
||||
a cut, as it always has. Set it to `0` to turn cut finding off and make
|
||||
in-betweens everywhere.
|
||||
|
||||
## Controls
|
||||
|
||||
@@ -40,8 +44,10 @@ disable detection and interpolate everything.
|
||||
source rate passes the batch through unchanged. A new node starts at
|
||||
24 → 30.
|
||||
- **Method** (`method`): `blend` or **optical flow (RAFT)**, as described above.
|
||||
- **Scene cut** (`scene_cut_threshold`): Cut sensitivity from 0 to 1; `0.35`
|
||||
suits most footage, `0` disables.
|
||||
- **Scene cut** (`scene_cut_threshold`): A change above this always counts
|
||||
as a cut; `0.35` suits most footage, and `0` turns cut finding off. Cuts
|
||||
that jump out from the frames around them are found at any setting above
|
||||
`0`.
|
||||
- **Batch** (`batch_size`, starts at `8`): In-between frames computed per batch. Higher is
|
||||
faster but uses more VRAM; results land in system memory as each batch
|
||||
finishes.
|
||||
@@ -55,3 +61,33 @@ disable detection and interpolate everything.
|
||||
|
||||
Neither method performs network requests or writes files. The optical-flow
|
||||
method reads an existing checkpoint from the local torch hub cache.
|
||||
|
||||
## Technical details
|
||||
|
||||
### How cuts are found
|
||||
|
||||
The node makes a small copy of every frame, 64 px on its long side. Each
|
||||
4 px block of a frame looks for its best match in the frame before it,
|
||||
moved up to 3 px each way. Movement inside a shot finds its match, so what
|
||||
is left is small; after a cut the picture is new and the change stays
|
||||
large, even with the same colors on both sides.
|
||||
|
||||
That leftover change is compared with the median of the 4 frame pairs on
|
||||
each side. A pair is a cut when it is at least 3 times that median and
|
||||
above 0.02 (on a 0 to 1 scale), so grain in a still shot never counts.
|
||||
Repeated frames, as in footage drawn on twos or threes, are left out of the
|
||||
median. A pair is also a cut when its plain mean difference over the full
|
||||
frame is above **Scene cut**, the rule earlier versions used on its own, so
|
||||
no cut those versions found is lost.
|
||||
|
||||
Measured on seven MiniMax H3 clips with 29 cuts, among them a rooftop clip
|
||||
whose three cuts scored 0.14 to 0.17 on the plain difference and a street
|
||||
clip that moved 0.15 inside one shot: every cut stood out at least 4.1
|
||||
times from its neighbours, and movement inside a shot at most 1.9 times.
|
||||
All 29 were held and nothing inside a shot was. The plain rule alone,
|
||||
at `0.35`, held 2 of them.
|
||||
|
||||
A cut straight into very fast movement, more than about a twentieth of the
|
||||
frame from one frame to the next, can stand out less from the shot after
|
||||
it. A clip of two frames has nothing to compare with; there only the
|
||||
plain rule applies.
|
||||
|
||||
@@ -7,6 +7,28 @@ Use it with MiniMax H3 or Pika H3 Flex. Connect up to four pictures and give eac
|
||||
one a job. Copy the moves from a video, keep a clip going, or add a voice or a
|
||||
song.
|
||||
|
||||
## Sockets appear as you use them
|
||||
|
||||
The node shows only the sockets you are using, so its face stays small.
|
||||
|
||||
- A new node has one picture socket. Connect a picture and the next one
|
||||
appears, up to four.
|
||||
- **video_sound** appears once a video is connected.
|
||||
- An output appears once its input is connected: connect two pictures and
|
||||
two picture outputs show. **song_under** needs a voice and a song, and
|
||||
**keeps_clip_sound** a video. **prompt**, **frames**, **width** and
|
||||
**height** are always there.
|
||||
- A socket with a wire on it always shows.
|
||||
- The picture chips under the words work the same way: a chip shows for each
|
||||
picture or video you plugged in. If its loader is turned off, the chip
|
||||
turns faint and says **off**.
|
||||
|
||||
Nothing changes in a workflow you already saved: every wire stays where it
|
||||
was and the node sends the same things. To see every socket and chip all the
|
||||
time, pick **all** under **Sockets** in the gear menu (the gear at the top
|
||||
right of the node), or turn on **Settings → 🆎 AusBoss → H3 Prompt Writer →
|
||||
Show every socket**. Both are the same setting.
|
||||
|
||||
## How to write it
|
||||
|
||||
Every line is a moment, and the lines play in order in one shot. The bar under
|
||||
@@ -23,10 +45,11 @@ the box shows the second each one starts, before you spend a run.
|
||||
That is two shots in two places. `@1` is Picture 1. With one person you can
|
||||
write `She` or `He` instead.
|
||||
|
||||
The node also fills in two things H3 misses by itself. A moment gets its own
|
||||
sound when it names something that makes one, like rain, footsteps or thunder.
|
||||
And what changes stays changed: when the lights go out, the next moments in that
|
||||
place say they are still out.
|
||||
Your words go into the prompt as you typed them. To hear something at a
|
||||
moment, say it in that line: `Thunder cracks overhead.` For a sound under the
|
||||
whole clip, add a `sound:` line, such as `sound: rain on the windows`. When
|
||||
something should stay the way it changed, say so in the later lines too:
|
||||
`The lights are still off.`
|
||||
|
||||
## The words box and the bar
|
||||
|
||||
@@ -84,31 +107,43 @@ from.
|
||||
|
||||
Connect a video, then pick what it is for:
|
||||
|
||||
- **copy its moves**: your person does the moves in the video. It needs a
|
||||
picture of your person. Say where in your lines:
|
||||
`@1 dances on a rooftop at sunset.` The clothes can come from words or from an
|
||||
outfit picture.
|
||||
- **copy its moves**: someone does the moves in the video. With a picture of
|
||||
your person, your person does them. Say where in your lines:
|
||||
`@1 dances on a rooftop at sunset.` With no person picture, the person in
|
||||
the video keeps their own moves and goes somewhere new: give a picture the
|
||||
job **place** and type `He dances in @1.` The clothes can come from words or
|
||||
from an outfit picture. It doesn't have to be a person: give a cartoon hand,
|
||||
a toy or a mascot the job **thing** and type `@1 waves.` It does the moves in
|
||||
its own look, and nothing of the video's subject is kept.
|
||||
- **swap the person**: your person takes over from the one in the video. The
|
||||
place, the moves and the camera stay. With two person pictures, the first
|
||||
replaces the person on the left and the second replaces the person on the
|
||||
right. To choose who goes, type one line per picture, for example
|
||||
`@1 replaces the man in the hat`. Put spoken words in quotes and name
|
||||
the speaker. If a voice comes from off screen, say so in the line.
|
||||
A line like `@1 dances.` is not read as who goes; only a description such
|
||||
as `the man in the hat` is. With two people, name who speaks.
|
||||
- **change something**: keep the video and describe the change, for example
|
||||
`She wears a red raincoat`. Be specific about what should change.
|
||||
`She wears a red raincoat`. Be specific about what should change. To change
|
||||
the whole look, connect a picture with the job **style** (or **place**, for
|
||||
the same room looking different) and type `It looks like @1.` A clip with
|
||||
nobody in it, such as an empty hallway, stays empty.
|
||||
- **keep going**: more of the same clip, from where it ends. Say what happens
|
||||
next, or leave the box empty and it just carries on. Connect the whole clip:
|
||||
the node sends H3 only the last 2 seconds.
|
||||
- **new voice**: the same clip with a new voice. Connect the voice, and type
|
||||
what they say in quotes.
|
||||
This keeps the person in the clip, so a person picture is not allowed here;
|
||||
use **swap the person** to change who is in it.
|
||||
|
||||
If your swap keeps the video's audio, connect it to **video_sound** and turn on
|
||||
If your swap keeps the video's audio, connect it to **video_sound** (it shows
|
||||
once a video is connected) and turn on
|
||||
**More → Clip's own sound**. The writer uses the clip to estimate when each
|
||||
line is spoken and keeps only the incoming people's words in the swap prompt.
|
||||
Type a time such as `3.2s:` to set it yourself. This switch starts off.
|
||||
|
||||
With an active video, **swap the person**, **change something** and **new voice**
|
||||
use the incoming clip to set the frame count. **Length** says **From the clip**;
|
||||
With an active video, **copy its moves**, **swap the person**, **change
|
||||
something** and **new voice** use the incoming clip to set the frame count. **Length** says **From the clip**;
|
||||
set the clip's length upstream. The bar does not show a guessed duration or offer
|
||||
retiming controls for these jobs. H3 rounds the frame count to a supported length.
|
||||
Other video jobs, or turning the video off, use the editable **Length** again.
|
||||
@@ -132,11 +167,17 @@ workflows and scripts keep their previous behavior when it is absent.
|
||||
- **A cut in the same place**: start the line with a kind of shot, like
|
||||
`a close-up of her hand`. Any other line after a blank line goes to a new
|
||||
place.
|
||||
- **A cut back**: `Cut back to the hallway.` returns to a place you have
|
||||
already shown.
|
||||
- **One long take**: type `no cuts` and blank lines stop being cuts.
|
||||
- **An ending**: start a line with `ends on`, wherever it sits:
|
||||
`ends on her sitting by the window`.
|
||||
- **Speech**: put the words in quotes: `@1 says "we are late."` Each person
|
||||
keeps their own voice.
|
||||
- **Speech**: put the words in quotes: `She says "we are late."` With two or
|
||||
more people, your sentence goes to H3 as you typed it, so write it the way
|
||||
you would tell a person: `@1 listens as @2 says "we are late."`
|
||||
- **Talking over a cut**: end the words with `...` and the line keeps going
|
||||
into the next shot, said once. On the last line, `...` means the clip ends
|
||||
mid-sentence.
|
||||
- **Words on a sign**: name the sign: `a neon sign reads "OPEN"`.
|
||||
- **Sound and music**: use the **Sound** and **Music** boxes, or type
|
||||
`sound: rain on a tin roof` and `music: slow sad piano`. With no music you get
|
||||
@@ -150,6 +191,17 @@ own, with blank lines around it, it is for the whole clip.
|
||||
Already wrote H3's six parts yourself? Paste them in and they go through as
|
||||
they are.
|
||||
|
||||
## See and change the full prompt
|
||||
|
||||
The **Full prompt** tab at the top of the node shows the prompt the node wrote
|
||||
on its last run. To change one thing, such as taking out "A slow push in.",
|
||||
edit it there and run again: H3 gets your text exactly as it is in the box. An
|
||||
amber dot on the tab shows that an edit is being sent. **Reset to written**
|
||||
throws the edit away and goes back to what the **Simple** tab writes.
|
||||
|
||||
While an edit is in place, changes on the Simple tab do nothing, because your
|
||||
text is sent instead.
|
||||
|
||||
## What you can plug in
|
||||
|
||||
- **picture_1** to **picture_4**: your pictures.
|
||||
@@ -158,14 +210,16 @@ they are.
|
||||
speech timing when **Clip's own sound** is on. To keep source audio in a swap
|
||||
or **change something**, route the original loader's audio to the save node.
|
||||
- **voice**: a clip of someone talking, about 10 seconds, plus words in quotes
|
||||
in your script. It goes to whoever speaks first. It works with your own voice,
|
||||
in your script. It goes to whoever speaks first. With two or more people,
|
||||
put the speaker right before the words: `@2 says "hello."` It works with your own voice,
|
||||
or one you have permission to use. Put the spoken line last: with time left
|
||||
after it, H3 tends to keep talking.
|
||||
- **song**: your music. It is cut to the length of the clip and plays as it is,
|
||||
and each moment moves onto its beat.
|
||||
- **clip**: a small text model such as Qwen3-VL 8B. Type one line and it adds
|
||||
what happens next, and it names the sound of the place. Your line always stays
|
||||
first.
|
||||
first. Turn on **More → Tidy up my lines** and it also cleans up what you
|
||||
typed before the node reads it (see the controls below).
|
||||
|
||||
A voice and a song work together. H3 can't keep a song while someone speaks, so
|
||||
the node keeps the song out of H3's way and hands it on as **song_under**, turned
|
||||
@@ -195,19 +249,47 @@ as not plugged in.
|
||||
- **Sound** (`sound`): what the clip sounds like, for the whole clip. Same as a
|
||||
`sound:` line.
|
||||
- **Music** (`music`): the music for the whole clip. Same as a `music:` line.
|
||||
- **Length** (`seconds`): how long the clip is, 5 to 15.
|
||||
- **Camera** (`camera`): how the camera moves the whole way through.
|
||||
- **Length** (`seconds`): how long the clip is, 4 to 15.
|
||||
- **Camera** (`camera`): how the camera moves the whole way through. The first
|
||||
choice adds no camera words. With a video wired it reads **from the video**:
|
||||
the camera does what it does in the video. Pick a move only to change it.
|
||||
- **Look** (`look`): from the picture keeps your photo's look. The others redraw
|
||||
the clip. Clay and 3D don't work from words, so change your picture first with
|
||||
an edit model.
|
||||
- **Picture 1** to **Picture 4** (`job_1` to `job_4`): what each picture is
|
||||
for, on the picture chips under the bar. An empty slot shows as a faint `+ @3`.
|
||||
for, on the picture chips under the bar. A chip shows once its picture is plugged in.
|
||||
- **Video** (`video_job`): what the video is for, on the video chip.
|
||||
- **Song starts at** (`song_start`, under **More**): the second of the song to
|
||||
start from, so the clip gets the good part.
|
||||
- **Moments on the beat** (`cut_on_beat`, under **More**): moves each moment onto
|
||||
the nearest beat of the song. Off keeps your own seconds.
|
||||
- **Language** (`language`, under **More**): the language of the words in quotes.
|
||||
- **Tidy up my lines** (`tidy`, under **More**): the model on **clip** rewrites
|
||||
your lines first. It fixes spelling, breaks long lines into short sentences,
|
||||
and puts each spoken line right after whoever says it, so
|
||||
`@1 stares at @2 who goes "No way."` becomes `@1 stares at @2. @2 says "No way."`
|
||||
Your words in quotes are never rewritten: they are held out while it tidies
|
||||
and come back exactly as typed. Each line is tidied on its own, so blank
|
||||
lines and timed lines stay where you put them, and `camera:`, `sound:` and
|
||||
`music:` lines are left alone. If a tidied line would change who says what,
|
||||
that line is used as typed. A one-line idea is left as it is, for the model to fill out. With nothing on
|
||||
**clip** it does nothing, so a workflow can leave it on. Starts off.
|
||||
- **Full prompt** (`full_prompt`, on the Full prompt tab): your own edit of the
|
||||
finished prompt. Empty means the node's own prompt is sent.
|
||||
- **What the model is asked** (`model_asks`, in the gear menu): the four things
|
||||
the model on **clip** is asked, each with an **Edit** button. **Describe a new
|
||||
person** writes how a new person in a swap looks from their picture. **Fill in
|
||||
the next moments** writes what happens after a single typed line. **Hear the
|
||||
place** writes the steady sound of the place. **Tidy up my lines** holds the
|
||||
instructions for Tidy up. Change the words to steer the model; `{seconds}`,
|
||||
`{first}`, `{count}` and `{lines}` are filled in by the node. Your wording is
|
||||
saved in this node, so a shared workflow asks the same. **Back to built-in**
|
||||
puts the node's own wording back. They only matter with a text model plugged
|
||||
into **clip**. If your wording loses `{lines}` or another filled-in name,
|
||||
**Save** first says what the model will miss; press it again to keep it.
|
||||
**Esc** over typing you have not saved asks once before it closes.
|
||||
**Reset** at the bottom of the menu puts the sockets and all four wordings
|
||||
back at once; Ctrl+Z brings yours back.
|
||||
|
||||
## Tips
|
||||
|
||||
@@ -229,7 +311,7 @@ as not plugged in.
|
||||
| --- | --- | --- | --- |
|
||||
| `script` | input | STRING | What happens, one line for each moment. |
|
||||
| `seconds` | input | INT | How long the clip is. |
|
||||
| `clip` | input, optional | CLIP | A small text model that fills in a one-line idea. |
|
||||
| `clip` | input, optional | CLIP | A small text model that fills in a one-line idea, and tidies your lines when Tidy up is on. |
|
||||
| `picture_1` to `picture_4` | input, optional | IMAGE | Your pictures. |
|
||||
| `video` | input, optional | IMAGE | The frames of a video. |
|
||||
| `video_sound` | input, optional | AUDIO | The video's own sound. |
|
||||
@@ -264,5 +346,29 @@ that sentence the picture's street came back halfway through on 2 of 2. With no
|
||||
place in your lines H3 has nothing else to use, so it stayed in the picture's
|
||||
place on 2 of 2.
|
||||
|
||||
Tidy up sends the model one call per typed line, with its own instructions, no
|
||||
picture, and no randomness, so the same lines tidy the same way every run. Blank
|
||||
lines, `camera:`/`sound:`/`music:`/`look:` lines and the order of lines never pass
|
||||
through the model. Each quote is swapped for a marker (`SPOKEN`, or `SPOKEN1`,
|
||||
`SPOKEN2`) before anything else touches the line, so the model never sees the
|
||||
quoted words. A line's answer is used only when it is one line, every marker comes
|
||||
back once, the same `@` numbers are in it, it is not much longer than what you
|
||||
typed, each typed `@N says "..."` keeps the same person, a quote on a sign or a
|
||||
shirt stays on it, and the writer reads the whole script the same way with the
|
||||
tidied line in it: the same words said in the same order, shot and second, and the
|
||||
same cuts and timed seconds.
|
||||
Any other line is used as typed. If the writer still turns the tidied lines down,
|
||||
it uses your lines as typed. On Qwen3-VL 8B the instructions put the right speaker
|
||||
before the words on 38 of 38 lines they were not written for, took about 0.3
|
||||
seconds a call once the model was loaded, and passed every check on 77 of 79
|
||||
lines. What it still changes: "as" and "while" can become two sentences, and a
|
||||
leading `Voiceover:` label is left as typed.
|
||||
|
||||
The Full prompt tab is filled from the node's run, so it shows nothing until
|
||||
the workflow has run once. The node still writes its own prompt on every run, a
|
||||
model on `clip` included, so the tab can show it next to your edit and Reset can
|
||||
go back to it. The last written prompt is kept with the node in a saved
|
||||
workflow.
|
||||
|
||||
H3's own rewriter runs only on paid services, and the open model reads a prompt as
|
||||
it is. This node does that job on your machine, with no model needed.
|
||||
|
||||
@@ -24,6 +24,15 @@ pan. **Save & close** keeps your edits. **Cancel** or Escape puts everything
|
||||
back, and asks first if anything changed. You do not need the editor: a run
|
||||
uses what the node shows.
|
||||
|
||||
Right-click the picture and choose **Copy image** to copy the original picture,
|
||||
without added padding, rotation, crop, resize, handles or guides. To include
|
||||
your edits, open the gear and turn on **Copy with crop, rotation and padding**.
|
||||
That also includes resize, and is remembered for this browser. **Open image**
|
||||
follows the same choice. This works on the node and in the editor.
|
||||
Direct copying needs localhost or HTTPS. On a plain HTTP address, choose
|
||||
**Open image**, then right-click that
|
||||
picture and use the browser's **Copy image**.
|
||||
|
||||
## On the node
|
||||
|
||||
From top to bottom:
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# Image Toolbox
|
||||
|
||||
Small picture jobs in one node. Pick the job from the **Job** list (`job`);
|
||||
the rows under it change to what that job needs.
|
||||
|
||||
## Jobs
|
||||
|
||||
### split sheet at gaps
|
||||
|
||||
Cuts a row of pictures that sit side by side, such as the four views of a
|
||||
character sheet, into separate pictures.
|
||||
|
||||
- **Pieces** (`pieces`): how many pictures are on the sheet. 4 for a
|
||||
four-view character sheet.
|
||||
|
||||
Each cut goes to the gap between two pictures, not to an equal share of the
|
||||
width. An image model rarely puts each view exactly on its quarter of a
|
||||
sheet, so cutting into equal parts can leave part of a neighbour's sleeve in
|
||||
one piece and cut another's off. Here every piece holds one picture.
|
||||
|
||||
The pieces come out as one batch, from left to right, all the same size.
|
||||
Narrower pieces are padded with the sheet's backdrop colour. The first and
|
||||
last pieces keep the sheet's own left and right edges at their outer edge,
|
||||
so a person drawn up to the edge of the sheet does not look cut off by a
|
||||
band of padding. Wire the batch into Save Image to save each piece as its
|
||||
own file.
|
||||
|
||||
A batch of sheets is cut sheet by sheet: the first sheet's pieces, then the
|
||||
next sheet's.
|
||||
|
||||
### cut a piece
|
||||
|
||||
Cuts one piece out of the picture, at the size and place you set. Use it when
|
||||
the parts you need are not the same size, or when you know exactly where a
|
||||
part is.
|
||||
|
||||
- **Width** and **Height** (`width`, `height`): the piece's size in pixels.
|
||||
0 takes the picture's full width or height.
|
||||
- **Position** (`position`): where the piece sits, from **top left** to
|
||||
**bottom right**. **center** puts it in the middle.
|
||||
- **Move right** and **Move down** (`move_right`, `move_down`): move the
|
||||
piece from that position by this many pixels. Below 0 moves it left or up.
|
||||
|
||||
The piece never leaves the picture. A size larger than the picture is cut to
|
||||
the picture's size, and a move that would push the piece past an edge stops
|
||||
at that edge.
|
||||
|
||||
The piece comes out of **images**. The second output, **rest**, is what is
|
||||
left of the picture:
|
||||
|
||||
- When the piece is as tall as the picture and sits against its left or
|
||||
right edge, **rest** is the strip beside it. The same goes for a piece as
|
||||
wide as the picture at the top or bottom. So to split a picture into two
|
||||
parts of different sizes, set the first part's width, Height 0, and
|
||||
Position **left**: **images** is the first part and **rest** the second.
|
||||
- Any other piece leaves a hole, and **rest** is the whole picture with the
|
||||
hole filled with the picture's backdrop colour.
|
||||
|
||||
A batch is cut at the same place in every picture. Other jobs pass the
|
||||
picture through **rest** unchanged.
|
||||
|
||||
## Technical details
|
||||
|
||||
- The backdrop colour is the median colour of the picture's border.
|
||||
- A pixel counts as part of a picture when any channel differs from the
|
||||
backdrop by more than 0.1 (on a 0-1 scale).
|
||||
- Each cut looks for the column with the fewest such pixels, up to 40% of
|
||||
one piece's width either side of the equal-share line, and takes the
|
||||
middle of the longest run of those columns.
|
||||
- When two pictures overlap on the sheet, no column is clean. The cut then
|
||||
goes where the least of them is lost, and a small part of one can remain
|
||||
in the other's piece.
|
||||
- cut a piece fills its hole with the same backdrop colour.
|
||||
- Pieces set to 1 returns the picture unchanged.
|
||||
- Pieces higher than the picture's width in pixels gives one piece per
|
||||
pixel column, so fewer pieces than asked for.
|
||||
@@ -0,0 +1,99 @@
|
||||
# Keep Detail
|
||||
|
||||
Puts the fine detail of your original picture back on an edited version of
|
||||
it. Use it when an edit, a relight or an upscale made skin, fabric or wood
|
||||
look too smooth: the edit keeps its shapes, light and colour, and the pores,
|
||||
weave and grain come from the original.
|
||||
|
||||
The two pictures must line up, pixel for pixel. Wire the edit to **image**
|
||||
and the original to **detail_from**. If an edit drifted (Qwen Image often
|
||||
draws an edit a little bigger or shifted), run it through Realign to Source
|
||||
first, or the detail lands in the wrong place and doubles up.
|
||||
|
||||
If **detail_from** is a different size from the edit, it is resized to the
|
||||
edit's size first. That only helps when it is the same picture at another
|
||||
size; the pictures still have to line up.
|
||||
|
||||
The panel under the card shows the result once the node has run. The small
|
||||
**preview** switch at the right of the bar turns it off.
|
||||
|
||||
## Live preview
|
||||
|
||||
Once the node has a picture, the picture on the node redraws while you drag a
|
||||
value, before you queue anything. Run the graph once to give the node its
|
||||
picture (run once to get the picture); after that it changes as you drag. A small "not run yet" tag
|
||||
shows while the picture is a preview and not a real result.
|
||||
|
||||
The **Fit | 100%** switch sits on the bar above the picture, left of Preview.
|
||||
Fit shows the whole picture. 100% shows real pixels, and dragging on the
|
||||
picture moves around it instead of moving the node. Fine detail is easiest to judge at 100%.
|
||||
|
||||
|
||||
## Controls
|
||||
|
||||
- **Detail size** (`detail_size`): detail smaller than this many pixels
|
||||
comes from the original; anything bigger stays the edit's. `2` to `6` suits
|
||||
skin and fabric. Larger brings back more of the original, until it starts
|
||||
to bring back the old picture's light and shapes too.
|
||||
- **Strength** (`strength`): `0` leaves the edit as it is, `1` puts the
|
||||
original's detail on it in place of the edit's own, above `1` makes the
|
||||
original's detail stronger.
|
||||
- **Detail** (`color_detail`): **light only** brings back only how bright
|
||||
or dark the detail is, so the edit's colours never shift. **color +
|
||||
light** brings back the detail's colour too, such as freckles, stains or
|
||||
a coloured weave. Use it when the edit kept the original's colours.
|
||||
|
||||
### Behind **More**
|
||||
|
||||
- **Edge safe** (`edge_safe`): on by default. Strong edges, such as a
|
||||
jaw against a bright wall, are left as the edit has them, so no light or
|
||||
dark rim appears along them. Turn it off when the edit also blurred
|
||||
strong edges and you want those back from the original as well.
|
||||
|
||||
### Inputs and output
|
||||
|
||||
- **image**: the edited picture.
|
||||
- **detail_from**: the original picture, lined up with the edit.
|
||||
- **mask** (optional): detail goes back only where the mask is white, such
|
||||
as on skin alone.
|
||||
- **image** (output): the edit with the original's detail, at the edit's
|
||||
size.
|
||||
|
||||
Both pictures can be videos. One picture on either side goes with every
|
||||
frame of the other.
|
||||
|
||||
## Technical details
|
||||
|
||||
- Each picture is split into a base and detail. The base is the picture
|
||||
smoothed over `detail_size` pixels; the detail is what the smoothing took
|
||||
away. The result is the edit's base with the original's detail.
|
||||
- The split is a ratio in linear light, not a difference. Detail is how much
|
||||
brighter or darker each pixel is than its base, as a factor: pores that
|
||||
are 8 % darker than the skin around them stay 8 % darker on a darker,
|
||||
relit face. A difference would carry a bright original's texture too
|
||||
strong into a dark edit and too weak into a bright one. Linear light is
|
||||
the picture with the sRGB curve taken off, where light adds up
|
||||
physically, so a factor means the same in shadows and highlights.
|
||||
- With **light only** the factor comes from the luminance (Rec. 709 weights)
|
||||
and multiplies red, green and blue alike, so the colour of every pixel
|
||||
stays the edit's. With **color + light** each channel has its own factor.
|
||||
- The base is a Gaussian blur with a radius of `detail_size`, or with
|
||||
**Edge safe** a guided filter (He, Sun and Tang, 2010) of the picture by
|
||||
itself over a box of the same spread: it smooths texture but follows a
|
||||
strong edge, so the detail at that edge stays near nothing. A step that
|
||||
varies the values around it by more than about `0.15` counts as an edge;
|
||||
skin, fabric and wood grain vary them less. The smoothing runs on the
|
||||
sRGB-curved values, where an edge's size matches how strong it looks.
|
||||
- Strength `s` mixes the two details: the edit's own to the power `1 - s`
|
||||
(for `s` up to `1`) times the original's to the power `s`. At `0` the
|
||||
result is the edit, unchanged.
|
||||
- Frames are worked on four at a time.
|
||||
|
||||
### Live preview
|
||||
|
||||
The preview runs the node's own maths in the browser: on a copy shrunk to the
|
||||
size it is shown at in Fit, and on a real-pixel crop of the picture in 100%.
|
||||
It is checked against the Python node on recorded values (`tests/test_live_parity.py`);
|
||||
results agree to within 5e-5 on a 0 to 1 scale. The picture is the one the
|
||||
last run kept, or a Load Image read through ComfyUI's own view route. When
|
||||
the values match the last run, the real result is drawn instead.
|
||||
@@ -39,6 +39,11 @@ come back with the new area still gray, like a gray frame or a gray corner.
|
||||
Pad 🆎 or Load Image + Pad 🆎, or the painted mask of an inpaint. Wire it
|
||||
for AnyPaint. The reference then shows that area in your picture's own
|
||||
colour instead of the gray fill, and the model paints it.
|
||||
- **reference_curve**: How strongly the picture follows the references over
|
||||
the run, from Strength Curve 🆎. 1 is the normal strength and 0 ignores
|
||||
them. Hold the layout early and let go late (a fade out), or let the
|
||||
model find its own shapes first and pull the reference in for the details
|
||||
(a fade in). Leave it unwired for today's behaviour.
|
||||
|
||||
## Outputs
|
||||
|
||||
@@ -69,3 +74,23 @@ above 0.5) is refilled with the median colour of everything else before the
|
||||
reference goes to the VAE and to the vision tower. The canvas the rest of
|
||||
the graph uses keeps its gray, so the prompt writer and the stitch are
|
||||
unchanged. Only `reference` is refilled; `extra_image` is left as it is.
|
||||
|
||||
## Technical details: the reference curve
|
||||
|
||||
The references reach Krea 2 as extra tokens that the prompt and the canvas
|
||||
attend to. At each step the curve's value `s` is added as `log(s)` to
|
||||
the attention scores of the reference keys, which multiplies the attention
|
||||
weight they get by `s` before the weights are shared out again. At 1
|
||||
nothing changes, at 0 the reference gets no attention at all and the result
|
||||
is the same as without a reference, and values in between fade it. The
|
||||
reference's own tokens see the same scale. It works the same with Krea 2
|
||||
Outpaint Model Patch 🆎, which scales its cached reference keys.
|
||||
|
||||
The curve travels on the positive output as a ComfyUI hook, read at each
|
||||
step by ComfyUI's own hook keyframes (see Strength Curve 🆎 for how "where
|
||||
in the run" is measured). Two costs come with ComfyUI's hooks: a run with a
|
||||
hooked prompt turns dynamic VRAM loading off (the first one loads the model
|
||||
a second time), and at a CFG above 1 the positive and negative are run one
|
||||
after the other instead of together. While the strength is not 1, attention
|
||||
also runs with a mask, which some fast attention kernels hand to PyTorch's
|
||||
own.
|
||||
|
||||
@@ -26,6 +26,60 @@ Boxes only shows "Node 2.0 only".
|
||||
|
||||
Wire `preview` to a Preview Image to see the boxes with their numbers and words.
|
||||
|
||||
## Place people with MiniMax H3 Image
|
||||
|
||||
The `h3_prompt` output says the boxes in words for MiniMax H3 Image: who goes
|
||||
where, what they do there, how big, and who stands beside whom. Use it to put the people from your
|
||||
reference pictures into a scene, each one where you drew a box.
|
||||
|
||||
1. Wire your scene picture into `background` and into the first picture of
|
||||
the H3 Image node: it is `<Picture 1>`, the picture that is changed.
|
||||
2. Wire the people's pictures into the next ones: `<Picture 2>`,
|
||||
`<Picture 3>` and so on.
|
||||
3. Draw one **object** box for each person. In its **Description**, name
|
||||
their picture and say what they do there, for example "the man from
|
||||
`<Picture 2>`, sitting on the couch". That second part is what puts them
|
||||
in the box: told only where to go, H3 Image keeps people standing as in
|
||||
their own picture, often outside the box.
|
||||
4. A box with no description still gets the next picture, `<Picture 2>`, then
|
||||
`<Picture 3>`, in the order of the boxes, and keeps that person's face,
|
||||
hair and clothes. It is a rough place only. A description without a
|
||||
picture is a thing: a dog, a sofa. A **text** box writes its words at its
|
||||
place.
|
||||
5. Wire `h3_prompt` to the prompt of the H3 Image node. To add words of your
|
||||
own, such as the light or the mood, join the two texts first, for example
|
||||
with ComfyUI's Concatenate Text node.
|
||||
|
||||
Without a picture on `background` there is no scene picture, and the people
|
||||
start at `<Picture 1>`.
|
||||
|
||||
The prompt says every place in words, never in numbers: H3 Image draws
|
||||
numbers from a prompt onto the picture as text. Tried on three rooms and two
|
||||
seeds: with a description like the one above, the man was in his box 6 times
|
||||
of 6 and the woman 4 of 6, and the room stayed as it was; with empty boxes,
|
||||
2 of 12. Keep `preview` out of H3
|
||||
Image's pictures too, or the boxes' lines can stay in the picture.
|
||||
|
||||
## Words for a prompt
|
||||
|
||||
Some models make a picture from a prompt alone and have no input for boxes.
|
||||
The `placement` output says your boxes as plain sentences: what goes in each
|
||||
box and where it is in the picture. Add it to your prompt, for example with
|
||||
ComfyUI's Concatenate Text node, and the model puts each thing where you drew
|
||||
it.
|
||||
|
||||
For a text box with the word FRESH in the top left and an orange on the right,
|
||||
it gives:
|
||||
|
||||
> The words "FRESH" in huge bold black sans-serif letters, placed top left,
|
||||
> from 6% to 52% across and 6% to 25% down. One ripe orange with a green
|
||||
> leaf, placed middle right, from 52% to 94% across and 35% to 85% down.
|
||||
|
||||
Write the **Description** of each box the way you would in a prompt. Tried on
|
||||
SenseNova U1.6, which has no box input: these sentences put all the boxes in
|
||||
place on two seeds of two, where `elements` as text put the words in the wrong
|
||||
places.
|
||||
|
||||
## Change the words in a picture
|
||||
|
||||
The `mask` output is white inside every box. Use it to change only one part
|
||||
@@ -149,11 +203,13 @@ removes it. The first color also colors the box on the canvas.
|
||||
| `bboxes` | The boxes in pixels of the canvas (x, y, width, height), for nodes that take bounding boxes. A turned box gives the straight box around it. |
|
||||
| `elements` | The boxes as prompt elements. Wire it to MOSS-Image Layout Prompt. A turned box gives the straight box around it, and a turned text box says its slant in its description. |
|
||||
| `mask` | White inside every box, black elsewhere, to change only those places of a picture. A turned box is white inside its turned shape only. |
|
||||
| `h3_prompt` | The boxes as a prompt for MiniMax H3 Image, in words: where each thing goes and how big it is. Name each person's picture and what they do in the box's description. See **Place people with MiniMax H3 Image**. |
|
||||
| `placement` | The boxes as sentences for a prompt: what goes in each box and where, as parts of the picture. Add it to your prompt for a model that has no box input. See **Words for a prompt**. |
|
||||
|
||||
## In place of Create Bounding Boxes
|
||||
|
||||
Layout Boxes has the same inputs and the same outputs in the same order (and
|
||||
`mask` after them), so the wires move straight over. For the same boxes it
|
||||
`mask`, `h3_prompt` and `placement` after them), so the wires move straight over. For the same boxes it
|
||||
gives the same `bboxes` and `elements`, and MOSS-Image Layout Prompt makes the
|
||||
same prompt from them.
|
||||
|
||||
@@ -209,5 +265,32 @@ run once: they fill the canvas. Then remove the old node.
|
||||
- Like Create Bounding Boxes, it is an output node: it runs with the workflow
|
||||
even when nothing is wired to its outputs, so new boxes on the `bboxes` wire
|
||||
reach the canvas.
|
||||
- `h3_prompt` has an opening sentence (one photograph of the scene in
|
||||
`<Picture 1>`, kept as it is), one sentence per box in box order, and a
|
||||
closing one (the same ground and light for everything). Across, a box is at
|
||||
the far left, left, middle, right or far right by its centre; it is "high"
|
||||
or "low" when its centre is in the top or bottom third and it is less than
|
||||
0.6 of the frame tall. Its height and width are said as a tenth, a quarter,
|
||||
a third, half, two thirds, three quarters or all of the frame. Each object
|
||||
is placed against the object on its left when the two share some height:
|
||||
right beside it (a gap under 5% of the frame), a little to the right (under
|
||||
15%), well to the right, or partly in front of or behind it when they
|
||||
overlap (the later box is in front). Text boxes are placed by the frame
|
||||
only. A turned box is placed by the straight box around it. A text box with
|
||||
no text and no description is left out. No boxes give an empty text.
|
||||
- `placement` has one sentence per box, in box order, joined by spaces. A
|
||||
text box with words gives `The words "TEXT" in DESCRIPTION, placed WHERE.`
|
||||
(`The words "TEXT", placed WHERE.` without a description); any other box
|
||||
gives its description, first letter in upper case, then `, placed WHERE.`
|
||||
A box with no words and no description is left out. The description is
|
||||
the one `elements` carries, so a turned text box says its slant. WHERE is
|
||||
a rough place and then the box's edges in whole percents of the canvas,
|
||||
cut to it: `top left, from 6% to 52% across and 6% to 25% down`. The box
|
||||
is "top" when its bottom edge is above 40%, "bottom" when its top edge is
|
||||
below 60%, else "middle"; "left" when its right edge is left of 55%,
|
||||
"right" when its left edge is right of 45%, else "center"; and the middle
|
||||
of both is said as "center" alone. A turned box is placed by the straight
|
||||
box around it. A box with colors gets ` Colors: #FF3399, #00AABB.` after
|
||||
its sentence. No boxes give an empty text.
|
||||
- The background is saved, shrunk, in ComfyUI's temp folder for the node's
|
||||
face. Nothing else is written.
|
||||
|
||||
@@ -5,37 +5,49 @@ clip, a song or any sound a video model or a save node takes, when you want
|
||||
one part of the file and not the whole thing.
|
||||
|
||||
The node shows the whole file as a wave, so you can see where the loud parts
|
||||
are. The part that comes out is bright. Drag the white **IN** and **OUT**
|
||||
handles to set where it starts and stops, drag the bright part to slide it,
|
||||
or click somewhere else on the wave to move it there. You can also type a time
|
||||
under the wave, in seconds (`12.5`) or minutes and seconds (`1:02.5`).
|
||||
are. The part that comes out is bright. Under the wave are three boxes:
|
||||
**Start**, **Duration** and **Ends at**, in seconds. Drag the left handle to
|
||||
move the start, drag the right handle or type a Duration to change how long
|
||||
the sound is, or drag the bright part to slide it. Click somewhere else on
|
||||
the wave to move it there. Typing **Ends at** sets the Duration for you.
|
||||
|
||||
Press **▶** to hear only the part that comes out. **LOOP** plays it again and
|
||||
again.
|
||||
|
||||
## Max length
|
||||
Set the Duration to the length the next step needs, such as the length of
|
||||
the video you are making. An empty Duration runs to the end of the file.
|
||||
|
||||
Set **Max length** to the longest sound the next step can take, such as the
|
||||
length of the video you are making. The start stays where it is, and anything
|
||||
past the limit turns red with a dashed line where it is cut. Next to OUT,
|
||||
the node shows how long the sound that comes out is, such as `15.0 s`. It
|
||||
turns red when part of your pick is cut; hold the mouse over it to see how
|
||||
much, and click it to move OUT to the cut. Play stops at the cut, so what you
|
||||
hear is what comes out. `0` means no limit.
|
||||
A box set by another node, such as Float 🆎, shows a **linked** button that
|
||||
jumps to that node, and the wave shows the part that number picks.
|
||||
|
||||
Max length can be wired. When the wire comes from a number node such as
|
||||
Float 🆎, the wave shows the cut for that number; otherwise the length's tooltip says
|
||||
`max wired` and the run still cuts the sound to the wired length.
|
||||
## Clean up
|
||||
|
||||
Turn **Clean up** on for a voice recording you want a video model to say,
|
||||
such as a line recorded on a phone. The sound that comes out:
|
||||
|
||||
- is one channel,
|
||||
- has the quiet bits at the start and end cut off, so the voice starts right
|
||||
away,
|
||||
- has less hum, rumble and hiss,
|
||||
- is at an even volume, never so loud that it clips.
|
||||
|
||||
A model that copies the sound it is given copies its noise too, so a clean
|
||||
recording gives a cleaner result. Clean up works on the part you picked, so
|
||||
the sound can come out a little shorter than the length shown under the wave;
|
||||
`seconds` always gives the real length. Leave it off for music.
|
||||
|
||||
## Controls
|
||||
|
||||
- **Source** (`audio`): a sound file in ComfyUI's input folder. **Upload**
|
||||
adds one. Videos are listed as well, for their sound.
|
||||
- **Max length** (`max_seconds`): the longest the sound may be, in seconds.
|
||||
`0` means no limit.
|
||||
- **IN** (`start_seconds`): where the sound starts.
|
||||
- **OUT** (`end_seconds`): where the sound stops. `0` means the end of the
|
||||
file.
|
||||
- **Start** (`start_seconds`): where the sound starts.
|
||||
- **Duration** (`max_seconds`): how long the sound is, in seconds. Empty, or
|
||||
`0`, runs to the end of the file.
|
||||
- **Ends at**: where the sound stops. Typing it sets the Duration.
|
||||
A workflow saved with an end time (`end_seconds`) keeps it and runs the
|
||||
same.
|
||||
- **Clean up** (`clean_up`): on cleans up a voice recording, as above. Off
|
||||
hands on the sound as it is.
|
||||
|
||||
## Outputs
|
||||
|
||||
@@ -49,4 +61,11 @@ Float 🆎, the wave shows the cut for that number; otherwise the length's toolt
|
||||
- The sound keeps its own sample rate and channels.
|
||||
- A start past the end of the file stops the run with a message that says so.
|
||||
- The wave is drawn in the browser from the file itself; nothing extra is
|
||||
stored with the workflow besides the four values above.
|
||||
stored with the workflow besides the node's own values.
|
||||
- Clean up runs in this order: the channels are averaged into one; a
|
||||
high-pass at 80 Hz takes out rumble and mains hum; a noise print is
|
||||
taken from the quietest moments and whatever sits close to it is turned
|
||||
down by up to 12 dB (hiss, fans, room tone); quiet ends are cut, keeping
|
||||
0.1 s before the first sound and 0.2 s after the last; then the volume is
|
||||
set to -18 LUFS (the loudness broadcast meters read) with a limiter that
|
||||
keeps every peak under -1 dBFS. The sample rate stays the file's own.
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
# Load Image
|
||||
|
||||
Loads a picture and sets its size in the same node, so a workflow does not
|
||||
need a resize node and a size node after its loader.
|
||||
|
||||
Pick a file in **Source**, press **Load** to upload one, or use the arrows
|
||||
under it to step through the pictures in ComfyUI's input folder. The line
|
||||
beside the arrows shows the size of the file and, when the size changes, the
|
||||
size that comes out:
|
||||
|
||||
`912 × 1632 → 1144 × 2048`
|
||||
|
||||
That is the real output size, worked out before you run.
|
||||
|
||||
Under that line are two small pictures: the file as it goes in, and the
|
||||
picture as it comes out. On the first one the part that is kept is lit and
|
||||
the part that is cut off is dark. Between them the node says the shape
|
||||
(`3:4 → 1:1`) and what happens (`77% size`, `cuts 449 px of height`).
|
||||
|
||||
## Size
|
||||
|
||||
**Size** (`size`) picks how the picture is resized. Each choice shows only
|
||||
the numbers it uses.
|
||||
|
||||
| Choice | What it does | Its number |
|
||||
|---|---|---|
|
||||
| **off** | The picture comes out exactly as the file has it. | none |
|
||||
| **megapixels** | Brings the whole picture to a total size and keeps its shape. | **Megapixels** (`megapixels`): 1.0 is about 1024 × 1024 |
|
||||
| **longest side** | Sets the longer edge; the other edge follows. | **Longest side** (`longest_side`), in pixels |
|
||||
| **scale** | Multiplies both edges. | **Scale** (`scale`): 0.5 is half, 2 is double |
|
||||
| **fit inside** | Makes the picture as big as it can be inside a box, with nothing cut off. | **Width** and **Height** (`width`, `height`) |
|
||||
| **crop to fill** | Covers the box completely and cuts off what sticks out. | **Width** and **Height** |
|
||||
| **crop** | Cuts a piece of that size out of the picture. Nothing is resized. | **Width** and **Height** |
|
||||
| **crop to ratio** | Cuts the largest piece of a shape, such as 16:9, out of the picture. Nothing is resized. | **Ratio** (`ratio`) |
|
||||
|
||||
**Round to** (`multiple`) rounds the new width and height to a multiple of
|
||||
that number. Most models want 8 or 16. Set it to 1 to keep the numbers as
|
||||
they are. It does nothing while Size is off.
|
||||
|
||||
## Which part is kept
|
||||
|
||||
The three crop choices show **Keep** (`crop_from`). It picks the part of the
|
||||
picture that stays: `center` cuts evenly from both sides, `top` keeps the top
|
||||
and cuts from the bottom, `bottom left` keeps that corner, and so on.
|
||||
|
||||
You can also click the first small picture: click its top to keep the top,
|
||||
a corner to keep that corner. The lit part moves so you see what you get.
|
||||
|
||||
In **Ratio**, `width : height` takes the shape from the Width and Height
|
||||
boxes, for a shape that is not in the list (1600 and 900 give 16:9).
|
||||
|
||||
## More
|
||||
|
||||
- **Method** (`method`): how pixels are resampled. `lanczos` is the sharpest
|
||||
for photos. `nearest` keeps pixel art crisp.
|
||||
- **Enlarge** (`enlarge`): on, a small picture is made bigger to reach the
|
||||
size you asked for. Off, a picture is only ever made smaller: one that is
|
||||
already below the target comes out at its own size, and crop to fill cuts
|
||||
the box's shape out of it without growing it.
|
||||
|
||||
## The picture on the node
|
||||
|
||||
The picture under the settings is ComfyUI's own preview, the same one the
|
||||
stock Load Image shows. Drop a file on the node or paste one to upload it,
|
||||
and right-click the node for the mask editor and for copy and paste.
|
||||
|
||||
## Outputs
|
||||
|
||||
- `image`: the picture at its new size.
|
||||
- `mask`: white where the picture is see-through and black where it is
|
||||
solid, as the stock loader gives it. A picture with no transparency gives
|
||||
an all black mask. It is always the same size as `image`.
|
||||
- `width`, `height`: the size that comes out.
|
||||
- `filename`: the file's name without its folder or its ending
|
||||
(`shots/hero.png` gives `hero`), ready for a save node's prefix.
|
||||
- `original_width`, `original_height`: the size of the file before any
|
||||
resize. Use them to bring a result back to the size you started from.
|
||||
|
||||
## Which loader to use
|
||||
|
||||
- **Load Image** (this node): load a picture and set its size.
|
||||
- **Load Image + Pad**: add empty space around a picture for outpainting.
|
||||
- **Image Crop + Rotate + Pad**: turn, crop and pad a picture by hand.
|
||||
|
||||
## Technical details
|
||||
|
||||
- Every frame of an animated file comes through as a batch, all at the same
|
||||
new size. A phone photo is turned the way its EXIF data says.
|
||||
- With Size off the pixels are the file's own, bit for bit, and Round to is
|
||||
not applied.
|
||||
- Rounding moves each edge to the nearest multiple, so the shape can change
|
||||
by up to half a step. Fit inside rounds down instead, so the result never
|
||||
leaves its box.
|
||||
- Crop to fill resizes the picture until it covers the box, then cuts the
|
||||
box out at the side Keep names. The mask goes through the same resize and
|
||||
the same cut.
|
||||
- Crop and crop to ratio only cut. A box larger than the picture is cut down
|
||||
to the picture, and Round to rounds down so the piece stays inside it.
|
||||
Enlarge does not apply to them.
|
||||
- The small pictures are drawn on one scale, so a picture made half as large
|
||||
is drawn half as large.
|
||||
- With Enlarge off, a rounded size is rounded down so it never passes the
|
||||
file's own size.
|
||||
- The size line on the node uses the same arithmetic as the run. The pack's
|
||||
tests hold the two to the same answers over a table of cases.
|
||||
- Files are read only from ComfyUI's input, output and temp folders. A name
|
||||
such as `photo.png [output]` loads a picture ComfyUI made.
|
||||
- The node runs again when the file changes on disk or a setting changes.
|
||||
@@ -1,37 +1,33 @@
|
||||
# Load Video
|
||||
|
||||
Loads a video from ComfyUI's input folder as an `IMAGE` frame batch plus its
|
||||
audio. One responsive player shows the source and previews the selected trim.
|
||||
Drag the high-contrast **IN** and **OUT** handles below it, drag the selected
|
||||
range to move the whole window, or type a time into the two fields, in seconds
|
||||
(`95.5`) or as a timecode (`1:35.5`). Click the strip outside the selection to
|
||||
move the window to that spot.
|
||||
The playhead follows each edit, so the frame at either boundary is visible
|
||||
while trimming. In **Source**, the list plays the clip under the pointer, muted, and filters as you type.
|
||||
audio. The player shows the video; the timing card under it picks the part
|
||||
that comes out.
|
||||
|
||||
Playback is constrained to the selected window. **LOOP** repeats it; turn loop
|
||||
off and playback pauses at OUT. The reload button refreshes the source without
|
||||
creating a second preview. The player takes the height you give the node:
|
||||
drag the node taller for a bigger picture. A tall video is shown whole, never
|
||||
cropped.
|
||||
The timing card has three boxes: **Start**, **Duration** and **Ends at**.
|
||||
Drag the left handle on the bar to move the start, drag the right handle or
|
||||
type a Duration to change how long the clip is, or drag the middle of the
|
||||
clip to slide it. **s | fr** switches every box between seconds and frames;
|
||||
it only changes what you see, never a saved value. **Use as start** starts
|
||||
the clip at the frame in the picture, and **Whole video** puts the clip back
|
||||
to the full file. In **Source**, the list plays the clip under the pointer,
|
||||
muted, and filters as you type.
|
||||
|
||||
**FRAME** switches the loader into a frame picker: the trim strip becomes a
|
||||
single scrub rail, and only the frame at the marker loads — a one-image batch,
|
||||
ready for image workflows without a separate frame-select node. Click or drag
|
||||
anywhere on the rail to choose the frame, or type an exact time into the AT
|
||||
field. Playback runs the whole source freely in this mode so you can hunt for
|
||||
the right moment. Picking a frame moves IN to that time. When you toggle back,
|
||||
OUT stays where it was, unless the frame is at or after OUT: then OUT moves to
|
||||
the end of the video.
|
||||
The player takes the height you give the node: drag the node taller for a
|
||||
bigger picture. A tall video is shown whole, never cropped. **LOOP** plays
|
||||
the clip again and again; with it off, playback pauses at the clip's end.
|
||||
The reload button refreshes the source.
|
||||
|
||||
The label between IN and OUT reports what one Run will actually load — e.g.
|
||||
`0:04.0 of 0:10.0 · 48 frames @ 12 fps`, or `1 frame at 0:05.2` while FRAME
|
||||
is on. The preview cannot re-render `every_nth` frame drops or a `max_frames`
|
||||
cap, so it counts them instead: the frame total and playback rate come from
|
||||
the source's real frame rate (probed from the file, since the browser's
|
||||
player never exposes it) with `every_nth` and `max_frames` applied. When a
|
||||
deciding value arrives over a link, or the rate cannot be probed, the count
|
||||
drops out rather than guessing.
|
||||
**FRAME** turns the loader into a frame picker: only the frame at the marker
|
||||
loads, as a one-image batch, ready for image workflows without a separate
|
||||
frame-select node. Drag the bar to choose the frame, or type it into the
|
||||
**FRAME** box. Playback runs the whole video in this mode so you can hunt for
|
||||
the right moment. Picking a frame moves the clip's start there.
|
||||
|
||||
The boxes count real frames: the frame rate and frame count come from the
|
||||
file itself, so a 4.1 s clip at 60 fps reads 247 frames, the same number
|
||||
the run loads. When a box is set by another node it shows a **linked**
|
||||
button that jumps to that node.
|
||||
|
||||
## Drop a video onto the node
|
||||
|
||||
@@ -48,21 +44,21 @@ embedded workflow replaces the whole graph.
|
||||
|
||||
- **Source** (`video`): A file in the input folder; **Upload** adds new ones.
|
||||
A video ComfyUI made, named like `clip.mp4 [output]`, loads too.
|
||||
- **IN** (`start_seconds`): Skip everything before this time.
|
||||
- **OUT** (`end_seconds`): Stop at this time; `0` means the source end until a
|
||||
handle is moved.
|
||||
- **Every nth** (`every_nth`): Keep one frame in this many — `2` halves the frame count.
|
||||
The `fps` output divides to match, so the clip still plays at real speed
|
||||
downstream.
|
||||
- **Limit** (`max_frames`): Stop after this many kept frames; `0` loads the
|
||||
whole trim window. Caps memory on long clips — the decode ends early
|
||||
instead of loading and discarding.
|
||||
- **LOOP**: Repeat the selected window during preview. It starts on and is
|
||||
saved with the workflow.
|
||||
- **FRAME** (`single_frame`): Load only the frame at the IN time (the field
|
||||
reads **AT** while FRAME is on) as a one-image batch; `end_seconds`,
|
||||
`every_nth`, and `max_frames` are ignored while it is on.
|
||||
- **↻**: Reload the selected source preview.
|
||||
- **Start** (`start_seconds`): Skip everything before this time.
|
||||
- **Duration** (`max_frames`): How many frames the clip keeps. **Whole
|
||||
video** removes the limit, so the clip runs to the end (the widget holds
|
||||
`0`). The decode stops early, so a short clip from a long video stays
|
||||
quick.
|
||||
- **Ends at**: Where the clip stops. Typing it sets the Duration. A
|
||||
workflow saved with an end time (`end_seconds`) keeps it and runs the same.
|
||||
- **Every nth** (`every_nth`): Keep one frame in this many; `2` halves the
|
||||
frame count. The `fps` output divides to match, so the clip still plays at
|
||||
real speed downstream.
|
||||
- **LOOP**: Repeat the clip during preview. It starts on and is saved with
|
||||
the workflow.
|
||||
- **FRAME** (`single_frame`): Load only the frame at the marker as a
|
||||
one-image batch; the Duration and Every nth are ignored while it is on.
|
||||
- **↻**: Reload the source preview.
|
||||
- **Width** / **Height** (`custom_width` / `custom_height`): `0` keeps the
|
||||
source size. Set one side only and the other follows the aspect ratio,
|
||||
rounded to an even number.
|
||||
|
||||
@@ -134,6 +134,64 @@ A group that a switch turns on and off shows the lock on its header
|
||||
instead. The LoRAs in it keep plain grips, so each one is still yours to
|
||||
turn on or off. Click the header's lock to take the group over.
|
||||
|
||||
## A strength set by a wire
|
||||
|
||||
To set one LoRA's strength from somewhere else, such as a slider, a Float
|
||||
node or a sweep, drag that number's wire onto the row and let go. The row
|
||||
under the pointer lights up teal while you aim; anywhere across the row
|
||||
works. The wire runs to that row and its strength box turns dashed teal,
|
||||
showing the number coming in. The bar behind the name follows it.
|
||||
|
||||
- **Click the dashed box** to jump to the node the number comes from.
|
||||
- **Right-click the row → Unlink strength** to take the wire off. The row
|
||||
goes back to the strength it had.
|
||||
- The wire sets the model strength. The CLIP strength keeps the same ratio
|
||||
to it, so a row at 1.0 / 0.5 fed 0.6 runs at 0.6 / 0.3.
|
||||
- Gear menu → **Linked strength wires** shows the wire (the default), shows
|
||||
it only while the pointer is on the loader or the number's node, or hides
|
||||
it.
|
||||
|
||||
### Technical details
|
||||
|
||||
Each linked row has its own input, `strength_<row id>`, which exists only
|
||||
while something is linked to that row. It takes FLOAT or INT. In an API
|
||||
prompt, give a row's input the row's `id` from the `loras` text, for example
|
||||
`"strength_ra1": 0.6`. A name that matches no row is ignored.
|
||||
|
||||
## Strength over the run
|
||||
|
||||
A row can change strength while the picture is made: strong at the start
|
||||
and gone by the end, say, so a style LoRA sets the look and the fine detail
|
||||
at the end comes out clean.
|
||||
|
||||
1. Wire a Strength Curve 🆎 into the loader's `curve` input.
|
||||
2. Each row now shows a small curve mark beside its strength. The first
|
||||
curve you wire marks every row (teal). Click a mark, or right-click the
|
||||
row and pick **Keep a steady strength**, for a row that should stay as
|
||||
it is; its mark turns gray. **Follow the strength curve** in the same
|
||||
menu turns it back on.
|
||||
|
||||
A row that follows the curve runs at its own strength times the curve: a row
|
||||
at 0.8 with a fade out goes from 0.8 down to 0. It works with every model
|
||||
file: full size, fp8, fp8 scaled and int8.
|
||||
|
||||
### Technical details
|
||||
|
||||
The CLIP half of a row is applied as always, since a prompt is encoded once.
|
||||
The model half is loaded in ComfyUI's bypass mode: the LoRA is added to each
|
||||
layer's result as the layer runs, and the model's weights are never
|
||||
rewritten. Before every step the loader sets each following row to its
|
||||
strength times the curve at that step. "Where in the run" is read by the
|
||||
step's noise level, the way ComfyUI reads hook keyframes, so it lines up
|
||||
with Krea 2 Encode's `reference_curve`. In the `loras` text a following row
|
||||
has `"curve": true`; in an API prompt, link `curve` and set that on the rows.
|
||||
|
||||
A moving curve costs a little speed and no memory: on Krea 2 each step ran
|
||||
3 to 8% slower, the same on every model file we tried. A flat curve
|
||||
skips all of this: the rows just run at their strength times its value. The
|
||||
rare parts of a LoRA that are not low-rank (a plain weight or bias
|
||||
difference) cannot change from step to step and stay at the row's strength.
|
||||
|
||||
## Strength bars
|
||||
|
||||
Every named row paints a center-zero bar behind its name: teal grows right
|
||||
@@ -176,8 +234,15 @@ last one you ticked and the one you click. Ticks stay while you search, so you c
|
||||
gather files from several searches; **Clear** unticks them all. Files that
|
||||
are already in the stack say **in stack** and have no box. With the
|
||||
keyboard, **Ctrl+Enter** ticks the highlighted file and **Shift+Enter**
|
||||
ticks the run up to it. Use the arrow beside a folder to collapse or expand it without
|
||||
adding anything. Folded folders are remembered in this browser. Search
|
||||
ticks the run up to it. The list opens with every folder folded. Use the
|
||||
arrow beside a folder to open or fold it without adding anything.
|
||||
**Open all** beside the search box opens every folder at once (it then
|
||||
reads **Fold all**), and **Alt**- or **Shift**-click on a folder's arrow
|
||||
opens or folds that folder and every folder inside it. With the keyboard,
|
||||
**Right** opens the highlighted folder and **Left** folds it; **Left** on a
|
||||
file folds the folder it is in and moves up to it. To have the list open
|
||||
the way you left it instead, set **Settings → 🆎 AusBoss → LoRA Loader →
|
||||
Picker folders** to **Remember my folds**. Search
|
||||
reveals matching files; clearing it brings back your folded view. You can
|
||||
also fold folders while searching.
|
||||
|
||||
@@ -266,6 +331,14 @@ red with advice to re-pick. Thumbnails, the info card, and range lookups
|
||||
all use the resolved name, so a moved file keeps its previews and Civitai
|
||||
data.
|
||||
|
||||
A missing LoRA is also listed in ComfyUI's own missing-models list (the
|
||||
Issues panel, and the "Download all" button) next to the other models the
|
||||
workflow needs, with a Download button when the workflow saved where the
|
||||
file comes from. Rows that are switched off, at zero strength, or whose
|
||||
file moved folders are left off that list, because the run does not need
|
||||
them or finds them anyway. Rows that come into the node over a link are
|
||||
listed by the node that sets them, not here.
|
||||
|
||||
The run side matches: a stale saved path resolves by name at load time
|
||||
(exact → unique case-insensitive path → unique basename, with a one-line
|
||||
console note when it remaps). A LoRA that is genuinely missing **stops the
|
||||
@@ -308,6 +381,16 @@ show it right away. Gear menu → **Civitai picture** picks which pictures:
|
||||
takes the first picture whatever its rating, and **off** saves none. It never
|
||||
replaces a picture you already have.
|
||||
|
||||
**All of them at once:** click **Fetch all LoRAs** beside that button (or gear
|
||||
menu → **Civitai info for every LoRA**). It looks up every LoRA in the stack that
|
||||
has no Civitai info yet, one after another with a short pause, so Civitai
|
||||
is not asked too fast. The bottom of the node shows how far it is
|
||||
(`Civitai 12 / 44 · Stop`); click it to stop after the LoRA being fetched.
|
||||
A message at the end says how many were found, how many Civitai does not
|
||||
know, and how many already had their info. LoRAs with info are skipped, so
|
||||
running it again only fetches the new ones. It follows the same
|
||||
**Civitai picture** setting and never replaces a picture.
|
||||
|
||||
## Trigger words
|
||||
|
||||
The info card gathers words from three places: the LoRA file's own metadata,
|
||||
@@ -328,10 +411,17 @@ switched on for the old one.
|
||||
(see "Get the pictures from Civitai" above). After that the button reads **Refresh Civitai
|
||||
info** and the card gets a **View on Civitai** link. A LoRA Civitai does
|
||||
not know (unpublished or hidden) reads **Not found on Civitai**. Gear
|
||||
menu → **Civitai lookup button** removes the button. When a lookup fails,
|
||||
menu → **Civitai lookup button** removes the button, and **Fetch all LoRAs**
|
||||
with it. When a lookup fails,
|
||||
a message says why. If it always says it could not reach civitai.com,
|
||||
check whether ComfyUI was started with `--disable-api-nodes`: that setting
|
||||
stops the browser from reaching any other site, Civitai included.
|
||||
- **Fetch all LoRAs** runs that same lookup for each LoRA in the stack that has no
|
||||
Civitai info yet, one at a time, about one and a half seconds apart. If
|
||||
Civitai answers "too many requests", it waits 20 seconds and tries that
|
||||
LoRA once more; a second time, it stops and says so. It also stops when
|
||||
civitai.com cannot be reached, or after three failures in a row. Only one
|
||||
Fetch all LoRAs runs at a time on the page.
|
||||
- **Suggested strength**: a lowest and a highest value at the bottom of the
|
||||
card (leave one empty for "any"). It is only a reminder: a row set outside
|
||||
it shows its number in orange, and the tooltip gives the range. Saved per
|
||||
|
||||
@@ -19,8 +19,8 @@ What is lit in teal is what the mask will be. When it is right, press Run
|
||||
for the whole workflow.
|
||||
|
||||
The first time the pointer rests on a picture, the node looks at it. A
|
||||
small button under the picture shows how far along it is, **❚❚ 40/104**,
|
||||
filling up as it goes. The first things light up after a few seconds, and
|
||||
button under the picture shows how far along it is, **❚❚ Pause · looking
|
||||
40/104**, filling up as it goes. The first things light up after a few seconds, and
|
||||
it has seen the whole picture after about 20.
|
||||
|
||||
You do not have to wait for that. Whatever is lit under the pointer can be
|
||||
@@ -28,7 +28,7 @@ picked: a click takes it at once, also while the node is still looking.
|
||||
|
||||
Click that button to pause the looking when what you need is already lit:
|
||||
what is lit stays, and you go on picking and painting. It turns into
|
||||
**▶**; click it to look on from where it stopped. A click on a spot where
|
||||
**▶ Look on**; click it to look on from where it stopped. A click on a spot where
|
||||
nothing is lit yet looks on as well.
|
||||
|
||||
A click on a spot where nothing is lit yet is not lost: a dot marks it, the
|
||||
@@ -50,6 +50,9 @@ at that spot.
|
||||
A stroke across two things, like both shoes, takes both.
|
||||
- Did the thing not light up at all? Type its name into the field under the
|
||||
picture, like "screen" or "earring", and press Enter.
|
||||
- Is something in the mask that should not be, like the face or the hair of
|
||||
a person you picked? Click the **+** in front of that field so it shows
|
||||
**−**, type "face" and press Enter. Or hold Ctrl and click the face.
|
||||
- When nothing fits, switch to **Paint** and paint the area yourself.
|
||||
|
||||
## The whole subject, or the background
|
||||
@@ -59,6 +62,10 @@ click: the person, the animal, the product. **Background** picks everything
|
||||
else. They are picks like any other: click more things to add them, or
|
||||
Ctrl-click a thing to take it away again.
|
||||
|
||||
Ctrl-click takes away the thing under the pointer, where it is in the mask.
|
||||
On a spot where nothing is picked it changes nothing, and the picture says
|
||||
so.
|
||||
|
||||
Both need ComfyUI's background-removal model, see "The model for Fine
|
||||
edges" below.
|
||||
|
||||
@@ -115,8 +122,11 @@ or an area you painted.
|
||||
it.
|
||||
- **all 3** on a chip takes every thing of that name instead of the one you
|
||||
clicked: all five birds, both shoes.
|
||||
- The field at the end, **+ type a name**, picks every thing of the name
|
||||
you type. With Erase chosen it takes them away.
|
||||
- The field at the end picks every thing of the name you type. The sign in
|
||||
front of it says what happens to the name: **+** adds it, **−** takes it
|
||||
away. Click the sign to change it. A name typed with a minus in front,
|
||||
like "-face", is taken away whatever the sign shows. With Erase chosen the
|
||||
sign starts on **−**.
|
||||
|
||||
## The tools on the node
|
||||
|
||||
@@ -160,6 +170,9 @@ or an area you painted.
|
||||
everything except what you picked.
|
||||
- **More → If nothing** (`if_nothing`): **stop the run** or **empty mask**,
|
||||
see below.
|
||||
- **More → New picture** (`new_picture`): **keep picks** or **start over**,
|
||||
for when a different picture comes in. See "Which picture the picks belong
|
||||
to" below.
|
||||
- **More → Free VRAM** (`free_vram`): takes SAM 3 out of the graphics card's
|
||||
memory right after the search, so the next model has the room. Turn it on
|
||||
in a workflow that loads a big model after this node.
|
||||
@@ -182,6 +195,35 @@ used ComfyUI's Remove Background template, you already have it.
|
||||
A workflow that already has Fine edges on tells ComfyUI which file it needs,
|
||||
so ComfyUI lists it under **Missing Models** with a download button.
|
||||
|
||||
### RMBG-3.0: softer hair, bigger and slower
|
||||
|
||||
Bria's RMBG-3.0 keeps loose strands, fur and lace that BiRefNet cuts into a
|
||||
hard edge. Once its files are in place, **Fine edges** offers **RMBG-3.0**
|
||||
next to **BiRefNet**, and **Subject** and **Background** use the one you pick.
|
||||
Fine edges still starts at **off**, and while it is off, Subject and
|
||||
Background use BiRefNet.
|
||||
|
||||
It costs more: about 14 GB of files, up to about 17 GB of graphics memory (a
|
||||
24 GB card), and
|
||||
about 2 seconds a picture once it is loaded, where BiRefNet takes under one.
|
||||
The first picture also waits while it loads. Its licence
|
||||
is non-commercial (CC BY-NC 4.0): for paid work, Bria sells a licence. Keep
|
||||
BiRefNet for that.
|
||||
|
||||
From the Hugging Face page `briaai/RMBG-3.0-Comfy`:
|
||||
|
||||
1. `diffusion_models/rmbg3_int8_convrot.safetensors` into
|
||||
`ComfyUI/models/diffusion_models`.
|
||||
2. `text_encoders/qwen3vl_4b_int8_convrot.safetensors` into
|
||||
`ComfyUI/models/text_encoders`.
|
||||
3. `vae/flux2-vae.safetensors` into `ComfyUI/models/vae`.
|
||||
4. Press **R**, then set **Fine edges** to **RMBG-3.0**.
|
||||
|
||||
It needs ComfyUI 0.43 or newer. Keep the model's file name starting with
|
||||
`rmbg3`: that is how the node knows it. After moving a file into a
|
||||
subfolder, pick it again under Fine edges. With both of Bria's copies (int8
|
||||
and bf16), Fine edges says which is which.
|
||||
|
||||
Good to know:
|
||||
|
||||
- Fine edges works on the outline of the main subject: a person's hair
|
||||
@@ -209,11 +251,17 @@ nothing instead.
|
||||
|
||||
## Which picture the picks belong to
|
||||
|
||||
Picks belong to the picture they were made on. Load another picture and the
|
||||
node shows it with nothing picked, and says the old picks are not used.
|
||||
If the workflow runs before the node has shown the new picture, the run
|
||||
stops and says the picks were made on another picture. The new picture
|
||||
shows on the node then, ready to pick from.
|
||||
Picks belong to the picture they were made on. When a different picture
|
||||
comes in, **New picture** (under More) decides what happens to them:
|
||||
|
||||
- **Keep picks** (the default): your clicks and paint move onto the new
|
||||
picture, in the same places. On a picture of another size they are
|
||||
scaled to fit it. A click finds whatever is at that spot now; paint stays
|
||||
exactly as painted. Press **Clear** to start over.
|
||||
- **Start over**: the node shows the new picture with nothing picked. If the
|
||||
workflow runs before you pick again, the run stops and says the picks
|
||||
were made on another picture. The new picture shows on the node then,
|
||||
ready to pick from.
|
||||
|
||||
- **The reload button** (the round arrow beside Undo) shows the picture
|
||||
coming in now. Use it after you change the picture before this node, for
|
||||
@@ -264,6 +312,15 @@ then.
|
||||
|
||||
### How SAM 3 is asked
|
||||
|
||||
- A picture whose long side is over 2048 pixels is asked about on a copy
|
||||
with its long side at 2048. SAM 3 reads every picture at 1008 pixels
|
||||
anyway, and returns each answer at the size it was given, on the graphics
|
||||
card: at 8192 pixels one word with many matches needed over 27 GB. The
|
||||
answer is brought back to the picture's own size, so the mask, the cut-out
|
||||
and your touches stay in pixels of the picture. Paint is never scaled.
|
||||
Measured on a 3840 pixel picture, five words: the new masks share 95 to
|
||||
99.6 % of their area with the old ones, the edge sits a median 0 to 2
|
||||
pixels differently, and a look takes 31 seconds in place of 53.
|
||||
- The search is ComfyUI's own SAM 3: SAM3 Detect, asked about points, or
|
||||
about a word that CLIP Text Encode has read. Both use ComfyUI's own
|
||||
settings (threshold 0.5, two edge passes). The node needs ComfyUI 0.20 or
|
||||
@@ -324,7 +381,10 @@ no browser:
|
||||
used.
|
||||
- **`paint`**: exactly the stroke's own area. SAM 3 is not asked.
|
||||
- **`key`** names the picture the picks were made on: its size and a
|
||||
fingerprint of every pixel. Picks made on another picture are ignored.
|
||||
fingerprint of every pixel. Picks made on another picture are moved onto
|
||||
the one that came in, scaled from the size in their key to its size, and
|
||||
the face is sent the moved touches. With `new_picture` set to `start
|
||||
over` they are ignored instead.
|
||||
Leave `key` out when you write `touches` by hand.
|
||||
|
||||
### How an area is tidied
|
||||
@@ -394,6 +454,15 @@ no browser:
|
||||
node, the plain edge is shown instead, with the same line.
|
||||
- **Free VRAM** unloads this model as well.
|
||||
|
||||
With RMBG-3.0 the subject comes from ComfyUI's own nodes, run the way Comfy's
|
||||
RMBG-3.0 template runs them: its fixed matting instruction, 4 steps, cfg 1,
|
||||
euler, simple, seed 42. The picture is stretched (never cropped) to about one
|
||||
megapixel in steps of 16 pixels, and the red channel of what it paints is
|
||||
scaled back to the picture's size, so the matte lines up pixel for pixel. Its
|
||||
model, text reader and VAE are loaded once and kept, and Free VRAM unloads all
|
||||
three. One copy is held at a time, and it is unloaded before BiRefNet runs.
|
||||
Each picture of a batch is worked out once per run, however long the batch.
|
||||
|
||||
### The things that light up
|
||||
|
||||
- The node asks SAM 3 about a picture in this order: the place under the
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
# Pause for Shot 🆎
|
||||
|
||||
Stops the run right after the 3D viewer so you can frame your shot on the
|
||||
model it just made. Turn the camera, zoom, spin the model, then press
|
||||
**Continue**, on this node or on the bar over the viewer. The run goes on with
|
||||
the shot exactly as the viewer shows it, and nothing before this node runs
|
||||
again. **Stop** ends the run here.
|
||||
|
||||
## How to wire it
|
||||
|
||||
Put it between a **Preview 3D (Advanced)** viewer and the node that renders
|
||||
the shot (such as Render Mesh): the viewer's `model_3d_info`, `camera_info`,
|
||||
`width` and `height` go in, and the same four come out.
|
||||
|
||||
## A 360 behind the model
|
||||
|
||||
Wire a 360 picture (twice as wide as tall) into `panorama`. While the run
|
||||
waits, the viewer shows it behind the model, and `backdrop` gives the part of
|
||||
it the camera sees, at the shot's size. Put the shot on top of `backdrop` and
|
||||
the model and its background can be treated apart, such as blurring one and
|
||||
not the other.
|
||||
|
||||
**Shadow** on the viewer's Backdrop tab puts a soft shadow on the floor under
|
||||
the model, so it stands on the 360 instead of floating in front of it. The
|
||||
viewer shows it while you frame, and `backdrop` carries the same shadow.
|
||||
|
||||
Take the 360 out of the viewer while the run waits, and `backdrop` comes out
|
||||
plain grey, the same as with no 360 wired in. What you see in the viewer is
|
||||
what you get.
|
||||
|
||||
## Cut the front or back off the model
|
||||
|
||||
**Cut front** and **Cut back** on the viewer's Model tab take away part of
|
||||
the model as the camera sees it: Back the far side, Front the near side, each
|
||||
as a share of the model's depth. Use Back to hide what should sit behind
|
||||
something in the picture, such as the inside of a hat behind the head. The
|
||||
viewer shows the cut as you drag.
|
||||
|
||||
For the shot to be cut too, wire the model's mesh into `mesh` and take `mesh`
|
||||
from this node to Render Mesh. A run that goes straight through uses the cut
|
||||
saved on the viewer.
|
||||
|
||||
## Settings
|
||||
|
||||
- **Pause**: *wait for me* stops every run here. *run through* lets runs go
|
||||
straight on with the camera as it was when you pressed Run, for runs nobody
|
||||
is watching. The viewer's 360 settings and Cut go along as they were then
|
||||
too, and changing one makes the next run redo the shot.
|
||||
|
||||
## Technical details
|
||||
|
||||
- Why it is needed: a run takes the camera from the moment Run is pressed. A
|
||||
camera moved after that never reaches it, so without a pause you would press
|
||||
Run a second time.
|
||||
- Continue sends the viewer's camera, the model's turn and the size as
|
||||
numbers to the pack's own route. Only a node that is waiting accepts it.
|
||||
- A run that goes straight through takes the viewer's 360 settings and Cut
|
||||
from the hidden `view` input, which the page fills from the viewer as Run
|
||||
is pressed. ComfyUI only runs a node again when one of its inputs changes,
|
||||
so they ride in an input rather than in the saved workflow. A prompt sent
|
||||
without the page can fill `view` with the same JSON (`{"sky": {...},
|
||||
"cut": {...}}`) or leave it empty for the defaults.
|
||||
- Cancel in ComfyUI's queue ends a pause too. A page reloaded during a pause
|
||||
shows the Continue bar again.
|
||||
- Every open page gets the model to frame, not only the one that pressed Run:
|
||||
ComfyUI sends a viewer's result only to that page, so the pause sends it
|
||||
again to all of them.
|
||||
- The floor grid and shadow sit at the lowest point the viewer finds. On
|
||||
large models it checks a sample of points. The shadow covers the bottom
|
||||
tenth of the model. Continue sends that patch with
|
||||
the camera, and the backdrop is darkened along the same rays Render Mesh
|
||||
casts, so the shadow lands where the model's feet are drawn.
|
||||
- The cut planes face the camera. The model's depth is how far the box around
|
||||
its own points reaches along the view, measured the same way in the viewer
|
||||
and on the run's mesh. The viewer cuts at the exact plane; the mesh keeps
|
||||
the triangles whose middle lies between the planes, so the edges agree to
|
||||
within a triangle. While a cut is on, the viewer draws both sides of the
|
||||
model, so through the cut you see its inside, the way Render Mesh draws it.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Photo Camera 🆎
|
||||
|
||||
Works out the camera your photo was taken with, so a 3D model of the person
|
||||
lines up with the photo. With it, the 3D viewer opens on your photo's own
|
||||
view: same height, same lens, the person where they stand in the photo. Move
|
||||
the camera from there and the shot starts from something real instead of a
|
||||
guess.
|
||||
|
||||
It is made for **Pixal3D**, the TRELLIS 2 model in ComfyUI that builds the
|
||||
model lined up with the photo.
|
||||
|
||||
## How to wire it
|
||||
|
||||
- `image`: your photo, the one **Crop to Mask** cuts the person from.
|
||||
- `mask`: the person's mask, the same one Crop to Mask uses.
|
||||
- `fov`: how wide the photo is, in degrees. Wire **Get FoV from MoGe**
|
||||
(horizontal, degrees) here, run on the same photo. Without MoGe, 55 suits
|
||||
most phone photos.
|
||||
|
||||
Then:
|
||||
|
||||
- `crop_fov` goes into **Pixal3D Conditioning**'s `fov`.
|
||||
- `camera_info` goes into the 3D viewer's `camera_info`
|
||||
(**Preview 3D (Advanced)**). The viewer opens on the photo's view.
|
||||
- `strip_width`, `strip_x` and `strip_y` say where the photo goes on the 360
|
||||
canvas: its width (into an Image Scale) and its left and top edges (into
|
||||
the Image Composite that lays it on the canvas). The 360 then lines up
|
||||
with the camera. Turn the 360 by 90 on the viewer's Angle tab so its middle
|
||||
sits behind the model.
|
||||
|
||||
## Settings
|
||||
|
||||
- **Lens**: the photo's field of view across, in degrees.
|
||||
- **Crop margin** (under **More**): the margin Crop to Mask adds around the person.
|
||||
Keep it the same as Crop to Mask's `pad_factor`.
|
||||
- **360 width** (under **More**): the width of the 360 canvas.
|
||||
|
||||
## Technical details
|
||||
|
||||
- Pixal3D builds from a square crop around the person and the crop's field of
|
||||
view. Its model comes out with +Y up, and with the crop's camera on +Z
|
||||
looking at the middle from 0.5 / tan(crop_fov / 2) away.
|
||||
- The whole photo was taken from the same point. Its centre is off the crop's
|
||||
middle, so the photo's camera is the crop's camera turned towards the
|
||||
photo's centre, with no roll. Render Mesh and the viewer can show a turn
|
||||
but not a shifted sensor, which is what a crop really is. A person near the
|
||||
middle lands to the pixel. A fifth of the frame off centre, the model's far
|
||||
edges move by up to 3% of the frame's width; up in a corner with a wide
|
||||
lens, up to 8%.
|
||||
- The crop box is the one Crop to Mask cuts: the node asks ComfyUI's own crop
|
||||
helper for it, and measures it the same way itself on a ComfyUI without
|
||||
that helper.
|
||||
- The photo is laid on the 360 canvas flat, at its own width in degrees, with
|
||||
its centre where the camera's axis meets the canvas.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Prompt Variations
|
||||
|
||||
A prompt box that changes on every run. Write choices in curly brackets and
|
||||
the node picks one from each set:
|
||||
|
||||
```text
|
||||
A woman in a {plain|striped|patterned} {tank top|sweater|button-up shirt}
|
||||
and {jeans|a pleated skirt|cargo shorts}, {standing|sitting on a stool|leaning on the wall}.
|
||||
```
|
||||
|
||||
One run might give "A woman in a striped sweater and jeans, sitting on a
|
||||
stool." The next gives another mix.
|
||||
|
||||
Use it to make many different pictures in one go. Wire in the seed, set the
|
||||
Seed node to **randomize**, and set the number of runs next to the Run
|
||||
button to 50. Each run gets a new seed, so each picture gets new choices.
|
||||
|
||||
## Controls
|
||||
|
||||
- The text box (`text`): your prompt. Put each set of choices in curly
|
||||
brackets and split the choices with `|`. Write as many sets as you like,
|
||||
each with as many choices as you like.
|
||||
- `seed` (a socket): the seed your sampler uses. A new seed picks new
|
||||
choices. The same seed picks the same ones again, so a picture you like
|
||||
can be made again from its seed.
|
||||
|
||||
## Output
|
||||
|
||||
- **prompt**: your text with one choice picked from each set. Wire it to
|
||||
Show Text to see what was picked.
|
||||
|
||||
## Tips
|
||||
|
||||
- An empty choice lets a part come and go: `a {|striped} shirt` gives "a
|
||||
shirt" or "a striped shirt".
|
||||
- Sets can go inside sets: `{a {red|blue} hat|a scarf}`.
|
||||
- Text without curly brackets comes out exactly as typed.
|
||||
- To make one choice come up more often, write it more than once:
|
||||
`{jeans|jeans|skirt}`.
|
||||
|
||||
## Technical details
|
||||
|
||||
Only brackets that hold a `|` are choices. Brackets without one are left as
|
||||
they are, so a JSON prompt such as `{"light": "soft"}` passes through
|
||||
unchanged. A `|` inside JSON brackets still counts as a choice.
|
||||
|
||||
The innermost sets are picked first, from left to right, with Python's
|
||||
`random.Random(seed)`. The same text and seed always give the same prompt,
|
||||
on any machine. Spaces around each choice are trimmed, and an empty pick
|
||||
also drops the one space in front of it.
|
||||
|
||||
The picks happen when the prompt runs, on the server, not in the browser.
|
||||
ComfyUI's own `{a|b}` choices in some text boxes are picked by the browser
|
||||
when you queue, with no seed; this node does not use them.
|
||||
@@ -31,8 +31,8 @@ names from here on; how it measures may still improve.
|
||||
moved a boat keeps the boat where it drew it, so the result lines up
|
||||
closely, not pixel for pixel.
|
||||
- **Leaves alone:** a picture it can't measure, or a zoom bigger than
|
||||
**Max zoom**. That picture only comes out resized, and the report says
|
||||
why.
|
||||
**Max zoom** after allowing for padded reframing. That picture only
|
||||
comes out resized, and the report says why.
|
||||
|
||||
## Controls
|
||||
|
||||
@@ -50,8 +50,10 @@ names from here on; how it measures may still improve.
|
||||
with nothing in it. `edge` (the default) stretches the nearest pixels
|
||||
into it, `source` fills it from the original, `gray` fills it flat gray
|
||||
for inpainting. With a big enough margin there is no strip.
|
||||
- **Max zoom**: the biggest zoom it will undo, in percent (20 by default).
|
||||
Anything bigger is treated as a change you meant and left alone.
|
||||
- **Max zoom**: the zoom limit in percent (20 by default). For a padded
|
||||
picture, zooming in to fill the padding gets an extra allowance; the
|
||||
setting limits zoom beyond that. Zooming out still uses the stated limit.
|
||||
Anything beyond those limits is treated as a change you meant and left alone.
|
||||
|
||||
## Outputs
|
||||
|
||||
@@ -121,6 +123,10 @@ new cloud, are left out. It trusts the fit when at least 10 blocks, and at
|
||||
least a quarter of them, agree. With a stitcher, the blocks tile the
|
||||
picture's area only.
|
||||
|
||||
For padded reframing, the extra zoom-in allowance on each axis is the
|
||||
canvas size divided by the source picture's size, minus one. It is added
|
||||
to **Max zoom**; zooming out gets no extra allowance.
|
||||
|
||||
It runs on the CPU in a fraction of a second per 1 MP frame. No new
|
||||
dependencies, and no model.
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ quick brush before the mask goes to an inpainter. It can also snap the edge
|
||||
to a guide image and adjust the mask's levels. Both the refined mask and its
|
||||
inverse are returned, so no separate invert node is needed.
|
||||
|
||||
You can run it on its own, with nothing wired after it, to check the mask
|
||||
before the rest of the graph runs.
|
||||
|
||||
The panel shows the refined mask itself once the node has run, so the effect
|
||||
of a setting is visible without wiring a preview node beside it. With a batch
|
||||
or a video it shows the first mask. The small
|
||||
@@ -58,12 +61,19 @@ run the workflow again. The switch is the node's optional `preview` input.
|
||||
- **Edge** (`edge_refine`): `off`, **guided** (`guided filter`), or
|
||||
`matting`. Both refinements snap the mask edge to the connected
|
||||
**guide_image** and run per frame, so video batches stay interruptible:
|
||||
- `guided filter` — fast edge-aware filtering of the soft mask against the
|
||||
guide image. The filter radius scales with **Expand**.
|
||||
- `matting` — closed-form alpha matting: the binarized mask eroded by the
|
||||
edge radius counts as definite foreground, the dilation marks where
|
||||
definite background begins, and the band between is solved against the
|
||||
guide image. Pair it with the levels remap to tidy the solved alpha.
|
||||
- `guided filter` — fast. Pulls the mask's edge onto the edges in the
|
||||
guide image, which picks up thin parts and loose strands a rough mask
|
||||
missed. **Detail range** sets how far it looks.
|
||||
- `matting` — slower and finer. Softens the mask's edge over a wide band
|
||||
and works out the real edge inside it from the guide image. Pair it
|
||||
with the levels remap to tidy the result.
|
||||
- **Detail range** (`detail_range`): How far from the mask's edge to look
|
||||
for the real edge, `12` by default. Raise it for hair or a loose mask,
|
||||
lower it for a small subject. Used only while **Edge** is on.
|
||||
- **Fix threshold** (`fix_threshold`): How much of the softened edge
|
||||
matting may rework. The default, `0.01`, lets it fix the whole edge;
|
||||
higher values trim the mask inward. Used only while **Edge** is
|
||||
`matting`.
|
||||
- **guide_image** (optional input): RGB frames the mask belongs to, matching
|
||||
the mask's size; one frame is broadcast across a mask batch. Required when
|
||||
`edge_refine` is not `off`.
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
Pick a picture size by shape and megapixels, or by dragging. Use it in place of an Empty Latent node: it gives you the width, the height and a blank latent of that size.
|
||||
|
||||
- **Shape:** the left button selects landscape or portrait. Ratio chips follow that choice; square retains it for the next selection. Clicking a chip uses its generated size near one megapixel. Enable **Chips keep current budget** in the gear to retain the current area.
|
||||
- **Shape:** the left button selects landscape or portrait. Ratio chips follow that choice; square retains it for the next selection. Clicking a chip changes the shape and keeps your current megapixels. To have a chip jump to its size near one megapixel instead, turn off **Chips keep current budget** in the gear.
|
||||
- **Canvas:** drag a side to change one dimension; drag the corner to scale both. Shift frees the corner ratio, Alt removes snapping, and Escape cancels the drag. The bright readout shows the size, megapixels and ratio; an amber dot means the size is off the snap grid, which a typed size can be. Arrow keys nudge the focused canvas by the snap step, or by 8 px with Shift.
|
||||
- **Size & budget:** scrub or type W, H, or MP. Typed dimensions are preserved exactly. The swap button exchanges dimensions. The **Sizes** chips are ready-made sizes for the current ratio, small to large. They show while the shape is one of the ratio chips; any other shape shows one greyed-out "custom" chip.
|
||||
- **Gear:** set the **Snap step**, edit the **Ratio rail**, choose the **Latent family** (`latent`) and **Batch size** (`batch_size`), and hide the **Dot grid** or **MP cost curves**. **Snap step** (8, 16, 32 or 64; starts at 32) is the grid that drags, arrow keys and chips land on. The **Ratio rail** is the list of ratio chips, typed as `1:1, 21:9`. The display options apply to every Latent Size node in this browser; latent family and batch size (1 to 64) belong to this node.
|
||||
- **Gear:** set the **Snap step**, edit the **Ratio chips**, choose the **Latent family** (`latent`) and **Batch size** (`batch_size`), and hide the **Dot grid** or **MP cost curves**. **Snap step** (8, 16, 32 or 64; starts at 32) is the grid that drags, arrow keys and chips land on. The display options apply to every Latent Size node in this browser; latent family and batch size (1 to 64) belong to this node.
|
||||
- **Ratio chips:** in the gear, **Ratio chips → Edit list** shows every ratio with its size near one megapixel. Tick a ratio to show it as a chip, untick it to hide it, × removes it, and the box at the bottom adds your own, such as `21:9`. 5:4 and 21:9 come in the list switched off. **Reset to defaults** brings back the shipped list. Add a ratio once: the flip button turns it portrait.
|
||||
- **Node size:** drag the node's corner to make it wider or taller, so it lines up with the nodes around it. The controls stretch with it, and the canvas preview takes any extra height. It can be as narrow as 320 pixels.
|
||||
|
||||
## Workflow resolutions
|
||||
|
||||
@@ -41,17 +41,39 @@ file's name. A caption on the `caption_text` input writes the paired `.txt`.
|
||||
workflow in EXIF. **JXL** (`jxl lossless`, lossless JPEG XL) is the most
|
||||
compact; it needs the optional `pillow-jxl-plugin` in ComfyUI's python
|
||||
(also the pack's `jxl` extra) and few browsers preview it.
|
||||
- **Embed workflow** (`save_metadata`): **On** stores the prompt and
|
||||
- **Embed** (`save_metadata`, `civitai_info`): **On** stores the prompt and
|
||||
workflow in the file (PNG text chunks, EXIF in webp and jxl) so it drags
|
||||
back into ComfyUI; **Off** writes a clean file for sharing or datasets.
|
||||
`--disable-metadata` on the server wins.
|
||||
- **Civitai** (the Embed switch's third choice, `civitai_info` on): stores
|
||||
the workflow and also the prompt, the sampler settings and the
|
||||
fingerprints of the model and LoRAs in the form civitai.com reads, so an
|
||||
upload shows its prompt and lists its resources. Not the default: Civitai
|
||||
then shows these settings instead of the ComfyUI workflow, though the
|
||||
workflow stays in the file and still drags back into ComfyUI. The first save with a new model
|
||||
takes a moment while its file is fingerprinted; after that it is
|
||||
remembered. See "Uploading to Civitai" below.
|
||||
- **Preview** (`preview`): the small switch under the card shows the saved
|
||||
image on the node. Off, the picture's box goes away and the node is
|
||||
shorter; on again, the node returns to its height with the last saved
|
||||
image. It is display only: the file is saved either way and the queue
|
||||
still lists it. When a run saves more than one image (a batch, or a list
|
||||
such as a folder of images), arrows beside the switch (‹ 2 / 5 ›) step
|
||||
through them.
|
||||
such as a folder of images), they all show side by side. The arrows
|
||||
beside the switch (‹ all 5 ›) go on to each one by itself (‹ 2 / 5 ›) and
|
||||
back round to all of them. A run of more than 48 shows one at a time.
|
||||
The node shows a small copy of each picture (up to 2048 pixels on the
|
||||
long side), so a big file shows at once on a slow connection too. The
|
||||
saved file is always full size. The copies are in ComfyUI's temp folder.
|
||||
- **Auto save** (`autosave`, on by default): on, every run saves its
|
||||
pictures. Off, a run only shows them here and saves nothing. A row over
|
||||
the picture then says **Not saved yet**, with a **Save picture** button.
|
||||
With several pictures it reads **Save all 4**, and with the arrows on one
|
||||
picture, **Save this one**. After a save the row says what is saved.
|
||||
Use it to make a batch, look, and keep only the good ones. The pictures
|
||||
are saved under the name and folder set above, in the format picked,
|
||||
with the workflow inside if **Embed workflow** is on. They wait in
|
||||
ComfyUI's temp folder, which is emptied when ComfyUI restarts, so save
|
||||
what you want before that. The Save button works for the last 256 runs.
|
||||
- **Preview steps** (`step_preview`, off by default): the switch left of
|
||||
**preview** shows the picture while it is being made, one step at a time,
|
||||
where the saved image goes, with a **STOP** button on the bar. Stop a run
|
||||
@@ -101,6 +123,44 @@ be, apart from the size, which only a run knows.
|
||||
and is not read for tokens.
|
||||
- Other text between percent signs stays as typed.
|
||||
|
||||
## Uploading to Civitai
|
||||
|
||||
civitai.com reads a ComfyUI picture's prompt from the embedded graph, but
|
||||
only from nodes it knows. A prompt typed into Krea 2 Encode 🆎, core's Qwen
|
||||
Image 2.1 encoder or a node inside a subgraph reads as no prompt, and the
|
||||
upload is flagged "Unable to Verify AI Generation". Civitai also finds a
|
||||
picture's models only by their file fingerprints, which a ComfyUI graph does
|
||||
not hold, so a plain ComfyUI picture always says no resources were found.
|
||||
Pick **Civitai** in the Embed switch before saving pictures you mean to
|
||||
upload.
|
||||
|
||||
### Technical details
|
||||
|
||||
- The line is the one A1111 writes (`parameters` text in PNG, EXIF
|
||||
UserComment in WebP and JPEG XL): prompt, `Negative prompt:`, then
|
||||
`Steps`, `Sampler`, `Schedule type`, `CFG scale`, `Seed`, `Size`,
|
||||
`Model hash`, `Model`, `Lora hashes` and a `Hashes` JSON block. Civitai
|
||||
reads it before the ComfyUI graph.
|
||||
- It ends with `engine: ComfyUI`, which tags the post with the ComfyUI tool,
|
||||
and `process: txt2img` or `img2img`, which picks its technique. A sampler
|
||||
that starts from an encoded picture, an inpaint node, or a denoise under 1
|
||||
counts as img2img.
|
||||
- Civitai does not keep the ComfyUI graph from a picture that carries this
|
||||
line, so its page shows no workflow to copy. The workflow is still in the
|
||||
file for anyone who downloads it.
|
||||
- It is built from the run's own graph, walking up from this node to the
|
||||
nearest sampler (KSampler, KSamplerAdvanced, SamplerCustom and
|
||||
SamplerCustomAdvanced), its prompt encoder, and the checkpoint or
|
||||
diffusion model and LoRAs on its model input. LoRA Loader 🆎 rows that are
|
||||
off or at strength 0 are left out. A graph with no sampler gets no line.
|
||||
- Fingerprints are AutoV2 hashes (the first ten hex digits of the file's
|
||||
SHA256), cached in `user/ausboss/` by file size and date. Text encoders and
|
||||
VAEs are not listed; Civitai does not credit a picture to them.
|
||||
- A prompt made while the graph runs (Prompt Variations 🆎) is written as
|
||||
the text typed into its node.
|
||||
- Videos cannot carry it: Civitai reads only the `prompt` and `workflow`
|
||||
tags of an mp4 or webm.
|
||||
|
||||
## Outputs
|
||||
|
||||
- **file_path**: absolute path of the first file saved this run (empty when
|
||||
|
||||
@@ -9,9 +9,10 @@ duration, shows a tall video whole, and has a **LOOP** control. `gif` and
|
||||
`webp` are shown as pictures with just the file name, since a video player
|
||||
cannot play either.
|
||||
|
||||
**Preview steps** above the player (`step_preview`, off by default) shows the clip's first frame in
|
||||
the player while it is being made, one step at a time, with a **STOP**
|
||||
button on the player. Stop a clip that is going wrong after the first steps
|
||||
**Preview steps** above the player (`step_preview`, off by default) shows the clip in
|
||||
the player while it is being made: after each step, about one frame per
|
||||
second of the clip plays in a loop, with a **STOP** button on the player.
|
||||
You see the motion take shape, not only the first frame. Stop a clip that is going wrong after the first steps
|
||||
instead of waiting for the end; a stopped run saves nothing. The saved
|
||||
video replaces the steps. The [Step Preview](AUSBOSS_NODES_StepPreview.md)
|
||||
page has the details.
|
||||
@@ -77,13 +78,14 @@ a software format to use instead rather than failing with a driver stack
|
||||
trace.
|
||||
|
||||
`gif` and `webp` have no streaming encoder, so every frame is held in memory
|
||||
before the first byte is written — keep those to short clips. Neither carries
|
||||
metadata, so an embedded workflow is not available for them.
|
||||
before the first byte is written — keep those to short clips. `webp` carries
|
||||
the embedded workflow the same way ComfyUI's own animated WebP does; `gif` has
|
||||
no place for it.
|
||||
|
||||
The node's face follows the table: widgets the chosen format ignores are
|
||||
hidden rather than left to look meaningful. The CRF field leaves the
|
||||
**FPS · CRF** row for `mov prores`, `mkv ffv1` and `gif` (their rows read
|
||||
*ignored* above), and the **Embed workflow** row disappears for `gif` and `webp`,
|
||||
*ignored* above), and the **Embed workflow** row disappears for `gif`,
|
||||
which cannot carry it. Hidden is not removed:
|
||||
the widget keeps its position and its value, saved workflows store and restore
|
||||
it exactly as before, and switching the format back brings it back with the
|
||||
|
||||
@@ -9,6 +9,10 @@ Put it anywhere on the canvas. It needs no wires: it shows whichever sampler
|
||||
in the workflow is making a picture right now, and the caption under the
|
||||
picture says how far it is ("step 3 of 8").
|
||||
|
||||
For a video, the picture moves: after each step a few frames of the clip,
|
||||
about one per second, play in a loop, so you can see the motion form and
|
||||
stop a clip that is going wrong.
|
||||
|
||||
## The buttons
|
||||
|
||||
- **STOP**: stops this run now. Nothing after the sampler runs, so nothing
|
||||
@@ -65,4 +69,17 @@ ComfyUI uses it.
|
||||
it does whenever previews are turned on in ComfyUI. The node grows to
|
||||
hold the picture and keeps the last step after the run.
|
||||
- Runs queued from another workflow tab are not shown here.
|
||||
- With video models the step picture is the clip's first frame.
|
||||
- With a video model (H3, Wan, LTX and others), the step picture moves:
|
||||
after each step the pack also sends about one frame per second of the
|
||||
clip (16 at most), and they play in a loop at the clip's own pace. Each
|
||||
frame is made by the same preview ComfyUI uses for the first frame, one
|
||||
frame at a time, so it needs no extra memory and no extra files.
|
||||
- Measured with MiniMax H3 (Pika, 6 steps, a 5 second clip) on one
|
||||
desktop: 6.22 s a step with no step pictures, 6.35 s with the moving
|
||||
ones; 53.6 s and 53.8 s for the whole run. With the quick preview the 7
|
||||
frames of a step take about 1 ms to make, and each step sends about 20 KB.
|
||||
- With the tiny video decoder (TAESD chosen and `taeh3` in
|
||||
`models/vae_approx`) the frames are sharper and take longer, about 60 ms
|
||||
each at 720p on that desktop. The frames never take more than a tenth of
|
||||
the run's time: on a slower card some steps keep the frames they have
|
||||
instead of making new ones.
|
||||
|
||||
@@ -7,6 +7,43 @@ from **Crop For Inpaint 🆎**, **Load Image + Pad 🆎** or any
|
||||
result, it is resized to fit first, then joined to your picture the way
|
||||
**Seam** says.
|
||||
|
||||
## Follow changes
|
||||
|
||||
Turn on **Follow changes** when the model draws past your box and the paste
|
||||
cuts it off: a boot that ends at the box's edge, half a plate rim, a collar
|
||||
sliced flat. Edit models that redraw the whole crop they are given, such as
|
||||
MiniMax H3 Image, do this often.
|
||||
|
||||
With it on, the paste is no longer just the box. It takes the box plus every
|
||||
change the model made that touches the box, and fades out before the edge
|
||||
of the crop that went to the model. Before that, it undoes the small zoom or
|
||||
shift such a model can draw, so the wall, tiles or table around the edit line
|
||||
up with your picture again.
|
||||
|
||||
When the model changed nearly everything around the box, there is no single
|
||||
new thing to follow, and the paste stays the box. The console says what was
|
||||
done on each run. Follow changes works on a Crop For Inpaint stitcher with
|
||||
the classic seam; an outpaint has no picture under its new area to compare
|
||||
against, so it pastes as before.
|
||||
|
||||
### Technical details
|
||||
|
||||
- The model's crop is lined up with the picture's own crop by the zoom and
|
||||
shift Realign to Source measures (up to 20% zoom). An unreliable
|
||||
measurement leaves the crop as it came back.
|
||||
- A pixel counts as changed when the lined-up crop differs from your
|
||||
picture by more than 0.10 (on 0 to 1, averaged over red, green and blue,
|
||||
after a 4 px blur). Changes are joined to the box when they come within
|
||||
8 px of it, then closed by 6 px, filled, widened by 10 px and softened by
|
||||
10 px.
|
||||
- The paste fades to nothing over 24 px before each crop edge that lies
|
||||
inside your picture, and runs to the picture's own edge where the crop
|
||||
reaches it.
|
||||
- When the changes outside the box cover more than half of the crop outside
|
||||
the box, the paste stays the box.
|
||||
- The work runs at most 768 px on the long side and takes under a second
|
||||
on a 4 MP crop.
|
||||
|
||||
## Paste onto: crop or original
|
||||
|
||||
**Paste onto** picks what you get back. It lives in the gear menu, next to
|
||||
@@ -67,9 +104,11 @@ are in the model's own picture.
|
||||
Tone match 0 the new area is bit-identical to what the model painted, and
|
||||
the whole stitch is the 2.4.0 blend in, pixel for pixel.
|
||||
- With the classic seam, feeding the crop back unchanged reproduces the
|
||||
original image exactly (with `fix_edge_halo` off; the fix rewrites the
|
||||
feathered band on purpose). Blend in does not promise this: it keeps the
|
||||
model's version of the thin strip at your picture's edge.
|
||||
original image exactly only when there is no resizing in either direction,
|
||||
with Tone match at 0 and `fix_edge_halo` off. Resizing can lose detail even
|
||||
when the crop comes back unchanged; the halo fix rewrites the feathered
|
||||
band on purpose. Blend in does not promise this: it keeps the model's
|
||||
version of the thin strip at your picture's edge.
|
||||
- A stitcher built from one image broadcasts over any number of inpainted
|
||||
frames. A stitcher built from **more** frames than came back is trimmed to
|
||||
the leading ones with a console note - video models keep 8n+1 (LTX) or
|
||||
@@ -153,9 +192,25 @@ correction turns the corner without a crease.
|
||||
The shift is subtracted from the pasted region before the blend. In the
|
||||
padding that is the whole shift; inside the feathered band the paste
|
||||
alpha scales it, which is exactly the share of each band pixel the
|
||||
sampler painted. Source pixels stay bit-identical. A crop stitcher, which
|
||||
has no source rectangle, gets a single global shift measured in its
|
||||
blend band instead.
|
||||
sampler painted. Source pixels stay bit-identical.
|
||||
|
||||
A Crop For Inpaint crop has no source rectangle, so it gets one shift for
|
||||
the whole painted area. That shift is read inside the painted area, in the
|
||||
32 pixels next to its edge: the same pixels before and after, taking the
|
||||
middle value. Those 32 pixels are counted at the size the model painted, so
|
||||
a large picture is read the same way and takes no longer. Most inpaint workflows let the model paint a little wider
|
||||
than the paste, so the soft edge itself comes back close to your picture
|
||||
and shows only a fraction of the drift. When the painted area holds
|
||||
something new (less than half of that rim agrees, or the change is larger
|
||||
than 20 LAB units, such as a black jacket over skin), it is not drift: the
|
||||
old pixels in that place show something else. The new part is then
|
||||
compared with your untouched picture right beside it, each side averaged
|
||||
within 48 pixels of the seam. Where the two sides look alike (within 20
|
||||
LAB units, on at least a quarter of the seam, such as new skin next to
|
||||
skin), the gap between them is taken off. Where they do not, such as a
|
||||
jacket next to skin, Tone match leaves that picture as painted. Before,
|
||||
the soft edge was read there instead, and a model that repaints the edge
|
||||
too could tint the whole patch: a yellow swimsuit over skin came back blue.
|
||||
|
||||
On a Crop + Rotate + Pad canvas the source rectangle is the crop, so it
|
||||
can also hold the rotation's empty corners and any transparency. The
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# Strength Curve
|
||||
|
||||
Draw how strong something should be over a run, from the first step to the
|
||||
last, and wire the curve into a node that follows it step by step.
|
||||
|
||||
- **LoRA Loader 🆎**: wire the curve into its `curve` input and click the
|
||||
curve mark on each row that should follow it. Fade a style LoRA out so
|
||||
the fine detail at the end comes out clean, or bring a detail LoRA in
|
||||
late.
|
||||
- **Krea 2 Encode 🆎**: wire the curve into `reference_curve`. The picture
|
||||
follows your reference as strongly as the curve says: hold the layout
|
||||
early and let go late, or the other way round.
|
||||
|
||||
## Using it
|
||||
|
||||
1. Pick a preset (flat, fade out, fade in, ease out, ease in) or drag the
|
||||
points. Double-click the curve box to add a point, right-click a point to
|
||||
remove it.
|
||||
2. Click a point to pick it, then type or scrub **Point at** (where in the
|
||||
run, in %) and **value** for exact numbers.
|
||||
3. Set **Top** (`high`) and **Bottom** (`low`): the strength at the top and
|
||||
the bottom of the curve box. A fade from 1 to 0.3 is a fade out with
|
||||
Bottom at 0.3.
|
||||
|
||||
Left is the start of the run, where the picture is still noise; right is
|
||||
the end, where only fine detail changes. Hover the curve to read the value at
|
||||
any point.
|
||||
|
||||
## Outputs
|
||||
|
||||
- **curve**: the strength over the run, as a list of numbers from start to
|
||||
end (ComfyUI's `FLOATS` type).
|
||||
|
||||
## Tips
|
||||
|
||||
- On a LoRA row, the curve multiplies the row's own strength. A row at 0.8
|
||||
with a fade out goes from 0.8 to 0.
|
||||
- It works with every model file: full size, fp8, fp8 scaled and int8.
|
||||
- A curve that moves makes each step a little slower (about 5% on Krea 2)
|
||||
and needs no extra memory. A flat line costs nothing.
|
||||
|
||||
## Technical details
|
||||
|
||||
- The points are saved in the hidden `points` input as `[where, value]`
|
||||
pairs from 0 to 1, so a workflow run through the API gives the same
|
||||
curve with no editor open. The line between points is a monotone cubic
|
||||
(Fritsch and Carlson), so it never swings past a point.
|
||||
- The output is 101 values spread evenly from start to end, Bottom to Top.
|
||||
It is the same reading ComfyUI's own **Create Hook Keyframes From
|
||||
Floats** gives a list, so the curve also feeds ComfyUI's hook nodes, and a
|
||||
list of numbers from another node feeds our inputs.
|
||||
- Both nodes read "where in the run" the way ComfyUI's hook keyframes do:
|
||||
ComfyUI's percent of the run, measured by noise level. With
|
||||
the `simple` and `normal` schedulers that matches the step count; other
|
||||
schedulers spend more steps at some noise levels. A second sampler that
|
||||
carries on from the first (a refiner pass, a denoise below 1) reads only
|
||||
the part of the curve it covers.
|
||||
- LoRA Loader adds a following row to each layer's result as the layer
|
||||
runs (ComfyUI's bypass mode), so the model's weights are never rewritten
|
||||
and no second copy of them is kept. Krea 2 Encode scales the reference
|
||||
inside attention.
|
||||
@@ -0,0 +1,60 @@
|
||||
# Text Lines
|
||||
|
||||
Runs what comes after once for each line of your text. Type five prompts,
|
||||
one on each line, press Run once, and you get five pictures.
|
||||
|
||||
Use it for a list of prompts you typed, or for a list another node wrote,
|
||||
such as a text model asked for "five different poses".
|
||||
|
||||
## How to use it
|
||||
|
||||
1. Type your lines in the box, or wire text into **text**.
|
||||
2. Wire **line** to where one prompt would go, such as a text encoder's
|
||||
prompt.
|
||||
3. Run. Every node after it runs once for each line, and a Save Image at the
|
||||
end saves one picture for each.
|
||||
|
||||
Empty lines are skipped. Models and pictures that do not depend on the line
|
||||
are loaded once, not once for each line.
|
||||
|
||||
## Controls
|
||||
|
||||
- The text box (`text`): One line for each run.
|
||||
- **Split at** (`split`): **each line** makes every line its own run.
|
||||
**blank line** keeps lines together and starts the next run at an empty
|
||||
line. Pick it when one prompt is several lines long.
|
||||
- **Numbering** (`remove_numbering`): **remove** takes a number or bullet
|
||||
off the start of each line, such as `1.`, `2)`, `-` or `[prompt 3]`.
|
||||
Lists a text model writes usually have them. **keep** leaves every line
|
||||
as written.
|
||||
- **Limit** (`limit`): The most lines to run. 0 runs them all. Set it when
|
||||
a text model might write more lines than you asked for.
|
||||
|
||||
## Outputs
|
||||
|
||||
- **line**: Each line, one at a time.
|
||||
- **number**: The line's place in the list, starting at 1. Add it to a seed
|
||||
with Math Expression (`a + b`) to give each line its own seed.
|
||||
- **count**: How many lines run.
|
||||
|
||||
## Notes
|
||||
|
||||
- With no lines at all, the run stops at this node and says so.
|
||||
- Every run uses the same seed unless you add **number** to it. Different
|
||||
prompts still give different pictures.
|
||||
- A line such as "2 women on a beach" or "1.5x zoom" keeps its number: only
|
||||
a number followed by a period, bracket or colon counts as numbering.
|
||||
|
||||
## Technical details
|
||||
|
||||
**line** and **number** are ComfyUI lists (`OUTPUT_IS_LIST`), the same way
|
||||
Image Folder hands out pictures. ComfyUI runs each later node once for each
|
||||
item and keeps the results in order. A node that takes a whole list at once,
|
||||
such as core Rebatch Images, gets all of them together.
|
||||
|
||||
Numbering that is removed: a number in square, round or CJK brackets with an
|
||||
optional word before it (`[prompt 1]`, `(2)`), a word and a number followed by
|
||||
a colon, period, bracket or dash (`Shot 3:`), a bare number followed by a
|
||||
period, bracket or colon that has no digit right after it, and the bullets
|
||||
`-`, `*` and `•` followed by a space. Only one marker is removed from each
|
||||
line.
|
||||
@@ -9,33 +9,76 @@ fill-color bands around it for a **video outpaint**: the `mask` output marks the
|
||||
bands (and rotation corners), ready for Crop For Inpaint or an in-context video
|
||||
model that paints black regions.
|
||||
|
||||
## Clip window for App mode
|
||||
|
||||
In an App-mode form, this node can show a **clip window** instead of its whole
|
||||
editor: the video, playing only the part that gets used on a loop, over a strip
|
||||
of pictures from the video with a box over that part. Click the video to pause it. Drag
|
||||
the box to pick where the clip starts; drag one of its edges to make it shorter
|
||||
or longer. A line under it says what you picked, such as "8.0 s used, starting at
|
||||
0:03". To put it in a form, list the field `clip_window` of this node, next to
|
||||
its `video` field. On the graph the node looks the same as before: the clip
|
||||
window only shows inside the form.
|
||||
|
||||
**Min seconds** and **max seconds** (`min_seconds`, `max_seconds`) keep the clip
|
||||
inside a range, for example 5 to 8 seconds for a model that is only reliable
|
||||
there. The edges stop at those lengths, in the form and on the node's own
|
||||
timeline, and a run keeps to them too:
|
||||
|
||||
- a longer pick, or the whole video, is cut to the max;
|
||||
- a shorter pick grows to the min, and where the video ends first the start
|
||||
moves back instead;
|
||||
- a video shorter than the min is used whole, with no error.
|
||||
|
||||
Set them in the **Clip length limits** fold, under Crop, pad & resize. It starts
|
||||
closed; its header shows the limits (`5 – 8 s`, `from 5 s`, `up to 8 s`, or `off`).
|
||||
Open it for **Shortest** and **Longest**. 0 means no limit, and both are 0 by
|
||||
default, so older workflows run as before. Typing a Shortest above the Longest
|
||||
moves the Longest up with it, and the other way round. An exact **Fixed frames**
|
||||
count wins over them.
|
||||
|
||||
## Source and window
|
||||
|
||||
- **Inputs**: Pick an existing input video (the list plays the clip under the pointer, muted, and filters as you type), click **Load**, or drop a video file
|
||||
onto the node. The old source widgets remain compatible with saved workflows, but
|
||||
are now driven by this compact card. Choosing another video keeps the canvas
|
||||
settings - Fill, Feather, **Align**, Resize, Every nth, Frames for, Length - and
|
||||
settings - Fill, Feather, **Align**, Resize, Every nth, Frames for, Duration - and
|
||||
fits the new clip to the lit ratio button, the way **Fit** is set. Rotation, crop,
|
||||
padding, IN/OUT and the playhead start over.
|
||||
padding, the clip's timing and the playhead start over.
|
||||
- **Outputs** (`source_mode` / `local_path`): Pick a video from ComfyUI's output folder,
|
||||
such as one you just rendered. The list shows the newest first and previews the video
|
||||
under the pointer. The video is read in place, without an upload copy. In an API prompt
|
||||
it is named the way ComfyUI names a file there: `clip.mp4 [output]`. A whole path such
|
||||
as `/home/me/ComfyUI/output/clip.mp4` is not read, for queued runs and the editor's live
|
||||
preview alike.
|
||||
- **Play / Pause** beside the scrubber previews the selected frames and stops at OUT. Press Play at OUT to start from IN again.
|
||||
- **Timeline** (right under the preview and size line): The rail on the node and in the editor is one timeline. Press or
|
||||
drag anywhere on it to scrub the **playhead**, with Length on or off; the stage shows
|
||||
that frame. Drag the **IN** or **OUT** handle to trim: the playhead rides on the handle, so what you see
|
||||
is the first (IN) or last (OUT) frame the run keeps, and it stays there when you let
|
||||
go. IN and OUT are frames, snapped to the source's frame grid; the boxes under the
|
||||
rail take a frame number, and `start_seconds` / `end_seconds` are derived from them
|
||||
(OUT is exclusive, 0 means the end of the source). Arrow keys on a handle move one
|
||||
second, Shift one frame. **OUT always sits on the last frame the run outputs**, so
|
||||
the handle and the bright bar end together; with Every nth or Frames for it steps to the
|
||||
frames the run keeps, and a dim tail marks frames the window holds but the run
|
||||
drops. In the editor, **Set IN** / **Set OUT** (or the **I** / **O** keys) put a
|
||||
trim point at the playhead, and **Full clip** resets the window. The editor also
|
||||
- **Play / Pause** beside the timeline plays the clip from its start and stops at its end. Pause and Play again to carry on from where you stopped.
|
||||
- **Timeline** (right under the picture): Press or drag anywhere on it to look at
|
||||
another frame; the picture shows it. Point at the bar to see where you are, the
|
||||
clip in words and the source's frame rate. Drag the **start** handle to move the
|
||||
clip (its Duration stays), and the **end** handle to change the Duration. The
|
||||
start stops where the whole Duration still fits, and a short note says so.
|
||||
**Use as start** starts the clip at the frame on the picture.
|
||||
- **Start / Duration / Ends at**: the clip in three boxes. Start and Ends at are
|
||||
places in the source video; Duration is how long the clip is. Type any of them,
|
||||
or drag over a box to scrub it. The small **s | fr** switch shows them in seconds
|
||||
or frames: Start and Ends at count source frames, Duration counts the frames the
|
||||
clip sends on, at the output rate. Point at a box for the other unit and what it
|
||||
covers. Typing a Start that leaves too little video is allowed: an amber note says
|
||||
how many frames still fit and offers to shorten the clip or move the start.
|
||||
- **Linked timing**: when another node feeds `start_frame`, `end_frame`,
|
||||
`frame_load_cap` or `fixed_frames`, that box is locked and its label shows a small
|
||||
**linked** button that jumps to the node. `fixed_frames` is an exact count;
|
||||
`frame_load_cap` is only a limit, so when the video ends first the note says how
|
||||
many frames you get. A count only worked out when the graph runs (a Math
|
||||
Expression, say) shows as **at run time**, and the timeline shows striped room
|
||||
after the start instead of a clip. A rate typed inside a subgraph counts as known.
|
||||
- **Technical details**: `start_seconds` / `end_seconds` are derived from the frames
|
||||
(the end is exclusive, 0 means the end of the source), and the Duration is stored
|
||||
as `max_frames`. Arrow keys on a handle move one second, Shift one frame. With
|
||||
Every nth or Frames for the end steps to the frames the run keeps, and a dim tail
|
||||
marks frames the window holds but the run drops.
|
||||
In the editor, **Set IN** / **Set OUT** (or the **I** / **O** keys) put a
|
||||
trim point at the playhead, and **Whole video** resets the clip. The editor also
|
||||
has buttons for the first and last frame, steps of 1, 25, 50 and 100 frames, and
|
||||
**Play**. Arrow keys step one frame (10 with Shift), Home and End jump to the
|
||||
ends, and Space plays or pauses. **Save & close** keeps your edits; **Cancel** or
|
||||
@@ -55,22 +98,16 @@ model that paints black regions.
|
||||
fill colour with a faint hatch, so black bands show on the black stage. A fresh clip node starts
|
||||
with black and feather 0 and the editor's **Reset transform** returns to them;
|
||||
the image nodes keep their grey fill and feathered mask.
|
||||
- **Length** (`max_frames`): the one other way to set how long the clip is. **Off**
|
||||
(the default): OUT ends the clip. **On**: a number of output frames from IN; OUT
|
||||
sits that many frames after IN and follows it when you drag IN, and dragging OUT or
|
||||
typing the number changes the Length. To move the whole clip, drag IN or the small
|
||||
grip in the middle of the kept part (the grip also slides a trimmed window with
|
||||
Length off). When the Length is the whole clip there is nowhere to move it, and the
|
||||
row says so: "= the whole clip. Shorten it to move IN." The Length stays when you
|
||||
swap the video, so a workflow built for 97 frames keeps taking 97. Turning it on or
|
||||
off never moves anything: the count becomes the OUT, or the OUT the count. If the
|
||||
source ends first, the footer says how many frames are left. **To start** moves IN
|
||||
to the start of the source.
|
||||
- **Whole video / To start** (bottom right of the timing card): **Whole video**
|
||||
uses the whole source, with no Duration limit. When the length is linked, the
|
||||
button reads **To start** and moves the start to the beginning instead. The
|
||||
Duration stays when you swap the video, so a workflow built for 97 frames keeps
|
||||
taking 97.
|
||||
- **Every nth** (`every_nth`): Thin the batch. The `fps` output divides to match
|
||||
every_nth, so the clip keeps real-time downstream; a Length counts the frames kept.
|
||||
every_nth, so the clip keeps real-time downstream; a Duration counts the frames kept.
|
||||
- **Frames for** (`frame_snap`): Keep a frame count a video model takes:
|
||||
**LTX (8n+1)** (49, 97, 121) or **Wan (4n+1)**. **any** keeps every frame in the window.
|
||||
OUT drags and the Length step through those counts.
|
||||
Dragging the end and typing a Duration step through those counts.
|
||||
With it on, `frame_count`, `duration`, the audio window and the stitcher all match the
|
||||
clip the sampler hands back, so wiring `frame_count` into the empty latent's length
|
||||
never leaves the stitch with more source frames than generated ones.
|
||||
@@ -102,7 +139,7 @@ with the padlock on it also takes away the bands the lock added.
|
||||
**Reset** on the node clears rotation, crop and padding and turns the padlock off;
|
||||
fill, feather, **Align** and the timeline stay.
|
||||
**Reset transform** in the editor resets rotation, crop, padding, fill, feather and
|
||||
**Align**; it keeps the source, current frame, trim, Length, resize and stitch
|
||||
**Align**; it keeps the source, current frame, trim, Duration, resize and stitch
|
||||
settings. **Align** makes the width and height divide evenly by the number
|
||||
you pick: padding grows by a few pixels, and a side with no padding is trimmed by
|
||||
a few instead. Some models need sizes divisible by 8, 16 or 32; 1 turns it off.
|
||||
@@ -155,16 +192,17 @@ The node performs no remote network requests and does not rewrite the source vid
|
||||
|
||||
## Connected timing inputs
|
||||
|
||||
Five optional sockets sit on the left, above the editor:
|
||||
Optional timing inputs:
|
||||
|
||||
| Input | Meaning |
|
||||
| --- | --- |
|
||||
| `force_rate` | Sample at this fps before Every nth. 0 keeps the source rate. Drops or repeats frames to keep playback speed. Accepts FLOAT or INT. |
|
||||
| `start_frame` | Zero-based source start frame. Overrides timeline IN. |
|
||||
| `end_frame` | Exclusive source end frame. 0 means the end of the source. Overrides timeline OUT. |
|
||||
| `fixed_frames` | Exact output frames from IN; the source must be long enough. Connected, it sets the length: OUT, Length and Frames for step aside. |
|
||||
| `frame_load_cap` | Maximum frames after rate conversion and Every nth, before Frames for. 0 means unlimited. Connected, it sets the length in place of Length. When the count is known, dragging IN stops at the last start that fits the kept frames. |
|
||||
| `fixed_frames` | Exact output frames from IN; the source must be long enough. Connected, it sets the length: Duration, Ends at and Frames for step aside. |
|
||||
| `frame_load_cap` | Maximum frames after rate conversion and Every nth, before Frames for. 0 means unlimited. Connected, it sets the length in place of Duration. When the count is known, dragging the start stops at the last start that fits the kept frames. |
|
||||
| `last_seconds` | Load only this many seconds from the end of the clip, or of the part before OUT. 0 loads all of it. Use it to carry on from a clip: a long clip then costs no more memory than a short one. |
|
||||
| `min_seconds` / `max_seconds` | The shortest and longest the clip may be, in seconds; 0 is no limit. Applied after the window is worked out, so the start, Duration and the other inputs set the clip and these keep its length in range (see Clip window for App mode). |
|
||||
|
||||
Frame bounds use the source's frame-rate grid, independent of `force_rate`.
|
||||
The footer labels **Source fps** separately from **Output fps**. A direct
|
||||
@@ -177,17 +215,17 @@ For example, start 24 and end 72 select two seconds from a 24 fps source.
|
||||
A 12 fps forced rate returns 24 frames; a cap of 10 then keeps only the first
|
||||
10 of those. Audio and duration follow the returned batch.
|
||||
|
||||
A connected start or end locks that handle and its IN/OUT field on both
|
||||
A connected start or end locks that handle and its box on both
|
||||
the node and fullscreen editor. Hover to see why. Disconnect to restore
|
||||
local control. While timing inputs are connected, the preview shows the local
|
||||
trim as a reference and avoids claiming an output count before the linked
|
||||
values are evaluated at run time.
|
||||
|
||||
**A connected length input takes over the length.** Connect a count to
|
||||
`fixed_frames` (exact) or `frame_load_cap` (at most) and the OUT handle goes
|
||||
away, OUT and Length grey out, and only IN is left to set: the clip starts at
|
||||
IN and the input decides where it ends. Literal Integer/Float nodes (including
|
||||
`fixed_frames` (exact) or `frame_load_cap` (at most) and the end handle goes
|
||||
away, Duration and Ends at lock, and only Start is left to set: the clip starts
|
||||
there and the input decides where it ends. Literal Integer/Float nodes (including
|
||||
AusBoss cards and reroutes) show the resulting frames on the rail before
|
||||
running; calculated counts show "at run time". An older workflow that saved a
|
||||
Fixed frames number without a connection reads as a Length; the first change
|
||||
Fixed frames number without a connection reads as a Duration; the first change
|
||||
here turns it into one.
|
||||
|
||||
@@ -60,12 +60,20 @@ answered on the same line as the button.
|
||||
- A found file swaps its Download button for an **✓ installed** pill; hovering
|
||||
the pill shows where it was found. A file that lives in a subfolder still
|
||||
counts. When a loader in the workflow still asks for the bare file name,
|
||||
which ComfyUI cannot find there (it marks that loader red), the row says
|
||||
where the file is instead (**in LTXV 2.3/**) and **Use it** points those
|
||||
loaders at the copy it found. The check only asks the ComfyUI server for its
|
||||
own model lists.
|
||||
which ComfyUI cannot find there (it marks that loader red), the note points
|
||||
that loader at your copy by itself and says so in a short message. If you
|
||||
have two copies in different subfolders, the row says where one is
|
||||
(**in LTXV 2.3/**) and **Use it** picks it. To always choose yourself, turn
|
||||
off Settings, 🆎 AusBoss, Models, **Pick found files**. The check only asks
|
||||
the ComfyUI server for its own model lists.
|
||||
- **↻ check files** re-runs the check after you move files in. ComfyUI's own
|
||||
**R** refresh triggers it as well.
|
||||
- Launchers such as Stability Matrix keep models in shared folders of their
|
||||
own, for example `Data/Models/Lora`. Files there count, and the card names
|
||||
such a folder under the usual heading ("also read from ..."), so you can
|
||||
see where your files are found and put new ones there. The old folder
|
||||
names `clip` and `unet` are checked as `text_encoders` and
|
||||
`diffusion_models`, the names ComfyUI uses for them.
|
||||
- Folder `input` is for a sample image or clip shipped with the workflow: it
|
||||
is looked for in `ComfyUI/input`.
|
||||
- Clicking a file name copies it — handy for searching a loader's picker.
|
||||
|
||||
@@ -17,6 +17,7 @@ help panel.
|
||||
| Pick a picture size by shape and megapixels, in place of Empty Latent | Latent Size (`AUSBOSS_NODES_Resolution`) |
|
||||
| Resize a picture, or snap its size to a multiple | Image Resize (`AUSBOSS_NODES_ImageResize`), Align Image (`AUSBOSS_NODES_AlignImage`) |
|
||||
| Read a picture's width and height | Image Size (`AUSBOSS_NODES_ImageSize`) |
|
||||
| Load a picture and set its size or crop it (megapixels, longest side, a box, a ratio) in one node | Load Image (`AUSBOSS_NODES_LoadImage`) |
|
||||
| Outpaint: load a picture and add empty space around it | Load Image + Pad (`AUSBOSS_NODES_LoadImagePad`) |
|
||||
| Turn, crop and pad a picture in one node | Image Crop + Rotate + Pad (`AUSBOSS_NODES_ImageCropRotatePad`) |
|
||||
| Inpaint only the masked part, then put it back | Crop For Inpaint (`AUSBOSS_NODES_CropForInpaint`) then Stitch Inpaint (`AUSBOSS_NODES_StitchInpaint`) |
|
||||
@@ -24,23 +25,33 @@ help panel.
|
||||
| Get a mask by typing what to find | Mask by Name (`AUSBOSS_NODES_MaskByName`) |
|
||||
| Get a mask by clicking the thing | Mask by Touch (`AUSBOSS_NODES_MaskByTouch`) |
|
||||
| Grow, shrink, fill or smooth a mask | Mask Refine (`AUSBOSS_NODES_RefineMask`) |
|
||||
| Keep the untouched parts of a picture exactly as they were while an edit model edits it | Edit Lock (`AUSBOSS_NODES_EditLock`) then Edit Lock Restore (`AUSBOSS_NODES_EditLockRestore`) |
|
||||
| Line an edited picture back up with the original | Realign to Source (`AUSBOSS_NODES_RealignToSource`, experimental) |
|
||||
| Match one picture's colors to another | Color Match (`AUSBOSS_NODES_ColorMatch`) |
|
||||
| Add film grain to a picture or a video, or copy another picture's grain | Film Grain (`AUSBOSS_NODES_FilmGrain`) |
|
||||
| Turn a picture and a mask into a transparent cut-out with clean edges | Cut Out (`AUSBOSS_NODES_CutOut`) |
|
||||
| Put the original's fine detail back on a smoothed edit | Keep Detail (`AUSBOSS_NODES_KeepDetail`) |
|
||||
| Upscale big pictures in tiles | Tiled Upscale (`AUSBOSS_NODES_TiledUpscale`) then Tiled Upscale Stitch (`AUSBOSS_NODES_TiledUpscaleStitch`) |
|
||||
| Compare two pictures | Image Compare A/B (`AUSBOSS_NODES_Compare`) |
|
||||
| Save pictures (PNG, lossless WebP or JPEG XL) | Save Image (`AUSBOSS_NODES_SaveImage`) |
|
||||
| Run a workflow on each picture in a folder | Image Folder (`AUSBOSS_NODES_ImageFolder`) |
|
||||
| Apply a stack of LoRAs | LoRA Loader (`AUSBOSS_NODES_LoraLoader`) |
|
||||
| Change a LoRA row's or a Krea 2 reference's strength over the steps of a run | Strength Curve (`AUSBOSS_NODES_StrengthCurve`) into LoRA Loader's `curve` or Krea 2 Encode's `reference_curve` |
|
||||
| Write a MiniMax H3 or Pika H3 Flex prompt from plain words | H3 Prompt Writer (`AUSBOSS_NODES_H3PromptWriter`): [node help](../AUSBOSS_NODES_H3PromptWriter.md) |
|
||||
| Krea 2 prompt, and Krea 2 outpainting | Krea 2 Encode (`AUSBOSS_NODES_Krea2Encode`), Krea 2 Outpaint Model Patch (`AUSBOSS_NODES_Krea2OutpaintModelPatch`) |
|
||||
| Load or save a video | Load Video (`AUSBOSS_NODES_LoadVideo`), Save Video (`AUSBOSS_NODES_SaveVideo`) |
|
||||
| Load a sound file and keep only part of it, up to a set length | Load Audio (`AUSBOSS_NODES_LoadAudio`) |
|
||||
| Turn, crop and pad a video: one frame, or the whole clip | Video Crop + Rotate + Pad → Frame (`AUSBOSS_NODES_VideoCropRotatePad`), → Clip (`AUSBOSS_NODES_VideoCropRotatePadClip`) |
|
||||
| Change a clip's frame rate | Frame Interpolate (`AUSBOSS_NODES_FrameInterpolate`) |
|
||||
| Make a clip larger and sharper | FlashVSR Upscale (`AUSBOSS_NODES_FlashVSRUpscale`) |
|
||||
| Work with frame batches | Select Frame, Select Every Nth, Split Batch, Merge Batches (`AUSBOSS_NODES_SelectFrame`, `_SelectEveryNth`, `_SplitBatch`, `_MergeBatches`) |
|
||||
| Run a workflow once for each line of text, such as a list of prompts | Text Lines (`AUSBOSS_NODES_TextLines`) |
|
||||
| One shared seed, number or text | Seed, Integer, Float, Text (`AUSBOSS_NODES_Seed`, `_Integer`, `_Float`, `_Text`) |
|
||||
| A prompt that picks from `{a\|b\|c}` choices on each run, by seed | Prompt Variations (`AUSBOSS_NODES_PromptVariations`) |
|
||||
| Do maths on numbers | Math Expression (`AUSBOSS_NODES_MathExpression`) |
|
||||
| Show text on the node, or the picture while it is made | Show Text (`AUSBOSS_NODES_ShowText`), Step Preview (`AUSBOSS_NODES_StepPreview`) |
|
||||
| Stop a run after the 3D viewer to frame the shot on the new model, with a 360 behind it | Pause for Shot (`AUSBOSS_NODES_PauseShot`): [node help](../AUSBOSS_NODES_PauseShot.md) |
|
||||
| Line a 3D model (Pixal3D) up with the photo: the photo's camera for the viewer, the crop's lens, the photo's place on a 360 | Photo Camera (`AUSBOSS_NODES_PhotoCamera`): [node help](../AUSBOSS_NODES_PhotoCamera.md) |
|
||||
| Free graphics memory between steps | Free Memory (`AUSBOSS_NODES_FreeMemory`) |
|
||||
| Time the whole run | Run Timer (`AUSBOSS_NODES_RunTimer`) |
|
||||
| Turn parts of a workflow off and on | Workflow Switches (`AUSBOSS_NODES_WorkflowSwitches`): [its own agent guide](workflow_switches.md) |
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
// Film Grain's Auto, on the node's face: keeps what Auto picks for the
|
||||
// picture on hand up to date for the card's "= 0.27" notes
|
||||
// (js/shared/grain_auto.mjs).
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { chainCallback } from "../shared/index.mjs";
|
||||
import { isForeignRun } from "../shared/prompt_scope.mjs";
|
||||
import { keepMatch, matchFromRun, refreshAuto } from "../shared/grain_auto.mjs";
|
||||
import { outputLocatorId, sourceFileWidget, upstreamNode } from "../shared/input_preview.mjs";
|
||||
|
||||
const NODE_CLASS = "AUSBOSS_NODES_FilmGrain";
|
||||
const viewUrl = (query) => api.apiURL(`/view?${query}`);
|
||||
|
||||
// One hook on a Load Image's file box, with every Film Grain it feeds listed
|
||||
// under it, so a picked file refreshes them all and a removed node leaves.
|
||||
// Both pictures are watched: the one getting grain, and grain_from's.
|
||||
const watched = new WeakMap();
|
||||
const WATCHED_INPUTS = ["image", "grain_from"];
|
||||
function unwatch(node) {
|
||||
for (const entry of node.__ausbossGrainWatch ?? []) entry.nodes.delete(node);
|
||||
node.__ausbossGrainWatch = [];
|
||||
}
|
||||
function watchFile(node) {
|
||||
const widgets = WATCHED_INPUTS.map((name) => sourceFileWidget(upstreamNode(node, name))).filter(Boolean);
|
||||
const now = node.__ausbossGrainWatch ?? [];
|
||||
if (now.length === widgets.length && now.every((entry, i) => entry.widget === widgets[i])) return;
|
||||
unwatch(node);
|
||||
for (const widget of widgets) {
|
||||
let entry = watched.get(widget);
|
||||
if (!entry) {
|
||||
const nodes = new Set();
|
||||
entry = { widget, nodes };
|
||||
chainCallback(widget, "callback", () => { for (const item of nodes) update(item); });
|
||||
watched.set(widget, entry);
|
||||
}
|
||||
entry.nodes.add(node);
|
||||
node.__ausbossGrainWatch.push(entry);
|
||||
}
|
||||
}
|
||||
|
||||
function update(node) {
|
||||
if (!node?.graph) return;
|
||||
watchFile(node);
|
||||
const record = app.nodeOutputs?.[outputLocatorId(node)] ?? null;
|
||||
refreshAuto(node, { viewUrl, record });
|
||||
}
|
||||
|
||||
const later = (node) => queueMicrotask(() => update(node));
|
||||
|
||||
app.registerExtension({
|
||||
name: "ausboss.film_grain",
|
||||
beforeRegisterNodeDef(nodeType, nodeData) {
|
||||
if (nodeData?.name !== NODE_CLASS) return;
|
||||
chainCallback(nodeType.prototype, "onNodeCreated", function () { later(this); });
|
||||
chainCallback(nodeType.prototype, "onConfigure", function () { later(this); });
|
||||
chainCallback(nodeType.prototype, "onConnectionsChange", function () { later(this); });
|
||||
chainCallback(nodeType.prototype, "onExecuted", function (output) {
|
||||
if (isForeignRun()) return;
|
||||
keepMatch(this, matchFromRun(output));
|
||||
later(this);
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onRemoved", function () { unwatch(this); });
|
||||
},
|
||||
// A reopened workflow restores every node's last output at once.
|
||||
onNodeOutputsUpdated() {
|
||||
for (const node of app.graph?._nodes ?? []) if (node.type === NODE_CLASS) later(node);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,177 @@
|
||||
// H3 Prompt Writer 🆎 draws only the sockets in use.
|
||||
//
|
||||
// The node keeps every socket in its lists: a wire is saved by its socket's
|
||||
// number, so taking one out would send the wrong output. A socket that is
|
||||
// not in use is only left out of the drawing. The rule is in
|
||||
// js/shared/h3_sockets.mjs.
|
||||
//
|
||||
// classic a hidden socket gets a position of its own, which takes it
|
||||
// out of the stacked rows, and draws nothing.
|
||||
// Nodes 2.0 one style rule hides the socket's row by its data-slot-key.
|
||||
//
|
||||
// If either lever is missing in the running frontend, every socket shows,
|
||||
// as it always did.
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { chainCallback } from "../shared/index.mjs";
|
||||
import { lookupLink } from "../shared/graph_links.mjs";
|
||||
import { SHOW_ALL, dropTarget, hiddenRowsRule, setSocketHidden, socketsToShow } from "../shared/h3_sockets.mjs";
|
||||
|
||||
const NODE_CLASS = "AUSBOSS_NODES_H3PromptWriter";
|
||||
const STYLE_ID = "ausboss-h3-sockets";
|
||||
|
||||
const showAll = () => Boolean(app.extensionManager?.setting?.get?.(SHOW_ALL));
|
||||
|
||||
let warned = false;
|
||||
// Nothing here may stop a node from loading: on a throw the sockets show.
|
||||
function safely(run) {
|
||||
return function (...args) {
|
||||
try { return run.apply(this, args); } catch (error) {
|
||||
if (!warned) console.warn("[AusBoss] H3 Prompt Writer shows every socket:", error);
|
||||
warned = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const plainInputs = (node) => (node.inputs ?? []).filter((slot) => !slot.widget);
|
||||
const outputWired = (slot) => (slot.links?.length ?? 0) > 0;
|
||||
const shownRows = (node) => Math.max(
|
||||
plainInputs(node).filter((slot) => !slot._ausbossHidden).length,
|
||||
(node.outputs ?? []).filter((slot) => !slot._ausbossHidden).length,
|
||||
1,
|
||||
);
|
||||
const hiddenRows = (node) => Math.max(plainInputs(node).length, (node.outputs ?? []).length, 1) - shownRows(node);
|
||||
const rowHeight = () => globalThis.LiteGraph?.NODE_SLOT_HEIGHT ?? 20;
|
||||
|
||||
function writerNodes(graph = app.graph, found = []) {
|
||||
for (const node of graph?._nodes ?? []) {
|
||||
if (node.type === NODE_CLASS) found.push(node);
|
||||
if (node.subgraph) writerNodes(node.subgraph, found);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
// Nodes 2.0 draws a row for every socket of the list. One style sheet for
|
||||
// the page holds each node's hidden rows.
|
||||
function writeStyleRules() {
|
||||
const rules = writerNodes().map((node) => node._ausbossSocketRule ?? "").filter(Boolean).join("\n");
|
||||
let sheet = document.getElementById(STYLE_ID);
|
||||
if (!sheet && !rules) return;
|
||||
sheet ??= document.head.appendChild(Object.assign(document.createElement("style"), { id: STYLE_ID }));
|
||||
if (sheet.textContent !== rules) sheet.textContent = rules;
|
||||
}
|
||||
|
||||
export function applySockets(node) {
|
||||
if (!node?.inputs || !node?.outputs) return;
|
||||
// The rows as this node last had them. Not counted from the sockets: a
|
||||
// paste or a copy gives the node new socket objects, with no marks.
|
||||
const rowsBefore = node._ausbossSocketRows;
|
||||
const show = socketsToShow({
|
||||
wiredInputs: plainInputs(node).filter((slot) => slot.link != null).map((slot) => slot.name),
|
||||
wiredOutputs: node.outputs.filter(outputWired).map((slot) => slot.name),
|
||||
showAll: showAll(),
|
||||
inputNames: plainInputs(node).map((slot) => slot.name),
|
||||
outputNames: node.outputs.map((slot) => slot.name),
|
||||
});
|
||||
const hiddenKeys = [];
|
||||
node.inputs.forEach((slot, index) => {
|
||||
if (slot.widget) return;
|
||||
const hide = !show.inputs.has(slot.name);
|
||||
if (setSocketHidden(slot, hide) && hide) hiddenKeys.push(`in-${index}`);
|
||||
});
|
||||
node.outputs.forEach((slot, index) => {
|
||||
const hide = !show.outputs.has(slot.name);
|
||||
if (setSocketHidden(slot, hide) && hide) hiddenKeys.push(`out-${index}`);
|
||||
});
|
||||
// When the hidden rows change, the nudge flips, so Nodes 2.0 measures the
|
||||
// sockets again and every wire ends on its dot.
|
||||
const hiddenNow = hiddenKeys.join(",");
|
||||
if (node._ausbossHiddenRows !== undefined && node._ausbossHiddenRows !== hiddenNow) node._ausbossNudge = !node._ausbossNudge;
|
||||
node._ausbossHiddenRows = hiddenNow;
|
||||
node._ausbossSocketRule = hiddenRowsRule(node.id, hiddenKeys, Boolean(node._ausbossNudge));
|
||||
writeStyleRules();
|
||||
|
||||
// The node gets a row taller or shorter with its sockets, so the panel
|
||||
// keeps its size. A workflow that is loading keeps the size it was saved at.
|
||||
const rows = shownRows(node);
|
||||
if (rowsBefore != null && rows !== rowsBefore && !app.configuringGraph && node.size) {
|
||||
node.setSize([node.size[0], node.size[1] + (rows - rowsBefore) * rowHeight()]);
|
||||
}
|
||||
node._ausbossSocketRows = rows;
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
// A wire dropped on the node's body goes to the socket the frontend finds
|
||||
// for its kind, and the first free one can be one nobody can see (an audio
|
||||
// wire finds video_sound before voice). Nodes 2.0 then makes no wire at
|
||||
// all, as a hidden row has no place to snap to. So the node answers with
|
||||
// the first shown socket of that kind that can take the wire. The same goes
|
||||
// for a wire pulled from another node's input, which lands on an output.
|
||||
function shownSocketFor(node, found, outputs) {
|
||||
if (!found?.slot?._ausbossHidden) return found;
|
||||
const slots = outputs ? node.outputs : node.inputs;
|
||||
const target = dropTarget(slots.map((slot) => ({
|
||||
name: slot.name,
|
||||
type: slot.type,
|
||||
// A wire that is being dragged away leaves its socket free.
|
||||
wired: outputs ? outputWired(slot) : slot.link != null && !lookupLink(node.graph, slot.link)?._dragging,
|
||||
shown: !slot.widget && !slot._ausbossHidden,
|
||||
})), found.index, { shared: outputs });
|
||||
return target === found.index ? found : { index: target, slot: slots[target] };
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "AusBoss.H3Sockets",
|
||||
settings: [
|
||||
{
|
||||
id: SHOW_ALL,
|
||||
name: "Show every socket on H3 Prompt Writer",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
category: ["🆎 AusBoss", "H3 Prompt Writer", "Show every socket"],
|
||||
tooltip:
|
||||
"H3 Prompt Writer shows only the sockets and picture chips you are using. "
|
||||
+ "Turn this on to see all of them all the time.",
|
||||
// The card redraws too: its row of picture chips follows the setting.
|
||||
onChange: safely(() => writerNodes().forEach((node) => { applySockets(node); node.__ausbossCard?.refresh?.(); })),
|
||||
},
|
||||
],
|
||||
beforeRegisterNodeDef(nodeType, nodeData) {
|
||||
if (nodeData.name !== NODE_CLASS) return;
|
||||
const proto = nodeType.prototype;
|
||||
|
||||
// The least height counts only the rows that are drawn.
|
||||
const computeSize = proto.computeSize;
|
||||
proto.computeSize = function (...args) {
|
||||
const size = computeSize.apply(this, args);
|
||||
try { size[1] -= hiddenRows(this) * rowHeight(); } catch { /* the full height is a safe answer */ }
|
||||
return size;
|
||||
};
|
||||
|
||||
for (const [name, outputs] of [["findInputByType", false], ["findOutputByType", true]]) {
|
||||
const find = proto[name];
|
||||
if (typeof find !== "function") continue;
|
||||
proto[name] = function (...args) {
|
||||
const found = find.apply(this, args);
|
||||
try { return shownSocketFor(this, found, outputs); } catch { return found; }
|
||||
};
|
||||
}
|
||||
|
||||
const apply = safely(function () { applySockets(this); });
|
||||
chainCallback(proto, "onNodeCreated", apply);
|
||||
chainCallback(proto, "onAdded", apply);
|
||||
// A node that takes a saved state (a load, a paste, a copy) keeps the
|
||||
// size that came with it.
|
||||
chainCallback(proto, "onConfigure", safely(function () { this._ausbossSocketRows = null; applySockets(this); }));
|
||||
chainCallback(proto, "onConnectionsChange", apply);
|
||||
chainCallback(proto, "onRemoved", safely(function () {
|
||||
this._ausbossSocketRule = "";
|
||||
// The node is still in the graph's list while it is being removed.
|
||||
queueMicrotask(safely(writeStyleRules));
|
||||
}));
|
||||
// The saved node is what it always was: no parked position in it.
|
||||
chainCallback(proto, "onSerialize", safely(function (saved) {
|
||||
(saved.inputs ?? []).forEach((slot, index) => { if (this.inputs?.[index]?._ausbossHidden) delete slot.pos; });
|
||||
(saved.outputs ?? []).forEach((slot, index) => { if (this.outputs?.[index]?._ausbossHidden) delete slot.pos; });
|
||||
}));
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
// On a Chinese ComfyUI (Settings > Language), the pack's own node faces show
|
||||
// Chinese. js/shared/i18n.mjs holds the rules, js/shared/i18n_zh.mjs the words.
|
||||
// The language is read when the page loads, so a change in Settings shows
|
||||
// after a reload.
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { chineseActive, followFaces, useLocaleSource } from "../shared/i18n.mjs";
|
||||
|
||||
app.registerExtension({
|
||||
name: "ausboss.i18n",
|
||||
async setup() {
|
||||
useLocaleSource(() => app.ui?.settings?.getSettingValue?.("Comfy.Locale"));
|
||||
if (chineseActive()) followFaces(document.body);
|
||||
},
|
||||
});
|
||||
+57
-13
@@ -26,6 +26,7 @@ import {
|
||||
childOf,
|
||||
countLine,
|
||||
foldersAddress,
|
||||
folderContext,
|
||||
isPicked,
|
||||
listAddress,
|
||||
nameAt,
|
||||
@@ -274,6 +275,7 @@ async function refresh(state) {
|
||||
}
|
||||
|
||||
function scheduleRefresh(state, delay = 160) {
|
||||
++state.token;
|
||||
clearTimeout(state.timer);
|
||||
state.timer = setTimeout(() => refresh(state), delay);
|
||||
}
|
||||
@@ -342,6 +344,7 @@ async function upload(file, subfolder, overwrite) {
|
||||
|
||||
// Loose pictures go into the folder the node shows.
|
||||
async function addFiles(state, files) {
|
||||
if (!state.alive) return false;
|
||||
const now = settings(state.node);
|
||||
const images = [...(files ?? [])].filter(isPicture);
|
||||
if (!images.length) return false;
|
||||
@@ -352,10 +355,13 @@ async function addFiles(state, files) {
|
||||
const added = [];
|
||||
let failed = 0;
|
||||
for (const file of images) {
|
||||
if (!state.alive) return true;
|
||||
const name = await upload(file, now.folder, false);
|
||||
if (!state.alive) return true;
|
||||
if (name) added.push(name); else failed += 1;
|
||||
}
|
||||
await refresh(state);
|
||||
if (!state.alive) return true;
|
||||
// A hand-made pick takes the new pictures in: they were just put there to be used.
|
||||
const picked = parsePicked(settings(state.node).pictures);
|
||||
if (picked !== null && added.length) setPicked(state, [...picked, ...added.filter((name) => state.names.includes(name))]);
|
||||
@@ -388,6 +394,7 @@ function closeAsk(answer = false) {
|
||||
}
|
||||
|
||||
function askBig(state, name, pictures) {
|
||||
if (!state.alive) return Promise.resolve(false);
|
||||
const bytes = pictures.reduce((sum, item) => sum + (Number(item.file?.size) || 0), 0);
|
||||
if (pictures.length <= BIG_COUNT && bytes <= BIG_BYTES) return Promise.resolve(true);
|
||||
closeAsk(false);
|
||||
@@ -404,7 +411,7 @@ function askBig(state, name, pictures) {
|
||||
foot.append(cancel, go);
|
||||
root.append(foot);
|
||||
const abort = new AbortController();
|
||||
openAsk = { root, abort, done };
|
||||
openAsk = { root, abort, done, state };
|
||||
cancel.addEventListener("click", () => closeAsk(false));
|
||||
go.addEventListener("click", () => closeAsk(true));
|
||||
document.body.append(root);
|
||||
@@ -420,7 +427,17 @@ function askBig(state, name, pictures) {
|
||||
// input/<its name>, folders inside it too, and the node moves there. Copying
|
||||
// the same folder again writes over its copies instead of piling up doubles.
|
||||
async function copyFolder(state, name, pictures) {
|
||||
if (!(await askBig(state, name, pictures)) || !state.alive) return;
|
||||
if (!state.alive || state.copyLocked) return;
|
||||
state.copyLocked = true;
|
||||
try {
|
||||
if (!(await askBig(state, name, pictures)) || !state.alive) return;
|
||||
await copyPictures(state, name, pictures);
|
||||
} finally {
|
||||
state.copyLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function copyPictures(state, name, pictures) {
|
||||
const target = folderName(name);
|
||||
const queue = pictures.slice(0, COPY_LIMIT);
|
||||
state.copying = { done: 0, total: queue.length, name, target };
|
||||
@@ -431,7 +448,9 @@ async function copyFolder(state, name, pictures) {
|
||||
for (;;) {
|
||||
const next = queue.shift();
|
||||
if (!next || !state.alive) return;
|
||||
if (await upload(next.file, next.folder ? `${target}/${next.folder}` : target, true)) copied += 1;
|
||||
const added = await upload(next.file, next.folder ? `${target}/${next.folder}` : target, true);
|
||||
if (!state.alive) return;
|
||||
if (added) copied += 1;
|
||||
state.copying.done += 1;
|
||||
paint(state);
|
||||
cover(state);
|
||||
@@ -444,6 +463,7 @@ async function copyFolder(state, name, pictures) {
|
||||
if (!state.alive) return;
|
||||
const moved = write(state.node, "source", "input") | write(state.node, "folder", target);
|
||||
if (moved) notifyAusbossChange(); else await refresh(state);
|
||||
if (!state.alive) return;
|
||||
paint(state);
|
||||
showToast({ detail: `Copied ${copied} picture${copied === 1 ? "" : "s"} from "${name}" into your ComfyUI input folder (input/${target}).` });
|
||||
if (copied < total) showToast({ severity: "warn", detail: `${total - copied} could not be copied.` });
|
||||
@@ -506,7 +526,7 @@ function addMenu(state, anchor) {
|
||||
closeMenu();
|
||||
const root = el("div", "ausboss-if-menu");
|
||||
const abort = new AbortController();
|
||||
openMenu = { root, abort };
|
||||
openMenu = { root, abort, state };
|
||||
const row = (text, title, run) => {
|
||||
const button = el("button", "ausboss-if-browse-row", text);
|
||||
button.type = "button"; button.title = title;
|
||||
@@ -545,19 +565,25 @@ async function browse(state, anchor) {
|
||||
foot.append(cancel, use);
|
||||
root.append(path, list, foot);
|
||||
const abort = new AbortController();
|
||||
openBrowse = { root, abort };
|
||||
openBrowse = { root, abort, state };
|
||||
let at = now.folder;
|
||||
let source = now.source;
|
||||
let navigation = 0;
|
||||
|
||||
const show = async (folder) => {
|
||||
const token = ++navigation;
|
||||
use.disabled = true;
|
||||
let data = null;
|
||||
try {
|
||||
const response = await api.fetchApi(foldersAddress({ source: now.source, folder }));
|
||||
const response = await api.fetchApi(foldersAddress({ source, folder }));
|
||||
if (response.ok) data = await response.json();
|
||||
} catch { /* shown as an empty list below */ }
|
||||
if (openBrowse?.root !== root) return;
|
||||
if (openBrowse?.root !== root || token !== navigation || !state.alive) return;
|
||||
if (!data && folder) return show(""); // a folder that is gone: start at the top
|
||||
at = data?.folder ?? "";
|
||||
path.replaceChildren(document.createTextNode(`${now.source} / `), el("b", "", at || "(the folder itself)"));
|
||||
source = data?.source ?? source;
|
||||
use.disabled = false;
|
||||
path.replaceChildren(document.createTextNode(`${source} / `), el("b", "", at || "(the folder itself)"));
|
||||
list.replaceChildren();
|
||||
if (at) {
|
||||
const up = el("button", "ausboss-if-browse-row up", "↑ up");
|
||||
@@ -582,7 +608,9 @@ async function browse(state, anchor) {
|
||||
};
|
||||
|
||||
use.addEventListener("click", () => {
|
||||
if (write(state.node, "folder", at)) notifyAusbossChange();
|
||||
if (use.disabled || !state.alive) return;
|
||||
const moved = write(state.node, "source", source) | write(state.node, "folder", at);
|
||||
if (moved) notifyAusbossChange();
|
||||
closeBrowse();
|
||||
});
|
||||
cancel.addEventListener("click", closeBrowse);
|
||||
@@ -706,6 +734,12 @@ function buildPanel(node) {
|
||||
const now = settings(node);
|
||||
const key = `${now.source}|${now.folder}|${now.subfolders}|${now.sort}`;
|
||||
if (key === state.key) { paint(state); return; }
|
||||
const context = folderContext(now);
|
||||
if (context !== state.context) {
|
||||
state.done.clear();
|
||||
state.loadedLine = "";
|
||||
state.context = context;
|
||||
}
|
||||
// Another folder holds other names: a pick made in the old one means nothing there.
|
||||
const moved = state.key && (now.source !== state.shown.source || now.folder !== state.shown.folder || now.subfolders !== state.shown.subfolders);
|
||||
state.key = key;
|
||||
@@ -725,7 +759,9 @@ function buildPanel(node) {
|
||||
const now = settings(node);
|
||||
if (now.run !== "one per run" || isLinked(node, "position")) return;
|
||||
const count = pickedNames(parsePicked(now.pictures), state.names).length;
|
||||
const next = nextPosition(now.position, count, now.afterRun, now.atTheEnd);
|
||||
// The folder can change on disk or arrive through a link. Only the
|
||||
// backend knows where it ends; a cached gallery must not cap "next".
|
||||
const next = nextPosition(now.position, now.afterRun === "next" ? null : count, now.afterRun, now.atTheEnd);
|
||||
if (next !== now.position) { position.value = next; position.callback?.(next); }
|
||||
});
|
||||
}
|
||||
@@ -748,6 +784,7 @@ function buildPanel(node) {
|
||||
});
|
||||
|
||||
const now = settings(node);
|
||||
state.context = folderContext(now);
|
||||
state.key = `${now.source}|${now.folder}|${now.subfolders}|${now.sort}`;
|
||||
rebuild(state);
|
||||
scheduleRefresh(state, 60);
|
||||
@@ -773,12 +810,18 @@ app.registerExtension({
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onConfigure", function (info) {
|
||||
const state = buildPanel(this);
|
||||
++state.token;
|
||||
clearTimeout(state.timer);
|
||||
state.done.clear();
|
||||
state.loadedLine = "";
|
||||
// A node that comes with a size keeps it, the smallest one too.
|
||||
if (info?.size) state.sized = true;
|
||||
// A loaded workflow brings its own folder and its own pick.
|
||||
state.restoring = true;
|
||||
queueMicrotask(() => {
|
||||
if (!state.alive) return;
|
||||
const now = settings(this);
|
||||
state.context = folderContext(now);
|
||||
state.key = `${now.source}|${now.folder}|${now.subfolders}|${now.sort}`;
|
||||
state.restoring = false;
|
||||
scheduleRefresh(state, 30);
|
||||
@@ -789,6 +832,7 @@ app.registerExtension({
|
||||
const state = this.__ausbossImageFolder;
|
||||
const note = output?.ausboss_image_folder?.[0];
|
||||
if (!state?.alive || !note) return;
|
||||
if (!note.context || folderContext(note.context) !== folderContext(settings(this))) return;
|
||||
for (const name of note.names ?? []) state.done.add(name);
|
||||
const loaded = note.loaded ?? [];
|
||||
state.loadedLine = loaded.length === 1
|
||||
@@ -805,9 +849,9 @@ app.registerExtension({
|
||||
state.abort.abort();
|
||||
state.choosing?.abort();
|
||||
clearTimeout(state.dropTimer);
|
||||
if (openBrowse) closeBrowse();
|
||||
if (openMenu) closeMenu();
|
||||
if (openAsk?.root && state.grid.isConnected === false) closeAsk(false);
|
||||
if (openBrowse?.state === state) closeBrowse();
|
||||
if (openMenu?.state === state) closeMenu();
|
||||
if (openAsk?.state === state) closeAsk(false);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
+371
-46
@@ -1,5 +1,5 @@
|
||||
// The in-node preview panel for LaMa Inpaint, Mask Refine, Mask by Name,
|
||||
// Select Frame and Save Image.
|
||||
// Select Frame, Save Image, Film Grain, Cut Out and Keep Detail.
|
||||
//
|
||||
// It shows this node's own result once it has one, and falls back to a
|
||||
// thumbnail of whatever feeds its IMAGE/MASK input before the graph has run.
|
||||
@@ -14,25 +14,30 @@
|
||||
// switch lays each sampling step over the stage, with a Stop button on the
|
||||
// bar (shared/step_preview.mjs).
|
||||
|
||||
import { panelSwitch } from "../shared/panel_controls.mjs";
|
||||
import { panelSwitch, primaryAction } from "../shared/panel_controls.mjs";
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { isForeignRun } from "../shared/prompt_scope.mjs";
|
||||
import { executionIdOf, nodeByExecutionId } from "../shared/graph_ids.mjs";
|
||||
import { BRAND, chainCallback, keepDomWidgetWidthAuto, notifyAusbossChange } from "../shared/index.mjs";
|
||||
import { FONT_UI, RADIUS_CONTROL, RADIUS_XS, THEME as T } from "../shared/theme.mjs";
|
||||
import { chainCallback, keepDomWidgetWidthAuto, notifyAusbossChange } from "../shared/index.mjs";
|
||||
import { ensureNodeMinHeight, fillNodeHeight, growToNodeFloor } from "../shared/panel_layout.mjs";
|
||||
import { suppressCoreImagePreview } from "../shared/core_preview.mjs";
|
||||
import { autoMaskValues } from "../shared/mask_auto.mjs";
|
||||
import { CHECKER } from "../shared/compare_erase.mjs";
|
||||
import { hideInputsInDef, hideWidget, setWidgetVisible } from "../shared/widget_visibility.mjs";
|
||||
import { makePictureStepper } from "../shared/picture_stepper.mjs";
|
||||
import { keepIndex, stepIndex } from "../shared/picture_steps.mjs";
|
||||
import { ALL, allLabel, gridShape, heldPlaces, keepIndex, keepWords, stepIndex, stepWithAll } from "../shared/picture_steps.mjs";
|
||||
import { mountLive, takeStage } from "../shared/live_stage.mjs";
|
||||
import { addStepConsumer, mountStepOverlay, showsStepsOn, stepRun, stopStepRun, watchSteps } from "../shared/step_preview.mjs";
|
||||
import {
|
||||
describeNodePreview,
|
||||
describeSourcePreview,
|
||||
lightPreviewQuery,
|
||||
outputLocatorId,
|
||||
outputRecordCount,
|
||||
outputRecordQuery,
|
||||
ownResultIsCurrent,
|
||||
placeholderText,
|
||||
staleText,
|
||||
sourceFileWidget,
|
||||
@@ -53,7 +58,15 @@ const BAR_GAP = 6;
|
||||
const BAR_PADDING = 2;
|
||||
const PANEL_HEIGHT = STAGE_HEIGHT + BAR_HEIGHT + 4 + 16;
|
||||
const OFF_HEIGHT = BAR_HEIGHT + 16;
|
||||
// The row over pictures that wait for a Save, and the gap under it.
|
||||
const KEEP_HEIGHT = 30;
|
||||
const KEEP_SPACE = KEEP_HEIGHT + 4;
|
||||
const INPUT_SIDE = 1; // LiteGraph.INPUT
|
||||
// A run that left this many pictures or fewer opens with all of them side
|
||||
// by side. More than that and each would be a speck, so the arrows go
|
||||
// through them one at a time, as before.
|
||||
const GRID_MAX = 48;
|
||||
const GRID_GAP = 4;
|
||||
// The node's height from before its preview was switched off, so switching
|
||||
// it back on returns the node to it (saved with the workflow).
|
||||
const HEIGHT_PROPERTY = "ausboss_preview_height";
|
||||
@@ -112,8 +125,23 @@ const NODE_CONFIG = {
|
||||
: null),
|
||||
},
|
||||
AUSBOSS_NODES_SelectFrame: { inputName: "frames", noun: "frames" },
|
||||
// These three redraw their picture while a value is dragged, before any
|
||||
// run (shared/live_stage.mjs), with a Fit | 100% switch on the bar.
|
||||
AUSBOSS_NODES_FilmGrain: { inputName: "image", noun: "an image", live: "grain" },
|
||||
AUSBOSS_NODES_CutOut: { inputName: "image", noun: "an image", checker: true, live: "cutout" },
|
||||
AUSBOSS_NODES_KeepDetail: { inputName: "image", noun: "an image", live: "detail" },
|
||||
// Its result is the file it just saved; the card sits above the panel.
|
||||
AUSBOSS_NODES_SaveImage: { inputName: "images", noun: "an image", switchTitle: "Show the saved image here. The file is saved either way.", steps: true },
|
||||
// SAVE shows only for a run made with Auto save off, which holds its
|
||||
// pictures until this button keeps them.
|
||||
AUSBOSS_NODES_SaveImage: {
|
||||
inputName: "images",
|
||||
noun: "an image",
|
||||
switchTitle: "Show the saved image here. The file is saved either way.",
|
||||
steps: true,
|
||||
// Auto save off: a row over the picture says it is not saved yet and
|
||||
// holds the button that saves it.
|
||||
keep: "Save what is showing: every picture, or the one the arrows picked.",
|
||||
},
|
||||
};
|
||||
|
||||
// The picture sits out of flow, centred in the stage, so it can never set
|
||||
@@ -130,28 +158,41 @@ function ensureCss() {
|
||||
style.textContent = `
|
||||
.ausboss-input-preview{box-sizing:border-box;display:flex;flex-direction:column;gap:4px;width:100%;height:100%;padding:0 6px 6px;pointer-events:none;overflow:hidden;}
|
||||
.ausboss-input-preview-bar{box-sizing:border-box;flex:none;display:flex;align-items:center;gap:${BAR_GAP}px;height:${BAR_HEIGHT}px;padding:0 ${BAR_PADDING}px;pointer-events:none;}
|
||||
.ausboss-input-preview-stage{position:relative;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden;border:1px solid rgba(0,180,170,.27);border-radius:6px;background:rgba(0,0,0,.28);}
|
||||
.ausboss-input-preview-stage{position:relative;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden;border:1px solid ${T.rule};border-radius:${RADIUS_CONTROL}px;background:${T.well};}
|
||||
[data-node-id] .ausboss-input-preview-stage{box-sizing:border-box;min-height:${STAGE_HEIGHT}px;}
|
||||
.ausboss-input-preview.preview-off .ausboss-input-preview-stage{display:none;}
|
||||
.ausboss-input-preview.preview-off .ausboss-stepper{display:none;}
|
||||
.ausboss-input-preview-stage img,.ausboss-input-preview-stage video{display:none;position:absolute;inset:0;margin:auto;max-width:100%;max-height:100%;object-fit:contain;}
|
||||
.ausboss-input-preview-stage.show-image img{display:block;}
|
||||
.ausboss-input-preview-stage.checker img{background-image:repeating-conic-gradient(${CHECKER.light} 0 25%,${CHECKER.dark} 0 50%);background-size:${CHECKER.side * 2}px ${CHECKER.side * 2}px;}
|
||||
.ausboss-input-preview-stage.loading-image img{opacity:.4;transition:opacity .3s ease 1.2s;}
|
||||
.ausboss-input-preview-stage.show-video video{display:block;}
|
||||
.ausboss-input-preview-hint{display:none;max-width:86%;color:#78908e;font:11px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:center;}
|
||||
.ausboss-input-preview-stage:not(.show-image):not(.show-video) .ausboss-input-preview-hint{display:block;}
|
||||
.ausboss-input-preview-grid{display:none;position:absolute;inset:0;box-sizing:border-box;gap:${GRID_GAP}px;padding:${GRID_GAP}px;justify-content:center;align-content:center;}
|
||||
.ausboss-input-preview-stage.show-grid .ausboss-input-preview-grid{display:grid;}
|
||||
.ausboss-input-preview-stage .ausboss-input-preview-grid img{display:block;position:static;margin:0;width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;object-fit:contain;}
|
||||
.ausboss-input-preview-hint{display:none;max-width:86%;color:${T.faint};font:11px/1.35 ${FONT_UI};text-align:center;}
|
||||
.ausboss-input-preview-stage:not(.show-image):not(.show-video):not(.show-grid) .ausboss-input-preview-hint{display:block;}
|
||||
.ausboss-input-preview-keep{box-sizing:border-box;flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;height:${KEEP_HEIGHT}px;padding:0 4px 0 10px;border-radius:${RADIUS_CONTROL}px;background:${T.brandSoft};pointer-events:none;}
|
||||
.ausboss-input-preview-keep[hidden]{display:none;}
|
||||
.ausboss-input-preview-keep span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:${T.brandInk};font:600 11px/1.2 ${FONT_UI};}
|
||||
.ausboss-input-preview-keep.done{background:${T.fill};}
|
||||
.ausboss-input-preview-keep.done span{color:${T.label};}
|
||||
.ausboss-input-preview-tools{display:flex;gap:4px;pointer-events:auto;}
|
||||
.ausboss-input-preview-tool{box-sizing:border-box;height:${BAR_HEIGHT}px;min-width:24px;padding:0 6px;border:1px solid rgba(0,180,170,.52);border-radius:4px;background:rgba(0,0,0,.7);color:#c8dddd;font:700 9px/18px "Segoe UI",sans-serif;cursor:pointer;}
|
||||
.ausboss-input-preview-tool:hover{border-color:${BRAND};color:#fff;background:rgba(0,79,75,.78);}
|
||||
.ausboss-input-preview-tool.active{border-color:${BRAND};color:${BRAND};}
|
||||
.ausboss-input-preview-tool{box-sizing:border-box;height:${BAR_HEIGHT}px;min-width:24px;padding:0 6px;border:1px solid transparent;border-radius:${RADIUS_XS}px;background:${T.fill};color:${T.label};font:600 9.5px/18px ${FONT_UI};letter-spacing:.02em;cursor:pointer;}
|
||||
.ausboss-input-preview-tool[hidden]{display:none;}
|
||||
.ausboss-input-preview-stage .ausboss-input-preview-grid img.kept{outline:2px solid ${T.brand};outline-offset:-2px;}
|
||||
.ausboss-input-preview-tool:hover{color:${T.ink};background:${T.fillHover};}
|
||||
.ausboss-input-preview-tool.active{color:${T.brandInk};background:${T.brandSoft};}
|
||||
.ausboss-input-preview-tool:focus-visible{outline:2px solid ${T.brand};outline-offset:1px;}
|
||||
.ausboss-input-preview:not(.preview-off) .ausboss-panel-switch.steps + .ausboss-panel-switch{margin-left:0;}
|
||||
.ausboss-input-preview.preview-off .ausboss-panel-switch.steps{display:none;}
|
||||
.ausboss-input-preview-tool.ausboss-steps-stop{visibility:hidden;}
|
||||
.ausboss-input-preview-tool.ausboss-steps-stop.live{visibility:visible;pointer-events:auto;}
|
||||
.ausboss-input-preview-readout{box-sizing:border-box;height:${BAR_HEIGHT}px;padding:0 7px;border:1px solid rgba(0,180,170,.5);border-radius:10px;background:rgba(0,180,170,.14);color:${BRAND};font:700 9.5px/18px "Segoe UI",sans-serif;white-space:nowrap;pointer-events:none;}
|
||||
.ausboss-input-preview-readout{box-sizing:border-box;height:${BAR_HEIGHT}px;padding:0 7px;border:1px solid transparent;border-radius:999px;background:${T.brandSoft};color:${T.brandInk};font:600 9.5px/18px ${FONT_UI};font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;}
|
||||
.ausboss-input-preview-readout:empty{display:none;}
|
||||
.ausboss-input-preview-readout.warn{border-color:#c98a2b;background:rgba(201,138,43,.16);color:#ffd9a0;}
|
||||
.ausboss-input-preview-note{display:none;position:absolute;left:6px;right:6px;bottom:6px;z-index:6;padding:6px 8px;border:1px solid #c98a2b;border-radius:6px;background:rgba(20,10,0,.86);color:#ffd9a0;font:600 11px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:center;pointer-events:none;}
|
||||
.ausboss-input-preview-toast{position:absolute;left:50%;bottom:6px;z-index:5;max-width:88%;padding:3px 7px;border-radius:4px;background:rgba(0,0,0,.78);color:#b8d3d1;font:10px/1.3 "Segoe UI",sans-serif;text-align:center;transform:translateX(-50%);pointer-events:none;}
|
||||
.ausboss-input-preview-readout.warn{background:${T.warnSoft};color:${T.warnInk};}
|
||||
.ausboss-input-preview-note{display:none;position:absolute;left:6px;right:6px;bottom:6px;z-index:6;padding:6px 8px;border:1px solid ${T.warn};border-radius:${RADIUS_CONTROL}px;background:${T.warnSoft};color:${T.warnInk};font:600 11px/1.35 ${FONT_UI};text-align:center;pointer-events:none;}
|
||||
.ausboss-input-preview-toast{position:absolute;left:50%;bottom:6px;z-index:5;max-width:88%;padding:3px 7px;border-radius:${RADIUS_XS}px;background:${T.fill};color:${T.inkSoft};font:10px/1.3 ${FONT_UI};text-align:center;transform:translateX(-50%);pointer-events:none;}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
@@ -444,12 +485,12 @@ function syncPreviewMode(state, resize) {
|
||||
}
|
||||
if (!enabled) {
|
||||
// Nothing to show and nothing to fetch while it is off.
|
||||
state.img.removeAttribute("src");
|
||||
clearMedia(state);
|
||||
}
|
||||
if (resize) {
|
||||
const node = state.node;
|
||||
node.properties ??= {};
|
||||
const floor = node.computeSize?.()[1] ?? (enabled ? PANEL_HEIGHT : OFF_HEIGHT);
|
||||
const floor = node.computeSize?.()[1] ?? panelFloor(state);
|
||||
if (!enabled) {
|
||||
// Off: remember the height, then shrink to what is left.
|
||||
const height = Number(node.size?.[1]);
|
||||
@@ -492,7 +533,7 @@ function buildTools(state, tools, signal) {
|
||||
}
|
||||
|
||||
function showHint(state, text) {
|
||||
state.stage.classList.remove("show-image", "show-video");
|
||||
state.stage.classList.remove("show-image", "show-video", "show-grid");
|
||||
state.hint.textContent = text;
|
||||
state.placeholder = null;
|
||||
releaseSteps(state);
|
||||
@@ -507,24 +548,76 @@ function showPlaceholder(state, connected) {
|
||||
function showMedia(state, kind) {
|
||||
state.stage.classList.toggle("show-image", kind === "image");
|
||||
state.stage.classList.toggle("show-video", kind === "video");
|
||||
state.stage.classList.toggle("show-grid", kind === "grid");
|
||||
state.placeholder = null;
|
||||
releaseSteps(state);
|
||||
}
|
||||
|
||||
function clearMedia(state) {
|
||||
state.img.removeAttribute("src");
|
||||
state.stage.classList.remove("loading-image");
|
||||
state.video.pause?.();
|
||||
state.video.removeAttribute("src");
|
||||
clearGrid(state);
|
||||
}
|
||||
|
||||
// Restore the watched widget's callback if our hook is still the tail of the
|
||||
// chain; if someone chained after us the hook simply goes inert via
|
||||
// state.alive. We never create object URLs, so there is nothing to revoke.
|
||||
function clearGrid(state) {
|
||||
if (!state.gridKey) return;
|
||||
state.gridKey = "";
|
||||
state.grid?.replaceChildren();
|
||||
}
|
||||
|
||||
// Every picture of the run at once, each as big as the stage allows.
|
||||
function layoutGrid(state) {
|
||||
const cells = [...(state.grid?.children ?? [])];
|
||||
if (!cells.length) return;
|
||||
const loaded = cells.find((cell) => cell.naturalWidth > 0 && cell.naturalHeight > 0);
|
||||
const aspect = loaded ? loaded.naturalWidth / loaded.naturalHeight : 1;
|
||||
const { columns, rows } = gridShape(cells.length, state.stage.clientWidth, state.stage.clientHeight, aspect);
|
||||
// Tracks the size of one picture, so the pictures sit together in the
|
||||
// middle of the stage with no bands between the rows.
|
||||
const wide = (state.stage.clientWidth - GRID_GAP * (columns + 1)) / columns;
|
||||
const tall = (state.stage.clientHeight - GRID_GAP * (rows + 1)) / rows;
|
||||
if (!(wide > 0) || !(tall > 0)) return;
|
||||
const width = Math.floor(Math.min(wide, tall * aspect));
|
||||
const height = Math.floor(width / aspect);
|
||||
state.grid.style.gridTemplateColumns = `repeat(${columns}, ${width}px)`;
|
||||
state.grid.style.gridTemplateRows = `repeat(${rows}, ${height}px)`;
|
||||
}
|
||||
|
||||
function showGrid(state, count) {
|
||||
const urls = Array.from({ length: count }, (_, index) => storedResultUrl(state.node, index) ?? "");
|
||||
const key = urls.join("\n");
|
||||
if (state.gridKey !== key) {
|
||||
state.gridKey = key;
|
||||
state.grid.replaceChildren(...urls.map((url, index) => {
|
||||
const cell = document.createElement("img");
|
||||
cell.alt = `Picture ${index + 1} of ${count}`;
|
||||
cell.decoding = "async";
|
||||
// The first picture to load tells the grid the shape to lay out for.
|
||||
cell.addEventListener("load", () => layoutGrid(state), { once: true });
|
||||
cell.addEventListener("error", () => dropLightPreview(state), { once: true });
|
||||
cell.src = url;
|
||||
return cell;
|
||||
}));
|
||||
}
|
||||
state.img.removeAttribute("src");
|
||||
state.video.pause?.();
|
||||
state.video.removeAttribute("src");
|
||||
layoutGrid(state);
|
||||
showMedia(state, "grid");
|
||||
}
|
||||
|
||||
// Each source has one hook, with subscribers that can leave in any order.
|
||||
const sourceWatchers = new WeakMap();
|
||||
function unwatchSource(state) {
|
||||
const watched = state.watched;
|
||||
state.watched = null;
|
||||
if (watched && watched.widget.callback === watched.hook) {
|
||||
if (!watched) return;
|
||||
watched.subscribers.delete(state);
|
||||
if (!watched.subscribers.size && watched.widget.callback === watched.hook) {
|
||||
watched.widget.callback = watched.prior;
|
||||
sourceWatchers.delete(watched.widget);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,14 +626,21 @@ function rewatchSource(state, source) {
|
||||
if (state.watched?.widget === widget) return;
|
||||
unwatchSource(state);
|
||||
if (!widget) return;
|
||||
const prior = widget.callback;
|
||||
const hook = function (...args) {
|
||||
const result = prior?.apply(this, args);
|
||||
if (state.alive) scheduleRefresh(state);
|
||||
return result;
|
||||
};
|
||||
widget.callback = hook;
|
||||
state.watched = { widget, prior, hook };
|
||||
let watched = sourceWatchers.get(widget);
|
||||
if (!watched) {
|
||||
const prior = widget.callback;
|
||||
const subscribers = new Set();
|
||||
const hook = function (...args) {
|
||||
const result = prior?.apply(this, args);
|
||||
for (const subscriber of subscribers) if (subscriber.alive) scheduleRefresh(subscriber);
|
||||
return result;
|
||||
};
|
||||
watched = { widget, prior, hook, subscribers };
|
||||
sourceWatchers.set(widget, watched);
|
||||
widget.callback = hook;
|
||||
}
|
||||
watched.subscribers.add(state);
|
||||
state.watched = watched;
|
||||
}
|
||||
|
||||
// The node's stored output as a /view URL, for Nodes 2.0, where node.imgs
|
||||
@@ -549,17 +649,36 @@ function rewatchSource(state, source) {
|
||||
// record: an overwritten file reloads after the next run, and a plain refresh
|
||||
// never reloads the picture.
|
||||
const storedRand = new WeakMap();
|
||||
const outputRecord = (node) => app.nodeOutputs?.[outputLocatorId(node)];
|
||||
// Save Image also writes a small copy of each picture for its face, and the
|
||||
// panel shows that one: a few hundred kilobytes where the file can be tens
|
||||
// of megabytes. The copies are in the temp folder, which ComfyUI empties
|
||||
// when it starts; a record whose copy is gone goes back to the file itself.
|
||||
const lightGone = new WeakSet();
|
||||
function lightQuery(record, index = null) {
|
||||
return record && !lightGone.has(record) ? lightPreviewQuery(record, index) : null;
|
||||
}
|
||||
function storedResultUrl(node, index = null) {
|
||||
const record = app.nodeOutputs?.[outputLocatorId(node)];
|
||||
const query = outputRecordQuery(record, index);
|
||||
const record = outputRecord(node);
|
||||
const light = lightQuery(record, index);
|
||||
const query = light ?? outputRecordQuery(record, index);
|
||||
if (!query) return null;
|
||||
if (!storedRand.has(record)) storedRand.set(record, app.getRandParam?.() ?? "");
|
||||
return api.apiURL(`/view?${query}${app.getPreviewFormatParam?.() ?? ""}${storedRand.get(record)}`);
|
||||
return api.apiURL(`/view?${query}${light ? "" : app.getPreviewFormatParam?.() ?? ""}${storedRand.get(record)}`);
|
||||
}
|
||||
// A small copy that would not load: show the file itself from now on.
|
||||
function dropLightPreview(state) {
|
||||
const record = outputRecord(state.node);
|
||||
if (!lightQuery(record)) return false;
|
||||
lightGone.add(record);
|
||||
scheduleRefresh(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Several pictures from one run (a list, or a batch Save Image saved one by
|
||||
// one): the arrows in the bar pick which one shows. One picture keeps the
|
||||
// panel as it was, with no arrows.
|
||||
// one): they all show side by side, and the arrows in the bar go on to each
|
||||
// one by itself and back round to all of them. One picture keeps the panel
|
||||
// as it was, with no arrows.
|
||||
function resultCount(state) {
|
||||
if (state.stale || state.resultGone) return 0;
|
||||
return outputRecordCount(app.nodeOutputs?.[outputLocatorId(state.node)]);
|
||||
@@ -575,21 +694,177 @@ function previewMinWidth(state) {
|
||||
return Math.max(PANEL_MIN_WIDTH, Math.ceil(state.node.size[0] - state.bar.clientWidth + needed));
|
||||
}
|
||||
|
||||
// --- pictures held until Save (Save Image with Auto save off) ---------------
|
||||
|
||||
// The pictures this node is holding, in the order it shows them. Empty when
|
||||
// the last run saved its pictures itself.
|
||||
function heldPictures(state) {
|
||||
if (state.stale || state.resultGone) return [];
|
||||
return heldPlaces(app.nodeOutputs?.[outputLocatorId(state.node)]);
|
||||
}
|
||||
|
||||
// Which of the shown pictures are kept, by their place on the node.
|
||||
function keptOf(state, held) {
|
||||
const key = held.map((picture) => `${picture.token}_${picture.index}`).join(" ");
|
||||
if (state.kept?.key !== key) state.kept = { key, indexes: new Set() };
|
||||
return state.kept.indexes;
|
||||
}
|
||||
|
||||
// A click keeps every picture, or only the one the arrows picked. With the
|
||||
// preview off there is no picture to pick, so it keeps them all.
|
||||
function keepsAll(state, count) {
|
||||
return count < 2 || showsAll(state, count) || !previewEnabled(state);
|
||||
}
|
||||
|
||||
// The row shows while the node holds pictures. It says what is saved, and
|
||||
// its button what a click will do (keepWords).
|
||||
function syncHeld(state, count = resultCount(state)) {
|
||||
const row = state.keepRow;
|
||||
if (!row) return;
|
||||
const held = heldPictures(state);
|
||||
const hidden = !held.length || count < 1;
|
||||
if (row.hidden !== hidden) {
|
||||
row.hidden = hidden;
|
||||
fitKeepRow(state);
|
||||
}
|
||||
if (hidden) return;
|
||||
const kept = keptOf(state, held);
|
||||
const all = keepsAll(state, count);
|
||||
const done = all ? kept.size >= held.length : kept.has(state.index);
|
||||
const words = keepWords({
|
||||
held: held.length, kept: kept.size, all, done, saving: Boolean(state.keeping), name: state.kept?.name ?? "",
|
||||
});
|
||||
state.keepNote.textContent = words.note;
|
||||
state.keepNote.title = state.kept?.path ? `ComfyUI/output/${state.kept.path}` : "";
|
||||
state.keepButton.textContent = words.button;
|
||||
state.keepButton.classList.toggle("quiet", words.quiet);
|
||||
state.keepButton.disabled = Boolean(state.keeping);
|
||||
row.classList.toggle("done", words.quiet && kept.size >= held.length);
|
||||
[...(state.grid?.children ?? [])].forEach((cell, index) => cell.classList.toggle("kept", kept.has(index)));
|
||||
}
|
||||
|
||||
// The row takes room of its own, so the picture keeps its floor: the node
|
||||
// grows to hold it, and a node with the preview off gives the room back.
|
||||
function fitKeepRow(state) {
|
||||
const node = state.node;
|
||||
if (previewEnabled(state)) {
|
||||
ensureNodeMinHeight(node);
|
||||
} else {
|
||||
const floor = Number(node.computeSize?.()?.[1]);
|
||||
if (Number.isFinite(floor)) node.setSize?.([node.size?.[0] ?? PANEL_MIN_WIDTH, floor]);
|
||||
}
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
function buildKeepRow(state, title, signal) {
|
||||
const row = document.createElement("div");
|
||||
row.className = "ausboss-input-preview-keep";
|
||||
row.hidden = true;
|
||||
const note = document.createElement("span");
|
||||
const button = primaryAction("Save picture", title);
|
||||
// Stop the graph from seeing the click as a canvas drag on the node.
|
||||
button.addEventListener("pointerdown", (event) => event.stopPropagation(), { signal });
|
||||
button.addEventListener("click", (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
keepHeld(state);
|
||||
}, { signal });
|
||||
row.append(note, button);
|
||||
state.keepRow = row;
|
||||
state.keepNote = note;
|
||||
state.keepButton = button;
|
||||
return row;
|
||||
}
|
||||
|
||||
async function keepHeld(state) {
|
||||
const held = heldPictures(state);
|
||||
if (!held.length || state.keeping) return;
|
||||
const count = resultCount(state);
|
||||
const wanted = keepsAll(state, count) ? held.map((_, place) => place) : [state.index];
|
||||
// One request for each run, in the order the pictures show.
|
||||
const runs = new Map();
|
||||
for (const place of wanted) {
|
||||
const picture = held[place];
|
||||
if (!picture) continue;
|
||||
if (!runs.has(picture.token)) runs.set(picture.token, []);
|
||||
runs.get(picture.token).push(picture.index);
|
||||
}
|
||||
state.keeping = true;
|
||||
syncHeld(state);
|
||||
const kept = keptOf(state, held);
|
||||
const saved = [];
|
||||
let skipped = 0;
|
||||
try {
|
||||
for (const [token, picks] of runs) {
|
||||
const response = await api.fetchApi("/ausboss/save_image/keep", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ token, picks }),
|
||||
});
|
||||
const answer = await response.json().catch(() => ({}));
|
||||
if (!response.ok) throw new Error(answer.error || "Could not save.");
|
||||
if (!state.alive) return;
|
||||
const done = new Set(answer.kept ?? []);
|
||||
held.forEach((picture, place) => {
|
||||
if (picture.token === token && done.has(picture.index)) kept.add(place);
|
||||
});
|
||||
saved.push(...(answer.saved ?? []));
|
||||
// One picture: the row says the name it was saved under.
|
||||
const path = held.length === 1 ? answer.saved?.[0]?.path : null;
|
||||
if (typeof path === "string" && path && state.kept) {
|
||||
state.kept.path = path;
|
||||
state.kept.name = path.slice(path.lastIndexOf("/") + 1);
|
||||
}
|
||||
skipped += answer.skipped?.length ?? 0;
|
||||
}
|
||||
toast(state, saved.length === 1
|
||||
? `Saved ${saved[0].path}`
|
||||
: saved.length
|
||||
? `Saved ${saved.length} pictures`
|
||||
: skipped ? "Not saved: the file already exists" : "Already saved");
|
||||
} catch (error) {
|
||||
if (state.alive) toast(state, error?.message || "Could not save.");
|
||||
} finally {
|
||||
state.keeping = false;
|
||||
if (state.alive) syncHeld(state);
|
||||
}
|
||||
}
|
||||
|
||||
function showsAll(state, count) {
|
||||
return count > 1 && count <= GRID_MAX && state.all !== false;
|
||||
}
|
||||
|
||||
function stepPicture(state, step) {
|
||||
const count = resultCount(state);
|
||||
if (count < 2) return;
|
||||
state.index = stepIndex(state.index, count, step);
|
||||
if (count > GRID_MAX) {
|
||||
state.index = stepIndex(state.index, count, step);
|
||||
} else {
|
||||
const at = stepWithAll(showsAll(state, count) ? ALL : state.index, count, step);
|
||||
state.all = at === ALL;
|
||||
if (!state.all) state.index = at;
|
||||
}
|
||||
refresh(state);
|
||||
}
|
||||
|
||||
function refresh(state) {
|
||||
if (!state.alive) return;
|
||||
if (!previewEnabled(state)) {
|
||||
clearMedia(state);
|
||||
syncHeld(state);
|
||||
return;
|
||||
}
|
||||
const source = upstreamNode(state.node, state.inputName);
|
||||
rewatchSource(state, source);
|
||||
// Film Grain, Keep Detail and Cut Out draw their own picture while a value
|
||||
// is dragged; the stage is theirs for as long as they can.
|
||||
if (state.live && takeStage(state)) return;
|
||||
const count = resultCount(state);
|
||||
const hidden = state.stepper.root.hidden;
|
||||
state.index = keepIndex(state.index, count);
|
||||
state.stepper.set(state.index, count);
|
||||
const all = showsAll(state, count);
|
||||
state.stepper.set(state.index, count, all ? allLabel(count) : undefined);
|
||||
syncHeld(state, count);
|
||||
if (state.stepper.root.hidden !== hidden) growToNodeFloor(state.widget);
|
||||
if (state.stale) {
|
||||
// The node ran while its preview was off, so the picture it still has
|
||||
@@ -601,11 +876,20 @@ function refresh(state) {
|
||||
// A node that just stopped the run has no result for this picture: the
|
||||
// one it still holds is from an earlier run (Mask by Name's last find,
|
||||
// tinted), so show what feeds it instead.
|
||||
if (all) {
|
||||
showGrid(state, count);
|
||||
// The grid's cells are new: mark the ones already kept.
|
||||
syncHeld(state, count);
|
||||
return;
|
||||
}
|
||||
clearGrid(state);
|
||||
const described = state.resultGone
|
||||
? describeSourcePreview(source)
|
||||
: count > 1
|
||||
? { kind: "url", url: storedResultUrl(state.node, state.index) }
|
||||
: describeNodePreview(state.node, state.inputName, storedResultUrl(state.node));
|
||||
: describeNodePreview(state.node, state.inputName, storedResultUrl(state.node),
|
||||
// The small copy goes first: node.imgs is the full file.
|
||||
!lightQuery(outputRecord(state.node)) && ownResultIsCurrent(state.node, outputRecord(state.node), state.imgsFor));
|
||||
if (!described) {
|
||||
clearMedia(state);
|
||||
showPlaceholder(state, !!source);
|
||||
@@ -627,6 +911,9 @@ function refresh(state) {
|
||||
state.video.removeAttribute("src");
|
||||
if (state.img.getAttribute("src") !== url) {
|
||||
state.img.src = url;
|
||||
// The picture before stays up while this one loads. A slow load
|
||||
// dims it, so an old picture is never taken for the new one.
|
||||
state.stage.classList.toggle("loading-image", true);
|
||||
} else if (state.img.complete && state.img.naturalWidth > 0) {
|
||||
showMedia(state, "image");
|
||||
}
|
||||
@@ -649,8 +936,19 @@ function scheduleRefresh(state) {
|
||||
// Watching the property rather than an api event catches both routes that set
|
||||
// it - the progress frames streamed during a run and the ui payload delivered
|
||||
// when the node finishes - without this file having to know either event name.
|
||||
// The panel's floor: the bar and the picture, the bar alone with the
|
||||
// preview off, and the Save row on top while it shows.
|
||||
function panelFloor(state, enabled = state ? previewEnabled(state) : true) {
|
||||
const keep = state?.keepRow && !state.keepRow.hidden ? KEEP_SPACE : 0;
|
||||
return (enabled ? PANEL_HEIGHT : OFF_HEIGHT) + keep;
|
||||
}
|
||||
|
||||
function watchOwnResult(node, state) {
|
||||
let images = node.imgs;
|
||||
// Which output the pictures in node.imgs were loaded for. The frontend
|
||||
// gives up on a picture that loads slowly and keeps the run before, so
|
||||
// the panel checks this before it trusts node.imgs (ownResultIsCurrent).
|
||||
state.imgsFor = outputRecord(node);
|
||||
try {
|
||||
Object.defineProperty(node, "imgs", {
|
||||
configurable: true,
|
||||
@@ -658,6 +956,7 @@ function watchOwnResult(node, state) {
|
||||
get: () => images,
|
||||
set: (value) => {
|
||||
images = value;
|
||||
state.imgsFor = outputRecord(node);
|
||||
if (state.alive) scheduleRefresh(state);
|
||||
},
|
||||
});
|
||||
@@ -676,6 +975,8 @@ function buildPanel(node, config) {
|
||||
root.className = "ausboss-input-preview";
|
||||
const stage = document.createElement("div");
|
||||
stage.className = "ausboss-input-preview-stage";
|
||||
// A cut-out's see-through parts show over a checkerboard.
|
||||
if (config.checker) stage.classList.add("checker");
|
||||
const img = document.createElement("img");
|
||||
const video = document.createElement("video");
|
||||
video.muted = true;
|
||||
@@ -686,7 +987,9 @@ function buildPanel(node, config) {
|
||||
const toastEl = document.createElement("div");
|
||||
toastEl.className = "ausboss-input-preview-toast";
|
||||
toastEl.style.display = "none";
|
||||
stage.append(img, video, hint, toastEl);
|
||||
const grid = document.createElement("div");
|
||||
grid.className = "ausboss-input-preview-grid";
|
||||
stage.append(img, video, grid, hint, toastEl);
|
||||
const bar = document.createElement("div");
|
||||
bar.className = "ausboss-input-preview-bar";
|
||||
root.append(bar, stage);
|
||||
@@ -696,7 +999,7 @@ function buildPanel(node, config) {
|
||||
const widget = node.addDOMWidget(WIDGET_NAME, "ausboss_input_preview", root, {
|
||||
serialize: false,
|
||||
hideOnZoom: false,
|
||||
getMinHeight: () => (enabled() ? PANEL_HEIGHT : OFF_HEIGHT),
|
||||
getMinHeight: () => panelFloor(node.__ausbossInputPreview, enabled()),
|
||||
});
|
||||
keepDomWidgetWidthAuto(widget);
|
||||
// Not saved with the workflow either: options.serialize only keeps it out
|
||||
@@ -708,7 +1011,7 @@ function buildPanel(node, config) {
|
||||
// dragged taller. With the preview off the floor is the bar alone.
|
||||
fillNodeHeight(widget, {
|
||||
minWidth: () => previewMinWidth(node.__ausbossInputPreview),
|
||||
minHeight: () => (enabled() ? PANEL_HEIGHT : OFF_HEIGHT),
|
||||
minHeight: () => panelFloor(node.__ausbossInputPreview, enabled()),
|
||||
minNodeSize: [PANEL_MIN_WIDTH, 90],
|
||||
exactMinWidth: true,
|
||||
});
|
||||
@@ -720,7 +1023,10 @@ function buildPanel(node, config) {
|
||||
noun: config.noun,
|
||||
switchTitle: config.switchTitle,
|
||||
advanced: config.advanced,
|
||||
root, bar, stage, img, video, hint, widget, abort,
|
||||
root, bar, stage, img, video, grid, hint, widget, abort,
|
||||
// Several pictures open side by side; the arrows pick one (false).
|
||||
all: true,
|
||||
gridKey: "",
|
||||
toast: toastEl,
|
||||
toastTimer: 0,
|
||||
toolButtons: null,
|
||||
@@ -736,6 +1042,7 @@ function buildPanel(node, config) {
|
||||
};
|
||||
livePanels.add(state);
|
||||
if (config.tools?.length) bar.append(buildTools(state, config.tools, abort.signal));
|
||||
if (config.keep) bar.after(buildKeepRow(state, config.keep, abort.signal));
|
||||
if (config.readout) {
|
||||
state.readout = document.createElement("span");
|
||||
state.readout.className = "ausboss-input-preview-readout";
|
||||
@@ -753,10 +1060,27 @@ function buildPanel(node, config) {
|
||||
syncAdvanced(state);
|
||||
installPreviewSwitch(state, abort.signal);
|
||||
if (config.steps) installStepsSwitch(state, abort.signal);
|
||||
if (config.live) {
|
||||
state.live = mountLive(state, config.live, {
|
||||
refresh: () => refresh(state),
|
||||
// A run that came while the preview was off left an older picture.
|
||||
record: () => (state.stale ? null : outputRecord(node) ?? null),
|
||||
hasResult: () => resultCount(state) > 0,
|
||||
resultUrl: () => storedResultUrl(node),
|
||||
viewUrl: (query) => api.apiURL(`/view?${query}`),
|
||||
});
|
||||
}
|
||||
|
||||
img.addEventListener("load", () => showMedia(state, "image"));
|
||||
// The grid is laid out for the stage's shape, so a resized node lays it out again.
|
||||
if (typeof ResizeObserver === "function") {
|
||||
const watcher = new ResizeObserver(() => { if (state.alive && state.gridKey) layoutGrid(state); });
|
||||
watcher.observe(stage);
|
||||
abort.signal.addEventListener("abort", () => watcher.disconnect(), { once: true });
|
||||
}
|
||||
img.addEventListener("load", () => { stage.classList.remove("loading-image"); showMedia(state, "image"); });
|
||||
img.addEventListener("error", () => {
|
||||
if (img.getAttribute("src")) showPlaceholder(state, true);
|
||||
stage.classList.remove("loading-image");
|
||||
if (img.getAttribute("src") && !dropLightPreview(state)) showPlaceholder(state, true);
|
||||
});
|
||||
video.addEventListener("loadeddata", () => showMedia(state, "video"));
|
||||
video.addEventListener("error", () => {
|
||||
@@ -825,9 +1149,9 @@ app.registerExtension({
|
||||
if (state) scheduleRefresh(state);
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onConfigure", function () {
|
||||
const state = this.__ausbossInputPreview;
|
||||
queueMicrotask(() => {
|
||||
const state = buildPanel(this, config);
|
||||
if (!state) return;
|
||||
if (!state?.alive || this.__ausbossInputPreview !== state) return;
|
||||
// onNodeCreated already built the panel before this node's saved
|
||||
// properties existed, so the advanced toggle has to be re-applied
|
||||
// here or a workflow always reopens in the simple state.
|
||||
@@ -861,6 +1185,7 @@ app.registerExtension({
|
||||
clearTimeout(state.toastTimer);
|
||||
state.timer = 0;
|
||||
state.abort?.abort();
|
||||
state.live?.dispose();
|
||||
unwatchSource(state);
|
||||
clearMedia(state);
|
||||
for (const forget of state.forgetSteps ?? []) forget();
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
// Check layout 🆎 (canvas right-click menu and command palette): lists what
|
||||
// makes a workflow hard to read and moves nothing. Overlapping nodes and
|
||||
// groups, wires that run backwards or hide behind a node, a node close under
|
||||
// one that grows when it runs, nodes outside every group, a saved zoom too
|
||||
// small to read and a missing Workflow Note, on the top level and inside
|
||||
// every subgraph. Click an entry to jump to it. The decisions live in
|
||||
// js/shared/layout_check_math.mjs under node:test.
|
||||
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { t } from "../shared/i18n.mjs";
|
||||
import { THEME as T, FONT_UI } from "../shared/theme.mjs";
|
||||
import { compactAction } from "../shared/panel_controls.mjs";
|
||||
import { CALLOUT_TYPES, NOTE_TYPES } from "../shared/note_identity.mjs";
|
||||
import { normalizeNote } from "../shared/workflow_note.mjs";
|
||||
import { frameBounds } from "../shared/workflow_switches.mjs";
|
||||
import { KINDS, MIN_ZOOM, checkLayout, countByKind, jumpViewport } from "../shared/layout_check_math.mjs";
|
||||
|
||||
const CSS_ID = "ausboss-layout-check-css";
|
||||
const LABEL = "Check layout";
|
||||
const FRAME_FILL = 0.8;
|
||||
// Core nodes that get taller once a run shows its picture or text in them.
|
||||
// The pack's own preview nodes keep their size (js/input_preview/).
|
||||
const GROWS = new Set(["PreviewImage", "SaveImage", "SaveAnimatedWEBP", "SaveAnimatedPNG", "SaveWEBM", "SaveVideo", "PreviewAny"]);
|
||||
const KIND_LABEL = {
|
||||
"overlap": "Overlapping",
|
||||
"group-overlap": "Groups overlapping",
|
||||
"under-grower": "Under a node that grows",
|
||||
"hidden-wire": "Wire behind a node",
|
||||
"backward-wire": "Wire runs backwards",
|
||||
"outside-group": "Outside every group",
|
||||
"no-groups": "No groups",
|
||||
"zoom": "Zoomed out too far",
|
||||
"no-note": "No Workflow Note",
|
||||
};
|
||||
|
||||
function ensureCss() {
|
||||
if (document.getElementById(CSS_ID)) return;
|
||||
const style = document.createElement("style");
|
||||
style.id = CSS_ID;
|
||||
style.textContent = `
|
||||
.ausboss-layout-check{position:fixed;z-index:1000;display:flex;flex-direction:column;box-sizing:border-box;width:360px;max-height:70vh;overflow:hidden;border:1px solid ${T.rule};border-radius:10px;background:${T.card};box-shadow:0 12px 40px #0009;color:${T.inkSoft};font:12px/1.4 ${FONT_UI}}
|
||||
.ausboss-layout-check header{display:flex;align-items:center;gap:6px;padding:10px 10px 8px 14px;border-bottom:1px solid ${T.rule}}
|
||||
.ausboss-layout-check header b{color:${T.ink};font-size:13px;font-weight:650}
|
||||
.ausboss-layout-check header span{margin-right:auto;color:${T.faint}}
|
||||
.ausboss-layout-check-list{overflow:auto;padding:4px 0 6px}
|
||||
.ausboss-layout-check h4{display:flex;align-items:center;gap:6px;margin:10px 14px 4px;color:${T.label};font:600 11px/1.25 ${FONT_UI}}
|
||||
.ausboss-layout-check h4 i{color:${T.faint};font-style:normal}
|
||||
.ausboss-layout-check-row{display:block;box-sizing:border-box;width:100%;padding:5px 12px 5px 11px;border:0;border-left:3px solid transparent;background:transparent;color:${T.inkSoft};font:12px/1.35 ${FONT_UI};text-align:left;cursor:pointer}
|
||||
.ausboss-layout-check-row:hover{background:${T.fill}}
|
||||
.ausboss-layout-check-row.is-picked{border-left-color:${T.brand};background:${T.brandSoft}}
|
||||
.ausboss-layout-check-row:focus-visible{outline:2px solid ${T.brand};outline-offset:-2px}
|
||||
.ausboss-layout-check-row small{display:block;color:${T.faint};font-size:11px}
|
||||
.ausboss-layout-check-row.is-info{cursor:default}
|
||||
.ausboss-layout-check-row.is-info:hover{background:transparent}
|
||||
.ausboss-layout-check-clean{padding:12px 14px;color:${T.inkSoft}}
|
||||
.ausboss-layout-check-clean small{display:block;margin-top:2px;color:${T.faint};font-size:11px}
|
||||
.ausboss-layout-check footer{padding:7px 14px 9px;border-top:1px solid ${T.rule};color:${T.faint};font-size:11px}
|
||||
`;
|
||||
document.head.append(style);
|
||||
}
|
||||
|
||||
const el = (tag, className, text) => {
|
||||
const node = document.createElement(tag);
|
||||
if (className) node.className = className;
|
||||
if (text !== undefined && text !== null) node.textContent = text;
|
||||
return node;
|
||||
};
|
||||
|
||||
// A name from the graph: never translated, whatever it says.
|
||||
const nameSpan = (text) => {
|
||||
const span = el("span", "", text);
|
||||
span.dataset.noI18n = "";
|
||||
return span;
|
||||
};
|
||||
|
||||
const LINK_MODES = { 0: "straight", 1: "linear", 2: "spline" };
|
||||
|
||||
function titleHeight(node) {
|
||||
const LG = globalThis.LiteGraph;
|
||||
const none = LG?.NO_TITLE;
|
||||
if (none !== undefined && (node.title_mode === none || node.constructor?.title_mode === none)) return 0;
|
||||
return LG?.NODE_TITLE_HEIGHT ?? 30;
|
||||
}
|
||||
|
||||
// A graph as plain numbers for checkLayout.
|
||||
function readGraph(graph, top) {
|
||||
const LG = globalThis.LiteGraph;
|
||||
const nodes = (graph._nodes ?? graph.nodes ?? []).map((node) => {
|
||||
const collapsed = Boolean(node.flags?.collapsed);
|
||||
const kind = NOTE_TYPES.has(node.type) ? "note" : CALLOUT_TYPES.has(node.type) ? "callout" : null;
|
||||
return {
|
||||
id: node.id,
|
||||
x: node.pos[0],
|
||||
y: node.pos[1],
|
||||
w: collapsed ? (node._collapsed_width ?? LG?.NODE_COLLAPSED_WIDTH ?? 80) : node.size[0],
|
||||
h: collapsed ? 0 : node.size[1],
|
||||
titleHeight: titleHeight(node),
|
||||
grows: GROWS.has(node.type),
|
||||
kind,
|
||||
};
|
||||
});
|
||||
const mode = app.canvas?.links_render_mode;
|
||||
const links = [];
|
||||
if (mode !== LG?.HIDDEN_LINK) {
|
||||
const all = graph.links instanceof Map ? [...graph.links.values()] : Object.values(graph.links ?? {});
|
||||
for (const link of all) {
|
||||
const from = link && graph.getNodeById?.(link.origin_id);
|
||||
const to = link && graph.getNodeById?.(link.target_id);
|
||||
if (!from || !to) continue;
|
||||
const start = from.getConnectionPos?.(false, link.origin_slot);
|
||||
const end = to.getConnectionPos?.(true, link.target_slot);
|
||||
if (!start || !end) continue;
|
||||
const via = [];
|
||||
for (let id = link.parentId, guard = 0; id !== undefined && id !== null && guard < 64; guard++) {
|
||||
const reroute = graph.reroutes?.get?.(id);
|
||||
if (!reroute) break;
|
||||
via.unshift([reroute.pos[0], reroute.pos[1]]);
|
||||
id = reroute.parentId;
|
||||
}
|
||||
links.push({ id: link.id, from: from.id, to: to.id, points: [[start[0], start[1]], ...via, [end[0], end[1]]] });
|
||||
}
|
||||
}
|
||||
const groups = (graph.groups ?? graph._groups ?? []).map((group) => {
|
||||
const [x, y, w, h] = group._bounding ?? [group.pos[0], group.pos[1], group.size[0], group.size[1]];
|
||||
return { id: group.id, x, y, w, h };
|
||||
});
|
||||
const shape = { nodes, links, groups, linkMode: LINK_MODES[mode] ?? "spline", topLevel: top };
|
||||
if (top) {
|
||||
const notes = (graph._nodes ?? []).filter((node) => NOTE_TYPES.has(node.type));
|
||||
shape.noteFilled = notes.some((node) => {
|
||||
const note = normalizeNote(node.widgets?.find((widget) => widget.name === "note")?.value);
|
||||
return Boolean(note.title && note.body.trim());
|
||||
});
|
||||
if (app.canvas?.graph === graph) shape.scale = app.canvas.ds?.scale;
|
||||
}
|
||||
return shape;
|
||||
}
|
||||
|
||||
// Every issue of the workflow, each with the graph it is in and the names of
|
||||
// the boxes that lead there.
|
||||
function findIssues() {
|
||||
const root = app.rootGraph ?? app.graph;
|
||||
if (!root) return [];
|
||||
const graphs = [{ graph: root, path: [] }];
|
||||
for (const sub of root.subgraphs?.values?.() ?? []) graphs.push({ graph: sub, path: [sub.name || "Subgraph"] });
|
||||
const out = [];
|
||||
for (const { graph, path } of graphs) {
|
||||
for (const issue of checkLayout(readGraph(graph, path.length === 0))) out.push({ ...issue, graph, path });
|
||||
}
|
||||
return out.sort((a, b) => KINDS.indexOf(a.kind) - KINDS.indexOf(b.kind));
|
||||
}
|
||||
|
||||
const nodeName = (graph, id) => {
|
||||
const node = graph.getNodeById?.(id);
|
||||
return node?.getTitle?.() ?? node?.title ?? String(id);
|
||||
};
|
||||
const groupName = (graph, id) => (graph.groups ?? []).find((group) => group.id === id)?.title || "Group";
|
||||
|
||||
// The two lines of an entry: what, and why or where.
|
||||
function describe(issue) {
|
||||
const { graph } = issue;
|
||||
const names = (ids) => ids.map((id) => nodeName(graph, id));
|
||||
const main = [];
|
||||
const small = [];
|
||||
const wires = issue.wires > 1 ? [" · ", el("span", "", `${issue.wires} wires`)] : [];
|
||||
switch (issue.kind) {
|
||||
case "overlap":
|
||||
main.push(nameSpan(names(issue.nodes).join(" × ")));
|
||||
small.push("Title bars count too");
|
||||
break;
|
||||
case "group-overlap":
|
||||
main.push(nameSpan(issue.groups.map((id) => groupName(graph, id)).join(" × ")));
|
||||
small.push("One group crosses the other");
|
||||
break;
|
||||
case "under-grower":
|
||||
main.push(nameSpan(nodeName(graph, issue.nodes[0])));
|
||||
small.push(el("span", "", "Under:"), " ", nameSpan(nodeName(graph, issue.nodes[1])));
|
||||
break;
|
||||
case "hidden-wire":
|
||||
main.push(nameSpan(names(issue.nodes.slice(0, 2)).join(" → ")));
|
||||
small.push(el("span", "", "Behind:"), " ", nameSpan(names(issue.behind).join(", ")), ...wires);
|
||||
break;
|
||||
case "backward-wire":
|
||||
main.push(nameSpan(names(issue.nodes).join(" → ")));
|
||||
small.push(el("span", "", "Ends left of where it starts"), ...wires);
|
||||
break;
|
||||
case "outside-group":
|
||||
main.push(nameSpan(nodeName(graph, issue.nodes[0])));
|
||||
small.push("Move it into a group");
|
||||
break;
|
||||
case "no-groups":
|
||||
main.push("Nothing here is in a group");
|
||||
small.push("Put each step in a numbered group");
|
||||
break;
|
||||
case "zoom":
|
||||
main.push(el("span", "", "Saved zoom:"), " ", nameSpan(issue.scale.toFixed(2)));
|
||||
small.push(el("span", "", `Below ${MIN_ZOOM.toFixed(2)} the text on nodes stops drawing`));
|
||||
break;
|
||||
case "no-note":
|
||||
main.push(issue.empty ? "The Workflow Note has no title or steps" : "Add a Workflow Note");
|
||||
small.push("It tells people what the workflow does and how to run it");
|
||||
break;
|
||||
default:
|
||||
main.push(issue.kind);
|
||||
}
|
||||
if (issue.path.length) small.push(small.length ? " · " : "", el("span", "", "Inside:"), " ", nameSpan(issue.path.join(" › ")));
|
||||
return { main, small };
|
||||
}
|
||||
|
||||
// Open the graph the issue is in, select what it names and bring it into view.
|
||||
function jump(issue) {
|
||||
const canvas = app.canvas;
|
||||
if (!canvas) return;
|
||||
const { graph } = issue;
|
||||
if (canvas.graph !== graph) {
|
||||
const root = app.rootGraph ?? app.graph;
|
||||
if (graph !== root && typeof canvas.openSubgraph === "function") canvas.openSubgraph(graph);
|
||||
else canvas.setGraph?.(graph);
|
||||
}
|
||||
canvas.deselectAll?.();
|
||||
for (const id of issue.nodes ?? []) {
|
||||
const node = graph.getNodeById?.(id);
|
||||
if (node) canvas.select?.(node);
|
||||
}
|
||||
for (const id of issue.groups ?? []) {
|
||||
const group = (graph.groups ?? []).find((item) => item.id === id);
|
||||
if (group) canvas.select?.(group);
|
||||
}
|
||||
const focus = issue.focus;
|
||||
if (focus) {
|
||||
const view = canvas.canvas?.getBoundingClientRect?.();
|
||||
// Frame it in the part of the canvas left of the panel, so what the
|
||||
// panel names is never under it.
|
||||
const viewport = jumpViewport(view, panel?.getBoundingClientRect?.());
|
||||
const size = viewport ? [viewport[2], viewport[3]] : [view?.width, view?.height];
|
||||
const rect = frameBounds([focus[0], focus[1], focus[2] - focus[0], focus[3] - focus[1]], size, FRAME_FILL);
|
||||
const options = viewport ? { zoom: FRAME_FILL, viewport } : { zoom: FRAME_FILL };
|
||||
if (typeof canvas.animateToBounds === "function") canvas.animateToBounds(rect, options);
|
||||
else canvas.ds?.fitToBounds?.(rect, options);
|
||||
}
|
||||
canvas.setDirty?.(true, true);
|
||||
}
|
||||
|
||||
let panel = null;
|
||||
|
||||
function onKey(event) {
|
||||
if (event.key !== "Escape" || !panel || event.target?.closest?.("input,textarea,select,[contenteditable]")) return;
|
||||
closePanel();
|
||||
}
|
||||
|
||||
function closePanel() {
|
||||
if (!panel) return;
|
||||
panel.remove();
|
||||
panel = null;
|
||||
window.removeEventListener("keydown", onKey, true);
|
||||
}
|
||||
|
||||
function fill(list, count) {
|
||||
const issues = findIssues();
|
||||
list.replaceChildren();
|
||||
count.textContent = issues.length === 0 ? "Nothing to fix" : issues.length === 1 ? "1 thing to look at" : `${issues.length} things to look at`;
|
||||
if (!issues.length) {
|
||||
const clean = el("div", "ausboss-layout-check-clean", "Nothing to fix.");
|
||||
clean.append(el("small", "", "No overlaps, no hidden or backwards wires, and every node sits in a group."));
|
||||
list.append(clean);
|
||||
return;
|
||||
}
|
||||
for (const [kind, total] of countByKind(issues)) {
|
||||
const heading = el("h4", "", KIND_LABEL[kind] ?? kind);
|
||||
heading.append(el("i", "", String(total)));
|
||||
list.append(heading);
|
||||
for (const issue of issues.filter((item) => item.kind === kind)) {
|
||||
const { main, small } = describe(issue);
|
||||
const canJump = Boolean(issue.focus || issue.nodes?.length || issue.groups?.length);
|
||||
const row = el(canJump ? "button" : "div", `ausboss-layout-check-row${canJump ? "" : " is-info"}`);
|
||||
if (canJump) row.type = "button";
|
||||
row.append(...main);
|
||||
if (small.length) {
|
||||
const line = el("small");
|
||||
line.append(...small);
|
||||
row.append(line);
|
||||
}
|
||||
if (canJump) {
|
||||
row.addEventListener("click", () => {
|
||||
list.querySelector(".is-picked")?.classList.remove("is-picked");
|
||||
row.classList.add("is-picked");
|
||||
jump(issue);
|
||||
});
|
||||
}
|
||||
list.append(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function openPanel() {
|
||||
closePanel();
|
||||
ensureCss();
|
||||
panel = el("div", "ausboss-layout-check");
|
||||
panel.setAttribute("role", "dialog");
|
||||
panel.setAttribute("aria-label", LABEL);
|
||||
const head = el("header");
|
||||
const count = el("span");
|
||||
const again = compactAction("Check again", "Look at the workflow again after a change");
|
||||
const close = compactAction("✕", "Close");
|
||||
head.append(el("b", "", LABEL), count, again, close);
|
||||
const list = el("div", "ausboss-layout-check-list");
|
||||
panel.append(head, list, el("footer", "", "Click an entry to jump to it. Nothing is moved."));
|
||||
again.addEventListener("click", () => fill(list, count));
|
||||
close.addEventListener("click", closePanel);
|
||||
// The panel is not part of the canvas: a press here must not start a drag.
|
||||
panel.addEventListener("pointerdown", (event) => event.stopPropagation());
|
||||
const rect = app.canvas?.canvas?.getBoundingClientRect?.();
|
||||
panel.style.left = `${(rect?.right ?? window.innerWidth) - 376}px`;
|
||||
panel.style.top = `${(rect?.top ?? 0) + 100}px`;
|
||||
document.body.append(panel);
|
||||
window.addEventListener("keydown", onKey, true);
|
||||
fill(list, count);
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "AusBoss.LayoutCheck",
|
||||
commands: [{ id: "AusBoss.CheckLayout", label: `AusBoss: ${LABEL}`, function: openPanel }],
|
||||
getCanvasMenuItems() {
|
||||
return [{ content: `${t(LABEL)} 🆎`, callback: openPanel }];
|
||||
},
|
||||
afterConfigureGraph() {
|
||||
closePanel();
|
||||
},
|
||||
});
|
||||
@@ -288,6 +288,9 @@ function syncSizes() {
|
||||
const grabbed = together.grabbed;
|
||||
if (!grabbed) return;
|
||||
const was = together.before.get(grabbed);
|
||||
// A handle click is not a resize. Once a drag starts, keep syncing even
|
||||
// when it returns to its starting size so the other nodes follow it back.
|
||||
if (!together.sides && grabbed.size[0] === was.size[0] && grabbed.size[1] === was.size[1]) return;
|
||||
together.sides ??= sharedSides(
|
||||
[...together.before.values()].map(({ pos, size }) => ({ x: pos[0], y: pos[1], w: size[0], h: size[1] })),
|
||||
);
|
||||
|
||||
@@ -20,21 +20,36 @@ export function outputWindow(durationValue, startValue, endValue, maxValue = 0)
|
||||
return { start, end, keepEnd, length: keepEnd - start, cut: Math.max(0, end - keepEnd) };
|
||||
}
|
||||
|
||||
// "0:12.0" style, the way the IN and OUT fields write a time.
|
||||
export function secondsLabel(value) {
|
||||
const seconds = Math.max(0, finite(value));
|
||||
if (seconds < 60) return `${seconds.toFixed(1)} s`;
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
return `${minutes}:${(seconds - minutes * 60).toFixed(1).padStart(4, "0")}`;
|
||||
const hundredth = (value) => Math.round(value * 100) / 100;
|
||||
|
||||
// What the face stores for a pick from `start` to `end`: a Start and a
|
||||
// Duration (max_seconds, with end_seconds at 0, "to the end"). A pick that
|
||||
// reaches the end of the file needs no Duration. When another node sets the
|
||||
// Duration or the end, the pick is stored as a start and an end instead.
|
||||
// A key left out is not written.
|
||||
export function pickWrites(durationValue, startValue, endValue, { maxLinked = false, endLinked = false } = {}) {
|
||||
const duration = Math.max(0, finite(durationValue));
|
||||
const start = hundredth(Math.min(Math.max(0, finite(startValue)), duration));
|
||||
const end = hundredth(Math.max(start, Math.min(finite(endValue), duration)));
|
||||
const toEnd = end >= duration - 0.005;
|
||||
if (endLinked) return { start };
|
||||
if (maxLinked) return { start, end: toEnd ? 0 : end };
|
||||
return { start, end: 0, max: toEnd ? 0 : Math.max(0.01, hundredth(end - start)) };
|
||||
}
|
||||
|
||||
// The line between IN and OUT: what comes out, and what the max cuts off.
|
||||
export function outputSummary(window, { maxFromLink = false } = {}) {
|
||||
if (!window || window.length <= 0) return "";
|
||||
const parts = [secondsLabel(window.length)];
|
||||
if (window.cut > 0.005) parts.push(`cut ${secondsLabel(window.cut)}`);
|
||||
if (maxFromLink) parts.push("max wired");
|
||||
return parts.join(" · ");
|
||||
// A value typed into Start, Duration or Ends at, as the pick it makes.
|
||||
// Start keeps the Duration; Duration and Ends at keep the start. An empty
|
||||
// or 0 Duration, and an empty Ends at, run to the end of the file.
|
||||
export function typedPick(key, value, window, durationValue, minimum = 0.1) {
|
||||
const duration = Math.max(0, finite(durationValue));
|
||||
const clampTime = (time) => Math.min(duration, Math.max(0, finite(time)));
|
||||
if (key === "start") {
|
||||
const start = clampTime(value);
|
||||
return { start, end: Math.min(duration, start + window.length) };
|
||||
}
|
||||
if (value == null || (key === "duration" && !(finite(value) > 0))) return { start: window.start, end: duration };
|
||||
const end = key === "duration" ? window.start + Math.max(minimum, finite(value)) : Math.max(window.start + minimum, finite(value));
|
||||
return { start: window.start, end: clampTime(end) };
|
||||
}
|
||||
|
||||
// Loud and quiet across the file: for each of `buckets` slices, the lowest
|
||||
|
||||
+118
-110
@@ -1,30 +1,35 @@
|
||||
// Load Audio 🆎 - the wave, the trim and the player.
|
||||
// Load Audio 🆎 - the wave, the timing and the player.
|
||||
//
|
||||
// The card above (js/widget_cards) holds Source and Max length. This panel
|
||||
// draws the whole file as a wave: the part that comes out is bright, the
|
||||
// part a Max length cuts off is red, and the rest is dim. Drag a handle to
|
||||
// move IN or OUT, drag the middle to slide the pick, or click elsewhere to
|
||||
// move it there. Play plays only what comes out. The widgets underneath
|
||||
// (start_seconds, end_seconds, max_seconds) stay the source of truth.
|
||||
// The card above (js/widget_cards) holds Source. This panel draws the whole
|
||||
// file as a wave: the part that comes out is bright and the rest is dim.
|
||||
// Under it, Start, Duration and Ends at, as on the video nodes. Drag a
|
||||
// handle on the wave to move the start or the end, drag the middle to slide
|
||||
// the sound, or click elsewhere to move it there. Play plays only what comes
|
||||
// out. The widgets underneath stay the source of truth: the Duration is
|
||||
// max_seconds with end_seconds at 0. A saved end (or a linked Max length)
|
||||
// still works: the part a Max length cuts off shows red.
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { BRAND, chainCallback, keepDomWidgetWidthAuto, notifyAusbossChange, showToast } from "../shared/index.mjs";
|
||||
import { keepKeyInField } from "../shared/canvas_passthrough.mjs";
|
||||
import { WIDGET_FRAME, fillNodeHeight } from "../shared/panel_layout.mjs";
|
||||
import { formatTimecode, parseTimecode } from "../shared/timecode.mjs";
|
||||
import { formatTimecode } from "../shared/timecode.mjs";
|
||||
import { inputNumber } from "../shared/clip_rate.mjs";
|
||||
import { makeScrubInput } from "../shared/scrub_input.mjs";
|
||||
import { linkedNodeInfo } from "../shared/timing_links.mjs";
|
||||
import { parseImageReference } from "../shared/pad_canvas.mjs";
|
||||
import { mediaViewQuery, splitMediaName } from "../shared/video_preview.mjs";
|
||||
import { ensureVideoCss, hideCanvasWidget, makeToolButton } from "../shared/video_ui.mjs";
|
||||
import { MIN_TRIM_SECONDS, dragTrimHandle, slideTrimWindow } from "../load_video/trim_preview.mjs";
|
||||
import { grabZone, outputSummary, outputWindow, secondsLabel, wavePeaks } from "./audio_window.mjs";
|
||||
import { grabZone, outputWindow, pickWrites, typedPick, wavePeaks } from "./audio_window.mjs";
|
||||
|
||||
const NODE_NAME = "AUSBOSS_NODES_LoadAudio";
|
||||
const PANEL_WIDGET = "ausboss_load_audio_wave";
|
||||
// The frontend's own player for an audio_upload input. The wave replaces it.
|
||||
const CORE_AUDIO_WIDGET = "audioUI";
|
||||
const MIN_WIDTH = 280;
|
||||
// 8px root padding + the wave's 28px floor + 6px gap + the 22px play, IN/OUT and loop row.
|
||||
const PANEL_MIN_HEIGHT = 64;
|
||||
// 8px root padding + the wave's 28px floor + 6px gap + the 38px Start,
|
||||
// Duration and Ends at row (a label over a box).
|
||||
const PANEL_MIN_HEIGHT = 80;
|
||||
// Opens small and neat: 300 px wide, with a wave about as tall as a field
|
||||
// (32 px). Drag the corner down for a taller wave.
|
||||
const DEFAULT_WIDTH = 300;
|
||||
@@ -50,26 +55,32 @@ function hideCoreAudio(node) {
|
||||
}
|
||||
}
|
||||
|
||||
// A wired Max length: the number the wire carries, when the far end is a
|
||||
// node that shows it (Float, Integer, a Primitive). null when it can't be known.
|
||||
function wiredMax(node) {
|
||||
const input = node.inputs?.find((slot) => slot?.widget?.name === "max_seconds");
|
||||
if (!input || input.link == null) return { wired: false, value: null };
|
||||
const graph = node.graph;
|
||||
const link = graph?.getLink?.(input.link) ?? graph?.links?.get?.(input.link) ?? graph?.links?.[input.link];
|
||||
const origin = link ? graph?.getNodeById?.(link.origin_id) : null;
|
||||
const shown = origin?.widgets?.find((widget) => typeof widget?.value === "number");
|
||||
return { wired: true, value: shown ? Number(shown.value) : null };
|
||||
function linked(node, name) {
|
||||
return !!node.inputs?.some((slot) => slot?.widget?.name === name && slot.link != null);
|
||||
}
|
||||
|
||||
// A value as the run will see it: the widget, or the number a linked input
|
||||
// carries when the far end is a typed number (through Reroutes and
|
||||
// subgraphs). null when only the run knows it.
|
||||
function valueOf(state, name, widget) {
|
||||
if (!linked(state.node, name)) return Number(widget?.value) || 0;
|
||||
return inputNumber(state.node, name, null);
|
||||
}
|
||||
|
||||
function maxSeconds(state) {
|
||||
const wired = wiredMax(state.node);
|
||||
if (wired.wired) return { value: wired.value ?? 0, fromLink: true, known: wired.value != null };
|
||||
return { value: Number(state.maxWidget?.value) || 0, fromLink: false, known: true };
|
||||
const fromLink = linked(state.node, "max_seconds");
|
||||
const value = valueOf(state, "max_seconds", state.maxWidget);
|
||||
return { value: value ?? 0, fromLink, known: value != null };
|
||||
}
|
||||
|
||||
function currentWindow(state) {
|
||||
return outputWindow(state.duration, state.startWidget.value, state.endWidget.value, maxSeconds(state).value);
|
||||
const start = valueOf(state, "start_seconds", state.startWidget) ?? 0;
|
||||
const max = maxSeconds(state).value;
|
||||
let end = valueOf(state, "end_seconds", state.endWidget) ?? 0;
|
||||
// No end and a Duration: the Duration is where the sound stops, so
|
||||
// nothing past it shows as cut off. Only an end past the Duration does.
|
||||
if (!(end > 0) && max > 0 && state.duration > 0) end = Math.min(state.duration, Math.max(0, start) + max);
|
||||
return outputWindow(state.duration, start, end, max);
|
||||
}
|
||||
|
||||
async function loadPeaks(name, route) {
|
||||
@@ -105,16 +116,15 @@ function ensureAudioCss() {
|
||||
.ausboss-audio-error{pointer-events:auto;border:0;background:transparent;color:#e6bf87;font:11px system-ui;cursor:pointer;white-space:nowrap}
|
||||
.ausboss-audio-root canvas.ausboss-audio-wave{position:absolute;inset:0;width:100%;height:100%;display:block;}
|
||||
.ausboss-audio-root .ausboss-video-stage:not(.is-empty) .ausboss-video-status{display:none;}
|
||||
.ausboss-audio-root .ausboss-audio-row{display:flex;align-items:center;gap:6px;flex:none;padding:0 2px;}
|
||||
.ausboss-audio-root .ausboss-audio-row .ausboss-video-values{flex:1 1 auto;min-width:0;}
|
||||
.ausboss-audio-root .ausboss-audio-play{min-width:30px;font-size:10px;}
|
||||
.ausboss-audio-root .ausboss-audio-length{flex:none;padding:0 2px;color:#7fd9d2;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap;cursor:default;}
|
||||
.ausboss-audio-root .ausboss-audio-length:empty{display:none;}
|
||||
.ausboss-audio-root .ausboss-audio-length.has-cut{color:#ff9aa0;cursor:pointer;text-decoration:underline dotted rgba(224,82,90,.8);text-underline-offset:2px;}
|
||||
.ausboss-audio-root .ausboss-audio-row .ausboss-video-tool{flex:none;}
|
||||
.ausboss-audio-root .ausboss-video-values{display:flex;gap:8px;}
|
||||
.ausboss-audio-root .ausboss-video-value input{width:48px;}
|
||||
.ausboss-audio-root .ausboss-audio-length{margin-left:auto;}
|
||||
.ausboss-audio-root .ausboss-audio-wave-row{display:flex;align-items:stretch;gap:6px;flex:1 1 auto;min-height:28px;}
|
||||
.ausboss-audio-root .ausboss-audio-wave-row .ausboss-video-stage{flex:1 1 auto;min-width:0;}
|
||||
.ausboss-audio-root .ausboss-audio-play{flex:none;align-self:center;min-width:30px;font-size:10px;}
|
||||
.ausboss-audio-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:none;padding:0 2px;color:#ddd;font:11px system-ui;}
|
||||
.ausboss-audio-field{display:flex;flex-direction:column;gap:2px;min-width:0;}
|
||||
.ausboss-audio-field .ausboss-scrub{width:100%;box-sizing:border-box;}
|
||||
.ausboss-audio-field-label{display:flex;align-items:center;gap:6px;min-width:0;color:#cadddb;}
|
||||
.ausboss-audio-go{border:0;background:transparent;padding:0;color:#45d6cb;font:600 10px system-ui;text-decoration:underline;cursor:pointer;}
|
||||
.ausboss-audio-go[hidden]{display:none;}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
@@ -192,21 +202,31 @@ function draw(state) {
|
||||
}
|
||||
}
|
||||
|
||||
// One box's look: its value, whether it can be typed, and the "linked"
|
||||
// button when another node sets it.
|
||||
function showField(state, key, value, lockedBy, tip) {
|
||||
const field = state.fields[key];
|
||||
field.control.set(value);
|
||||
field.control.root.style.opacity = lockedBy ? ".45" : "";
|
||||
field.control.root.inert = Boolean(lockedBy);
|
||||
field.go.hidden = !lockedBy;
|
||||
field.cell.title = lockedBy ? `Set by ${lockedBy.title}. Click "linked" to go to that node.` : tip;
|
||||
if (lockedBy) field.go.onclick = () => lockedBy.go?.();
|
||||
}
|
||||
|
||||
function updateFace(state) {
|
||||
const win = currentWindow(state);
|
||||
const max = maxSeconds(state);
|
||||
if (document.activeElement !== state.startInput) state.startInput.value = formatTimecode(win.start);
|
||||
if (document.activeElement !== state.endInput) state.endInput.value = formatTimecode(win.end);
|
||||
if (state.duration > 0) {
|
||||
const summary = outputSummary(win, { maxFromLink: max.fromLink && !max.known });
|
||||
state.summary.textContent = win.length > 0 ? secondsLabel(win.length) : "";
|
||||
state.summary.classList.toggle("has-cut", win.cut > 0.005);
|
||||
state.summary.title = win.cut > 0.005
|
||||
? `${summary}. Max length is ${max.value} s, so ${formatTimecode(win.keepEnd)} to ${formatTimecode(win.end)} is cut off (red). Click to move OUT to ${formatTimecode(win.keepEnd)}.`
|
||||
: `${summary}: ${formatTimecode(win.start)} to ${formatTimecode(win.keepEnd)} comes out.`;
|
||||
} else {
|
||||
state.summary.textContent = "";
|
||||
}
|
||||
const link = (name) => (linked(state.node, name) ? linkedNodeInfo(state.node, name) : null);
|
||||
// A linked value the page cannot read is only known when the graph runs:
|
||||
// its box, and the boxes that depend on it, stay empty.
|
||||
const known = (name) => !linked(state.node, name) || inputNumber(state.node, name, null) != null;
|
||||
const has = state.duration > 0;
|
||||
const startKnown = has && known("start_seconds");
|
||||
const lengthKnown = startKnown && known("max_seconds") && known("end_seconds");
|
||||
showField(state, "start", startKnown ? win.start : null, link("start_seconds"), `Where the sound starts in the file, of ${formatTimecode(state.duration)}.`);
|
||||
showField(state, "duration", lengthKnown ? win.length : null, link("max_seconds"),
|
||||
win.cut > 0.005 ? `How long the sound is. It stops ${formatTimecode(win.cut)} before the saved end (red).` : "How long the sound is. Clear it, or type 0, to run to the end of the file.");
|
||||
showField(state, "end", lengthKnown ? win.keepEnd : null, link("end_seconds"), "Where the sound stops in the file. Typing it changes the Duration.");
|
||||
draw(state);
|
||||
}
|
||||
|
||||
@@ -217,12 +237,19 @@ function writeWidget(widget, value) {
|
||||
widget.callback?.(next);
|
||||
}
|
||||
|
||||
// The pick, stored the way the face shows it (pickWrites): a Start and a
|
||||
// Duration, or a start and an end when another node sets the Duration.
|
||||
function writeTrim(state, bounds) {
|
||||
state.writing = true;
|
||||
try {
|
||||
writeWidget(state.startWidget, bounds.start);
|
||||
// OUT at the very end stays 0, the widget's own "to the end".
|
||||
writeWidget(state.endWidget, bounds.end >= state.duration - 0.005 ? 0 : bounds.end);
|
||||
const startLinked = linked(state.node, "start_seconds");
|
||||
const writes = pickWrites(state.duration, startLinked ? currentWindow(state).start : bounds.start, bounds.end, {
|
||||
maxLinked: linked(state.node, "max_seconds") || !state.maxWidget,
|
||||
endLinked: linked(state.node, "end_seconds"),
|
||||
});
|
||||
if (!startLinked) writeWidget(state.startWidget, writes.start);
|
||||
if (writes.end !== undefined) writeWidget(state.endWidget, writes.end);
|
||||
if (writes.max !== undefined) writeWidget(state.maxWidget, writes.max);
|
||||
} finally {
|
||||
state.writing = false;
|
||||
}
|
||||
@@ -248,7 +275,7 @@ function installDrag(state) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const initial = infoAt(event.clientX);
|
||||
const bounds = { start: initial.win.start, end: initial.win.end };
|
||||
const bounds = { start: initial.win.start, end: initial.win.keepEnd };
|
||||
const anchor = initial.fraction * state.duration;
|
||||
const downX = event.clientX;
|
||||
let moved = false;
|
||||
@@ -262,7 +289,7 @@ function installDrag(state) {
|
||||
const next = infoAt(clientX);
|
||||
if (initial.zone === "start" || initial.zone === "end") {
|
||||
const now = currentWindow(state);
|
||||
writeTrim(state, dragTrimHandle(state.duration, { start: now.start, end: now.end }, initial.zone, next.fraction, MIN_TRIM_SECONDS));
|
||||
writeTrim(state, dragTrimHandle(state.duration, { start: now.start, end: now.keepEnd }, initial.zone, next.fraction, MIN_TRIM_SECONDS));
|
||||
} else if (initial.zone === "move") {
|
||||
writeTrim(state, slideTrimWindow(state.duration, bounds, next.fraction * state.duration - anchor));
|
||||
} else {
|
||||
@@ -336,19 +363,6 @@ function installPlayer(state) {
|
||||
state.stopPlayer = () => { audio.pause(); stop(); };
|
||||
}
|
||||
|
||||
function commitTimeInput(state, edge, input) {
|
||||
if (state.duration <= 0) return;
|
||||
const seconds = parseTimecode(input.value);
|
||||
const win = currentWindow(state);
|
||||
if (seconds === null) {
|
||||
input.value = formatTimecode(edge === "start" ? win.start : win.end);
|
||||
return;
|
||||
}
|
||||
writeTrim(state, dragTrimHandle(state.duration, { start: win.start, end: win.end }, edge, seconds / state.duration, MIN_TRIM_SECONDS));
|
||||
notifyAusbossChange();
|
||||
input.blur();
|
||||
}
|
||||
|
||||
function watchWidget(state, widget) {
|
||||
if (!widget || widget.__ausbossAudioWatch) return;
|
||||
widget.__ausbossAudioWatch = true;
|
||||
@@ -385,37 +399,44 @@ function buildPanel(node) {
|
||||
playButton.classList.add("ausboss-audio-play");
|
||||
const loopButton = makeToolButton("LOOP", "Play it again and again");
|
||||
stage.append(canvas, status);
|
||||
// Play and Loop sit either side of the wave, so neither covers a handle.
|
||||
loopButton.classList.add("ausboss-audio-play");
|
||||
const waveRow = document.createElement("div");
|
||||
waveRow.className = "ausboss-audio-wave-row";
|
||||
waveRow.append(playButton, stage, loopButton);
|
||||
|
||||
const values = document.createElement("div");
|
||||
values.className = "ausboss-video-values";
|
||||
const makeValue = (labelText, title) => {
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "ausboss-video-value";
|
||||
const label = document.createElement("label");
|
||||
label.textContent = labelText;
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.inputMode = "decimal";
|
||||
input.placeholder = "m:ss.s";
|
||||
input.title = title;
|
||||
input.addEventListener("keydown", (event) => {
|
||||
keepKeyInField(event);
|
||||
if (event.key === "Enter") input.dispatchEvent(new Event("change"));
|
||||
});
|
||||
wrap.append(label, input);
|
||||
return { wrap, input };
|
||||
// Start, Duration and Ends at, as on the video nodes, in seconds.
|
||||
const fieldsRow = document.createElement("div");
|
||||
fieldsRow.className = "ausboss-audio-fields";
|
||||
const fields = {};
|
||||
const commit = (key, value) => {
|
||||
const state = node.__ausbossLoadAudio;
|
||||
if (!state || state.duration <= 0) return;
|
||||
writeTrim(state, typedPick(key, value, currentWindow(state), state.duration, MIN_TRIM_SECONDS));
|
||||
};
|
||||
const startValue = makeValue("IN", "Where the sound starts. Type seconds (12.5) or a time (0:12.5).");
|
||||
const endValue = makeValue("OUT", "Where the sound stops. Type seconds (24) or a time (0:24.0).");
|
||||
// How long the output is, beside OUT and off the wave. Red when Max
|
||||
// length cuts the pick short; the tooltip says how much.
|
||||
const summary = document.createElement("div");
|
||||
summary.className = "ausboss-audio-length";
|
||||
values.append(startValue.wrap, endValue.wrap);
|
||||
const row = document.createElement("div");
|
||||
row.className = "ausboss-audio-row";
|
||||
row.append(playButton, values, summary, loopButton);
|
||||
root.append(stage, row);
|
||||
for (const [key, caption] of [["start", "Start"], ["duration", "Duration"], ["end", "Ends at"]]) {
|
||||
const cell = document.createElement("div");
|
||||
cell.className = "ausboss-audio-field";
|
||||
const label = document.createElement("span");
|
||||
label.className = "ausboss-audio-field-label";
|
||||
label.textContent = caption;
|
||||
const go = document.createElement("button");
|
||||
go.type = "button";
|
||||
go.className = "ausboss-audio-go";
|
||||
go.textContent = "linked";
|
||||
go.hidden = true;
|
||||
label.append(go);
|
||||
const control = makeScrubInput({
|
||||
value: 0, min: 0, max: 86400, step: 0.1, fineStep: 0.01, decimals: 2, minDecimals: 0, unit: "s", unitWidth: 14,
|
||||
allowEmpty: true,
|
||||
onChange: (value) => commit(key, value),
|
||||
onSettle: () => notifyAusbossChange(),
|
||||
});
|
||||
cell.append(label, control.root);
|
||||
fieldsRow.append(cell);
|
||||
fields[key] = { cell, control, go };
|
||||
}
|
||||
root.append(waveRow, fieldsRow);
|
||||
|
||||
const widget = node.addDOMWidget(PANEL_WIDGET, "ausboss_audio", root, {
|
||||
serialize: false,
|
||||
@@ -435,22 +456,11 @@ function buildPanel(node) {
|
||||
audio.preload = "auto";
|
||||
const abort = new AbortController();
|
||||
const state = node.__ausbossLoadAudio = {
|
||||
node, root, stage, canvas, status, playButton, loopButton, summary, audio,
|
||||
startInput: startValue.input, endInput: endValue.input,
|
||||
node, root, stage, canvas, status, playButton, loopButton, audio, fields,
|
||||
audioWidget, startWidget, endWidget, maxWidget: findWidget(node, "max_seconds"),
|
||||
duration: 0, peaks: null, abort, writing: false, dragging: false, raf: 0, loading: 0,
|
||||
};
|
||||
|
||||
// Clicking the red length moves OUT to where the sound really ends.
|
||||
summary.addEventListener("click", (event) => {
|
||||
const win = currentWindow(state);
|
||||
if (win.cut <= 0.005) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
writeTrim(state, { start: win.start, end: win.keepEnd });
|
||||
notifyAusbossChange();
|
||||
});
|
||||
|
||||
const updateLoop = () => loopButton.classList.toggle("active", loopEnabled(node));
|
||||
updateLoop();
|
||||
loopButton.addEventListener("click", (event) => {
|
||||
@@ -509,8 +519,6 @@ function buildPanel(node) {
|
||||
watchWidget(state, startWidget);
|
||||
watchWidget(state, endWidget);
|
||||
watchWidget(state, state.maxWidget);
|
||||
startValue.input.addEventListener("change", () => commitTimeInput(state, "start", startValue.input));
|
||||
endValue.input.addEventListener("change", () => commitTimeInput(state, "end", endValue.input));
|
||||
const observer = new ResizeObserver(() => draw(state));
|
||||
observer.observe(stage);
|
||||
state.observer = observer;
|
||||
|
||||
+145
-355
@@ -1,9 +1,11 @@
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { chainCallback, keepDomWidgetWidthAuto, notifyAusbossChange } from "../shared/index.mjs";
|
||||
import { keepKeyInField } from "../shared/canvas_passthrough.mjs";
|
||||
import { WIDGET_FRAME, fillNodeHeight } from "../shared/panel_layout.mjs";
|
||||
import { formatTimecode, parseTimecode } from "../shared/timecode.mjs";
|
||||
import { inputNumber } from "../shared/clip_rate.mjs";
|
||||
import { clipInfo, windowSeconds } from "../shared/timeline_math.mjs";
|
||||
import { mountTransformTrim } from "../shared/transform_trim.mjs";
|
||||
import { linkedNodeInfo, timingUnits } from "../shared/timing_links.mjs";
|
||||
import { parseImageReference } from "../shared/pad_canvas.mjs";
|
||||
import {
|
||||
mediaInfo,
|
||||
@@ -19,42 +21,31 @@ import {
|
||||
suppressCoreVideoPreview,
|
||||
} from "../shared/video_ui.mjs";
|
||||
import {
|
||||
MIN_TRIM_SECONDS,
|
||||
clampTrimSeek,
|
||||
closestTrimHandle,
|
||||
dragTrimHandle,
|
||||
loadSummary,
|
||||
playbackBoundaryAction,
|
||||
singleFrameFraction,
|
||||
singleFrameTime,
|
||||
slideTrimWindow,
|
||||
trimAfterFramePick,
|
||||
trimBounds,
|
||||
trimFractions,
|
||||
} from "./trim_preview.mjs";
|
||||
|
||||
const NODE_NAME = "AUSBOSS_NODES_LoadVideo";
|
||||
const PREVIEW_WIDGET = "ausboss_load_video_viewer";
|
||||
const PREVIEW_CHROME = 88;
|
||||
// The shared video root's CSS minimum: 8px root padding + the stage's 112px
|
||||
// floor + 6px gap + the 76px trim strip. The declared floor adds
|
||||
// WIDGET_FRAME on top, or the element comes up short and clips the trim
|
||||
// strip's bottom border at the node's minimum height.
|
||||
const PANEL_MIN_HEIGHT = 202;
|
||||
// 8px root padding + the stage's 112px floor + 6px gap + the 152px timing
|
||||
// card (js/shared/transform_trim.mjs). The declared floor adds WIDGET_FRAME
|
||||
// on top, or the element comes up short and clips the card's bottom border
|
||||
// at the node's minimum height.
|
||||
const PANEL_MIN_HEIGHT = 278;
|
||||
// Height the node opens at. It used to fall out of the panel's computeSize;
|
||||
// with the panel free to follow the node, the default has to be stated. The
|
||||
// chrome covers the transport row and the trim strip under the player.
|
||||
const DEFAULT_NODE_SIZE = [380, responsivePreviewHeight(380) + PREVIEW_CHROME + 190];
|
||||
// extra covers the tools over the picture and the timing card under it.
|
||||
const DEFAULT_NODE_SIZE = [380, responsivePreviewHeight(380) + PREVIEW_CHROME + 210];
|
||||
const TRIM_EPSILON = 0.04;
|
||||
|
||||
function findWidget(node, name) {
|
||||
return node.widgets?.find((widget) => widget.name === name);
|
||||
}
|
||||
|
||||
function roundHundredth(value) {
|
||||
return Math.round(Number(value || 0) * 100) / 100;
|
||||
}
|
||||
|
||||
function getLoopEnabled(node) {
|
||||
node.properties ??= {};
|
||||
if (node.properties.ausboss_load_video_loop === undefined) {
|
||||
@@ -66,14 +57,25 @@ function getLoopEnabled(node) {
|
||||
function setEmpty(state, text) {
|
||||
state.stage.classList.add("is-empty");
|
||||
state.status.textContent = text;
|
||||
state.status.hidden = false;
|
||||
}
|
||||
|
||||
function setReady(state, text) {
|
||||
state.stage.classList.remove("is-empty");
|
||||
state.status.textContent = text;
|
||||
state.status.hidden = !text;
|
||||
}
|
||||
|
||||
// The run's window in seconds, as the timing card works it out (Start, and
|
||||
// the Duration or the end), or the plain start/end before the video's frame
|
||||
// rate is known.
|
||||
function currentBounds(state) {
|
||||
const info = clipInfo(state.metadata);
|
||||
const window = state.card?.window?.();
|
||||
if (info.fps > 0 && window && Number.isFinite(window.first)) {
|
||||
const last = Number.isFinite(window.last) ? window.last : info.count - 1;
|
||||
return { start: window.first / info.fps, end: Math.min(info.duration || Infinity, (last + 1) / info.fps) };
|
||||
}
|
||||
return trimBounds(state.video.duration, state.startWidget.value, state.endWidget.value);
|
||||
}
|
||||
|
||||
@@ -82,271 +84,116 @@ function isSingleFrame(state) {
|
||||
}
|
||||
|
||||
// Where the preview belongs for the current mode: the chosen frame, or the
|
||||
// trim window's IN point.
|
||||
// clip's start.
|
||||
function homeTime(state) {
|
||||
return isSingleFrame(state)
|
||||
? singleFrameTime(state.video.duration, state.startWidget.value)
|
||||
: currentBounds(state).start;
|
||||
}
|
||||
|
||||
function applyMode(state) {
|
||||
const single = isSingleFrame(state);
|
||||
state.root.classList.toggle("is-single-frame", single);
|
||||
state.frameButton?.classList.toggle("active", single);
|
||||
state.startLabel.textContent = single ? "AT" : "IN";
|
||||
state.range.title = single
|
||||
? "Drag or click to choose the frame that loads"
|
||||
: "Drag either handle to set the trim; drag the selected range to move it";
|
||||
updateTrimFace(state);
|
||||
}
|
||||
|
||||
function widgetLinkDriven(node, name) {
|
||||
return !!node.inputs?.some((input) => input?.widget?.name === name && input.link != null);
|
||||
}
|
||||
|
||||
// The honest "what will actually load" text for the label under the trim
|
||||
// strip, or "" when there is nothing honest to say. Any of the deciding
|
||||
// widgets driven by a link means its face value is stale, so the count
|
||||
// drops out rather than guessing.
|
||||
function trimLoadSummary(state, duration, bounds) {
|
||||
const deciders = ["start_seconds", "end_seconds", "every_nth", "max_frames", "single_frame"];
|
||||
if (deciders.some((name) => widgetLinkDriven(state.node, name))) return "";
|
||||
return loadSummary(
|
||||
duration,
|
||||
bounds,
|
||||
state.sourceFps,
|
||||
state.everyNthWidget?.value,
|
||||
state.maxFramesWidget?.value,
|
||||
isSingleFrame(state),
|
||||
);
|
||||
}
|
||||
|
||||
// The <video> element never exposes the source frame rate, so the frame
|
||||
// count in the label needs a probe of the pack's metadata route. Fail-soft:
|
||||
// on any error the label simply omits the count and the timecodes stand.
|
||||
async function probeSourceFps(state, name) {
|
||||
state.sourceFps = 0;
|
||||
// Frame rate and the real frame count come from the pack's metadata route:
|
||||
// the <video> element knows neither, and its length rounds up a frame.
|
||||
// Fail-soft: without it the card waits for a source.
|
||||
async function probeMetadata(state, name) {
|
||||
state.metadata = null;
|
||||
try {
|
||||
const query = new URLSearchParams({ source_mode: "input folder", video: name });
|
||||
const type = parseImageReference(name)?.type;
|
||||
if (type && type !== "input") {
|
||||
query.set("source_mode", "local path");
|
||||
query.set("local_path", name);
|
||||
}
|
||||
const response = await api.fetchApi(`/ausboss/transform/video/metadata?${query}`);
|
||||
if (!response.ok) return;
|
||||
const metadata = await response.json();
|
||||
if (state.videoWidget.value !== name) return; // a newer selection won
|
||||
state.sourceFps = Math.max(0, Number(metadata?.fps) || 0);
|
||||
updateTrimFace(state);
|
||||
state.metadata = metadata;
|
||||
state.card?.sync();
|
||||
} catch (_error) {
|
||||
/* no fps, no frame count */
|
||||
/* no metadata, no timing card numbers */
|
||||
}
|
||||
}
|
||||
|
||||
function writeWidget(widget, value) {
|
||||
const next = roundHundredth(value);
|
||||
if (Math.abs(Number(widget.value || 0) - next) < 0.0001) return;
|
||||
widget.value = next;
|
||||
widget.callback?.(next);
|
||||
function setWidget(widget, value) {
|
||||
if (!widget) return;
|
||||
if (widget.value === value) return;
|
||||
widget.value = value;
|
||||
widget.callback?.(value);
|
||||
}
|
||||
|
||||
function writeTrim(state, bounds, seekEdge = null) {
|
||||
state.writing = true;
|
||||
try {
|
||||
writeWidget(state.startWidget, bounds.start);
|
||||
writeWidget(state.endWidget, bounds.end);
|
||||
} finally {
|
||||
state.writing = false;
|
||||
}
|
||||
updateTrimFace(state);
|
||||
if (state.video.readyState >= 1 && seekEdge) {
|
||||
state.video.currentTime = seekEdge === "start"
|
||||
? bounds.start
|
||||
: Math.max(bounds.start, bounds.end - TRIM_EPSILON);
|
||||
}
|
||||
state.node.setDirtyCanvas?.(true, true);
|
||||
state.node.graph?.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
function writeFrameTime(state, timeValue) {
|
||||
const duration = Number.isFinite(state.video.duration) ? state.video.duration : 0;
|
||||
const time = singleFrameTime(duration, timeValue);
|
||||
state.writing = true;
|
||||
try {
|
||||
writeWidget(state.startWidget, time);
|
||||
} finally {
|
||||
state.writing = false;
|
||||
}
|
||||
updateTrimFace(state);
|
||||
if (state.video.readyState >= 1) state.video.currentTime = time;
|
||||
state.node.setDirtyCanvas?.(true, true);
|
||||
state.node.graph?.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
function updateTrimFace(state) {
|
||||
const duration = Number.isFinite(state.video.duration) ? state.video.duration : 0;
|
||||
if (isSingleFrame(state)) {
|
||||
const time = singleFrameTime(duration, state.startWidget.value);
|
||||
const percent = singleFrameFraction(duration, time) * 100;
|
||||
state.selection.style.width = "0%";
|
||||
state.startHandle.style.left = `${percent}%`;
|
||||
if (document.activeElement !== state.startInput) state.startInput.value = formatTimecode(time);
|
||||
// "1 frame at 0:05.2" - the count comes from the same pure summary the
|
||||
// trim label uses, so both modes report what one Run will load.
|
||||
const summary = trimLoadSummary(state, duration, null);
|
||||
state.durationLabel.textContent = duration > 0
|
||||
? `${summary || "frame"} at ${formatTimecode(time)}`
|
||||
: "load a video to pick a frame";
|
||||
if (duration > 0) state.status.textContent = `frame at ${formatTimecode(time)}`;
|
||||
return;
|
||||
}
|
||||
const bounds = trimBounds(duration, state.startWidget.value, state.endWidget.value);
|
||||
const fractions = trimFractions(duration, bounds);
|
||||
const startPercent = fractions.start * 100;
|
||||
const endPercent = fractions.end * 100;
|
||||
state.selection.style.left = `${startPercent}%`;
|
||||
state.selection.style.width = `${Math.max(0, endPercent - startPercent)}%`;
|
||||
state.startHandle.style.left = `${startPercent}%`;
|
||||
state.endHandle.style.left = `${endPercent}%`;
|
||||
if (document.activeElement !== state.startInput) state.startInput.value = formatTimecode(bounds.start);
|
||||
if (document.activeElement !== state.endInput) state.endInput.value = formatTimecode(bounds.end);
|
||||
const selected = Math.max(0, bounds.end - bounds.start);
|
||||
// The preview cannot re-render every_nth or max_frames, so the label
|
||||
// reports them instead: "0:04.0 of 0:10.0 · 48 frames @ 12 fps".
|
||||
const summary = trimLoadSummary(state, duration, bounds);
|
||||
state.durationLabel.textContent = duration > 0
|
||||
? `${formatTimecode(selected)} of ${formatTimecode(duration)}${summary ? ` · ${summary}` : ""}`
|
||||
: "load a video to trim";
|
||||
state.status.textContent = duration > 0
|
||||
? `${formatTimecode(bounds.start)} → ${formatTimecode(bounds.end)}`
|
||||
: state.status.textContent;
|
||||
}
|
||||
|
||||
function installTrimDrag(state) {
|
||||
const { range } = state;
|
||||
const infoAt = (clientX) => {
|
||||
const rect = range.getBoundingClientRect();
|
||||
const duration = Number.isFinite(state.video.duration) ? state.video.duration : 0;
|
||||
const bounds = currentBounds(state);
|
||||
const fractions = trimFractions(duration, bounds);
|
||||
const x = clientX - rect.left;
|
||||
const hit = 10;
|
||||
let zone = "jump";
|
||||
const closest = closestTrimHandle(
|
||||
fractions.start,
|
||||
fractions.end,
|
||||
rect.width ? x / rect.width : 0,
|
||||
rect.width,
|
||||
hit,
|
||||
);
|
||||
if (closest) zone = closest;
|
||||
else if (x > fractions.start * rect.width && x < fractions.end * rect.width) zone = "move";
|
||||
return { rect, duration, bounds, fraction: rect.width ? x / rect.width : 0, zone };
|
||||
};
|
||||
|
||||
range.addEventListener("pointermove", (event) => {
|
||||
if (state.dragging) return;
|
||||
if (isSingleFrame(state)) {
|
||||
range.style.cursor = "ew-resize";
|
||||
return;
|
||||
}
|
||||
const { zone } = infoAt(event.clientX);
|
||||
range.style.cursor = zone === "start" || zone === "end"
|
||||
? "ew-resize"
|
||||
: zone === "move" ? "grab" : "pointer";
|
||||
});
|
||||
|
||||
range.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0 || state.dragging) return;
|
||||
const initial = infoAt(event.clientX);
|
||||
if (initial.duration <= 0) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (isSingleFrame(state)) {
|
||||
// Frame-picker gesture: the strip is one scrub rail. A click already
|
||||
// sets the frame; a drag keeps refining it until release.
|
||||
state.dragging = true;
|
||||
try { range.setPointerCapture(event.pointerId); } catch (_error) { /* mouse fallback */ }
|
||||
const scrub = (clientX) => {
|
||||
const next = infoAt(clientX);
|
||||
writeFrameTime(state, next.fraction * next.duration);
|
||||
};
|
||||
scrub(event.clientX);
|
||||
const move = (moveEvent) => {
|
||||
if (!(moveEvent.buttons & 1)) { finish(); return; }
|
||||
scrub(moveEvent.clientX);
|
||||
};
|
||||
const finish = () => {
|
||||
if (!state.dragging) return;
|
||||
state.dragging = false;
|
||||
range.removeEventListener("pointermove", move);
|
||||
try { range.releasePointerCapture(event.pointerId); } catch (_error) { /* already released */ }
|
||||
// One notification per gesture: the frame changed on pointerdown.
|
||||
notifyAusbossChange();
|
||||
};
|
||||
range.addEventListener("pointermove", move);
|
||||
range.addEventListener("pointerup", finish, { once: true });
|
||||
range.addEventListener("pointercancel", finish, { once: true });
|
||||
range.addEventListener("lostpointercapture", finish, { once: true });
|
||||
return;
|
||||
}
|
||||
state.dragging = true;
|
||||
try { range.setPointerCapture(event.pointerId); } catch (_error) { /* mouse fallback */ }
|
||||
const downX = event.clientX;
|
||||
const anchorTime = initial.fraction * initial.duration;
|
||||
let moved = false;
|
||||
|
||||
const apply = (clientX) => {
|
||||
const next = infoAt(clientX);
|
||||
if (initial.zone === "start" || initial.zone === "end") {
|
||||
writeTrim(
|
||||
state,
|
||||
dragTrimHandle(next.duration, currentBounds(state), initial.zone, next.fraction),
|
||||
initial.zone,
|
||||
);
|
||||
} else if (initial.zone === "move") {
|
||||
const pointerTime = next.fraction * next.duration;
|
||||
writeTrim(
|
||||
state,
|
||||
slideTrimWindow(next.duration, initial.bounds, pointerTime - anchorTime),
|
||||
"start",
|
||||
);
|
||||
} else {
|
||||
const span = initial.bounds.end - initial.bounds.start;
|
||||
const centeredStart = next.fraction * next.duration - span / 2;
|
||||
writeTrim(
|
||||
state,
|
||||
slideTrimWindow(next.duration, initial.bounds, centeredStart - initial.bounds.start),
|
||||
"start",
|
||||
);
|
||||
// The timing card: the clip node's own, with Start, Duration and Ends at,
|
||||
// or, while FRAME is on, its frame picker. The player above it is the
|
||||
// picture, so the card leaves out its own Play button.
|
||||
function mountCard(state) {
|
||||
const { node } = state;
|
||||
const widgetFor = (name) => node.widgets?.find((widget) => widget.name === name);
|
||||
const fps = () => clipInfo(state.metadata).fps;
|
||||
const single = isSingleFrame(state);
|
||||
const card = mountTransformTrim({
|
||||
get: (name, fallback) => {
|
||||
if (name === "frame_index") return state.head ?? 0;
|
||||
const widget = widgetFor(name);
|
||||
return widget ? widget.value : fallback;
|
||||
},
|
||||
set: (name, value) => {
|
||||
state.writing = true;
|
||||
try { setWidget(widgetFor(name), value); } finally { state.writing = false; }
|
||||
if (state.video.readyState >= 1 && !state.video.paused) return;
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
},
|
||||
has: (name) => Boolean(widgetFor(name)),
|
||||
driven: (name) => widgetLinkDriven(node, name),
|
||||
number: (name, fallback) => inputNumber(node, name, fallback),
|
||||
metadata: () => state.metadata,
|
||||
trim: !single,
|
||||
play: false,
|
||||
isPlaying: () => !state.video.paused,
|
||||
onTogglePlayback: () => {},
|
||||
onSeek: (frame, settled) => {
|
||||
state.head = frame;
|
||||
const rate = fps();
|
||||
if (single && rate > 0) {
|
||||
state.writing = true;
|
||||
try { setWidget(state.startWidget, windowSeconds(clipInfo(state.metadata), frame, frame).start_seconds); } finally { state.writing = false; }
|
||||
}
|
||||
};
|
||||
|
||||
const move = (moveEvent) => {
|
||||
if (!(moveEvent.buttons & 1)) { finish(moveEvent); return; }
|
||||
if (!moved && Math.abs(moveEvent.clientX - downX) < 3) return;
|
||||
moved = true;
|
||||
apply(moveEvent.clientX);
|
||||
};
|
||||
const finish = (finishEvent) => {
|
||||
if (!state.dragging) return;
|
||||
state.dragging = false;
|
||||
range.removeEventListener("pointermove", move);
|
||||
try { range.releasePointerCapture(event.pointerId); } catch (_error) { /* already released */ }
|
||||
if (!moved && initial.zone === "jump") {
|
||||
const next = infoAt(finishEvent?.clientX ?? downX);
|
||||
const span = initial.bounds.end - initial.bounds.start;
|
||||
const centeredStart = next.fraction * next.duration - span / 2;
|
||||
writeTrim(
|
||||
state,
|
||||
slideTrimWindow(next.duration, initial.bounds, centeredStart - initial.bounds.start),
|
||||
"start",
|
||||
);
|
||||
}
|
||||
// One notification per gesture, on release — never per pointermove.
|
||||
if (moved || initial.zone === "jump") notifyAusbossChange();
|
||||
};
|
||||
range.addEventListener("pointermove", move);
|
||||
range.addEventListener("pointerup", finish, { once: true });
|
||||
range.addEventListener("pointercancel", finish, { once: true });
|
||||
range.addEventListener("lostpointercapture", finish, { once: true });
|
||||
if (state.video.readyState >= 1 && rate > 0) state.video.currentTime = Math.min(state.video.duration || Infinity, (frame + 0.5) / rate);
|
||||
if (settled) notifyAusbossChange();
|
||||
},
|
||||
onCommit: notifyAusbossChange,
|
||||
linkInfo: (name) => linkedNodeInfo(node, name),
|
||||
units: () => timingUnits(),
|
||||
setUnits: (next) => timingUnits(next),
|
||||
});
|
||||
state.card?.root.remove();
|
||||
state.card = card;
|
||||
state.cardSlot.append(card.root);
|
||||
return card;
|
||||
}
|
||||
|
||||
function applyMode(state) {
|
||||
const single = isSingleFrame(state);
|
||||
state.root.classList.toggle("is-single-frame", single);
|
||||
state.frameButton?.classList.toggle("active", single);
|
||||
if (state.cardMode !== single) {
|
||||
state.cardMode = single;
|
||||
mountCard(state);
|
||||
}
|
||||
state.card?.sync();
|
||||
}
|
||||
|
||||
// The playhead follows the player, so the card's marker and readout move
|
||||
// with the picture.
|
||||
function followPlayer(state) {
|
||||
const rate = clipInfo(state.metadata).fps;
|
||||
if (!(rate > 0)) return;
|
||||
const frame = Math.max(0, Math.floor(state.video.currentTime * rate + 1e-6));
|
||||
if (frame === state.head) return;
|
||||
state.head = frame;
|
||||
state.card?.sync();
|
||||
}
|
||||
|
||||
function installPlayback(state) {
|
||||
@@ -356,9 +203,9 @@ function installPlayback(state) {
|
||||
state.playRaf = 0;
|
||||
};
|
||||
const tick = () => {
|
||||
if (video.paused || video.ended) { stopTick(); return; }
|
||||
// Frame picking plays the whole source freely — the trim window is not
|
||||
// in force, so there is no boundary to loop or stop at.
|
||||
if (video.paused || video.ended) { stopTick(); followPlayer(state); return; }
|
||||
// Frame picking plays the whole source freely - the clip is not in
|
||||
// force, so there is no boundary to loop or stop at.
|
||||
if (!isSingleFrame(state)) {
|
||||
const bounds = currentBounds(state);
|
||||
const action = playbackBoundaryAction(video.currentTime, bounds, getLoopEnabled(state.node), TRIM_EPSILON);
|
||||
@@ -367,9 +214,11 @@ function installPlayback(state) {
|
||||
} else if (action === "stop") {
|
||||
video.pause();
|
||||
video.currentTime = Math.max(bounds.start, bounds.end - TRIM_EPSILON);
|
||||
followPlayer(state);
|
||||
return;
|
||||
}
|
||||
}
|
||||
followPlayer(state);
|
||||
state.playRaf = requestAnimationFrame(tick);
|
||||
};
|
||||
video.addEventListener("play", () => {
|
||||
@@ -390,7 +239,7 @@ function installPlayback(state) {
|
||||
state.correctingSeek = true;
|
||||
video.currentTime = target;
|
||||
}, { signal: state.abort.signal });
|
||||
video.addEventListener("seeked", () => { state.correctingSeek = false; }, { signal: state.abort.signal });
|
||||
video.addEventListener("seeked", () => { state.correctingSeek = false; followPlayer(state); }, { signal: state.abort.signal });
|
||||
state.stopTick = stopTick;
|
||||
}
|
||||
|
||||
@@ -401,8 +250,8 @@ function watchTrimWidget(state, widget) {
|
||||
widget.callback = function (...args) {
|
||||
const result = prior?.apply(this, args);
|
||||
if (!state.writing) {
|
||||
updateTrimFace(state);
|
||||
if (state.video.readyState >= 1) state.video.currentTime = homeTime(state);
|
||||
state.card?.sync();
|
||||
if (state.video.readyState >= 1 && state.video.paused) state.video.currentTime = homeTime(state);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
@@ -416,7 +265,10 @@ function watchFrameWidget(state, widget) {
|
||||
const result = prior?.apply(this, args);
|
||||
if (!isSingleFrame(state)) {
|
||||
const reopened = trimAfterFramePick(state.startWidget.value, state.endWidget.value);
|
||||
if (reopened) writeTrim(state, reopened);
|
||||
if (reopened) {
|
||||
state.writing = true;
|
||||
try { setWidget(state.endWidget, reopened.end); } finally { state.writing = false; }
|
||||
}
|
||||
}
|
||||
applyMode(state);
|
||||
if (state.video.readyState >= 1) state.video.currentTime = homeTime(state);
|
||||
@@ -424,28 +276,6 @@ function watchFrameWidget(state, widget) {
|
||||
};
|
||||
}
|
||||
|
||||
function commitTimeInput(state, edge, input) {
|
||||
const duration = Number.isFinite(state.video.duration) ? state.video.duration : 0;
|
||||
if (duration <= 0) return;
|
||||
const seconds = parseTimecode(input.value);
|
||||
if (seconds === null) {
|
||||
// Malformed entry: restore the previous value and keep focus for a retry.
|
||||
const bounds = currentBounds(state);
|
||||
input.value = formatTimecode(edge === "start" ? bounds.start : bounds.end);
|
||||
return;
|
||||
}
|
||||
if (isSingleFrame(state)) {
|
||||
writeFrameTime(state, seconds);
|
||||
notifyAusbossChange();
|
||||
input.blur();
|
||||
return;
|
||||
}
|
||||
const fraction = seconds / duration;
|
||||
writeTrim(state, dragTrimHandle(duration, currentBounds(state), edge, fraction), edge);
|
||||
notifyAusbossChange();
|
||||
input.blur();
|
||||
}
|
||||
|
||||
function buildPreview(node) {
|
||||
if (node.__ausbossLoadVideo) return node.__ausbossLoadVideo;
|
||||
const videoWidget = findWidget(node, "video");
|
||||
@@ -461,6 +291,8 @@ function buildPreview(node) {
|
||||
hideCanvasWidget(startWidget);
|
||||
hideCanvasWidget(endWidget);
|
||||
if (frameWidget) hideCanvasWidget(frameWidget);
|
||||
// Every nth and the frame limit (the Duration) live in the timing card;
|
||||
// the widget card hides their widgets (js/widget_cards).
|
||||
|
||||
const root = document.createElement("div");
|
||||
root.className = "ausboss-video-root";
|
||||
@@ -475,7 +307,7 @@ function buildPreview(node) {
|
||||
status.textContent = "Choose or upload a video";
|
||||
const tools = document.createElement("div");
|
||||
tools.className = "ausboss-video-tools";
|
||||
const loopButton = makeToolButton("LOOP", "Loop playback inside the selected trim");
|
||||
const loopButton = makeToolButton("LOOP", "Play the clip again and again");
|
||||
loopButton.classList.add("ausboss-video-loop");
|
||||
const reloadButton = makeToolButton("↻", "Reload the selected source video");
|
||||
const frameButton = frameWidget
|
||||
@@ -485,45 +317,12 @@ function buildPreview(node) {
|
||||
tools.append(loopButton, reloadButton);
|
||||
stage.append(video, status, tools);
|
||||
|
||||
const trim = document.createElement("div");
|
||||
trim.className = "ausboss-video-trim";
|
||||
const range = document.createElement("div");
|
||||
range.className = "ausboss-video-range";
|
||||
range.title = "Drag either handle to set the trim; drag the selected range to move it";
|
||||
const selection = document.createElement("div");
|
||||
selection.className = "ausboss-video-selection";
|
||||
const startHandle = document.createElement("div");
|
||||
startHandle.className = "ausboss-video-handle";
|
||||
const endHandle = document.createElement("div");
|
||||
endHandle.className = "ausboss-video-handle is-end";
|
||||
range.append(selection, startHandle, endHandle);
|
||||
const values = document.createElement("div");
|
||||
values.className = "ausboss-video-values";
|
||||
const makeValue = (labelText) => {
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "ausboss-video-value";
|
||||
const label = document.createElement("label");
|
||||
label.textContent = labelText;
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.inputMode = "decimal";
|
||||
input.placeholder = "m:ss.s";
|
||||
input.title = `${labelText} point - type seconds (95.5) or a timecode (1:35.5, 1:02:03.5)`;
|
||||
input.addEventListener("keydown", (event) => {
|
||||
keepKeyInField(event);
|
||||
if (event.key === "Enter") input.dispatchEvent(new Event("change"));
|
||||
});
|
||||
wrap.append(label, input);
|
||||
return { wrap, input, label };
|
||||
};
|
||||
const startValue = makeValue("IN");
|
||||
const endValue = makeValue("OUT");
|
||||
endValue.wrap.classList.add("is-end");
|
||||
const durationLabel = document.createElement("div");
|
||||
durationLabel.className = "ausboss-video-duration";
|
||||
values.append(startValue.wrap, durationLabel, endValue.wrap);
|
||||
trim.append(range, values);
|
||||
root.append(stage, trim);
|
||||
// The timing card goes here (mountCard): the clip node's Start,
|
||||
// Duration and Ends at, or the frame picker while FRAME is on.
|
||||
const cardSlot = document.createElement("div");
|
||||
cardSlot.className = "ausboss-video-timing";
|
||||
cardSlot.style.flex = "none";
|
||||
root.append(stage, cardSlot);
|
||||
|
||||
const widget = node.addDOMWidget(PREVIEW_WIDGET, "ausboss_video", root, {
|
||||
serialize: false,
|
||||
@@ -544,15 +343,9 @@ function buildPreview(node) {
|
||||
const abort = new AbortController();
|
||||
const state = node.__ausbossLoadVideo = {
|
||||
node, root, stage, video, status, loopButton, reloadButton, frameButton,
|
||||
trim, range, selection, startHandle, endHandle, startInput: startValue.input,
|
||||
endInput: endValue.input, startLabel: startValue.label, durationLabel,
|
||||
cardSlot, card: null, cardMode: null, metadata: null, head: 0,
|
||||
videoWidget, startWidget, endWidget, frameWidget,
|
||||
// Absent on a backend without these widgets; the summary then reads
|
||||
// its defaults (keep every frame, no cap).
|
||||
everyNthWidget: findWidget(node, "every_nth"),
|
||||
maxFramesWidget: findWidget(node, "max_frames"),
|
||||
sourceFps: 0,
|
||||
widget, abort, writing: false, dragging: false, correctingSeek: false, playRaf: 0,
|
||||
widget, abort, writing: false, correctingSeek: false, playRaf: 0,
|
||||
};
|
||||
|
||||
const updateLoopButton = () => loopButton.classList.toggle("active", getLoopEnabled(node));
|
||||
@@ -583,9 +376,9 @@ function buildPreview(node) {
|
||||
if (!name || typeof name !== "string") {
|
||||
video.pause();
|
||||
video.removeAttribute("src");
|
||||
state.sourceFps = 0;
|
||||
state.metadata = null;
|
||||
setEmpty(state, "Choose or upload a video");
|
||||
updateTrimFace(state);
|
||||
state.card?.sync();
|
||||
return;
|
||||
}
|
||||
const parts = splitMediaName(name);
|
||||
@@ -595,7 +388,7 @@ function buildPreview(node) {
|
||||
const type = parseImageReference(name)?.type ?? "input";
|
||||
video.src = api.apiURL(`/view?${mediaViewQuery({ ...parts, type }, "input")}`);
|
||||
video.load();
|
||||
probeSourceFps(state, name);
|
||||
probeMetadata(state, name);
|
||||
};
|
||||
state.refresh = refresh;
|
||||
reloadButton.addEventListener("click", (event) => {
|
||||
@@ -605,31 +398,23 @@ function buildPreview(node) {
|
||||
});
|
||||
|
||||
video.addEventListener("loadedmetadata", () => {
|
||||
const single = isSingleFrame(state);
|
||||
const bounds = currentBounds(state);
|
||||
if (!single && bounds.end - bounds.start < MIN_TRIM_SECONDS && video.duration >= MIN_TRIM_SECONDS) {
|
||||
writeTrim(state, { start: Math.max(0, bounds.end - MIN_TRIM_SECONDS), end: bounds.end });
|
||||
}
|
||||
video.currentTime = homeTime(state);
|
||||
setReady(state, single
|
||||
? `frame at ${formatTimecode(homeTime(state))}`
|
||||
: `${formatTimecode(currentBounds(state).start)} → ${formatTimecode(currentBounds(state).end)}`);
|
||||
// Quiet source hint: resolution and duration from the loaded metadata.
|
||||
// The card says where the clip is; the stage only names the source on hover.
|
||||
setReady(state, "");
|
||||
const sourceInfo = mediaInfo(null, video);
|
||||
durationLabel.title = sourceInfo ? `Source: ${sourceInfo}` : "";
|
||||
updateTrimFace(state);
|
||||
stage.title = sourceInfo ? `Source: ${sourceInfo}` : "";
|
||||
state.card?.sync();
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}, { signal: abort.signal });
|
||||
video.addEventListener("error", () => setEmpty(state, "Preview could not load this video"), { signal: abort.signal });
|
||||
|
||||
installTrimDrag(state);
|
||||
installPlayback(state);
|
||||
watchTrimWidget(state, startWidget);
|
||||
watchTrimWidget(state, endWidget);
|
||||
watchFrameWidget(state, frameWidget);
|
||||
watchTrimWidget(state, findWidget(node, "every_nth"));
|
||||
watchTrimWidget(state, findWidget(node, "max_frames"));
|
||||
applyMode(state);
|
||||
startValue.input.addEventListener("change", () => commitTimeInput(state, "start", startValue.input));
|
||||
endValue.input.addEventListener("change", () => commitTimeInput(state, "end", endValue.input));
|
||||
|
||||
const priorVideoCallback = videoWidget.callback;
|
||||
videoWidget.callback = function (...args) {
|
||||
@@ -664,6 +449,11 @@ app.registerExtension({
|
||||
}
|
||||
});
|
||||
});
|
||||
// A wire into a timing input changes what the card can show.
|
||||
chainCallback(nodeType.prototype, "onConnectionsChange", function () {
|
||||
const state = this.__ausbossLoadVideo;
|
||||
if (state) queueMicrotask(() => state.card?.sync());
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onRemoved", function () {
|
||||
const state = this.__ausbossLoadVideo;
|
||||
state?.stopTick?.();
|
||||
|
||||
+385
-36
@@ -1,7 +1,7 @@
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { BRAND, chainCallback, keepDomWidgetWidthAuto, notifyAusbossChange, showToast } from "../shared/index.mjs";
|
||||
import { WIDGET_FRAME, fillNodeHeight, holdVueNodeMinWidth } from "../shared/panel_layout.mjs";
|
||||
import { WIDGET_FRAME, fillNodeHeight, growToNodeFloor, holdVueNodeMinWidth } from "../shared/panel_layout.mjs";
|
||||
import { hideInputsInDef, hideWidget as collapseWidget } from "../shared/widget_visibility.mjs";
|
||||
import {
|
||||
closeSettingsMenu,
|
||||
@@ -9,10 +9,15 @@ import {
|
||||
loadSettings,
|
||||
openSettingsMenu,
|
||||
} from "../shared/settings_menu.mjs";
|
||||
import { compactAction } from "../shared/panel_controls.mjs";
|
||||
import {
|
||||
STRENGTH_LINK_STYLES, WIRE_LOOKS, installStrengthLinks, sourceTitle, sourceValue, syncStrengthLinks, unlinkRow,
|
||||
} from "./strength_links.mjs";
|
||||
import { makeScrubInput } from "../shared/scrub_input.mjs";
|
||||
import { isAppShortcut, keepKeyInField } from "../shared/canvas_passthrough.mjs";
|
||||
import { resetUnknownValues } from "../shared/widget_card_math.mjs";
|
||||
import { boxRowInputs, boxRowsWidget, boxesOf, hostBox, rowsInputName, workflowNodes } from "../shared/lora_box.mjs";
|
||||
import { coreLoraList, syncFileWidgets } from "../shared/lora_file_widgets.mjs";
|
||||
import {
|
||||
SETTINGS_PROPERTY as SWITCHES_PROPERTY, releaseStackGroup, releaseStackRow, renameStackGroup, stackGroupOwners, stackRowOwners,
|
||||
} from "../shared/workflow_switches.mjs";
|
||||
@@ -25,6 +30,8 @@ import {
|
||||
STRENGTH_MIN,
|
||||
appendFolderRows,
|
||||
clampHighlight,
|
||||
followCurve,
|
||||
rowsForNewCurve,
|
||||
fitLoraLabel,
|
||||
formatFileSize,
|
||||
groupName,
|
||||
@@ -46,6 +53,8 @@ import {
|
||||
collectUpstreamLoaders,
|
||||
collectDownstreamLoaders,
|
||||
absorbChainIssue,
|
||||
anyFolderOpen,
|
||||
parentFolder,
|
||||
mergeImportedRows,
|
||||
moveGroup,
|
||||
moveHighlight,
|
||||
@@ -64,6 +73,7 @@ import {
|
||||
scrubValue,
|
||||
serializeRows,
|
||||
setGroupEnabled,
|
||||
setFolderFolds,
|
||||
setGroupOff,
|
||||
setStrength,
|
||||
shortLoraName,
|
||||
@@ -82,8 +92,9 @@ import {
|
||||
upsertTemplate,
|
||||
} from "../shared/lora_stack.mjs";
|
||||
import {
|
||||
MAX_PICTURE_BYTES, civitaiButtonLabel, civitaiByHashUrl, civitaiFailureText, isCivitaiAddress,
|
||||
parseCivitaiBody, pickCivitaiPicture, smallPictureUrl,
|
||||
MAX_PICTURE_BYTES, civitaiButtonLabel, civitaiByHashUrl, civitaiFailureText, civitaiQueueLabel,
|
||||
civitaiQueueSummary, isCivitaiAddress, parseCivitaiBody, pickCivitaiPicture, runCivitaiQueue,
|
||||
smallPictureUrl,
|
||||
} from "../shared/civitai_lookup.mjs";
|
||||
|
||||
const NODE_CLASS = "AUSBOSS_NODES_LoraLoader";
|
||||
@@ -138,6 +149,14 @@ const SETTINGS_SCHEMA = [
|
||||
hint: "Two strength boxes per row on this node. New nodes always start "
|
||||
+ "unified.",
|
||||
},
|
||||
{
|
||||
key: "strength_wires", label: "Linked strength wires", type: "choice",
|
||||
options: WIRE_LOOKS, default: "shown",
|
||||
hint: "A number wire dropped on a row sets that row's strength. shown: "
|
||||
+ "the wire runs to the row. on hover: it shows while the pointer is on "
|
||||
+ "this node or its source. hidden: never drawn; the row still says "
|
||||
+ "what sets it.",
|
||||
},
|
||||
{
|
||||
key: "strength_bars", label: "Strength bars", type: "toggle",
|
||||
default: true,
|
||||
@@ -208,6 +227,8 @@ const SETTINGS_SCHEMA = [
|
||||
// as much, and the name keeps the same room.
|
||||
const PANEL_MIN_WIDTH = 320;
|
||||
const SEPARATE_EXTRA_WIDTH = 72;
|
||||
// The curve mark and its gap, on every row while a Strength Curve is wired in.
|
||||
const CURVE_MARK_WIDTH = 28;
|
||||
// The popups' font, shared with the picker's width measurement, and the
|
||||
// picker's side paddings, from which an option's text width is worked out.
|
||||
const POP_FONT = "12px system-ui";
|
||||
@@ -218,7 +239,7 @@ function installStyles() {
|
||||
if (document.getElementById("ausboss-lora-styles")) return;
|
||||
const style = document.createElement("style");
|
||||
style.id = "ausboss-lora-styles";
|
||||
style.textContent = `
|
||||
style.textContent = STRENGTH_LINK_STYLES + `
|
||||
.ausboss-lora-panel, .ausboss-lora-panel *,
|
||||
.ausboss-lora-pop, .ausboss-lora-pop *,
|
||||
.ausboss-lora-hoverthumb { box-sizing: border-box; }
|
||||
@@ -243,6 +264,11 @@ function installStyles() {
|
||||
.ausboss-lora-actions { pointer-events: auto; }
|
||||
.ausboss-lora-row { flex: none; display: flex; align-items: center; gap: 6px; height: ${ROW_HEIGHT}px; }
|
||||
.ausboss-lora-row:focus-visible { outline: 2px solid ${BRAND}; outline-offset: 1px; border-radius: 4px; }
|
||||
.ausboss-lora-curve { flex: none; width: 22px; height: 22px; display: grid; place-items: center; padding: 0;
|
||||
border: 0; border-radius: 5px; background: #2d3134; color: #62676d; cursor: pointer; }
|
||||
.ausboss-lora-curve:hover { background: #383c40; color: #b4b9bd; }
|
||||
.ausboss-lora-curve.on { background: rgba(0,180,170,.26); color: #45d6cb; }
|
||||
.ausboss-lora-curve:focus-visible { outline: 2px solid ${BRAND}; outline-offset: 1px; }
|
||||
/* An off row dims its controls, not itself: the row's own opacity would
|
||||
dim the focus outline with them. A dragged row is dimmed as one piece. */
|
||||
.ausboss-lora-row.off > * { opacity: 0.45; }
|
||||
@@ -393,6 +419,10 @@ function installStyles() {
|
||||
.ausboss-lora-pop { position: fixed; z-index: 10000; background: #1c1f23;
|
||||
border: 1px solid #3a4047; border-radius: 7px; box-shadow: 0 8px 28px rgba(0,0,0,.5);
|
||||
font: ${POP_FONT}; color: #d7dde2; display: flex; flex-direction: column; }
|
||||
.ausboss-lora-pickhead { display: flex; align-items: center; gap: 6px; margin: 8px; }
|
||||
.ausboss-lora-pickhead .ausboss-lora-search { flex: 1 1 auto; min-width: 0; margin: 0; }
|
||||
/* Wide enough for either label, so the search box keeps its width. */
|
||||
.ausboss-lora-pickhead .ausboss-compact-action { min-width: 64px; }
|
||||
.ausboss-lora-search { margin: 8px; height: 26px; border: 1px solid #3a4047; border-radius: 5px;
|
||||
background: #23272c; color: inherit; padding: 0 8px; outline: none; }
|
||||
.ausboss-lora-search:focus { border-color: ${BRAND}; }
|
||||
@@ -476,6 +506,10 @@ function installStyles() {
|
||||
color: inherit; cursor: pointer; padding: 2px 8px; font-size: 11px; }
|
||||
.ausboss-lora-chip.active { border-color: ${BRAND}; color: ${BRAND}; }
|
||||
.ausboss-lora-fetch { align-self: flex-start; }
|
||||
.ausboss-lora-fetchrow { display: flex; gap: 6px; align-items: center; }
|
||||
.ausboss-lora-fetchrow .ausboss-lora-fetch { align-self: auto; }
|
||||
.ausboss-lora-fetchrow .ausboss-lora-fetch-all { height: ${ACTIONS_HEIGHT}px; }
|
||||
.ausboss-lora-actions .ausboss-lora-civitai-run { align-self: center; margin-left: 6px; }
|
||||
.ausboss-lora-custom { display: flex; gap: 6px; align-items: center; }
|
||||
.ausboss-lora-custom input { flex: 1 1 auto; min-width: 0; height: ${ACTIONS_HEIGHT}px;
|
||||
border: 1px solid #3a4047; box-sizing: border-box;
|
||||
@@ -724,15 +758,78 @@ function commitRows(state, rows, { structural = false, record = true } = {}) {
|
||||
state.node.graph?.setDirtyCanvas(true, true);
|
||||
if (structural) renderRows(state);
|
||||
else updateRowValues(state);
|
||||
syncLoraFiles(state.node);
|
||||
if (record) notifyAusbossChange();
|
||||
}
|
||||
|
||||
// ComfyUI's missing-models list sees a row's file only through a list
|
||||
// widget, so each row that needs a file gets a hidden one
|
||||
// (js/shared/lora_file_widgets.mjs). Rows that come in over a link (from a
|
||||
// box or another node) are not this node's to list.
|
||||
function syncLoraFiles(node) {
|
||||
if (node?.type !== NODE_CLASS) return;
|
||||
const widget = node.widgets?.find((item) => item.name === "loras");
|
||||
if (!widget) return;
|
||||
const fed = node.inputs?.find((item) => item?.name === "loras")?.link != null;
|
||||
syncFileWidgets(node, fed ? [] : parseRows(widget.value), {
|
||||
installed: () => coreLoraList(globalThis.LiteGraph?.registered_node_types?.LoraLoader?.nodeData)
|
||||
?? node.__ausbossLoraState?.available ?? null,
|
||||
hide: hideWidget,
|
||||
onPick: (rowId, name) => pickRowFile(node, rowId, name),
|
||||
});
|
||||
}
|
||||
|
||||
// ComfyUI put another file in a row's hidden list (a replacement picked in
|
||||
// its Issues panel): the row takes that file.
|
||||
function pickRowFile(node, rowId, name) {
|
||||
const widget = node.widgets?.find((item) => item.name === "loras");
|
||||
if (!widget) return;
|
||||
const rows = parseRows(widget.value);
|
||||
const row = rows.find((item) => item.id === rowId);
|
||||
if (!row || row.name === name) return;
|
||||
row.name = name;
|
||||
const state = node.__ausbossLoraState;
|
||||
if (state && !state.disposed && !state.readOnly && state.widget === widget) {
|
||||
commitRows(state, rows, { structural: true });
|
||||
return;
|
||||
}
|
||||
widget.value = serializeRows(rows);
|
||||
node.graph?.setDirtyCanvas(true, true);
|
||||
syncLoraFiles(node);
|
||||
notifyAusbossChange();
|
||||
}
|
||||
|
||||
// A box shows its loader's rows the way the loader does: one strength per
|
||||
// row, or model and CLIP apart.
|
||||
function linked(state) {
|
||||
return (state.box?.loader ?? state.node).properties?.ausbossLoraLinked !== false;
|
||||
}
|
||||
|
||||
// A Strength Curve is wired into this loader's `curve` input. Only then do
|
||||
// the rows show the mark that makes one follow it.
|
||||
function curveWired(state) {
|
||||
if (state.box || state.readOnly) return false;
|
||||
return Boolean(state.node.inputs?.some((input) => input?.name === "curve" && input.link != null));
|
||||
}
|
||||
|
||||
function setFollowsCurve(state, ids, on) {
|
||||
commitRows(state, followCurve(state.rows, ids, on), { structural: true });
|
||||
}
|
||||
|
||||
// The curve wire came or went: the marks show or hide, and a first curve
|
||||
// marks every row. A workflow being opened keeps the marks it was saved with.
|
||||
function curveLinksChanged(state, { opening = false } = {}) {
|
||||
const wired = curveWired(state);
|
||||
if (wired === state.curveWired) return;
|
||||
state.curveWired = wired;
|
||||
if (wired && !opening && !app.configuringGraph && state.rows.length && !state.rows.some((row) => row.curve)) {
|
||||
commitRows(state, rowsForNewCurve(state.rows), { structural: true });
|
||||
} else {
|
||||
renderRows(state);
|
||||
}
|
||||
growToNodeFloor(state.domWidget);
|
||||
}
|
||||
|
||||
// Picker options honor only hide-extension: their folder context is the
|
||||
// disambiguator (group headers, search prefixes), so it stays.
|
||||
function displayName(state, name) {
|
||||
@@ -813,7 +910,7 @@ function panelHeight(state) {
|
||||
}
|
||||
|
||||
function panelMinWidth(state) {
|
||||
return PANEL_MIN_WIDTH + (linked(state) ? 0 : SEPARATE_EXTRA_WIDTH);
|
||||
return PANEL_MIN_WIDTH + (linked(state) ? 0 : SEPARATE_EXTRA_WIDTH) + (curveWired(state) ? CURVE_MARK_WIDTH : 0);
|
||||
}
|
||||
|
||||
function fitNode(state) {
|
||||
@@ -870,7 +967,11 @@ function strengthBox(state, index, key) {
|
||||
input.dataset.ausbossStrength = key;
|
||||
// A short name; the tooltip above stays as the longer description.
|
||||
input.setAttribute("aria-label", key === "strength" ? "Model strength" : "CLIP strength");
|
||||
input.__ausbossRead = () => state.rows[index]?.[key].toFixed(2) ?? "1.00";
|
||||
input.__ausbossRead = () => {
|
||||
const entry = linkedEntry(state, index);
|
||||
if (entry) return sourceValue(entry)?.toFixed(2) ?? "link";
|
||||
return state.rows[index]?.[key].toFixed(2) ?? "1.00";
|
||||
};
|
||||
input.__ausbossTint = () => state.rows[index] && applyRangeTint(input, state.rows[index], key);
|
||||
ensureRange(state, state.rows[index].name);
|
||||
|
||||
@@ -884,6 +985,16 @@ function strengthBox(state, index, key) {
|
||||
let drag = null;
|
||||
input.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0 || !input.readOnly) return;
|
||||
// A linked strength is set by its wire: a click shows where it comes from.
|
||||
const entry = linkedEntry(state, index);
|
||||
if (entry) {
|
||||
event.preventDefault();
|
||||
if (entry.source) {
|
||||
app.canvas?.selectNode?.(entry.source);
|
||||
app.canvas?.centerOnNode?.(entry.source);
|
||||
}
|
||||
return;
|
||||
}
|
||||
drag = { x: event.clientX, y: event.clientY, start: state.rows[index][key], scrubbed: false };
|
||||
input.setPointerCapture(event.pointerId);
|
||||
event.preventDefault();
|
||||
@@ -955,6 +1066,34 @@ function strengthBox(state, index, key) {
|
||||
return box;
|
||||
}
|
||||
|
||||
function linkedEntry(state, index) {
|
||||
const row = state.rows[index];
|
||||
return row ? state.linkedStrengths?.get(row.id) ?? null : null;
|
||||
}
|
||||
|
||||
// Mark the rows a wire sets: the strength box shows the incoming number,
|
||||
// and its tooltip names where it comes from.
|
||||
function decorateStrengthLinks(state) {
|
||||
if (state.disposed || state.box) return;
|
||||
state.linkedStrengths = syncStrengthLinks(state);
|
||||
for (const box of state.panel.querySelectorAll(".ausboss-lora-strengthbox")) {
|
||||
const rowId = box.closest(".ausboss-lora-row")?.dataset.rowId;
|
||||
const entry = rowId ? state.linkedStrengths.get(rowId) : null;
|
||||
box.classList.toggle("linked", Boolean(entry));
|
||||
const input = box.querySelector(".ausboss-lora-strength");
|
||||
if (!input) continue;
|
||||
input.title = entry
|
||||
? `Set by "${sourceTitle(entry)}". Click to show it. Right-click the row to unlink.`
|
||||
: input.dataset.baseTitle ?? "";
|
||||
if (input.readOnly && input.__ausbossRead) input.value = input.__ausbossRead();
|
||||
}
|
||||
const signature = [...state.linkedStrengths].map(([id, entry]) => `${id}:${sourceValue(entry)}`).join("|");
|
||||
if (signature !== state.linkSignature) {
|
||||
state.linkSignature = signature;
|
||||
decorateRows(state);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- picker ----------
|
||||
|
||||
// Width of the longest label in the picker's font. Remembered across opens,
|
||||
@@ -967,6 +1106,14 @@ let widestPickerLabel = 0;
|
||||
const COLLAPSED_FOLDERS_KEY = "AusBoss.lora_loader.collapsedFolders";
|
||||
let rememberedCollapsedFolders = new Set();
|
||||
|
||||
// "Start folded" (the default) opens the picker with every folder folded
|
||||
// and forgets folds when it closes. "Remember my folds" keeps them.
|
||||
const PICKER_FOLDERS_SETTING = "AusBoss.LoraLoader.PickerFolders";
|
||||
const START_FOLDED = "Start folded";
|
||||
const REMEMBER_FOLDS = "Remember my folds";
|
||||
const pickerStartsFolded = () =>
|
||||
(app.ui?.settings?.getSettingValue?.(PICKER_FOLDERS_SETTING) ?? START_FOLDED) !== REMEMBER_FOLDS;
|
||||
|
||||
function loadCollapsedFolders() {
|
||||
try {
|
||||
const raw = window.localStorage?.getItem(COLLAPSED_FOLDERS_KEY);
|
||||
@@ -1001,9 +1148,15 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
const search = el("input", "ausboss-lora-search");
|
||||
search.placeholder = "Search LoRAs...";
|
||||
search.setAttribute("aria-label", "Search LoRAs");
|
||||
// Folds or opens every folder at once. Hidden until the list has folders.
|
||||
const foldAll = compactAction("Fold all");
|
||||
foldAll.hidden = true;
|
||||
foldAll.addEventListener("keydown", keepKeyInField);
|
||||
const head = el("div", "ausboss-lora-pickhead");
|
||||
head.append(search, foldAll);
|
||||
const list = el("div", "ausboss-lora-list");
|
||||
list.append(el("div", "ausboss-lora-empty", "Loading..."));
|
||||
pop.append(search, list);
|
||||
pop.append(head, list);
|
||||
if (adding) pop.append(el("div", "ausboss-lora-picker-note",
|
||||
"Click a file to add it. Tick boxes (or Ctrl-click) to add several at once. Click a folder name to add all of it. Skips files already in this stack."));
|
||||
const anchorRect = anchor.getBoundingClientRect();
|
||||
@@ -1026,7 +1179,8 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
const inStack = () => new Set(state.rows.map((row) => pathKey(row.name)));
|
||||
let loadError = false;
|
||||
let highlight = -1;
|
||||
const collapsedFolders = loadCollapsedFolders();
|
||||
const startFolded = pickerStartsFolded();
|
||||
const collapsedFolders = startFolded ? new Set() : loadCollapsedFolders();
|
||||
// Search reveals matches without losing the user's usual folded view.
|
||||
let searchCollapsed = new Set();
|
||||
const currentFolds = () => search.value.trim() ? searchCollapsed : collapsedFolders;
|
||||
@@ -1034,15 +1188,21 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
// after: "highlight" keeps the folder highlighted for the search box's
|
||||
// arrow keys, "arrow" keeps focus on the fold arrow that was pressed with
|
||||
// the keyboard, "search" hands the keys back to the search box.
|
||||
const toggleFolder = (name, collapsed = !currentFolds().has(name), after = "highlight") => {
|
||||
// subtree: the folder's own folders fold or open with it (Alt- or
|
||||
// Shift-click on its arrow). A null name means every folder (Fold all).
|
||||
const toggleFolder = (name, collapsed = !currentFolds().has(name), after = "highlight", { subtree = false } = {}) => {
|
||||
const folds = currentFolds();
|
||||
if (collapsed) folds.add(name);
|
||||
if (subtree || name == null) {
|
||||
const next = setFolderFolds(folds, folders.keys(), collapsed, name);
|
||||
folds.clear();
|
||||
for (const folder of next) folds.add(folder);
|
||||
} else if (collapsed) folds.add(name);
|
||||
else folds.delete(name);
|
||||
if (folds === collapsedFolders) saveCollapsedFolders(folds);
|
||||
if (folds === collapsedFolders && !startFolded) saveCollapsedFolders(folds);
|
||||
const scrollTop = list.scrollTop;
|
||||
highlight = -1;
|
||||
renderList();
|
||||
if (after === "highlight" && adding) {
|
||||
if (after === "highlight" && adding && name != null) {
|
||||
highlight = options.findIndex((entry) => entry.kind === "folder" && entry.name === name);
|
||||
list.querySelector(`[data-ausboss-flat="${highlight}"]`)?.classList.add("highlight");
|
||||
}
|
||||
@@ -1059,15 +1219,16 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
button.dataset.folder = name;
|
||||
button.innerHTML = chevronIconSvg(false);
|
||||
button.setAttribute("aria-expanded", String(expanded));
|
||||
button.title = `${expanded ? "Collapse" : "Expand"} ${name}`;
|
||||
button.setAttribute("aria-label", button.title);
|
||||
button.setAttribute("aria-label", `${expanded ? "Collapse" : "Expand"} ${name}`);
|
||||
button.title = `${button.getAttribute("aria-label")} (Alt-click: and every folder inside it)`;
|
||||
button.addEventListener("keydown", keepKeyInField);
|
||||
button.addEventListener("click", (event) => {
|
||||
// Only the folder name adds files; its arrow is browse-only.
|
||||
event.stopPropagation();
|
||||
// A click made with a key (detail 0) stays on the arrow. A mouse click
|
||||
// goes back to the search box, so typing keeps searching.
|
||||
toggleFolder(name, !currentFolds().has(name), event.detail === 0 ? "arrow" : "search");
|
||||
toggleFolder(name, !currentFolds().has(name), event.detail === 0 ? "arrow" : "search",
|
||||
{ subtree: event.altKey || event.shiftKey });
|
||||
});
|
||||
row.append(button);
|
||||
};
|
||||
@@ -1290,6 +1451,11 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
for (const entry of entries) if (entry.kind === "file") entry.inStack = have.has(pathKey(entry.name));
|
||||
}
|
||||
options = entries.filter((entry) => adding || entry.kind === "file");
|
||||
const open = anyFolderOpen(entries, currentFolds());
|
||||
foldAll.hidden = !entries.some((entry) => entry.kind === "folder");
|
||||
foldAll.textContent = open ? "Fold all" : "Open all";
|
||||
foldAll.dataset.folds = open ? "1" : "";
|
||||
foldAll.title = open ? "Fold every folder in this list" : "Open every folder in this list";
|
||||
if (highlight >= 0) highlight = clampHighlight(highlight, options.length);
|
||||
list.textContent = "";
|
||||
hideHoverThumb();
|
||||
@@ -1317,6 +1483,9 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
place();
|
||||
};
|
||||
|
||||
foldAll.addEventListener("click", () => {
|
||||
toggleFolder(null, foldAll.dataset.folds === "1", "search");
|
||||
});
|
||||
search.addEventListener("input", () => { highlight = -1; searchCollapsed = new Set(); renderList(); });
|
||||
search.addEventListener("keydown", (event) => {
|
||||
keepKeyInField(event);
|
||||
@@ -1326,9 +1495,18 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
highlight = moveHighlight(highlight, event.key === "ArrowDown" ? 1 : -1, options.length);
|
||||
renderList();
|
||||
} else if ((event.key === "ArrowLeft" || event.key === "ArrowRight")
|
||||
&& options[highlight]?.kind === "folder") {
|
||||
&& options[highlight]?.kind === "folder"
|
||||
&& !(event.key === "ArrowLeft" && currentFolds().has(options[highlight].name)
|
||||
&& parentFolder(options[highlight].name) && !event.altKey && !event.shiftKey)) {
|
||||
event.preventDefault();
|
||||
toggleFolder(options[highlight].name, event.key === "ArrowLeft");
|
||||
toggleFolder(options[highlight].name, event.key === "ArrowLeft", "highlight",
|
||||
{ subtree: event.altKey || event.shiftKey });
|
||||
} else if (event.key === "ArrowLeft" && adding && highlight >= 0
|
||||
&& parentFolder(options[highlight]?.name)) {
|
||||
// On a file, or on a folder that is already folded, Left folds the
|
||||
// folder it sits in and moves up to it, as in a file tree.
|
||||
event.preventDefault();
|
||||
toggleFolder(parentFolder(options[highlight].name), true);
|
||||
} else if (event.key === "Home" || event.key === "End") {
|
||||
event.preventDefault();
|
||||
highlight = event.key === "Home" ? 0 : options.length - 1;
|
||||
@@ -1357,6 +1535,13 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
if (!pop.isConnected) return;
|
||||
names = fetched;
|
||||
folders = new Map(loraFolders(fetched).map(({ folder, names }) => [folder, names]));
|
||||
if (startFolded) {
|
||||
for (const folder of folders.keys()) collapsedFolders.add(folder);
|
||||
// A row's own picker opens the way to that row's file.
|
||||
for (let folder = parentFolder(state.rows[index]?.name); folder; folder = parentFolder(folder)) {
|
||||
collapsedFolders.delete(folder);
|
||||
}
|
||||
}
|
||||
state.available = fetched;
|
||||
state.nameStatus = new Map();
|
||||
widestPickerLabel = widestLabel(names.map((name) => displayName(state, name))) + (adding ? 110 : 30);
|
||||
@@ -1378,8 +1563,10 @@ function openPicker(state, index, anchor, { keyboard = false } = {}) {
|
||||
// about that hash, and the server saves the answer beside the LoRA after
|
||||
// checking it describes the same file. Returns false when Civitai does not
|
||||
// know the file (unpublished or hidden models answer 404). `picture` is the
|
||||
// Civitai picture gear option ("off", "PG-13" or "any").
|
||||
async function lookUpOnCivitai(serverName, picture = "PG-13") {
|
||||
// Civitai picture gear option ("off", "PG-13" or "any"). Otherwise it returns
|
||||
// `{ picture }`: "saved", "none" (Civitai has none to save), "failed" or
|
||||
// "off". `quiet` keeps the picture's own messages back for Fetch all.
|
||||
async function lookUpOnCivitai(serverName, picture = "PG-13", { quiet = false } = {}) {
|
||||
const hashed = await (await api.fetchApi(
|
||||
`/ausboss/lora/hash?name=${encodeURIComponent(serverName)}`
|
||||
)).json();
|
||||
@@ -1388,7 +1575,9 @@ async function lookUpOnCivitai(serverName, picture = "PG-13") {
|
||||
credentials: "omit", redirect: "error", referrerPolicy: "no-referrer", cache: "no-store",
|
||||
});
|
||||
if (response.status === 404) return false;
|
||||
if (!response.ok) throw new Error(`Civitai answered ${response.status}.`);
|
||||
if (!response.ok) {
|
||||
throw Object.assign(new Error(`Civitai answered ${response.status}.`), { status: response.status });
|
||||
}
|
||||
const info = parseCivitaiBody(await response.text());
|
||||
const saved = await (await api.fetchApi("/ausboss/lora/civitai", {
|
||||
method: "POST",
|
||||
@@ -1396,24 +1585,28 @@ async function lookUpOnCivitai(serverName, picture = "PG-13") {
|
||||
body: JSON.stringify({ name: serverName, info }),
|
||||
})).json();
|
||||
if (!saved.ok) throw new Error(saved.error || "Could not save the Civitai info.");
|
||||
if (picture !== "off") {
|
||||
await saveCivitaiPicture(serverName, info, picture === "any").catch((error) =>
|
||||
loraToast(`Saved the Civitai info, but not its picture: ${civitaiFailureText(error)}`));
|
||||
if (picture === "off") return { picture: "off" };
|
||||
try {
|
||||
if (await saveCivitaiPicture(serverName, info, picture === "any")) return { picture: "saved" };
|
||||
if (!quiet) {
|
||||
loraToast(picture === "any"
|
||||
? "Civitai has no picture of this LoRA to save."
|
||||
: "Civitai has no picture of this LoRA rated PG-13 or milder.");
|
||||
}
|
||||
return { picture: "none" };
|
||||
} catch (error) {
|
||||
if (!quiet) loraToast(`Saved the Civitai info, but not its picture: ${civitaiFailureText(error)}`);
|
||||
return { picture: "failed" };
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// The LoRA's first picture on Civitai, saved beside it as its preview. The
|
||||
// browser downloads a 450-pixel copy from Civitai's picture server without
|
||||
// cookies; the server checks it is a picture and never replaces one.
|
||||
// Returns false when Civitai has no picture the setting allows.
|
||||
async function saveCivitaiPicture(serverName, info, anyRating) {
|
||||
const picture = pickCivitaiPicture(info, anyRating);
|
||||
if (!picture) {
|
||||
loraToast(anyRating
|
||||
? "Civitai has no picture of this LoRA to save."
|
||||
: "Civitai has no picture of this LoRA rated PG-13 or milder.");
|
||||
return;
|
||||
}
|
||||
if (!picture) return false;
|
||||
const response = await fetch(smallPictureUrl(picture.url), {
|
||||
credentials: "omit", referrerPolicy: "no-referrer", cache: "no-store",
|
||||
});
|
||||
@@ -1431,6 +1624,76 @@ async function saveCivitaiPicture(serverName, info, anyRating) {
|
||||
})).json();
|
||||
if (!saved.ok) throw new Error(saved.error || "Could not save the picture.");
|
||||
pictureSaved();
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------- Fetch all ----------
|
||||
|
||||
// The same one-file lookup for every LoRA in the stack that has no Civitai
|
||||
// info yet, one file at a time (runCivitaiQueue). One run for the whole
|
||||
// page: Civitai counts requests per browser, not per node.
|
||||
let civitaiRun = null;
|
||||
|
||||
function fetchAllFromCivitai(state) {
|
||||
if (state.settings?.civitai_lookup === false) return;
|
||||
if (civitaiRun) {
|
||||
if (civitaiRun.state !== state) loraToast("Another LoRA Loader is fetching Civitai info. Wait for it, or stop it there.");
|
||||
return;
|
||||
}
|
||||
const names = state.rows.map((row) => row.name).filter(Boolean)
|
||||
.map((name) => effectiveLoraName(state, name));
|
||||
const hasPicture = new Map();
|
||||
const run = { state, done: 0, total: null, stopping: false, wake: null, button: null };
|
||||
civitaiRun = run;
|
||||
renderRows(state);
|
||||
runCivitaiQueue(names, {
|
||||
needsLookup: async (name) => {
|
||||
const data = await (await api.fetchApi(`/ausboss/lora/info?name=${encodeURIComponent(name)}`)).json();
|
||||
if (!data.ok) throw new Error(data.error || "No such LoRA.");
|
||||
hasPicture.set(name, Boolean(data.info.has_preview));
|
||||
return !data.info.has_civitai;
|
||||
},
|
||||
// The picture setting is read per file, so a change mid-run counts.
|
||||
lookUp: (name) => lookUpOnCivitai(name,
|
||||
hasPicture.get(name) ? "off" : (state.settings?.civitai_picture ?? "PG-13"), { quiet: true }),
|
||||
wait: (ms) => new Promise((resolve) => {
|
||||
const timer = setTimeout(resolve, ms);
|
||||
run.wake = () => { clearTimeout(timer); resolve(); };
|
||||
}),
|
||||
shouldStop: () => run.stopping,
|
||||
onProgress: ({ done, total }) => {
|
||||
run.done = done;
|
||||
run.total = total;
|
||||
showCivitaiRun(run);
|
||||
},
|
||||
}).then((result) => loraToast(civitaiQueueSummary(result)))
|
||||
.catch((error) => loraToast(civitaiFailureText(error)))
|
||||
.finally(() => {
|
||||
civitaiRun = null;
|
||||
if (state.panel?.isConnected) renderRows(state);
|
||||
});
|
||||
}
|
||||
|
||||
// While a run works, its node's footer holds one button: how far it is, and
|
||||
// a click stops it after the file being fetched.
|
||||
function civitaiRunButton(run) {
|
||||
const button = compactAction("", "Fetching Civitai info for every LoRA in this stack "
|
||||
+ "that has none yet, one at a time. Click to stop after the current one.");
|
||||
button.classList.add("ausboss-lora-civitai-run");
|
||||
button.addEventListener("click", () => {
|
||||
run.stopping = true;
|
||||
run.wake?.();
|
||||
showCivitaiRun(run);
|
||||
});
|
||||
run.button = button;
|
||||
showCivitaiRun(run);
|
||||
return button;
|
||||
}
|
||||
|
||||
function showCivitaiRun(run) {
|
||||
if (!run.button) return;
|
||||
run.button.disabled = run.stopping;
|
||||
run.button.textContent = run.stopping ? "Stopping..." : civitaiQueueLabel(run.done, run.total);
|
||||
}
|
||||
|
||||
// ---------- info card ----------
|
||||
@@ -1529,7 +1792,17 @@ function openInfo(state, index, anchor) {
|
||||
loraToast(fetchButton.title);
|
||||
}
|
||||
});
|
||||
card.append(fetchButton);
|
||||
const fetchAll = compactAction("Fetch all LoRAs",
|
||||
"Fetch Civitai info for every LoRA in this stack that has none yet, one at a time.");
|
||||
fetchAll.classList.add("ausboss-lora-fetch-all");
|
||||
fetchAll.disabled = Boolean(civitaiRun);
|
||||
fetchAll.addEventListener("click", () => {
|
||||
closePopup();
|
||||
fetchAllFromCivitai(state);
|
||||
});
|
||||
const fetchRow = el("div", "ausboss-lora-fetchrow");
|
||||
fetchRow.append(fetchButton, fetchAll);
|
||||
card.append(fetchRow);
|
||||
}
|
||||
|
||||
const range = el("div", "ausboss-lora-range");
|
||||
@@ -1765,6 +2038,18 @@ function openRowMenu(state, index, event) {
|
||||
commitRows(state, rows, { structural: true });
|
||||
fitNode(state);
|
||||
};
|
||||
if (state.linkedStrengths?.has(row.id)) {
|
||||
item("Unlink strength", () => {
|
||||
unlinkRow(state, row.id);
|
||||
decorateStrengthLinks(state);
|
||||
});
|
||||
menu.append(el("div", "ausboss-lora-menu-rule"));
|
||||
}
|
||||
if (curveWired(state)) {
|
||||
const follow = !chosen.every((entry) => entry.curve);
|
||||
item(follow ? "Follow the strength curve" : "Keep a steady strength", () => setFollowsCurve(state, ids, follow));
|
||||
menu.append(el("div", "ausboss-lora-menu-rule"));
|
||||
}
|
||||
item("Insert empty LoRA above", () => insertEmpty(index));
|
||||
item("Insert empty LoRA below", () => insertEmpty(index + 1));
|
||||
item("Move up", () => commitGroups(state, moveRowInStack(state.rows, index, -1)),
|
||||
@@ -2291,7 +2576,12 @@ function renameOwnedGroup(state, from, to) {
|
||||
// value update - the bar scale can change whenever any row's strength does.
|
||||
function decorateRows(state) {
|
||||
const showBars = state.settings?.strength_bars !== false;
|
||||
const scale = strengthBarScale(state.rows);
|
||||
// A linked row's bar shows the number coming in on its wire.
|
||||
const shown = state.rows.map((row, index) => {
|
||||
const value = sourceValue(linkedEntry(state, index));
|
||||
return value === null ? row : { ...row, strength: value };
|
||||
});
|
||||
const scale = strengthBarScale(shown);
|
||||
const dups = duplicateLoraKeys(state.rows);
|
||||
state.panel.querySelectorAll(".ausboss-lora-name").forEach((button, index) => {
|
||||
const row = state.rows[index];
|
||||
@@ -2302,8 +2592,8 @@ function decorateRows(state) {
|
||||
}
|
||||
const notes = [row.name];
|
||||
if (showBars) {
|
||||
button.style.background = strengthBarBackground(row.strength, scale);
|
||||
notes.push(`Model strength ${row.strength.toFixed(2)}; `
|
||||
button.style.background = strengthBarBackground(shown[index].strength, scale);
|
||||
notes.push(`Model strength ${shown[index].strength.toFixed(2)}; `
|
||||
+ `bar edges are ±${scale.toFixed(2)}`);
|
||||
} else {
|
||||
button.style.background = "";
|
||||
@@ -2348,6 +2638,7 @@ function updateRowValues(state) {
|
||||
master.classList.toggle("mixed", overall === "mixed");
|
||||
}
|
||||
decorateRows(state);
|
||||
decorateStrengthLinks(state);
|
||||
}
|
||||
|
||||
// ---------- absorb the loader chain ----------
|
||||
@@ -2521,6 +2812,19 @@ function openSettings(state, anchor) {
|
||||
runImportChain(state);
|
||||
},
|
||||
},
|
||||
...(state.settings?.civitai_lookup === false ? [] : [{
|
||||
key: "_civitai_all",
|
||||
label: "Civitai info for every LoRA",
|
||||
type: "action",
|
||||
button: "Fetch all LoRAs",
|
||||
hint: "Look up every LoRA in this stack that has no Civitai info yet, "
|
||||
+ "one at a time, the same way the info card's button does. The "
|
||||
+ "bottom of the node shows how far it is; click there to stop.",
|
||||
onAction: () => {
|
||||
closeSettingsMenu();
|
||||
fetchAllFromCivitai(state);
|
||||
},
|
||||
}]),
|
||||
];
|
||||
// Inside a subgraph the rows can show on the box's face instead; first in
|
||||
// the menu there, since it is what a loader in a box is usually set up for.
|
||||
@@ -2829,7 +3133,7 @@ function renderRows(state) {
|
||||
let nameDrag = null;
|
||||
name.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0 || !row.name
|
||||
|| state.settings?.name_scrub === false) return;
|
||||
|| state.settings?.name_scrub === false || linkedEntry(state, index)) return;
|
||||
nameDrag = { x: event.clientX, y: event.clientY,
|
||||
start: state.rows[index].strength, scrubbed: false };
|
||||
name.setPointerCapture(event.pointerId);
|
||||
@@ -2876,7 +3180,20 @@ function renderRows(state) {
|
||||
showHoverThumb(state, row.name, event.clientX, event.clientY));
|
||||
name.addEventListener("pointerleave", hideHoverThumb);
|
||||
|
||||
rowElement.append(grip, toggle, name, strengthBox(state, index, "strength"));
|
||||
rowElement.append(grip, toggle, name);
|
||||
if (curveWired(state)) {
|
||||
const mark = el("button", `ausboss-lora-curve${row.curve ? " on" : ""}`);
|
||||
mark.type = "button";
|
||||
mark.title = row.curve
|
||||
? "This LoRA follows the strength curve. Click to keep it steady."
|
||||
: "This LoRA keeps one strength. Click to make it follow the strength curve.";
|
||||
mark.setAttribute("role", "switch");
|
||||
mark.setAttribute("aria-checked", String(Boolean(row.curve)));
|
||||
mark.innerHTML = '<svg width="14" height="10" viewBox="0 0 14 10" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M1 2 C5 2 6 8 13 8"/></svg>';
|
||||
mark.addEventListener("click", () => setFollowsCurve(state, [row.id], !row.curve));
|
||||
rowElement.append(mark);
|
||||
}
|
||||
rowElement.append(strengthBox(state, index, "strength"));
|
||||
if (!linked(state)) rowElement.append(strengthBox(state, index, "strength_clip"));
|
||||
|
||||
const info = el("button", "ausboss-lora-info", "i");
|
||||
@@ -2918,9 +3235,11 @@ function renderRows(state) {
|
||||
add.addEventListener("click", addRowAndPick);
|
||||
add.title = "Pick one LoRA, or click a folder name to add all its LoRAs.";
|
||||
actions.append(add);
|
||||
if (civitaiRun?.state === state) actions.append(civitaiRunButton(civitaiRun));
|
||||
stack.append(actions);
|
||||
body.append(stack);
|
||||
decorateRows(state);
|
||||
decorateStrengthLinks(state);
|
||||
state.lockSignature = null;
|
||||
refreshLocks(state);
|
||||
// Names refit whenever the stack's box changes - the node was resized,
|
||||
@@ -3027,6 +3346,7 @@ function syncRows(state) {
|
||||
state.toggleSnapshot = snapshotEnabled(state.rows);
|
||||
renderRows(state);
|
||||
fitNode(state);
|
||||
syncLoraFiles(state.node);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3051,6 +3371,7 @@ function ensureRedrawHook() {
|
||||
if (state.node.graph !== shown) continue;
|
||||
syncRows(state);
|
||||
refreshLocks(state);
|
||||
decorateStrengthLinks(state);
|
||||
}
|
||||
}, 250);
|
||||
});
|
||||
@@ -3156,6 +3477,7 @@ function watchBox(box) {
|
||||
function unmountCard(state, { resize = true } = {}) {
|
||||
liveCards.delete(state);
|
||||
state.disposed = true;
|
||||
state.unlinkStrengthWatch?.();
|
||||
state.nameObserver?.disconnect();
|
||||
closePopup();
|
||||
try {
|
||||
@@ -3191,6 +3513,7 @@ function mountCard(node, { box = null, separatorWidget = null, onMissingWidget =
|
||||
state.owner = source.owner;
|
||||
state.note = source.note;
|
||||
state.readOnly = Boolean(source.readOnly);
|
||||
state.curveWired = curveWired(state);
|
||||
if (box) hideWidget(source.widget);
|
||||
state.rows = parseRows(state.widget.value);
|
||||
state.renderedValue = state.widget.value;
|
||||
@@ -3249,6 +3572,10 @@ function mountCard(node, { box = null, separatorWidget = null, onMissingWidget =
|
||||
panel.style.height = `calc(100% + ${reclaim}px)`;
|
||||
}
|
||||
|
||||
if (!box) {
|
||||
state.unlinkStrengthWatch = installStrengthLinks(state, app);
|
||||
state.onStrengthLinks = () => decorateStrengthLinks(state);
|
||||
}
|
||||
renderRows(state);
|
||||
refreshAvailable(state);
|
||||
node.setSize?.([Math.max(336, node.size?.[0] || 336), node.computeSize?.()[1] || 220]);
|
||||
@@ -3311,6 +3638,18 @@ function installLoraNode(node) {
|
||||
|
||||
app.registerExtension({
|
||||
name: "AusBoss.LoraLoader",
|
||||
settings: [
|
||||
{
|
||||
id: PICKER_FOLDERS_SETTING,
|
||||
name: "+ LoRA list folders",
|
||||
type: "combo",
|
||||
options: [START_FOLDED, REMEMBER_FOLDS],
|
||||
defaultValue: START_FOLDED,
|
||||
category: ["🆎 AusBoss", "LoRA Loader", "Picker folders"],
|
||||
tooltip: "Start folded opens the + LoRA list with every folder folded. "
|
||||
+ "Remember my folds opens it the way you left it in this browser.",
|
||||
},
|
||||
],
|
||||
setup() {
|
||||
watchEnteredBoxes();
|
||||
ensureRedrawHook();
|
||||
@@ -3324,6 +3663,16 @@ app.registerExtension({
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onConfigure", function () {
|
||||
resetUnknownValues(this.widgets, RESET_UNKNOWN);
|
||||
// Now, not later: ComfyUI reads its missing-models list right after
|
||||
// the workflow is restored.
|
||||
syncLoraFiles(this);
|
||||
queueMicrotask(() => {
|
||||
if (this.__ausbossLoraState) curveLinksChanged(this.__ausbossLoraState, { opening: true });
|
||||
});
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onConnectionsChange", function () {
|
||||
syncLoraFiles(this);
|
||||
if (this.__ausbossLoraState) curveLinksChanged(this.__ausbossLoraState);
|
||||
});
|
||||
},
|
||||
// A box (subgraph node) shows the rows of a loader inside once they come
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
// A row's strength can come in on a link: drag a number wire onto a row and
|
||||
// let go. The link lands on a hidden input named strength_<row id> that sits
|
||||
// on the node's left edge at that row's height. Nothing marks the spot until
|
||||
// a number wire is dragged over the node: then the row under the pointer
|
||||
// lights up. Once linked, the row's strength box shows the incoming value,
|
||||
// and the wire is shown, shown on hover, or hidden (gear menu).
|
||||
//
|
||||
// How the input stays out of sight: the frontend treats an input that names
|
||||
// a widget as a widget's socket. It leaves such a socket out of the node's
|
||||
// height, draws it only while a link is dragged or hovered or once it is
|
||||
// connected, and keeps the position it is given when no widget by that name
|
||||
// exists. The socket is also drawn in a clear colour, so a linked row shows
|
||||
// no dot. The frontend does not hit-test such a socket either, so the
|
||||
// loader's getInputOnPos finds the row under a drop itself.
|
||||
//
|
||||
// The frontend also removes, when a workflow loads, every widget socket
|
||||
// whose widget it cannot find. So the input is saved as a plain input and
|
||||
// becomes a widget socket again once the workflow has loaded.
|
||||
|
||||
import { chainCallback } from "../shared/index.mjs";
|
||||
|
||||
const NAME = /^strength_[A-Za-z0-9_-]{1,64}$/;
|
||||
const CLEAR = "rgba(0,0,0,0)";
|
||||
// Where the hidden socket sits from the node's left edge, as the frontend
|
||||
// places a widget's socket.
|
||||
const SOCKET_X = 10;
|
||||
const NUMBER_TYPES = new Set(["FLOAT", "INT"]);
|
||||
export const WIRE_LOOKS = ["shown", "on hover", "hidden"];
|
||||
// The canvas skips drawing a wire it is told is being dragged, shadow and
|
||||
// all, so a hidden wire carries that mark. The mark is not saved.
|
||||
|
||||
export const rowInputName = (rowId) => `strength_${rowId}`;
|
||||
export const isRowInput = (input) => typeof input?.name === "string" && NAME.test(input.name);
|
||||
const rowIdOf = (input) => input.name.slice("strength_".length);
|
||||
|
||||
const states = new Set();
|
||||
let watching = false;
|
||||
let hoverTarget = null;
|
||||
|
||||
function canvasOf(app) {
|
||||
return app?.canvas ?? null;
|
||||
}
|
||||
|
||||
function clientPoint(app, x, y) {
|
||||
const canvas = canvasOf(app);
|
||||
const rect = canvas.canvas.getBoundingClientRect();
|
||||
const scale = canvas.ds.scale || 1;
|
||||
const [ox, oy] = canvas.ds.offset;
|
||||
return [rect.left + (x + ox) * scale, rect.top + (y + oy) * scale];
|
||||
}
|
||||
|
||||
function graphPoint(app, clientX, clientY) {
|
||||
const canvas = canvasOf(app);
|
||||
const rect = canvas.canvas.getBoundingClientRect();
|
||||
const scale = canvas.ds.scale || 1;
|
||||
const [ox, oy] = canvas.ds.offset;
|
||||
return [(clientX - rect.left) / scale - ox, (clientY - rect.top) / scale - oy];
|
||||
}
|
||||
|
||||
function linkOf(graph, id) {
|
||||
if (id === null || id === undefined || !graph) return null;
|
||||
return graph.links?.get?.(id) ?? graph.links?.[id] ?? graph._links?.get?.(id) ?? null;
|
||||
}
|
||||
|
||||
function rowElements(state) {
|
||||
return [...state.panel.querySelectorAll(".ausboss-lora-row")]
|
||||
.filter((element) => !element.classList.contains("folded-away"));
|
||||
}
|
||||
|
||||
function rowElement(state, rowId) {
|
||||
return rowElements(state).find((element) => element.dataset.rowId === rowId) ?? null;
|
||||
}
|
||||
|
||||
// The row under a point in client pixels: anywhere across the node's width,
|
||||
// so a drop does not have to hit the strength box itself.
|
||||
function rowAtClient(state, clientX, clientY) {
|
||||
const node = state.node;
|
||||
const app = state.app;
|
||||
const [left] = clientPoint(app, node.pos[0], node.pos[1]);
|
||||
const [right] = clientPoint(app, node.pos[0] + node.size[0], node.pos[1]);
|
||||
if (clientX < left - 4 || clientX > right + 4) return null;
|
||||
for (const element of rowElements(state)) {
|
||||
const rect = element.getBoundingClientRect();
|
||||
if (clientY >= rect.top - 3 && clientY <= rect.bottom + 3) return element;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function isNumberDrag(app) {
|
||||
const connector = canvasOf(app)?.linkConnector;
|
||||
if (!connector?.isConnecting) return false;
|
||||
if (connector.state?.connectingTo && connector.state.connectingTo !== "input") return false;
|
||||
const types = (connector.renderLinks ?? []).map((link) => String(link?.fromSlot?.type ?? ""));
|
||||
return types.length > 0 && types.every((type) => type.split(",").some((part) => NUMBER_TYPES.has(part.trim())));
|
||||
}
|
||||
|
||||
export function rowInputs(node) {
|
||||
return (node.inputs ?? []).filter(isRowInput);
|
||||
}
|
||||
|
||||
// {row id: {input, link, source}} for every row a link sets now.
|
||||
export function linkedRows(node) {
|
||||
const found = new Map();
|
||||
for (const input of rowInputs(node)) {
|
||||
const link = linkOf(node.graph, input.link);
|
||||
if (!link) continue;
|
||||
const source = node.graph?.getNodeById?.(link.origin_id) ?? null;
|
||||
found.set(rowIdOf(input), { input, link, source });
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
// What a linked row shows: the source's own number when it has one in
|
||||
// sight (a Float or Int node, a slider), else just that it is linked.
|
||||
export function sourceValue(entry) {
|
||||
const widgets = entry?.source?.widgets ?? [];
|
||||
const widget = widgets.find((item) => item.name === "value") ?? widgets.find((item) => typeof item.value === "number");
|
||||
return typeof widget?.value === "number" ? widget.value : null;
|
||||
}
|
||||
|
||||
export function sourceTitle(entry) {
|
||||
return String(entry?.source?.title || entry?.source?.type || "another node");
|
||||
}
|
||||
|
||||
function placeInput(state, input) {
|
||||
const element = rowElement(state, rowIdOf(input));
|
||||
if (!element) return;
|
||||
const rect = element.getBoundingClientRect();
|
||||
const [, y] = graphPoint(state.app, 0, rect.top + rect.height / 2);
|
||||
const pos = [SOCKET_X, Math.round((y - state.node.pos[1]) * 10) / 10];
|
||||
if (input.pos?.[0] !== pos[0] || input.pos?.[1] !== pos[1]) input.pos = pos;
|
||||
}
|
||||
|
||||
const HIDDEN = () => ({ label: " ", localized_name: " ", color_on: CLEAR, color_off: CLEAR });
|
||||
|
||||
function hideInput(input) {
|
||||
Object.assign(input, HIDDEN());
|
||||
if (!input.widget) input.widget = { name: input.name };
|
||||
}
|
||||
|
||||
function ensureRowInput(state, rowId) {
|
||||
const node = state.node;
|
||||
const name = rowInputName(rowId);
|
||||
let input = node.inputs?.find((item) => item.name === name);
|
||||
if (!input) input = node.addInput(name, "FLOAT,INT", { ...HIDDEN(), widget: { name } });
|
||||
placeInput(state, input);
|
||||
return input;
|
||||
}
|
||||
|
||||
export function unlinkRow(state, rowId) {
|
||||
const node = state.node;
|
||||
const index = (node.inputs ?? []).findIndex((input) => input.name === rowInputName(rowId));
|
||||
if (index < 0) return;
|
||||
node.removeInput(index);
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
function wireHidden(state, entry) {
|
||||
const look = state.settings?.strength_wires ?? "shown";
|
||||
if (look === "hidden") return true;
|
||||
return look === "on hover" && hoverTarget !== state.node && hoverTarget !== entry.source;
|
||||
}
|
||||
|
||||
function setWireHidden(entry, hidden) {
|
||||
const link = entry.link;
|
||||
if (hidden === Boolean(link._dragging)) return false;
|
||||
// A wire the user is moving keeps the mark the canvas gave it.
|
||||
if (!hidden && link.__ausbossHidden !== true) return false;
|
||||
link._dragging = hidden;
|
||||
link.__ausbossHidden = hidden;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Keep the hidden inputs in step with the rows: drop the ones nothing is
|
||||
// linked to or whose row is gone, move each to its row, colour its wire.
|
||||
// Returns the linked rows.
|
||||
export function syncStrengthLinks(state) {
|
||||
const node = state.node;
|
||||
const connecting = canvasOf(state.app)?.linkConnector?.isConnecting;
|
||||
// Rows not yet read from a workflow that is loading say nothing about
|
||||
// which inputs are stale.
|
||||
const rowsCurrent = state.widget && state.renderedValue === state.widget.value;
|
||||
if (!connecting && rowsCurrent) {
|
||||
const ids = new Set(state.rows.map((row) => row.id));
|
||||
for (let index = (node.inputs?.length ?? 0) - 1; index >= 0; index -= 1) {
|
||||
const input = node.inputs[index];
|
||||
if (!isRowInput(input)) continue;
|
||||
if (!ids.has(rowIdOf(input)) || !linkOf(node.graph, input.link)) node.removeInput(index);
|
||||
}
|
||||
}
|
||||
for (const input of rowInputs(node)) placeInput(state, input);
|
||||
const linked = linkedRows(node);
|
||||
let changed = false;
|
||||
for (const entry of linked.values()) {
|
||||
if (setWireHidden(entry, wireHidden(state, entry))) changed = true;
|
||||
}
|
||||
if (changed) node.setDirtyCanvas?.(true, true);
|
||||
return linked;
|
||||
}
|
||||
|
||||
function paintTarget(element) {
|
||||
for (const state of states) {
|
||||
for (const row of state.panel.querySelectorAll(".ausboss-lora-row.link-target")) {
|
||||
if (row !== element) row.classList.remove("link-target");
|
||||
}
|
||||
}
|
||||
element?.classList.add("link-target");
|
||||
}
|
||||
|
||||
function watchPointer(app) {
|
||||
if (watching) return;
|
||||
watching = true;
|
||||
window.addEventListener("pointermove", (event) => {
|
||||
let target = null;
|
||||
let over = null;
|
||||
for (const state of states) {
|
||||
if (state.disposed) continue;
|
||||
const node = state.node;
|
||||
const [x, y] = graphPoint(app, event.clientX, event.clientY);
|
||||
if (x >= node.pos[0] && x <= node.pos[0] + node.size[0] && y >= node.pos[1] - 30 && y <= node.pos[1] + node.size[1]) over = node;
|
||||
if (!target && !state.box && !state.readOnly && isNumberDrag(app)) target = rowAtClient(state, event.clientX, event.clientY);
|
||||
}
|
||||
paintTarget(target);
|
||||
if (!over) {
|
||||
const [x, y] = graphPoint(app, event.clientX, event.clientY);
|
||||
over = canvasOf(app)?.graph?.getNodeOnPos?.(x, y) ?? null;
|
||||
}
|
||||
if (over !== hoverTarget) {
|
||||
hoverTarget = over;
|
||||
for (const state of states) if (!state.disposed) syncStrengthLinks(state);
|
||||
}
|
||||
}, true);
|
||||
// Nodes 2.0 finishes a link drag in its own pointerup handler and never asks
|
||||
// the node which input is under the pointer. So there the drop on a row is
|
||||
// made here, before that handler runs; it then finds the link made.
|
||||
window.addEventListener("pointerup", (event) => {
|
||||
if (globalThis.LiteGraph?.vueNodesMode && isNumberDrag(app)) {
|
||||
for (const state of states) {
|
||||
if (state.disposed || state.box || state.readOnly) continue;
|
||||
const element = rowAtClient(state, event.clientX, event.clientY);
|
||||
if (element?.dataset.rowId) {
|
||||
dropOnRow(state, element.dataset.rowId, canvasOf(app).linkConnector);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
requestAnimationFrame(() => {
|
||||
paintTarget(null);
|
||||
for (const state of states) if (!state.disposed) state.onStrengthLinks?.();
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
||||
function dropOnRow(state, rowId, connector) {
|
||||
const input = ensureRowInput(state, rowId);
|
||||
for (const link of connector.renderLinks ?? []) {
|
||||
if (link.node === state.node) continue;
|
||||
link.connectToInput?.(state.node, input, connector.events);
|
||||
}
|
||||
}
|
||||
|
||||
export function installStrengthLinks(state, app) {
|
||||
state.app = app;
|
||||
states.add(state);
|
||||
watchPointer(app);
|
||||
const node = state.node;
|
||||
// Saved as plain inputs (see the top of this file), hidden again on load.
|
||||
chainCallback(node, "onSerialize", (data) => {
|
||||
if (!Array.isArray(data?.inputs)) return;
|
||||
data.inputs = data.inputs.map((input) => {
|
||||
if (!isRowInput(input)) return input;
|
||||
const { widget, ...plain } = input;
|
||||
return plain;
|
||||
});
|
||||
});
|
||||
const rehide = () => {
|
||||
for (const input of rowInputs(node)) hideInput(input);
|
||||
requestAnimationFrame(() => { if (!state.disposed) state.onStrengthLinks?.(); });
|
||||
};
|
||||
chainCallback(node, "onGraphConfigured", rehide);
|
||||
chainCallback(node, "onConfigure", () => requestAnimationFrame(rehide));
|
||||
const original = node.getInputOnPos;
|
||||
node.getInputOnPos = function (pos) {
|
||||
const found = typeof original === "function" ? original.call(this, pos) : undefined;
|
||||
if (found && !isRowInput(found)) return found;
|
||||
if (state.disposed || state.box || state.readOnly || !isNumberDrag(app)) return found;
|
||||
const [clientX, clientY] = clientPoint(app, pos[0], pos[1]);
|
||||
const element = rowAtClient(state, clientX, clientY);
|
||||
if (!element?.dataset.rowId) return found;
|
||||
return ensureRowInput(state, element.dataset.rowId);
|
||||
};
|
||||
return () => {
|
||||
states.delete(state);
|
||||
if (node.getInputOnPos !== original) delete node.getInputOnPos;
|
||||
};
|
||||
}
|
||||
|
||||
export const STRENGTH_LINK_STYLES = `
|
||||
.ausboss-lora-row.link-target{outline:2px solid #00b4aa;outline-offset:-1px;background:rgba(0,180,170,.14);}
|
||||
.ausboss-lora-strengthbox.linked{border-color:transparent;outline:2px dashed rgba(0,180,170,.7);outline-offset:-2px;}
|
||||
.ausboss-lora-strengthbox.linked .ausboss-lora-strength{color:#5fe3d9;cursor:pointer;}
|
||||
.ausboss-lora-strengthbox.linked .ausboss-lora-step{display:none;}
|
||||
`;
|
||||
@@ -47,6 +47,24 @@ async function stopLook(node) {
|
||||
return Boolean(running || waiting.length);
|
||||
}
|
||||
|
||||
// Take this node's own runs that still wait out of the queue: the looks and
|
||||
// touches its picture asked for (they carry an `ask`), never a run of the
|
||||
// workflow. Says how many went. The one that is running is left alone.
|
||||
async function dropWaiting(node) {
|
||||
const id = executionIdOf(app.rootGraph ?? app.graph, node);
|
||||
if (!id) return 0;
|
||||
const queue = await (await api.fetchApi("/queue")).json();
|
||||
const ours = (entry) => {
|
||||
const step = entry?.[2]?.[id];
|
||||
return step?.class_type === NODE_CLASS && String(step.inputs?.ask ?? "") !== "";
|
||||
};
|
||||
const waiting = (queue?.queue_pending ?? []).filter(ours).map((entry) => entry[1]);
|
||||
if (waiting.length) {
|
||||
await api.fetchApi("/queue", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ delete: waiting }) });
|
||||
}
|
||||
return waiting.length;
|
||||
}
|
||||
|
||||
// The picture goes above the settings: the stage widget sits ahead of the
|
||||
// node's card, whichever of the two was built first.
|
||||
function stageFirst(node) {
|
||||
@@ -92,6 +110,7 @@ function build(node) {
|
||||
const face = mountTouchStage(node, {
|
||||
lookOnButton: () => lookOnButton,
|
||||
stopLook: () => stopLook(node).catch(() => false),
|
||||
dropWaiting: () => dropWaiting(node).catch(() => 0),
|
||||
// A workflow is being opened: nothing is run on the person's behalf.
|
||||
loading: () => Boolean(app.configuringGraph),
|
||||
// Bypassed or muted, or inside a box that is: nothing is run for it.
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
// Pause for Shot 🆎: while a run waits on the node, a Continue bar shows on
|
||||
// the node and over the 3D viewer it is wired to. Continue reads the viewer's
|
||||
// camera, model turn and size as they are now and sends them to
|
||||
// POST /ausboss/pause_shot/answer (nodes/node_pause_shot.py), which only
|
||||
// accepts them while that node is waiting. The switch above the bar is the
|
||||
// node's `pause` setting (js/widget_cards). When a 360 is wired into the
|
||||
// node, the run hands it over as a temp picture and it goes behind the model
|
||||
// as the viewer's panorama; Continue also sends the 360 strip's settings
|
||||
// (js/viewer_pano), so the run's backdrop matches the viewer.
|
||||
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { api } from "../../../scripts/api.js";
|
||||
import { chainCallback, keepDomWidgetWidthAuto, showToast } from "../shared/index.mjs";
|
||||
import { nodeByExecutionId } from "../shared/graph_ids.mjs";
|
||||
import { compactAction, HINT_TYPE } from "../shared/panel_controls.mjs";
|
||||
import { holdNodeMinWidth, pinVuePanelHeight } from "../shared/panel_layout.mjs";
|
||||
import { FONT_UI, RADIUS_CONTROL, THEME as T } from "../shared/theme.mjs";
|
||||
import { bottomButtons } from "../shared/viewer3d_layout.mjs";
|
||||
import { viewValue } from "../shared/viewer_view.mjs";
|
||||
|
||||
const NODE_CLASS = "AUSBOSS_NODES_PauseShot";
|
||||
const PANEL = "ausboss_pause_shot_panel";
|
||||
const MIN_WIDTH = 260;
|
||||
const PANEL_HEIGHT = 62;
|
||||
|
||||
function ensureCss() {
|
||||
if (document.getElementById("ausboss-pause-shot-css")) return;
|
||||
const style = document.createElement("style");
|
||||
style.id = "ausboss-pause-shot-css";
|
||||
style.textContent = `
|
||||
.ausboss-pshot{box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;gap:6px;width:100%;height:100%;padding:6px 8px 8px;background:${T.card};border-radius:${RADIUS_CONTROL}px;font:400 12px/1.3 ${FONT_UI};color:${T.inkSoft}}
|
||||
.ausboss-pshot-hint{${HINT_TYPE}}
|
||||
.ausboss-pshot.waiting .ausboss-pshot-hint{color:${T.brandInk}}
|
||||
.ausboss-pshot-row{display:flex;gap:6px;justify-content:flex-end}
|
||||
.ausboss-pshot-row .ausboss-compact-action{height:26px;padding:0 12px}
|
||||
.ausboss-pshot .go,.ausboss-pshot-over .go{background:${T.brand};color:${T.onBrand}}
|
||||
.ausboss-pshot .go:hover:enabled,.ausboss-pshot-over .go:hover:enabled{background:${T.brand};color:${T.onBrand};filter:brightness(1.1)}
|
||||
.ausboss-pshot:not(.waiting) .ausboss-pshot-row{visibility:hidden}
|
||||
.ausboss-pshot-over{position:absolute;left:8px;bottom:8px;z-index:6;box-sizing:border-box;display:flex;align-items:center;gap:6px;height:32px;padding:0 4px 0 10px;border-radius:${RADIUS_CONTROL}px;background:${T.card};box-shadow:0 1px 6px rgba(0,0,0,.4);font:600 11px/1 ${FONT_UI};color:${T.brandInk};white-space:nowrap}
|
||||
.ausboss-pshot-over .ausboss-compact-action{height:24px;padding:0 10px}
|
||||
`;
|
||||
document.head.append(style);
|
||||
}
|
||||
|
||||
// The viewer wired to the pause: where its camera comes from.
|
||||
function viewerOf(node) {
|
||||
const slot = node.inputs?.findIndex((input) => input.name === "camera_info") ?? -1;
|
||||
return slot >= 0 ? node.getInputNode?.(slot) ?? null : null;
|
||||
}
|
||||
|
||||
// The viewer's shot as it is on screen right now.
|
||||
async function readShot(viewer) {
|
||||
const shot = {};
|
||||
const state = viewer?.widgets?.find((widget) => widget.name === "viewport_state");
|
||||
if (state?.serializeValue) {
|
||||
const value = await state.serializeValue(viewer, viewer.widgets.indexOf(state));
|
||||
if (value?.camera_info) shot.camera_info = value.camera_info;
|
||||
if (Array.isArray(value?.model_3d_info)) shot.model_3d_info = value.model_3d_info;
|
||||
}
|
||||
const sky = viewer?.properties?.["AusBoss View"]?.sky;
|
||||
if (sky && typeof sky === "object") shot.sky = sky;
|
||||
// The viewer's Cut, so the run's mesh is cut the way the viewer shows it.
|
||||
const cut = viewer?.properties?.["AusBoss View"]?.cut;
|
||||
if (cut && typeof cut === "object") shot.cut = cut;
|
||||
// The 360 taken out of the viewer (its background image removed) leaves
|
||||
// the backdrop grey, as with no 360 wired in.
|
||||
const scene = viewerGizmo(viewer)?.__ausbossScene;
|
||||
if (scene && !(scene.currentBackgroundType === "image" && scene.backgroundRenderMode === "panorama")) shot.panorama = false;
|
||||
try {
|
||||
const ground = viewerGizmo(viewer)?.__ausbossScene?.__ausbossGround?.();
|
||||
if (ground) shot.ground = ground;
|
||||
} catch {
|
||||
// No shadow then.
|
||||
}
|
||||
for (const key of ["width", "height"]) {
|
||||
const linked = viewer?.inputs?.find((input) => input.name === key)?.link != null;
|
||||
const widget = viewer?.widgets?.find((w) => w.name === key);
|
||||
if (!linked && Number.isFinite(Number(widget?.value))) shot[key] = Number(widget.value);
|
||||
}
|
||||
return shot;
|
||||
}
|
||||
|
||||
// The viewer's gizmo box, found through the 360 strip (js/viewer_pano).
|
||||
function viewerGizmo(viewer) {
|
||||
if (!viewer) return null;
|
||||
for (const box of document.querySelectorAll("div[data-ausboss-gizmo]")) {
|
||||
if (box.__ausbossNode === viewer && box.parentElement) return box;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
const viewerBox = (viewer) => viewerGizmo(viewer)?.parentElement ?? null;
|
||||
|
||||
// ComfyUI sends the viewer's model only to the page that pressed Run. The
|
||||
// pause brings it along, so a page that did not start the run (another tab,
|
||||
// a phone, a reload) shows the model too.
|
||||
// ComfyUI names the model as {"result": ["model.glb [temp]", ...]}, or since
|
||||
// its standard 3d output item as {"3d": [{filename, subfolder, type}]}.
|
||||
const plainName = (text) => String(text ?? "").replace(/\s*\[[^\]]*\]$/, "").replaceAll("\\", "/");
|
||||
|
||||
function modelName(output) {
|
||||
const first = output?.result?.[0];
|
||||
if (typeof first === "string") return plainName(first);
|
||||
const item = output?.["3d"]?.[0];
|
||||
if (typeof item?.filename !== "string") return "";
|
||||
return plainName(item.subfolder ? `${item.subfolder}/${item.filename}` : item.filename);
|
||||
}
|
||||
|
||||
function showModel(viewer, shown) {
|
||||
const name = modelName(shown?.output);
|
||||
if (!viewer || !name || typeof viewer.onExecuted !== "function") return;
|
||||
const last = plainName(viewer.properties?.["Last Time Model File"]);
|
||||
if (last === name || last.endsWith(`/${name}`)) return;
|
||||
viewer.onExecuted(shown.output);
|
||||
}
|
||||
|
||||
// Put the run's 360 behind the model, as the viewer's panorama.
|
||||
async function showPanorama(viewer, picture) {
|
||||
const scene = viewerGizmo(viewer)?.__ausbossScene;
|
||||
if (!scene?.setBackgroundImage || !picture?.filename) return false;
|
||||
await scene.setBackgroundImage(`temp/${picture.filename}`);
|
||||
scene.setBackgroundRenderMode?.("panorama");
|
||||
scene.__ausbossViewport?.forceRender?.();
|
||||
return true;
|
||||
}
|
||||
|
||||
function buildPanel(node) {
|
||||
ensureCss();
|
||||
const root = document.createElement("div");
|
||||
root.className = "ausboss-pshot";
|
||||
const hint = document.createElement("div");
|
||||
hint.className = "ausboss-pshot-hint";
|
||||
const row = document.createElement("div");
|
||||
row.className = "ausboss-pshot-row";
|
||||
const stop = compactAction("Stop", "End the run here.");
|
||||
const go = compactAction("Continue", "Go on with the shot as the viewer shows it now.");
|
||||
go.classList.add("go");
|
||||
row.append(stop, go);
|
||||
root.append(hint, row);
|
||||
|
||||
const state = { waitingFor: null, over: null };
|
||||
const idle = "A run waits here while you frame the shot.";
|
||||
hint.textContent = idle;
|
||||
|
||||
const removeOver = () => { state.over?.remove(); state.over = null; };
|
||||
const clear = () => {
|
||||
state.waitingFor = null;
|
||||
root.classList.remove("waiting");
|
||||
hint.textContent = idle;
|
||||
removeOver();
|
||||
};
|
||||
|
||||
const answer = async (action) => {
|
||||
const id = state.waitingFor;
|
||||
if (!id) return;
|
||||
const buttons = [go, stop, ...(state.over ? state.over.querySelectorAll("button") : [])];
|
||||
buttons.forEach((button) => { button.disabled = true; });
|
||||
try {
|
||||
const body = { node: id, action };
|
||||
if (action === "continue") body.shot = await readShot(viewerOf(node));
|
||||
const response = await api.fetchApi("/ausboss/pause_shot/answer", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
|
||||
if (!response.ok) {
|
||||
const data = await response.json().catch(() => ({}));
|
||||
showToast({ detail: data.error || "The pause could not be answered.", severity: "warn" });
|
||||
if (response.status === 409) clear();
|
||||
}
|
||||
} catch {
|
||||
showToast({ detail: "The pause could not be answered. Is ComfyUI still running?", severity: "warn" });
|
||||
} finally {
|
||||
buttons.forEach((button) => { button.disabled = false; });
|
||||
}
|
||||
};
|
||||
go.addEventListener("click", () => answer("continue"));
|
||||
stop.addEventListener("click", () => answer("stop"));
|
||||
|
||||
// The same Continue on the viewer, at its bottom-left corner on the line
|
||||
// of the viewer's own bottom buttons, clear of the shot.
|
||||
const placeOver = (host, over) => {
|
||||
const line = bottomButtons(host);
|
||||
if (!line) return;
|
||||
over.style.bottom = `${line.bottom}px`;
|
||||
over.style.height = `${line.height}px`;
|
||||
};
|
||||
const showOver = () => {
|
||||
removeOver();
|
||||
const host = viewerBox(viewerOf(node));
|
||||
if (!host) return;
|
||||
const over = document.createElement("div");
|
||||
over.className = "ausboss-pshot-over";
|
||||
const label = document.createElement("span");
|
||||
label.textContent = "Frame your shot";
|
||||
const overStop = compactAction("Stop", "End the run here.");
|
||||
const overGo = compactAction("Continue", "Go on with the shot as the viewer shows it now.");
|
||||
overGo.classList.add("go");
|
||||
overStop.addEventListener("click", () => answer("stop"));
|
||||
overGo.addEventListener("click", () => answer("continue"));
|
||||
for (const type of ["pointerdown", "mousedown", "dblclick", "contextmenu"]) over.addEventListener(type, (event) => event.stopPropagation());
|
||||
over.append(label, overStop, overGo);
|
||||
host.append(over);
|
||||
placeOver(host, over);
|
||||
state.over = over;
|
||||
};
|
||||
|
||||
const show = (detail) => {
|
||||
state.waitingFor = String(detail.node);
|
||||
root.classList.add("waiting");
|
||||
hint.textContent = "Frame the shot in the viewer, then Continue.";
|
||||
showOver();
|
||||
const viewer = viewerOf(node);
|
||||
try {
|
||||
showModel(viewer, detail.viewer);
|
||||
} catch {
|
||||
// The viewer keeps what it has.
|
||||
}
|
||||
const panorama = detail.panorama;
|
||||
const showIt = () => showPanorama(viewer, panorama).catch(() => false);
|
||||
// After a reload, or before the viewer has drawn once, its panel is not
|
||||
// there yet: keep looking for it while the pause waits.
|
||||
if (!state.over || !viewerGizmo(viewer)) {
|
||||
const id = state.waitingFor;
|
||||
let tries = 0;
|
||||
const retry = () => {
|
||||
if (state.waitingFor !== id) return;
|
||||
if (!state.over) showOver();
|
||||
if (state.over && viewerGizmo(viewer)) { showIt(); return; }
|
||||
// Quick at first, then slower for as long as the pause waits.
|
||||
setTimeout(retry, (tries += 1) < 40 ? 750 : 2000);
|
||||
};
|
||||
setTimeout(retry, 750);
|
||||
} else showIt();
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
};
|
||||
|
||||
root.addEventListener("pointerdown", (event) => {
|
||||
if (event.target.closest("button")) event.stopPropagation();
|
||||
});
|
||||
return { root, show, clear, isWaitingFor: (id) => state.waitingFor === String(id) };
|
||||
}
|
||||
|
||||
function panelOf(detail) {
|
||||
const node = nodeByExecutionId(app.rootGraph ?? app.graph, detail?.node);
|
||||
return node?.__ausbossPauseShot ?? null;
|
||||
}
|
||||
|
||||
// A page opened or reloaded while a run waits missed the event: ask.
|
||||
async function showWaiting() {
|
||||
try {
|
||||
const response = await api.fetchApi("/ausboss/pause_shot/waiting");
|
||||
if (!response.ok) return;
|
||||
const { waiting } = await response.json();
|
||||
for (const detail of Array.isArray(waiting) ? waiting : []) {
|
||||
const panel = panelOf(detail);
|
||||
if (panel && !panel.isWaitingFor(detail.node)) panel.show(detail);
|
||||
}
|
||||
} catch {
|
||||
// Nothing to bring back.
|
||||
}
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "ausboss.pause_shot",
|
||||
afterConfigureGraph() { showWaiting(); },
|
||||
setup() {
|
||||
api.addEventListener("reconnected", () => showWaiting());
|
||||
api.addEventListener("ausboss-pause-shot", (event) => panelOf(event.detail)?.show(event.detail));
|
||||
api.addEventListener("ausboss-pause-shot-done", (event) => {
|
||||
const panel = panelOf(event.detail);
|
||||
if (panel?.isWaitingFor(event.detail?.node)) panel.clear();
|
||||
});
|
||||
},
|
||||
beforeRegisterNodeDef(nodeType, nodeData) {
|
||||
if (nodeData?.name !== NODE_CLASS) return;
|
||||
chainCallback(nodeType.prototype, "onNodeCreated", function () {
|
||||
const panel = buildPanel(this);
|
||||
const widget = this.addDOMWidget(PANEL, PANEL, panel.root, { serialize: false, hideOnZoom: false });
|
||||
keepDomWidgetWidthAuto(widget);
|
||||
// Not saved with the workflow: saved values come back by position.
|
||||
widget.serialize = false;
|
||||
// A hint and two buttons: a constant height (tests/panel_guards.test.mjs,
|
||||
// fixedByDesign).
|
||||
widget.computeSize = (width) => [Math.max(MIN_WIDTH, Number(width || this.size?.[0] || MIN_WIDTH)), PANEL_HEIGHT];
|
||||
pinVuePanelHeight(widget);
|
||||
holdNodeMinWidth(widget, MIN_WIDTH);
|
||||
widget.options.minNodeSize = [MIN_WIDTH, 60];
|
||||
this.__ausbossPauseShot = panel;
|
||||
// The viewer's 360 settings and Cut go into the hidden `view` input as
|
||||
// the prompt is built, so a run that goes straight through runs again
|
||||
// when one of them changed (js/shared/viewer_view.mjs). The widget
|
||||
// itself holds nothing, so a saved workflow carries no copy.
|
||||
const view = this.widgets?.find((item) => item.name === "view");
|
||||
if (view) {
|
||||
view.value = "";
|
||||
view.serializeValue = () => viewValue(viewerOf(this)?.properties?.["AusBoss View"]);
|
||||
}
|
||||
});
|
||||
chainCallback(nodeType.prototype, "onRemoved", function () {
|
||||
this.__ausbossPauseShot?.clear();
|
||||
});
|
||||
},
|
||||
});
|
||||
+187
-13
@@ -30,19 +30,22 @@ import {
|
||||
} from "../shared/index.mjs";
|
||||
import { WIDGET_FRAME, fillNodeHeight, holdVueNodeMinWidth } from "../shared/panel_layout.mjs";
|
||||
import { hideInputsInDef, hideWidget } from "../shared/widget_visibility.mjs";
|
||||
import { markSocketless } from "../shared/widget_card_math.mjs";
|
||||
import { liftSlot, markSocketless } from "../shared/widget_card_math.mjs";
|
||||
import { makeScrubInput } from "../shared/scrub_input.mjs";
|
||||
import { keepKeyInField } from "../shared/canvas_passthrough.mjs";
|
||||
import {
|
||||
closeSettingsMenu,
|
||||
gearIconSvg,
|
||||
loadSettings,
|
||||
openSettingsMenu,
|
||||
saveSetting,
|
||||
} from "../shared/settings_menu.mjs";
|
||||
import {
|
||||
DEFAULT_RAIL,
|
||||
DEFAULT_SNAP,
|
||||
DIM_MAX,
|
||||
DIM_MIN,
|
||||
RAIL_MAX,
|
||||
SNAP_STEPS,
|
||||
applyRatioAtBudget,
|
||||
chipMatch,
|
||||
@@ -54,12 +57,16 @@ import {
|
||||
offGrid,
|
||||
orientRatio,
|
||||
parseRail,
|
||||
parseRatioToken,
|
||||
parseWorkflowSizes,
|
||||
railEntries,
|
||||
railText,
|
||||
ratioKey,
|
||||
readWorkflowPolicy,
|
||||
savedWorkflowPolicy,
|
||||
workflowRatios,
|
||||
quickSizes,
|
||||
ratioLabel,
|
||||
railRatioLabel,
|
||||
reduceRatio,
|
||||
scrubDim,
|
||||
sizeForMegapixels,
|
||||
@@ -97,14 +104,16 @@ const SETTINGS_SCHEMA = [
|
||||
},
|
||||
{
|
||||
key: "chips_keep_budget", label: "Chips keep current budget", type: "toggle",
|
||||
default: false,
|
||||
hint: "Ratio chips reshape at your current megapixels instead of jumping "
|
||||
+ "to that ratio's ~1MP default size.",
|
||||
default: true,
|
||||
hint: "On: ratio chips keep your current megapixels. Off: a chip jumps "
|
||||
+ "to that ratio's ~1MP size.",
|
||||
},
|
||||
{
|
||||
key: "rail", label: "Ratio rail", type: "text",
|
||||
default: DEFAULT_RAIL, placeholder: DEFAULT_RAIL,
|
||||
hint: "Comma-separated ratios shown as chips, e.g. \"1:1, 21:9\".",
|
||||
// Stored as text ("1:1, 16:9, -21:9"); the gear shows it as a list
|
||||
// editor (editRatioRail), never as this text field.
|
||||
key: "rail", label: "Ratio chips", type: "text",
|
||||
default: DEFAULT_RAIL,
|
||||
hint: "Which ratios show as chips. Switch them on or off, or add your own, like 21:9.",
|
||||
},
|
||||
{ section: "Latent output" },
|
||||
{
|
||||
@@ -146,6 +155,25 @@ function installStyles() {
|
||||
.ausboss-size-dialog [role=alert]{color:#ffd49e}
|
||||
.ausboss-size-dialog p{color:#adc1be;font:12px/1.45 system-ui;margin:7px 0 12px}
|
||||
.ausboss-size-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
|
||||
.ausboss-size-dialog footer .grow{margin-right:auto}
|
||||
.ausboss-rail-list{list-style:none;margin:0;padding:0;max-height:min(320px,50vh);overflow:auto;
|
||||
border:1px solid #2a3a3a;border-radius:8px;background:#111819}
|
||||
.ausboss-rail-row{display:flex;align-items:center;gap:10px;height:32px;padding:0 6px 0 10px;
|
||||
border-bottom:1px solid #1f2b2b;cursor:pointer}
|
||||
.ausboss-rail-row:last-child{border-bottom:0}
|
||||
.ausboss-rail-row.off{color:#6f8482}
|
||||
.ausboss-rail-row .box{width:24px;height:16px;display:flex;align-items:center;justify-content:center;flex:none}
|
||||
.ausboss-rail-row .box span{display:block;border:1.4px solid currentColor;border-radius:2px;box-sizing:border-box}
|
||||
.ausboss-rail-row .name{font:12px ${MONO};min-width:44px}
|
||||
.ausboss-rail-row .size{flex:1;color:#7f9795;font:11px ${MONO}}
|
||||
.ausboss-rail-row.off .size{color:#4f6260}
|
||||
.ausboss-rail-del{width:24px;height:24px;border:0;border-radius:5px;background:none;color:#7f9795;
|
||||
cursor:pointer;font:15px/1 system-ui}
|
||||
.ausboss-rail-del:hover{background:#3a2424;color:#ffb4a8}
|
||||
.ausboss-rail-add{display:flex;align-items:center;gap:8px;margin-top:10px}
|
||||
.ausboss-rail-add input{flex:1;min-width:0;box-sizing:border-box;height:28px;padding:0 8px;
|
||||
border:1px solid #345554;border-radius:6px;background:#0f1516;color:#d7e4e3;font:12px ${MONO}}
|
||||
.ausboss-rail-add input:focus{outline:none;border-color:#00b4aa}
|
||||
.ausboss-res-sec { flex: none; background: #141515; border: 1px solid #252727;
|
||||
border-radius: 8px; padding: 6px 8px 8px; }
|
||||
.ausboss-res-sechead { display: flex; align-items: baseline;
|
||||
@@ -517,6 +545,146 @@ function editWorkflowSizes(state) {
|
||||
dialog.showModal();
|
||||
}
|
||||
|
||||
// The gear's "Ratio chips" list: every saved ratio with a switch, a delete
|
||||
// button, an add box and a way back to the shipped list. One list for every
|
||||
// Latent Size node in this browser, like the gear's other display options.
|
||||
function editRatioRail(state) {
|
||||
closeSettingsMenu();
|
||||
let entries = railEntries(state.settings?.rail);
|
||||
const dialog = el("dialog", "ausboss-size-dialog");
|
||||
dialog.setAttribute("aria-label", "Ratio chips");
|
||||
const heading = el("label", "", "Ratio chips");
|
||||
const hint = el("p", "", "Ticked ratios show as chips on every Latent Size node. "
|
||||
+ "The flip button on the node turns any of them portrait.");
|
||||
const list = el("ul", "ausboss-rail-list");
|
||||
const addRow = el("div", "ausboss-rail-add");
|
||||
const input = el("input");
|
||||
input.type = "text";
|
||||
input.placeholder = "Add a ratio, like 21:9";
|
||||
input.setAttribute("aria-label", "New ratio");
|
||||
const add = compactAction("Add");
|
||||
addRow.append(input, add);
|
||||
const error = el("div");
|
||||
error.setAttribute("role", "alert");
|
||||
|
||||
const render = () => {
|
||||
list.textContent = "";
|
||||
const snap = currentSnap(state);
|
||||
for (const entry of entries) {
|
||||
const row = el("li", `ausboss-rail-row${entry.on ? "" : " off"}`);
|
||||
const check = el("input");
|
||||
check.type = "checkbox";
|
||||
check.checked = entry.on;
|
||||
check.setAttribute("aria-label", `Show ${entry.label}`);
|
||||
const box = el("span", "box");
|
||||
const glyph = el("span");
|
||||
const fitted = fitRectInBox(entry.x, entry.y, 22, 14);
|
||||
glyph.style.width = `${fitted.w.toFixed(1)}px`;
|
||||
glyph.style.height = `${fitted.h.toFixed(1)}px`;
|
||||
box.append(glyph);
|
||||
const size = defaultSizeForRatio(entry, snap);
|
||||
const del = el("button", "ausboss-rail-del", "×");
|
||||
del.type = "button";
|
||||
del.title = `Remove ${entry.label}`;
|
||||
del.setAttribute("aria-label", `Remove ${entry.label}`);
|
||||
const toggle = () => {
|
||||
entry.on = !entry.on;
|
||||
error.textContent = "";
|
||||
render();
|
||||
};
|
||||
check.addEventListener("click", (event) => { event.stopPropagation(); toggle(); });
|
||||
row.addEventListener("click", (event) => { if (event.target !== del) toggle(); });
|
||||
del.addEventListener("click", (event) => {
|
||||
event.stopPropagation();
|
||||
entries = entries.filter(other => other !== entry);
|
||||
error.textContent = "";
|
||||
render();
|
||||
});
|
||||
row.append(check, box, el("span", "name", entry.label),
|
||||
el("span", "size", `${size.width} × ${size.height}`), del);
|
||||
list.append(row);
|
||||
}
|
||||
add.disabled = entries.length >= RAIL_MAX;
|
||||
};
|
||||
|
||||
const addTyped = () => {
|
||||
const ratio = parseRatioToken(input.value);
|
||||
if (!ratio) {
|
||||
error.textContent = "Type a ratio as two whole numbers, like 21:9 or 5:4.";
|
||||
input.focus();
|
||||
return;
|
||||
}
|
||||
const existing = entries.find(entry => ratioKey(entry) === ratioKey(ratio));
|
||||
if (existing) {
|
||||
existing.on = true;
|
||||
error.textContent = `${existing.label} is already in the list, so it is switched on.`;
|
||||
} else if (entries.length >= RAIL_MAX) {
|
||||
error.textContent = `The list holds up to ${RAIL_MAX} ratios. Remove one first.`;
|
||||
return;
|
||||
} else {
|
||||
entries.push({ ...ratio, on: true });
|
||||
error.textContent = "";
|
||||
}
|
||||
input.value = "";
|
||||
render();
|
||||
list.lastElementChild?.scrollIntoView?.({ block: "nearest" });
|
||||
input.focus();
|
||||
};
|
||||
add.onclick = addTyped;
|
||||
input.addEventListener("keydown", (event) => {
|
||||
keepKeyInField(event);
|
||||
if (event.key !== "Enter") return;
|
||||
event.preventDefault();
|
||||
addTyped();
|
||||
});
|
||||
|
||||
const footer = el("footer");
|
||||
const reset = compactAction("Reset to defaults");
|
||||
reset.classList.add("grow");
|
||||
reset.title = "Back to the shipped list: six chips on, 5:4 and 21:9 off";
|
||||
reset.onclick = () => {
|
||||
entries = railEntries(DEFAULT_RAIL);
|
||||
error.textContent = "";
|
||||
render();
|
||||
};
|
||||
const cancel = compactAction("Cancel");
|
||||
const save = compactAction("Save");
|
||||
cancel.onclick = () => dialog.close();
|
||||
save.onclick = () => {
|
||||
if (!entries.some(entry => entry.on)) {
|
||||
error.textContent = "Keep at least one ratio switched on.";
|
||||
return;
|
||||
}
|
||||
const rail = railText(entries);
|
||||
saveSetting(SETTINGS_SCOPE, SETTINGS_SCHEMA, "rail", rail);
|
||||
for (const other of latentSizeStates()) {
|
||||
other.settings = { ...other.settings, rail };
|
||||
buildPanel(other);
|
||||
fitNode(other);
|
||||
}
|
||||
dialog.close();
|
||||
};
|
||||
footer.append(reset, cancel, save);
|
||||
dialog.append(heading, hint, list, addRow, error, footer);
|
||||
document.body.append(dialog);
|
||||
dialog.addEventListener("close", () => dialog.remove(), { once: true });
|
||||
render();
|
||||
dialog.showModal();
|
||||
}
|
||||
|
||||
// Every live Latent Size panel, in the open graph and the one on screen
|
||||
// (a subgraph), so a changed chip list shows everywhere at once.
|
||||
function latentSizeStates() {
|
||||
const states = new Set();
|
||||
for (const graph of [app.graph, app.canvas?.graph]) {
|
||||
for (const node of graph?.nodes ?? graph?._nodes ?? []) {
|
||||
const state = node?.__ausbossResolution;
|
||||
if (state && !state.disposed) states.add(state);
|
||||
}
|
||||
}
|
||||
return states;
|
||||
}
|
||||
|
||||
function repaint(state) {
|
||||
const { width, height } = getSize(state);
|
||||
const snap = currentSnap(state);
|
||||
@@ -525,7 +693,7 @@ function repaint(state) {
|
||||
|
||||
state.dimLabel.textContent = `${width} × ${height}`;
|
||||
state.subMp.textContent = `${megapixels(width, height).toFixed(2)} MP`;
|
||||
state.subRatio.textContent = state.strict ? `${ratio.x}:${ratio.y}` : ratioLabel(width, height);
|
||||
state.subRatio.textContent = state.strict ? `${ratio.x}:${ratio.y}` : railRatioLabel(width, height, state.railRatios);
|
||||
state.offGridDot.style.display = !state.strict && offGrid(width, height, snap) ? "" : "none";
|
||||
state.dots.style.display = state.settings?.show_grid === false ? "none" : "";
|
||||
|
||||
@@ -606,7 +774,7 @@ function repaint(state) {
|
||||
state.quickHint.textContent = state.policyError ? "Invalid list · edit in settings"
|
||||
: linked && state.strict ? "Linked size checked at run"
|
||||
: state.strict ? `Allowed · ${ratio.x}:${ratio.y}` : picks ? "Workflow recommendations"
|
||||
: onRail ? `for ${ratioLabel(width, height)} · /${snap}` : `custom · /${snap}`;
|
||||
: onRail ? `for ${railRatioLabel(width, height, state.railRatios)} · /${snap}` : `custom · /${snap}`;
|
||||
}
|
||||
state.quickButtons.forEach(({ button, size }) => {
|
||||
button.disabled = linked;
|
||||
@@ -901,6 +1069,10 @@ function buildPanel(state) {
|
||||
key: "workflow_sizes", type: "action", label: "Workflow resolutions", button: "Edit list",
|
||||
onAction: () => editWorkflowSizes(state),
|
||||
}, ...SETTINGS_SCHEMA.filter(e => !state.strict || !["default_snap", "chips_keep_budget", "rail"].includes(e.key)).map((entry) => {
|
||||
if (entry.key === "rail") {
|
||||
return { key: "rail_list", type: "action", label: entry.label, hint: entry.hint,
|
||||
button: "Edit list", onAction: () => editRatioRail(state) };
|
||||
}
|
||||
const input = entry.key === "latent" ? "latent" : entry.key === "batch" ? "batch_size" : null;
|
||||
return input && axisLinked(state, input) ? { section: `${entry.label} is linked` } : entry;
|
||||
})],
|
||||
@@ -912,7 +1084,10 @@ function buildPanel(state) {
|
||||
batch: Number(state.batchWidget?.value ?? 1),
|
||||
},
|
||||
onChange: (values, key) => {
|
||||
state.settings = values;
|
||||
// The menu's values lack the rail (its row is the list editor), so
|
||||
// keep the stored one; after a Reset that is the shipped list.
|
||||
state.settings = { ...loadSettings(SETTINGS_SCOPE, SETTINGS_SCHEMA), ...values };
|
||||
delete state.settings.rail_list;
|
||||
if (key === "latent" && state.latentWidget) {
|
||||
state.latentWidget.value = values.latent;
|
||||
state.latentWidget.callback?.(values.latent);
|
||||
@@ -1014,8 +1189,7 @@ function installResolutionNode(node) {
|
||||
const liftSockets = () => {
|
||||
for (const input of node.inputs ?? []) {
|
||||
if (["width", "height", "latent", "batch_size"].includes(input.widget?.name)) {
|
||||
delete input.widget;
|
||||
input._widget = undefined;
|
||||
liftSlot(input);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@ import { nodeByExecutionId } from "../shared/graph_ids.mjs";
|
||||
import {
|
||||
collapseRepeatedErrors,
|
||||
emptySourceMessage,
|
||||
explainRunError,
|
||||
findEmptySources,
|
||||
nodeLacksSource,
|
||||
} from "../shared/run_check.mjs";
|
||||
@@ -174,10 +175,20 @@ function collapseAnswers() {
|
||||
api.queuePrompt = collapsing;
|
||||
}
|
||||
|
||||
// A run that stops on an error the pack knows the cause of gets one toast
|
||||
// that says what to do. ComfyUI's own error report is left as it is.
|
||||
function explainKnownErrors() {
|
||||
api.addEventListener("execution_error", ({ detail }) => {
|
||||
const known = explainRunError(detail);
|
||||
if (known) showToast({ severity: "warn", summary: known.summary, detail: known.detail, life: 30000 });
|
||||
});
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "ausboss.run_check",
|
||||
setup() {
|
||||
guardRuns();
|
||||
collapseAnswers();
|
||||
explainKnownErrors();
|
||||
},
|
||||
});
|
||||
|
||||
+56
-15
@@ -33,7 +33,7 @@ const CARD_HEIGHT = 288;
|
||||
const WRAPPER_INSET = 16;
|
||||
const HIDDEN = [
|
||||
"filename_prefix", "format", "save_metadata", "exact_name", "on_existing",
|
||||
"output_dir", "caption", "name_counter", "name_date", "name_time", "name_size", "name_batch",
|
||||
"output_dir", "caption", "name_counter", "name_date", "name_time", "name_size", "name_batch", "autosave", "civitai_info",
|
||||
];
|
||||
const FONT = `-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif`;
|
||||
const MONO = `ui-monospace,SFMono-Regular,Menlo,Consolas,monospace`;
|
||||
@@ -60,7 +60,11 @@ function ensureCss() {
|
||||
.ausboss-save-chip:hover{color:#fff;border-color:${BRAND}}
|
||||
.ausboss-save-chip.on{background:${BRAND};border-color:${BRAND};color:#04201d}
|
||||
.ausboss-save-chips.off .ausboss-save-chip{opacity:.4;pointer-events:none}
|
||||
.ausboss-save-embed-label{flex:0 0 30%;color:#8ba3a1;font-size:11px;user-select:none}
|
||||
.ausboss-save-embed-label{flex:none;color:#8ba3a1;font-size:11px;white-space:nowrap;user-select:none}
|
||||
.ausboss-save-half{display:flex;align-items:center;gap:6px;flex:1 1 auto;min-width:0}
|
||||
.ausboss-save-half .ausboss-card-seg{flex:1 1 0;min-width:0}
|
||||
.ausboss-save-switches{gap:12px}
|
||||
.ausboss-save-half.embed{flex-grow:1.5}
|
||||
.ausboss-save-browse{position:fixed;z-index:10000;width:260px;max-height:320px;overflow:auto;padding:4px;border:1px solid #3a4047;border-radius:7px;background:#1c1f23;box-shadow:0 8px 28px rgba(0,0,0,.5);font:12px/1.3 ${FONT};color:#d8ecea}
|
||||
.ausboss-save-browse-head{padding:5px 8px 6px;border-bottom:1px solid #2c3238;color:#78908e;font:10px/1 ${FONT};letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.ausboss-save-browse button{display:block;width:100%;padding:6px 8px;border:none;border-radius:5px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
|
||||
@@ -146,7 +150,7 @@ async function openBrowse(state, anchor) {
|
||||
}
|
||||
path = listing.path;
|
||||
const use = el("button", "use", path ? `Use “${path}”` : "Use the output folder");
|
||||
use.addEventListener("click", () => { setValue(state.node, "output_dir", path); state.refresh(); notifyAusbossChange(); closeBrowse(); });
|
||||
use.addEventListener("click", () => { state.savedPath = null; setValue(state.node, "output_dir", path); state.refresh(); notifyAusbossChange(); closeBrowse(); });
|
||||
popup.append(use);
|
||||
if (path) {
|
||||
const up = el("button", "", "↑ up one level");
|
||||
@@ -270,20 +274,51 @@ function buildCard(node) {
|
||||
}
|
||||
root.append(seg);
|
||||
|
||||
// Embed workflow: a no | yes pill, the pack's boolean.
|
||||
// Embed: what goes in the file, in one pill. Off is a clean picture; On
|
||||
// stores the prompt and workflow for drag-back; Civitai stores them too and
|
||||
// adds the settings line civitai.com reads (save_metadata + civitai_info).
|
||||
const embedRow = el("div", "ausboss-save-row");
|
||||
const embedSeg = el("div", "ausboss-card-seg ausboss-card-bool");
|
||||
embedSeg.setAttribute("role", "radiogroup");
|
||||
const embedButtons = new Map();
|
||||
const embedTitle = "Embed stores the prompt and workflow in the image for drag-back. Off writes a clean image for sharing or datasets.";
|
||||
const embedChoices = [
|
||||
["off", PANEL_LABELS.off, false, false, "Off writes a clean image, with no prompt or workflow inside - for sharing or datasets."],
|
||||
["on", PANEL_LABELS.on, true, false, "On stores the prompt and workflow in the image, so it drags back into ComfyUI."],
|
||||
["civitai", "Civitai", true, true, "Civitai stores the workflow and also the prompt, settings and model and LoRA fingerprints the way civitai.com reads them, so an upload lists its prompt and resources."],
|
||||
];
|
||||
for (const [key, text, embed, civitai, title] of embedChoices) {
|
||||
const button = el("button", "", text);
|
||||
button.type = "button"; button.title = title;
|
||||
button.addEventListener("click", () => {
|
||||
const changedEmbed = setValue(node, "save_metadata", embed);
|
||||
const changedCivitai = setValue(node, "civitai_info", civitai);
|
||||
if (changedEmbed || changedCivitai) notifyAusbossChange();
|
||||
state.refresh();
|
||||
});
|
||||
embedSeg.append(button); embedButtons.set(key, button);
|
||||
}
|
||||
const embedHalf = el("div", "ausboss-save-half embed");
|
||||
embedHalf.append(el("span", "ausboss-save-embed-label", "Embed"), embedSeg);
|
||||
embedRow.classList.add("ausboss-save-switches");
|
||||
embedRow.append(embedHalf);
|
||||
root.append(embedRow);
|
||||
|
||||
// Auto save: off shows the pictures without saving them; the Save button
|
||||
// over the picture (js/input_preview) then keeps the ones that are wanted.
|
||||
// It shares the Embed workflow row, so the card is no taller than before.
|
||||
const autoHalf = el("div", "ausboss-save-half");
|
||||
const autoSeg = el("div", "ausboss-card-seg ausboss-card-bool");
|
||||
autoSeg.setAttribute("role", "radiogroup");
|
||||
const autoButtons = new Map();
|
||||
const autoTitle = "On: every run saves its pictures. Off: the pictures only show here, and the Save button over them keeps the ones you want.";
|
||||
for (const [on, text] of [[false, PANEL_LABELS.off], [true, PANEL_LABELS.on]]) {
|
||||
const button = el("button", "", text);
|
||||
button.type = "button"; button.title = embedTitle;
|
||||
button.addEventListener("click", () => { if (setValue(node, "save_metadata", on)) notifyAusbossChange(); state.refresh(); });
|
||||
embedSeg.append(button); embedButtons.set(on, button);
|
||||
button.type = "button"; button.title = autoTitle;
|
||||
button.addEventListener("click", () => { if (setValue(node, "autosave", on)) { state.savedPath = null; notifyAusbossChange(); } state.refresh(); });
|
||||
autoSeg.append(button); autoButtons.set(on, button);
|
||||
}
|
||||
embedRow.append(el("span", "ausboss-save-embed-label", PANEL_LABELS.embed), embedSeg);
|
||||
root.append(embedRow);
|
||||
autoHalf.append(el("span", "ausboss-save-embed-label", "Auto save"), autoSeg);
|
||||
embedRow.append(autoHalf);
|
||||
|
||||
root.addEventListener("pointerdown", (event) => {
|
||||
if (event.target.closest("button,input,select")) event.stopPropagation();
|
||||
@@ -325,10 +360,15 @@ function buildCard(node) {
|
||||
chips.classList.toggle("off", !tagsEnabled(values));
|
||||
for (const [key, chip] of chipButtons) chip.classList.toggle("on", Boolean(values[key]));
|
||||
for (const [key, button] of formatButtons) button.classList.toggle("on", values.format === key);
|
||||
const embed = Boolean(values.save_metadata);
|
||||
for (const [on, button] of embedButtons) {
|
||||
button.classList.toggle("on", on === embed);
|
||||
button.setAttribute("aria-checked", String(on === embed));
|
||||
const embed = !values.save_metadata ? "off" : values.civitai_info ? "civitai" : "on";
|
||||
for (const [key, button] of embedButtons) {
|
||||
button.classList.toggle("on", key === embed);
|
||||
button.setAttribute("aria-checked", String(key === embed));
|
||||
}
|
||||
const auto = values.autosave !== false;
|
||||
for (const [on, button] of autoButtons) {
|
||||
button.classList.toggle("on", on === auto);
|
||||
button.setAttribute("aria-checked", String(on === auto));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -370,7 +410,8 @@ function buildCard(node) {
|
||||
chainCallback(node, "onExecuted", (output) => {
|
||||
if (isForeignRun()) return;
|
||||
const saved = output?.ausboss_saved_path?.[0];
|
||||
if (typeof saved === "string" && saved) { state.savedPath = saved; state.refresh(); }
|
||||
state.savedPath = typeof saved === "string" && saved ? saved : null;
|
||||
state.refresh();
|
||||
});
|
||||
chainCallback(node, "onRemoved", () => { state.alive = false; closeBrowse(); });
|
||||
state.refresh();
|
||||
|
||||
@@ -40,8 +40,8 @@ function getLoopEnabled(node) {
|
||||
}
|
||||
|
||||
// The Preview steps switch: the hidden `step_preview` widget (the card hides it).
|
||||
// On, the player shows each step of the clip's first frame while it is
|
||||
// being made, and a STOP button joins the tools for the run.
|
||||
// On, the player shows each step of the clip while it is being made (a few
|
||||
// of its frames in a loop), and a STOP button joins the tools for the run.
|
||||
function stepsOn(state) {
|
||||
return state.stepsWidget?.value === true;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ function buildPreview(node) {
|
||||
loopButton.classList.add("ausboss-steps-loop");
|
||||
const stopButton = makeToolButton("STOP", "Stop this run now. The next run in the queue still starts.");
|
||||
stopButton.classList.add("ausboss-steps-stop");
|
||||
const stepsButton = panelSwitch("Preview steps", "Show the clip's first frame here while it is being made, one step at a time, with a Stop button. Off by default.");
|
||||
const stepsButton = panelSwitch("Preview steps", "Show the clip here while it is being made: after each step, a few of its frames play in a loop, with a Stop button. Off by default.");
|
||||
tools.classList.add("ausboss-steps-tools");
|
||||
tools.append(stopButton, loopButton);
|
||||
stage.append(video, image, status, tools);
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
// App mode and the pack's cards. Pure logic, no DOM: tested under node:test.
|
||||
//
|
||||
// App mode is ComfyUI's simple form view of a workflow: a saved list of
|
||||
// fields (extra.linearData.inputs) and a Run button. Each field is a
|
||||
// widget. A node with a card or panel hides its standard widgets and shows
|
||||
// its own controls instead, and App mode reads that hidden flag too, so the
|
||||
// form drew an empty row for every field on such a node.
|
||||
//
|
||||
// While a workflow is in App mode, the widgets its form lists are shown
|
||||
// again; App mode draws its own control for each. Back in the graph they are
|
||||
// hidden again, so the node's face is unchanged. Only listed widgets move.
|
||||
import { hideWidget, isWidgetHidden, showWidget } from "./widget_visibility.mjs";
|
||||
|
||||
export const APP_MODE = "app";
|
||||
|
||||
// "app", "graph" or "builder:..." for the open workflow.
|
||||
export function workflowMode(workflow) {
|
||||
return workflow?.activeMode ?? workflow?.initialMode ?? "graph";
|
||||
}
|
||||
|
||||
// The form's fields as { nodeId, widget } pairs. A field is saved as
|
||||
// [nodeId, widgetName] or [nodeId, widgetName, { description }].
|
||||
export function appFields(linearData) {
|
||||
const inputs = Array.isArray(linearData?.inputs) ? linearData.inputs : [];
|
||||
const fields = [];
|
||||
for (const entry of inputs) {
|
||||
if (!Array.isArray(entry) || entry.length < 2) continue;
|
||||
const [nodeId, widget] = entry;
|
||||
if ((typeof nodeId !== "string" && typeof nodeId !== "number") || typeof widget !== "string") continue;
|
||||
fields.push({ nodeId: String(nodeId), widget });
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
// Where the form puts a DOM widget (a panel, the clip window): the empty
|
||||
// host the form draws in that field's row. The form moves the widget's
|
||||
// element into it once, as the row mounts, and the graph's own widget layer
|
||||
// can take it back a moment later, which left the row empty. So the pack
|
||||
// moves it in again (js/app_mode/). A selector, so it is testable here.
|
||||
export function formHostSelector(nodeId, name) {
|
||||
const id = String(nodeId).replace(/["\\]/g, "");
|
||||
const field = String(name).replace(/["\\]/g, "");
|
||||
return `[data-testid="app-mode-widget-item"][data-widget-key$=":${id}:${field}"] [data-widget-name="${field}"] div[node-type]`;
|
||||
}
|
||||
|
||||
// find(nodeId, widgetName) -> { node, widget } or null
|
||||
// changed(node) is called after a widget on that node changed visibility.
|
||||
export function createAppModeSync({ find, changed = () => {} }) {
|
||||
const lent = new Map(); // widget -> node, shown for the form
|
||||
return function sync(mode, linearData) {
|
||||
if (mode === APP_MODE) {
|
||||
for (const { nodeId, widget: name } of appFields(linearData)) {
|
||||
const found = find(nodeId, name);
|
||||
if (!found?.widget || !isWidgetHidden(found.widget)) continue;
|
||||
showWidget(found.widget);
|
||||
// An explicit false, not a deleted flag: the frontend keeps its own
|
||||
// copy of the hidden state and only hears about a written value.
|
||||
if (found.widget.options) found.widget.options.hidden = false;
|
||||
lent.set(found.widget, found.node);
|
||||
changed(found.node);
|
||||
}
|
||||
return lent.size;
|
||||
}
|
||||
for (const [widget, node] of lent) {
|
||||
if (hideWidget(widget)) changed(node);
|
||||
}
|
||||
lent.clear();
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
// The maths behind the 3D viewer's Blender keys (js/viewer_keys): G moves,
|
||||
// R rotates and S scales the model while the mouse moves, the way Blender
|
||||
// does it. Plain arrays [x, y, z]; nothing here touches the page, so it is
|
||||
// tested on its own (tests/blender_transform.test.mjs).
|
||||
|
||||
export const AXES = Object.freeze({ x: [1, 0, 0], y: [0, 1, 0], z: [0, 0, 1] });
|
||||
export const AXIS_NAMES = Object.freeze(["x", "y", "z"]);
|
||||
|
||||
export const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
||||
export const add = (a, b) => [a[0] + b[0], a[1] + b[1], a[2] + b[2]];
|
||||
export const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
|
||||
export const times = (a, k) => [a[0] * k, a[1] * k, a[2] * k];
|
||||
export const cross = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
|
||||
export const length = (a) => Math.hypot(a[0], a[1], a[2]);
|
||||
export const unit = (a) => { const n = length(a); return n > 1e-12 ? times(a, 1 / n) : [0, 0, 0]; };
|
||||
|
||||
/**
|
||||
* Blender's axis lock. X locks to the world's X axis, X again to the
|
||||
* model's own X, a third time unlocks. Shift+X locks to the plane that
|
||||
* leaves X out (move or scale along the other two), with the same cycle.
|
||||
*/
|
||||
export function nextConstraint(current, axis, plane = false) {
|
||||
const kind = plane ? "plane" : "axis";
|
||||
if (!current || current.axis !== axis || current.kind !== kind) return { kind, axis, space: "global" };
|
||||
if (current.space === "global") return { kind, axis, space: "local" };
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Where a ray meets a plane, as a distance along the ray; null when it runs parallel. */
|
||||
export function rayPlane(origin, dir, point, normal) {
|
||||
const denom = dot(dir, normal);
|
||||
if (Math.abs(denom) < 1e-9) return null;
|
||||
return dot(sub(point, origin), normal) / denom;
|
||||
}
|
||||
|
||||
export const along = (origin, dir, t) => add(origin, times(dir, t));
|
||||
|
||||
/**
|
||||
* The spot on an axis line (through `point`, along unit `axis`) nearest a
|
||||
* ray, as a distance along the axis. null when the axis points along the
|
||||
* ray, where every spot is as near as any other.
|
||||
*/
|
||||
export function closestOnAxis(origin, dir, point, axis) {
|
||||
const w = sub(point, origin);
|
||||
const a = dot(axis, axis);
|
||||
const b = dot(axis, dir);
|
||||
const c = dot(dir, dir);
|
||||
const denom = a * c - b * b;
|
||||
if (Math.abs(denom) < 1e-9 * a * c) return null;
|
||||
return (b * dot(dir, w) - c * dot(axis, w)) / denom;
|
||||
}
|
||||
|
||||
/** The turn from screen point `a` to `b` around `center`, counter-clockwise positive, in (-pi, pi]. Screen y points down. */
|
||||
export function screenTurn(center, a, b) {
|
||||
const ax = a[0] - center[0], ay = center[1] - a[1];
|
||||
const bx = b[0] - center[0], by = center[1] - b[1];
|
||||
if (Math.hypot(ax, ay) < 1e-6 || Math.hypot(bx, by) < 1e-6) return 0;
|
||||
return Math.atan2(ax * by - ay * bx, ax * bx + ay * by);
|
||||
}
|
||||
|
||||
/** Round to the nearest step; a step of 0 leaves the value alone. */
|
||||
export const snapTo = (value, step) => (step > 0 ? Math.round(value / step) * step : value);
|
||||
|
||||
/**
|
||||
* A typed number as Blender takes it while a move runs: digits, one point,
|
||||
* and a minus anywhere that flips the sign. null while nothing usable is typed.
|
||||
*/
|
||||
export function parseTyped(text) {
|
||||
if (typeof text !== "string") return null;
|
||||
const negative = (text.match(/-/g)?.length ?? 0) % 2 === 1;
|
||||
const digits = text.replace(/-/g, "");
|
||||
if (!/^\d*\.?\d*$/.test(digits) || !/\d/.test(digits)) return null;
|
||||
const value = Number(digits);
|
||||
return Number.isFinite(value) ? (negative ? -value : value) : null;
|
||||
}
|
||||
|
||||
/** Edit the typed text with one key: a digit, ".", "-" (flip), or Backspace. */
|
||||
export function typeKey(text, key) {
|
||||
if (key === "Backspace") return text.slice(0, -1);
|
||||
if (key === "-") return text.startsWith("-") ? text.slice(1) : `-${text}`;
|
||||
if (key === ".") return text.includes(".") ? text : `${text}.`;
|
||||
if (/^\d$/.test(key)) return text + key;
|
||||
return text;
|
||||
}
|
||||
|
||||
/** How fine Ctrl snapping is: Shift makes it ten times finer, as in Blender. */
|
||||
export function snapStep(mode, precise) {
|
||||
if (mode === "rotate") return precise ? 1 : 5; // degrees
|
||||
return precise ? 0.01 : 0.1; // world units, or scale factor
|
||||
}
|
||||
|
||||
/**
|
||||
* The model's own axis that lies closest to a world axis, for scaling along
|
||||
* a world axis: scale belongs to the model's own axes, so a turned model
|
||||
* is scaled along the one that points most that way.
|
||||
* `localAxes` are the model's three axes in world space.
|
||||
*/
|
||||
export function nearestLocalAxis(localAxes, worldAxis) {
|
||||
let best = 0;
|
||||
let score = -1;
|
||||
localAxes.forEach((axis, i) => {
|
||||
const s = Math.abs(dot(unit(axis), worldAxis));
|
||||
if (s > score) { score = s; best = i; }
|
||||
});
|
||||
return best;
|
||||
}
|
||||
|
||||
/** The scale factors on the model's own axes for a scale of `factor` under a lock. */
|
||||
export function scaleFactors(factor, constraint, lockedIndex) {
|
||||
if (!constraint) return [factor, factor, factor];
|
||||
return [0, 1, 2].map((i) => {
|
||||
const on = constraint.kind === "axis" ? i === lockedIndex : i !== lockedIndex;
|
||||
return on ? factor : 1;
|
||||
});
|
||||
}
|
||||
|
||||
/** How far (screen px) the mouse must travel before the middle button picks an axis. */
|
||||
export const PICK_PX = 8;
|
||||
|
||||
/**
|
||||
* The mouse move that picks the axis for Blender's middle-button lock: the
|
||||
* move since the middle button went down once it is long enough (hold and
|
||||
* slide along an axis), else the move since G, R or S began (move, then
|
||||
* click the middle button). null while neither is long enough; then a click
|
||||
* waits for the mouse to move and picks from that.
|
||||
*/
|
||||
export function pickVector(start, press, now, min = PICK_PX) {
|
||||
if (press) {
|
||||
const held = [now[0] - press[0], now[1] - press[1]];
|
||||
if (Math.hypot(held[0], held[1]) >= min) return held;
|
||||
}
|
||||
const whole = [now[0] - start[0], now[1] - start[1]];
|
||||
return Math.hypot(whole[0], whole[1]) >= min ? whole : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Of the axes as drawn on screen (2D directions, any length), the one a
|
||||
* mouse move runs most nearly along: Blender picks the axis line nearest
|
||||
* the mouse's move. Axes shorter than `minLength` on screen (pointing at
|
||||
* the camera) are left out; -1 when none is left or the move is empty.
|
||||
*/
|
||||
export function nearestScreenAxis(move, screenAxes, minLength = 1e-3) {
|
||||
if (!move || Math.hypot(move[0], move[1]) < 1e-9) return -1;
|
||||
let best = -1;
|
||||
let score = Infinity;
|
||||
screenAxes.forEach((d, i) => {
|
||||
const n = Math.hypot(d[0], d[1]);
|
||||
if (!(n >= minLength)) return;
|
||||
// The move's distance from the axis line through the start.
|
||||
const off = Math.abs(move[0] * d[1] - move[1] * d[0]) / n;
|
||||
if (off < score - 1e-9) { score = off; best = i; }
|
||||
});
|
||||
return best;
|
||||
}
|
||||
|
||||
/** The lock the middle button gives for the picked axis (Shift: the plane without it). */
|
||||
export const autoConstraint = (axis, plane = false) => ({ kind: plane ? "plane" : "axis", axis, space: "global" });
|
||||
|
||||
/** Words for the lock, for the header line. */
|
||||
export function constraintLabel(constraint) {
|
||||
if (!constraint) return "";
|
||||
const name = constraint.axis.toUpperCase();
|
||||
const where = constraint.space === "local" ? "local" : "global";
|
||||
if (constraint.kind === "plane") {
|
||||
const others = AXIS_NAMES.filter((a) => a !== constraint.axis).map((a) => a.toUpperCase()).join("");
|
||||
return `on ${where} ${others}`;
|
||||
}
|
||||
return `along ${where} ${name}`;
|
||||
}
|
||||
|
||||
const num = (v, digits = 3) => (Math.abs(v) < 5e-7 ? 0 : v).toFixed(digits);
|
||||
|
||||
/**
|
||||
* The amount in Blender's header words, without the lock: "D: 0.500 (0.500)"
|
||||
* along a locked axis (`along` is the signed distance on it), "Dx: .. Dy: ..
|
||||
* Dz: .. (length)" otherwise, "Rot: 45.0°", "Scale: 1.200" or "Scale X: ..
|
||||
* Y: .. Z: ..". `value` is the move [x, y, z], the degrees, the factor, or
|
||||
* [dx, dy] degrees for the trackball.
|
||||
*/
|
||||
export function readout(mode, value, constraint = null, along = null) {
|
||||
if (mode === "grab") {
|
||||
const size = num(length(value));
|
||||
if (constraint?.kind === "axis" && along != null) return `D: ${num(along)} (${size})`;
|
||||
return `Dx: ${num(value[0])} Dy: ${num(value[1])} Dz: ${num(value[2])} (${size})`;
|
||||
}
|
||||
if (mode === "trackball") return `Trackball: ${num(value[0], 1)}° ${num(value[1], 1)}°`;
|
||||
if (mode === "rotate") return `Rot: ${num(value, 1)}°`;
|
||||
if (constraint) return `Scale: ${num(value)}`;
|
||||
return `Scale X: ${num(value)} Y: ${num(value)} Z: ${num(value)}`;
|
||||
}
|
||||
@@ -289,3 +289,86 @@ export function repointLinks(text, nodes, groups) {
|
||||
.replace(ARROW_RE, (all, _arrow, id) => (id === undefined ? all : `${all.slice(0, -id.length - 1)}${follow(`#${id}`)}`));
|
||||
return changed ? next : null;
|
||||
}
|
||||
|
||||
// Info card: a small card with a title, rows and small print, chosen from the
|
||||
// note's menu. Its text is the note's ordinary text with one addition: a line
|
||||
// with a | in it is a row, the words before it on the left and the rest on
|
||||
// the right. A row in **bold** is the one to notice and is drawn in teal. The
|
||||
// first line is the card's title; a clock, info, warning, bulb or tick emoji
|
||||
// at its start is drawn as a small icon. A plain callout reads none of this,
|
||||
// so every note written before looks as it did, and a release before this
|
||||
// one shows the card as a plain note with its rows written out.
|
||||
const CARD_ICONS = new Map([
|
||||
["⏱", "clock"], ["⏲", "clock"], ["⏰", "clock"], ["\u{1F552}", "clock"], ["⌛", "clock"], ["⏳", "clock"],
|
||||
["ℹ", "info"], ["⚠", "warning"], ["\u{1F4A1}", "tip"], ["✅", "check"], ["✔", "check"],
|
||||
]);
|
||||
const CARD_ICON_RE = new RegExp(`^(${[...CARD_ICONS.keys()].join("|")})${VS16}?\\s*`, "u");
|
||||
export const CARD_TEMPLATE = [
|
||||
"ℹ️ Title",
|
||||
`${SMALL_MARK}A line of small print under the title.`,
|
||||
"",
|
||||
"Label | value",
|
||||
"**The one to notice | value**",
|
||||
"",
|
||||
`${SMALL_MARK}A note at the bottom.`,
|
||||
].join("\n");
|
||||
|
||||
// Where a row splits: the first | that is not inside a link, or -1.
|
||||
function cellSplit(line) {
|
||||
const masked = line.replace(WORDS_LINK_RE, (all) => " ".repeat(all.length));
|
||||
return masked.indexOf("|");
|
||||
}
|
||||
|
||||
// A row's two sides, or null when the line is not a row. The outer pipes of
|
||||
// a pasted Markdown table row are dropped.
|
||||
export function cardCells(line) {
|
||||
const bare = String(line ?? "").trim().replace(/^\|/, "").replace(/\|$/, "");
|
||||
const at = cellSplit(bare);
|
||||
if (at < 0) return null;
|
||||
let label = bare.slice(0, at).trim();
|
||||
let value = bare.slice(at + 1).trim();
|
||||
if (!label || !value) return null;
|
||||
// **label | value** marks the whole row.
|
||||
if (label.startsWith("**") && !label.slice(2).includes("**") && value.endsWith("**") && !value.slice(0, -2).includes("**")) {
|
||||
label = `${label}**`;
|
||||
value = `**${value}`;
|
||||
}
|
||||
return [label, value];
|
||||
}
|
||||
|
||||
// Text -> blocks of lines. A line is { kind: "title", icon, pieces },
|
||||
// { kind: "row", cells: [pieces, pieces], highlight } or { kind: "text",
|
||||
// pieces }; small print carries `small: true`. A Markdown table's ---|---
|
||||
// line is dropped.
|
||||
export function parseCard(text) {
|
||||
const blocks = [];
|
||||
let lines = [];
|
||||
let first = true;
|
||||
const flush = () => {
|
||||
if (lines.length) blocks.push(lines);
|
||||
lines = [];
|
||||
};
|
||||
for (const raw of String(text ?? "").replace(/\r\n?/g, "\n").split("\n")) {
|
||||
const line = raw.replace(HEADING_RE, "").trim();
|
||||
if (!line) { flush(); continue; }
|
||||
if (/^\|?[\s:|-]*-[\s:|-]*\|?$/.test(line) && line.includes("|")) continue;
|
||||
const small = SMALL_RE.test(raw);
|
||||
const cells = cardCells(line);
|
||||
let item;
|
||||
if (first && !small && !cells) {
|
||||
const icon = CARD_ICON_RE.exec(line);
|
||||
item = { kind: "title", icon: icon ? CARD_ICONS.get(icon[1]) : null, pieces: pieces(icon ? line.slice(icon[0].length) : line) };
|
||||
} else if (cells) {
|
||||
const sides = cells.map((cell) => pieces(cell));
|
||||
const shown = sides.flat().filter((piece) => piece.arrow || piece.text?.trim());
|
||||
item = { kind: "row", cells: sides, highlight: shown.length > 0 && shown.every((piece) => piece.bold) };
|
||||
} else {
|
||||
item = { kind: "text", pieces: pieces(line) };
|
||||
}
|
||||
first = false;
|
||||
if (small) item.small = true;
|
||||
lines.push(item);
|
||||
}
|
||||
flush();
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@@ -9,28 +9,50 @@
|
||||
// in js/canvas_passthrough/ wires them to the page.
|
||||
|
||||
// The wheel belongs to the panel while it can still scroll that way (a long
|
||||
// text box, a list of rows), or while a text field has the keyboard.
|
||||
export function canScrollFurther(element, deltaY) {
|
||||
if (!element || !deltaY) return false;
|
||||
const room = element.scrollHeight - element.clientHeight;
|
||||
// text box, a list of rows). A text box with the cursor in it is no
|
||||
// exception: when it has nothing left to scroll, the wheel zooms the graph,
|
||||
// as it does over ComfyUI's own text boxes.
|
||||
export function canScrollFurther(element, delta, axis = "y") {
|
||||
if (!element || !delta) return false;
|
||||
const horizontal = axis === "x";
|
||||
const size = horizontal ? element.scrollWidth : element.scrollHeight;
|
||||
const visible = horizontal ? element.clientWidth : element.clientHeight;
|
||||
const start = horizontal ? element.scrollLeft : element.scrollTop;
|
||||
const room = size - visible;
|
||||
if (room <= 1) return false;
|
||||
return deltaY > 0 ? element.scrollTop + element.clientHeight < element.scrollHeight - 1 : element.scrollTop > 0;
|
||||
return delta > 0 ? start + visible < size - 1 : start > 0;
|
||||
}
|
||||
|
||||
// Does the wheel belong to something inside the panel, between the target
|
||||
// and the panel's own root? `styleOf` is getComputedStyle, passed in so this
|
||||
// stays testable without a page. `host` is the frontend's wrapper around the
|
||||
// panel: a pointer on the wrapper itself is on nothing inside the panel.
|
||||
export function panelKeepsWheel(target, event, { root, host, styleOf, activeElement }) {
|
||||
// Ctrl + wheel, which is also how a trackpad pinch arrives, always zooms the
|
||||
// graph; left to a scrolling box it would zoom the whole page.
|
||||
export function panelKeepsWheel(target, event, { root, host, styleOf }) {
|
||||
if (event.ctrlKey || event.metaKey) return false;
|
||||
for (let element = target; element && element !== root && element !== host; element = element.parentElement) {
|
||||
const tag = String(element.tagName ?? "").toUpperCase();
|
||||
if ((tag === "TEXTAREA" || tag === "INPUT") && element === activeElement) return true;
|
||||
const overflow = styleOf(element)?.overflowY;
|
||||
const style = styleOf(element);
|
||||
const overflow = style?.overflowY;
|
||||
if ((overflow === "auto" || overflow === "scroll") && canScrollFurther(element, event.deltaY)) return true;
|
||||
const overflowX = style?.overflowX;
|
||||
if ((overflowX === "auto" || overflowX === "scroll") && canScrollFurther(element, event.deltaX, "x")) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Nodes 2.0 hands every wheel turn over a node to the graph on its way down
|
||||
// to the node, before any part of the node sees it (only a focused core text
|
||||
// box is spared). A box of the pack's that can still scroll the way the wheel
|
||||
// turns has to claim the wheel before that. The classic renderer lets the box
|
||||
// see the wheel first, so there it needs no claim.
|
||||
export function vueBoxKeepsWheel(target, event, { styleOf }) {
|
||||
if (!target?.closest?.(".lg-node-widgets")) return false;
|
||||
const root = panelRoot(target);
|
||||
if (!root) return false;
|
||||
return panelKeepsWheel(target, event, { root, host: panelHost(target), styleOf });
|
||||
}
|
||||
|
||||
// Gestures that start over a panel and still mean "move the graph": the
|
||||
// middle button (pan), and Ctrl + Shift + left button (drag-zoom) when the
|
||||
// user has that shortcut switched on.
|
||||
|
||||
@@ -104,3 +104,119 @@ export function isCivitaiAddress(url) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- fetch all ----------
|
||||
// One button runs the same one-file lookup for every LoRA in a stack that has
|
||||
// no Civitai info yet: one file at a time, with a pause between files so
|
||||
// Civitai is not asked too fast. Nothing here talks to the network itself;
|
||||
// the caller hands in the lookup.
|
||||
|
||||
// The pause between two lookups, and the longer one after Civitai answers
|
||||
// 429 ("too many requests"). A second 429 ends the run.
|
||||
export const QUEUE_PAUSE_MS = 1500;
|
||||
export const SLOW_DOWN_PAUSE_MS = 20000;
|
||||
// This many failures in a row ends the run: something is wrong for all files.
|
||||
export const MAX_FAILURES_IN_A_ROW = 3;
|
||||
|
||||
// `names`: the stack's LoRA names (repeats and blanks are dropped).
|
||||
// `needsLookup(name)`: true when the file has no Civitai info yet; an error
|
||||
// means the file is missing, and it is left out.
|
||||
// `lookUp(name)`: false when Civitai does not know the file, else
|
||||
// `{ picture }` ("saved" when a picture was saved). An error with
|
||||
// `status: 429` means slow down; a TypeError means Civitai cannot be reached.
|
||||
// `wait(ms)`: a pause; it may end early once `shouldStop()` is true.
|
||||
// `onProgress({ done, total, name })`: total is null while files are checked.
|
||||
export async function runCivitaiQueue(names, {
|
||||
needsLookup, lookUp, wait, shouldStop = () => false, onProgress = () => {},
|
||||
pauseMs = QUEUE_PAUSE_MS, slowDownMs = SLOW_DOWN_PAUSE_MS,
|
||||
}) {
|
||||
const result = {
|
||||
total: 0, done: 0, found: 0, pictures: 0, notFound: 0, failed: 0,
|
||||
alreadyHad: 0, missing: 0, stopped: null, error: null,
|
||||
};
|
||||
const unique = [...new Set((names ?? []).filter((name) => typeof name === "string" && name))];
|
||||
const todo = [];
|
||||
onProgress({ done: 0, total: null, name: null });
|
||||
for (const name of unique) {
|
||||
if (shouldStop()) { result.stopped = "you"; return result; }
|
||||
try {
|
||||
if (await needsLookup(name)) todo.push(name);
|
||||
else result.alreadyHad += 1;
|
||||
} catch {
|
||||
result.missing += 1;
|
||||
}
|
||||
}
|
||||
result.total = todo.length;
|
||||
onProgress({ done: 0, total: result.total, name: null });
|
||||
let failuresInRow = 0;
|
||||
for (const name of todo) {
|
||||
if (result.done > 0) await wait(pauseMs);
|
||||
if (shouldStop()) { result.stopped = "you"; return result; }
|
||||
let slowedDown = false;
|
||||
for (;;) {
|
||||
try {
|
||||
const answer = await lookUp(name);
|
||||
if (answer) {
|
||||
result.found += 1;
|
||||
if (answer.picture === "saved") result.pictures += 1;
|
||||
} else {
|
||||
result.notFound += 1;
|
||||
}
|
||||
failuresInRow = 0;
|
||||
break;
|
||||
} catch (error) {
|
||||
if (error?.status === 429 && !slowedDown) {
|
||||
slowedDown = true;
|
||||
await wait(slowDownMs);
|
||||
if (shouldStop()) { result.stopped = "you"; return result; }
|
||||
continue;
|
||||
}
|
||||
result.error = error;
|
||||
if (error?.status === 429) { result.stopped = "slow down"; return result; }
|
||||
if (error instanceof TypeError) { result.stopped = "unreachable"; return result; }
|
||||
result.failed += 1;
|
||||
failuresInRow += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result.done += 1;
|
||||
onProgress({ done: result.done, total: result.total, name });
|
||||
if (failuresInRow >= MAX_FAILURES_IN_A_ROW) { result.stopped = "failures"; return result; }
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// The run's button while it works: where it is, and that a click stops it.
|
||||
export function civitaiQueueLabel(done, total) {
|
||||
return total == null ? "Civitai: checking · Stop" : `Civitai ${done} / ${total} · Stop`;
|
||||
}
|
||||
|
||||
const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
|
||||
|
||||
// What the run did, in one or two plain sentences for the closing message.
|
||||
export function civitaiQueueSummary(result) {
|
||||
if (!result.total && !result.stopped) {
|
||||
if (result.alreadyHad && !result.missing) return "Every LoRA in this stack already has its Civitai info.";
|
||||
if (!result.alreadyHad && !result.missing) return "This stack has no LoRAs to look up.";
|
||||
}
|
||||
const parts = [];
|
||||
if (result.found) {
|
||||
parts.push(`found ${plural(result.found, "LoRA")}`
|
||||
+ (result.pictures ? ` (${plural(result.pictures, "new picture")})` : ""));
|
||||
}
|
||||
if (result.notFound) parts.push(`${result.notFound} not on Civitai`);
|
||||
if (result.failed) parts.push(`${result.failed} failed`);
|
||||
if (result.alreadyHad) parts.push(`${result.alreadyHad} already had info`);
|
||||
if (result.missing) parts.push(`${plural(result.missing, "file")} not found on disk`);
|
||||
let text = parts.length ? `Civitai: ${parts.join(", ")}.` : "Civitai: nothing fetched.";
|
||||
const left = result.total - result.done;
|
||||
if (result.stopped === "you") text += ` Stopped with ${left} left.`;
|
||||
else if (result.stopped === "slow down") {
|
||||
text += ` Civitai asked us to slow down, so it stopped with ${left} left. Try again in a few minutes.`;
|
||||
} else if (result.stopped === "unreachable") text += ` ${civitaiFailureText(result.error)}`;
|
||||
else if (result.failed && !result.stopped) text += ` Last failure: ${civitaiFailureText(result.error)}`;
|
||||
else if (result.stopped === "failures") {
|
||||
text += ` Stopped after ${MAX_FAILURES_IN_A_ROW} failures in a row: ${civitaiFailureText(result.error)}`;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
+64
-16
@@ -1,30 +1,78 @@
|
||||
// Read only literal numeric sources. Calculated inputs must remain unknown
|
||||
// until execution; never evaluate an arbitrary upstream graph for a label.
|
||||
export function inputNumber(node, name, fallback) {
|
||||
const input = node.inputs?.find((slot) => slot.name === name || slot.widget?.name === name);
|
||||
if (input?.link == null) return fallback;
|
||||
const graph = node.graph;
|
||||
let linkId = input.link;
|
||||
// A subgraph's output that comes straight from a literal inside it (Person
|
||||
// Swap's "Pick the model files" hands out its video fps that way) counts as
|
||||
// that literal: it is still a typed number, not a calculation.
|
||||
function tableLink(graph, id) {
|
||||
if (id == null || !graph) return null;
|
||||
return graph.getLink?.(id) ?? graph.links?.get?.(id) ?? graph.links?.[id] ?? graph._links?.get?.(id) ?? null;
|
||||
}
|
||||
|
||||
// The link into one of a node's inputs: the frontend's own accessor first
|
||||
// (newer frontends warn on reading input.link), the link table after it.
|
||||
// undefined when nothing is connected.
|
||||
function linkInto(node, index, graph) {
|
||||
if (typeof node?.getInputLink === "function" && node.graph) {
|
||||
try {
|
||||
return node.getInputLink(index) ?? undefined;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
const id = node?.inputs?.[index]?.link;
|
||||
return id == null ? undefined : tableLink(node.graph ?? graph, id);
|
||||
}
|
||||
|
||||
// Where a linked input really comes from: the node and output slot at the
|
||||
// far end, through Reroutes and into a subgraph whose output is wired
|
||||
// straight to a node inside it. null for a muted or bypassed source, a loop,
|
||||
// or a subgraph output with nothing behind it. undefined when the input is
|
||||
// not linked at all.
|
||||
export function linkOrigin(node, name) {
|
||||
const index = node?.inputs?.findIndex((slot) => slot?.name === name || slot?.widget?.name === name) ?? -1;
|
||||
if (index < 0) return undefined;
|
||||
let graph = node.graph;
|
||||
let link = linkInto(node, index, graph);
|
||||
if (link === undefined) return undefined;
|
||||
const seen = new Set();
|
||||
for (let depth = 0; depth < 16; depth++) {
|
||||
if (seen.has(linkId)) return null;
|
||||
seen.add(linkId);
|
||||
const link = graph?.links?.[linkId] ?? graph?._links?.get?.(linkId);
|
||||
const source = graph?.getNodeById?.(link?.origin_id);
|
||||
if (!link || seen.has(link)) return null;
|
||||
seen.add(link);
|
||||
const source = graph?.getNodeById?.(link.origin_id);
|
||||
if (!source || (source.mode ?? 0) !== 0) return null;
|
||||
if (source.type === "Reroute") {
|
||||
linkId = source.inputs?.[0]?.link;
|
||||
if (linkId == null) return null;
|
||||
if ((source.comfyClass ?? source.type) === "Reroute") {
|
||||
link = linkInto(source, 0, graph) ?? null;
|
||||
continue;
|
||||
}
|
||||
if (!["PrimitiveFloat", "PrimitiveInt", "AUSBOSS_NODES_Integer", "AUSBOSS_NODES_Float"].includes(source.type) || link.origin_slot !== 0) return null;
|
||||
if (source.inputs?.some((slot) => slot.name === "value" && slot.link != null)) return null;
|
||||
const value = source.widgets?.find((widget) => widget.name === "value")?.value;
|
||||
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
||||
const inner = source.subgraph;
|
||||
if (inner && typeof source.isSubgraphNode === "function" && source.isSubgraphNode()) {
|
||||
link = tableLink(inner, inner.outputs?.[link.origin_slot]?.linkIds?.[0]);
|
||||
graph = inner;
|
||||
continue;
|
||||
}
|
||||
return { node: source, slot: link.origin_slot };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
const LITERALS = ["PrimitiveFloat", "PrimitiveInt", "AUSBOSS_NODES_Integer", "AUSBOSS_NODES_Float"];
|
||||
|
||||
export function inputNumber(node, name, fallback) {
|
||||
const origin = linkOrigin(node, name);
|
||||
if (origin === undefined) return fallback;
|
||||
if (!origin) return null;
|
||||
const { node: source, slot } = origin;
|
||||
// ComfyUI's older Primitive node holds the value of the widget it feeds.
|
||||
if ((source.comfyClass ?? source.type) === "PrimitiveNode") {
|
||||
const value = source.widgets?.[0]?.value;
|
||||
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
||||
}
|
||||
if (!LITERALS.includes(source.type) || slot !== 0) return null;
|
||||
if (source.inputs?.some((input) => input.name === "value" && input.link != null)) return null;
|
||||
const value = source.widgets?.find((widget) => widget.name === "value")?.value;
|
||||
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
||||
}
|
||||
|
||||
export function clipOutputRate(node, sourceFps, everyNth = 1) {
|
||||
const forced = inputNumber(node, "force_rate", 0);
|
||||
const nth = inputNumber(node, "every_nth", everyNth);
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
// The clip window: the part of the video a run uses, as one box on a strip
|
||||
// of pictures from the video, under a player that plays only that part on a
|
||||
// loop. Drag the box to pick where the clip starts; drag an edge to make it
|
||||
// shorter or longer, never past min_seconds / max_seconds. While a drag is
|
||||
// live the player shows the frame under the edge being moved. Made for an App-mode form, where it is the only control a
|
||||
// person sees for the clip node: the node keeps it hidden on the graph and
|
||||
// js/app_mode/ lends it to the form when the form lists it.
|
||||
//
|
||||
// It reads and writes the node's own values (start_seconds, max_frames,
|
||||
// end_seconds), the way the node's timeline does, so both always agree. The
|
||||
// arithmetic lives in timeline_math.mjs (clipWindowOf, dragClipWindow).
|
||||
import { THEME, FONT_UI, RADIUS_CONTROL } from "./theme.mjs";
|
||||
import { formatTimecode } from "./timecode.mjs";
|
||||
import {
|
||||
clipInfo,
|
||||
clipWindowOf,
|
||||
clipWindowValues,
|
||||
dragClipWindow,
|
||||
lengthLimits,
|
||||
limitFrameRange,
|
||||
loopPlayhead,
|
||||
} from "./timeline_math.mjs";
|
||||
|
||||
const CSS_ID = "ausboss-clip-window-css-v2";
|
||||
const EDGE_HIT_PX = 14;
|
||||
const STRIP_HEIGHT = 58;
|
||||
const PLAYER_MAX_HEIGHT = 240;
|
||||
// Inputs that, when connected, set the clip on the graph instead.
|
||||
const GRAPH_SET = ["start_seconds", "start_frame", "end_frame", "end_seconds", "fixed_frames", "frame_load_cap", "max_frames", "every_nth"];
|
||||
|
||||
function installCss() {
|
||||
if (document.getElementById(CSS_ID)) return;
|
||||
const style = document.createElement("style");
|
||||
style.id = CSS_ID;
|
||||
style.textContent = `
|
||||
.ausboss-clip-window{display:flex;flex-direction:column;gap:6px;box-sizing:border-box;width:100%;min-width:0;overflow:hidden;padding:2px 0 4px;color:${THEME.inkSoft};font:13px ${FONT_UI}}
|
||||
.ausboss-clip-window-head{display:flex;align-items:baseline;gap:6px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:${THEME.label}}
|
||||
.ausboss-clip-window-head b{color:${THEME.ink};font-weight:600}
|
||||
.ausboss-clip-window-strip{position:relative;height:${STRIP_HEIGHT}px;margin:0 9px;border-radius:${RADIUS_CONTROL}px;background:${THEME.well};touch-action:none;user-select:none;cursor:pointer}
|
||||
.ausboss-clip-window-strip.is-off{cursor:default}
|
||||
.ausboss-clip-window-thumbs{position:absolute;inset:0;width:100%;height:100%;border-radius:${RADIUS_CONTROL}px;pointer-events:none}
|
||||
.ausboss-clip-window-shade{position:absolute;top:0;bottom:0;background:rgba(8,9,10,.68);pointer-events:none}
|
||||
.ausboss-clip-window-box{position:absolute;top:-3px;bottom:-3px;box-sizing:border-box;border:3px solid ${THEME.brand};border-radius:${RADIUS_CONTROL}px;cursor:grab;outline:none}
|
||||
.ausboss-clip-window-box:focus-visible{box-shadow:0 0 0 2px ${THEME.ink}}
|
||||
.ausboss-clip-window-strip.is-moving .ausboss-clip-window-box{cursor:grabbing}
|
||||
.ausboss-clip-window-box[hidden]{display:none}
|
||||
.ausboss-clip-window-edge{position:absolute;top:50%;width:9px;height:26px;margin-top:-13px;border-radius:3px;background:${THEME.brand};cursor:ew-resize}
|
||||
.ausboss-clip-window-edge.start{left:-6px}
|
||||
.ausboss-clip-window-edge.end{right:-6px}
|
||||
.ausboss-clip-window-box.is-whole{cursor:default}
|
||||
.ausboss-clip-window-box.is-whole .ausboss-clip-window-edge{display:none}
|
||||
.ausboss-clip-window-empty{position:absolute;inset:0;display:grid;place-items:center;color:${THEME.faint};pointer-events:none}
|
||||
.ausboss-clip-window-empty[hidden],.ausboss-clip-window-shade[hidden]{display:none}
|
||||
.ausboss-clip-window-readout{color:${THEME.brandInk};font-weight:600;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.ausboss-clip-window-hint{color:${THEME.faint};font-size:12px;line-height:1.4}
|
||||
.ausboss-clip-window-hint.is-stop{color:${THEME.warnInk}}
|
||||
.ausboss-clip-window-player{position:relative;width:100%;max-height:${PLAYER_MAX_HEIGHT}px;aspect-ratio:16/9;margin:0 auto;border-radius:${RADIUS_CONTROL}px;background:${THEME.well};overflow:hidden;cursor:pointer}
|
||||
.ausboss-clip-window-player[hidden]{display:none}
|
||||
.ausboss-clip-window-player video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
|
||||
.ausboss-clip-window-play{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;background:rgba(8,9,10,.62);pointer-events:none;opacity:0;transition:opacity .15s}
|
||||
.ausboss-clip-window-play::after{content:"";position:absolute;left:18px;top:14px;border-style:solid;border-width:9px 0 9px 14px;border-color:transparent transparent transparent ${THEME.ink}}
|
||||
.ausboss-clip-window-player.is-paused .ausboss-clip-window-play{opacity:1}
|
||||
.ausboss-clip-window-playhead{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background:${THEME.ink};box-shadow:0 0 0 1px rgba(8,9,10,.5);pointer-events:none}
|
||||
.ausboss-clip-window-playhead[hidden]{display:none}
|
||||
`;
|
||||
document.head.append(style);
|
||||
}
|
||||
|
||||
function el(tag, className = "", text = "") {
|
||||
const item = document.createElement(tag);
|
||||
if (className) item.className = className;
|
||||
if (text) item.textContent = text;
|
||||
return item;
|
||||
}
|
||||
|
||||
const secondsText = (value) => String(Number((Number(value) || 0).toFixed(1)));
|
||||
// A length in the readout keeps its tenth: "8.0 s used".
|
||||
const lengthText = (value) => (Number(value) || 0).toFixed(1);
|
||||
|
||||
// options:
|
||||
// get(name, fallback) / set(name, value) widget access
|
||||
// driven(name) whether an input is linked
|
||||
// number(name, fallback) a linked literal's value, null when only the run knows it
|
||||
// outputRate() output fps, null when unknown
|
||||
// metadata() the source's {fps, frame_count, duration}
|
||||
// storyboard() {image, times, tileWidth, tileHeight} or null
|
||||
// videoUrl() the source video for the player, "" for none
|
||||
// onCommit() a drag settled (undo point)
|
||||
export function mountClipWindow({ get, set, driven = () => false, number = (name, fallback) => get(name, fallback), outputRate = () => null, metadata, storyboard = () => null, videoUrl = () => "", onCommit }) {
|
||||
installCss();
|
||||
const root = el("div", "ausboss-clip-window");
|
||||
const head = el("div", "ausboss-clip-window-head");
|
||||
const strip = el("div", "ausboss-clip-window-strip");
|
||||
const thumbs = el("canvas", "ausboss-clip-window-thumbs");
|
||||
const shadeLeft = el("div", "ausboss-clip-window-shade");
|
||||
const shadeRight = el("div", "ausboss-clip-window-shade");
|
||||
const box = el("div", "ausboss-clip-window-box");
|
||||
box.tabIndex = 0;
|
||||
box.setAttribute("role", "slider");
|
||||
box.setAttribute("aria-label", "Part of the video to use");
|
||||
const edgeStart = el("span", "ausboss-clip-window-edge start");
|
||||
const edgeEnd = el("span", "ausboss-clip-window-edge end");
|
||||
box.append(edgeStart, edgeEnd);
|
||||
const empty = el("div", "ausboss-clip-window-empty", "Choose a video first");
|
||||
const playhead = el("div", "ausboss-clip-window-playhead");
|
||||
playhead.hidden = true;
|
||||
strip.append(thumbs, shadeLeft, shadeRight, box, playhead, empty);
|
||||
const readout = el("div", "ausboss-clip-window-readout");
|
||||
const hint = el("div", "ausboss-clip-window-hint");
|
||||
// The player: muted, plays the picked part on a loop, a click pauses it.
|
||||
const player = el("div", "ausboss-clip-window-player is-paused");
|
||||
player.hidden = true;
|
||||
player.title = "Click to play or pause";
|
||||
const video = document.createElement("video");
|
||||
video.muted = true;
|
||||
video.playsInline = true;
|
||||
video.preload = "auto";
|
||||
video.disablePictureInPicture = true;
|
||||
player.append(video, el("span", "ausboss-clip-window-play"));
|
||||
root.append(player, head, strip, readout, hint);
|
||||
|
||||
const info = () => clipInfo(metadata());
|
||||
const limits = () => lengthLimits(number("min_seconds", get("min_seconds", 0)) ?? 0, number("max_seconds", get("max_seconds", 0)) ?? 0);
|
||||
const nth = () => Math.max(1, Math.trunc(Number(get("every_nth", 1)) || 1));
|
||||
const rate = () => {
|
||||
const known = outputRate?.();
|
||||
if (known > 0) return known;
|
||||
const clip = info();
|
||||
return clip.fps > 0 ? clip.fps / nth() : 0;
|
||||
};
|
||||
// The clip is set on the graph (a connected input, or an exact Fixed
|
||||
// frames count): the window shows nothing it cannot honour.
|
||||
const setOnGraph = () => GRAPH_SET.some((name) => driven(name)) || Number(get("fixed_frames", 0)) > 0;
|
||||
const current = () => clipWindowOf(info(), {
|
||||
start: get("start_seconds", 0),
|
||||
end: get("end_seconds", 0),
|
||||
cap: get("max_frames", 0),
|
||||
rate: rate(),
|
||||
}, limits());
|
||||
|
||||
const rangeWords = () => {
|
||||
const { min, max } = limits();
|
||||
if (min > 0 && max > 0) return min === max ? `${secondsText(min)} s` : `${secondsText(min)} to ${secondsText(max)} s`;
|
||||
if (max > 0) return `up to ${secondsText(max)} s`;
|
||||
if (min > 0) return `at least ${secondsText(min)} s`;
|
||||
return "";
|
||||
};
|
||||
|
||||
let stopText = "";
|
||||
let thumbsKey = "";
|
||||
const drawThumbs = () => {
|
||||
const clip = info();
|
||||
const board = storyboard?.();
|
||||
const width = Math.round(strip.clientWidth);
|
||||
const height = Math.round(strip.clientHeight);
|
||||
const key = `${width}x${height}:${board?.image?.src?.length ?? 0}:${board?.times?.length ?? 0}:${clip.duration}`;
|
||||
if (key === thumbsKey) return;
|
||||
thumbsKey = key;
|
||||
const scale = Math.min(2, window.devicePixelRatio || 1);
|
||||
thumbs.width = Math.max(1, Math.round(width * scale));
|
||||
thumbs.height = Math.max(1, Math.round(height * scale));
|
||||
const context = thumbs.getContext("2d");
|
||||
if (!context) return;
|
||||
context.clearRect(0, 0, thumbs.width, thumbs.height);
|
||||
if (!board?.image || !board.times?.length || !(clip.duration > 0) || !width) return;
|
||||
// Cells as wide as a tile drawn at the strip's height, each showing the
|
||||
// tile nearest its middle.
|
||||
const cellWidth = Math.max(24, (board.tileWidth / board.tileHeight) * height);
|
||||
const cells = Math.max(1, Math.ceil(width / cellWidth));
|
||||
const cell = thumbs.width / cells;
|
||||
for (let index = 0; index < cells; index++) {
|
||||
const moment = ((index + 0.5) / cells) * clip.duration;
|
||||
let tile = 0;
|
||||
for (let other = 1; other < board.times.length; other++) {
|
||||
if (Math.abs(board.times[other] - moment) < Math.abs(board.times[tile] - moment)) tile = other;
|
||||
}
|
||||
// Cover the cell: crop the tile's sides to the cell's shape.
|
||||
const sourceWidth = Math.min(board.tileWidth, (cell / thumbs.height) * board.tileHeight);
|
||||
const sourceX = tile * board.tileWidth + (board.tileWidth - sourceWidth) / 2;
|
||||
context.drawImage(board.image, sourceX, 0, sourceWidth, board.tileHeight, Math.floor(index * cell), 0, Math.ceil(cell), thumbs.height);
|
||||
}
|
||||
};
|
||||
|
||||
const sync = () => {
|
||||
const clip = info();
|
||||
const window = clip.count ? current() : null;
|
||||
const off = !window || setOnGraph();
|
||||
strip.classList.toggle("is-off", off);
|
||||
empty.hidden = Boolean(window);
|
||||
box.hidden = !window;
|
||||
shadeLeft.hidden = shadeRight.hidden = !window;
|
||||
const range = rangeWords();
|
||||
if (!clip.count) {
|
||||
head.textContent = "";
|
||||
readout.textContent = "";
|
||||
hint.textContent = range ? `The clip will be ${range} long.` : "";
|
||||
hint.classList.remove("is-stop");
|
||||
thumbsKey = "";
|
||||
drawThumbs();
|
||||
syncPlayer();
|
||||
return;
|
||||
}
|
||||
head.replaceChildren(el("b", "", `Your video: ${secondsText(clip.duration)} s long`));
|
||||
if (range) head.append(document.createTextNode(`· the clip is ${range} long`));
|
||||
if (!window) {
|
||||
readout.textContent = "";
|
||||
hint.textContent = "The clip length is known once the graph runs.";
|
||||
syncPlayer();
|
||||
return;
|
||||
}
|
||||
const duration = clip.duration || clip.count / clip.fps;
|
||||
const left = Math.max(0, Math.min(1, window.start / duration));
|
||||
const right = Math.max(left, Math.min(1, (window.start + window.seconds) / duration));
|
||||
box.style.left = `${(left * 100).toFixed(3)}%`;
|
||||
box.style.width = `${((right - left) * 100).toFixed(3)}%`;
|
||||
shadeLeft.style.left = "0";
|
||||
shadeLeft.style.width = `${(left * 100).toFixed(3)}%`;
|
||||
shadeRight.style.left = `${(right * 100).toFixed(3)}%`;
|
||||
shadeRight.style.right = "0";
|
||||
box.classList.toggle("is-whole", window.whole || off);
|
||||
box.setAttribute("aria-valuemin", "0");
|
||||
box.setAttribute("aria-valuemax", String(Number(duration.toFixed(2))));
|
||||
box.setAttribute("aria-valuenow", String(Number(window.start.toFixed(2))));
|
||||
box.setAttribute("aria-valuetext", `${secondsText(window.seconds)} seconds from ${formatTimecode(window.start)}`);
|
||||
readout.textContent = window.whole
|
||||
? `The whole video is used: ${lengthText(window.seconds)} s`
|
||||
: `${lengthText(window.seconds)} s used, starting at ${formatTimecode(Math.round(window.start * 10) / 10)}`;
|
||||
hint.classList.toggle("is-stop", Boolean(stopText));
|
||||
if (off) hint.textContent = "This clip is set on the graph, so it cannot be moved here.";
|
||||
else if (window.whole) hint.textContent = `The video is shorter than ${secondsText(limits().min)} s, so all of it is used.`;
|
||||
else if (stopText) hint.textContent = stopText;
|
||||
else hint.textContent = range
|
||||
? `Drag the box to pick where it starts. Drag an edge to shorten it, never under ${secondsText(limits().min || 0)} s or over ${secondsText(limits().max || duration)} s.`
|
||||
: "Drag the box to pick where it starts. Drag an edge to change its length.";
|
||||
drawThumbs();
|
||||
syncPlayer();
|
||||
};
|
||||
|
||||
// --- player ---------------------------------------------------------------
|
||||
let playerUrl = "";
|
||||
let wantPlay = true; // the person's play/pause choice; a drag only pauses for its length
|
||||
let onScreen = false;
|
||||
let frameRequest = 0;
|
||||
const playable = () => Boolean(playerUrl) && !player.hidden;
|
||||
const showPlayhead = () => {
|
||||
const clip = info();
|
||||
const duration = clip.duration || (clip.fps ? clip.count / clip.fps : 0);
|
||||
playhead.hidden = !playable() || !(duration > 0) || !(video.readyState >= 1);
|
||||
if (!playhead.hidden) playhead.style.left = `${(Math.max(0, Math.min(1, video.currentTime / duration)) * 100).toFixed(3)}%`;
|
||||
};
|
||||
const seek = (seconds) => {
|
||||
if (!(video.readyState >= 1) || !Number.isFinite(seconds)) return;
|
||||
if (Math.abs(video.currentTime - seconds) > 0.01) video.currentTime = Math.max(0, seconds);
|
||||
showPlayhead();
|
||||
};
|
||||
// Keeps the playhead inside the picked part while it plays.
|
||||
const tick = () => {
|
||||
frameRequest = 0;
|
||||
if (video.paused || !onScreen) return;
|
||||
const window = info().count ? current() : null;
|
||||
if (window && !drag) {
|
||||
const next = loopPlayhead(video.currentTime, window.start, window.seconds);
|
||||
if (next !== video.currentTime) video.currentTime = next;
|
||||
}
|
||||
showPlayhead();
|
||||
frameRequest = requestAnimationFrame(tick);
|
||||
};
|
||||
const play = () => {
|
||||
if (!playable() || !onScreen || drag || !wantPlay) return;
|
||||
const window = info().count ? current() : null;
|
||||
if (window) seek(loopPlayhead(video.currentTime, window.start, window.seconds));
|
||||
video.play().catch(() => { /* not ready or not allowed: stays paused */ });
|
||||
};
|
||||
const pause = () => { if (!video.paused) video.pause(); };
|
||||
video.addEventListener("play", () => { player.classList.remove("is-paused"); if (!frameRequest) frameRequest = requestAnimationFrame(tick); });
|
||||
video.addEventListener("pause", () => player.classList.add("is-paused"));
|
||||
video.addEventListener("loadedmetadata", () => {
|
||||
if (video.videoWidth > 0 && video.videoHeight > 0) player.style.aspectRatio = `${video.videoWidth} / ${video.videoHeight}`;
|
||||
const window = info().count ? current() : null;
|
||||
if (window) seek(window.start);
|
||||
play();
|
||||
});
|
||||
// A file the browser cannot play: no player, the strip still works.
|
||||
video.addEventListener("error", () => { player.hidden = true; playhead.hidden = true; });
|
||||
player.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
wantPlay = video.paused;
|
||||
if (wantPlay) play(); else pause();
|
||||
});
|
||||
// Plays only while it can be seen: hidden on the graph, it stays still.
|
||||
new IntersectionObserver((entries) => {
|
||||
onScreen = entries.some((entry) => entry.isIntersecting);
|
||||
if (onScreen) play(); else pause();
|
||||
}).observe(player);
|
||||
const syncPlayer = () => {
|
||||
const url = info().count ? String(videoUrl?.() || "") : "";
|
||||
if (url !== playerUrl) {
|
||||
playerUrl = url;
|
||||
player.hidden = !url;
|
||||
playhead.hidden = true;
|
||||
if (url) { video.src = url; video.load(); } else { video.removeAttribute("src"); video.load(); }
|
||||
}
|
||||
if (!playable()) return;
|
||||
const window = info().count ? current() : null;
|
||||
if (window && !drag && !video.paused) {
|
||||
const next = loopPlayhead(video.currentTime, window.start, window.seconds);
|
||||
if (next !== video.currentTime) seek(next);
|
||||
}
|
||||
showPlayhead();
|
||||
};
|
||||
|
||||
const store = (window) => {
|
||||
const values = clipWindowValues(window, info());
|
||||
if (!driven("fixed_frames") && Number(get("fixed_frames", 0)) !== 0) set("fixed_frames", 0);
|
||||
set("start_seconds", values.start_seconds);
|
||||
set("end_seconds", values.end_seconds);
|
||||
set("max_frames", values.max_frames);
|
||||
};
|
||||
|
||||
// Why a drag stopped short of the pointer, in words.
|
||||
const stopWords = (zone, wanted, got) => {
|
||||
if (zone === "move" || Math.abs(wanted - got) < 0.5 / Math.max(1, rate())) return "";
|
||||
const range = limitFrameRange(limits(), rate());
|
||||
const frames = Math.round(got * rate());
|
||||
if (frames >= range.max) return `${secondsText(got)} s is the longest it can be.`;
|
||||
if (frames <= range.min) return `${secondsText(got)} s is the shortest it can be.`;
|
||||
return "The video ends there.";
|
||||
};
|
||||
|
||||
// --- gestures ---------------------------------------------------------------
|
||||
let drag = null;
|
||||
const secondsAt = (event) => {
|
||||
const rect = strip.getBoundingClientRect();
|
||||
const clip = info();
|
||||
const duration = clip.duration || (clip.fps ? clip.count / clip.fps : 0);
|
||||
const x = Math.max(0, Math.min(rect.width, event.clientX - rect.left));
|
||||
return { seconds: rect.width > 0 ? (x / rect.width) * duration : 0, x, width: rect.width, duration };
|
||||
};
|
||||
const apply = (event, settled) => {
|
||||
if (!drag) return;
|
||||
const { seconds } = secondsAt(event);
|
||||
const target = drag.zone === "move" ? seconds - drag.grab : seconds;
|
||||
const next = dragClipWindow(drag.base, drag.zone, target, info(), limits());
|
||||
if (!next) return;
|
||||
const wantedLength = drag.zone === "end" ? seconds - drag.base.start
|
||||
: drag.zone === "start" ? drag.base.start + drag.base.seconds - seconds : next.seconds;
|
||||
stopText = stopWords(drag.zone, wantedLength, next.seconds);
|
||||
store(next);
|
||||
sync();
|
||||
if (playable()) seek(settled || drag.zone !== "end" ? next.start : Math.max(next.start, next.start + next.seconds - 1 / Math.max(1, rate())));
|
||||
if (settled) {
|
||||
onCommit?.();
|
||||
stopText = "";
|
||||
setTimeout(sync, 1600);
|
||||
}
|
||||
};
|
||||
strip.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0) return;
|
||||
const window = info().count && !setOnGraph() ? current() : null;
|
||||
if (!window || window.whole) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const { seconds, width, duration } = secondsAt(event);
|
||||
const pxPerSecond = duration > 0 ? width / duration : 0;
|
||||
const startX = window.start * pxPerSecond;
|
||||
const endX = (window.start + window.seconds) * pxPerSecond;
|
||||
const x = seconds * pxPerSecond;
|
||||
const nearStart = Math.abs(x - startX) <= EDGE_HIT_PX;
|
||||
const nearEnd = Math.abs(x - endX) <= EDGE_HIT_PX;
|
||||
let zone;
|
||||
if (nearStart || nearEnd) zone = nearStart && nearEnd ? (x < (startX + endX) / 2 ? "start" : "end") : nearStart ? "start" : "end";
|
||||
else zone = "move";
|
||||
// A press outside the box brings the box there, centred on the press.
|
||||
const inside = x > startX && x < endX;
|
||||
const grab = zone !== "move" ? 0 : inside ? seconds - window.start : window.seconds / 2;
|
||||
drag = { zone, grab, base: window, pointerId: event.pointerId };
|
||||
pause();
|
||||
strip.classList.toggle("is-moving", zone === "move");
|
||||
box.focus({ preventScroll: true });
|
||||
try { strip.setPointerCapture(event.pointerId); } catch { /* mouse fallback */ }
|
||||
apply(event, false);
|
||||
});
|
||||
strip.addEventListener("pointermove", (event) => {
|
||||
if (!drag) {
|
||||
const window = info().count && !setOnGraph() ? current() : null;
|
||||
if (!window || window.whole) { strip.style.cursor = ""; return; }
|
||||
const { seconds, width, duration } = secondsAt(event);
|
||||
const px = duration > 0 ? width / duration : 0;
|
||||
const near = Math.min(Math.abs(seconds - window.start), Math.abs(seconds - window.start - window.seconds)) * px <= EDGE_HIT_PX;
|
||||
strip.style.cursor = near ? "ew-resize" : "grab";
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
apply(event, false);
|
||||
});
|
||||
const finish = (event) => {
|
||||
if (!drag) return;
|
||||
if (event) apply(event, true);
|
||||
else onCommit?.();
|
||||
try { if (strip.hasPointerCapture(drag.pointerId)) strip.releasePointerCapture(drag.pointerId); } catch { /* released already */ }
|
||||
drag = null;
|
||||
strip.classList.remove("is-moving");
|
||||
play();
|
||||
};
|
||||
strip.addEventListener("pointerup", (event) => { event.stopPropagation(); finish(event); });
|
||||
strip.addEventListener("pointercancel", () => finish(null));
|
||||
strip.addEventListener("lostpointercapture", () => finish(null));
|
||||
|
||||
// Arrow keys slide the box a second at a time; Shift moves one frame.
|
||||
box.addEventListener("keydown", (event) => {
|
||||
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
|
||||
const window = info().count && !setOnGraph() ? current() : null;
|
||||
if (!window || window.whole) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const clip = info();
|
||||
const step = event.shiftKey && clip.fps > 0 ? 1 / clip.fps : 1;
|
||||
const target = event.key === "Home" ? 0 : event.key === "End" ? Infinity
|
||||
: window.start + (event.key === "ArrowLeft" ? -step : step);
|
||||
const moved = dragClipWindow(window, "move", Number.isFinite(target) ? target : clip.duration, clip, limits());
|
||||
store(moved);
|
||||
sync();
|
||||
if (moved && playable()) seek(moved.start);
|
||||
onCommit?.();
|
||||
});
|
||||
|
||||
new ResizeObserver(() => drawThumbs()).observe(strip);
|
||||
sync();
|
||||
return { root, sync };
|
||||
}
|
||||
+42
-6
@@ -131,6 +131,21 @@ export function compareBadges(fraction, stageWidth, badgeWidth = 22, gap = 5) {
|
||||
return { a: a >= 4 ? a : null, b: b + badgeWidth <= width - 4 ? b : null };
|
||||
}
|
||||
|
||||
// The node property that holds the picture the panel rests on: "A" or "B",
|
||||
// saved with the workflow. A new node rests on B, the "after" picture.
|
||||
export const REST_PROPERTY = "ausboss_compare_rest";
|
||||
|
||||
// A saved resting side, or null when the node has none yet (a workflow
|
||||
// saved before the choice existed).
|
||||
export function savedRestSide(value) {
|
||||
return value === "A" || value === "B" ? value : null;
|
||||
}
|
||||
|
||||
// Node types that hand on one of their pictures and make nothing new.
|
||||
export const SWITCH_NODE_TYPES = new Set(["ComfySwitchNode", "ComfySoftSwitchNode", "AUSBOSS_NODES_Switch"]);
|
||||
// The inputs of a switch that choose a branch rather than carry a picture.
|
||||
export const SWITCH_CONTROL_INPUTS = new Set(["switch", "select", "boolean", "index"]);
|
||||
|
||||
// Is `target` somewhere upstream of `start`? `feeds(id)` lists the ids of
|
||||
// the nodes wired into node `id`.
|
||||
function isUpstream(target, start, feeds) {
|
||||
@@ -147,15 +162,34 @@ function isUpstream(target, start, feeds) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is the picture out of `start` made from `target`'s picture? A switch only
|
||||
// hands one of its pictures on, so it counts only when one branch is made
|
||||
// from `target` and no branch can hand on a picture from before `target`.
|
||||
// `branches(id)` lists a switch's picture branches, null for other nodes.
|
||||
function madeFrom(start, target, graph, memo = new Map()) {
|
||||
if (start === target) return true;
|
||||
if (memo.has(start)) return memo.get(start);
|
||||
memo.set(start, false); // a loop in the links proves nothing
|
||||
const branches = graph.branches?.(start) ?? null;
|
||||
const ids = (branches ?? graph.feeds(start) ?? []).filter((id) => id != null);
|
||||
const answer = ids.some((id) => madeFrom(id, target, graph, memo))
|
||||
&& !(branches && ids.some((id) => id !== target && isUpstream(id, target, graph.feeds)));
|
||||
memo.set(start, answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
// Which input holds the result, the picture the panel rests on. B is the
|
||||
// "after" picture by convention. When B's picture feeds the node that makes
|
||||
// A, they are wired the other way round and the result is A.
|
||||
// "after" picture by convention. When A is made from B's picture, they are
|
||||
// wired the other way round and the result is A. A switch that can hand on
|
||||
// either the other picture or the one it started from is a "before" picker:
|
||||
// the picture it can hand on is the result.
|
||||
//
|
||||
// `a` and `b` say where the two pictures come from: { id, slot } of the node
|
||||
// and output wired to each input. `graph` reads the links: feeds(id) lists
|
||||
// the ids of the nodes wired into node `id`, and inside(id) opens a
|
||||
// subgraph: the same two calls for the graph in it, plus output(slot),
|
||||
// where that output comes from in there.
|
||||
// the ids of the nodes wired into node `id`, branches(id) the picture
|
||||
// branches of a switch (null for other nodes), and inside(id) opens a
|
||||
// subgraph: the same calls for the graph in it, plus output(slot), where
|
||||
// that output comes from in there.
|
||||
export function compareResultSide(a, b, graph) {
|
||||
// Both pictures out of one subgraph: the answer is inside it.
|
||||
for (let depth = 0; a && b && a.id === b.id && depth < 16; depth += 1) {
|
||||
@@ -164,5 +198,7 @@ export function compareResultSide(a, b, graph) {
|
||||
[a, b, graph] = [inner.output(a.slot), inner.output(b.slot), inner];
|
||||
}
|
||||
if (!a || !b || a.id === b.id) return "B";
|
||||
return isUpstream(b.id, a.id, graph.feeds) ? "A" : "B";
|
||||
if (madeFrom(a.id, b.id, graph)) return "A";
|
||||
if (madeFrom(b.id, a.id, graph)) return "B";
|
||||
return isUpstream(a.id, b.id, graph.feeds) ? "A" : "B";
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ function installPointer(er, signal) {
|
||||
}
|
||||
|
||||
async function save(er) {
|
||||
if (er.saving || !er.refs) return;
|
||||
if (er.signal.aborted || er.saving || !er.refs) return;
|
||||
er.saving = true;
|
||||
syncTools(er);
|
||||
try {
|
||||
@@ -644,6 +644,7 @@ async function save(er) {
|
||||
})),
|
||||
});
|
||||
const answer = await response.json().catch(() => null);
|
||||
if (er.signal.aborted) return;
|
||||
if (!response.ok) {
|
||||
// No words from the route: this ComfyUI started before the update.
|
||||
const missing = (response.status === 404 || response.status === 405) && !answer?.error;
|
||||
@@ -652,10 +653,11 @@ async function save(er) {
|
||||
showToast({ severity: "success", summary: "Image Compare", detail: savedMessage(answer?.files) });
|
||||
er.onSaved?.(answer?.files ?? []);
|
||||
} catch (error) {
|
||||
if (er.signal.aborted) return;
|
||||
showToast({ severity: "error", summary: "Image Compare", detail: String(error?.message ?? error), life: 8000 });
|
||||
} finally {
|
||||
er.saving = false;
|
||||
syncTools(er);
|
||||
if (!er.signal.aborted) syncTools(er);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,20 +665,24 @@ async function save(er) {
|
||||
// to B as it came. The panel swaps in the pictures; Save and Copy then use
|
||||
// the lined-up B, and the paint stays where it is.
|
||||
async function align(er) {
|
||||
if (er.aligning || !er.refs) return;
|
||||
if (er.signal.aborted || er.aligning || !er.refs) return;
|
||||
if (er.refs.aligned) {
|
||||
er.onAligned?.(er.refs.original);
|
||||
return;
|
||||
}
|
||||
er.aligning = true;
|
||||
const refs = er.refs;
|
||||
const picturesVersion = er.picturesVersion;
|
||||
const current = () => !er.signal.aborted && er.refs === refs && er.picturesVersion === picturesVersion;
|
||||
syncTools(er);
|
||||
try {
|
||||
const response = await api.fetchApi(ALIGN_ROUTE, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ pair: er.refs.pair }),
|
||||
body: JSON.stringify({ pair: refs.pair }),
|
||||
});
|
||||
const answer = await response.json().catch(() => null);
|
||||
if (!current()) return;
|
||||
if (!response.ok) {
|
||||
// No words from the route: this ComfyUI started before the update.
|
||||
const missing = (response.status === 404 || response.status === 405) && !answer?.error;
|
||||
@@ -684,15 +690,16 @@ async function align(er) {
|
||||
}
|
||||
if (answer?.aligned && answer.b?.filename && typeof answer.pair === "string") {
|
||||
showToast({ severity: "success", summary: "Image Compare", detail: answer.message, life: 4000 });
|
||||
er.onAligned?.({ ...er.refs, b: answer.b, pair: answer.pair, aligned: true, original: er.refs });
|
||||
er.onAligned?.({ ...refs, b: answer.b, pair: answer.pair, aligned: true, original: refs });
|
||||
} else {
|
||||
showToast({ severity: "info", summary: "Image Compare", detail: answer?.message || "B was left as it is.", life: 6000 });
|
||||
}
|
||||
} catch (error) {
|
||||
if (!current()) return;
|
||||
showToast({ severity: "error", summary: "Image Compare", detail: String(error?.message ?? error), life: 8000 });
|
||||
} finally {
|
||||
er.aligning = false;
|
||||
syncTools(er);
|
||||
if (!er.signal.aborted) syncTools(er);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -764,7 +771,7 @@ function copy(er) {
|
||||
// pictures change.
|
||||
export function makeEraser({ node, root, stage, imageA, imageB, signal, onSaved, onAligned }) {
|
||||
const er = {
|
||||
node, root, stage, imageA, imageB, onSaved, onAligned,
|
||||
node, root, stage, imageA, imageB, signal, onSaved, onAligned,
|
||||
canvas: document.createElement("canvas"),
|
||||
mask: document.createElement("canvas"),
|
||||
live: document.createElement("canvas"),
|
||||
@@ -772,7 +779,7 @@ export function makeEraser({ node, root, stage, imageA, imageB, signal, onSaved,
|
||||
dab: document.createElement("canvas"),
|
||||
dabKey: "",
|
||||
maskScale: 1,
|
||||
refs: null, width: 0, height: 0, fit: null,
|
||||
refs: null, picturesVersion: 0, width: 0, height: 0, fit: null,
|
||||
strokes: [], history: [],
|
||||
active: false, stroke: null, adjust: null, pointer: null, back: false, flipKey: false,
|
||||
saving: false, copying: false, frame: 0, keys: null,
|
||||
@@ -985,6 +992,7 @@ export function makeEraser({ node, root, stage, imageA, imageB, signal, onSaved,
|
||||
// Both pictures are loaded (or, with null, on their way). The paint is
|
||||
// read from the node, and kept only while the picture keeps its size.
|
||||
setPictures(refs) {
|
||||
er.picturesVersion += 1;
|
||||
const ready = Boolean(refs && imageA.naturalWidth > 0 && imageB.naturalWidth > 0);
|
||||
er.refs = ready ? refs : null;
|
||||
finishStroke(er, null, true);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// A click on the dark area around a modal <dialog> closes it, the way people
|
||||
// expect any popup to work. The browser reports a click on a dialog's
|
||||
// backdrop as a click on the dialog element itself, so a click counts as
|
||||
// outside when it lands on the dialog element beyond its own box. Both the
|
||||
// press and the release must be outside: a text selection or a drag that
|
||||
// starts on the card and ends on the backdrop keeps the popup open.
|
||||
|
||||
export function pointOutside(rect, x, y) {
|
||||
return x < rect.left || x > rect.right || y < rect.top || y > rect.bottom;
|
||||
}
|
||||
|
||||
export function closeOnBackdropClick(dialog, close = () => dialog.close()) {
|
||||
const outside = (event) => event.target === dialog
|
||||
&& pointOutside(dialog.getBoundingClientRect(), event.clientX, event.clientY);
|
||||
let pressedOutside = false;
|
||||
dialog.addEventListener("pointerdown", (event) => {
|
||||
pressedOutside = outside(event);
|
||||
});
|
||||
dialog.addEventListener("click", (event) => {
|
||||
const started = pressedOutside;
|
||||
pressedOutside = false;
|
||||
if (started && outside(event)) close();
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
// Film Grain's Auto, on the node's face: what Auto picks for the picture on
|
||||
// hand, shown beside the Amount and Size boxes ("= 0.27", "= 1.0 px").
|
||||
//
|
||||
// The picture is read from its Load Image through ComfyUI's /view route and
|
||||
// its fine noise measured here, with the same measure the node uses
|
||||
// (js/shared/live_grain.mjs). A picture that only exists after a run (a VAE
|
||||
// Decode) is known from the node's last run, which sends Auto's picks with
|
||||
// its result. Until either, the card shows a plain dash.
|
||||
//
|
||||
// With a picture on grain_from, Auto copies that picture's grain instead.
|
||||
// The match is worked out by the node when it runs, and sent with its result
|
||||
// (node.__ausbossMatch = { amount, size, color }); the card's notes and the
|
||||
// live preview use it from then on. The node keeps its last few matches,
|
||||
// one per pair of pictures, in its saved properties: ComfyUI does not run a
|
||||
// node again for pictures it already ran, so a run that comes from its
|
||||
// cache sends no match, and a reopened workflow would otherwise wait for one.
|
||||
import { autoGrain, measureNoise } from "./live_grain.mjs";
|
||||
import { loadPixels, pixelsToImage, planInput } from "./live_sources.mjs";
|
||||
|
||||
// Is a picture wired into grain_from?
|
||||
export const grainFromLinked = (node) => node?.inputs?.some((input) => input?.name === "grain_from" && input.link != null) === true;
|
||||
|
||||
// Does Auto copy grain from a picture right now?
|
||||
export const copiesGrain = (node) => Boolean(node?.widgets?.find((widget) => widget?.name === "auto")?.value) && grainFromLinked(node);
|
||||
|
||||
// The match from the node's last run, or null.
|
||||
export function matchFromRun(record) {
|
||||
const sent = record?.ausboss_grain_match?.[0];
|
||||
return sent && ["base_amount", "base_size", "base_color"].every((key) => Number.isFinite(sent[key]))
|
||||
? { amount: sent.base_amount, size: sent.base_size, color: sent.base_color }
|
||||
: null;
|
||||
}
|
||||
|
||||
// Which pair of pictures a match belongs to: the picture and grain_from's
|
||||
// source (a Load Image's file, or the link a run reads).
|
||||
export const matchKey = (node) => ["image", "grain_from"].map((name) => planInput(node, name).key ?? "-").join("|");
|
||||
|
||||
const KEPT_MATCHES = 8;
|
||||
const validMatch = (match) => match && ["amount", "size", "color"].every((key) => Number.isFinite(match[key])) ? match : null;
|
||||
|
||||
// Remember a run's match for the pictures wired now.
|
||||
export function keepMatch(node, match) {
|
||||
if (!node || !validMatch(match)) return;
|
||||
node.properties ??= {};
|
||||
const kept = { ...(node.properties.ausboss_grain_matches ?? {}) };
|
||||
const key = matchKey(node);
|
||||
delete kept[key];
|
||||
kept[key] = { amount: match.amount, size: match.size, color: match.color };
|
||||
const keys = Object.keys(kept);
|
||||
for (const old of keys.slice(0, Math.max(0, keys.length - KEPT_MATCHES))) delete kept[old];
|
||||
node.properties.ausboss_grain_matches = kept;
|
||||
}
|
||||
|
||||
// The kept match for the pictures wired now, or null.
|
||||
export const keptMatch = (node) => validMatch(node?.properties?.ausboss_grain_matches?.[matchKey(node)]) ?? null;
|
||||
|
||||
export function setMatch(node, match) {
|
||||
const before = node.__ausbossMatch;
|
||||
if (before?.amount === match?.amount && before?.size === match?.size && before?.color === match?.color) return;
|
||||
node.__ausbossMatch = match ?? null;
|
||||
node.__ausbossCard?.refresh?.();
|
||||
node.__ausbossLive?.hooks?.refresh?.();
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
// Auto's picks for the node (node.__ausbossAuto = { amount, size }: the
|
||||
// numbers before the card's multipliers), or null while they are not known.
|
||||
export function setAuto(node, picks) {
|
||||
const before = node.__ausbossAuto;
|
||||
const next = picks && Number.isFinite(picks.amount) && Number.isFinite(picks.size) ? { amount: picks.amount, size: picks.size } : null;
|
||||
if (before?.amount === next?.amount && before?.size === next?.size) return;
|
||||
node.__ausbossAuto = next;
|
||||
node.__ausbossCard?.refresh?.();
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
// From a picture already read (the live stage has it).
|
||||
export function autoFromImage(node, image) {
|
||||
const noise = measureNoise(image);
|
||||
const picks = autoGrain(image.h, image.w, noise);
|
||||
setAuto(node, picks);
|
||||
return picks;
|
||||
}
|
||||
|
||||
// From what the node's last run sent.
|
||||
export function autoFromRun(record) {
|
||||
const sent = record?.ausboss_grain_auto?.[0];
|
||||
return sent && Number.isFinite(sent.base_amount) && Number.isFinite(sent.base_size) ? { amount: sent.base_amount, size: sent.base_size } : null;
|
||||
}
|
||||
|
||||
// Work out Auto's picks for a node now. `viewUrl(query)` turns a /view query
|
||||
// into a URL; `record` is the node's last output record, if any.
|
||||
export async function refreshAuto(node, { viewUrl, record = null }) {
|
||||
if (!node || typeof viewUrl !== "function") return;
|
||||
// The match kept for these two pictures; other pictures wait for a run.
|
||||
setMatch(node, grainFromLinked(node) ? keptMatch(node) : null);
|
||||
const plan = planInput(node, "image");
|
||||
if (plan.state === "direct") {
|
||||
try {
|
||||
const image = pixelsToImage(await loadPixels(viewUrl(plan.query)), 3);
|
||||
// The wiring or the file changed while the picture was being read.
|
||||
if (planInput(node, "image").key !== plan.key) return;
|
||||
autoFromImage(node, image);
|
||||
return;
|
||||
} catch {
|
||||
// A browser that hides picture pixels: fall back to the last run's numbers.
|
||||
}
|
||||
}
|
||||
setAuto(node, plan.state === "none" ? null : autoFromRun(record));
|
||||
}
|
||||
+162
-28
@@ -1,9 +1,15 @@
|
||||
// The row of chips on H3 Prompt Writer: each picture plugged in, with its @
|
||||
// name, a small copy of it and its job, then the video and its job. A slot with nothing plugged in is a faint
|
||||
// dashed chip, so it reads as optional. The widgets underneath stay the
|
||||
// source of truth: a chip only changes their value.
|
||||
// name, a small copy of it and its job, then the video and its job. A slot
|
||||
// with nothing plugged in has no chip (js/shared/h3_sockets.mjs holds the
|
||||
// rule). A picture whose loader is turned off keeps a faint dashed chip that
|
||||
// says so. The widgets underneath stay the source of truth: a chip only
|
||||
// changes their value. The chips share one line. On a narrow node the widest
|
||||
// chips give way first, their job cut short, so a short job such as "place"
|
||||
// stays whole for as long as it can.
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { BRAND, chainCallback } from "./index.mjs";
|
||||
import { BRAND, chainCallback, notifyAusbossChange } from "./index.mjs";
|
||||
import { THEME as T, FONT_UI } from "./theme.mjs";
|
||||
import { SHOW_ALL, chipsToShow } from "./h3_sockets.mjs";
|
||||
import { liftSocket } from "./widget_card.mjs";
|
||||
import { commitWidgetValue, comboValues } from "./widget_card_math.mjs";
|
||||
|
||||
@@ -15,15 +21,22 @@ function ensureCss() {
|
||||
const style = document.createElement("style");
|
||||
style.id = CSS_ID;
|
||||
style.textContent = `
|
||||
.ausboss-chips{display:flex;flex-wrap:wrap;align-content:flex-start;gap:5px;height:100%;min-width:0;font:600 10.5px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
|
||||
.ausboss-chip{position:relative;display:flex;align-items:center;gap:4px;height:24px;max-width:100%;padding:0 8px;box-sizing:border-box;border:1px solid #2a3437;border-radius:12px;background:#0b0f10;color:#d8ecea;white-space:nowrap}
|
||||
.ausboss-chips{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,max-content);justify-content:start;align-items:start;gap:5px;height:100%;min-width:0;font:600 10.5px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
|
||||
.ausboss-chip{position:relative;display:flex;align-items:center;gap:4px;height:24px;min-width:0;max-width:100%;padding:0 8px;box-sizing:border-box;border:1px solid #2a3437;border-radius:12px;background:#0b0f10;color:#d8ecea;white-space:nowrap}
|
||||
.ausboss-chip:hover{border-color:${BRAND}}
|
||||
.ausboss-chip img{flex:none;width:18px;height:18px;margin-left:-5px;border-radius:9px;object-fit:cover}
|
||||
.ausboss-chip b{flex:none;color:${BRAND};font:700 10px ui-monospace,SFMono-Regular,Menlo,monospace}
|
||||
.ausboss-chip em{flex:none;color:#6f8886;font-style:normal;font-weight:500}
|
||||
.ausboss-chip select{field-sizing:content;min-width:0;max-width:120px;height:22px;padding:0 11px 0 0;border:none;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%236f8886' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 1px center;color:#d8ecea;font:inherit;appearance:none;-webkit-appearance:none;cursor:pointer;text-overflow:ellipsis}
|
||||
.ausboss-chip select:focus-visible{outline:2px solid ${BRAND};outline-offset:2px}
|
||||
.ausboss-chip select option{background:#0f1516;color:#d8ecea}
|
||||
.ausboss-chip-pick{flex:0 1 auto;min-width:0;max-width:120px;height:22px;padding:0 12px 0 0;border:none;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%236f8886' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 1px center;color:#d8ecea;font:inherit;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}
|
||||
.ausboss-chip-pick:focus-visible{outline:2px solid ${BRAND};outline-offset:2px;border-radius:3px}
|
||||
.ausboss-chip.open{border-color:${BRAND}}
|
||||
.ausboss-chip-menu{position:fixed;z-index:10000;box-sizing:border-box;padding:.33em;border:1px solid ${T.rule};border-radius:.66em;background:${T.card};box-shadow:0 10px 32px rgba(0,0,0,.55);font:500 12px/1.25 ${FONT_UI};color:${T.inkSoft}}
|
||||
.ausboss-chip-item{display:flex;align-items:center;gap:.5em;padding:.45em .75em .45em .5em;border-radius:.4em;white-space:nowrap;cursor:pointer;user-select:none}
|
||||
.ausboss-chip-item::before{content:"";flex:none;width:.9em;text-align:center;color:${T.brand}}
|
||||
.ausboss-chip-item.current::before{content:"\\2713"}
|
||||
.ausboss-chip-item.current{color:${T.brandInk}}
|
||||
.ausboss-chip-item.hot{background:${T.fill};color:${T.ink}}
|
||||
.ausboss-chip span{min-width:0;overflow:hidden;text-overflow:ellipsis}
|
||||
.ausboss-chip.off{border-style:dashed;background:transparent;color:#56706d}
|
||||
.ausboss-chip.off:hover{border-color:#2a3437}
|
||||
.ausboss-chip.wired{color:#8ba3a1}
|
||||
@@ -40,6 +53,19 @@ function linkSource(node, name) {
|
||||
return (source?.mode ?? 0) === 0 ? source ?? {} : null;
|
||||
}
|
||||
|
||||
const hasWire = (node, name) => {
|
||||
const slot = node.inputs?.find((input) => !input?.widget && input?.name === name);
|
||||
return slot?.link !== null && slot?.link !== undefined;
|
||||
};
|
||||
|
||||
// The names of the chips this node draws now: picture_1 to picture_4, video.
|
||||
export function castChipNames(node) {
|
||||
return chipsToShow({
|
||||
wiredInputs: ["picture_1", "picture_2", "picture_3", "picture_4", "video"].filter((name) => hasWire(node, name)),
|
||||
showAll: Boolean(app.extensionManager?.setting?.get?.(SHOW_ALL)),
|
||||
});
|
||||
}
|
||||
|
||||
const widgetOf = (node, name) => node.widgets?.find((widget) => widget.name === name) ?? null;
|
||||
|
||||
function chip(className = "") {
|
||||
@@ -56,17 +82,116 @@ function add(parent, tag, text, className) {
|
||||
return child;
|
||||
}
|
||||
|
||||
// The open job list, one at a time across every chip on the page.
|
||||
let openMenu = null;
|
||||
|
||||
// The job list a chip opens. A native <select> lets the browser draw its own
|
||||
// list (small system font, light highlight, pinned to the select's left
|
||||
// edge); this one wears the node's colours, sits under the whole chip and
|
||||
// grows with the canvas zoom like the chip does.
|
||||
function openJobMenu(chipElement, button, values, current, choose) {
|
||||
openMenu?.close();
|
||||
const menu = add(document.body, "div", undefined, "ausboss-chip-menu");
|
||||
menu.setAttribute("role", "listbox");
|
||||
const items = values.map((value) => {
|
||||
const item = add(menu, "div", value, "ausboss-chip-item");
|
||||
item.setAttribute("role", "option");
|
||||
if (value === current) { item.classList.add("current"); item.setAttribute("aria-selected", "true"); }
|
||||
return item;
|
||||
});
|
||||
let hot = -1;
|
||||
const setHot = (index) => {
|
||||
items[hot]?.classList.remove("hot");
|
||||
hot = (index + items.length) % items.length;
|
||||
items[hot]?.classList.add("hot");
|
||||
items[hot]?.scrollIntoView({ block: "nearest" });
|
||||
};
|
||||
setHot(Math.max(0, values.indexOf(current)));
|
||||
|
||||
// The chip is drawn scaled with the canvas: the list matches that size,
|
||||
// starts at the chip's left edge and is at least as wide as the chip.
|
||||
function place() {
|
||||
const box = chipElement.getBoundingClientRect();
|
||||
const zoom = Math.min(2.5, Math.max(0.85, box.height / (chipElement.offsetHeight || 24)));
|
||||
menu.style.fontSize = `${12 * zoom}px`;
|
||||
menu.style.minWidth = `${box.width}px`;
|
||||
const width = menu.offsetWidth;
|
||||
const height = menu.offsetHeight;
|
||||
let top = box.bottom + 4;
|
||||
if (top + height > window.innerHeight - 8 && box.top - height - 4 >= 8) top = box.top - height - 4;
|
||||
menu.style.left = `${Math.max(8, Math.min(box.left, window.innerWidth - width - 8))}px`;
|
||||
menu.style.top = `${Math.max(8, top)}px`;
|
||||
}
|
||||
|
||||
const abort = new AbortController();
|
||||
const close = () => {
|
||||
abort.abort();
|
||||
menu.remove();
|
||||
chipElement.classList.remove("open");
|
||||
if (openMenu?.menu === menu) openMenu = null;
|
||||
};
|
||||
const pick = (index) => { close(); button.focus(); choose(values[index]); };
|
||||
items.forEach((item, index) => {
|
||||
item.addEventListener("pointermove", () => { if (hot !== index) setHot(index); });
|
||||
item.addEventListener("click", () => pick(index));
|
||||
});
|
||||
menu.addEventListener("pointerdown", (event) => event.stopPropagation());
|
||||
const outside = (event) => !menu.contains(event.target) && !button.contains(event.target);
|
||||
const on = { capture: true, signal: abort.signal };
|
||||
window.addEventListener("pointerdown", (event) => { if (outside(event)) close(); }, on);
|
||||
window.addEventListener("wheel", (event) => { if (outside(event)) close(); }, { ...on, passive: true });
|
||||
// The page fires resize on its own now and then: the list follows the chip
|
||||
// instead of vanishing, and goes only when the chip itself is gone.
|
||||
window.addEventListener("resize", () => (chipElement.isConnected ? place() : close()), on);
|
||||
// Only the window itself losing focus (another app, another tab). Pressing an item takes
|
||||
// focus off the chip's button, and a capturing blur listener would hear that and close
|
||||
// the list before the click lands. The press keeps focus on the button instead.
|
||||
window.addEventListener("blur", (event) => { if (event.target === window) close(); }, { signal: abort.signal });
|
||||
menu.addEventListener("mousedown", (event) => event.preventDefault());
|
||||
window.addEventListener("keydown", (event) => {
|
||||
const step = { ArrowDown: 1, ArrowUp: -1 }[event.key];
|
||||
if (step) setHot(hot + step);
|
||||
else if (event.key === "Home") setHot(0);
|
||||
else if (event.key === "End") setHot(items.length - 1);
|
||||
else if (event.key === "Enter" || event.key === " ") pick(hot);
|
||||
else if (event.key === "Escape" || event.key === "Tab") { close(); if (event.key === "Escape") button.focus(); }
|
||||
else return;
|
||||
if (event.key !== "Tab") { event.preventDefault(); event.stopPropagation(); }
|
||||
}, on);
|
||||
|
||||
place();
|
||||
chipElement.classList.add("open");
|
||||
openMenu = { owner: button, menu, close };
|
||||
}
|
||||
|
||||
function choice(node, name, into) {
|
||||
const widget = widgetOf(node, name);
|
||||
const select = add(into, "select");
|
||||
for (const value of comboValues(widget)) add(select, "option", value).value = value;
|
||||
select.value = widget?.value ?? "";
|
||||
select.title = widget?.options?.tooltip ?? "";
|
||||
select.addEventListener("change", () => {
|
||||
if (widget) commitWidgetValue(node, widget, select.value, app.canvas);
|
||||
const button = add(into, "button", undefined, "ausboss-chip-pick");
|
||||
button.type = "button";
|
||||
button.setAttribute("aria-haspopup", "listbox");
|
||||
// The job can be cut short on a narrow node, so the hint starts with it.
|
||||
const hint = widget?.options?.tooltip ?? "";
|
||||
const show = (value) => {
|
||||
button.textContent = String(value ?? "");
|
||||
button.title = [String(value ?? ""), hint].filter(Boolean).join("\n");
|
||||
};
|
||||
show(widget?.value);
|
||||
const choose = (value) => {
|
||||
show(value);
|
||||
if (widget && value !== widget.value) {
|
||||
commitWidgetValue(node, widget, value, app.canvas);
|
||||
notifyAusbossChange();
|
||||
}
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
};
|
||||
button.addEventListener("pointerdown", (event) => event.stopPropagation());
|
||||
button.addEventListener("click", (event) => {
|
||||
event.preventDefault();
|
||||
if (openMenu?.owner === button) { openMenu.close(); return; }
|
||||
const values = comboValues(widget).map(String);
|
||||
openJobMenu(into, button, values, String(widget?.value ?? ""), choose);
|
||||
});
|
||||
return (values) => { if (document.activeElement !== select) select.value = values[name] ?? ""; };
|
||||
return (values) => { if (openMenu?.owner !== button) show(values[name]); };
|
||||
}
|
||||
|
||||
// The jobs have no socket of their own, but a page saved by an earlier
|
||||
@@ -90,15 +215,24 @@ export function castChips(node) {
|
||||
let syncs = [];
|
||||
let latest = {};
|
||||
const build = (values) => {
|
||||
if (openMenu && element.contains(openMenu.owner)) openMenu.close();
|
||||
element.textContent = "";
|
||||
syncs = [];
|
||||
const names = castChipNames(node);
|
||||
// A faint chip: a socket with nothing in it (only with every socket
|
||||
// shown), or a picture whose loader is turned off.
|
||||
const faint = (name, label, plugIn) => {
|
||||
const empty = chip("off");
|
||||
const off = hasWire(node, name);
|
||||
empty.textContent = off ? `${label} off` : `+ ${label}`;
|
||||
empty.title = off ? `The loader on ${name} is turned off, so it is not used.` : plugIn;
|
||||
element.append(empty);
|
||||
};
|
||||
for (const number of [1, 2, 3, 4]) {
|
||||
if (!names.includes(`picture_${number}`)) continue;
|
||||
const source = linkSource(node, `picture_${number}`);
|
||||
if (!source) {
|
||||
const empty = chip("off");
|
||||
empty.textContent = `+ @${number}`;
|
||||
empty.title = `Plug a picture into picture_${number} to name it @${number} in your lines.`;
|
||||
element.append(empty);
|
||||
faint(`picture_${number}`, `@${number}`, `Plug a picture into picture_${number} to name it @${number} in your lines.`);
|
||||
continue;
|
||||
}
|
||||
const item = chip();
|
||||
@@ -115,20 +249,17 @@ export function castChips(node) {
|
||||
if (linkSource(node, "video_job")) add(item, "span", "job from its wire");
|
||||
else syncs.push(choice(node, "video_job", item));
|
||||
element.append(item);
|
||||
} else {
|
||||
const empty = chip("off");
|
||||
empty.textContent = "+ video";
|
||||
empty.title = "Plug a video into video to copy its moves, swap the person, keep it going or give it a new voice.";
|
||||
element.append(empty);
|
||||
} else if (names.includes("video")) {
|
||||
faint("video", "video", "Plug a video into video to copy its moves, swap the person, keep it going or give it a new voice.");
|
||||
}
|
||||
|
||||
for (const run of syncs) run(values);
|
||||
};
|
||||
|
||||
const shapeOf = () => JSON.stringify(["picture_1", "picture_2", "picture_3", "picture_4", "video", ...JOBS].map((name) => {
|
||||
const shapeOf = () => JSON.stringify([castChipNames(node), ...["picture_1", "picture_2", "picture_3", "picture_4", "video", ...JOBS].map((name) => {
|
||||
const source = linkSource(node, name);
|
||||
return source ? [source.id ?? 1, source.imgs?.[0]?.src ?? ""] : 0;
|
||||
}));
|
||||
})]);
|
||||
const sync = (values) => {
|
||||
latest = values;
|
||||
const now = shapeOf();
|
||||
@@ -136,7 +267,10 @@ export function castChips(node) {
|
||||
for (const run of syncs) run(values);
|
||||
};
|
||||
const watch = setInterval(() => sync(latest), WATCH);
|
||||
chainCallback(node, "onRemoved", () => clearInterval(watch));
|
||||
chainCallback(node, "onRemoved", () => {
|
||||
clearInterval(watch);
|
||||
if (openMenu && element.contains(openMenu.owner)) openMenu.close();
|
||||
});
|
||||
chainCallback(node, "onConfigure", () => queueMicrotask(() => keepOldJobLinks(node)));
|
||||
return { element, sync };
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { linkOrigin } from "./clip_rate.mjs";
|
||||
|
||||
// The same live-input rule used by the writer timeline: muted/bypassed
|
||||
// sources do not reach this node. This inspects the wire, never media bytes.
|
||||
export function linkSource(node, name) {
|
||||
@@ -9,8 +11,58 @@ export function linkSource(node, name) {
|
||||
return (source?.mode ?? 0) === 0 ? source ?? null : null;
|
||||
}
|
||||
|
||||
// Keep in step with Python video_frames (node_h3_prompt_writer.py): H3 makes
|
||||
// 5 frames plus steps of 17, at most 15 s at 24 fps, rounding a clip down.
|
||||
export const H3_FPS = 24;
|
||||
export function h3VideoFrames(frames) {
|
||||
const count = Math.trunc(Number(frames));
|
||||
if (!(count > 0)) return null;
|
||||
return Math.max(1, Math.floor((Math.min(count, 15 * H3_FPS) - 5) / 17)) * 17 + 5;
|
||||
}
|
||||
|
||||
// What the clip node's face last worked out for its run ({frames,
|
||||
// startSeconds, endSeconds}), or null when the clip is not that node or its
|
||||
// count is only known at run time.
|
||||
export function clipTimingFor(node) {
|
||||
// Through Reroutes and subgraphs, as every linked value is read.
|
||||
const timing = linkOrigin(node, "video")?.node?.__ausbossClipTiming;
|
||||
return timing && timing.frames > 0 ? timing : null;
|
||||
}
|
||||
|
||||
// The words under "From the clip": what H3 will make of the clip's frames.
|
||||
export function clipLengthWords(timing) {
|
||||
if (!timing) return null;
|
||||
const made = h3VideoFrames(timing.frames);
|
||||
const seconds = (frames) => String(Number((frames / H3_FPS).toFixed(2)));
|
||||
if (made < timing.frames) {
|
||||
const up = made + 17;
|
||||
const room = timing.roomFrames ?? Infinity;
|
||||
const stops = timing.startSeconds + made / H3_FPS;
|
||||
return {
|
||||
title: `H3 makes ${made} of the clip's ${timing.frames} frames · ${seconds(made)} s`,
|
||||
note: `H3 leaves out the last ${seconds(timing.frames - made)} s, so it stops at ${String(Number(stops.toFixed(2)))} s in the video. To lose nothing, set the clip's Duration to ${seconds(made)} s${up <= Math.min(room, 15 * H3_FPS) ? ` or ${seconds(up)} s` : ""}.`,
|
||||
warn: true,
|
||||
};
|
||||
}
|
||||
if (made === timing.frames) return { title: `H3 uses all ${made} frames · ${seconds(made)} s`, note: "The clip is already a length H3 makes.", warn: false };
|
||||
return { title: `H3 makes ${made} frames · ${seconds(made)} s`, note: `That is its shortest length; the clip has ${timing.frames} frames.`, warn: true };
|
||||
}
|
||||
|
||||
// These video jobs keep the clip's own camera (Python MOVES_ARE and
|
||||
// SWAP_VIDEO say so; a new voice or a change keeps the clip as it was shot).
|
||||
// "keep going" makes new footage, so its camera is still the user's words.
|
||||
const CAMERA_FROM_CLIP = ["copy its moves", "swap the person", "new voice", "change something"];
|
||||
|
||||
// The Camera list's first choice adds no camera words. With a clip wired for
|
||||
// one of those jobs that means the clip's own camera, so it reads that way.
|
||||
export function cameraChoiceLabel(value, values, node) {
|
||||
if (value !== "as typed" || !node) return undefined;
|
||||
const job = node.widgets?.find((widget) => widget.name === "video_job")?.value;
|
||||
return CAMERA_FROM_CLIP.includes(job) && linkSource(node, "video") !== null ? "from the video" : undefined;
|
||||
}
|
||||
|
||||
// Keep in step with Python KEEPS_ITS_LENGTH. Other jobs use seconds normally.
|
||||
export function clipSetsDuration(node, values) {
|
||||
return ["swap the person", "new voice", "change something"].includes(values.video_job)
|
||||
return ["copy its moves", "swap the person", "new voice", "change something"].includes(values.video_job)
|
||||
&& linkSource(node, "video") !== null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
// H3 Prompt Writer's two tabs. Simple is the card as it always was: your
|
||||
// lines, the chips and the menus. Full prompt shows the prompt the node wrote
|
||||
// on its last run, in a box you can change; whatever you type there is what
|
||||
// H3 gets, until Reset to written. The `full_prompt` widget underneath holds
|
||||
// the edit (empty when there is none), so it saves and loads like any value.
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { chainCallback, notifyAusbossChange } from "./index.mjs";
|
||||
import { keepKeyInField } from "./canvas_passthrough.mjs";
|
||||
import { compactAction } from "./panel_controls.mjs";
|
||||
import { THEME as T } from "./theme.mjs";
|
||||
import { commitWidgetValue } from "./widget_card_math.mjs";
|
||||
import { FULL, SIMPLE, TAB_PROPERTY, WRITTEN_PROPERTY, boxText, editValue, isEdited, promptTab, writtenFromOutput } from "./h3_full_prompt_math.mjs";
|
||||
|
||||
export { FULL, SIMPLE, isEdited, promptTab };
|
||||
|
||||
const CSS_ID = "ausboss-h3-full-prompt-css";
|
||||
const EDITED_NOTE = "Edited by you. This text is sent as it is; the Simple tab is not used until you reset.";
|
||||
|
||||
function ensureCss() {
|
||||
if (document.getElementById(CSS_ID)) return;
|
||||
const style = document.createElement("style");
|
||||
style.id = CSS_ID;
|
||||
style.textContent = `
|
||||
.ausboss-prompt-tabs .dot{display:inline-block;width:6px;height:6px;margin-left:6px;border-radius:3px;background:${T.warn};vertical-align:1px}
|
||||
.ausboss-prompt-tabs .dot[hidden]{display:none}
|
||||
.ausboss-full-prompt{display:flex;flex-direction:column;gap:6px;height:100%;min-height:0}
|
||||
.ausboss-full-prompt-area{display:block;flex:1 1 auto;width:100%;min-width:0;min-height:0;padding:5px 8px;box-sizing:border-box;border:1px solid transparent;border-radius:6px;background:${T.fill};color:${T.ink};font:11.5px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:none;overflow:auto}
|
||||
.ausboss-full-prompt-area:focus{outline:none;border-color:${T.brand}}
|
||||
.ausboss-full-prompt-area::placeholder{color:${T.faint}}
|
||||
.ausboss-full-prompt-note{flex:none;padding:5px 8px;border-radius:5px;background:${T.warnSoft};color:${T.warnInk};font-size:11px;line-height:1.35}
|
||||
.ausboss-full-prompt-note[hidden]{display:none}
|
||||
.ausboss-full-prompt-foot{flex:none;display:flex;align-items:center;gap:8px;min-height:24px}
|
||||
.ausboss-full-prompt-foot span{flex:1 1 auto;min-width:0;color:${T.faint};font-size:11px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
|
||||
.ausboss-simple-edited{display:flex;align-items:center;height:100%;padding:0 8px;box-sizing:border-box;border-radius:5px;background:${T.warnSoft};color:${T.warnInk};font-size:11px;line-height:1.3}
|
||||
`;
|
||||
document.head.append(style);
|
||||
}
|
||||
|
||||
const widgetOf = (node, name) => node.widgets?.find((widget) => widget.name === name) ?? null;
|
||||
const redraw = (node) => (node.__ausbossCard?.refreshByHand ?? node.__ausbossCard?.refresh)?.();
|
||||
const writtenOf = (node) => String(node.properties?.[WRITTEN_PROPERTY] ?? "");
|
||||
|
||||
function setEdit(node, value) {
|
||||
const widget = widgetOf(node, "full_prompt");
|
||||
if (!widget || widget.value === value) return;
|
||||
commitWidgetValue(node, widget, value, app?.canvas);
|
||||
node.graph?.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
// The tab switch at the top of the card. The open tab is a display choice
|
||||
// kept on the node, not a value: it changes nothing that is sent.
|
||||
export function promptTabs(node) {
|
||||
ensureCss();
|
||||
const element = document.createElement("div");
|
||||
element.className = "ausboss-card-seg ausboss-prompt-tabs";
|
||||
const make = (tab, label, title) => {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.textContent = label;
|
||||
button.title = title;
|
||||
button.addEventListener("click", () => {
|
||||
if (promptTab(node) === tab) return;
|
||||
node.properties ??= {};
|
||||
node.properties[TAB_PROPERTY] = tab;
|
||||
redraw(node);
|
||||
});
|
||||
element.append(button);
|
||||
return button;
|
||||
};
|
||||
const simple = make(SIMPLE, "Simple", "Your lines, the pictures and the menus. The node writes the full prompt from them.");
|
||||
const full = make(FULL, "Full prompt", "The prompt the node wrote on its last run. Change it here to send your own.");
|
||||
const dot = document.createElement("span");
|
||||
dot.className = "dot";
|
||||
dot.title = "Edited: this text is sent instead of the Simple tab.";
|
||||
full.append(dot);
|
||||
return {
|
||||
element,
|
||||
sync(values) {
|
||||
const tab = promptTab(node);
|
||||
simple.classList.toggle("on", tab === SIMPLE);
|
||||
full.classList.toggle("on", tab === FULL);
|
||||
dot.hidden = !isEdited(values);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// One line on the Simple tab while an edit is being sent instead.
|
||||
export function simpleEditedNote() {
|
||||
ensureCss();
|
||||
const element = document.createElement("div");
|
||||
element.className = "ausboss-simple-edited";
|
||||
element.textContent = "Full prompt is edited, so these lines are not used until you reset it there.";
|
||||
return { element };
|
||||
}
|
||||
|
||||
// The Full prompt tab: the box, a note while it holds an edit, and Reset.
|
||||
export function fullPromptBox(node) {
|
||||
ensureCss();
|
||||
const element = document.createElement("div");
|
||||
element.className = "ausboss-full-prompt";
|
||||
const area = document.createElement("textarea");
|
||||
// Not the card's own textarea class: the script's colouring takes the
|
||||
// first box with that class, and it belongs to the script.
|
||||
area.className = "ausboss-full-prompt-area";
|
||||
area.spellcheck = false;
|
||||
area.placeholder = "Run the workflow once and the prompt the node writes shows here. Change it to send your own.";
|
||||
area.title = "What H3 gets. Type here to send your own text instead of the node's.";
|
||||
const note = document.createElement("div");
|
||||
note.className = "ausboss-full-prompt-note";
|
||||
note.textContent = EDITED_NOTE;
|
||||
const foot = document.createElement("div");
|
||||
foot.className = "ausboss-full-prompt-foot";
|
||||
const hint = document.createElement("span");
|
||||
hint.textContent = "Filled in after each run.";
|
||||
const reset = compactAction("Reset to written", "Throw your edit away and send what the Simple tab writes again.");
|
||||
foot.append(hint, reset);
|
||||
element.append(area, note, foot);
|
||||
|
||||
area.addEventListener("input", () => {
|
||||
setEdit(node, editValue(area.value, writtenOf(node)));
|
||||
redraw(node);
|
||||
});
|
||||
area.addEventListener("change", () => notifyAusbossChange());
|
||||
area.addEventListener("keydown", (event) => {
|
||||
keepKeyInField(event, { weights: true });
|
||||
if (event.key === "Escape") area.blur();
|
||||
});
|
||||
// Leaving the box shows what is sent: emptied, it is the written prompt again.
|
||||
area.addEventListener("blur", () => redraw(node));
|
||||
reset.addEventListener("click", () => {
|
||||
setEdit(node, "");
|
||||
area.value = writtenOf(node);
|
||||
notifyAusbossChange();
|
||||
redraw(node);
|
||||
});
|
||||
|
||||
// Each run hands back the prompt the node wrote. It is kept on the node, so
|
||||
// a saved workflow opens with it.
|
||||
chainCallback(node, "onExecuted", (output) => {
|
||||
const written = writtenFromOutput(output);
|
||||
if (written === null) return;
|
||||
node.properties ??= {};
|
||||
node.properties[WRITTEN_PROPERTY] = written;
|
||||
redraw(node);
|
||||
});
|
||||
|
||||
return {
|
||||
element,
|
||||
sync(values) {
|
||||
const edited = isEdited(values);
|
||||
if (document.activeElement !== area) area.value = boxText(values, writtenOf(node));
|
||||
note.hidden = !edited;
|
||||
reset.disabled = !edited;
|
||||
},
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user