DiffusionWave commited on
Commit
48d81fc
·
verified ·
1 Parent(s): d654f9e

Upload 104 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +4 -0
  2. comfyui-impact-pack/.github/workflows/publish.yml +25 -0
  3. comfyui-impact-pack/.gitignore +11 -0
  4. comfyui-impact-pack/.gitmodules +3 -0
  5. comfyui-impact-pack/LICENSE.txt +674 -0
  6. comfyui-impact-pack/README.md +514 -0
  7. comfyui-impact-pack/__init__.py +456 -0
  8. comfyui-impact-pack/__pycache__/__init__.cpython-311.pyc +0 -0
  9. comfyui-impact-pack/__pycache__/__init__.cpython-312.pyc +0 -0
  10. comfyui-impact-pack/custom_wildcards/put_wildcards_here +0 -0
  11. comfyui-impact-pack/impact-pack.ini +6 -0
  12. comfyui-impact-pack/install.py +116 -0
  13. comfyui-impact-pack/js/common.js +137 -0
  14. comfyui-impact-pack/js/impact-image-util.js +229 -0
  15. comfyui-impact-pack/js/impact-pack.js +933 -0
  16. comfyui-impact-pack/js/impact-sam-editor.js +641 -0
  17. comfyui-impact-pack/js/impact-segs-picker.js +182 -0
  18. comfyui-impact-pack/js/mask-rect-area-advanced.js +381 -0
  19. comfyui-impact-pack/js/mask-rect-area.js +366 -0
  20. comfyui-impact-pack/latent.png +3 -0
  21. comfyui-impact-pack/locales/ko/nodeDefs.json +1241 -0
  22. comfyui-impact-pack/modules/impact/__pycache__/animatediff_nodes.cpython-311.pyc +0 -0
  23. comfyui-impact-pack/modules/impact/__pycache__/animatediff_nodes.cpython-312.pyc +0 -0
  24. comfyui-impact-pack/modules/impact/__pycache__/bridge_nodes.cpython-311.pyc +0 -0
  25. comfyui-impact-pack/modules/impact/__pycache__/bridge_nodes.cpython-312.pyc +0 -0
  26. comfyui-impact-pack/modules/impact/__pycache__/config.cpython-311.pyc +0 -0
  27. comfyui-impact-pack/modules/impact/__pycache__/config.cpython-312.pyc +0 -0
  28. comfyui-impact-pack/modules/impact/__pycache__/core.cpython-311.pyc +3 -0
  29. comfyui-impact-pack/modules/impact/__pycache__/core.cpython-312.pyc +3 -0
  30. comfyui-impact-pack/modules/impact/__pycache__/defs.cpython-311.pyc +0 -0
  31. comfyui-impact-pack/modules/impact/__pycache__/defs.cpython-312.pyc +0 -0
  32. comfyui-impact-pack/modules/impact/__pycache__/detectors.cpython-311.pyc +0 -0
  33. comfyui-impact-pack/modules/impact/__pycache__/detectors.cpython-312.pyc +0 -0
  34. comfyui-impact-pack/modules/impact/__pycache__/hf_nodes.cpython-311.pyc +0 -0
  35. comfyui-impact-pack/modules/impact/__pycache__/hf_nodes.cpython-312.pyc +0 -0
  36. comfyui-impact-pack/modules/impact/__pycache__/hook_nodes.cpython-311.pyc +0 -0
  37. comfyui-impact-pack/modules/impact/__pycache__/hook_nodes.cpython-312.pyc +0 -0
  38. comfyui-impact-pack/modules/impact/__pycache__/hooks.cpython-311.pyc +0 -0
  39. comfyui-impact-pack/modules/impact/__pycache__/hooks.cpython-312.pyc +0 -0
  40. comfyui-impact-pack/modules/impact/__pycache__/impact_pack.cpython-311.pyc +3 -0
  41. comfyui-impact-pack/modules/impact/__pycache__/impact_pack.cpython-312.pyc +3 -0
  42. comfyui-impact-pack/modules/impact/__pycache__/impact_sampling.cpython-311.pyc +0 -0
  43. comfyui-impact-pack/modules/impact/__pycache__/impact_sampling.cpython-312.pyc +0 -0
  44. comfyui-impact-pack/modules/impact/__pycache__/impact_server.cpython-311.pyc +0 -0
  45. comfyui-impact-pack/modules/impact/__pycache__/impact_server.cpython-312.pyc +0 -0
  46. comfyui-impact-pack/modules/impact/__pycache__/logics.cpython-311.pyc +0 -0
  47. comfyui-impact-pack/modules/impact/__pycache__/logics.cpython-312.pyc +0 -0
  48. comfyui-impact-pack/modules/impact/__pycache__/pipe.cpython-311.pyc +0 -0
  49. comfyui-impact-pack/modules/impact/__pycache__/pipe.cpython-312.pyc +0 -0
  50. comfyui-impact-pack/modules/impact/__pycache__/segs_nodes.cpython-311.pyc +0 -0
.gitattributes CHANGED
@@ -57,3 +57,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
60
+ comfyui-impact-pack/modules/impact/__pycache__/core.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
61
+ comfyui-impact-pack/modules/impact/__pycache__/core.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
62
+ comfyui-impact-pack/modules/impact/__pycache__/impact_pack.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
63
+ comfyui-impact-pack/modules/impact/__pycache__/impact_pack.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
comfyui-impact-pack/.github/workflows/publish.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Publish to Comfy registry
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - "pyproject.toml"
9
+
10
+ permissions:
11
+ issues: write
12
+
13
+ jobs:
14
+ publish-node:
15
+ name: Publish Custom Node to registry
16
+ runs-on: ubuntu-latest
17
+ if: ${{ github.repository_owner == 'ltdrdata' }}
18
+ steps:
19
+ - name: Check out code
20
+ uses: actions/checkout@v4
21
+ - name: Publish Custom Node
22
+ uses: Comfy-Org/publish-node-action@v1
23
+ with:
24
+ ## Add your own personal access token to your Github Repository secrets and reference it here.
25
+ personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
comfyui-impact-pack/.gitignore ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ __pycache__
2
+ *.ini
3
+ wildcards/**
4
+ .vscode/
5
+ .idea/
6
+ subpack
7
+ impact_subpack
8
+ *.txt
9
+ *.yaml
10
+ !requirements.txt
11
+ !LICENSE.txt
comfyui-impact-pack/.gitmodules ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [submodule "subpack"]
2
+ path = subpack
3
+ url = https://github.com/ltdrdata/ComfyUI-Impact-Subpack
comfyui-impact-pack/LICENSE.txt ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
comfyui-impact-pack/README.md ADDED
@@ -0,0 +1,514 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![Youtube Badge](https://img.shields.io/badge/Youtube-FF0000?style=for-the-badge&logo=Youtube&logoColor=white&link=https://www.youtube.com/watch?v=AccoxDZIg3Y&list=PL_Ej2RDzjQLGfEeizq4GISeY3FtVyFmGP)](https://www.youtube.com/watch?v=AccoxDZIg3Y&list=PL_Ej2RDzjQLGfEeizq4GISeY3FtVyFmGP)
2
+
3
+ # ComfyUI-Impact-Pack
4
+
5
+ **Custom node pack for ComfyUI**
6
+ This node pack helps to conveniently enhance images through Detector, Detailer, Upscaler, Pipe, and more.
7
+
8
+ NOTE: The UltralyticsDetectorProvider node is not part of the ComfyUI-Impact-Pack. To use the UltralyticsDetectorProvider node, please install the ComfyUI-Impact-Subpack separately.
9
+
10
+ ## NOTICE
11
+ * V8.19: legacy nodes (mmdet and etc.) are removed
12
+ * V8.18: Support [facebookresearch/sam2](https://github.com/facebookresearch/sam2) models
13
+ * V8.0: The `Impact Subpack` is no longer installed automatically. To use `UltralyticsDetectorProvider` nodes, please install the `Impact Subpack` separately.
14
+ * V7.6: Automatic installation is no longer supported. Please install using ComfyUI-Manager, or manually install requirements.txt and run install.py to complete the installation.
15
+ * V7.0: Supports Switch based on Execution Model Inversion.
16
+ * V6.0: Supports FLUX.1 model in Impact KSampler, Detailers, PreviewBridgeLatent
17
+ * V5.0: It is no longer compatible with versions of ComfyUI before 2024.04.08.
18
+ * V4.87.4: Update to a version of ComfyUI after 2024.04.08 for proper functionality.
19
+ * V4.85: Incompatible with the outdated **ComfyUI IPAdapter Plus**. (A version dated March 24th or later is required.)
20
+ * V4.77: Compatibility patch applied. Requires ComfyUI version (Oct. 8th) or later.
21
+ * V4.73.3: ControlNetApply (SEGS) supports AnimateDiff
22
+ * V4.20.1: Due to the feature update in `RegionalSampler`, the parameter order has changed, causing malfunctions in previously created `RegionalSamplers`. Please adjust the parameters accordingly.
23
+ * V4.12: `MASKS` is changed to `MASK`.
24
+ * V4.7.2 isn't compatible with old version of `ControlNet Auxiliary Preprocessor`. If you will use `MediaPipe FaceMesh to SEGS` update to latest version(Sep. 17th).
25
+ * Selection weight syntax is changed(: -> ::) since V3.16. ([tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/ImpactWildcardProcessor.md))
26
+ * Starting from V3.6, requires latest version(Aug 8, 9ccc965) of ComfyUI.
27
+ * **In versions below V3.3.1, there was an issue with the image quality generated after using the UltralyticsDetectorProvider. Please make sure to upgrade to a newer version.**
28
+ * Starting from V3.0, nodes related to `mmdet` are optional nodes that are activated only based on the configuration settings.
29
+ - Through ComfyUI-Impact-Subpack, you can utilize UltralyticsDetectorProvider to access various detection models.
30
+ * Between versions 2.22 and 2.21, there is partial compatibility loss regarding the Detailer workflow. If you continue to use the existing workflow, errors may occur during execution. An additional output called "enhanced_alpha_list" has been added to Detailer-related nodes.
31
+ * The permission error related to cv2 that occurred during the installation of Impact Pack has been patched in version 2.21.4. However, please note that the latest versions of ComfyUI and ComfyUI-Manager are required.
32
+ * The "PreviewBridge" feature may not function correctly on ComfyUI versions released before July 1, 2023.
33
+ * Attempting to load the "ComfyUI-Impact-Pack" on ComfyUI versions released before June 27, 2023, will result in a failure.
34
+ * With the addition of wildcard support in FaceDetailer, the structure of DETAILER_PIPE-related nodes and Detailer nodes has changed. There may be malfunctions when using the existing workflow.
35
+
36
+
37
+ ## How To Install
38
+
39
+ ### **Recommended**
40
+ * Install via [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager).
41
+
42
+ ### **Manual**
43
+ * Navigate to `ComfyUI/custom_nodes` in your terminal (cmd).
44
+ * Clone the repository under the `custom_nodes` directory using the following command:
45
+ ```
46
+ git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
47
+ cd comfyui-impact-pack
48
+ ```
49
+ * Install dependencies in your Python environment.
50
+ * For Windows Portable, run the following command inside `ComfyUI\custom_nodes\comfyui-impact-pack`:
51
+ ```
52
+ ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
53
+ ```
54
+ * If using venv or conda, activate your Python environment first, then run:
55
+ ```
56
+ pip install -r requirements.txt
57
+ ```
58
+
59
+ ### Companion Pack
60
+ * If you need the `Ultralytics Detector Provider` to use various YOLO detection models, you should also install [ComfyUI-Impact-Subpack](https://github.com/ltdrdata/ComfyUI-Impact-Subpack).
61
+
62
+
63
+ ## Custom Nodes
64
+ ### [Detector nodes](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/detectors.md)
65
+ * `SAMLoader (Impact)` - Loads the SAM model.
66
+ * `ONNXDetectorProvider` - Loads the ONNX model to provide BBOX_DETECTOR.
67
+ * `CLIPSegDetectorProvider` - Wrapper for CLIPSeg to provide BBOX_DETECTOR.
68
+ * You need to install the ComfyUI-CLIPSeg node extension.
69
+ * `SEGM Detector (combined)` - Detects segmentation and returns a mask from the input image.
70
+ * `BBOX Detector (combined)` - Detects bounding boxes and returns a mask from the input image.
71
+ * `SAMDetector (combined)` - Utilizes the SAM technology to extract the segment at the location indicated by the input SEGS on the input image and outputs it as a unified mask.
72
+ * `SAMDetector (Segmented)` - It is similar to `SAMDetector (combined)`, but it separates and outputs the detected segments. Multiple segments can be found for the same detected area, and currently, a policy is in place to group them arbitrarily in sets of three. This aspect is expected to be improved in the future.
73
+ * As a result, it outputs the `combined_mask`, which is a unified mask, and `batch_masks`, which are multiple masks grouped together in batch form.
74
+ * While `batch_masks` may not be completely separated, it provides functionality to perform some level of segmentation.
75
+ * `Simple Detector (SEGS)` - Operating primarily with `BBOX_DETECTOR`, and with the additional provision of `SAM_MODEL` or `SEGM_DETECTOR`, this node internally generates improved SEGS through mask operations on both *bbox* and *silhouette*. It serves as a convenient tool to simplify a somewhat intricate workflow.
76
+ * `Simple Detector for Video (SEGS)` – Performs detection on videos composed of image frames. Instead of using a single mask, it performs detection individually on each image frame and generates a SEGS object with a batch of masks.
77
+ * `SAM2 Video Detector (SEGS)` – Similar to `Simple Detector for Video (SEGS)`, but utilizes SAM2’s video tracking technology to generate a SEGS object with a batch of masks.
78
+ * To use this node, you must select a SAM2 model in the SAMLoader.
79
+
80
+
81
+ ### ControlNet, IPAdapter
82
+ * `ControlNetApply (SEGS)` - To apply ControlNet in SEGS, you need to use the Preprocessor Provider node from the Inspire Pack to utilize this node.
83
+ * `segs_preprocessor` and `control_image` can be selectively applied. If a `control_image` is given, `segs_preprocessor` will be ignored.
84
+ * If set to `control_image`, you can preview the cropped cnet image through `SEGSPreview (CNET Image)`. Images generated by `segs_preprocessor` should be verified through the `cnet_images` output of each Detailer.
85
+ * The `segs_preprocessor` operates by applying preprocessing on-the-fly based on the cropped image during the detailing process, while `control_image` will be cropped and used as input to `ControlNetApply (SEGS)`.
86
+ * `ControlNetClear (SEGS)` - Clear applied ControlNet in SEGS
87
+ * `IPAdapterApply (SEGS)` - To apply IPAdapter in SEGS, you need to use the Preprocessor Provider node from the Inspire Pack to utilize this node.
88
+
89
+
90
+ ### Mask operation
91
+ * `Pixelwise(SEGS & SEGS)` - Performs a 'pixelwise and' operation between two SEGS.
92
+ * `Pixelwise(SEGS - SEGS)` - Subtracts one SEGS from another.
93
+ * `Pixelwise(SEGS & MASK)` - Performs a pixelwise AND operation between SEGS and MASK.
94
+ * `Pixelwise(SEGS & MASKS ForEach)` - Performs a pixelwise AND operation between SEGS and MASKS.
95
+ * Please note that this operation is performed with batches of MASKS, not just a single MASK.
96
+ * `Pixelwise(MASK & MASK)` - Performs a 'pixelwise and' operation between two masks.
97
+ * `Pixelwise(MASK - MASK)` - Subtracts one mask from another.
98
+ * `Pixelwise(MASK + MASK)` - Combine two masks.
99
+ * `SEGM Detector (SEGS)` - Detects segmentation and returns SEGS from the input image.
100
+ * `BBOX Detector (SEGS)` - Detects bounding boxes and returns SEGS from the input image.
101
+ * `Dilate Mask` - Dilate Mask.
102
+ * Support erosion for negative value.
103
+ * `Gaussian Blur Mask` - Apply Gaussian Blur to Mask. You can utilize this for mask feathering.
104
+ * `Mask Rect Area` - Create a rectangular mask defined by percentages with preview canvas.
105
+ * `Mask Rect Area (Advanced)` - Create a rectangular mask defined by pixels and image size.
106
+
107
+
108
+ ### [Detailer nodes](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/detailers.md)
109
+ * `Detailer (SEGS)` - Refines the image based on SEGS.
110
+ * `Detailer (SEGS) with auto retry` - Refines the image based on SEGS and will automatically retry if the patch is all black.
111
+ * `DetailerDebug (SEGS)` - Refines the image based on SEGS. Additionally, it provides the ability to monitor the cropped image and the refined image of the cropped image.
112
+ * To prevent regeneration caused by the seed that does not change every time when using 'external_seed', please disable the 'seed random generate' option in the 'Detailer...' node.
113
+ * `MASK to SEGS` - Generates SEGS based on the mask.
114
+ * `MASK to SEGS For Video` - Generates SEGS based on the mask for Video. (Renamed from `MASK to SEGS For AnimateDiff`)
115
+ * When using a single mask, convert it to SEGS to apply it to the entire frame.
116
+ * When using a batch mask, the contour fill feature is disabled.
117
+ * `MediaPipe FaceMesh to SEGS` - Separate each landmark from the mediapipe facemesh image to create labeled SEGS.
118
+ * Usually, the size of images created through the MediaPipe facemesh preprocessor is downscaled. It resizes the MediaPipe facemesh image to the original size given as reference_image_opt for matching sizes during processing.
119
+ * `ToBinaryMask` - Separates the mask generated with alpha values between 0 and 255 into 0 and 255. The non-zero parts are always set to 255.
120
+ * `Masks to Mask List` - This node converts the MASKS in batch form to a list of individual masks.
121
+ * `Mask List to Masks` - This node converts the MASK list to MASK batch form.
122
+ * `EmptySEGS` - Provides an empty SEGS.
123
+ * `MaskPainter` - Provides a feature to draw masks.
124
+ * `FaceDetailer` - Easily detects faces and improves them.
125
+ * `FaceDetailer (pipe)` - Easily detects faces and improves them (for multipass).
126
+ * `MaskDetailer (pipe)` - This is a simple inpaint node that applies the Detailer to the mask area.
127
+
128
+ * `FromDetailer (SDXL/pipe)`, `BasicPipe -> DetailerPipe (SDXL)`, `Edit DetailerPipe (SDXL)` - These are pipe functions used in Detailer for utilizing the refiner model of SDXL.
129
+ * `Any PIPE -> BasicPipe` - Convert the PIPE Value of other custom nodes that are not BASIC_PIPE but internally have the same structure as BASIC_PIPE to BASIC_PIPE. If an incompatible type is applied, it may cause runtime errors.
130
+
131
+
132
+ ### SEGS Manipulation nodes
133
+ * `SEGSDetailer` - Performs detailed work on SEGS without pasting it back onto the original image.
134
+ * `SEGSPaste` - Pastes the results of SEGS onto the original image.
135
+ * If `ref_image_opt` is present, the images contained within SEGS are ignored. Instead, the image within `ref_image_opt` corresponding to the crop area of SEGS is taken and pasted. The size of the image in `ref_image_opt` should be the same as the original image size.
136
+ * This node can be used in conjunction with the processing results of AnimateDiff.
137
+ * `SEGSPreview` - Provides a preview of SEGS.
138
+ * This option is used to preview the improved image through `SEGSDetailer` before merging it into the original. Prior to going through ```SEGSDetailer```, SEGS only contains mask information without image information. If fallback_image_opt is connected to the original image, SEGS without image information will generate a preview using the original image. However, if SEGS already contains image information, fallback_image_opt will be ignored.
139
+ * This node can be used in conjunction with the processing results of AnimateDiff.
140
+ * `SEGSPreview (CNET Image)` - Show images configured with `ControlNetApply (SEGS)` for debugging purposes.
141
+ * `SEGSToImageList` - Convert SEGS To Image List
142
+ * `SEGSToMaskList` - Convert SEGS To Mask List
143
+ * `SEGS Filter (label)` - This node filters SEGS based on the label of the detected areas.
144
+ * `SEGS Filter (ordered)` - This node sorts SEGS based on size and position and retrieves SEGs within a certain range.
145
+ * `SEGS Filter (range)` - This node retrieves only SEGs from SEGS that have a size and position within a certain range.
146
+ * `SEGS Filter (non max suppression)` - This node filters SEGS by removing those with high overlap based on the Intersection over Union (IoU) threshold, keeping only the most confident detections.
147
+ * `SEGS Filter (intersection)` - This node filters segs1, keeping only the SEGS that do not significantly overlap with any SEGS in segs2, based on the Intersection over Area (IoA) threshold.
148
+ * `SEGS Assign (label)` - Assign labels sequentially to SEGS. This node is useful when used with `[LAB]` of FaceDetailer.
149
+ * `SEGSConcat` - Concatenate segs1 and segs2. If source shape of segs1 and segs2 are different from segs2 will be ignored.
150
+ * `SEGS Merge` - SEGS contains multiple SEGs. SEGS Merge integrates several SEGs into a single merged SEG. The label is changed to `merged` and the confidence becomes the minimum confidence. The applied controlnet and cropped_image are removed.
151
+ * `Picker (SEGS)` - Among the input SEGS, you can select a specific SEG through a dialog. If no SEG is selected, it outputs an empty SEGS. Increasing the batch_size of SEGSDetailer can be used for the purpose of selecting from the candidates.
152
+ * `Set Default Image For SEGS` - Set a default image for SEGS. SEGS with images set this way do not need to have a fallback image set. When override is set to false, the original image is preserved.
153
+ * `Remove Image from SEGS` - Remove the image set for the SEGS that has been configured by "Set Default Image for SEGS" or SEGSDetailer. When the image for the SEGS is removed, the Detailer node will operate based on the currently processed image instead of the SEGS.
154
+ * `Make Tile SEGS` - [experimental] Create SEGS in the form of tiles from an image to facilitate experiments for Tiled Upscale using the Detailer.
155
+ * The `filter_in_segs_opt` and `filter_out_segs_opt` are optional inputs. If these inputs are provided, when creating the tiles, the mask for each tile is generated by overlapping with the mask of `filter_in_segs_opt` and excluding the overlap with the mask of `filter_out_segs_opt`. Tiles with an empty mask will not be created as SEGS.
156
+ * `Dilate Mask (SEGS)` - Dilate/Erosion Mask in SEGS
157
+ * `Gaussian Blur Mask (SEGS)` - Apply Gaussian Blur to Mask in SEGS
158
+ * `SEGS_ELT Manipulation` - experimental nodes
159
+ * `DecomposeSEGS` - Decompose SEGS to allow for detailed manipulation.
160
+ * `AssembleSEGS` - Reassemble the decomposed SEGS.
161
+ * `From SEG_ELT` - Extract detailed information from SEG_ELT.
162
+ * `Edit SEG_ELT` - Modify some of the information in SEG_ELT.
163
+ * `Dilate SEG_ELT` - Dilate the mask of SEG_ELT.
164
+ * `From SEG_ELT` bbox - Extract coordinate from bbox in SEG_ELT
165
+ * `From SEG_ELT` crop_region - Extract coordinate from crop_region in SEG_ELT
166
+ * `Count Elt in SEGS` - Number of Elts ins SEGS
167
+
168
+
169
+ ### Pipe nodes
170
+ * `ToDetailerPipe`, `FromDetailerPipe` - These nodes are used to bundle multiple inputs used in the detailer, such as models and vae, ..., into a single DETAILER_PIPE or extract the elements that are bundled in the DETAILER_PIPE.
171
+ * `ToBasicPipe`, `FromBasicPipe` - These nodes are used to bundle model, clip, vae, positive conditioning, and negative conditioning into a single BASIC_PIPE, or extract each element from the BASIC_PIPE.
172
+ * `EditBasicPipe`, `EditDetailerPipe` - These nodes are used to replace some elements in BASIC_PIPE or DETAILER_PIPE.
173
+ * `FromDetailerPipe_v2`, `FromBasicPipe_v2` - It has the same functionality as `FromDetailerPipe` and `FromBasicPipe`, but it has an additional output that directly exports the input pipe. It is useful when editing EditBasicPipe and EditDetailerPipe.
174
+ * `Latent Scale (on Pixel Space)` - This node converts latent to pixel space, upscales it, and then converts it back to latent.
175
+ * If upscale_model_opt is provided, it uses the model to upscale the pixel and then downscales it using the interpolation method provided in scale_method to the target resolution.
176
+ * `PixelKSampleUpscalerProvider` - An upscaler is provided that converts latent to pixels using VAEDecode, performs upscaling, converts back to latent using VAEEncode, and then performs k-sampling. This upscaler can be attached to nodes such as `Iterative Upscale` for use.
177
+ * Similar to `Latent Scale (on Pixel Space)`, if upscale_model_opt is provided, it performs pixel upscaling using the model.
178
+ * `PixelTiledKSampleUpscalerProvider` - It is similar to `PixelKSampleUpscalerProvider`, but it uses `ComfyUI_TiledKSampler` and Tiled VAE Decoder/Encoder to avoid GPU VRAM issues at high resolutions.
179
+ * You need to install the [BlenderNeko/ComfyUI_TiledKSampler](https://github.com/BlenderNeko/ComfyUI_TiledKSampler) node extension.
180
+
181
+
182
+ ### PK_HOOK
183
+ * `DenoiseScheduleHookProvider` - IterativeUpscale provides a hook that gradually changes the denoise to target_denoise as the iterative-step progresses.
184
+ * `CfgScheduleHookProvider` - IterativeUpscale provides a hook that gradually changes the cfg to target_cfg as the iterative-step progresses.
185
+ * `StepsScheduleHookProvider` - IterativeUpscale provides a hook that gradually changes the sampling-steps to target_steps as the iterative-step progresses.
186
+ * `NoiseInjectionHookProvider` - During each iteration of IterativeUpscale, noise is injected into the latent space while varying the strength according to a schedule.
187
+ * You need to install the [BlenderNeko/ComfyUI_Noise](https://github.com/BlenderNeko/ComfyUI_Noise) node extension.
188
+ * The seed serves as the initial value required for generating noise, and it increments by 1 with each iteration as the process unfolds.
189
+ * The source determines the types of CPU noise and GPU noise to be configured.
190
+ * Currently, there is only a simple schedule available, where the strength of the noise varies from start_strength to end_strength during the progression of each iteration.
191
+ * `UnsamplerHookProvider` - Apply Unsampler during each iteration. To use this node, ComfyUI_Noise must be installed.
192
+ * `PixelKSampleHookCombine` - This is used to connect two PK_HOOKs. hook1 is executed first and then hook2 is executed.
193
+ * If you want to simultaneously change cfg and denoise, you can combine the PK_HOOKs of CfgScheduleHookProvider and PixelKSampleHookCombine.
194
+
195
+
196
+ ### DETAILER_HOOK
197
+ * `NoiseInjectionDetailerHookProvider` - The `detailer_hook` is a hook in the `Detailer` that injects noise during the processing of each SEGS.
198
+ * `UnsamplerDetailerHookProvider` - Apply Unsampler during each cycle. To use this node, ComfyUI_Noise must be installed.
199
+ * `DenoiseSchedulerDetailerHookProvider` - During the progress of the cycle, the detailer's denoise is altered up to the `target_denoise`.
200
+ * `CoreMLDetailerHookProvider` - CoreML supports only 512x512, 512x768, 768x512, 768x768 size sampling. CoreMLDetailerHookProvider precisely fixes the upscale of the crop_region to this size. When using this hook, it will always be selected size, regardless of the guide_size. However, if the guide_size is too small, skipping will occur.
201
+ * `DetailerHookCombine` - This is used to connect two DETAILER_HOOKs. Similar to PixelKSampleHookCombine.
202
+ * `SEGSOrderedFilterDetailerHook`, SEGSRangeFilterDetailerHook, SEGSLabelFilterDetailerHook - There are a wrapper node that provides SEGSFilter nodes to be applied in FaceDetailer or Detector by creating DETAILER_HOOK.
203
+ * `PreviewDetailerHook` - Connecting this hook node helps provide assistance for viewing previews whenever SEGS Detailing tasks are completed. When working with a large number of SEGS, such as Make Tile SEGS, it allows for monitoring the situation as improvements progress incrementally.
204
+ * Since this is the hook applied when pasting onto the original image, it has no effect on nodes like `SEGSDetailer`.
205
+ * `VariationNoiseDetailerHookProvider` - Apply variation seed to the detailer. It can be applied in multiple stages through combine.
206
+ * `CustomSamplerDetailerHookProvider` - Apply a hook that allows you to use a custom sampler in the Detailer nodes. When using `DetailerHookCombine`, the sampler from the first hook is applied.
207
+ * `LamaRemoverDetailerHookProvider` – Applies Lama Remover to the upscaled image during the detailing stage. If `skip_sampling` is set to True, Lama Remover can be used alone without the detailing stage, allowing it to simply remove detected regions.
208
+ * Not applicable for **AnimateDiff** detailers. When using `DetailerHookCombine`, `skip_sampling` is only applied if it is set to `True` for all hooks.
209
+ * To use this node, the node pack at [Layer-norm/comfyui-lama-remover](https://github.com/Layer-norm/comfyui-lama-remover) must be installed.
210
+
211
+
212
+ ### Iterative Upscale nodes
213
+ * `Iterative Upscale (Latent/on Pixel Space)` - The upscaler takes the input upscaler and splits the scale_factor into steps, then iteratively performs upscaling.
214
+ This takes latent as input and outputs latent as the result.
215
+ * `Iterative Upscale (Image)` - The upscaler takes the input upscaler and splits the scale_factor into steps, then iteratively performs upscaling. This takes image as input and outputs image as the result.
216
+ * Internally, this node uses 'Iterative Upscale (Latent)'.
217
+
218
+
219
+ ### TwoSamplers nodes
220
+ * `TwoSamplersForMask` - This node can apply two samplers depending on the mask area. The base_sampler is applied to the area where the mask is 0, while the mask_sampler is applied to the area where the mask is 1.
221
+ * Note: The latent encoded through VAEEncodeForInpaint cannot be used.
222
+ * `KSamplerProvider` - This is a wrapper that enables KSampler to be used in TwoSamplersForMask TwoSamplersForMaskUpscalerProvider.
223
+ * `TiledKSamplerProvider` - ComfyUI_TiledKSampler is a wrapper that provides KSAMPLER.
224
+ * You need to install the [BlenderNeko/ComfyUI_TiledKSampler](https://github.com/BlenderNeko/ComfyUI_TiledKSampler) node extension.
225
+
226
+ * `TwoAdvancedSamplersForMask` - TwoSamplersForMask is similar to TwoAdvancedSamplersForMask, but they differ in their operation. TwoSamplersForMask performs sampling in the mask area only after all the samples in the base area are finished. On the other hand, TwoAdvancedSamplersForMask performs sampling in both the base area and the mask area sequentially at each step.
227
+ * `KSamplerAdvancedProvider` - This is a wrapper that enables KSampler to be used in TwoAdvancedSamplersForMask, RegionalSampler.
228
+ * sigma_factor: By multiplying the denoise schedule by the sigma_factor, you can adjust the amount of denoising based on the configured denoise.
229
+
230
+ * `TwoSamplersForMaskUpscalerProvider` - This is an Upscaler that extends TwoSamplersForMask to be used in Iterative Upscale.
231
+ * TwoSamplersForMaskUpscalerProviderPipe - pipe version of TwoSamplersForMaskUpscalerProvider.
232
+
233
+
234
+ ### Image Utils
235
+ * `PreviewBridge (image)` - This custom node can be used with a bridge for image when using the MaskEditor feature of Clipspace.
236
+ * `PreviewBridge (latent)` - This custom node can be used with a bridge for latent image when using the MaskEditor feature of Clipspace.
237
+ * If a latent with a mask is provided as input, it displays the mask. Additionally, the mask output provides the mask set in the latent.
238
+ * If a latent without a mask is provided as input, it outputs the original latent as is, but the mask output provides an output with the entire region set as a mask.
239
+ * When set mask through MaskEditor, a mask is applied to the latent, and the output includes the stored mask. The same mask is also output as the mask output.
240
+ * When connected to `vae_opt`, it takes higher priority than the `preview_method`.
241
+ * `ImageSender`, `ImageReceiver` - The images generated in ImageSender are automatically sent to the ImageReceiver with the same link_id.
242
+ * `LatentSender`, `LatentReceiver` - The latent generated in LatentSender are automatically sent to the LatentReceiver with the same link_id.
243
+ * Furthermore, LatentSender is implemented with PreviewLatent, which stores the latent in payload form within the image thumbnail.
244
+ * Due to the current structure of ComfyUI, it is unable to distinguish between SDXL latent and SD1.5/SD2.1 latent. Therefore, it generates thumbnails by decoding them using the SD1.5 method.
245
+
246
+
247
+ ### Switch nodes
248
+ * `Switch (image,mask)`, `Switch (latent)`, `Switch (SEGS)` - Among multiple inputs, it selects the input designated by the selector and outputs it. The first input must be provided, while the others are optional. However, if the input specified by the selector is not connected, an error may occur.
249
+ * `Switch (Any)` - This is a Switch node that takes an arbitrary number of inputs and produces a single output. Its type is determined when connected to any node, and connecting inputs increases the available slots for connections.
250
+ * `Inversed Switch (Any)` - In contrast to `Switch (Any)`, it takes a single input and outputs one of many.
251
+ * NOTE: See this [tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/switch.md)
252
+
253
+
254
+ ### [Wildcards](http://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/ImpactWildcard.md) nodes
255
+ * These are nodes that supports syntax in the form of `__wildcard-name__` and dynamic prompt syntax like `{a|b|c}`.
256
+ * Wildcard files can be used by placing `.txt` or `.yaml` files under either `ComfyUI-Impact-Pack/wildcards` or `ComfyUI-Impact-Pack/custom_wildcards` paths.
257
+ * You can download and use [Wildcard YAML](https://civitai.com/models/138970/billions-of-wildcards-all-in-one) files in this format.
258
+ * After the first execution, you can change the custom wildcards path in the `custom_wildcards` entry within the `ComfyUI-Impact-Pack/impact-pack.ini` file created.
259
+ * `ImpactWildcardProcessor` - The text is generated by processing the wildcard in the Text. If the mode is set to "populate", a dynamic prompt is generated with each execution and the input is filled in the second textbox. If the mode is set to "fixed", the content of the second textbox remains unchanged.
260
+ * When an image is generated with the "fixed" mode, the prompt used for that particular generation is stored in the metadata.
261
+ * `ImpactWildcardEncode` - Similar to ImpactWildcardProcessor, this provides the loading functionality of LoRAs (e.g. `<lora:some_awesome_lora:0.7:1.2>`). Populated prompts are encoded using the clip after all the lora loading is done.
262
+ * If the `Inspire Pack` is installed, you can use **Lora Block Weight** in the form of `LBW=lbw spec;`
263
+ * `<lora:chunli:1.0:1.0:LBW=B11:0,0,0,0,0,0,0,0,0,0,A,0,0,0,0,0,0;A=0.;>`, `<lora:chunli:1.0:1.0:LBW=0,0,0,0,0,0,0,0,0,0,A,B,0,0,0,0,0;A=0.5;B=0.2;>`, `<lora:chunli:1.0:1.0:LBW=SD-MIDD;>`
264
+
265
+
266
+ ### Regional Sampling
267
+ * These nodes offer the capability to divide regions and perform partial sampling using a mask. Unlike TwoSamplersForMask, sampling for each region is applied during each step.
268
+ * `RegionalPrompt` - This node combines a **mask** for specifying regions and the **sampler** to apply to each region to create `REGIONAL_PROMPTS`.
269
+ * `CombineRegionalPrompts` - Combine multiple `REGIONAL_PROMPTS` to create a single `REGIONAL_PROMPTS`.
270
+ * `RegionalSampler` - This node performs sampling using a base sampler and regional prompts. Sampling by the base sampler is executed at each step, while sampling for each region is performed through the sampler bound to each region.
271
+ * overlap_factor - Specifies the amount of overlap for each region to blend well with the area outside the mask.
272
+ * restore_latent - When sampling each region, restore the areas outside the mask to the base latent, preventing additional noise from being introduced outside the mask during region sampling.
273
+ * `RegionalSamplerAdvanced` - This is the Advanced version of the RegionalSampler. You can control it using `step` instead of `denoise`.
274
+ > NOTE: The `sde` sampler and `uni_pc` sampler introduce additional noise during each step of the sampling process. To mitigate this, when sampling each region, the `uni_pc` sampler applies additional `dpmpp_fast`, and the sde sampler applies the `dpmpp_2m` sampler as an additional measure.
275
+
276
+
277
+ ### Impact KSampler
278
+ * These samplers support basic_pipe and AYS/OSS/GITS scheduler
279
+ * `KSampler (pipe)` - pipe version of KSampler
280
+ * `KSampler (advanced/pipe)` - pipe version of KSamplerAdvacned
281
+ * When converting the scheduler widget to input, refer to the `Impact Scheduler Adapter` node to resolve compatibility issues.
282
+ * `GITSScheduler Func Provider` - provider scheduler function for GITSScheduler
283
+
284
+
285
+ ### Batch/List Util
286
+ * `Image Batch to Image List` - Convert Image batch to Image List
287
+ - You can use images generated in a multi batch to handle them
288
+ * `Image List to Image Batch` - Convert Image List to Image Batch
289
+ * `Make Image List` - Convert multiple images into a single image list
290
+ * `Make Image Batch` - Convert multiple images into a single image batch
291
+ - The input of images can be scaled up as needed
292
+ * `Masks to Mask List`, `Mask List to Masks`, `Make Mask List`, `Make Mask Batch` - It has the same functionality as the nodes above, but uses mask as input instead of image.
293
+ * `Flatten Mask Batch` - Flattens a Mask Batch into a single Mask. Normal operation is not guaranteed for non-binary masks.
294
+ * `Make List (Any)` - Create a list with arbitrary values.
295
+ * `Select Nth Item (Any list)` - Selects the Nth item from a list. If the index is out of range, it returns the last item in the list.
296
+
297
+
298
+ ### Logics (experimental)
299
+ * These nodes are experimental nodes designed to implement the logic for loops and dynamic switching.
300
+ * `ImpactCompare`, `ImpactConditionalBranch`, `ImpactConditionalBranchSelMode`, `ImpactInt`, `ImpactBoolean`, `ImpactValueSender`, `ImpactValueReceiver`, `ImpactImageInfo`, `ImpactMinMax`, `ImpactNeg`, `ImpactConditionalStopIteration`
301
+ * `ImpactIsNotEmptySEGS` - This node returns `true` only if the input SEGS is not empty.
302
+ * `ImpactIfNone` - Returns `true` if any_input is None, and returns `false` if it is not None.
303
+ * `Queue Trigger` - When this node is executed, it adds a new queue to assist with repetitive tasks. It will only execute if the signal's status changes.
304
+ * `Queue Trigger (Countdown)` - Like the Queue Trigger, it adds a queue, but only adds it if it's greater than 1, and decrements the count by one each time it runs.
305
+ * `Sleep` - Waits for the specified time (in seconds).
306
+ * `Set Widget Value` - This node sets one of the optional inputs to the specified node's widget. An error may occur if the types do not match.
307
+ * `Set Mute State` - This node changes the mute state of a specific node.
308
+ * `Control Bridge` - This node modifies the state of the connected control nodes based on the `mode` and `behavior` . If there are nodes that require a change, the current execution is paused, the mute status is updated, and a new prompt queue is inserted.
309
+ * When the `mode` is `active`, it makes the connected control nodes active regardless of the behavior.
310
+ * When the `mode` is `Bypass/Mute`, it changes the state of the connected nodes based on whether the behavior is `Bypass` or `Mute`.
311
+ * **Limitation**: Due to these characteristics, it does not function correctly when the batch count exceeds 1. Additionally, it does not guarantee proper operation when the seed is randomized or when the state of nodes is altered by actions such as `Queue Trigger`, `Set Widget Value`, `Set Mute`, before the Control Bridge.
312
+ * When utilizing this node, please structure the workflow in such a way that `Queue Trigger`, `Set Widget Value`, `Set Mute State`, and similar actions are executed at the end of the workflow.
313
+ * If you want to change the value of the seed at each iteration, please ensure that Set Widget Value is executed at the end of the workflow instead of using randomization.
314
+ * It is not a problem if the seed changes due to randomization as long as it occurs after the Control Bridge section.
315
+ * `Remote Boolean (on prompt)`, `Remote Int (on prompt)` - At the start of the prompt, this node forcibly sets the `widget_value` of `node_id`. It is disregarded if the target widget type is different.
316
+ * You can find the `node_id` by checking through [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) using the format `Badge: #ID Nickname`.
317
+ * Experimental set of nodes for implementing loop functionality (tutorial to be prepared later / [example workflow](test/loop-test.json)).
318
+
319
+
320
+ ### HuggingFace nodes
321
+ * These nodes provide functionalities based on HuggingFace repository models.
322
+ * The path where the HuggingFace model cache is stored can be changed through the `HF_HOME` environment variable.
323
+ * `HF Transformers Classifier Provider` - This is a node that provides a classifier based on HuggingFace's transformers models.
324
+ * The 'repo id' parameter should contain HuggingFace's repo id. When `preset_repo_id` is set to `Manual repo id`, use the manually entered repo id in `manual_repo_id`.
325
+ * e.g. 'rizvandwiki/gender-classification-2' is a repository that provides a model for gender classification.
326
+ * `SEGS Classify` - This node utilizes the `TRANSFORMERS_CLASSIFIER` loaded with 'HF Transformers Classifier Provider' to classify `SEGS`.
327
+ * The 'expr' allows for forms like `label > number`, and in the case of `preset_expr` being `Manual expr`, it uses the expression entered in `manual_expr`.
328
+ * For example, in the case of `male <= 0.4`, if the score of the `male` label in the classification result is less than or equal to 0.4, it is categorized as `filtered_SEGS`, otherwise, it is categorized as `remained_SEGS`.
329
+ * For supported labels, please refer to the `config.json` of the respective HuggingFace repository.
330
+ * `#Female` and `#Male` are symbols that group multiple labels such as `Female, women, woman, ...`, for convenience, rather than being single labels.
331
+
332
+
333
+ ### Etc nodes
334
+ * `Impact Scheduler Adapter` - With the addition of AYS to the scheduler of the Impact Pack and Inspire Pack, there is an issue of incompatibility when the existing scheduler widget is converted to input. The Impact Scheduler Adapter allows for an indirect connection to be possible.
335
+ * `StringListToString` - Convert String List to String
336
+ * `WildcardPromptFromString` - Create labeled wildcard for detailer from string.
337
+ * This node works well when used with MakeTileSEGS. [[Link](https://github.com/ltdrdata/ComfyUI-Impact-Pack/pull/536#discussion_r1586060779)]
338
+
339
+ * `String Selector` - It selects and returns a portion of the string. When `multiline` mode is disabled, it simply returns the string of the line pointed to by the selector. When `multiline` mode is enabled, it divides the string based on lines that start with `#` and returns them. If the `select` value is larger than the number of items, it will start counting from the first line again and return accordingly.
340
+ * `Combine Conditionings` - It takes multiple conditionings as input and combines them into a single conditioning.
341
+ * `Concat Conditionings` - It takes multiple conditionings as input and concat them into a single conditioning.
342
+ * `Negative Cond Placeholder` - Models like FLUX.1 do not use Negative Conditioning. This is a placeholder node for them. You can use FLUX.1 by replacing the Negative Conditioning used in Impact KSampler, KSampler (Inspire), and Detailer with this node.
343
+ * `Execution Order Controller` - A helper node that can forcibly control the execution order of nodes.
344
+ * Connect the output of the node that should be executed first to the signal, and make the input of the node that should be executed later pass through this node.
345
+ * `List Bridge` - When passing the list output through this node, it collects and organizes the data before forwarding it, which ensures that the previous stage's sub-workflow has been completed.
346
+
347
+
348
+ ## Feature
349
+ * `Interactive SAM Detector (Clipspace)` - When you right-click on a node that has 'MASK' and 'IMAGE' outputs, a context menu will open. From this menu, you can either open a dialog to create a SAM Mask using 'Open in SAM Detector', or copy the content (likely mask data) using 'Copy (Clipspace)' and generate a mask using 'Impact SAM Detector' from the clipspace menu, and then paste it using 'Paste (Clipspace)'.
350
+ * Providing a feature to detect errors that occur when mixing models and clips from checkpoints such as `SDXL Base`, `SDXL Refiner`, `SD1.x`, `SD2.x` during sample execution, and reporting appropriate errors.
351
+
352
+
353
+ ## How To Install?
354
+
355
+ ### Install via ComfyUI-Manager (Recommended)
356
+ * Search `ComfyUI Impact Pack` in ComfyUI-Manager and click `Install` button.
357
+
358
+ ### Manual Install (Not Recommended)
359
+ 1. `cd custom_nodes`
360
+ 2. `git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack`
361
+ 3. `cd ComfyUI-Impact-Pack`
362
+ 4. `pip install -r requirements.txt`
363
+ * **IMPORTANT**:
364
+ * You must install it within the Python environment where ComfyUI is running.
365
+ * For the portable version, use `<installed path>\python_embeded\python.exe -m pip` instead of `pip`. For a `venv`, activate the `venv` first and then use `pip`.
366
+ 5. Restart ComfyUI
367
+
368
+ * NOTE1: If an error occurs during the installation process, please refer to [Troubleshooting Page](troubleshooting/TROUBLESHOOTING.md) for assistance.
369
+ * NOTE2: You can use this colab notebook [colab notebook](https://colab.research.google.com/github/ltdrdata/ComfyUI-Impact-Pack/blob/Main/notebook/comfyui_colab_impact_pack.ipynb) to launch it. This notebook automatically downloads the impact pack to the custom_nodes directory, installs the tested dependencies, and runs it.
370
+ * NOTE3: If you create an empty file named `skip_download_model` in the `ComfyUI/custom_nodes/` directory, it will skip the model download step during the installation of the impact pack.
371
+
372
+
373
+ ## Package Dependencies (If you need to manual setup.)
374
+
375
+ * pip install
376
+ * segment-anything
377
+ * scikit-image
378
+ * piexif
379
+ * opencv-python
380
+ * scipy
381
+ * numpy<2
382
+ * dill
383
+ * matplotlib
384
+ * (optional) onnxruntime
385
+ * (deprecated) openmim # for mim
386
+ * (deprecated) pycocotools # for mim
387
+
388
+ * linux packages (ubuntu)
389
+ * libgl1-mesa-glx
390
+ * libglib2.0-0
391
+
392
+
393
+ ## Config example
394
+ * Once you run the Impact Pack for the first time, an `impact-pack.ini` file will be automatically generated in the Impact Pack directory. You can modify this configuration file to customize the default behavior.
395
+ * `dependency_version` - don't touch this
396
+ * `sam_editor_cpu` - use cpu for `SAM editor` instead of gpu
397
+ * sam_editor_model: Specify the SAM model for the SAM editor.
398
+ * You can download various SAM models using ComfyUI-Manager.
399
+ * Path to SAM model: `ComfyUI/models/sams`
400
+ ```
401
+ [default]
402
+ sam_editor_cpu = False
403
+ sam_editor_model = sam_vit_b_01ec64.pth
404
+ ```
405
+
406
+
407
+ ## Other Materials (auto-download when installing)
408
+
409
+ * ComfyUI/models/sams <= https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
410
+
411
+
412
+ ## Troubleshooting page
413
+ * [Troubleshooting Page](troubleshooting/TROUBLESHOOTING.md)
414
+
415
+
416
+ ## How To Use (DDetailer feature)
417
+
418
+ #### 1. Basic auto face detection and refine exapmle.
419
+ ![simple](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/simple.png)
420
+ * The face that has been damaged due to low resolution is restored with high resolution by generating and synthesizing it, in order to restore the details.
421
+ * The FaceDetailer node is a combination of a Detector node for face detection and a Detailer node for image enhancement. See the [Advanced Tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/tutorial/advanced.md) for a more detailed explanation.
422
+ * The MASK output of FaceDetailer provides a visualization of where the detected and enhanced areas are.
423
+
424
+ ![simple-orig](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/simple-original.png) ![simple-refined](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/simple-refined.png)
425
+ * You can see that the face in the image on the left has increased detail as in the image on the right.
426
+
427
+ #### 2. 2Pass refine (restore a severely damaged face)
428
+ ![2pass-workflow-example](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/2pass-simple.png)
429
+ * Although two FaceDetailers can be attached together for a 2-pass configuration, various common inputs used in KSampler can be passed through DETAILER_PIPE, so FaceDetailerPipe can be used to configure easily.
430
+ * In 1pass, only rough outline recovery is required, so restore with a reasonable resolution and low options. However, if you increase the dilation at this time, not only the face but also the surrounding parts are included in the recovery range, so it is useful when you need to reshape the face other than the facial part.
431
+
432
+ ![2pass-example-original](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/2pass-original.png) ![2pass-example-middle](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/2pass-1pass.png) ![2pass-example-result](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/2pass-2pass.png)
433
+ * In the first stage, the severely damaged face is restored to some extent, and in the second stage, the details are restored
434
+
435
+ #### 3. Face Bbox(bounding box) + Person silhouette segmentation (prevent distortion of the background.)
436
+ ![combination-workflow-example](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/combination.jpg)
437
+ ![combination-example-original](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/combination-original.png) ![combination-example-refined](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/combination-refined.png)
438
+
439
+ * Facial synthesis that emphasizes details is delicately aligned with the contours of the face, and it can be observed that it does not affect the image outside of the face.
440
+
441
+ * The BBoxDetectorForEach node is used to detect faces, and the SAMDetectorCombined node is used to find the segment related to the detected face. By using the Segs & Mask node with the two masks obtained in this way, an accurate mask that intersects based on segs can be generated. If this generated mask is input to the DetailerForEach node, only the target area can be created in high resolution from the image and then composited.
442
+
443
+ #### 4. Iterative Upscale
444
+ ![upscale-workflow-example](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/upscale-workflow.png)
445
+
446
+ * The IterativeUpscale node is a node that enlarges an image/latent by a scale_factor. In this process, the upscale is carried out progressively by dividing it into steps.
447
+ * IterativeUpscale takes an Upscaler as an input, similar to a plugin, and uses it during each iteration. PixelKSampleUpscalerProvider is an Upscaler that converts the latent representation to pixel space and applies ksampling.
448
+ * The upscale_model_opt is an optional parameter that determines whether to use the upscale function of the model base if available. Using the upscale function of the model base can significantly reduce the number of iterative steps required. If an x2 upscaler is used, the image/latent is first upscaled by a factor of 2 and then downscaled to the target scale at each step before further processing is done.
449
+
450
+ * The following image is an image of 304x512 pixels and the same image scaled up to three times its original size using IterativeUpscale.
451
+
452
+ ![combination-example-original](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/upscale-original.png) ![combination-example-refined](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/upscale-3x.png)
453
+
454
+
455
+ #### 5. Interactive SAM Detector (Clipspace)
456
+
457
+ * When you right-click on the node that outputs 'MASK' and 'IMAGE', a menu called "Open in SAM Detector" appears, as shown in the following picture. Clicking on the menu opens a dialog in SAM's functionality, allowing you to generate a segment mask.
458
+ ![samdetector-menu](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/SAMDetector-menu.png)
459
+
460
+ * By clicking the left mouse button on a coordinate, a positive prompt in blue color is entered, indicating the area that should be included. Clicking the right mouse button on a coordinate enters a negative prompt in red color, indicating the area that should be excluded. Positive prompts represent the areas that should be included, while negative prompts represent the areas that should be excluded.
461
+ * You can remove the points that were added by using the "undo" button. After selecting the points, pressing the "detect" button generates the mask. Additionally, you can adjust the fidelity slider to determine the extent to which the mask belongs to the confidence region.
462
+
463
+ ![samdetector-dialog](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/SAMDetector-dialog.jpg)
464
+
465
+ * If you opened the dialog through "Open in SAM Detector" from the node, you can directly apply the changes by clicking the "Save to node" button. However, if you opened the dialog through the "clipspace" menu, you can save it to clipspace by clicking the "Save" button.
466
+
467
+ ![samdetector-result](https://github.com/ltdrdata/ComfyUI-extension-tutorials/raw/Main/ComfyUI-Impact-Pack/images/SAMDetector-result.jpg)
468
+
469
+ * When you execute using the reflected mask in the node, you can observe that the image and mask are displayed separately.
470
+
471
+
472
+ ## Others Tutorials
473
+ * [ComfyUI-extension-tutorials/ComfyUI-Impact-Pack](https://github.com/ltdrdata/ComfyUI-extension-tutorials/tree/Main/ComfyUI-Impact-Pack) - You can find various tutorials and workflows on this page.
474
+ * [Advanced Tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/advanced.md)
475
+ * [SAM Application](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/sam.md)
476
+ * [PreviewBridge](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/previewbridge.md)
477
+ * [Mask Pointer](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/maskpointer.md)
478
+ * [ONNX Tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/ONNX.md)
479
+ * [CLIPSeg Tutorial](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/clipseg.md)
480
+ * [Extreme Highresolution Upscale](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/extreme-upscale.md)
481
+ * [TwoSamplersForMask](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/TwoSamplers.md)
482
+ * [TwoAdvancedSamplersForMask](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/TwoAdvancedSamplers.md)
483
+ * [Advanced Iterative Upscale: PK_HOOK](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/pk_hook.md)
484
+ * [Advanced Iterative Upscale: TwoSamplersForMask Upscale Provider](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/TwoSamplersUpscale.md)
485
+ * [Interactive SAM + PreviewBridge](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/sam_with_preview_bridge.md)
486
+ * [ImageSender/ImageReceiver/LatentSender/LatentReceiver](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/sender_receiver.md)
487
+ * [ImpactWildcardProcessor](https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/ImpactWildcardProcessor.md)
488
+
489
+
490
+ ## Credits
491
+
492
+ ComfyUI/[ComfyUI](https://github.com/comfyanonymous/ComfyUI) - A powerful and modular stable diffusion GUI.
493
+
494
+ dustysys/[ddetailer](https://github.com/dustysys/ddetailer) - DDetailer for Stable-diffusion-webUI extension.
495
+
496
+ Bing-su/[dddetailer](https://github.com/Bing-su/dddetailer) - The anime-face-detector used in ddetailer has been updated to be compatible with mmdet 3.0.0, and we have also applied a patch to the pycocotools dependency for Windows environment in ddetailer.
497
+
498
+ facebook/[segment-anything](https://github.com/facebookresearch/segment-anything) - Segmentation Anything!
499
+
500
+ hysts/[anime-face-detector](https://github.com/hysts/anime-face-detector) - Creator of `anime-face_yolov3`, which has impressive performance on a variety of art styles.
501
+
502
+ open-mmlab/[mmdetection](https://github.com/open-mmlab/mmdetection) - Object detection toolset. `dd-person_mask2former` was trained via transfer learning using their [R-50 Mask2Former instance segmentation model](https://github.com/open-mmlab/mmdetection/tree/master/configs/mask2former#instance-segmentation) as a base.
503
+
504
+ biegert/[ComfyUI-CLIPSeg](https://github.com/biegert/ComfyUI-CLIPSeg) - This is a custom node that enables the use of CLIPSeg technology, which can find segments through prompts, in ComfyUI.
505
+
506
+ BlenderNeok/[ComfyUI-TiledKSampler](https://github.com/BlenderNeko/ComfyUI_TiledKSampler) - The tile sampler allows high-resolution sampling even in places with low GPU VRAM.
507
+
508
+ BlenderNeok/[ComfyUI_Noise](https://github.com/BlenderNeko/ComfyUI_Noise) - The noise injection feature relies on this function and slerp code for noise variation
509
+
510
+ WASasquatch/[was-node-suite-comfyui](https://github.com/WASasquatch/was-node-suite-comfyui) - A powerful custom node extensions of ComfyUI.
511
+
512
+ Trung0246/[ComfyUI-0246](https://github.com/Trung0246/ComfyUI-0246) - Nice bypass hack!
513
+
514
+ Layer-norm/[comfyui-lama-remover](https://github.com/Layer-norm/comfyui-lama-remover) - Required for using `LamaRemoverDetailerHook`.
comfyui-impact-pack/__init__.py ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ @author: Dr.Lt.Data
3
+ @title: Impact Pack
4
+ @nickname: Impact Pack
5
+ @description: This extension offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler.
6
+ """
7
+
8
+ import folder_paths
9
+ import os
10
+ import sys
11
+ import logging
12
+
13
+ comfy_path = os.path.dirname(folder_paths.__file__)
14
+ impact_path = os.path.join(os.path.dirname(__file__))
15
+ modules_path = os.path.join(os.path.dirname(__file__), "modules")
16
+
17
+ sys.path.append(modules_path)
18
+
19
+ import impact.config
20
+ logging.info(f"### Loading: ComfyUI-Impact-Pack ({impact.config.version})")
21
+
22
+ # Core
23
+ # recheck dependencies for colab
24
+ try:
25
+ import folder_paths
26
+ import torch # noqa: F401
27
+ import cv2 # noqa: F401
28
+ from cv2 import setNumThreads # noqa: F401
29
+ import numpy as np # noqa: F401
30
+ import comfy.samplers
31
+ import comfy.sd # noqa: F401
32
+ from PIL import Image, ImageFilter # noqa: F401
33
+ from skimage.measure import label, regionprops # noqa: F401
34
+ from collections import namedtuple # noqa: F401
35
+ import piexif # noqa: F401
36
+ import nodes
37
+ except Exception as e:
38
+ import logging
39
+ logging.error("[Impact Pack] Failed to import due to several dependencies are missing!!!!")
40
+ raise e
41
+
42
+
43
+ import impact.impact_server # to load server api
44
+
45
+ from .modules.impact.impact_pack import * # noqa: F403
46
+ from .modules.impact.detectors import * # noqa: F403
47
+ from .modules.impact.pipe import * # noqa: F403
48
+ from .modules.impact.logics import * # noqa: F403
49
+ from .modules.impact.util_nodes import * # noqa: F403
50
+ from .modules.impact.segs_nodes import * # noqa: F403
51
+ from .modules.impact.special_samplers import * # noqa: F403
52
+ from .modules.impact.hf_nodes import * # noqa: F403
53
+ from .modules.impact.bridge_nodes import * # noqa: F403
54
+ from .modules.impact.hook_nodes import * # noqa: F403
55
+ from .modules.impact.animatediff_nodes import * # noqa: F403
56
+ from .modules.impact.segs_upscaler import * # noqa: F403
57
+
58
+ import threading
59
+
60
+
61
+ threading.Thread(target=impact.wildcards.wildcard_load).start()
62
+
63
+
64
+ NODE_CLASS_MAPPINGS = {
65
+ "SAMLoader": SAMLoader, # noqa: F405
66
+ "CLIPSegDetectorProvider": CLIPSegDetectorProvider, # noqa: F405
67
+ "ONNXDetectorProvider": ONNXDetectorProvider, # noqa: F405
68
+
69
+ "BitwiseAndMaskForEach": BitwiseAndMaskForEach, # noqa: F405
70
+ "SubtractMaskForEach": SubtractMaskForEach, # noqa: F405
71
+
72
+ "DetailerForEach": DetailerForEach, # noqa: F405
73
+ "DetailerForEachAutoRetry": DetailerForEachAutoRetry, # noqa: F405
74
+ "DetailerForEachDebug": DetailerForEachTest, # noqa: F405
75
+ "DetailerForEachPipe": DetailerForEachPipe, # noqa: F405
76
+ "DetailerForEachDebugPipe": DetailerForEachTestPipe, # noqa: F405
77
+ "DetailerForEachPipeForAnimateDiff": DetailerForEachPipeForAnimateDiff, # noqa: F405
78
+
79
+ "SAMDetectorCombined": SAMDetectorCombined, # noqa: F405
80
+ "SAMDetectorSegmented": SAMDetectorSegmented, # noqa: F405
81
+
82
+ "FaceDetailer": FaceDetailer, # noqa: F405
83
+ "FaceDetailerPipe": FaceDetailerPipe, # noqa: F405
84
+ "MaskDetailerPipe": MaskDetailerPipe, # noqa: F405
85
+
86
+ "ToDetailerPipe": ToDetailerPipe, # noqa: F405
87
+ "ToDetailerPipeSDXL": ToDetailerPipeSDXL, # noqa: F405
88
+ "FromDetailerPipe": FromDetailerPipe, # noqa: F405
89
+ "FromDetailerPipe_v2": FromDetailerPipe_v2, # noqa: F405
90
+ "FromDetailerPipeSDXL": FromDetailerPipe_SDXL, # noqa: F405
91
+ "AnyPipeToBasic": AnyPipeToBasic, # noqa: F405
92
+ "ToBasicPipe": ToBasicPipe, # noqa: F405
93
+ "FromBasicPipe": FromBasicPipe, # noqa: F405
94
+ "FromBasicPipe_v2": FromBasicPipe_v2, # noqa: F405
95
+ "BasicPipeToDetailerPipe": BasicPipeToDetailerPipe, # noqa: F405
96
+ "BasicPipeToDetailerPipeSDXL": BasicPipeToDetailerPipeSDXL, # noqa: F405
97
+ "DetailerPipeToBasicPipe": DetailerPipeToBasicPipe, # noqa: F405
98
+ "EditBasicPipe": EditBasicPipe, # noqa: F405
99
+ "EditDetailerPipe": EditDetailerPipe, # noqa: F405
100
+ "EditDetailerPipeSDXL": EditDetailerPipeSDXL, # noqa: F405
101
+
102
+ "LatentPixelScale": LatentPixelScale, # noqa: F405
103
+ "PixelKSampleUpscalerProvider": PixelKSampleUpscalerProvider, # noqa: F405
104
+ "PixelKSampleUpscalerProviderPipe": PixelKSampleUpscalerProviderPipe, # noqa: F405
105
+ "IterativeLatentUpscale": IterativeLatentUpscale, # noqa: F405
106
+ "IterativeImageUpscale": IterativeImageUpscale, # noqa: F405
107
+ "PixelTiledKSampleUpscalerProvider": PixelTiledKSampleUpscalerProvider, # noqa: F405
108
+ "PixelTiledKSampleUpscalerProviderPipe": PixelTiledKSampleUpscalerProviderPipe, # noqa: F405
109
+ "TwoSamplersForMaskUpscalerProvider": TwoSamplersForMaskUpscalerProvider, # noqa: F405
110
+ "TwoSamplersForMaskUpscalerProviderPipe": TwoSamplersForMaskUpscalerProviderPipe, # noqa: F405
111
+
112
+ "PixelKSampleHookCombine": PixelKSampleHookCombine, # noqa: F405
113
+ "DenoiseScheduleHookProvider": DenoiseScheduleHookProvider, # noqa: F405
114
+ "StepsScheduleHookProvider": StepsScheduleHookProvider, # noqa: F405
115
+ "CfgScheduleHookProvider": CfgScheduleHookProvider, # noqa: F405
116
+ "NoiseInjectionHookProvider": NoiseInjectionHookProvider, # noqa: F405
117
+ "UnsamplerHookProvider": UnsamplerHookProvider, # noqa: F405
118
+ "CoreMLDetailerHookProvider": CoreMLDetailerHookProvider, # noqa: F405
119
+ "PreviewDetailerHookProvider": PreviewDetailerHookProvider, # noqa: F405
120
+ "BlackPatchRetryHookProvider": BlackPatchRetryHookProvider, # noqa: F405
121
+ "CustomSamplerDetailerHookProvider": CustomSamplerDetailerHookProvider, # noqa: F405
122
+ "LamaRemoverDetailerHookProvider": LamaRemoverDetailerHookProvider, # noqa: F405
123
+
124
+ "DetailerHookCombine": DetailerHookCombine, # noqa: F405
125
+ "NoiseInjectionDetailerHookProvider": NoiseInjectionDetailerHookProvider, # noqa: F405
126
+ "UnsamplerDetailerHookProvider": UnsamplerDetailerHookProvider, # noqa: F405
127
+ "DenoiseSchedulerDetailerHookProvider": DenoiseSchedulerDetailerHookProvider, # noqa: F405
128
+ "SEGSOrderedFilterDetailerHookProvider": SEGSOrderedFilterDetailerHookProvider, # noqa: F405
129
+ "SEGSRangeFilterDetailerHookProvider": SEGSRangeFilterDetailerHookProvider, # noqa: F405
130
+ "SEGSLabelFilterDetailerHookProvider": SEGSLabelFilterDetailerHookProvider, # noqa: F405
131
+ "VariationNoiseDetailerHookProvider": VariationNoiseDetailerHookProvider, # noqa: F405
132
+ # "CustomNoiseDetailerHookProvider": CustomNoiseDetailerHookProvider,
133
+
134
+ "BitwiseAndMask": BitwiseAndMask, # noqa: F405
135
+ "SubtractMask": SubtractMask, # noqa: F405
136
+ "AddMask": AddMask, # noqa: F405
137
+ "MaskRectArea": MaskRectArea, # noqa: F405
138
+ "MaskRectAreaAdvanced": MaskRectAreaAdvanced, # noqa: F405
139
+ "ImpactSegsAndMask": SegsBitwiseAndMask, # noqa: F405
140
+ "ImpactSegsAndMaskForEach": SegsBitwiseAndMaskForEach, # noqa: F405
141
+ "EmptySegs": EmptySEGS, # noqa: F405
142
+ "ImpactFlattenMask": FlattenMask, # noqa: F405
143
+
144
+ "MediaPipeFaceMeshToSEGS": MediaPipeFaceMeshToSEGS, # noqa: F405
145
+ "MaskToSEGS": MaskToSEGS, # noqa: F405
146
+ "MaskToSEGS_for_AnimateDiff": MaskToSEGS_for_AnimateDiff, # noqa: F405
147
+ "ToBinaryMask": ToBinaryMask, # noqa: F405
148
+ "MasksToMaskList": MasksToMaskList, # noqa: F405
149
+ "MaskListToMaskBatch": MaskListToMaskBatch, # noqa: F405
150
+ "ImageListToImageBatch": ImageListToImageBatch, # noqa: F405
151
+ "SetDefaultImageForSEGS": DefaultImageForSEGS, # noqa: F405
152
+ "RemoveImageFromSEGS": RemoveImageFromSEGS, # noqa: F405
153
+
154
+ "BboxDetectorSEGS": BboxDetectorForEach, # noqa: F405
155
+ "SegmDetectorSEGS": SegmDetectorForEach, # noqa: F405
156
+ "ONNXDetectorSEGS": BboxDetectorForEach, # noqa: F405
157
+ "ImpactSimpleDetectorSEGS_for_AD": SimpleDetectorForAnimateDiff, # noqa: F405
158
+ "ImpactSAM2VideoDetectorSEGS": SAM2VideoDetectorSEGS, # noqa: F405
159
+ "ImpactSimpleDetectorSEGS": SimpleDetectorForEach, # noqa: F405
160
+ "ImpactSimpleDetectorSEGSPipe": SimpleDetectorForEachPipe, # noqa: F405
161
+ "ImpactControlNetApplySEGS": ControlNetApplySEGS, # noqa: F405
162
+ "ImpactControlNetApplyAdvancedSEGS": ControlNetApplyAdvancedSEGS, # noqa: F405
163
+ "ImpactControlNetClearSEGS": ControlNetClearSEGS, # noqa: F405
164
+ "ImpactIPAdapterApplySEGS": IPAdapterApplySEGS, # noqa: F405
165
+
166
+ "ImpactDecomposeSEGS": DecomposeSEGS, # noqa: F405
167
+ "ImpactAssembleSEGS": AssembleSEGS, # noqa: F405
168
+ "ImpactFrom_SEG_ELT": From_SEG_ELT, # noqa: F405
169
+ "ImpactEdit_SEG_ELT": Edit_SEG_ELT, # noqa: F405
170
+ "ImpactDilate_Mask_SEG_ELT": Dilate_SEG_ELT, # noqa: F405
171
+ "ImpactDilateMask": DilateMask, # noqa: F405
172
+ "ImpactGaussianBlurMask": GaussianBlurMask, # noqa: F405
173
+ "ImpactDilateMaskInSEGS": DilateMaskInSEGS, # noqa: F405
174
+ "ImpactGaussianBlurMaskInSEGS": GaussianBlurMaskInSEGS, # noqa: F405
175
+ "ImpactScaleBy_BBOX_SEG_ELT": SEG_ELT_BBOX_ScaleBy, # noqa: F405
176
+ "ImpactFrom_SEG_ELT_bbox": From_SEG_ELT_bbox, # noqa: F405
177
+ "ImpactFrom_SEG_ELT_crop_region": From_SEG_ELT_crop_region, # noqa: F405
178
+ "ImpactCount_Elts_in_SEGS": Count_Elts_in_SEGS, # noqa: F405
179
+
180
+ "BboxDetectorCombined_v2": BboxDetectorCombined, # noqa: F405
181
+ "SegmDetectorCombined_v2": SegmDetectorCombined, # noqa: F405
182
+ "SegsToCombinedMask": SegsToCombinedMask, # noqa: F405
183
+
184
+ "KSamplerProvider": KSamplerProvider, # noqa: F405
185
+ "TwoSamplersForMask": TwoSamplersForMask, # noqa: F405
186
+ "TiledKSamplerProvider": TiledKSamplerProvider, # noqa: F405
187
+
188
+ "KSamplerAdvancedProvider": KSamplerAdvancedProvider, # noqa: F405
189
+ "TwoAdvancedSamplersForMask": TwoAdvancedSamplersForMask, # noqa: F405
190
+
191
+ "ImpactNegativeConditioningPlaceholder": NegativeConditioningPlaceholder, # noqa: F405
192
+
193
+ "PreviewBridge": PreviewBridge, # noqa: F405
194
+ "PreviewBridgeLatent": PreviewBridgeLatent, # noqa: F405
195
+ "ImageSender": ImageSender, # noqa: F405
196
+ "ImageReceiver": ImageReceiver, # noqa: F405
197
+ "LatentSender": LatentSender, # noqa: F405
198
+ "LatentReceiver": LatentReceiver, # noqa: F405
199
+ "ImageMaskSwitch": ImageMaskSwitch, # noqa: F405
200
+ "LatentSwitch": GeneralSwitch, # noqa: F405
201
+ "SEGSSwitch": GeneralSwitch, # noqa: F405
202
+ "ImpactSwitch": GeneralSwitch, # noqa: F405
203
+ "ImpactInversedSwitch": GeneralInversedSwitch, # noqa: F405
204
+
205
+ "ImpactWildcardProcessor": ImpactWildcardProcessor, # noqa: F405
206
+ "ImpactWildcardEncode": ImpactWildcardEncode, # noqa: F405
207
+
208
+ "SEGSUpscaler": SEGSUpscaler, # noqa: F405
209
+ "SEGSUpscalerPipe": SEGSUpscalerPipe, # noqa: F405
210
+ "SEGSDetailer": SEGSDetailer, # noqa: F405
211
+ "SEGSPaste": SEGSPaste, # noqa: F405
212
+ "SEGSPreview": SEGSPreview, # noqa: F405
213
+ "SEGSPreviewCNet": SEGSPreviewCNet, # noqa: F405
214
+ "SEGSToImageList": SEGSToImageList, # noqa: F405
215
+ "ImpactSEGSToMaskList": SEGSToMaskList, # noqa: F405
216
+ "ImpactSEGSToMaskBatch": SEGSToMaskBatch, # noqa: F405
217
+ "ImpactSEGSConcat": SEGSConcat, # noqa: F405
218
+ "ImpactSEGSPicker": SEGSPicker, # noqa: F405
219
+ "ImpactMakeTileSEGS": MakeTileSEGS, # noqa: F405
220
+ "ImpactSEGSMerge": SEGSMerge, # noqa: F405
221
+
222
+ "SEGSDetailerForAnimateDiff": SEGSDetailerForAnimateDiff, # noqa: F405
223
+
224
+ "ImpactKSamplerBasicPipe": KSamplerBasicPipe, # noqa: F405
225
+ "ImpactKSamplerAdvancedBasicPipe": KSamplerAdvancedBasicPipe, # noqa: F405
226
+
227
+ "ReencodeLatent": ReencodeLatent, # noqa: F405
228
+ "ReencodeLatentPipe": ReencodeLatentPipe, # noqa: F405
229
+
230
+ "ImpactImageBatchToImageList": ImageBatchToImageList, # noqa: F405
231
+ "ImpactMakeImageList": MakeImageList, # noqa: F405
232
+ "ImpactMakeImageBatch": MakeImageBatch, # noqa: F405
233
+ "ImpactMakeAnyList": MakeAnyList, # noqa: F405
234
+ "ImpactMakeMaskList": MakeMaskList, # noqa: F405
235
+ "ImpactMakeMaskBatch": MakeMaskBatch, # noqa: F405
236
+ "ImpactSelectNthItemOfAnyList": NthItemOfAnyList, # noqa: F405
237
+
238
+ "RegionalSampler": RegionalSampler, # noqa: F405
239
+ "RegionalSamplerAdvanced": RegionalSamplerAdvanced, # noqa: F405
240
+ "CombineRegionalPrompts": CombineRegionalPrompts, # noqa: F405
241
+ "RegionalPrompt": RegionalPrompt, # noqa: F405
242
+
243
+ "ImpactCombineConditionings": CombineConditionings, # noqa: F405
244
+ "ImpactConcatConditionings": ConcatConditionings, # noqa: F405
245
+
246
+ "ImpactSEGSLabelAssign": SEGSLabelAssign, # noqa: F405
247
+ "ImpactSEGSLabelFilter": SEGSLabelFilter, # noqa: F405
248
+ "ImpactSEGSRangeFilter": SEGSRangeFilter, # noqa: F405
249
+ "ImpactSEGSOrderedFilter": SEGSOrderedFilter, # noqa: F405
250
+ "ImpactSEGSIntersectionFilter": SEGSIntersectionFilter, # noqa: F405
251
+ "ImpactSEGSNMSFilter": SEGSNMSFilter, # noqa: F405
252
+
253
+ "ImpactCompare": ImpactCompare, # noqa: F405
254
+ "ImpactConditionalBranch": ImpactConditionalBranch, # noqa: F405
255
+ "ImpactConditionalBranchSelMode": ImpactConditionalBranchSelMode, # noqa: F405
256
+ "ImpactIfNone": ImpactIfNone, # noqa: F405
257
+ "ImpactConvertDataType": ImpactConvertDataType, # noqa: F405
258
+ "ImpactLogicalOperators": ImpactLogicalOperators, # noqa: F405
259
+ "ImpactInt": ImpactInt, # noqa: F405
260
+ "ImpactFloat": ImpactFloat, # noqa: F405
261
+ "ImpactBoolean": ImpactBoolean, # noqa: F405
262
+ "ImpactValueSender": ImpactValueSender, # noqa: F405
263
+ "ImpactValueReceiver": ImpactValueReceiver, # noqa: F405
264
+ "ImpactImageInfo": ImpactImageInfo, # noqa: F405
265
+ "ImpactLatentInfo": ImpactLatentInfo, # noqa: F405
266
+ "ImpactMinMax": ImpactMinMax, # noqa: F405
267
+ "ImpactNeg": ImpactNeg, # noqa: F405
268
+ "ImpactConditionalStopIteration": ImpactConditionalStopIteration, # noqa: F405
269
+ "ImpactStringSelector": StringSelector, # noqa: F405
270
+ "StringListToString": StringListToString, # noqa: F405
271
+ "WildcardPromptFromString": WildcardPromptFromString, # noqa: F405
272
+ "ImpactExecutionOrderController": ImpactExecutionOrderController, # noqa: F405
273
+ "ImpactListBridge": ImpactListBridge, # noqa: F405
274
+
275
+ "RemoveNoiseMask": RemoveNoiseMask, # noqa: F405
276
+
277
+ "ImpactLogger": ImpactLogger, # noqa: F405
278
+ "ImpactDummyInput": ImpactDummyInput, # noqa: F405
279
+
280
+ "ImpactQueueTrigger": ImpactQueueTrigger, # noqa: F405
281
+ "ImpactQueueTriggerCountdown": ImpactQueueTriggerCountdown, # noqa: F405
282
+ "ImpactSetWidgetValue": ImpactSetWidgetValue, # noqa: F405
283
+ "ImpactNodeSetMuteState": ImpactNodeSetMuteState, # noqa: F405
284
+ "ImpactControlBridge": ImpactControlBridge, # noqa: F405
285
+ "ImpactIsNotEmptySEGS": ImpactNotEmptySEGS, # noqa: F405
286
+ "ImpactSleep": ImpactSleep, # noqa: F405
287
+ "ImpactRemoteBoolean": ImpactRemoteBoolean, # noqa: F405
288
+ "ImpactRemoteInt": ImpactRemoteInt, # noqa: F405
289
+
290
+ "ImpactHFTransformersClassifierProvider": HF_TransformersClassifierProvider, # noqa: F405
291
+ "ImpactSEGSClassify": SEGS_Classify, # noqa: F405
292
+
293
+ "ImpactSchedulerAdapter": ImpactSchedulerAdapter, # noqa: F405
294
+ "GITSSchedulerFuncProvider": GITSSchedulerFuncProvider # noqa: F405
295
+ }
296
+
297
+
298
+ NODE_DISPLAY_NAME_MAPPINGS = {
299
+ "SAMLoader": "SAMLoader (Impact)",
300
+
301
+ "BboxDetectorSEGS": "BBOX Detector (SEGS)",
302
+ "SegmDetectorSEGS": "SEGM Detector (SEGS)",
303
+ "ONNXDetectorSEGS": "ONNX Detector (SEGS/legacy) - use BBOXDetector",
304
+ "ImpactSimpleDetectorSEGS_for_AD": "Simple Detector for Video (SEGS)",
305
+ "ImpactSAM2VideoDetectorSEGS": "SAM2 Video Detector (SEGS)",
306
+ "ImpactSimpleDetectorSEGS": "Simple Detector (SEGS)",
307
+ "ImpactSimpleDetectorSEGSPipe": "Simple Detector (SEGS/pipe)",
308
+ "ImpactControlNetApplySEGS": "ControlNetApply (SEGS) - DEPRECATED",
309
+ "ImpactControlNetApplyAdvancedSEGS": "ControlNetApply (SEGS)",
310
+ "ImpactIPAdapterApplySEGS": "IPAdapterApply (SEGS)",
311
+
312
+ "BboxDetectorCombined_v2": "BBOX Detector (combined)",
313
+ "SegmDetectorCombined_v2": "SEGM Detector (combined)",
314
+ "SegsToCombinedMask": "SEGS to MASK (combined)",
315
+ "MediaPipeFaceMeshToSEGS": "MediaPipe FaceMesh to SEGS",
316
+ "MaskToSEGS": "MASK to SEGS",
317
+ "MaskToSEGS_for_AnimateDiff": "MASK to SEGS for Video",
318
+ "BitwiseAndMaskForEach": "Pixelwise(SEGS & SEGS)",
319
+ "SubtractMaskForEach": "Pixelwise(SEGS - SEGS)",
320
+ "ImpactSegsAndMask": "Pixelwise(SEGS & MASK)",
321
+ "ImpactSegsAndMaskForEach": "Pixelwise(SEGS & MASKS ForEach)",
322
+ "BitwiseAndMask": "Pixelwise(MASK & MASK)",
323
+ "SubtractMask": "Pixelwise(MASK - MASK)",
324
+ "AddMask": "Pixelwise(MASK + MASK)",
325
+ "MaskRectArea": "Mask Rect Area",
326
+ "MaskRectAreaAdvanced": "Mask Rect Area (Advanced)",
327
+ "ImpactFlattenMask": "Flatten Mask Batch",
328
+ "DetailerForEach": "Detailer (SEGS)",
329
+ "DetailerForEachAutoRetry": "Detailer (SEGS) with auto retry",
330
+ "DetailerForEachPipe": "Detailer (SEGS/pipe)",
331
+ "DetailerForEachDebug": "DetailerDebug (SEGS)",
332
+ "DetailerForEachDebugPipe": "DetailerDebug (SEGS/pipe)",
333
+ "SEGSDetailerForAnimateDiff": "SEGSDetailer For Video (SEGS/pipe)",
334
+ "DetailerForEachPipeForAnimateDiff": "Detailer For Video (SEGS/pipe)",
335
+ "SEGSUpscaler": "Upscaler (SEGS)",
336
+ "SEGSUpscalerPipe": "Upscaler (SEGS/pipe)",
337
+
338
+ "SAMDetectorCombined": "SAMDetector (combined)",
339
+ "SAMDetectorSegmented": "SAMDetector (segmented)",
340
+ "FaceDetailerPipe": "FaceDetailer (pipe)",
341
+ "MaskDetailerPipe": "MaskDetailer (pipe)",
342
+
343
+ "FromDetailerPipeSDXL": "FromDetailer (SDXL/pipe)",
344
+ "BasicPipeToDetailerPipeSDXL": "BasicPipe -> DetailerPipe (SDXL)",
345
+ "EditDetailerPipeSDXL": "Edit DetailerPipe (SDXL)",
346
+
347
+ "BasicPipeToDetailerPipe": "BasicPipe -> DetailerPipe",
348
+ "DetailerPipeToBasicPipe": "DetailerPipe -> BasicPipe",
349
+ "EditBasicPipe": "Edit BasicPipe",
350
+ "EditDetailerPipe": "Edit DetailerPipe",
351
+ "AnyPipeToBasic": "Any PIPE -> BasicPipe",
352
+
353
+ "LatentPixelScale": "Latent Scale (on Pixel Space)",
354
+ "IterativeLatentUpscale": "Iterative Upscale (Latent/on Pixel Space)",
355
+ "IterativeImageUpscale": "Iterative Upscale (Image)",
356
+
357
+ "TwoSamplersForMaskUpscalerProvider": "TwoSamplersForMask Upscaler Provider",
358
+ "TwoSamplersForMaskUpscalerProviderPipe": "TwoSamplersForMask Upscaler Provider (pipe)",
359
+
360
+ "ReencodeLatent": "Reencode Latent",
361
+ "ReencodeLatentPipe": "Reencode Latent (pipe)",
362
+
363
+ "ImpactKSamplerBasicPipe": "KSampler (pipe)",
364
+ "ImpactKSamplerAdvancedBasicPipe": "KSampler (Advanced/pipe)",
365
+ "ImpactSEGSLabelAssign": "SEGS Assign (label)",
366
+ "ImpactSEGSLabelFilter": "SEGS Filter (label)",
367
+ "ImpactSEGSRangeFilter": "SEGS Filter (range)",
368
+ "ImpactSEGSOrderedFilter": "SEGS Filter (ordered)",
369
+ "ImpactSEGSIntersectionFilter": "SEGS Filter (intersection)",
370
+ "ImpactSEGSNMSFilter": "SEGS Filter (non max suppression)",
371
+ "ImpactSEGSConcat": "SEGS Concat",
372
+ "ImpactSEGSToMaskList": "SEGS to Mask List",
373
+ "ImpactSEGSToMaskBatch": "SEGS to Mask Batch",
374
+ "ImpactSEGSPicker": "Picker (SEGS)",
375
+ "ImpactMakeTileSEGS": "Make Tile SEGS",
376
+ "ImpactSEGSMerge": "SEGS Merge",
377
+
378
+ "ImpactDecomposeSEGS": "Decompose (SEGS)",
379
+ "ImpactAssembleSEGS": "Assemble (SEGS)",
380
+ "ImpactFrom_SEG_ELT": "From SEG_ELT",
381
+ "ImpactEdit_SEG_ELT": "Edit SEG_ELT",
382
+ "ImpactFrom_SEG_ELT_bbox": "From SEG_ELT bbox",
383
+ "ImpactFrom_SEG_ELT_crop_region": "From SEG_ELT crop_region",
384
+ "ImpactDilate_Mask_SEG_ELT": "Dilate Mask (SEG_ELT)",
385
+ "ImpactScaleBy_BBOX_SEG_ELT": "ScaleBy BBOX (SEG_ELT)",
386
+ "ImpactCount_Elts_in_SEGS": "Count Elts in SEGS",
387
+ "ImpactDilateMask": "Dilate Mask",
388
+ "ImpactGaussianBlurMask": "Gaussian Blur Mask",
389
+ "ImpactDilateMaskInSEGS": "Dilate Mask (SEGS)",
390
+ "ImpactGaussianBlurMaskInSEGS": "Gaussian Blur Mask (SEGS)",
391
+
392
+ "PreviewBridge": "Preview Bridge (Image)",
393
+ "PreviewBridgeLatent": "Preview Bridge (Latent)",
394
+ "ImageSender": "Image Sender",
395
+ "ImageReceiver": "Image Receiver",
396
+ "ImageMaskSwitch": "Switch (images, mask)",
397
+ "ImpactSwitch": "Switch (Any)",
398
+ "ImpactInversedSwitch": "Inversed Switch (Any)",
399
+ "ImpactExecutionOrderController": "Execution Order Controller",
400
+ "ImpactListBridge": "List Bridge",
401
+
402
+ "MasksToMaskList": "Mask Batch to Mask List",
403
+ "MaskListToMaskBatch": "Mask List to Mask Batch",
404
+ "ImpactImageBatchToImageList": "Image Batch to Image List",
405
+ "ImageListToImageBatch": "Image List to Image Batch",
406
+
407
+ "ImpactMakeImageList": "Make Image List",
408
+ "ImpactMakeImageBatch": "Make Image Batch",
409
+ "ImpactMakeMaskList": "Make Mask List",
410
+ "ImpactMakeMaskBatch": "Make Mask Batch",
411
+ "ImpactMakeAnyList": "Make List (Any)",
412
+ "ImpactSelectNthItemOfAnyList": "Select Nth Item (Any list)",
413
+
414
+ "ImpactStringSelector": "String Selector",
415
+ "StringListToString": "String List to String",
416
+ "WildcardPromptFromString": "Wildcard Prompt from String",
417
+ "ImpactIsNotEmptySEGS": "SEGS isn't Empty",
418
+ "SetDefaultImageForSEGS": "Set Default Image for SEGS",
419
+ "RemoveImageFromSEGS": "Remove Image from SEGS",
420
+
421
+ "RemoveNoiseMask": "Remove Noise Mask",
422
+
423
+ "ImpactCombineConditionings": "Combine Conditionings",
424
+ "ImpactConcatConditionings": "Concat Conditionings",
425
+
426
+ "ImpactQueueTrigger": "Queue Trigger",
427
+ "ImpactQueueTriggerCountdown": "Queue Trigger (Countdown)",
428
+ "ImpactSetWidgetValue": "Set Widget Value",
429
+ "ImpactNodeSetMuteState": "Set Mute State",
430
+ "ImpactControlBridge": "Control Bridge",
431
+ "ImpactSleep": "Sleep",
432
+ "ImpactRemoteBoolean": "Remote Boolean (on prompt)",
433
+ "ImpactRemoteInt": "Remote Int (on prompt)",
434
+
435
+ "ImpactHFTransformersClassifierProvider": "HF Transformers Classifier Provider",
436
+ "ImpactSEGSClassify": "SEGS Classify",
437
+
438
+ "LatentSwitch": "Switch (latent/legacy)",
439
+ "SEGSSwitch": "Switch (SEGS/legacy)",
440
+
441
+ "SEGSPreviewCNet": "SEGSPreview (CNET Image)",
442
+
443
+ "ImpactSchedulerAdapter": "Impact Scheduler Adapter",
444
+ "GITSSchedulerFuncProvider": "GITSScheduler Func Provider",
445
+ "ImpactNegativeConditioningPlaceholder": "Negative Cond Placeholder"
446
+ }
447
+
448
+
449
+ # NOTE: Inject directly into EXTENSION_WEB_DIRS instead of WEB_DIRECTORY
450
+ # Provide the js path fixed as ComfyUI-Impact-Pack instead of the path name, making it available for external use
451
+
452
+ # WEB_DIRECTORY = "js" -- deprecated method
453
+ nodes.EXTENSION_WEB_DIRS["ComfyUI-Impact-Pack"] = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'js')
454
+
455
+
456
+ __all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
comfyui-impact-pack/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (19.7 kB). View file
 
comfyui-impact-pack/__pycache__/__init__.cpython-312.pyc ADDED
Binary file (21 kB). View file
 
comfyui-impact-pack/custom_wildcards/put_wildcards_here ADDED
File without changes
comfyui-impact-pack/impact-pack.ini ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ [default]
2
+ sam_editor_cpu = False
3
+ sam_editor_model = sam_vit_b_01ec64.pth
4
+ custom_wildcards = D:\ComfyUI\custom_nodes\comfyui-impact-pack\modules\impact\..\..\custom_wildcards
5
+ disable_gpu_opencv = True
6
+
comfyui-impact-pack/install.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import shutil
3
+ import sys
4
+ import subprocess
5
+ import threading
6
+ import locale
7
+ import traceback
8
+
9
+
10
+ if sys.argv[0] == 'install.py':
11
+ sys.path.append('.') # for portable version
12
+
13
+
14
+ impact_path = os.path.join(os.path.dirname(__file__), "modules")
15
+
16
+
17
+ comfy_path = os.environ.get('COMFYUI_PATH')
18
+ if comfy_path is None:
19
+ print(f"\nWARN: The `COMFYUI_PATH` environment variable is not set. Assuming `{os.path.dirname(__file__)}/../../` as the ComfyUI path.", file=sys.stderr)
20
+ comfy_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
21
+
22
+ model_path = os.environ.get('COMFYUI_MODEL_PATH')
23
+ if model_path is None:
24
+ try:
25
+ import folder_paths
26
+ model_path = folder_paths.models_dir
27
+ except:
28
+ pass
29
+
30
+ if model_path is None:
31
+ model_path = os.path.abspath(os.path.join(comfy_path, 'models'))
32
+ print(f"\nWARN: The `COMFYUI_MODEL_PATH` environment variable is not set. Assuming `{model_path}` as the ComfyUI path.", file=sys.stderr)
33
+
34
+
35
+ sys.path.append(impact_path)
36
+ sys.path.append(comfy_path)
37
+
38
+
39
+ # ---
40
+ def handle_stream(stream, is_stdout):
41
+ stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
42
+
43
+ for msg in stream:
44
+ if is_stdout:
45
+ print(msg, end="", file=sys.stdout)
46
+ else:
47
+ print(msg, end="", file=sys.stderr)
48
+
49
+
50
+ def process_wrap(cmd_str, cwd=None, handler=None, env=None):
51
+ print(f"[Impact Pack] EXECUTE: {cmd_str} in '{cwd}'")
52
+ process = subprocess.Popen(cmd_str, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, text=True, bufsize=1)
53
+
54
+ if handler is None:
55
+ handler = handle_stream
56
+
57
+ stdout_thread = threading.Thread(target=handler, args=(process.stdout, True))
58
+ stderr_thread = threading.Thread(target=handler, args=(process.stderr, False))
59
+
60
+ stdout_thread.start()
61
+ stderr_thread.start()
62
+
63
+ stdout_thread.join()
64
+ stderr_thread.join()
65
+
66
+ return process.wait()
67
+ # ---
68
+
69
+
70
+ try:
71
+ from torchvision.datasets.utils import download_url
72
+ import impact.config
73
+
74
+ print("### ComfyUI-Impact-Pack: Check dependencies")
75
+ def install():
76
+ new_env = os.environ.copy()
77
+ new_env["COMFYUI_PATH"] = comfy_path
78
+ new_env["COMFYUI_MODEL_PATH"] = model_path
79
+
80
+ # Download model
81
+ print("### ComfyUI-Impact-Pack: Check basic models")
82
+ sam_path = os.path.join(model_path, "sams")
83
+ onnx_path = os.path.join(model_path, "onnx")
84
+
85
+ if not os.path.exists(os.path.join(os.path.dirname(__file__), '..', 'skip_download_model')):
86
+ try:
87
+ if not os.path.exists(os.path.join(sam_path, "sam_vit_b_01ec64.pth")):
88
+ download_url("https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth", sam_path)
89
+ except:
90
+ print("[Impact Pack] Failed to auto-download model files. Please download them manually.")
91
+
92
+ if not os.path.exists(onnx_path):
93
+ print(f"### ComfyUI-Impact-Pack: onnx model directory created ({onnx_path})")
94
+ os.mkdir(onnx_path)
95
+
96
+ impact.config.write_config()
97
+
98
+ # Remove legacy subpack
99
+ try:
100
+ subpack_path = os.path.join(os.path.dirname(__file__), 'impact_subpack')
101
+ if os.path.exists(subpack_path):
102
+ shutil.rmtree(subpack_path)
103
+ print(f"Legacy subpack is detected. '{subpack_path}' is removed.")
104
+
105
+ subpack_path = os.path.join(os.path.dirname(__file__), 'subpack')
106
+ if os.path.exists(subpack_path):
107
+ shutil.rmtree(subpack_path)
108
+ print(f"Legacy subpack is detected. '{subpack_path}' is removed.")
109
+ except:
110
+ print(f"ERROT: Failed to delete legacy subpack '{subpack_path}'\nPlease delete the folder after terminate ComfyUI.")
111
+
112
+ install()
113
+
114
+ except Exception:
115
+ print("[ERROR] ComfyUI-Impact-Pack: Dependency installation has failed. Please install manually.")
116
+ traceback.print_exc()
comfyui-impact-pack/js/common.js ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { api } from "../../scripts/api.js";
2
+ import { app } from "../../scripts/app.js";
3
+
4
+ let original_show = app.ui.dialog.show;
5
+
6
+ export function customAlert(message) {
7
+ try {
8
+ app.extensionManager.toast.addAlert(message);
9
+ }
10
+ catch {
11
+ alert(message);
12
+ }
13
+ }
14
+
15
+ export function isBeforeFrontendVersion(compareVersion) {
16
+ try {
17
+ const frontendVersion = window['__COMFYUI_FRONTEND_VERSION__'];
18
+ if (typeof frontendVersion !== 'string') {
19
+ return false;
20
+ }
21
+
22
+ function parseVersion(versionString) {
23
+ const parts = versionString.split('.').map(Number);
24
+ return parts.length === 3 && parts.every(part => !isNaN(part)) ? parts : null;
25
+ }
26
+
27
+ const currentVersion = parseVersion(frontendVersion);
28
+ const comparisonVersion = parseVersion(compareVersion);
29
+
30
+ if (!currentVersion || !comparisonVersion) {
31
+ return false;
32
+ }
33
+
34
+ for (let i = 0; i < 3; i++) {
35
+ if (currentVersion[i] > comparisonVersion[i]) {
36
+ return false;
37
+ } else if (currentVersion[i] < comparisonVersion[i]) {
38
+ return true;
39
+ }
40
+ }
41
+
42
+ return false;
43
+ } catch {
44
+ return true;
45
+ }
46
+ }
47
+
48
+ function dialog_show_wrapper(html) {
49
+ if (typeof html === "string") {
50
+ if(html.includes("IMPACT-PACK-SIGNAL: STOP CONTROL BRIDGE")) {
51
+ return;
52
+ }
53
+
54
+ this.textElement.innerHTML = html;
55
+ } else {
56
+ this.textElement.replaceChildren(html);
57
+ }
58
+ this.element.style.display = "flex";
59
+ }
60
+
61
+ app.ui.dialog.show = dialog_show_wrapper;
62
+
63
+
64
+ function nodeFeedbackHandler(event) {
65
+ let nodes = app.graph._nodes_by_id;
66
+ let node = nodes[event.detail.node_id];
67
+ if(node) {
68
+ const w = node.widgets.find((w) => event.detail.widget_name === w.name);
69
+ if(w) {
70
+ w.value = event.detail.value;
71
+ }
72
+ }
73
+ }
74
+
75
+ api.addEventListener("impact-node-feedback", nodeFeedbackHandler);
76
+
77
+
78
+ function setMuteState(event) {
79
+ let nodes = app.graph._nodes_by_id;
80
+ let node = nodes[event.detail.node_id];
81
+ if(node) {
82
+ if(event.detail.is_active)
83
+ node.mode = 0;
84
+ else
85
+ node.mode = 2;
86
+ }
87
+ }
88
+
89
+ api.addEventListener("impact-node-mute-state", setMuteState);
90
+
91
+
92
+ async function bridgeContinue(event) {
93
+ let nodes = app.graph._nodes_by_id;
94
+ let node = nodes[event.detail.node_id];
95
+ if(node) {
96
+ const mutes = new Set(event.detail.mutes);
97
+ const actives = new Set(event.detail.actives);
98
+ const bypasses = new Set(event.detail.bypasses);
99
+
100
+ for(let i in app.graph._nodes_by_id) {
101
+ let this_node = app.graph._nodes_by_id[i];
102
+ if(mutes.has(i)) {
103
+ this_node.mode = 2;
104
+ }
105
+ else if(actives.has(i)) {
106
+ this_node.mode = 0;
107
+ }
108
+ else if(bypasses.has(i)) {
109
+ this_node.mode = 4;
110
+ }
111
+ }
112
+
113
+ await app.queuePrompt(0, 1);
114
+ }
115
+ }
116
+
117
+ api.addEventListener("impact-bridge-continue", bridgeContinue);
118
+
119
+
120
+ function addQueue(event) {
121
+ app.queuePrompt(0, 1);
122
+ }
123
+
124
+ api.addEventListener("impact-add-queue", addQueue);
125
+
126
+
127
+ function refreshPreview(event) {
128
+ let node_id = event.detail.node_id;
129
+ let item = event.detail.item;
130
+ let img = new Image();
131
+ img.src = `/view?filename=${item.filename}&subfolder=${item.subfolder}&type=${item.type}&no-cache=${Date.now()}`;
132
+ let node = app.graph._nodes_by_id[node_id];
133
+ if(node)
134
+ node.imgs = [img];
135
+ }
136
+
137
+ api.addEventListener("impact-preview", refreshPreview);
comfyui-impact-pack/js/impact-image-util.js ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ComfyApp, app } from "../../scripts/app.js";
2
+ import { api } from "../../scripts/api.js";
3
+
4
+ function load_image(str) {
5
+ let base64String = canvas.toDataURL('image/png');
6
+ let img = new Image();
7
+ img.src = base64String;
8
+ }
9
+
10
+ function getFileItem(baseType, path) {
11
+ try {
12
+ let pathType = baseType;
13
+
14
+ if (path.endsWith("[output]")) {
15
+ pathType = "output";
16
+ path = path.slice(0, -9);
17
+ } else if (path.endsWith("[input]")) {
18
+ pathType = "input";
19
+ path = path.slice(0, -8);
20
+ } else if (path.endsWith("[temp]")) {
21
+ pathType = "temp";
22
+ path = path.slice(0, -7);
23
+ }
24
+
25
+ const subfolder = path.substring(0, path.lastIndexOf('/'));
26
+ const filename = path.substring(path.lastIndexOf('/') + 1);
27
+
28
+ return {
29
+ filename: filename,
30
+ subfolder: subfolder,
31
+ type: pathType
32
+ };
33
+ }
34
+ catch(exception) {
35
+ return null;
36
+ }
37
+ }
38
+
39
+ async function loadImageFromUrl(image, node_id, v, need_to_load) {
40
+ let item = getFileItem('temp', v);
41
+
42
+ if(item) {
43
+ let params = `?node_id=${node_id}&filename=${item.filename}&type=${item.type}&subfolder=${item.subfolder}`;
44
+
45
+ let res = await api.fetchApi('/impact/set/pb_id_image'+params, { cache: "no-store" });
46
+ if(res.status == 200) {
47
+ let pb_id = await res.text();
48
+ if(need_to_load) {;
49
+ image.src = api.apiURL(`/view?filename=${item.filename}&type=${item.type}&subfolder=${item.subfolder}`);
50
+ }
51
+ return pb_id;
52
+ }
53
+ else {
54
+ return `$${node_id}-0`;
55
+ }
56
+ }
57
+ else {
58
+ return `$${node_id}-0`;
59
+ }
60
+ }
61
+
62
+ async function loadImageFromId(image, v) {
63
+ let res = await api.fetchApi('/impact/get/pb_id_image?id='+v, { cache: "no-store" });
64
+ if(res.status == 200) {
65
+ let item = await res.json();
66
+ image.src = api.apiURL(`/view?filename=${item.filename}&type=${item.type}&subfolder=${item.subfolder}`);
67
+ return true;
68
+ }
69
+
70
+ return false;
71
+ }
72
+
73
+ app.registerExtension({
74
+ name: "Comfy.Impact.img",
75
+
76
+ nodeCreated(node, app) {
77
+ if(node.comfyClass == "PreviewBridge" || node.comfyClass == "PreviewBridgeLatent") {
78
+ let w = node.widgets.find(obj => obj.name === 'image');
79
+ node._imgs = [new Image()];
80
+ node.imageIndex = 0;
81
+
82
+ Object.defineProperty(w, 'value', {
83
+ async set(v) {
84
+ if(w._lock)
85
+ return;
86
+
87
+ const stackTrace = new Error().stack;
88
+ if(stackTrace.includes('presetText.js'))
89
+ return;
90
+
91
+ var image = new Image();
92
+ if(v && v.constructor == String && v.startsWith('$')) {
93
+ // from node feedback
94
+ let need_to_load = node._imgs[0].src == '';
95
+ if(await loadImageFromId(image, v, need_to_load)) {
96
+ w._value = v;
97
+ if(node._imgs[0].src == '') {
98
+ node._imgs = [image];
99
+ }
100
+ }
101
+ else {
102
+ w._value = `$${node.id}-0`;
103
+ }
104
+ }
105
+ else {
106
+ // from clipspace
107
+ w._lock = true;
108
+ w._value = await loadImageFromUrl(image, node.id, v, false);
109
+ w._lock = false;
110
+ }
111
+ },
112
+ get() {
113
+ if(w._value == undefined) {
114
+ w._value = `$${node.id}-0`;
115
+ }
116
+ return w._value;
117
+ }
118
+ });
119
+
120
+ Object.defineProperty(node, 'imgs', {
121
+ set(v) {
122
+ const stackTrace = new Error().stack;
123
+ if(v && v.length == 0)
124
+ return;
125
+ else if(stackTrace.includes('pasteFromClipspace')) {
126
+ let sp = new URLSearchParams(v[0].src.split("?")[1]);
127
+ let str = "";
128
+ if(sp.get('subfolder')) {
129
+ str += sp.get('subfolder') + '/';
130
+ }
131
+ str += `${sp.get("filename")} [${sp.get("type")}]`;
132
+
133
+ w.value = str;
134
+ }
135
+
136
+ node._imgs = v;
137
+ },
138
+ get() {
139
+ return node._imgs;
140
+ }
141
+ });
142
+ }
143
+
144
+ if(node.comfyClass == "ImageReceiver") {
145
+ let path_widget = node.widgets.find(obj => obj.name === 'image');
146
+ let w = node.widgets.find(obj => obj.name === 'image_data');
147
+ let stw_widget = node.widgets.find(obj => obj.name === 'save_to_workflow');
148
+ w._value = "";
149
+
150
+ Object.defineProperty(w, 'value', {
151
+ set(v) {
152
+ if(v != '[IMAGE DATA]')
153
+ w._value = v;
154
+ },
155
+ get() {
156
+ const stackTrace = new Error().stack;
157
+ if(!stackTrace.includes('draw') && !stackTrace.includes('graphToPrompt') && stackTrace.includes('app.js')) {
158
+ return "[IMAGE DATA]";
159
+ }
160
+ else {
161
+ if(stw_widget.value)
162
+ return w._value;
163
+ else
164
+ return "";
165
+ }
166
+ }
167
+ });
168
+
169
+ let set_img_act = (v) => {
170
+ node._img = v;
171
+ var canvas = document.createElement('canvas');
172
+ canvas.width = v[0].width;
173
+ canvas.height = v[0].height;
174
+
175
+ var context = canvas.getContext('2d');
176
+ context.drawImage(v[0], 0, 0, v[0].width, v[0].height);
177
+
178
+ var base64Image = canvas.toDataURL('image/png');
179
+ w.value = base64Image;
180
+ };
181
+
182
+ Object.defineProperty(node, 'imgs', {
183
+ set(v) {
184
+ if (v && !v[0].complete) {
185
+ let orig_onload = v[0].onload;
186
+ v[0].onload = function(v2) {
187
+ if(orig_onload)
188
+ orig_onload();
189
+ set_img_act(v);
190
+ };
191
+ }
192
+ else {
193
+ set_img_act(v);
194
+ }
195
+ },
196
+ get() {
197
+ if(this._img == undefined && w.value != '') {
198
+ this._img = [new Image()];
199
+ if(stw_widget.value && w.value != '[IMAGE DATA]')
200
+ this._img[0].src = w.value;
201
+ }
202
+ else if(this._img == undefined && path_widget.value) {
203
+ let image = new Image();
204
+ image.src = path_widget.value;
205
+
206
+ try {
207
+ let item = getFileItem('temp', path_widget.value);
208
+ let params = `?filename=${item.filename}&type=${item.type}&subfolder=${item.subfolder}`;
209
+
210
+ let res = api.fetchApi('/view/validate'+params, { cache: "no-store" }).then(response => response);
211
+ if(res.status == 200) {
212
+ image.src = api.apiURL('/view'+params);
213
+ }
214
+
215
+ this._img = [new Image()]; // placeholder
216
+ image.onload = function(v) {
217
+ set_img_act([image]);
218
+ };
219
+ }
220
+ catch {
221
+
222
+ }
223
+ }
224
+ return this._img;
225
+ }
226
+ });
227
+ }
228
+ }
229
+ })
comfyui-impact-pack/js/impact-pack.js ADDED
@@ -0,0 +1,933 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ComfyApp, app } from "../../scripts/app.js";
2
+ import { ComfyDialog, $el } from "../../scripts/ui.js";
3
+ import { api } from "../../scripts/api.js";
4
+ import { customAlert, isBeforeFrontendVersion } from "./common.js";
5
+
6
+ const is_legacy_front = () => isBeforeFrontendVersion('1.16.9');
7
+
8
+ if(is_legacy_front()) {
9
+ customAlert("An outdated version(<1.16.9) of the `comfyui-frontend-package` is installed. It is not compatible with the current version of the Impact Pack.");
10
+ }
11
+
12
+ let wildcards_list = [];
13
+ async function load_wildcards() {
14
+ let res = await api.fetchApi('/impact/wildcards/list');
15
+ let data = await res.json();
16
+ wildcards_list = data.data;
17
+ }
18
+
19
+ load_wildcards();
20
+
21
+ export function get_wildcards_list() {
22
+ return wildcards_list;
23
+ }
24
+
25
+ // temporary implementation (copying from https://github.com/pythongosssss/ComfyUI-WD14-Tagger)
26
+ // I think this should be included into master!!
27
+ class ImpactProgressBadge {
28
+ constructor() {
29
+ if (!window.__progress_badge__) {
30
+ window.__progress_badge__ = Symbol("__impact_progress_badge__");
31
+ }
32
+ this.symbol = window.__progress_badge__;
33
+ }
34
+
35
+ getState(node) {
36
+ return node[this.symbol] || {};
37
+ }
38
+
39
+ setState(node, state) {
40
+ node[this.symbol] = state;
41
+ app.canvas.setDirty(true);
42
+ }
43
+
44
+ addStatusHandler(nodeType) {
45
+ if (nodeType[this.symbol]?.statusTagHandler) {
46
+ return;
47
+ }
48
+ if (!nodeType[this.symbol]) {
49
+ nodeType[this.symbol] = {};
50
+ }
51
+ nodeType[this.symbol] = {
52
+ statusTagHandler: true,
53
+ };
54
+
55
+ api.addEventListener("impact/update_status", ({ detail }) => {
56
+ let { node, progress, text } = detail;
57
+ const n = app.graph.getNodeById(+(node || app.runningNodeId));
58
+ if (!n) return;
59
+ const state = this.getState(n);
60
+ state.status = Object.assign(state.status || {}, { progress: text ? progress : null, text: text || null });
61
+ this.setState(n, state);
62
+ });
63
+
64
+ const self = this;
65
+ const onDrawForeground = nodeType.prototype.onDrawForeground;
66
+ nodeType.prototype.onDrawForeground = function (ctx) {
67
+ const r = onDrawForeground?.apply?.(this, arguments);
68
+ const state = self.getState(this);
69
+ if (!state?.status?.text) {
70
+ return r;
71
+ }
72
+
73
+ const { fgColor, bgColor, text, progress, progressColor } = { ...state.status };
74
+
75
+ ctx.save();
76
+ ctx.font = "12px sans-serif";
77
+ const sz = ctx.measureText(text);
78
+ ctx.fillStyle = bgColor || "dodgerblue";
79
+ ctx.beginPath();
80
+ ctx.roundRect(0, -LiteGraph.NODE_TITLE_HEIGHT - 20, sz.width + 12, 20, 5);
81
+ ctx.fill();
82
+
83
+ if (progress) {
84
+ ctx.fillStyle = progressColor || "green";
85
+ ctx.beginPath();
86
+ ctx.roundRect(0, -LiteGraph.NODE_TITLE_HEIGHT - 20, (sz.width + 12) * progress, 20, 5);
87
+ ctx.fill();
88
+ }
89
+
90
+ ctx.fillStyle = fgColor || "#fff";
91
+ ctx.fillText(text, 6, -LiteGraph.NODE_TITLE_HEIGHT - 6);
92
+ ctx.restore();
93
+ return r;
94
+ };
95
+ }
96
+ }
97
+
98
+ const input_tracking = {};
99
+ const input_dirty = {};
100
+ const output_tracking = {};
101
+
102
+ function progressExecuteHandler(event) {
103
+ if(event.detail?.output?.aux){
104
+ const id = event.detail.node;
105
+ if(input_tracking.hasOwnProperty(id)) {
106
+ if(input_tracking.hasOwnProperty(id) && input_tracking[id][0] != event.detail.output.aux[0]) {
107
+ input_dirty[id] = true;
108
+ }
109
+ else{
110
+
111
+ }
112
+ }
113
+
114
+ input_tracking[id] = event.detail.output.aux;
115
+ }
116
+ }
117
+
118
+ function imgSendHandler(event) {
119
+ if(event.detail.images.length > 0){
120
+ let data = event.detail.images[0];
121
+ let filename = `${data.filename} [${data.type}]`;
122
+
123
+ let nodes = app.graph._nodes;
124
+ for(let i in nodes) {
125
+ if(nodes[i].type == 'ImageReceiver') {
126
+ let is_linked = false;
127
+
128
+ if(nodes[i].widgets[1].type == 'converted-widget') {
129
+ for(let j in nodes[i].inputs) {
130
+ let input = nodes[i].inputs[j];
131
+ if(input.name === 'link_id') {
132
+ if(input.link) {
133
+ let src_node = app.graph._nodes_by_id[app.graph.links[input.link].origin_id];
134
+ if(src_node.type == 'ImpactInt' || src_node.type == 'PrimitiveNode') {
135
+ is_linked = true;
136
+ }
137
+ }
138
+ break;
139
+ }
140
+ }
141
+ }
142
+ else if(nodes[i].widgets[1].value == event.detail.link_id) {
143
+ is_linked = true;
144
+ }
145
+
146
+ if(is_linked) {
147
+ if(data.subfolder)
148
+ nodes[i].widgets[0].value = `${data.subfolder}/${data.filename} [${data.type}]`;
149
+ else
150
+ nodes[i].widgets[0].value = `${data.filename} [${data.type}]`;
151
+
152
+ let img = new Image();
153
+ img.onload = (event) => {
154
+ nodes[i].imgs = [img];
155
+ nodes[i].size[1] = Math.max(200, nodes[i].size[1]);
156
+ app.canvas.setDirty(true);
157
+ };
158
+ img.src = `/view?filename=${data.filename}&type=${data.type}&subfolder=${data.subfolder}`+app.getPreviewFormatParam();
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+
165
+
166
+ function latentSendHandler(event) {
167
+ if(event.detail.images.length > 0){
168
+ let data = event.detail.images[0];
169
+ let filename = `${data.filename} [${data.type}]`;
170
+
171
+ let nodes = app.graph._nodes;
172
+ for(let i in nodes) {
173
+ if(nodes[i].type == 'LatentReceiver') {
174
+ if(nodes[i].widgets[1].value == event.detail.link_id) {
175
+ if(data.subfolder)
176
+ nodes[i].widgets[0].value = `${data.subfolder}/${data.filename} [${data.type}]`;
177
+ else
178
+ nodes[i].widgets[0].value = `${data.filename} [${data.type}]`;
179
+
180
+ let img = new Image();
181
+ img.src = `/view?filename=${data.filename}&type=${data.type}&subfolder=${data.subfolder}`+app.getPreviewFormatParam();
182
+ nodes[i].imgs = [img];
183
+ nodes[i].size[1] = Math.max(200, nodes[i].size[1]);
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+
190
+
191
+ function valueSendHandler(event) {
192
+ let nodes = app.graph._nodes;
193
+ for(let i in nodes) {
194
+ if(nodes[i].type == 'ImpactValueReceiver') {
195
+ if(nodes[i].widgets[2].value == event.detail.link_id) {
196
+ nodes[i].widgets[1].value = event.detail.value;
197
+
198
+ let typ = typeof event.detail.value;
199
+ if(typ == 'string') {
200
+ nodes[i].widgets[0].value = "STRING";
201
+ }
202
+ else if(typ == "boolean") {
203
+ nodes[i].widgets[0].value = "BOOLEAN";
204
+ }
205
+ else if(typ != "number") {
206
+ nodes[i].widgets[0].value = typeof event.detail.value;
207
+ }
208
+ else if(Number.isInteger(event.detail.value)) {
209
+ nodes[i].widgets[0].value = "INT";
210
+ }
211
+ else {
212
+ nodes[i].widgets[0].value = "FLOAT";
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+
220
+ const impactProgressBadge = new ImpactProgressBadge();
221
+
222
+ api.addEventListener("stop-iteration", () => {
223
+ document.getElementById("autoQueueCheckbox").checked = false;
224
+ });
225
+ api.addEventListener("value-send", valueSendHandler);
226
+ api.addEventListener("img-send", imgSendHandler);
227
+ api.addEventListener("latent-send", latentSendHandler);
228
+ api.addEventListener("executed", progressExecuteHandler);
229
+
230
+ app.registerExtension({
231
+ name: "Comfy.Impack",
232
+
233
+ commands: [
234
+ {
235
+ id: 'refresh-impact-wildcard',
236
+ label: 'Impact: Refresh Wildcard',
237
+ function: async () => {
238
+ await api.fetchApi('/impact/wildcards/refresh');
239
+ await load_wildcards();
240
+ app.extensionManager.toast.add({
241
+ severity: 'info',
242
+ summary: 'Refreshed!',
243
+ detail: 'Impact Wildcard List is refreshed!!',
244
+ life: 3000
245
+ });
246
+ }
247
+ }
248
+ ],
249
+
250
+ menuCommands: [
251
+ {
252
+ path: ['Edit'],
253
+ commands: ['refresh-impact-wildcard']
254
+ }
255
+ ],
256
+
257
+ loadedGraphNode(node, app) {
258
+ if (node.comfyClass == "MaskPainter") {
259
+ input_dirty[node.id + ""] = true;
260
+ }
261
+ },
262
+
263
+ async beforeRegisterNodeDef(nodeType, nodeData, app) {
264
+ if (nodeData.name == "IterativeLatentUpscale" || nodeData.name == "IterativeImageUpscale"
265
+ || nodeData.name == "RegionalSampler"|| nodeData.name == "RegionalSamplerAdvanced") {
266
+ impactProgressBadge.addStatusHandler(nodeType);
267
+ }
268
+
269
+ if(nodeData.name == "ImpactControlBridge") {
270
+ const onConnectionsChange = nodeType.prototype.onConnectionsChange;
271
+ nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
272
+ if(index != 0 || !link_info || this.inputs[0].type != '*')
273
+ return;
274
+
275
+ // assign type
276
+ let slot_type = '*';
277
+
278
+ if(type == 2) {
279
+ slot_type = link_info.type;
280
+ }
281
+ else {
282
+ const node = app.graph.getNodeById(link_info.origin_id);
283
+ slot_type = node.outputs[link_info.origin_slot]?.type;
284
+ }
285
+
286
+ this.inputs[0].type = slot_type;
287
+ this.outputs[0].type = slot_type;
288
+ this.outputs[0].label = slot_type;
289
+ }
290
+ }
291
+
292
+ if(nodeData.name == "ImpactConditionalBranch" || nodeData.name == "ImpactConditionalBranchSelMode") {
293
+ const onConnectionsChange = nodeType.prototype.onConnectionsChange;
294
+ nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
295
+ if(!link_info || this.inputs[0].type != '*')
296
+ return;
297
+
298
+ if(index >= 2)
299
+ return;
300
+
301
+ // assign type
302
+ let slot_type = '*';
303
+
304
+ if(type == 2) {
305
+ slot_type = link_info.type;
306
+ }
307
+ else {
308
+ const node = app.graph.getNodeById(link_info.origin_id);
309
+ slot_type = node.outputs[link_info.origin_slot].type;
310
+ }
311
+
312
+ this.inputs[0].type = slot_type;
313
+ this.inputs[1].type = slot_type;
314
+ this.outputs[0].type = slot_type;
315
+ this.outputs[0].label = slot_type;
316
+ }
317
+ }
318
+
319
+ if(nodeData.name == "ImpactCompare") {
320
+ const onConnectionsChange = nodeType.prototype.onConnectionsChange;
321
+ nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
322
+ if(!link_info || this.inputs[0].type != '*' || type == 2)
323
+ return;
324
+
325
+ // assign type
326
+ const node = app.graph.getNodeById(link_info.origin_id);
327
+ let slot_type = node.outputs[link_info.origin_slot].type;
328
+
329
+ this.inputs[0].type = slot_type;
330
+ this.inputs[1].type = slot_type;
331
+ }
332
+ }
333
+
334
+ if(nodeData.name == "ImpactSelectNthItemOfAnyList") {
335
+ const onConnectionsChange = nodeType.prototype.onConnectionsChange;
336
+ nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
337
+ if(!link_info || this.inputs[0].type != '*')
338
+ return;
339
+
340
+ if(index >= 2)
341
+ return;
342
+
343
+ // assign type
344
+ let slot_type = '*';
345
+
346
+ if(type == 2) {
347
+ slot_type = link_info.type;
348
+ }
349
+ else {
350
+ const node = app.graph.getNodeById(link_info.origin_id);
351
+ slot_type = node.outputs[link_info.origin_slot].type;
352
+ }
353
+
354
+ this.inputs[0].type = slot_type;
355
+ this.outputs[0].type = slot_type;
356
+ this.outputs[0].label = slot_type;
357
+ }
358
+ }
359
+
360
+ if(nodeData.name === 'ImpactInversedSwitch') {
361
+ nodeData.output = ['*'];
362
+ nodeData.output_is_list = [false];
363
+ nodeData.output_name = ['output1'];
364
+
365
+ const onConnectionsChange = nodeType.prototype.onConnectionsChange;
366
+ nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
367
+ if(!link_info)
368
+ return;
369
+
370
+ // HOTFIX: subgraph
371
+ const stackTrace = new Error().stack;
372
+
373
+ if(stackTrace.includes('convertToSubgraph') || stackTrace.includes('Subgraph.configure')) {
374
+ return;
375
+ }
376
+
377
+ if(type == 2) {
378
+ // connect output
379
+ if(connected){
380
+ if(app.graph._nodes_by_id[link_info.target_id]?.type == 'Reroute') {
381
+ app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
382
+ }
383
+
384
+ if(this.outputs[0].type == '*'){
385
+ if(link_info.type == '*' && app.graph.getNodeById(link_info.target_id).slots[link_info.target_slot].type != '*') {
386
+ app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
387
+ }
388
+ else {
389
+ // propagate type
390
+ this.outputs[0].type = link_info.type;
391
+ this.outputs[0].name = link_info.type;
392
+
393
+ for(let i in this.inputs) {
394
+ if(this.inputs[i].name != 'select')
395
+ this.inputs[i].type = link_info.type;
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ else {
402
+ if(app.graph._nodes_by_id[link_info.origin_id]?.type == 'Reroute')
403
+ this.disconnectInput(link_info.target_slot);
404
+
405
+ // connect input
406
+ if(this.inputs[0].type == '*'){
407
+ const node = app.graph.getNodeById(link_info.origin_id);
408
+ let origin_type = node.outputs[link_info.origin_slot]?.type;
409
+
410
+ if(origin_type==undefined) {
411
+ return; // fallback
412
+ }
413
+
414
+ if(origin_type == '*' && app.graph.getNodeById(link_info.origin_id).slots[link_info.origin_slot].type != '*') {
415
+ this.disconnectInput(link_info.target_slot);
416
+ return;
417
+ }
418
+
419
+ for(let i in this.inputs) {
420
+ if(this.inputs[i].name != 'select')
421
+ this.inputs[i].type = origin_type;
422
+ }
423
+
424
+ this.outputs[0].type = origin_type;
425
+ this.outputs[0].name = 'output1';
426
+ }
427
+
428
+ return;
429
+ }
430
+
431
+ if (!connected && this.outputs.length > 1) {
432
+ const stackTrace = new Error().stack;
433
+
434
+ if(
435
+ !stackTrace.includes('LGraphNode.prototype.connect') && // for touch device
436
+ !stackTrace.includes('LGraphNode.connect') && // for mouse device
437
+ !stackTrace.includes('loadGraphData')) {
438
+ if(this.outputs[link_info.origin_slot].links.length == 0) {
439
+ this.removeOutput(link_info.origin_slot);
440
+ }
441
+ }
442
+ }
443
+
444
+ let slot_i = 1;
445
+ for (let i = 0; i < this.outputs.length; i++) {
446
+ this.outputs[i].name = `output${slot_i}`
447
+ if (this.outputs[i].slot_index === undefined) {
448
+ this.outputs[i].slot_index = i;
449
+ }
450
+ slot_i++;
451
+ }
452
+
453
+ if(connected) {
454
+ // NOTE: node.slot_index is different with link_info.origin_slot
455
+ let last_slot_index = this.outputs.length - 1;
456
+ if (last_slot_index == link_info.origin_slot) {
457
+ this.addOutput(`output${slot_i}`, this.outputs[0].type);
458
+ }
459
+ }
460
+
461
+ let select_slot = this.inputs.find(x => x.name == "select");
462
+ if(this.widgets?.length) {
463
+ this.widgets[0].options.max = select_slot?this.outputs.length-1:this.outputs.length;
464
+ this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
465
+ if(this.widgets[0].options.max > 0 && this.widgets[0].value == 0)
466
+ this.widgets[0].value = 1;
467
+ }
468
+ }
469
+ }
470
+
471
+ if (nodeData.name === 'ImpactMakeImageList' || nodeData.name === 'ImpactMakeImageBatch' ||
472
+ nodeData.name === 'ImpactMakeMaskList' || nodeData.name === 'ImpactMakeMaskBatch' ||
473
+ nodeData.name === 'ImpactMakeAnyList' || nodeData.name === 'CombineRegionalPrompts' ||
474
+ nodeData.name === 'ImpactCombineConditionings' || nodeData.name === 'ImpactConcatConditionings' ||
475
+ nodeData.name === 'ImpactSEGSConcat' ||
476
+ nodeData.name === 'ImpactSwitch' || nodeData.name === 'LatentSwitch' || nodeData.name == 'SEGSSwitch') {
477
+ var input_name = "input";
478
+
479
+ switch(nodeData.name) {
480
+ case 'ImpactMakeImageList':
481
+ case 'ImpactMakeImageBatch':
482
+ input_name = "image";
483
+ break;
484
+
485
+ case 'ImpactMakeMaskList':
486
+ case 'ImpactMakeMaskBatch':
487
+ input_name = "mask";
488
+ break;
489
+
490
+ case 'ImpactMakeAnyList':
491
+ input_name = "value";
492
+ break;
493
+
494
+ case 'ImpactSEGSConcat':
495
+ input_name = "segs";
496
+ break;
497
+
498
+ case 'CombineRegionalPrompts':
499
+ input_name = "regional_prompts";
500
+ break;
501
+
502
+ case 'ImpactCombineConditionings':
503
+ case 'ImpactConcatConditionings':
504
+ input_name = "conditioning";
505
+ break;
506
+
507
+ case 'LatentSwitch':
508
+ input_name = "input";
509
+ break;
510
+
511
+ case 'SEGSSwitch':
512
+ input_name = "input";
513
+ break;
514
+
515
+ case 'ImpactSwitch':
516
+ input_name = "input";
517
+ }
518
+
519
+ const onConnectionsChange = nodeType.prototype.onConnectionsChange;
520
+ nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
521
+ const stackTrace = new Error().stack;
522
+
523
+ // HOTFIX: subgraph
524
+ if(stackTrace.includes('convertToSubgraph') || stackTrace.includes('Subgraph.configure')) {
525
+ return;
526
+ }
527
+
528
+ if(stackTrace.includes('loadGraphData')) {
529
+ if(this.widgets?.[0]) {
530
+ this.widgets[0].options.max = this.inputs.length-3;
531
+ this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
532
+ }
533
+ return;
534
+ }
535
+
536
+ if(stackTrace.includes('pasteFromClipboard')) {
537
+ if(this.widgets?.[0]) {
538
+ this.widgets[0].options.max = this.inputs.length-3;
539
+ this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
540
+ }
541
+ return;
542
+ }
543
+
544
+ if(!link_info)
545
+ return;
546
+
547
+ if(type == 2) {
548
+ // connect output
549
+ if(connected && index == 0){
550
+ if(nodeData.name == 'ImpactSwitch' && app.graph._nodes_by_id[link_info.target_id]?.type == 'Reroute') {
551
+ app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
552
+ }
553
+
554
+ if(this.outputs[0].type == '*'){
555
+ if(link_info.type == '*' && app.graph.getNodeById(link_info.target_id).slots[link_info.target_slot].type != '*') {
556
+ app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot);
557
+ }
558
+ else {
559
+ // propagate type
560
+ this.outputs[0].type = link_info.type;
561
+ this.outputs[0].label = link_info.type;
562
+ this.outputs[0].name = link_info.type;
563
+
564
+ for(let i in this.inputs) {
565
+ let input_i = this.inputs[i];
566
+ if(input_i.name != 'select' && input_i.name != 'sel_mode')
567
+ input_i.type = link_info.type;
568
+ }
569
+ }
570
+ }
571
+ }
572
+
573
+ return;
574
+ }
575
+ else {
576
+ if(nodeData.name == 'ImpactSwitch' && app.graph._nodes_by_id[link_info.origin_id]?.type == 'Reroute')
577
+ this.disconnectInput(link_info.target_slot);
578
+
579
+ // connect input
580
+ if(this.inputs[index].name == 'select' || this.inputs[index].name == 'sel_mode')
581
+ return;
582
+
583
+ if(this.inputs[0].type == '*'){
584
+ const node = app.graph.getNodeById(link_info.origin_id);
585
+
586
+ // NOTE: node is undefined when subgraph editing mode
587
+ if(node) {
588
+ let origin_type = node.outputs[link_info.origin_slot]?.type;
589
+ if(link_info.target_slot == 0 && this.inputs.length > 3) { // NOTE: widgets are regarded as input since new front
590
+ origin_type = this.inputs[1].type;
591
+ node.connect(link_info.origin_slot, node.id, 'input1');
592
+ }
593
+
594
+ if(origin_type == '*' && app.graph.getNodeById(link_info.origin_id).slots[link_info.origin_slot].type != '*') {
595
+ this.disconnectInput(link_info.target_slot);
596
+ return;
597
+ }
598
+
599
+ for(let i in this.inputs) {
600
+ let input_i = this.inputs[i];
601
+ if(input_i.name != 'select' && input_i.name != 'sel_mode')
602
+ input_i.type = origin_type;
603
+ }
604
+
605
+ this.outputs[0].type = origin_type;
606
+ this.outputs[0].label = origin_type;
607
+ this.outputs[0].name = origin_type;
608
+ }
609
+ }
610
+ }
611
+
612
+ let widget_count = 0;
613
+ if(nodeData.name == 'ImpactSwitch' || nodeData.name == 'LatentSwitch' || nodeData.name == 'SEGSSwitch') {
614
+ widget_count += 1;
615
+ }
616
+
617
+ if (!connected && (this.inputs.length > widget_count+1)) {
618
+ if(
619
+ !stackTrace.includes('LGraphNode.prototype.connect') && // for touch device
620
+ !stackTrace.includes('LGraphNode.connect') && // for mouse device
621
+ !stackTrace.includes('loadGraphData') &&
622
+ this.inputs[index].name != 'select') {
623
+ this.removeInput(index);
624
+ }
625
+ }
626
+
627
+ let slot_i = 1;
628
+ for (let i = 0; i < this.inputs.length; i++) {
629
+ let input_i = this.inputs[i];
630
+ if(input_i.name != 'select'&& input_i.name != 'sel_mode') {
631
+ input_i.name = `${input_name}${slot_i}`
632
+ slot_i++;
633
+ }
634
+ }
635
+
636
+ if(connected) {
637
+ this.addInput(`${input_name}${slot_i}`, this.outputs[0].type);
638
+ }
639
+
640
+ if(this.widgets?.[0]) {
641
+ this.widgets[0].options.max = this.inputs.length-3;
642
+ this.widgets[0].value = Math.min(this.widgets[0].value, this.widgets[0].options.max);
643
+ }
644
+ }
645
+ }
646
+ },
647
+
648
+ nodeCreated(node, app) {
649
+ if(node.comfyClass == "MaskPainter") {
650
+ node.addWidget("button", "Edit mask", null, () => {
651
+ ComfyApp.copyToClipspace(node);
652
+ ComfyApp.clipspace_return_node = node;
653
+ ComfyApp.open_maskeditor();
654
+ });
655
+ }
656
+
657
+ switch(node.comfyClass) {
658
+ case "ToDetailerPipe":
659
+ case "ToDetailerPipeSDXL":
660
+ case "BasicPipeToDetailerPipe":
661
+ case "BasicPipeToDetailerPipeSDXL":
662
+ case "EditDetailerPipe":
663
+ case "FaceDetailer":
664
+ case "DetailerForEach":
665
+ case "DetailerForEachDebug":
666
+ case "DetailerForEachPipe":
667
+ case "DetailerForEachDebugPipe":
668
+ {
669
+ for(let i in node.widgets) {
670
+ let widget = node.widgets[i];
671
+ if(widget.type === "customtext") {
672
+ widget.dynamicPrompts = false;
673
+ widget.inputEl.placeholder = "wildcard spec: if kept empty, this option will be ignored";
674
+ widget.serializeValue = () => {
675
+ return node.widgets[i].value;
676
+ };
677
+ }
678
+ }
679
+ }
680
+ break;
681
+ }
682
+
683
+ if(node.comfyClass == "ImpactSEGSLabelFilter" || node.comfyClass == "SEGSLabelFilterDetailerHookProvider") {
684
+ node.widgets[0].callback = (value, canvas, node, pos, e) => {
685
+ if(node) {
686
+ if(node.widgets[1].value.trim() != "" && !node.widgets[1].value.trim().endsWith(","))
687
+ node.widgets[1].value += ", "
688
+
689
+ node.widgets[1].value += value;
690
+ if(node.widgets_values)
691
+ node.widgets_values[1] = node.widgets[1].value;
692
+ }
693
+ }
694
+
695
+ Object.defineProperty(node.widgets[0], "value", {
696
+ set: (value) => {
697
+ node._value = value;
698
+ },
699
+ get: () => {
700
+ return node._value;
701
+ }
702
+ });
703
+ }
704
+
705
+ if(node.comfyClass == "UltralyticsDetectorProvider") {
706
+ let model_name_widget = node.widgets.find((w) => w.name === "model_name");
707
+ let orig_draw = node.onDrawForeground;
708
+ node.onDrawForeground = function (ctx) {
709
+ const r = orig_draw?.apply?.(this, arguments);
710
+
711
+ let is_seg = model_name_widget.value?.startsWith('segm/') || model_name_widget.value?.includes('-seg');
712
+ if(!is_seg) {
713
+ var slot_pos = new Float32Array(2);
714
+ var pos = node.getConnectionPos(false, 1, slot_pos);
715
+
716
+ pos[0] -= node.pos[0] - 10;
717
+ pos[1] -= node.pos[1];
718
+
719
+ ctx.beginPath();
720
+ ctx.strokeStyle = "red";
721
+ ctx.lineWidth = 4;
722
+ ctx.moveTo(pos[0] - 5, pos[1] - 5);
723
+ ctx.lineTo(pos[0] + 5, pos[1] + 5);
724
+ ctx.moveTo(pos[0] + 5, pos[1] - 5);
725
+ ctx.lineTo(pos[0] - 5, pos[1] + 5);
726
+ ctx.stroke();
727
+ }
728
+ }
729
+ }
730
+
731
+ if(
732
+ node.comfyClass == "ImpactWildcardEncode" || node.comfyClass == "ImpactWildcardProcessor"
733
+ || node.comfyClass == "ToDetailerPipe" || node.comfyClass == "ToDetailerPipeSDXL"
734
+ || node.comfyClass == "EditDetailerPipe" || node.comfyClass == "EditDetailerPipeSDXL"
735
+ || node.comfyClass == "BasicPipeToDetailerPipe" || node.comfyClass == "BasicPipeToDetailerPipeSDXL") {
736
+ node._value = "Select the LoRA to add to the text";
737
+ node._wvalue = "Select the Wildcard to add to the text";
738
+
739
+ var tbox_id = 0;
740
+ var combo_id = 3;
741
+ var has_lora = true;
742
+
743
+ switch(node.comfyClass){
744
+ case "ImpactWildcardEncode":
745
+ tbox_id = 0;
746
+ combo_id = 3;
747
+ break;
748
+
749
+ case "ImpactWildcardProcessor":
750
+ tbox_id = 0;
751
+ combo_id = 4;
752
+ has_lora = false;
753
+ break;
754
+
755
+ case "ToDetailerPipe":
756
+ case "ToDetailerPipeSDXL":
757
+ case "EditDetailerPipe":
758
+ case "EditDetailerPipeSDXL":
759
+ case "BasicPipeToDetailerPipe":
760
+ case "BasicPipeToDetailerPipeSDXL":
761
+ tbox_id = 0;
762
+ combo_id = 1;
763
+ break;
764
+ }
765
+
766
+ node.widgets[combo_id+1].callback = (value, canvas, node, pos, e) => {
767
+ if(node) {
768
+ if(node.widgets[tbox_id].value != '')
769
+ node.widgets[tbox_id].value += ', '
770
+
771
+ node.widgets[tbox_id].value += node._wildcard_value;
772
+ }
773
+ }
774
+
775
+ Object.defineProperty(node.widgets[combo_id+1], "value", {
776
+ set: (value) => {
777
+ if (value !== "Select the Wildcard to add to the text")
778
+ node._wildcard_value = value;
779
+ },
780
+ get: () => { return "Select the Wildcard to add to the text"; }
781
+ });
782
+
783
+ Object.defineProperty(node.widgets[combo_id+1].options, "values", {
784
+ set: (x) => {},
785
+ get: () => {
786
+ return wildcards_list;
787
+ }
788
+ });
789
+
790
+ if(has_lora) {
791
+ node.widgets[combo_id].callback = (value, canvas, node, pos, e) => {
792
+ if(node) {
793
+ let lora_name = node._value;
794
+ if(lora_name.endsWith('.safetensors')) {
795
+ lora_name = lora_name.slice(0, -12);
796
+ }
797
+
798
+ node.widgets[tbox_id].value += `<lora:${lora_name}>`;
799
+ if(node.widgets_values) {
800
+ node.widgets_values[tbox_id] = node.widgets[tbox_id].value;
801
+ }
802
+ }
803
+ }
804
+
805
+ Object.defineProperty(node.widgets[combo_id], "value", {
806
+ set: (value) => {
807
+ if (value !== "Select the LoRA to add to the text")
808
+ node._value = value;
809
+ },
810
+
811
+ get: () => { return "Select the LoRA to add to the text"; }
812
+ });
813
+ }
814
+
815
+ // Preventing validation errors from occurring in any situation.
816
+ if(has_lora) {
817
+ node.widgets[combo_id].serializeValue = () => { return "Select the LoRA to add to the text"; }
818
+ }
819
+ node.widgets[combo_id+1].serializeValue = () => { return "Select the Wildcard to add to the text"; }
820
+ }
821
+
822
+ if(node.comfyClass == "ImpactWildcardProcessor" || node.comfyClass == "ImpactWildcardEncode") {
823
+ node.widgets[0].inputEl.placeholder = "Wildcard Prompt (User input)";
824
+ node.widgets[1].inputEl.placeholder = "Populated Prompt (Will be generated automatically)";
825
+ node.widgets[1].inputEl.disabled = true;
826
+
827
+ const populated_text_widget = node.widgets.find((w) => w.name == 'populated_text');
828
+ const mode_widget = node.widgets.find((w) => w.name == 'mode');
829
+
830
+ // mode combo
831
+ Object.defineProperty(mode_widget, "value", {
832
+ set: (value) => {
833
+ if(value == true)
834
+ node._mode_value = "populate";
835
+ else if(value == false)
836
+ node._mode_value = "fixed";
837
+ else
838
+ node._mode_value = value; // combo value
839
+
840
+ populated_text_widget.inputEl.disabled = node._mode_value == 'populate';
841
+ },
842
+ get: () => {
843
+ if(node._mode_value != undefined)
844
+ return node._mode_value;
845
+ else
846
+ return 'populate';
847
+ }
848
+ });
849
+ }
850
+
851
+ if (node.comfyClass == "MaskPainter") {
852
+ node.widgets[0].value = '#placeholder';
853
+
854
+ Object.defineProperty(node, "images", {
855
+ set: function(value) {
856
+ node._images = value;
857
+ },
858
+ get: function() {
859
+ const id = node.id+"";
860
+ if(node.widgets[0].value != '#placeholder') {
861
+ var need_invalidate = false;
862
+
863
+ if(input_dirty.hasOwnProperty(id) && input_dirty[id]) {
864
+ node.widgets[0].value = {...input_tracking[id][1]};
865
+ input_dirty[id] = false;
866
+ need_invalidate = true
867
+ this._images = app.nodeOutputs[id].images;
868
+ }
869
+
870
+ let filename = app.nodeOutputs[id]['aux'][1][0]['filename'];
871
+ let subfolder = app.nodeOutputs[id]['aux'][1][0]['subfolder'];
872
+ let type = app.nodeOutputs[id]['aux'][1][0]['type'];
873
+
874
+ let item =
875
+ {
876
+ image_hash: app.nodeOutputs[id]['aux'][0],
877
+ forward_filename: app.nodeOutputs[id]['aux'][1][0]['filename'],
878
+ forward_subfolder: app.nodeOutputs[id]['aux'][1][0]['subfolder'],
879
+ forward_type: app.nodeOutputs[id]['aux'][1][0]['type']
880
+ };
881
+
882
+ if(node._images) {
883
+ app.nodeOutputs[id].images = [{
884
+ ...node._images[0],
885
+ ...item
886
+ }];
887
+
888
+ node.widgets[0].value =
889
+ {
890
+ ...node._images[0],
891
+ ...item
892
+ };
893
+ }
894
+ else {
895
+ app.nodeOutputs[id].images = [{
896
+ ...item
897
+ }];
898
+
899
+ node.widgets[0].value =
900
+ {
901
+ ...item
902
+ };
903
+ }
904
+
905
+ if(need_invalidate) {
906
+ Promise.all(
907
+ app.nodeOutputs[id].images.map((src) => {
908
+ return new Promise((r) => {
909
+ const img = new Image();
910
+ img.onload = () => r(img);
911
+ img.onerror = () => r(null);
912
+ img.src = "/view?" + new URLSearchParams(src).toString();
913
+ });
914
+ })
915
+ ).then((imgs) => {
916
+ this.imgs = imgs.filter(Boolean);
917
+ this.setSizeForImage?.();
918
+ app.graph.setDirtyCanvas(true);
919
+ });
920
+
921
+ app.nodeOutputs[id].images[0] = { ...node.widgets[0].value };
922
+ }
923
+
924
+ return app.nodeOutputs[id].images;
925
+ }
926
+ else {
927
+ return node._images;
928
+ }
929
+ }
930
+ });
931
+ }
932
+ }
933
+ });
comfyui-impact-pack/js/impact-sam-editor.js ADDED
@@ -0,0 +1,641 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { app } from "../../scripts/app.js";
2
+ import { api } from "../../scripts/api.js";
3
+ import { ComfyDialog, $el } from "../../scripts/ui.js";
4
+ import { ComfyApp } from "../../scripts/app.js";
5
+ import { ClipspaceDialog } from "../../extensions/core/clipspace.js";
6
+
7
+ function addMenuHandler(nodeType, cb) {
8
+ const getOpts = nodeType.prototype.getExtraMenuOptions;
9
+ nodeType.prototype.getExtraMenuOptions = function () {
10
+ const r = getOpts.apply(this, arguments);
11
+ cb.apply(this, arguments);
12
+ return r;
13
+ };
14
+ }
15
+
16
+ // Helper function to convert a data URL to a Blob object
17
+ function dataURLToBlob(dataURL) {
18
+ const parts = dataURL.split(';base64,');
19
+ const contentType = parts[0].split(':')[1];
20
+ const byteString = atob(parts[1]);
21
+ const arrayBuffer = new ArrayBuffer(byteString.length);
22
+ const uint8Array = new Uint8Array(arrayBuffer);
23
+ for (let i = 0; i < byteString.length; i++) {
24
+ uint8Array[i] = byteString.charCodeAt(i);
25
+ }
26
+ return new Blob([arrayBuffer], { type: contentType });
27
+ }
28
+
29
+ function loadedImageToBlob(image) {
30
+ const canvas = document.createElement('canvas');
31
+
32
+ canvas.width = image.width;
33
+ canvas.height = image.height;
34
+
35
+ const ctx = canvas.getContext('2d');
36
+
37
+ ctx.drawImage(image, 0, 0);
38
+
39
+ const dataURL = canvas.toDataURL('image/png', 1);
40
+ const blob = dataURLToBlob(dataURL);
41
+
42
+ return blob;
43
+ }
44
+
45
+ async function uploadMask(filepath, formData) {
46
+ await api.fetchApi('/upload/mask', {
47
+ method: 'POST',
48
+ body: formData
49
+ }).then(response => {}).catch(error => {
50
+ console.error('Error:', error);
51
+ });
52
+
53
+ ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']] = new Image();
54
+ ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src = `view?filename=${filepath.filename}&type=${filepath.type}`;
55
+
56
+ if(ComfyApp.clipspace.images)
57
+ ComfyApp.clipspace.images[ComfyApp.clipspace['selectedIndex']] = filepath;
58
+
59
+ ClipspaceDialog.invalidatePreview();
60
+ }
61
+
62
+ class ImpactSamEditorDialog extends ComfyDialog {
63
+ static instance = null;
64
+
65
+ static getInstance() {
66
+ if(!ImpactSamEditorDialog.instance) {
67
+ ImpactSamEditorDialog.instance = new ImpactSamEditorDialog();
68
+ }
69
+
70
+ return ImpactSamEditorDialog.instance;
71
+ }
72
+
73
+ constructor() {
74
+ super();
75
+ this.element = $el("div.comfy-modal", { parent: document.body },
76
+ [ $el("div.comfy-modal-content",
77
+ [...this.createButtons()]),
78
+ ]);
79
+ }
80
+
81
+ createButtons() {
82
+ return [];
83
+ }
84
+
85
+ createButton(name, callback) {
86
+ var button = document.createElement("button");
87
+ button.innerText = name;
88
+ button.addEventListener("click", callback);
89
+ return button;
90
+ }
91
+
92
+ createLeftButton(name, callback) {
93
+ var button = this.createButton(name, callback);
94
+ button.style.cssFloat = "left";
95
+ button.style.marginRight = "4px";
96
+ return button;
97
+ }
98
+
99
+ createRightButton(name, callback) {
100
+ var button = this.createButton(name, callback);
101
+ button.style.cssFloat = "right";
102
+ button.style.marginLeft = "4px";
103
+ return button;
104
+ }
105
+
106
+ createLeftSlider(self, name, callback) {
107
+ const divElement = document.createElement('div');
108
+ divElement.id = "sam-confidence-slider";
109
+ divElement.style.cssFloat = "left";
110
+ divElement.style.fontFamily = "sans-serif";
111
+ divElement.style.marginRight = "4px";
112
+ divElement.style.color = "var(--input-text)";
113
+ divElement.style.backgroundColor = "var(--comfy-input-bg)";
114
+ divElement.style.borderRadius = "8px";
115
+ divElement.style.borderColor = "var(--border-color)";
116
+ divElement.style.borderStyle = "solid";
117
+ divElement.style.fontSize = "15px";
118
+ divElement.style.height = "21px";
119
+ divElement.style.padding = "1px 6px";
120
+ divElement.style.display = "flex";
121
+ divElement.style.position = "relative";
122
+ divElement.style.top = "2px";
123
+ self.confidence_slider_input = document.createElement('input');
124
+ self.confidence_slider_input.setAttribute('type', 'range');
125
+ self.confidence_slider_input.setAttribute('min', '0');
126
+ self.confidence_slider_input.setAttribute('max', '100');
127
+ self.confidence_slider_input.setAttribute('value', '70');
128
+ const labelElement = document.createElement("label");
129
+ labelElement.textContent = name;
130
+
131
+ divElement.appendChild(labelElement);
132
+ divElement.appendChild(self.confidence_slider_input);
133
+
134
+ self.confidence_slider_input.addEventListener("change", callback);
135
+
136
+ return divElement;
137
+ }
138
+
139
+ async detect_and_invalidate_mask_canvas(self) {
140
+ const mask_img = await self.detect(self);
141
+
142
+ const canvas = self.maskCtx.canvas;
143
+ const ctx = self.maskCtx;
144
+
145
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
146
+
147
+ await new Promise((resolve, reject) => {
148
+ self.mask_image = new Image();
149
+ self.mask_image.onload = function() {
150
+ ctx.drawImage(self.mask_image, 0, 0, canvas.width, canvas.height);
151
+ resolve();
152
+ };
153
+ self.mask_image.onerror = reject;
154
+ self.mask_image.src = mask_img.src;
155
+ });
156
+ }
157
+
158
+ setlayout(imgCanvas, maskCanvas, pointsCanvas) {
159
+ const self = this;
160
+
161
+ // If it is specified as relative, using it only as a hidden placeholder for padding is recommended
162
+ // to prevent anomalies where it exceeds a certain size and goes outside of the window.
163
+ var placeholder = document.createElement("div");
164
+ placeholder.style.position = "relative";
165
+ placeholder.style.height = "50px";
166
+
167
+ var bottom_panel = document.createElement("div");
168
+ bottom_panel.style.position = "absolute";
169
+ bottom_panel.style.bottom = "0px";
170
+ bottom_panel.style.left = "20px";
171
+ bottom_panel.style.right = "20px";
172
+ bottom_panel.style.height = "50px";
173
+
174
+ var brush = document.createElement("div");
175
+ brush.id = "sam-brush";
176
+ brush.style.backgroundColor = "blue";
177
+ brush.style.outline = "2px solid pink";
178
+ brush.style.borderRadius = "50%";
179
+ brush.style.MozBorderRadius = "50%";
180
+ brush.style.WebkitBorderRadius = "50%";
181
+ brush.style.position = "absolute";
182
+ brush.style.zIndex = 100;
183
+ brush.style.pointerEvents = "none";
184
+ this.brush = brush;
185
+ this.element.appendChild(imgCanvas);
186
+ this.element.appendChild(maskCanvas);
187
+ this.element.appendChild(pointsCanvas);
188
+ this.element.appendChild(placeholder); // must below z-index than bottom_panel to avoid covering button
189
+ this.element.appendChild(bottom_panel);
190
+ document.body.appendChild(brush);
191
+ this.brush_size = 5;
192
+
193
+ var confidence_slider = this.createLeftSlider(self, "Confidence", (event) => {
194
+ self.confidence = event.target.value;
195
+ });
196
+
197
+ var clearButton = this.createLeftButton("Clear", () => {
198
+ self.maskCtx.clearRect(0, 0, self.maskCanvas.width, self.maskCanvas.height);
199
+ self.pointsCtx.clearRect(0, 0, self.pointsCanvas.width, self.pointsCanvas.height);
200
+
201
+ self.prompt_points = [];
202
+
203
+ self.invalidatePointsCanvas(self);
204
+ });
205
+
206
+ var detectButton = this.createLeftButton("Detect", () => self.detect_and_invalidate_mask_canvas(self));
207
+
208
+ var cancelButton = this.createRightButton("Cancel", () => {
209
+ document.removeEventListener("mouseup", ImpactSamEditorDialog.handleMouseUp);
210
+ document.removeEventListener("keydown", ImpactSamEditorDialog.handleKeyDown);
211
+ self.close();
212
+ });
213
+
214
+ self.saveButton = this.createRightButton("Save", () => {
215
+ document.removeEventListener("mouseup", ImpactSamEditorDialog.handleMouseUp);
216
+ document.removeEventListener("keydown", ImpactSamEditorDialog.handleKeyDown);
217
+ self.save(self);
218
+ });
219
+
220
+ var undoButton = this.createLeftButton("Undo", () => {
221
+ if(self.prompt_points.length > 0) {
222
+ self.prompt_points.pop();
223
+ self.pointsCtx.clearRect(0, 0, self.pointsCanvas.width, self.pointsCanvas.height);
224
+ self.invalidatePointsCanvas(self);
225
+ }
226
+ });
227
+
228
+ bottom_panel.appendChild(clearButton);
229
+ bottom_panel.appendChild(detectButton);
230
+ bottom_panel.appendChild(self.saveButton);
231
+ bottom_panel.appendChild(cancelButton);
232
+ bottom_panel.appendChild(confidence_slider);
233
+ bottom_panel.appendChild(undoButton);
234
+
235
+ imgCanvas.style.position = "relative";
236
+ imgCanvas.style.top = "200";
237
+ imgCanvas.style.left = "0";
238
+
239
+ maskCanvas.style.position = "absolute";
240
+ maskCanvas.style.opacity = 0.5;
241
+ pointsCanvas.style.position = "absolute";
242
+ }
243
+
244
+ show() {
245
+ this.mask_image = null;
246
+ self.prompt_points = [];
247
+
248
+ this.message_box = $el("p", ["Please wait a moment while the SAM model and the image are being loaded."]);
249
+ this.element.appendChild(this.message_box);
250
+
251
+ if(self.imgCtx) {
252
+ self.imgCtx.clearRect(0, 0, self.imageCanvas.width, self.imageCanvas.height);
253
+ }
254
+
255
+ const target_image_path = ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src;
256
+ this.load_sam(target_image_path);
257
+
258
+ if(!this.is_layout_created) {
259
+ // layout
260
+ const imgCanvas = document.createElement('canvas');
261
+ const maskCanvas = document.createElement('canvas');
262
+ const pointsCanvas = document.createElement('canvas');
263
+
264
+ imgCanvas.id = "imageCanvas";
265
+ maskCanvas.id = "samEditorMaskCanvas";
266
+ pointsCanvas.id = "pointsCanvas";
267
+
268
+ this.setlayout(imgCanvas, maskCanvas, pointsCanvas);
269
+
270
+ // prepare content
271
+ this.imgCanvas = imgCanvas;
272
+ this.maskCanvas = maskCanvas;
273
+ this.pointsCanvas = pointsCanvas;
274
+ this.maskCtx = maskCanvas.getContext('2d');
275
+ this.pointsCtx = pointsCanvas.getContext('2d');
276
+
277
+ this.is_layout_created = true;
278
+
279
+ // replacement of onClose hook since close is not real close
280
+ const self = this;
281
+ const observer = new MutationObserver(function(mutations) {
282
+ mutations.forEach(function(mutation) {
283
+ if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
284
+ if(self.last_display_style && self.last_display_style != 'none' && self.element.style.display == 'none') {
285
+ ComfyApp.onClipspaceEditorClosed();
286
+ }
287
+
288
+ self.last_display_style = self.element.style.display;
289
+ }
290
+ });
291
+ });
292
+
293
+ const config = { attributes: true };
294
+ observer.observe(this.element, config);
295
+ }
296
+
297
+ this.setImages(target_image_path, this.imgCanvas, this.pointsCanvas);
298
+
299
+ if(ComfyApp.clipspace_return_node) {
300
+ this.saveButton.innerText = "Save to node";
301
+ }
302
+ else {
303
+ this.saveButton.innerText = "Save";
304
+ }
305
+ this.saveButton.disabled = true;
306
+
307
+ this.element.style.display = "block";
308
+ this.element.style.zIndex = 8888; // NOTE: alert dialog must be high priority.
309
+ }
310
+
311
+ updateBrushPreview(self, event) {
312
+ event.preventDefault();
313
+
314
+ const centerX = event.pageX;
315
+ const centerY = event.pageY;
316
+
317
+ const brush = self.brush;
318
+
319
+ brush.style.width = self.brush_size * 2 + "px";
320
+ brush.style.height = self.brush_size * 2 + "px";
321
+ brush.style.left = (centerX - self.brush_size) + "px";
322
+ brush.style.top = (centerY - self.brush_size) + "px";
323
+ }
324
+
325
+ setImages(target_image_path, imgCanvas, pointsCanvas) {
326
+ const imgCtx = imgCanvas.getContext('2d');
327
+ const maskCtx = this.maskCtx;
328
+ const maskCanvas = this.maskCanvas;
329
+
330
+ const self = this;
331
+
332
+ // image load
333
+ const orig_image = new Image();
334
+ window.addEventListener("resize", () => {
335
+ // repositioning
336
+ imgCanvas.width = window.innerWidth - 250;
337
+ imgCanvas.height = window.innerHeight - 200;
338
+
339
+ // redraw image
340
+ let drawWidth = orig_image.width;
341
+ let drawHeight = orig_image.height;
342
+
343
+ if (orig_image.width > imgCanvas.width) {
344
+ drawWidth = imgCanvas.width;
345
+ drawHeight = (drawWidth / orig_image.width) * orig_image.height;
346
+ }
347
+
348
+ if (drawHeight > imgCanvas.height) {
349
+ drawHeight = imgCanvas.height;
350
+ drawWidth = (drawHeight / orig_image.height) * orig_image.width;
351
+ }
352
+
353
+ imgCtx.drawImage(orig_image, 0, 0, drawWidth, drawHeight);
354
+
355
+ // update mask
356
+ let w = (drawWidth * imgCanvas.clientWidth/imgCanvas.width) + "px";
357
+ let h = (drawHeight * imgCanvas.clientHeight/imgCanvas.height) + "px";
358
+
359
+ pointsCanvas.width = drawWidth * imgCanvas.clientWidth/imgCanvas.width;
360
+ pointsCanvas.height = drawHeight * imgCanvas.clientHeight/imgCanvas.height;
361
+ pointsCanvas.style.top = imgCanvas.offsetTop + "px";
362
+ pointsCanvas.style.left = imgCanvas.offsetLeft + "px";
363
+
364
+ maskCanvas.width = pointsCanvas.width;
365
+ maskCanvas.height = pointsCanvas.height;
366
+ maskCanvas.style.top = imgCanvas.offsetTop + "px";
367
+ maskCanvas.style.left = imgCanvas.offsetLeft + "px";
368
+
369
+ self.invalidateMaskCanvas(self);
370
+ self.invalidatePointsCanvas(self);
371
+ });
372
+
373
+ // original image load
374
+ orig_image.onload = () => self.onLoaded(self);
375
+ const rgb_url = new URL(target_image_path);
376
+ rgb_url.searchParams.delete('channel');
377
+ rgb_url.searchParams.set('channel', 'rgb');
378
+ orig_image.src = rgb_url;
379
+ self.image = orig_image;
380
+ }
381
+
382
+ onLoaded(self) {
383
+ if(self.message_box) {
384
+ self.element.removeChild(self.message_box);
385
+ self.message_box = null;
386
+ }
387
+
388
+ window.dispatchEvent(new Event('resize'));
389
+
390
+ self.setEventHandler(pointsCanvas);
391
+ self.saveButton.disabled = false;
392
+ }
393
+
394
+ setEventHandler(targetCanvas) {
395
+ targetCanvas.addEventListener("contextmenu", (event) => {
396
+ event.preventDefault();
397
+ });
398
+
399
+ const self = this;
400
+ targetCanvas.addEventListener('pointermove', (event) => this.updateBrushPreview(self,event));
401
+ targetCanvas.addEventListener('pointerdown', (event) => this.handlePointerDown(self,event));
402
+ targetCanvas.addEventListener('pointerover', (event) => { this.brush.style.display = "block"; });
403
+ targetCanvas.addEventListener('pointerleave', (event) => { this.brush.style.display = "none"; });
404
+ document.addEventListener('keydown', ImpactSamEditorDialog.handleKeyDown);
405
+ }
406
+
407
+ static handleKeyDown(event) {
408
+ const self = ImpactSamEditorDialog.instance;
409
+ if (event.key === '=') { // positive
410
+ brush.style.backgroundColor = "blue";
411
+ brush.style.outline = "2px solid pink";
412
+ self.is_positive_mode = true;
413
+ } else if (event.key === '-') { // negative
414
+ brush.style.backgroundColor = "red";
415
+ brush.style.outline = "2px solid skyblue";
416
+ self.is_positive_mode = false;
417
+ }
418
+ }
419
+
420
+ is_positive_mode = true;
421
+ prompt_points = [];
422
+ confidence = 70;
423
+
424
+ invalidatePointsCanvas(self) {
425
+ const ctx = self.pointsCtx;
426
+
427
+ for (const i in self.prompt_points) {
428
+ const [is_positive, x, y] = self.prompt_points[i];
429
+
430
+ const scaledX = x * ctx.canvas.width / self.image.width;
431
+ const scaledY = y * ctx.canvas.height / self.image.height;
432
+
433
+ if(is_positive)
434
+ ctx.fillStyle = "blue";
435
+ else
436
+ ctx.fillStyle = "red";
437
+ ctx.beginPath();
438
+ ctx.arc(scaledX, scaledY, 3, 0, 3 * Math.PI);
439
+ ctx.fill();
440
+ }
441
+ }
442
+
443
+ invalidateMaskCanvas(self) {
444
+ if(self.mask_image) {
445
+ self.maskCtx.clearRect(0, 0, self.maskCanvas.width, self.maskCanvas.height);
446
+ self.maskCtx.drawImage(self.mask_image, 0, 0, self.maskCanvas.width, self.maskCanvas.height);
447
+ }
448
+ }
449
+
450
+ async load_sam(url) {
451
+ const parsedUrl = new URL(url);
452
+ const searchParams = new URLSearchParams(parsedUrl.search);
453
+
454
+ const filename = searchParams.get("filename") || "";
455
+ const fileType = searchParams.get("type") || "";
456
+ const subfolder = searchParams.get("subfolder") || "";
457
+
458
+ const data = {
459
+ sam_model_name: "auto",
460
+ filename: filename,
461
+ type: fileType,
462
+ subfolder: subfolder
463
+ };
464
+
465
+ api.fetchApi('/sam/prepare', {
466
+ method: 'POST',
467
+ headers: { 'Content-Type': 'application/json' },
468
+ body: JSON.stringify(data)
469
+ });
470
+ }
471
+
472
+ async detect(self) {
473
+ const positive_points = [];
474
+ const negative_points = [];
475
+
476
+ for(const i in self.prompt_points) {
477
+ const [is_positive, x, y] = self.prompt_points[i];
478
+ const point = [x,y];
479
+ if(is_positive) {
480
+ positive_points.push(point);
481
+ }
482
+ else
483
+ negative_points.push(point);
484
+ }
485
+
486
+ const data = {
487
+ positive_points: positive_points,
488
+ negative_points: negative_points,
489
+ threshold: self.confidence/100
490
+ };
491
+
492
+ const response = await api.fetchApi('/sam/detect', {
493
+ method: 'POST',
494
+ headers: { 'Content-Type': 'image/png' },
495
+ body: JSON.stringify(data)
496
+ });
497
+
498
+ const blob = await response.blob();
499
+ const url = URL.createObjectURL(blob);
500
+
501
+ return new Promise((resolve, reject) => {
502
+ const image = new Image();
503
+ image.onload = () => resolve(image);
504
+ image.onerror = reject;
505
+ image.src = url;
506
+ });
507
+ }
508
+
509
+ handlePointerDown(self, event) {
510
+ if ([0, 2, 5].includes(event.button)) {
511
+ event.preventDefault();
512
+ const x = event.offsetX || event.targetTouches[0].clientX - maskRect.left;
513
+ const y = event.offsetY || event.targetTouches[0].clientY - maskRect.top;
514
+
515
+ const originalX = x * self.image.width / self.pointsCanvas.clientWidth;
516
+ const originalY = y * self.image.height / self.pointsCanvas.clientHeight;
517
+
518
+ var point = null;
519
+ if (event.button == 0) {
520
+ // positive
521
+ point = [true, originalX, originalY];
522
+ } else {
523
+ // negative
524
+ point = [false, originalX, originalY];
525
+ }
526
+
527
+ self.prompt_points.push(point);
528
+
529
+ self.invalidatePointsCanvas(self);
530
+ }
531
+ }
532
+
533
+ async save(self) {
534
+ if(!self.mask_image) {
535
+ this.close();
536
+ return;
537
+ }
538
+
539
+ const save_canvas = document.createElement('canvas');
540
+
541
+ const save_ctx = save_canvas.getContext('2d', {willReadFrequently:true});
542
+ save_canvas.width = self.mask_image.width;
543
+ save_canvas.height = self.mask_image.height;
544
+
545
+ save_ctx.drawImage(self.mask_image, 0, 0, save_canvas.width, save_canvas.height);
546
+
547
+ const save_data = save_ctx.getImageData(0, 0, save_canvas.width, save_canvas.height);
548
+
549
+ // refine mask image
550
+ for (let i = 0; i < save_data.data.length; i += 4) {
551
+ if(save_data.data[i]) {
552
+ save_data.data[i+3] = 0;
553
+ }
554
+ else {
555
+ save_data.data[i+3] = 255;
556
+ }
557
+
558
+ save_data.data[i] = 0;
559
+ save_data.data[i+1] = 0;
560
+ save_data.data[i+2] = 0;
561
+ }
562
+
563
+ save_ctx.globalCompositeOperation = 'source-over';
564
+ save_ctx.putImageData(save_data, 0, 0);
565
+
566
+ const formData = new FormData();
567
+ const filename = "clipspace-mask-" + performance.now() + ".png";
568
+
569
+ const item =
570
+ {
571
+ "filename": filename,
572
+ "subfolder": "",
573
+ "type": "temp",
574
+ };
575
+
576
+ if(ComfyApp.clipspace.images)
577
+ ComfyApp.clipspace.images[0] = item;
578
+
579
+ if(ComfyApp.clipspace.widgets) {
580
+ const index = ComfyApp.clipspace.widgets.findIndex(obj => obj.name === 'image');
581
+
582
+ if(index >= 0)
583
+ ComfyApp.clipspace.widgets[index].value = `${filename} [temp]`;
584
+ }
585
+
586
+ const dataURL = save_canvas.toDataURL();
587
+ const blob = dataURLToBlob(dataURL);
588
+
589
+ let original_url = new URL(this.image.src);
590
+
591
+ const original_ref = { filename: original_url.searchParams.get('filename') };
592
+
593
+ let original_subfolder = original_url.searchParams.get("subfolder");
594
+ if(original_subfolder)
595
+ original_ref.subfolder = original_subfolder;
596
+
597
+ let original_type = original_url.searchParams.get("type");
598
+ if(original_type)
599
+ original_ref.type = original_type;
600
+
601
+ formData.append('image', blob, filename);
602
+ formData.append('original_ref', JSON.stringify(original_ref));
603
+ formData.append('type', "temp");
604
+
605
+ await uploadMask(item, formData);
606
+ ComfyApp.onClipspaceEditorSave();
607
+ this.close();
608
+ }
609
+ }
610
+
611
+ app.registerExtension({
612
+ name: "Comfy.Impact.SAMEditor",
613
+ init(app) {
614
+ const callback =
615
+ function () {
616
+ let dlg = ImpactSamEditorDialog.getInstance();
617
+ dlg.show();
618
+ };
619
+
620
+ const context_predicate = () => ComfyApp.clipspace && ComfyApp.clipspace.imgs && ComfyApp.clipspace.imgs.length > 0
621
+ ClipspaceDialog.registerButton("Impact SAM Detector", context_predicate, callback);
622
+ },
623
+
624
+ async beforeRegisterNodeDef(nodeType, nodeData, app) {
625
+ if (Array.isArray(nodeData.output) && (nodeData.output.includes("MASK") || nodeData.output.includes("IMAGE"))) {
626
+ addMenuHandler(nodeType, function (_, options) {
627
+ options.unshift({
628
+ content: "Open in SAM Detector",
629
+ callback: () => {
630
+ ComfyApp.copyToClipspace(this);
631
+ ComfyApp.clipspace_return_node = this;
632
+
633
+ let dlg = ImpactSamEditorDialog.getInstance();
634
+ dlg.show();
635
+ },
636
+ });
637
+ });
638
+ }
639
+ }
640
+ });
641
+
comfyui-impact-pack/js/impact-segs-picker.js ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ComfyApp, app } from "../../scripts/app.js";
2
+ import { ComfyDialog, $el } from "../../scripts/ui.js";
3
+ import { api } from "../../scripts/api.js";
4
+
5
+ async function open_picker(node) {
6
+ const resp = await api.fetchApi(`/impact/segs/picker/count?id=${node.id}`);
7
+ const body = await resp.text();
8
+
9
+ let cnt = parseInt(body);
10
+
11
+ var existingPicker = document.getElementById('impact-picker');
12
+ if (existingPicker) {
13
+ existingPicker.parentNode.removeChild(existingPicker);
14
+ }
15
+
16
+ var gallery = document.createElement('div');
17
+ gallery.id = 'impact-picker';
18
+
19
+ gallery.style.position = "absolute";
20
+ gallery.style.height = "80%";
21
+ gallery.style.width = "80%";
22
+ gallery.style.top = "10%";
23
+ gallery.style.left = "10%";
24
+ gallery.style.display = 'flex';
25
+ gallery.style.flexWrap = 'wrap';
26
+ gallery.style.maxHeight = '600px';
27
+ gallery.style.overflow = 'auto';
28
+ gallery.style.backgroundColor = 'rgba(0,0,0,0.3)';
29
+ gallery.style.padding = '20px';
30
+ gallery.draggable = false;
31
+ gallery.style.zIndex = 5000;
32
+
33
+ var doneButton = document.createElement('button');
34
+ doneButton.textContent = 'Done';
35
+ doneButton.style.padding = '10px 10px';
36
+ doneButton.style.border = 'none';
37
+ doneButton.style.borderRadius = '5px';
38
+ doneButton.style.fontFamily = 'Arial, sans-serif';
39
+ doneButton.style.fontSize = '16px';
40
+ doneButton.style.fontWeight = 'bold';
41
+ doneButton.style.color = '#fff';
42
+ doneButton.style.background = 'linear-gradient(to bottom, #0070B8, #003D66)';
43
+ doneButton.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.4)';
44
+ doneButton.style.margin = "20px";
45
+ doneButton.style.height = "40px";
46
+
47
+ var cancelButton = document.createElement('button');
48
+ cancelButton.textContent = 'Cancel';
49
+ cancelButton.style.padding = '10px 10px';
50
+ cancelButton.style.border = 'none';
51
+ cancelButton.style.borderRadius = '5px';
52
+ cancelButton.style.fontFamily = 'Arial, sans-serif';
53
+ cancelButton.style.fontSize = '16px';
54
+ cancelButton.style.fontWeight = 'bold';
55
+ cancelButton.style.color = '#fff';
56
+ cancelButton.style.background = 'linear-gradient(to bottom, #ff70B8, #ff3D66)';
57
+ cancelButton.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.4)';
58
+ cancelButton.style.margin = "20px";
59
+ cancelButton.style.height = "40px";
60
+
61
+ const w = node.widgets.find((w) => w.name == 'picks');
62
+ let prev_selected = w.value.split(',').map(function(item) {
63
+ return parseInt(item, 10);
64
+ });
65
+
66
+ let images = [];
67
+ doneButton.onclick = () => {
68
+ var result = '';
69
+ for(let i in images) {
70
+ if(images[i].isSelected) {
71
+ if(result != '')
72
+ result += ', ';
73
+
74
+ result += (parseInt(i)+1);
75
+ }
76
+ }
77
+
78
+ w.value = result;
79
+
80
+ gallery.parentNode.removeChild(gallery);
81
+ }
82
+
83
+ cancelButton.onclick = () => {
84
+ gallery.parentNode.removeChild(gallery);
85
+ }
86
+
87
+ var panel = document.createElement('div');
88
+ panel.style.clear = 'both';
89
+ panel.style.width = '100%';
90
+ panel.style.height = '40px';
91
+ panel.style.justifyContent = 'center';
92
+ panel.style.alignItems = 'center';
93
+ panel.style.display = 'flex';
94
+ panel.appendChild(doneButton);
95
+ panel.appendChild(cancelButton);
96
+ gallery.appendChild(panel);
97
+
98
+ var hint = document.createElement('label');
99
+ hint.style.position = 'absolute';
100
+ hint.innerHTML = 'Click: Toggle Selection<BR>Ctrl-click: Single Selection';
101
+ gallery.appendChild(hint);
102
+
103
+ let max_size = 300;
104
+
105
+ for(let i=0; i<cnt; i++) {
106
+ let image = new Image();
107
+ image.src = `/impact/segs/picker/view?id=${node.id}&idx=${i}`;
108
+ image.style.margin = '10px';
109
+ image.draggable = false;
110
+ images.push(image);
111
+ image.isSelected = prev_selected.includes(i + 1);
112
+ if(image.isSelected) {
113
+ image.style.border = '2px solid #006699';
114
+ }
115
+
116
+ image.onload = function() {
117
+ var ratio = 1.0;
118
+ if(image.naturalWidth > image.naturalHeight) {
119
+ ratio = max_size/image.naturalWidth;
120
+ }
121
+ else {
122
+ ratio = max_size/image.naturalHeight;
123
+ }
124
+
125
+ let width = image.naturalWidth * ratio;
126
+ let height = image.naturalHeight * ratio;
127
+
128
+ if(width < height) {
129
+ this.style.marginLeft = (200-width)/2+"px";
130
+ }
131
+ else{
132
+ this.style.marginTop = (200-height)/2+"px";
133
+ }
134
+
135
+ this.style.width = width+"px";
136
+ this.style.height = height+"px";
137
+ this.style.objectFit = 'cover';
138
+ }
139
+
140
+ image.addEventListener('click', function(event) {
141
+ if(event.ctrlKey) {
142
+ for(let i in images) {
143
+ if(images[i].isSelected) {
144
+ images[i].style.border = 'none';
145
+ images[i].isSelected = false;
146
+ }
147
+ }
148
+
149
+ image.style.border = '2px solid #006699';
150
+ image.isSelected = true;
151
+
152
+ return;
153
+ }
154
+
155
+ if(image.isSelected) {
156
+ image.style.border = 'none';
157
+ image.isSelected = false;
158
+ }
159
+ else {
160
+ image.style.border = '2px solid #006699';
161
+ image.isSelected = true;
162
+ }
163
+ });
164
+
165
+ gallery.appendChild(image);
166
+ }
167
+
168
+ document.body.appendChild(gallery);
169
+ }
170
+
171
+
172
+ app.registerExtension({
173
+ name: "Comfy.Impack.Picker",
174
+
175
+ nodeCreated(node, app) {
176
+ if(node.comfyClass == "ImpactSEGSPicker") {
177
+ node.addWidget("button", "pick", "image", () => {
178
+ open_picker(node);
179
+ });
180
+ }
181
+ }
182
+ });
comfyui-impact-pack/js/mask-rect-area-advanced.js ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { app } from "../../scripts/app.js";
2
+ function showPreviewCanvas(node, app) {
3
+
4
+ const widget = {
5
+ type: "customCanvas",
6
+ name: "mask-rect-area-canvas",
7
+ get value() {
8
+ return this.canvas.value;
9
+ },
10
+ set value(x) {
11
+ this.canvas.value = x;
12
+ },
13
+ draw: function (ctx, node, widgetWidth, widgetY) {
14
+
15
+ // If we are initially offscreen when created we wont have received a resize event
16
+ // Calculate it here instead
17
+ if (!node.canvasHeight) {
18
+ computeCanvasSize(node, node.size);
19
+ }
20
+
21
+ const visible = true;
22
+ const t = ctx.getTransform();
23
+ const margin = 12;
24
+ const border = 2;
25
+ const widgetHeight = node.canvasHeight;
26
+ const width = Math.round(node.properties["width"]);
27
+ const height = Math.round(node.properties["height"]);
28
+ const scale = Math.min((widgetWidth - margin * 3) / width, (widgetHeight - margin * 3) / height);
29
+ const blurRadius = node.properties["blur_radius"] || 0;
30
+ const index = 0;
31
+
32
+ Object.assign(this.canvas.style, {
33
+ left: `${t.e}px`,
34
+ top: `${t.f + (widgetY * t.d)}px`,
35
+ width: `${widgetWidth * t.a}px`,
36
+ height: `${widgetHeight * t.d}px`,
37
+ position: "absolute",
38
+ zIndex: 1,
39
+ fontSize: `${t.d * 10.0}px`,
40
+ pointerEvents: "none"
41
+ });
42
+
43
+ this.canvas.hidden = !visible;
44
+
45
+ let backgroundWidth = width * scale;
46
+ let backgroundHeight = height * scale;
47
+
48
+ let xOffset = margin;
49
+ if (backgroundWidth < widgetWidth) {
50
+ xOffset += (widgetWidth - backgroundWidth) / 2 - margin;
51
+ }
52
+ let yOffset = (margin / 2);
53
+ if (backgroundHeight < widgetHeight) {
54
+ yOffset += (widgetHeight - backgroundHeight) / 2 - margin;
55
+ }
56
+
57
+ let widgetX = xOffset;
58
+ widgetY = widgetY + yOffset;
59
+
60
+ // Draw the background border
61
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_OUTLINE_COLOR;
62
+ ctx.fillRect(widgetX - border, widgetY - border, backgroundWidth + border * 2, backgroundHeight + border * 2)
63
+
64
+ // Draw the main background area
65
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_BGCOLOR;
66
+ ctx.fillRect(widgetX, widgetY, backgroundWidth, backgroundHeight);
67
+
68
+ // Draw the conditioning zone
69
+ let [x, y, w, h] = getDrawArea(node, backgroundWidth, backgroundHeight);
70
+
71
+ ctx.fillStyle = getDrawColor(0, "80");
72
+ ctx.fillRect(widgetX + x, widgetY + y, w, h);
73
+ ctx.beginPath();
74
+ ctx.lineWidth = 1;
75
+
76
+ // Draw grid lines
77
+ for (let x = 0; x <= width / 64; x += 1) {
78
+ ctx.moveTo(widgetX + x * 64 * scale, widgetY);
79
+ ctx.lineTo(widgetX + x * 64 * scale, widgetY + backgroundHeight);
80
+ }
81
+
82
+ for (let y = 0; y <= height / 64; y += 1) {
83
+ ctx.moveTo(widgetX, widgetY + y * 64 * scale);
84
+ ctx.lineTo(widgetX + backgroundWidth, widgetY + y * 64 * scale);
85
+ }
86
+
87
+ ctx.strokeStyle = "#66666650";
88
+ ctx.stroke();
89
+ ctx.closePath();
90
+
91
+ // Draw current zone
92
+ let [sx, sy, sw, sh] = getDrawArea(node, backgroundWidth, backgroundHeight);
93
+
94
+ ctx.fillStyle = getDrawColor(0, "80");
95
+ ctx.fillRect(widgetX + sx, widgetY + sy, sw, sh);
96
+
97
+ ctx.fillStyle = getDrawColor(0, "40");
98
+ ctx.fillRect(widgetX + sx + border, widgetY + sy + border, sw - border * 2, sh - border * 2);
99
+
100
+ // Draw white border around the current zone
101
+ ctx.strokeStyle = globalThis.LiteGraph.NODE_SELECTED_TITLE_COLOR;
102
+ ctx.lineWidth = 2;
103
+ ctx.strokeRect(widgetX + sx, widgetY + sy, sw, sh);
104
+
105
+ // Display
106
+ ctx.beginPath();
107
+
108
+ ctx.arc(LiteGraph.NODE_SLOT_HEIGHT * 0.5, LiteGraph.NODE_SLOT_HEIGHT * (index + 0.5) + 4, 4, 0, Math.PI * 2);
109
+ ctx.fill();
110
+
111
+ ctx.lineWidth = 1;
112
+ ctx.strokeStyle = "white";
113
+ ctx.stroke();
114
+
115
+ ctx.lineWidth = 1;
116
+ ctx.closePath();
117
+
118
+ // Draw progress bar canvas
119
+ if (backgroundWidth < widgetWidth) {
120
+ xOffset += (widgetWidth - backgroundWidth) / 2 - margin;
121
+ }
122
+
123
+ // Ajustar las coordenadas X e Y
124
+ const barHeight = 8;
125
+ let widgetYBar = widgetY + backgroundHeight + margin;
126
+
127
+ // Dibujar el borde negro alrededor de la barra
128
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_OUTLINE_COLOR;
129
+ ctx.fillRect(
130
+ widgetX - border,
131
+ widgetYBar - border,
132
+ backgroundWidth + border * 2,
133
+ barHeight + border * 2
134
+ );
135
+
136
+ // Dibujar el área principal de la barra (fondo)
137
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_BGCOLOR; // Mismo color de fondo que el canvas
138
+ ctx.fillRect(
139
+ widgetX,
140
+ widgetYBar,
141
+ backgroundWidth,
142
+ barHeight
143
+ );
144
+
145
+
146
+ // Draw progress bar grid
147
+ ctx.beginPath();
148
+ ctx.lineWidth = 1;
149
+ ctx.strokeStyle = "#66666650";
150
+
151
+ // Calcular el número de líneas en función del tamaño de la barra
152
+ const numLines = Math.floor(backgroundWidth / 64);
153
+
154
+ // Dibujar líneas del grid
155
+ for (let x = 0; x <= width / 64; x += 1) {
156
+ ctx.moveTo(widgetX + x * 64 * scale, widgetYBar);
157
+ ctx.lineTo(widgetX + x * 64 * scale, widgetYBar + barHeight);
158
+ }
159
+ ctx.stroke();
160
+ ctx.closePath();
161
+
162
+ // Dibujar progreso (basado en blur_radius)
163
+ const progress = Math.min(blurRadius / 255, 1);
164
+ ctx.fillStyle = "rgba(0, 120, 255, 0.5)";
165
+
166
+ ctx.fillRect(
167
+ widgetX,
168
+ widgetYBar,
169
+ backgroundWidth * progress,
170
+ barHeight
171
+ );
172
+ }
173
+ };
174
+
175
+ widget.canvas = document.createElement("canvas");
176
+ widget.canvas.className = "mask-rect-area-canvas";
177
+ widget.parent = node;
178
+
179
+ document.body.appendChild(widget.canvas);
180
+ node.addCustomWidget(widget);
181
+
182
+ app.canvas.onDrawBackground = function () {
183
+ // Draw node isnt fired once the node is off the screen
184
+ // if it goes off screen quickly, the input may not be removed
185
+ // this shifts it off screen so it can be moved back if the node is visible.
186
+ for (let n in app.graph._nodes) {
187
+ n = app.graph._nodes[n];
188
+ for (let w in n.widgets) {
189
+ let wid = n.widgets[w];
190
+ if (Object.hasOwn(wid, "canvas")) {
191
+ wid.canvas.style.left = -8000 + "px";
192
+ wid.canvas.style.position = "absolute";
193
+ }
194
+ }
195
+ }
196
+ };
197
+
198
+ node.onResize = function (size) {
199
+ computeCanvasSize(node, size);
200
+ };
201
+
202
+ return {minWidth: 200, minHeight: 200, widget};
203
+ }
204
+
205
+ app.registerExtension({
206
+ name: 'drltdata.MaskRectAreaAdvanced',
207
+ async beforeRegisterNodeDef(nodeType, nodeData, app) {
208
+ if (nodeData.name === "MaskRectAreaAdvanced") {
209
+ const onNodeCreated = nodeType.prototype.onNodeCreated;
210
+ nodeType.prototype.onNodeCreated = function () {
211
+ const r = onNodeCreated ? onNodeCreated.apply(this, arguments) : undefined;
212
+
213
+ this.setProperty("width", 512);
214
+ this.setProperty("height", 512);
215
+ this.setProperty("x", 0);
216
+ this.setProperty("y", 0);
217
+ this.setProperty("w", 256);
218
+ this.setProperty("h", 256);
219
+ this.setProperty("blur_radius", 0);
220
+
221
+ this.selected = false;
222
+ this.index = 3;
223
+ this.serialize_widgets = true;
224
+
225
+ CUSTOM_INT(this, "x", 0, function (v, _, node) {
226
+ const s = this.options.step / 10;
227
+ this.value = Math.round(v / s) * s;
228
+ node.properties["x"] = this.value;
229
+ });
230
+ CUSTOM_INT(this, "y", 0, function (v, _, node) {
231
+ const s = this.options.step / 10;
232
+ this.value = Math.round(v / s) * s;
233
+ node.properties["y"] = this.value;
234
+ });
235
+ CUSTOM_INT(this, "width", 256, function (v, _, node) {
236
+ const s = this.options.step / 10;
237
+ this.value = Math.round(v / s) * s;
238
+ node.properties["w"] = this.value;
239
+ });
240
+ CUSTOM_INT(this, "height", 256, function (v, _, node) {
241
+ const s = this.options.step / 10;
242
+ this.value = Math.round(v / s) * s;
243
+ node.properties["h"] = this.value;
244
+ });
245
+ CUSTOM_INT(this, "image_width", 512, function (v, _, node) {
246
+ const s = this.options.step / 10;
247
+ this.value = Math.round(v / s) * s;
248
+ node.properties["width"] = this.value;
249
+ });
250
+ CUSTOM_INT(this, "image_height", 512, function (v, _, node) {
251
+ const s = this.options.step / 10;
252
+ this.value = Math.round(v / s) * s;
253
+ node.properties["height"] = this.value;
254
+ });
255
+ CUSTOM_INT(this, "blur_radius", 0, function (v, _, node) {
256
+ this.value = Math.round(v) || 0;
257
+ node.properties["blur_radius"] = this.value;
258
+ },
259
+ {"min": 0, "max": 255, "step": 10}
260
+ );
261
+
262
+ showPreviewCanvas(this, app);
263
+
264
+ this.onSelected = function () {
265
+ this.selected = true;
266
+ };
267
+ this.onDeselected = function () {
268
+ this.selected = false;
269
+ };
270
+
271
+ return r;
272
+ };
273
+ }
274
+ }
275
+ });
276
+
277
+ // Calculate the drawing area using individual properties.
278
+ function getDrawArea(node, backgroundWidth, backgroundHeight) {
279
+ let x = node.properties["x"] * backgroundWidth / node.properties["width"];
280
+ let y = node.properties["y"] * backgroundHeight / node.properties["height"];
281
+ let w = node.properties["w"] * backgroundWidth / node.properties["width"];
282
+ let h = node.properties["h"] * backgroundHeight / node.properties["height"];
283
+
284
+ if (x > backgroundWidth) {
285
+ x = backgroundWidth;
286
+ }
287
+ if (y > backgroundHeight) {
288
+ y = backgroundHeight;
289
+ }
290
+
291
+ if (x + w > backgroundWidth) {
292
+ w = Math.max(0, backgroundWidth - x);
293
+ }
294
+
295
+ if (y + h > backgroundHeight) {
296
+ h = Math.max(0, backgroundHeight - y);
297
+ }
298
+
299
+ return [x, y, w, h];
300
+ }
301
+
302
+ function CUSTOM_INT(node, inputName, val, func, config = {}) {
303
+ return {
304
+ widget: node.addWidget(
305
+ "number",
306
+ inputName,
307
+ val,
308
+ func,
309
+ Object.assign({}, {min: 0, max: 4096, step: 640, precision: 0}, config)
310
+ )
311
+ };
312
+ }
313
+
314
+ function getDrawColor(percent, alpha) {
315
+ let h = 360 * percent;
316
+ let s = 50;
317
+ let l = 50;
318
+ l /= 100;
319
+ const a = s * Math.min(l, 1 - l) / 100;
320
+ const f = n => {
321
+ const k = (n + h / 30) % 12;
322
+ const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
323
+ return Math.round(255 * color).toString(16).padStart(2, '0'); // convert to Hex and prefix "0" if needed
324
+ };
325
+ return `#${f(0)}${f(8)}${f(4)}${alpha}`;
326
+ }
327
+
328
+ function computeCanvasSize(node, size) {
329
+ if (node.widgets[0].last_y == null) {
330
+ return;
331
+ }
332
+
333
+ const MIN_HEIGHT = 220;
334
+ const MIN_WIDTH = 240;
335
+
336
+ let y = LiteGraph.NODE_WIDGET_HEIGHT * Math.max(node.inputs.length, node.outputs.length) + 5;
337
+ let freeSpace = size[1] - y;
338
+
339
+ // Compute the height of all non-customCanvas widgets
340
+ let widgetHeight = 0;
341
+ for (let i = 0; i < node.widgets.length; i++) {
342
+ const w = node.widgets[i];
343
+ if (w.type !== "customCanvas") {
344
+ if (w.computeSize) {
345
+ widgetHeight += w.computeSize()[1] + 4;
346
+ } else {
347
+ widgetHeight += LiteGraph.NODE_WIDGET_HEIGHT + 5;
348
+ }
349
+ }
350
+ }
351
+
352
+ // Ensure there is enough vertical space
353
+ freeSpace -= widgetHeight;
354
+
355
+ // Adjust the height of the node if needed
356
+ if (freeSpace < MIN_HEIGHT) {
357
+ freeSpace = MIN_HEIGHT;
358
+ node.size[1] = y + widgetHeight + freeSpace;
359
+ node.graph.setDirtyCanvas(true);
360
+ }
361
+
362
+ // Ensure the node width meets the minimum width requirement
363
+ if (node.size[0] < MIN_WIDTH) {
364
+ node.size[0] = MIN_WIDTH;
365
+ node.graph.setDirtyCanvas(true);
366
+ }
367
+
368
+ // Position each of the widgets
369
+ for (const w of node.widgets) {
370
+ w.y = y;
371
+ if (w.type === "customCanvas") {
372
+ y += freeSpace;
373
+ } else if (w.computeSize) {
374
+ y += w.computeSize()[1] + 4;
375
+ } else {
376
+ y += LiteGraph.NODE_WIDGET_HEIGHT + 4;
377
+ }
378
+ }
379
+
380
+ node.canvasHeight = freeSpace;
381
+ }
comfyui-impact-pack/js/mask-rect-area.js ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { app } from "../../scripts/app.js";
2
+ function showPreviewCanvas(node, app) {
3
+
4
+ const widget = {
5
+ type: "customCanvas",
6
+ name: "mask-rect-area-canvas",
7
+ get value() {
8
+ return this.canvas.value;
9
+ },
10
+ set value(x) {
11
+ this.canvas.value = x;
12
+ },
13
+ draw: function (ctx, node, widgetWidth, widgetY) {
14
+
15
+ // If we are initially offscreen when created we wont have received a resize event
16
+ // Calculate it here instead
17
+ if (!node.canvasHeight) {
18
+ computeCanvasSize(node, node.size);
19
+ }
20
+
21
+ const visible = true;
22
+ const t = ctx.getTransform();
23
+ const margin = 12;
24
+ const border = 2;
25
+ const widgetHeight = node.canvasHeight;
26
+ const width = 512;
27
+ const height = 512;
28
+ const scale = Math.min((widgetWidth - margin * 3) / width, (widgetHeight - margin * 3) / height);
29
+ const blurRadius = node.properties["blur_radius"] || 0;
30
+ const index = 0;
31
+
32
+ Object.assign(this.canvas.style, {
33
+ left: `${t.e}px`,
34
+ top: `${t.f + (widgetY * t.d)}px`,
35
+ width: `${widgetWidth * t.a}px`,
36
+ height: `${widgetHeight * t.d}px`,
37
+ position: "absolute",
38
+ zIndex: 1,
39
+ fontSize: `${t.d * 10.0}px`,
40
+ pointerEvents: "none"
41
+ });
42
+
43
+ this.canvas.hidden = !visible;
44
+
45
+ let backgroundWidth = width * scale;
46
+ let backgroundHeight = height * scale;
47
+ let xOffset = margin;
48
+ if (backgroundWidth < widgetWidth) {
49
+ xOffset += (widgetWidth - backgroundWidth) / 2 - margin;
50
+ }
51
+ let yOffset = (margin / 2);
52
+ if (backgroundHeight < widgetHeight) {
53
+ yOffset += (widgetHeight - backgroundHeight) / 2 - margin;
54
+ }
55
+
56
+ let widgetX = xOffset;
57
+ widgetY = widgetY + yOffset;
58
+
59
+ // Draw the background border
60
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_OUTLINE_COLOR;
61
+ ctx.fillRect(widgetX - border, widgetY - border, backgroundWidth + border * 2, backgroundHeight + border * 2);
62
+
63
+ // Draw the main background area
64
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_BGCOLOR;
65
+ ctx.fillRect(widgetX, widgetY, backgroundWidth, backgroundHeight);
66
+
67
+ // Draw the conditioning zone
68
+ let [x, y, w, h] = getDrawArea(node, backgroundWidth, backgroundHeight);
69
+
70
+ ctx.fillStyle = getDrawColor(0, "80");
71
+ ctx.fillRect(widgetX + x, widgetY + y, w, h);
72
+ ctx.beginPath();
73
+ ctx.lineWidth = 1;
74
+
75
+ // Draw grid lines
76
+ for (let x = 0; x <= width / 64; x += 1) {
77
+ ctx.moveTo(widgetX + x * 64 * scale, widgetY);
78
+ ctx.lineTo(widgetX + x * 64 * scale, widgetY + backgroundHeight);
79
+ }
80
+
81
+ for (let y = 0; y <= height / 64; y += 1) {
82
+ ctx.moveTo(widgetX, widgetY + y * 64 * scale);
83
+ ctx.lineTo(widgetX + backgroundWidth, widgetY + y * 64 * scale);
84
+ }
85
+
86
+ ctx.strokeStyle = "#66666650";
87
+ ctx.stroke();
88
+ ctx.closePath();
89
+
90
+ // Draw current zone
91
+ let [sx, sy, sw, sh] = getDrawArea(node, backgroundWidth, backgroundHeight);
92
+
93
+ ctx.fillStyle = getDrawColor(0, "80");
94
+ ctx.fillRect(widgetX + sx, widgetY + sy, sw, sh);
95
+
96
+ ctx.fillStyle = getDrawColor(0, "40");
97
+ ctx.fillRect(widgetX + sx + border, widgetY + sy + border, sw - border * 2, sh - border * 2);
98
+
99
+ // Draw white border around the current zone
100
+ ctx.strokeStyle = globalThis.LiteGraph.NODE_SELECTED_TITLE_COLOR;
101
+ ctx.lineWidth = 2;
102
+ ctx.strokeRect(widgetX + sx, widgetY + sy, sw, sh);
103
+ //ctx.strokeRect(finalSX, finalSY, finalSW, finalSH);
104
+
105
+ // Display
106
+ ctx.beginPath();
107
+
108
+ ctx.arc(LiteGraph.NODE_SLOT_HEIGHT * 0.5, LiteGraph.NODE_SLOT_HEIGHT * (index + 0.5) + 4, 4, 0, Math.PI * 2);
109
+ ctx.fill();
110
+
111
+ ctx.lineWidth = 1;
112
+ ctx.strokeStyle = "white";
113
+ ctx.stroke();
114
+ ctx.lineWidth = 1;
115
+ ctx.closePath();
116
+
117
+ // Draw progress bar canvas
118
+ if (backgroundWidth < widgetWidth) {
119
+ xOffset += (widgetWidth - backgroundWidth) / 2 - margin;
120
+ }
121
+
122
+ const barHeight = 8;
123
+ let widgetYBar = widgetY + backgroundHeight + margin;
124
+
125
+ // Draw progress bar border
126
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_OUTLINE_COLOR;
127
+ ctx.fillRect(
128
+ widgetX - border,
129
+ widgetYBar - border,
130
+ backgroundWidth + border * 2,
131
+ barHeight + border * 2
132
+ );
133
+
134
+ // Draw progress bar area
135
+ ctx.fillStyle = globalThis.LiteGraph.WIDGET_BGCOLOR; // Mismo color de fondo que el canvas
136
+ ctx.fillRect(
137
+ widgetX,
138
+ widgetYBar,
139
+ backgroundWidth,
140
+ barHeight
141
+ );
142
+
143
+ // Draw progress bar grid
144
+ ctx.beginPath();
145
+ ctx.lineWidth = 1;
146
+ ctx.strokeStyle = "#66666650";
147
+
148
+ // Determine max lines
149
+ const numLines = Math.floor(backgroundWidth / 64);
150
+
151
+ // Draw progress bar grid
152
+ for (let x = 0; x <= width / 64; x += 1) {
153
+ ctx.moveTo(widgetX + x * 64 * scale, widgetYBar);
154
+ ctx.lineTo(widgetX + x * 64 * scale, widgetYBar + barHeight);
155
+ }
156
+ ctx.stroke();
157
+ ctx.closePath();
158
+
159
+ // Draw progress bar
160
+ const progress = Math.min(blurRadius / 255, 1);
161
+ ctx.fillStyle = "rgba(0, 120, 255, 0.5)";
162
+
163
+ ctx.fillRect(
164
+ widgetX,
165
+ widgetYBar,
166
+ backgroundWidth * progress,
167
+ barHeight
168
+ );
169
+ }
170
+ };
171
+
172
+ widget.canvas = document.createElement("canvas");
173
+ widget.canvas.className = "mask-rect-area-canvas";
174
+ widget.parent = node;
175
+
176
+ document.body.appendChild(widget.canvas);
177
+ node.addCustomWidget(widget);
178
+
179
+ app.canvas.onDrawBackground = function () {
180
+ // Draw node isnt fired once the node is off the screen
181
+ // if it goes off screen quickly, the input may not be removed
182
+ // this shifts it off screen so it can be moved back if the node is visible.
183
+ for (let n in app.graph._nodes) {
184
+ n = app.graph._nodes[n];
185
+ for (let w in n.widgets) {
186
+ let wid = n.widgets[w];
187
+ if (Object.hasOwn(wid, "canvas")) {
188
+ wid.canvas.style.left = -8000 + "px";
189
+ wid.canvas.style.position = "absolute";
190
+ }
191
+ }
192
+ }
193
+ };
194
+
195
+ node.onResize = function (size) {
196
+ computeCanvasSize(node, size);
197
+ };
198
+
199
+ return {minWidth: 200, minHeight: 200, widget};
200
+ }
201
+
202
+ app.registerExtension({
203
+ name: 'drltdata.MaskRectArea',
204
+ async beforeRegisterNodeDef(nodeType, nodeData, app) {
205
+ if (nodeData.name === "MaskRectArea") {
206
+ const onNodeCreated = nodeType.prototype.onNodeCreated;
207
+ nodeType.prototype.onNodeCreated = function () {
208
+ const r = onNodeCreated ? onNodeCreated.apply(this, arguments) : undefined;
209
+
210
+ this.setProperty("width", 512);
211
+ this.setProperty("height", 512);
212
+ this.setProperty("x", 0);
213
+ this.setProperty("y", 0);
214
+ this.setProperty("w", 50);
215
+ this.setProperty("h", 50);
216
+ this.setProperty("blur_radius", 0);
217
+
218
+ this.selected = false;
219
+ this.index = 3;
220
+ this.serialize_widgets = true;
221
+
222
+ CUSTOM_INT(this, "x", 0, function (v, _, node) {
223
+ this.value = Math.max(0, Math.min(100, Math.round(v))); // Limitar entre 0 y 100
224
+ node.properties["x"] = this.value;
225
+ });
226
+ CUSTOM_INT(this, "y", 0, function (v, _, node) {
227
+ this.value = Math.max(0, Math.min(100, Math.round(v)));
228
+ node.properties["y"] = this.value;
229
+ });
230
+ CUSTOM_INT(this, "w", 50, function (v, _, node) {
231
+ this.value = Math.max(0, Math.min(100, Math.round(v)));
232
+ node.properties["w"] = this.value;
233
+ });
234
+ CUSTOM_INT(this, "h", 50, function (v, _, node) {
235
+ this.value = Math.max(0, Math.min(100, Math.round(v)));
236
+ node.properties["h"] = this.value;
237
+ });
238
+ CUSTOM_INT(this, "blur_radius", 0, function (v, _, node) {
239
+ this.value = Math.round(v) || 0;
240
+ node.properties["blur_radius"] = this.value;
241
+ },
242
+ {"min": 0, "max": 255, "step": 10}
243
+ );
244
+
245
+ showPreviewCanvas(this, app);
246
+
247
+ this.onSelected = function () {
248
+ this.selected = true;
249
+ };
250
+ this.onDeselected = function () {
251
+ this.selected = false;
252
+ };
253
+
254
+ return r;
255
+ };
256
+ }
257
+ }
258
+ });
259
+
260
+ // Calculate the drawing area using percentage-based properties.
261
+ function getDrawArea(node, backgroundWidth, backgroundHeight) {
262
+ // Convert percentages to actual pixel values based on the background dimensions
263
+ let x = (node.properties["x"] / 100) * backgroundWidth;
264
+ let y = (node.properties["y"] / 100) * backgroundHeight;
265
+ let w = (node.properties["w"] / 100) * backgroundWidth;
266
+ let h = (node.properties["h"] / 100) * backgroundHeight;
267
+
268
+ // Ensure the values do not exceed the background boundaries
269
+ if (x > backgroundWidth) {
270
+ x = backgroundWidth;
271
+ }
272
+ if (y > backgroundHeight) {
273
+ y = backgroundHeight;
274
+ }
275
+
276
+ // Adjust width and height to fit within the background dimensions
277
+ if (x + w > backgroundWidth) {
278
+ w = Math.max(0, backgroundWidth - x);
279
+ }
280
+ if (y + h > backgroundHeight) {
281
+ h = Math.max(0, backgroundHeight - y);
282
+ }
283
+
284
+ return [x, y, w, h];
285
+ }
286
+
287
+ function CUSTOM_INT(node, inputName, val, func, config = {}) {
288
+ return {
289
+ widget: node.addWidget(
290
+ "number",
291
+ inputName,
292
+ val,
293
+ func,
294
+ Object.assign({}, {min: 0, max: 100, step: 10, precision: 0}, config)
295
+ )
296
+ };
297
+ }
298
+
299
+ function getDrawColor(percent, alpha) {
300
+ let h = 360 * percent;
301
+ let s = 50;
302
+ let l = 50;
303
+ l /= 100;
304
+ const a = s * Math.min(l, 1 - l) / 100;
305
+ const f = n => {
306
+ const k = (n + h / 30) % 12;
307
+ const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
308
+ return Math.round(255 * color).toString(16).padStart(2, '0'); // convert to Hex and prefix "0" if needed
309
+ };
310
+ return `#${f(0)}${f(8)}${f(4)}${alpha}`;
311
+ }
312
+
313
+ function computeCanvasSize(node, size) {
314
+ if (node.widgets[0].last_y == null) {
315
+ return;
316
+ }
317
+
318
+ const MIN_HEIGHT = 200;
319
+ const MIN_WIDTH = 200;
320
+
321
+ let y = LiteGraph.NODE_WIDGET_HEIGHT * Math.max(node.inputs.length, node.outputs.length) + 5;
322
+ let freeSpace = size[1] - y;
323
+
324
+ // Compute the height of all non-customCanvas widgets
325
+ let widgetHeight = 0;
326
+ for (let i = 0; i < node.widgets.length; i++) {
327
+ const w = node.widgets[i];
328
+ if (w.type !== "customCanvas") {
329
+ if (w.computeSize) {
330
+ widgetHeight += w.computeSize()[1] + 4;
331
+ } else {
332
+ widgetHeight += LiteGraph.NODE_WIDGET_HEIGHT + 5;
333
+ }
334
+ }
335
+ }
336
+
337
+ // Ensure there is enough vertical space
338
+ freeSpace -= widgetHeight;
339
+
340
+ // Adjust the height of the node if needed
341
+ if (freeSpace < MIN_HEIGHT) {
342
+ freeSpace = MIN_HEIGHT;
343
+ node.size[1] = y + widgetHeight + freeSpace;
344
+ node.graph.setDirtyCanvas(true);
345
+ }
346
+
347
+ // Ensure the node width meets the minimum width requirement
348
+ if (node.size[0] < MIN_WIDTH) {
349
+ node.size[0] = MIN_WIDTH;
350
+ node.graph.setDirtyCanvas(true);
351
+ }
352
+
353
+ // Position each of the widgets
354
+ for (const w of node.widgets) {
355
+ w.y = y;
356
+ if (w.type === "customCanvas") {
357
+ y += freeSpace;
358
+ } else if (w.computeSize) {
359
+ y += w.computeSize()[1] + 4;
360
+ } else {
361
+ y += LiteGraph.NODE_WIDGET_HEIGHT + 4;
362
+ }
363
+ }
364
+
365
+ node.canvasHeight = freeSpace;
366
+ }
comfyui-impact-pack/latent.png ADDED

Git LFS Details

  • SHA256: 1faf0cc926b0d65c8ab93e7485aea816283eb22fdeefe9682c206948c1de2043
  • Pointer size: 129 Bytes
  • Size of remote file: 2.81 kB
comfyui-impact-pack/locales/ko/nodeDefs.json ADDED
@@ -0,0 +1,1241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "FaceDetailer": {
3
+ "description": "감지 모델(bbox, segm, sam) 모델을 이용해서 입력 이미지에서 자동으로 특정 객체를 감지하고, 감지 영역을 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.\n사용자들이 자주 사용하는 얼굴 디테일 강화 워크플로를 단순화하기 위해 특화 시킨 노드이긴 하지만, 감지 모델에 따라서 다양한 자동 인페인트 용도로 사용 가능합니다.",
4
+ "display_name": "얼굴 디테일러",
5
+ "inputs": {
6
+ "image": {
7
+ "name": "이미지"
8
+ },
9
+ "model": {
10
+ "name": "모델",
11
+ "tooltip": "만약 `ImpactDummyInput` 을 연결 하면, 인페인트 단계를 건너 뜁니다."
12
+ },
13
+ "guide_size": {
14
+ "name": "가이드 크기",
15
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
16
+ },
17
+ "guide_size_for": {
18
+ "name": "가이드 크기 대상",
19
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
20
+ },
21
+ "max_size": {
22
+ "name": "최대 크기",
23
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
24
+ },
25
+ "seed": {
26
+ "name": "시드"
27
+ },
28
+ "steps": {
29
+ "name": "스텝수"
30
+ },
31
+ "sampler_name": {
32
+ "name": "샘플러 이름"
33
+ },
34
+ "scheduler": {
35
+ "name": "스케쥴러"
36
+ },
37
+ "positive": {
38
+ "name": "긍정 조건"
39
+ },
40
+ "negative": {
41
+ "name": "부정 조건"
42
+ },
43
+ "denoise": {
44
+ "name": "노이즈 제거양"
45
+ },
46
+ "feather": {
47
+ "name": "가장자리 흐림",
48
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
49
+ },
50
+ "noise_mask": {
51
+ "name": "노이즈 마스크 사용",
52
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
53
+ },
54
+ "force_inpaint": {
55
+ "name": "인페인트 강제 적용",
56
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 가이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
57
+ },
58
+ "bbox_threshold": {
59
+ "name": "bbox 감지 임계치",
60
+ "tooltip": "사각 영역(bbox) 감지 모델의 최소 감지 임계치를 설정합니다. 임계치가 높을수록 확실한 객체만 감지하지만, 객체를 감지하지 못할 확률이 증가합니다."
61
+ },
62
+ "bbox_dilation": {
63
+ "name": "bbox 확장",
64
+ "tooltip": "감지된 사각 영역(bbox)을 확장 합니다. 이 옵션은 감지된 영역보다 더 넓은 영역을 인페인트 할 경우 사용합니다.\n주의: sam 모델을 사용할 경우 잘라낸 영역내에서 bbox 확장을 하더라도, sam 감지 영역이 작으면 여전히 제한됩니다."
65
+ },
66
+ "bbox_crop_factor": {
67
+ "name": "bbox 자르기 배율",
68
+ "tooltip": "감지된 사각 영역(bbox)의 몇배 크기의 영역을 잘라낼 것 인지를 설정합니다. 이 크기가 너무 작으면, 인페인트 할 이미지의 주변 정보가 부족해서 위화감이 강한 이미지가 생성됩니다. 이 크기가 너무 크면, 인페인팅에 너무 오랜 시간이 걸릴 수 있으며, 모델의 역량을 초과할 정도로 클 경우 올바르지 않은 이미지를 생성하게 됩니다."
69
+ },
70
+ "sam_detection_hint": {
71
+ "name": "sam 감지 힌트",
72
+ "tooltip": "[실험기능] 오래된 실험 기능으로, sam 모델의 감지 힌트를 제공하는 방식입니다. cetner-1 (중앙점 1개) 외에는 사용하지 않을 것을 권장합니다."
73
+ },
74
+ "sam_dilation": {
75
+ "name": "sam 마스크 확장",
76
+ "tooltip": "sam 모델로 감지된 실루엣 마스크를 확장합니다."
77
+ },
78
+ "sam_threshold": {
79
+ "name": "sam 감지 임계치",
80
+ "tooltip": "sam 모델의 최소 감지 임계치를 설정합니다. 임계치가 높을수록 확실한 객체만 감지하지만, 객체를 감지하지 못할 확률이 증가합니다."
81
+ },
82
+ "sam_bbox_expansion": {
83
+ "name": "sam 영역 확장",
84
+ "tooltip": "sam 의 감지 영역을 확장합니다. 감지 영역은 마스크를 포함하는 전체 사각 영역입니다.\n주의1:sam 마스크를 확장하더라도, 감지 영역을 벗어날 수 없습니다.\n주의2: bbox 확장을 하더라도, sam 감지 영역이 작으면 여전히 제한됩니다."
85
+ },
86
+ "sam_mask_hint_threshold": {
87
+ "name": "sam 마스크 힌트 임계치",
88
+ "tooltip": "[실험기능] 오래된 실험 기능으로, mask-hint 모드에서만 사용되는 옵션으로, 마스크에서 이 크기 이상의 점 마스크를 sam의 힌트로 사용합니다."
89
+ },
90
+ "sam_mask_hint_use_negative": {
91
+ "name": "sam 마스크 힌트에 제외 힌트 사용",
92
+ "tooltip": "[실험기능] 오래된 실험 기능으로, mask-hitn 모드에서만 사용되는 옵션으로, sam 마스크 힌트 임계치보다 작은 점 마스크를 sam의 제외 힌트로 사용합니다."
93
+ },
94
+ "drop_size": {
95
+ "name": "감지 최소 크기",
96
+ "tooltip": "사각 영역(bbox) 감지기로 감지한 크기가 이 설정값 보다 작을 경우 무시합니다."
97
+ },
98
+ "bbox_detector": {
99
+ "name": "bbox 감지기",
100
+ "tooltip": "디테일 개선 대상을 자동으로 감지해주는 사각 영역(bbox) 감지기 입력.\n이 감지기로 감지된 감지 정보가 기준 정보입니다."
101
+ },
102
+ "wildcard": {
103
+ "name": "와일드카드 프롬프트",
104
+ "tooltip": "'와일드카드 인코더 (Impact)'와 유사한 기능을 수행하여, 와일드카드 기능과 로라 로딩 기능을 제공합니다. 또한, 감지된 영역별로 다른 프롬프트를 적용하는 기능들을 제공합니다.\n더 자세한 정보는 튜토리얼 페이지를 참고하세요.\n주의:이 입력을 비워두면, 이 입력은 무시됩니다."
105
+ },
106
+ "cycle": {
107
+ "name": "반복수",
108
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
109
+ },
110
+ "sam_model_opt": {
111
+ "name": "sam 모델",
112
+ "tooltip": "이 모델을 제공할 경우 sam 모델을 감지 보조 모델로 사용합니다. bbox 감지기로 감지된 사각 영역에 sam 모델을 적용해서 정교한 실루엣 마스크를 생성합니다.\n주의: 이 입력이 연결될 경우 segm 감지기는 무시됩니다."
113
+ },
114
+ "segm_detector_opt": {
115
+ "name": "segm 감지기",
116
+ "tooltip": "이 모델을 제공할 경우 segm 모델을 감지 보조 모델로 사용합니다. bbox 감지기로 감지된 사각 영역에 segm 감지기로 감지된 실루엣 마스크를 생성합니다.\n주의: 이 입력은 sam 모델이 연결될 경우 무시됩니다."
117
+ },
118
+ "detailer_hook": {
119
+ "name": "디테일러 후크",
120
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
121
+ },
122
+ "inpaint_model": {
123
+ "name": "인페인트 모델 모드",
124
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
125
+ },
126
+ "noise_mask_feather": {
127
+ "name": "노이즈 마스크 가장자리 흐림",
128
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
129
+ },
130
+ "scheduler_func_opt": {
131
+ "name": "스케쥴러 함수",
132
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
133
+ },
134
+ "tiled_encode": {
135
+ "name": "타일 인코드 사용",
136
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 인코드'를 사용할 경우, 기본 'VAE 인코드' 대신 'VAE 인코드 (타일)' 을 적용합니다."
137
+ },
138
+ "tiled_decode": {
139
+ "name": "타일 디코드 사용",
140
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 다코드'를 사용할 경우, 기본 'VAE 디코드' 대신 'VAE 디코드 (타일)' 을 적용합니다."
141
+ }
142
+ },
143
+ "outputs": {
144
+ "0": {
145
+ "name": "개선 이미"
146
+ },
147
+ "1": {
148
+ "name": "잘라낸 이미지"
149
+ },
150
+ "2": {
151
+ "name": "잘라낸 투명 이미지"
152
+ },
153
+ "3": {
154
+ "name": "마스크"
155
+ },
156
+ "4": {
157
+ "name": "디테일러 파이프"
158
+ },
159
+ "5": {
160
+ "name": "컨트롤넷 이미지"
161
+ }
162
+ }
163
+ },
164
+ "FaceDetailerPipe": {
165
+ "description": "감지 모델(bbox, segm, sam) 모델을 이용해서 입력 이미지에서 자동으로 특정 객체를 감지하고, 감지 영역을 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.\n사용자들이 자주 사용하는 얼굴 디테일 강화 워크플로를 단순화하기 위해 특화 시킨 노드이긴 하지만, 감지 모델에 따라서 다양한 자동 인페인트 용도로 사용 가능합니다.",
166
+ "display_name": "얼굴 디테일러 (파이프)",
167
+ "inputs": {
168
+ "image": {
169
+ "name": "이미지"
170
+ },
171
+ "detailer_pipe": {
172
+ "name": "디테일러 파이프",
173
+ "tooltip": "만약 디테일러 파이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
174
+ },
175
+ "guide_size": {
176
+ "name": "가이드 크기",
177
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
178
+ },
179
+ "guide_size_for": {
180
+ "name": "가이드 크기 대상",
181
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
182
+ },
183
+ "max_size": {
184
+ "name": "최대 크기",
185
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
186
+ },
187
+ "seed": {
188
+ "name": "시드"
189
+ },
190
+ "steps": {
191
+ "name": "스텝수"
192
+ },
193
+ "sampler_name": {
194
+ "name": "샘플러 이름"
195
+ },
196
+ "scheduler": {
197
+ "name": "스케쥴러"
198
+ },
199
+ "denoise": {
200
+ "name": "노이즈 제거양"
201
+ },
202
+ "feather": {
203
+ "name": "가장자리 흐림",
204
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
205
+ },
206
+ "noise_mask": {
207
+ "name": "노이즈 마스크 사용",
208
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
209
+ },
210
+ "force_inpaint": {
211
+ "name": "인페인트 강제 적용",
212
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 가이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
213
+ },
214
+ "bbox_threshold": {
215
+ "name": "bbox 감지 임계치",
216
+ "tooltip": "사각 영역(bbox) 감지 모델의 최소 감지 임계치를 설정합니다. 임계치가 높을수록 확실한 객체만 감지하지만, 객체를 감지하지 못할 확률이 증가합니다."
217
+ },
218
+ "bbox_dilation": {
219
+ "name": "bbox 확장",
220
+ "tooltip": "감지된 사각 영역(bbox)을 확장 합니다. 이 옵션은 감지된 영역보다 더 넓은 영역을 인페인트 할 경우 사용합니다.\n주의: sam 모델을 사용할 경우 잘라낸 영역내에서 bbox 확장을 하더라도, sam 감지 영역이 작으면 여전히 제한됩니다."
221
+ },
222
+ "bbox_crop_factor": {
223
+ "name": "bbox 자르기 배율",
224
+ "tooltip": "감지된 사각 영역(bbox)의 몇배 크기의 영역을 잘라낼 것 인지를 설정합니다. 이 크기가 너무 작으면, 인페인트 할 이미지의 주변 정보가 부족해서 위화감이 강한 이미지가 생성됩니다. 이 크기가 너무 크면, 인페인팅에 너무 오랜 시간이 걸릴 수 있으며, 모델의 역량을 초과할 정도로 클 경우 올바르지 않은 이미지를 생성하게 됩니다."
225
+ },
226
+ "sam_detection_hint": {
227
+ "name": "sam 감지 힌트",
228
+ "tooltip": "[실험기능] 오래된 실험 기능으로, sam 모델의 감지 힌트를 제공하는 방식입니다. cetner-1 (중앙점 1개) 외에는 사용하지 않을 것을 권장합니다."
229
+ },
230
+ "sam_dilation": {
231
+ "name": "sam 마스크 확장",
232
+ "tooltip": "sam 모델로 감지된 실루엣 마스크를 확장합니다."
233
+ },
234
+ "sam_threshold": {
235
+ "name": "sam 감지 임계치",
236
+ "tooltip": "sam 모델의 최소 감지 임계치를 설정합니다. 임계치가 높을수록 확실한 객체만 감지하지만, 객체를 감지하지 못할 확률이 증가합니다."
237
+ },
238
+ "sam_bbox_expansion": {
239
+ "name": "sam 영역 확장",
240
+ "tooltip": "sam 의 감지 영역을 확장합니다. 감지 영역은 마스크를 포함하는 전체 사각 영역입니다.\n주의1:sam 마스크를 확장하더라도, 감지 영역을 벗어날 수 없습니다.\n주의2: bbox 확장을 하더라도, sam 감지 영역이 작으면 여전히 제한됩니다."
241
+ },
242
+ "sam_mask_hint_threshold": {
243
+ "name": "sam 마스크 힌트 임계치",
244
+ "tooltip": "[실험기능] 오래된 실험 기능으로, mask-hint 모드에서만 사용되는 옵션으로, 마스크에서 이 크기 이상의 점 마스크를 sam의 힌트로 사용합니다."
245
+ },
246
+ "sam_mask_hint_use_negative": {
247
+ "name": "sam 마스크 힌트에 제외 힌트 사용",
248
+ "tooltip": "[실험기능] 오래된 실험 기능으로, mask-hitn 모드에서만 사용되는 옵션으로, sam 마스크 힌트 임계치보다 작은 점 마스크를 sam의 제외 힌트로 사용합니다."
249
+ },
250
+ "drop_size": {
251
+ "name": "감지 최소 크기",
252
+ "tooltip": "사각 영역(bbox) 감지기로 감지한 크기가 이 설정값 보다 작을 경우 무시합니다."
253
+ },
254
+ "refiner_ratio": {
255
+ "name": "라파이너 적용 비율",
256
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
257
+ },
258
+ "cycle": {
259
+ "name": "반복수",
260
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
261
+ },
262
+ "inpaint_model": {
263
+ "name": "인페인트 모델 모드",
264
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
265
+ },
266
+ "noise_mask_feather": {
267
+ "name": "노이즈 마스크 가장자리 흐림",
268
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
269
+ },
270
+ "scheduler_func_opt": {
271
+ "name": "스케쥴러 함수",
272
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
273
+ },
274
+ "tiled_encode": {
275
+ "name": "타일 인코드 사용",
276
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 인코드'를 사용할 경우, 기본 'VAE 인코드' 대신 'VAE 인코드 (타일)' 을 적용합니다."
277
+ },
278
+ "tiled_decode": {
279
+ "name": "타일 디코드 사용",
280
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 다코드'를 사용할 경우, 기본 'VAE 디코드' 대신 'VAE 디코드 (타일)' 을 적용합니다."
281
+ }
282
+ },
283
+ "outputs": {
284
+ "0": {
285
+ "name": "개선 이미"
286
+ },
287
+ "1": {
288
+ "name": "잘라낸 이미지"
289
+ },
290
+ "2": {
291
+ "name": "잘라낸 투명 이미지"
292
+ },
293
+ "3": {
294
+ "name": "마스크"
295
+ },
296
+ "4": {
297
+ "name": "디테일러 파이프"
298
+ },
299
+ "5": {
300
+ "name": "컨트롤넷 이미지"
301
+ }
302
+ }
303
+ },
304
+ "DetailerForEach": {
305
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으�� 디테일을 강화합니다.",
306
+ "display_name": "디테일러 (SEGS)",
307
+ "inputs": {
308
+ "image": {
309
+ "name": "이미지"
310
+ },
311
+ "segs": {
312
+ "name": "segs",
313
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
314
+ },
315
+ "model": {
316
+ "name": "모델",
317
+ "tooltip": "만약 `ImpactDummyInput` 을 연결 하면, 인페인트 단계를 건너 뜁니다."
318
+ },
319
+ "guide_size": {
320
+ "name": "가이드 크기",
321
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
322
+ },
323
+ "guide_size_for": {
324
+ "name": "가이드 크기 대상",
325
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
326
+ },
327
+ "max_size": {
328
+ "name": "최대 크기",
329
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
330
+ },
331
+ "seed": {
332
+ "name": "시드"
333
+ },
334
+ "steps": {
335
+ "name": "스텝수"
336
+ },
337
+ "sampler_name": {
338
+ "name": "샘플러 이름"
339
+ },
340
+ "scheduler": {
341
+ "name": "스케쥴러"
342
+ },
343
+ "positive": {
344
+ "name": "긍정 조건"
345
+ },
346
+ "negative": {
347
+ "name": "부정 조건"
348
+ },
349
+ "denoise": {
350
+ "name": "노이즈 제거양"
351
+ },
352
+ "feather": {
353
+ "name": "가장자리 흐림",
354
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
355
+ },
356
+ "noise_mask": {
357
+ "name": "노이즈 마스크 사용",
358
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
359
+ },
360
+ "force_inpaint": {
361
+ "name": "인페인트 강제 적용",
362
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 가이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
363
+ },
364
+ "wildcard": {
365
+ "name": "와일드카드 프롬프트",
366
+ "tooltip": "'와일드카드 인코더 (Impact)'와 유사한 기능을 수행하여, 와일드카드 기능과 로라 로딩 기능을 제공합니다. 또한, 감지된 영역별로 다른 프롬프트를 적용하는 기능들을 제공합니다.\n더 자세한 정보는 튜토리얼 페이지를 참고하세요.\n주의:이 입력을 비워두면, 이 입력은 무시됩니다."
367
+ },
368
+ "cycle": {
369
+ "name": "반복수",
370
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
371
+ },
372
+ "detailer_hook": {
373
+ "name": "디테일러 후크",
374
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
375
+ },
376
+ "inpaint_model": {
377
+ "name": "인페인트 모델 모드",
378
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
379
+ },
380
+ "noise_mask_feather": {
381
+ "name": "노이즈 마스크 가장자리 흐림",
382
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
383
+ },
384
+ "scheduler_func_opt": {
385
+ "name": "스케쥴러 함수",
386
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
387
+ },
388
+ "tiled_encode": {
389
+ "name": "타일 인코드 사용",
390
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 인코드'를 사용�� 경우, 기본 'VAE 인코드' 대신 'VAE 인코드 (타일)' 을 적용합니다."
391
+ },
392
+ "tiled_decode": {
393
+ "name": "타일 디코드 사용",
394
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 다코드'를 사용할 경우, 기본 'VAE 디코드' 대신 'VAE 디코드 (타일)' 을 적용합니다."
395
+ }
396
+ },
397
+ "outputs": {
398
+ "0": {
399
+ "name": "개선 이미지"
400
+ }
401
+ }
402
+ },
403
+ "DetailerForEachPipe": {
404
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.",
405
+ "display_name": "디테일러 (상세/SEGS/파이프)",
406
+ "inputs": {
407
+ "image": {
408
+ "name": "이미지"
409
+ },
410
+ "segs": {
411
+ "name": "segs",
412
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
413
+ },
414
+ "guide_size": {
415
+ "name": "가이드 크기",
416
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
417
+ },
418
+ "guide_size_for": {
419
+ "name": "가이드 크기 대상",
420
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
421
+ },
422
+ "max_size": {
423
+ "name": "최대 크기",
424
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
425
+ },
426
+ "seed": {
427
+ "name": "시드"
428
+ },
429
+ "steps": {
430
+ "name": "스텝수"
431
+ },
432
+ "sampler_name": {
433
+ "name": "샘플러 이름"
434
+ },
435
+ "scheduler": {
436
+ "name": "스케쥴러"
437
+ },
438
+ "denoise": {
439
+ "name": "노이즈 제거양"
440
+ },
441
+ "feather": {
442
+ "name": "가장자리 흐림",
443
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
444
+ },
445
+ "noise_mask": {
446
+ "name": "노이즈 마스크 사용",
447
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
448
+ },
449
+ "force_inpaint": {
450
+ "name": "인페인트 강제 적용",
451
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 가이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
452
+ },
453
+ "basic_pipe": {
454
+ "name": "기본 파이프",
455
+ "tooltip": "만약 기본 파이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
456
+ },
457
+ "refiner_ratio": {
458
+ "name": "라파이너 적용 비율",
459
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
460
+ },
461
+ "cycle": {
462
+ "name": "반복수",
463
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
464
+ },
465
+ "detailer_hook": {
466
+ "name": "디테일러 후크",
467
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
468
+ },
469
+ "refiner_basic_pipe_opt": {
470
+ "name": "리파이너 기본 파이프",
471
+ "tooltip": "SDXL 리파이너 단계에 적용할 기본 파이프를 연결합니다."
472
+ },
473
+ "inpaint_model": {
474
+ "name": "인페인트 모델 모드",
475
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
476
+ },
477
+ "noise_mask_feather": {
478
+ "name": "노이즈 마스크 가장자리 흐림",
479
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노���를 적용합니다."
480
+ },
481
+ "scheduler_func_opt": {
482
+ "name": "스케쥴러 함수",
483
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
484
+ },
485
+ "tiled_encode": {
486
+ "name": "타일 인코드 사용",
487
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 인코드'를 사용할 경우, 기본 'VAE 인코드' 대신 'VAE 인코드 (타일)' 을 적용합니다."
488
+ },
489
+ "tiled_decode": {
490
+ "name": "타일 디코드 사용",
491
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 다코드'를 사용할 경우, 기본 'VAE 디코드' 대신 'VAE 디코드 (타일)' 을 적용합니다."
492
+ }
493
+ },
494
+ "outputs": {
495
+ "0": {
496
+ "name": "개선 이미지"
497
+ },
498
+ "1": {
499
+ "name": "segs"
500
+ },
501
+ "2": {
502
+ "name": "기본 파이프"
503
+ },
504
+ "3": {
505
+ "name": "컨트롤넷 이미지"
506
+ }
507
+ }
508
+ },
509
+ "DetailerForEachDebug": {
510
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.",
511
+ "display_name": "디테일러 (상세/SEGS)",
512
+ "inputs": {
513
+ "image": {
514
+ "name": "이미지"
515
+ },
516
+ "segs": {
517
+ "name": "segs",
518
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
519
+ },
520
+ "model": {
521
+ "name": "모델",
522
+ "tooltip": "만약 `ImpactDummyInput` 을 연결 하면, 인페인트 단계를 건너 뜁니다."
523
+ },
524
+ "guide_size": {
525
+ "name": "가이드 크기",
526
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
527
+ },
528
+ "guide_size_for": {
529
+ "name": "가이드 크기 대상",
530
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
531
+ },
532
+ "max_size": {
533
+ "name": "최대 크기",
534
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
535
+ },
536
+ "seed": {
537
+ "name": "시드"
538
+ },
539
+ "steps": {
540
+ "name": "스텝수"
541
+ },
542
+ "sampler_name": {
543
+ "name": "샘플러 이름"
544
+ },
545
+ "scheduler": {
546
+ "name": "스케쥴러"
547
+ },
548
+ "positive": {
549
+ "name": "긍정 조건"
550
+ },
551
+ "negative": {
552
+ "name": "부정 조건"
553
+ },
554
+ "denoise": {
555
+ "name": "노이즈 제거양"
556
+ },
557
+ "feather": {
558
+ "name": "가장자리 흐림",
559
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
560
+ },
561
+ "noise_mask": {
562
+ "name": "노이즈 마스크 사용",
563
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
564
+ },
565
+ "force_inpaint": {
566
+ "name": "인페인트 강제 적용",
567
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 가이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
568
+ },
569
+ "wildcard": {
570
+ "name": "와일드카드 프롬프트",
571
+ "tooltip": "'와일드카드 인코더 (Impact)'와 유사한 기능을 수행하여, 와일드카드 기능과 로라 로딩 기능을 제공합니다. 또한, 감지된 영역별로 다른 프롬프트를 적용하는 기능들을 제공합니다.\n더 자세한 정보는 튜토리얼 페이지를 참고하세요.\n주의:이 입력을 비워두면, 이 입력은 무시됩니다."
572
+ },
573
+ "cycle": {
574
+ "name": "반복수",
575
+ "tooltip": "설정된 값만큼 인페인팅을 반�� 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
576
+ },
577
+ "detailer_hook": {
578
+ "name": "디테일러 후크",
579
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
580
+ },
581
+ "inpaint_model": {
582
+ "name": "인페인트 모델 모드",
583
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
584
+ },
585
+ "noise_mask_feather": {
586
+ "name": "노이즈 마스크 가장자리 흐림",
587
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
588
+ },
589
+ "scheduler_func_opt": {
590
+ "name": "스케쥴러 함수",
591
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
592
+ },
593
+ "tiled_encode": {
594
+ "name": "타일 인코드 사용",
595
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 인코드'를 사용할 경우, 기본 'VAE 인코드' 대신 'VAE 인코드 (타일)' 을 적용합니다."
596
+ },
597
+ "tiled_decode": {
598
+ "name": "타일 디코드 사용",
599
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 다코드'를 사용할 경우, 기본 'VAE 디코드' 대신 'VAE 디코드 (타일)' 을 적용합니다."
600
+ }
601
+ },
602
+ "outputs": {
603
+ "0": {
604
+ "name": "개선 이미지"
605
+ },
606
+ "1": {
607
+ "name": "잘라낸 이미지"
608
+ },
609
+ "2": {
610
+ "name": "잘라낸 개선 이미지"
611
+ },
612
+ "3": {
613
+ "name": "잘라낸 투명 개선 이미지"
614
+ },
615
+ "4": {
616
+ "name": "컨트롤넷 이미지"
617
+ }
618
+ }
619
+ },
620
+ "DetailerForEachDebugPipe": {
621
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.",
622
+ "display_name": "디테일러 (상세/SEGS/파이프)",
623
+ "inputs": {
624
+ "image": {
625
+ "name": "이미지"
626
+ },
627
+ "segs": {
628
+ "name": "segs",
629
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
630
+ },
631
+ "guide_size": {
632
+ "name": "가이드 크기",
633
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
634
+ },
635
+ "guide_size_for": {
636
+ "name": "가이드 크기 대상",
637
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
638
+ },
639
+ "max_size": {
640
+ "name": "최대 크기",
641
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
642
+ },
643
+ "seed": {
644
+ "name": "시드"
645
+ },
646
+ "steps": {
647
+ "name": "스텝수"
648
+ },
649
+ "sampler_name": {
650
+ "name": "샘플러 이름"
651
+ },
652
+ "scheduler": {
653
+ "name": "스케쥴러"
654
+ },
655
+ "denoise": {
656
+ "name": "노이즈 제거양"
657
+ },
658
+ "feather": {
659
+ "name": "가장자리 흐림",
660
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
661
+ },
662
+ "noise_mask": {
663
+ "name": "노이즈 마스크 사용",
664
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
665
+ },
666
+ "force_inpaint": {
667
+ "name": "인페인트 강제 적용",
668
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 ���이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
669
+ },
670
+ "basic_pipe": {
671
+ "name": "기본 파이프",
672
+ "tooltip": "만약 기본 파이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
673
+ },
674
+ "refiner_ratio": {
675
+ "name": "라파이너 적용 비율",
676
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
677
+ },
678
+ "cycle": {
679
+ "name": "반복수",
680
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
681
+ },
682
+ "detailer_hook": {
683
+ "name": "디테일러 후크",
684
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
685
+ },
686
+ "refiner_basic_pipe_opt": {
687
+ "name": "리파이너 기본 파이프",
688
+ "tooltip": "SDXL 리파이너 단계에 적용할 기본 파이프를 연결합니다."
689
+ },
690
+ "inpaint_model": {
691
+ "name": "인페인트 모델 모드",
692
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
693
+ },
694
+ "noise_mask_feather": {
695
+ "name": "노이즈 마스크 가장자리 흐림",
696
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
697
+ },
698
+ "scheduler_func_opt": {
699
+ "name": "스케쥴러 함수",
700
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
701
+ },
702
+ "tiled_encode": {
703
+ "name": "타일 인코드 사용",
704
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 인코드'를 사용할 경우, 기본 'VAE 인코드' 대신 'VAE 인코드 (타일)' 을 적용합니다."
705
+ },
706
+ "tiled_decode": {
707
+ "name": "타일 디코드 사용",
708
+ "tooltip": "이 옵션을 켜면, 내부적으로 'VAE 다코드'를 사용할 경우, 기본 'VAE 디코드' 대신 'VAE 디코드 (타일)' 을 적용합니다."
709
+ }
710
+ },
711
+ "outputs": {
712
+ "0": {
713
+ "name": "개선 이미지"
714
+ },
715
+ "1": {
716
+ "name": "개선 SEGS"
717
+ },
718
+ "2": {
719
+ "name": "기본 파이프"
720
+ },
721
+ "3": {
722
+ "name": "잘라낸 이미지"
723
+ },
724
+ "4": {
725
+ "name": "잘라낸 개선 이미지"
726
+ },
727
+ "5": {
728
+ "name": "잘라낸 투명 개선 이미지"
729
+ },
730
+ "6": {
731
+ "name": "컨트롤넷 이미지"
732
+ }
733
+ }
734
+ },
735
+ "DetailerForEachPipeForAnimateDiff": {
736
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.\n이 노드는 AnimateDiff와 같은 동영상의 디테일 개선을 위한 특수 디테일러 노드로써, SEGS가 담고 있는 마스크가 여러 프레임에 걸친 배치 마스크가 되는 경우를 처리할 수 있습니다.",
737
+ "display_name": "디테일러 (AnimateDiff/파이프)",
738
+ "inputs": {
739
+ "image_frames": {
740
+ "name": "이미지 프레임 묶음"
741
+ },
742
+ "segs": {
743
+ "name": "segs",
744
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
745
+ },
746
+ "guide_size": {
747
+ "name": "가이드 크기",
748
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
749
+ },
750
+ "guide_size_for": {
751
+ "name": "가이드 크기 대상",
752
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
753
+ },
754
+ "max_size": {
755
+ "name": "최대 크기",
756
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
757
+ },
758
+ "seed": {
759
+ "name": "시드"
760
+ },
761
+ "steps": {
762
+ "name": "스텝수"
763
+ },
764
+ "sampler_name": {
765
+ "name": "샘플러 이름"
766
+ },
767
+ "scheduler": {
768
+ "name": "스케쥴러"
769
+ },
770
+ "denoise": {
771
+ "name": "노이즈 제거양"
772
+ },
773
+ "feather": {
774
+ "name": "가장자리 흐림",
775
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
776
+ },
777
+ "basic_pipe": {
778
+ "name": "기본 파이프",
779
+ "tooltip": "만약 기본 파이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
780
+ },
781
+ "refiner_ratio": {
782
+ "name": "라파이너 적용 비율",
783
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
784
+ },
785
+ "detailer_hook": {
786
+ "name": "디테일러 후크",
787
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
788
+ },
789
+ "refiner_basic_pipe_opt": {
790
+ "name": "리파이너 기본 파이프",
791
+ "tooltip": "SDXL 리파이너 단계에 적용할 기본 파이프를 연결합니다."
792
+ },
793
+ "noise_mask_feather": {
794
+ "name": "노이즈 마스크 가장자리 흐림",
795
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
796
+ },
797
+ "scheduler_func_opt": {
798
+ "name": "스케쥴러 함수",
799
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
800
+ }
801
+ },
802
+ "outputs": {
803
+ "0": {
804
+ "name": "개선 SEGS"
805
+ },
806
+ "1": {
807
+ "name": "개선 이미지"
808
+ },
809
+ "2": {
810
+ "name": "기본 파이프"
811
+ },
812
+ "3": {
813
+ "name": "컨트롤넷 이미지"
814
+ }
815
+ }
816
+ },
817
+ "SEGSDetailerForAnimateDiff": {
818
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.\n이 노드는 원본 이미지가 아닌 SEGS를 대상으로 적용되는 노드로 원본 이미지에 적용하려면 'SEGS 붙여넣기' 노드를 사용하세요.\n이 노드는 AnimateDiff와 같은 동영상의 디테일 개선을 위한 특수 디테일러 노드로써, SEGS가 담고 있는 마스크가 여러 프레임에 걸친 배치 마스크가 되는 경우를 처리할 수 있습니다.",
819
+ "display_name": "SEGS 디테일러 (AnimateDiff/파이프)",
820
+ "inputs": {
821
+ "image_frames": {
822
+ "name": "이미지 프레임 묶음"
823
+ },
824
+ "segs": {
825
+ "name": "segs",
826
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
827
+ },
828
+ "guide_size": {
829
+ "name": "가이드 크기",
830
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
831
+ },
832
+ "guide_size_for": {
833
+ "name": "가이드 크기 대상",
834
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
835
+ },
836
+ "max_size": {
837
+ "name": "최대 크기",
838
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
839
+ },
840
+ "seed": {
841
+ "name": "시드"
842
+ },
843
+ "steps": {
844
+ "name": "스텝수"
845
+ },
846
+ "sampler_name": {
847
+ "name": "샘플러 이름"
848
+ },
849
+ "scheduler": {
850
+ "name": "스케쥴러"
851
+ },
852
+ "denoise": {
853
+ "name": "노이즈 제거양"
854
+ },
855
+ "basic_pipe": {
856
+ "name": "기본 파이프",
857
+ "tooltip": "만약 기본 ���이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
858
+ },
859
+ "refiner_ratio": {
860
+ "name": "라파이너 적용 비율",
861
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
862
+ },
863
+ "refiner_basic_pipe_opt": {
864
+ "name": "리파이너 기본 파이프",
865
+ "tooltip": "SDXL 리파이너 단계에 적용할 기본 파이프를 연결합니다."
866
+ },
867
+ "noise_mask_feather": {
868
+ "name": "노이즈 마스크 가장자리 흐림",
869
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
870
+ },
871
+ "scheduler_func_opt": {
872
+ "name": "스케쥴러 함수",
873
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
874
+ }
875
+ },
876
+ "outputs": {
877
+ "0": {
878
+ "name": "개선 SEGS"
879
+ },
880
+ "1": {
881
+ "name": "개선 이미지"
882
+ }
883
+ }
884
+ },
885
+ "SEGSDetailer": {
886
+ "description": "감지 영역 정보 묶음(SEGS)내의 각 영역들에 대해 가이드 크기를 기반으로 확대해서 인페이트하는 방법으로 디테일을 강화합니다.\n이 노드는 원본 이미지가 아닌 SEGS를 대상으로 적용되는 노드로 원본 이미지에 적용하려면 'SEGS 붙여넣기' 노드를 사용하세요.",
887
+ "display_name": "SEGS 디테일러 (파이프)",
888
+ "inputs": {
889
+ "image": {
890
+ "name": "이미지"
891
+ },
892
+ "segs": {
893
+ "name": "segs",
894
+ "tooltip": "감지 영역 정보를 담고 있는 묶음.\n이 영역들을 대상으로 인페인트가 적용됩니다."
895
+ },
896
+ "guide_size": {
897
+ "name": "가이드 크기",
898
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
899
+ },
900
+ "guide_size_for": {
901
+ "name": "가이드 크기 대상",
902
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
903
+ },
904
+ "max_size": {
905
+ "name": "최대 크기",
906
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
907
+ },
908
+ "seed": {
909
+ "name": "시드"
910
+ },
911
+ "steps": {
912
+ "name": "스텝수"
913
+ },
914
+ "sampler_name": {
915
+ "name": "샘플러 이름"
916
+ },
917
+ "scheduler": {
918
+ "name": "스케쥴러"
919
+ },
920
+ "denoise": {
921
+ "name": "노이즈 제거양"
922
+ },
923
+ "noise_mask": {
924
+ "name": "노이즈 마스크 사용",
925
+ "tooltip": "인페인트 할 때, 마스크를 적용해서 마스크 영역만 인페인트합니다. 이 옵션을 적용하지 않으면, 잘라낸 이미지 전체가 재생성되어 노이즈 제거양이 클 때 위화감이 나타나게 됩니다."
926
+ },
927
+ "force_inpaint": {
928
+ "name": "인페인트 강제 적용",
929
+ "tooltip": "가이드 크기와 상관 없이 인페인팅을 무조건 적용 합니다. 이 옵션이 꺼져있는 경우 가이드 크기보다 이미 큰 감지 영역은 인페인팅을 건너 뜁니다."
930
+ },
931
+ "basic_pipe": {
932
+ "name": "기본 파이프",
933
+ "tooltip": "만약 기본 파이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
934
+ },
935
+ "refiner_ratio": {
936
+ "name": "라파이너 적용 비율",
937
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
938
+ },
939
+ "batch_size": {
940
+ "name": "배치 갯수",
941
+ "tooltip": "대상 SEGS 에 대해서 배치 갯수만큼 여러개의 후보를 생성합니다. 여러개를 생성할 경우 '고르기 (SEGS)'와 함께 사용하세요."
942
+ },
943
+ "cycle": {
944
+ "name": "반복수",
945
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
946
+ },
947
+ "refiner_basic_pipe_opt": {
948
+ "name": "리파이너 기본 파이프",
949
+ "tooltip": "SDXL 리파이너 단계에 적용할 기본 파이프를 연결합니다."
950
+ },
951
+ "inpaint_model": {
952
+ "name": "인페인트 모델 모드",
953
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
954
+ },
955
+ "noise_mask_feather": {
956
+ "name": "노이즈 마스크 가장자리 흐림",
957
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
958
+ },
959
+ "scheduler_func_opt": {
960
+ "name": "스케쥴러 함수",
961
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
962
+ }
963
+ },
964
+ "outputs": {
965
+ "0": {
966
+ "name": "개선 SEGS"
967
+ },
968
+ "1": {
969
+ "name": "컨트롤넷 이미지"
970
+ }
971
+ }
972
+ },
973
+ "MaskDetailerPipe": {
974
+ "description": "이 디테일러 노드는 마스크로 설정된 영역을 확대해서 가이드 크기를 기반으로 확대해서 인페인트하는 방법으로 디테일을 강화합니다.",
975
+ "display_name": "마스크 디테일러 (파이프)",
976
+ "inputs": {
977
+ "image": {
978
+ "name": "이미지"
979
+ },
980
+ "mask": {
981
+ "name": "마스크",
982
+ "tooltip": "디테일을 강화하고 싶은 대상 영역이 설정된 마스크. 분리된 마스크 영역은 개별적으로 디테일 강화가 이루어집니다."
983
+ },
984
+ "basic_pipe": {
985
+ "name": "기본 파이프",
986
+ "tooltip": "만약 기본 파이프 내의 모델에 `ImpactDummyInput` 가 설정된 경우, 인페인트 단계를 건너 뜁니다."
987
+ },
988
+ "guide_size": {
989
+ "name": "가이드 크기",
990
+ "tooltip": "'가이드 크기 대상'으로 지정된 크기의 가장 짧은면을 이 크기까지 확대합니다."
991
+ },
992
+ "guide_size_for": {
993
+ "name": "가이드 크기 대상",
994
+ "tooltip": "bbox: 감지된 사각 영역(bbox)\ncrop_region: 잘라낸 영역"
995
+ },
996
+ "max_size": {
997
+ "name": "최대 크기",
998
+ "tooltip": "'가이드 크기'로 확대 할 때, 가장 긴 면의 길이를 이 크기로 제한합니다. 너무 크게 확대 되는 것을 막아줍니다."
999
+ },
1000
+ "mask_mode": {
1001
+ "name": "마스크 모드",
1002
+ "tooltip": "마스크로 설정된 영역만을 인페인트 할지, 잘라낸 영역 전체를 인페인트 할 것인지를 설정합니다."
1003
+ },
1004
+ "seed": {
1005
+ "name": "시드"
1006
+ },
1007
+ "steps": {
1008
+ "name": "스텝수"
1009
+ },
1010
+ "sampler_name": {
1011
+ "name": "샘플러 이름"
1012
+ },
1013
+ "scheduler": {
1014
+ "name": "스케쥴러"
1015
+ },
1016
+ "denoise": {
1017
+ "name": "노이즈 제거양"
1018
+ },
1019
+ "feather": {
1020
+ "name": "가장자리 흐림",
1021
+ "tooltip": "확대 해서 인페인트 된 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
1022
+ },
1023
+ "crop_factor": {
1024
+ "name": "자르기 배율",
1025
+ "tooltip": "각 마스크로 설정된 영역에 대해서 몇배 크기를 잘라내어서 인페인트에 사용할지를 설정합니다. 이 크기가 너무 작으면, 인페인트 할 이미지의 주변 정보가 부족해서 위화감이 강한 이미지가 생성됩니다. 이 크기가 너무 크면, 인페인팅에 너무 오랜 시간이 걸릴 수 있으며, 모델의 역량을 초과할 정도로 클 경우 올바르지 않은 이미지를 생성하게 됩니다."
1026
+ },
1027
+ "drop_size": {
1028
+ "name": "감지 최소 크기",
1029
+ "tooltip": "사각 영역(bbox) 감지기로 감지한 크기가 이 설정값 보다 작을 경우 무시합니다."
1030
+ },
1031
+ "refiner_ratio": {
1032
+ "name": "라파이너 적용 비율",
1033
+ "tooltip": "SDXL 리파이너 모델을 사용할 경우 적용될 후반 스텝수 비율을 설정합니다."
1034
+ },
1035
+ "batch_size": {
1036
+ "name": "배치 갯수",
1037
+ "tooltip": "대상 SEGS 에 대해서 배치 갯수만큼 여러개의 후보를 생성합니다. 여러개를 생성할 경우 '고르기 (SEGS)'와 함께 사용하세요."
1038
+ },
1039
+ "cycle": {
1040
+ "name": "반복수",
1041
+ "tooltip": "설정된 값만큼 인페인팅을 반복 적용합니다. 인코딩/디코딩 없이 확대된 잠재 이미지 단계에서 반복됩니다."
1042
+ },
1043
+ "refiner_basic_pipe_opt": {
1044
+ "name": "리파이너 기본 파이프",
1045
+ "tooltip": "SDXL 리파이너 단계에 적용할 기본 파이프를 연결합니다."
1046
+ },
1047
+ "detailer_hook": {
1048
+ "name": "디테일러 후크",
1049
+ "tooltip": "이 노드의 실행 중간단계에서 여러가지 기능을 수행할 수 있는 후크를 연결합니다."
1050
+ },
1051
+ "inpaint_model": {
1052
+ "name": "인페인트 모델 모드",
1053
+ "tooltip": "인페인트 전용 모델을 사용할 경우 이 옵션을 켜면, 인페인팅시에 '인페인트 모델 조건 설정'이 적용되어 수행됩니다."
1054
+ },
1055
+ "noise_mask_feather": {
1056
+ "name": "노이즈 마스크 가장자리 흐림",
1057
+ "tooltip": "인페인트시에 적용되는 노이즈 마스크의 가장자리를 흐리게 합니다. 이 설정값이 0을 초과할 경우, 내부적으로 자동으로 '차등 확산' 노드를 적용합니다."
1058
+ },
1059
+ "bbox_fill": {
1060
+ "name": "bbox 채우기",
1061
+ "tooltip": "각 마스크 조각들을 해당 마스크를 포함하는 가장 작은 사각 영역의 마스크로 간주합니다."
1062
+ },
1063
+ "contour_fill": {
1064
+ "name": "윤곽 내부 채우기",
1065
+ "tooltip": "윤곽선 형태의 마스크 조각들의 경우 마스크 내부가 모두 채워진 것으로 간주합니다."
1066
+ },
1067
+ "scheduler_func_opt": {
1068
+ "name": "스케쥴러 함수",
1069
+ "tooltip": "GITS 스케쥴러 처럼 기본 스케쥴러 리스트에서 선택할 수 없는 특수 스케쥴러를 사용할 수 있게 해줍니다. 이 입력이 연결되면, 기본 스케쥴러 선택은 무시됩니다."
1070
+ }
1071
+ },
1072
+ "outputs": {
1073
+ "0": {
1074
+ "name": "개선 이미지"
1075
+ },
1076
+ "1": {
1077
+ "name": "잘라낸 개선 이미지"
1078
+ },
1079
+ "2": {
1080
+ "name": "잘라낸 투명 개선 이미지"
1081
+ },
1082
+ "3": {
1083
+ "name": "기본 파이프"
1084
+ },
1085
+ "4": {
1086
+ "name": "리파이너 기본 파이프"
1087
+ }
1088
+ }
1089
+ },
1090
+
1091
+ "SEGSPaste": {
1092
+ "description": "SEGS 디테일러를 통해 개선된 SEGS를 원본 이미지에 붙여넣는 기능을 제공하기 위한 노드입니다.",
1093
+ "display_name": "SEGS 붙여넣기",
1094
+ "inputs": {
1095
+ "image": {
1096
+ "name": "원본 이미지"
1097
+ },
1098
+ "segs": {
1099
+ "name": "segs"
1100
+ },
1101
+ "feather": {
1102
+ "name": "가장자리 흐림",
1103
+ "tooltip": "개선된 SEGS의 이미지를 원본 이미지에 붙여넣을 때, 이 수치로 마스크의 가장 자리를 흐리게 해서 붙여넣어 이음매의 위화감을 줄여줍니다."
1104
+ },
1105
+ "alpha": {
1106
+ "name": "투명도",
1107
+ "tooltip": "원본에 붙여넣는 이미지에 투명도를 설정합니다."
1108
+ },
1109
+ "ref_image_opt": {
1110
+ "name": "참조 이미지",
1111
+ "tooltip": "디테일러를 통과시키거나 'SEGS에 기본 이미지 설정'을 한 경우가 아니라면, SEGS는 이미지가 없이 감지 영역 정보만 있습니다. 이 때 감지영역이 참조할 원본 이미지를 설정합니다."
1112
+ }
1113
+ },
1114
+ "outputs": {
1115
+ "0": {
1116
+ "name": "개선 SEGS"
1117
+ }
1118
+ }
1119
+ },
1120
+
1121
+ "ImpactSEGSPicker": {
1122
+ "description": "입력된 SEGS 중에서 선택된 SEGS만을 고를 수 있는 있는 기능을 제공합니다.",
1123
+ "display_name": "고르기 (SEGS)",
1124
+ "inputs": {
1125
+ "picks": {
1126
+ "name": "선택 목록",
1127
+ "tooltip": "출력할 SEGS 번호 목록을 나열합니다. 'pick' 버튼을 눌러서 선택하세요."
1128
+ },
1129
+ "segs": {
1130
+ "name": "segs"
1131
+ },
1132
+ "fallback_image_opt": {
1133
+ "name": "참조 이미지",
1134
+ "tooltip": "디테일러를 통과시키거나 'SEGS에 기본 이미지 설정'을 한 경우가 아니라면, SEGS는 이미지가 없이 감지 영역 정보만 있습니다. 이 때 감지영역이 참조할 원본 이미지를 설정합니다."
1135
+ }
1136
+ },
1137
+ "outputs": {
1138
+ "0": {
1139
+ "name": "선택된 SEGS"
1140
+ }
1141
+ }
1142
+ },
1143
+
1144
+ "SetDefaultImageForSEGS": {
1145
+ "description": "디테일러를 통과시킨 경우가 아니라면, SEGS는 이미지가 없이 감지 영역 정보만 있습니다. 이 노드는 SEGS에 기본 이미지를 설정해 줍니다.",
1146
+ "display_name": "SEGS에 기본 이미지 설정",
1147
+ "inputs": {
1148
+ "segs": {
1149
+ "name": "segs"
1150
+ },
1151
+ "image": {
1152
+ "name": "이미지"
1153
+ },
1154
+ "override": {
1155
+ "name": "덮어쓰기",
1156
+ "tooltip": "이미 설정된 이미지가 있는 경우 덮어쓸지 여부를 설정합니다."
1157
+ }
1158
+ },
1159
+ "outputs": {
1160
+ "0": {
1161
+ "name": "segs"
1162
+ }
1163
+ }
1164
+ },
1165
+
1166
+ "ImpactWildcardProcessor": {
1167
+ "description": "이 노드는 와일드카드 구문으로 작성된 텍스트 프롬프트를 처리하고, 처리된 텍스트 프롬프트를 출력합니다.\n\nTIP: 워크플로가 실행되기 전에 '와일드카드 텍스트'의 처리 결과가 '채워진(populated) 텍스트'에 표시되며, 이 값은 워크플로와 함께 저장됩니다. 입력으로 변환된 시드를 사용하려면 '와일드카드 텍스트' 대신 '채워진(populated) 텍스트'에 직접 프롬프트를 작성하고, 모드를 '고정(fixed)'로 설정하세요.",
1168
+ "display_name": "와일드카드 처리기 (Impact)",
1169
+ "inputs": {
1170
+ "wildcard_text": {
1171
+ "name": "와일드카드 텍스트",
1172
+ "tooltip": "와일드카드 문법으로 작성된 텍스트 프롬프트를 입력하세요."
1173
+ },
1174
+ "populated_text": {
1175
+ "name": "채워진 텍스트",
1176
+ "tooltip": "이 노드에 실행 중에 전달되는 실제 값은 여기 표시된 값입니다. 동작은 모드에 따라 약간 다를 수 있으며, '채워진 텍스트'에서도 와일드카드 구문을 사용할 수 있습니다."
1177
+ },
1178
+ "mode": {
1179
+ "name": "모드",
1180
+ "tooltip": "채우기(populate): 워크플로를 실행하기 전에 '와일드카드 텍스트'에서 처리된 프롬프트로 '채워진 텍스트'의 기존 값을 덮어씁니다. 이 모드에서는 '채워진 텍스트'를 수정할 수 없습니다.\n\n고정(fixed): '와일드카드 텍스트'를 무시하고 '채워진 텍스트'의 값을 그대로 유지합니다. 이 모드에서는 '채워진 텍스트'를 수정할 수 있습니다.\n\n재현(reproduce): 이 모드는 한 번만 '고정(fixed)' 모드로 작동하여 재현한 후, 이후에는 '채우기(populate)' 모드로 전환됩니다."
1181
+ },
1182
+ "seed": {
1183
+ "name": "시드",
1184
+ "tooltip": "와일드카드의 무작위 선택에 사용할 시드 입니다"
1185
+ },
1186
+ "Select to add Wildcard": {
1187
+ "name": "추가할 와일드카드 선택"
1188
+ }
1189
+ },
1190
+ "outputs": {
1191
+ "0": {
1192
+ "name": "처리된 텍스트"
1193
+ }
1194
+ }
1195
+ },
1196
+
1197
+ "ImpactWildcardEncode": {
1198
+ "description": "이 노드는 와일드카드 구문으로 작성된 텍스트 프롬프트를 처리하고 이를 조건으로 출력합니다. 또한 LoRA 구문을 지원하며, 적용된 LoRA는 모델 출력에 반영됩니다.\n\nTIP1: 워크플로가 실행되기 전에 '와일드카드 텍스트'의 처리 결과가 '채워진 텍스트'에 표시되며, 이 값은 워크플로와 함께 저장됩니다. 입력으로 변환된 시드를 사용하려면 '와일드카드 텍스트' 대신 '채워진 텍스트'에 직접 프롬프트를 작성하고, 모드를 '고정(fixed)'로 설정하세요.\nTIP2: 'Inspire Pack'이 설치되어 있으면 LBW(로라 블록 웨이트) 구문도 적용할 수 있습니다.",
1199
+ "display_name": "와일드카드 인코딩 (Impact)",
1200
+ "inputs": {
1201
+ "wildcard_text": {
1202
+ "name": "와일드카드 텍스트",
1203
+ "tooltip": "와일드카드 문법으로 작성된 텍스트 프롬프트를 입력하세요."
1204
+ },
1205
+ "populated_text": {
1206
+ "name": "채워진 텍스트",
1207
+ "tooltip": "이 노드에 실행 중에 전달되는 실제 값은 여기 표시된 값입니다. 동작은 모드에 따라 약간 다를 수 있으며, '채워진 텍스트'에서도 와일드카드 구문을 사용할 수 있습니다."
1208
+ },
1209
+ "mode": {
1210
+ "name": "모드",
1211
+ "tooltip": "채우기(populate): 워크플로를 ��행하기 전에 '와일드카드 텍스트'에서 처리된 프롬프트로 '채워진 텍스트'의 기존 값을 덮어씁니다. 이 모드에서는 '채워진 텍스트'를 수정할 수 없습니다.\n\n고정(fixed): '와일드카드 텍스트'를 무시하고 '채워진 텍스트'의 값을 그대로 유지합니다. 이 모드에서는 '채워진 텍스트'를 수정할 수 있습니다.\n\n재현(reproduce): 이 모드는 한 번만 '고정(fixed)' 모드로 작동하여 재현한 후, 이후에는 '채우기(populate)' 모드로 전환됩니다."
1212
+ },
1213
+ "Select to add LoRA": {
1214
+ "name": "추가할 LoRA 선택"
1215
+ },
1216
+ "Select to add Wildcard": {
1217
+ "name": "추가할 와일드카드 선택"
1218
+ },
1219
+ "seed": {
1220
+ "name": "시드",
1221
+ "tooltip": "와일드카드의 무작위 선택에 사용할 시드 입니다"
1222
+ }
1223
+ },
1224
+ "outputs": {
1225
+ "0": {
1226
+ "name": "model",
1227
+ "tooltip": "LoRA 적용 문법이 사용된 경우, LoRA 가 적용된 model이 출력됩니다."
1228
+ },
1229
+ "1": {
1230
+ "name": "clip",
1231
+ "tooltip": "LoRA 적용 문법이 사용된 경우, LoRA 가 적용된 clip이 출력됩니다."
1232
+ },
1233
+ "2": {
1234
+ "name": "조건"
1235
+ },
1236
+ "3": {
1237
+ "name": "채워진 텍스트"
1238
+ }
1239
+ }
1240
+ }
1241
+ }
comfyui-impact-pack/modules/impact/__pycache__/animatediff_nodes.cpython-311.pyc ADDED
Binary file (11.2 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/animatediff_nodes.cpython-312.pyc ADDED
Binary file (9.98 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/bridge_nodes.cpython-311.pyc ADDED
Binary file (22.9 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/bridge_nodes.cpython-312.pyc ADDED
Binary file (18.4 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/config.cpython-311.pyc ADDED
Binary file (4.02 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/config.cpython-312.pyc ADDED
Binary file (3.83 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/core.cpython-311.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8aefb12844b8fc641258094929c09799bf65a593a72aaea70af9b3b78ac86150
3
+ size 126953
comfyui-impact-pack/modules/impact/__pycache__/core.cpython-312.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba906f9b1b6df6e4aeaaaa0b09c57119866f1fb22c335801704a3601c681ea72
3
+ size 103078
comfyui-impact-pack/modules/impact/__pycache__/defs.cpython-311.pyc ADDED
Binary file (1.22 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/defs.cpython-312.pyc ADDED
Binary file (1.21 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/detectors.cpython-311.pyc ADDED
Binary file (29.2 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/detectors.cpython-312.pyc ADDED
Binary file (23.5 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/hf_nodes.cpython-311.pyc ADDED
Binary file (6.25 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/hf_nodes.cpython-312.pyc ADDED
Binary file (5.5 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/hook_nodes.cpython-311.pyc ADDED
Binary file (6.25 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/hook_nodes.cpython-312.pyc ADDED
Binary file (5.07 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/hooks.cpython-311.pyc ADDED
Binary file (35.7 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/hooks.cpython-312.pyc ADDED
Binary file (30.9 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/impact_pack.cpython-311.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0daaef732e53ef5beb1abb60956dd32fb0d90a86da1307c3d91141460cf86d51
3
+ size 129320
comfyui-impact-pack/modules/impact/__pycache__/impact_pack.cpython-312.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81ca8190994e744c9e1556d7daac8b4c73c2f96551f92728c3df6cd9aae0c209
3
+ size 106160
comfyui-impact-pack/modules/impact/__pycache__/impact_sampling.cpython-311.pyc ADDED
Binary file (16.3 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/impact_sampling.cpython-312.pyc ADDED
Binary file (14.6 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/impact_server.cpython-311.pyc ADDED
Binary file (32 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/impact_server.cpython-312.pyc ADDED
Binary file (28.5 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/logics.cpython-311.pyc ADDED
Binary file (31.1 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/logics.cpython-312.pyc ADDED
Binary file (27.5 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/pipe.cpython-311.pyc ADDED
Binary file (16.6 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/pipe.cpython-312.pyc ADDED
Binary file (14.9 kB). View file
 
comfyui-impact-pack/modules/impact/__pycache__/segs_nodes.cpython-311.pyc ADDED
Binary file (89.4 kB). View file