├── .gitattributes
├── .github
└── workflows
│ └── publish.yml
├── .gitignore
├── LICENSE
├── README.md
├── __init__.py
├── examples
├── workflow-gaffer-grayscaler-compare.json
├── workflow-gaffer-iclight-all.json
├── workflow-gaffer-iclight-fbc.json
├── workflow-gaffer-iclight-fc-animated.json
├── workflow-gaffer-iclight-fc-normal.json
├── workflow-gaffer-iclight-fc-text.json
└── workflow-gaffer-iclight-fc.json
├── iclight.py
├── image
├── all.png
├── node_apply-iclight.png
├── node_calculate_normal_map.png
├── node_gray-scaler.png
├── node_load-iclight-model.png
└── node_simple-light-source.png
├── pyproject.toml
├── requirements.txt
└── utils
├── image.py
└── patches.py
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish to Comfy registry
2 | on:
3 | workflow_dispatch:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - "pyproject.toml"
9 |
10 | jobs:
11 | publish-node:
12 | name: Publish Custom Node to registry
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Check out code
16 | uses: actions/checkout@v4
17 | - name: Publish Custom Node
18 | uses: Comfy-Org/publish-node-action@main
19 | with:
20 | ## Add your own personal access token to your Github Repository secrets and reference it here.
21 | personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
2 | /venv
3 | .vscode
4 | *.ckpt
5 | *.safetensors
6 | *.pth
7 | types
8 | *.pyc
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
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 |
635 | Copyright (C)
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 .
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 | Copyright (C)
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 | .
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 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ComfyUI Gaffer
2 |
3 | comfyui's gaffer
4 |
5 | ## Important updates
6 |
7 | * 2024-05-12: ComfyUI native implementation of [IC-Light](https://github.com/lllyasviel/IC-Light).
8 |
9 | ## Install
10 |
11 | * Recommended use [ComfyUI Manager](https://github.com/ltdrdata/ComfyUI-Manager) for installation.
12 |
13 | * Or open the cmd window in the plugin directory of ComfyUI, like ```ComfyUI\custom_nodes```,type
14 | ```
15 | git clone https://github.com/huagetai/ComfyUI-Gaffer.git
16 | ```
17 | * Or download the zip file and extracted, copy the resulting folder to ```ComfyUI\custom_ Nodes```
18 | * Download models
19 |
20 | You can download models here: https://huggingface.co/lllyasviel/ic-light/tree/main
21 | There are 3 models:
22 | * iclight_sd15_fc.safetensors: Use this in FG workflows
23 | - iclight_sd15_fcon.safetensors: Use this in FG workflows
24 | - iclight_sd15_fbc.safetensors: Use this in BG workflows
25 |
26 | After you download these models, please put them under ComfyUI/models/iclight.
27 |
28 | * Restart ComfyUI.
29 |
30 | ## Usage
31 |
32 | 
33 |
34 |
35 | * Text-Conditioned Model
36 |
37 | * refer to: [Text + foreground Conditioned](examples/workflow-gaffer-iclight-fc-text.json)
38 |
39 | * refer to: [Text + foreground + Lighting Preference Conditioned](examples/workflow-gaffer-iclight-fc.json)
40 |
41 | * Background-Conditioned Model
42 |
43 | * refer to: [Text + foreground + background Conditioned](examples/workflow-gaffer-iclight-fbc.json)
44 |
45 | * Calculate Normal
46 |
47 | * refer to: [Calculate Normal](examples/workflow-gaffer-iclight-fc-normal.json)
48 |
49 | * animated
50 |
51 | * refer to: [Animated](examples/workflow-gaffer-iclight-fc-animated.json)
52 |
53 | * tips: Lighting Preference Requires [ComfyUI-KJNodes](https://github.com/kijai/ComfyUI-KJNodes)
54 |
55 | * tips
56 |
57 | * Model description and input foreground and background images can be obtained [IC-Light](https://github.com/lllyasviel/IC-Light)
58 | * The overall brightness can be controlled through the grayscale. refer to [grayscaler-compare](examples/workflow-gaffer-grayscaler-compare.json)
59 |
60 | ## Nodes
61 |
62 |
63 | * **Load ICLight Model Node**
64 |
65 | Load ICLight Model
66 |
67 | 
68 |
69 | input:
70 | * iclight_name: The name of the ICLight model to load.
71 |
72 | output:
73 | * iclight: ICLight model information.
74 |
75 |
76 | * **Apply ICLight Node**
77 |
78 | Apply ICLight
79 |
80 | 
81 |
82 | input:
83 | * model: base model
84 | * vae: VAE
85 | * iclight: ICLight model information.
86 | * position: position prompts
87 | * negative: negative prompts
88 | * fg_pixels: foreground image.The background of the foreground image needs to be removed, and it is recommended to set it to a grayscale background.
89 | * bg_pixels: background image(optional).Required for Background-Conditioned Model.Consistent with the width and height of the foreground image
90 | * multiplier: strength of ic-light model
91 |
92 | output:
93 | * model: model with ICLight
94 | * position: position prompts
95 | * negative: negative prompts
96 | * empty_latent: Empty Latent Image.The width and height are consistent with the foreground image.
97 |
98 |
99 | * **Simple Light Source Node**
100 |
101 | Simple Light Source for Lighting Preference
102 | 
103 |
104 | input:
105 | * light_position: Left Light, Right Light, Top Light, Bottom Light, Top Left Light, Top Right Light, Bottom Left Light, Bottom Right Light
106 | * multiplier: strength of Lighting Preference
107 | * start_color: start color of Lighting Preference
108 | * end_color: end color of Lighting Preference
109 | * width: The width of Lighting Preference
110 | * height: The height of Lighting Preference
111 | tips:Consistent with the width and height of the foreground image
112 |
113 | output:
114 | * image: Lighting Preference.
115 |
116 | tips:
117 | * different effects can be achieved by setting the start color and end color.
118 |
119 | * **Calculate Normal Map Node**
120 |
121 | Calculate Normal Map
122 |
123 | 
124 |
125 | input:
126 | * images: A sequence of input images
127 | * mask: Optional, a mask image to specify the computation region.
128 | * sigma: The standard deviation for Gaussian blur, controlling the smoothness of the normal calculation.
129 | * center_input_range: The range used to center the input images.
130 |
131 | output:
132 | * normal: normal map
133 |
134 | **tips**:The node from [kijai-ComfyUI-IC-Light](https://github.com/kijai/ComfyUI-IC-Light) project
135 |
136 | * **Gray Scaler Node**
137 |
138 | Scales the image area to gray according to the provided mask.
139 |
140 | 
141 | *
142 | input:
143 | * image: transparent background image.
144 | * mask: mask indicating areas to be converted to grey.
145 | * multiplier: A value to control the intensity of the grey conversion.
146 |
147 | output:
148 | * image: gray background image.
149 |
150 |
151 | ## Credits
152 |
153 | * [IC-Light](https://github.com/lllyasviel/IC-Light)
154 | * [ComfyUI](https://github.com/comfyanonymous/ComfyUI)
155 | * [kijai-ComfyUI-IC-Light](https://github.com/kijai/ComfyUI-IC-Light)
156 | * [huchenlei-ComfyUI-IC-Light-Native](https://github.com/huchenlei/ComfyUI-IC-Light-Native)
--------------------------------------------------------------------------------
/__init__.py:
--------------------------------------------------------------------------------
1 | from .iclight import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
2 | __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
--------------------------------------------------------------------------------
/examples/workflow-gaffer-iclight-fbc.json:
--------------------------------------------------------------------------------
1 | {
2 | "last_node_id": 88,
3 | "last_link_id": 226,
4 | "nodes": [
5 | {
6 | "id": 28,
7 | "type": "ImageResize+",
8 | "pos": [
9 | -266.61503629140856,
10 | 966.8616135979687
11 | ],
12 | "size": {
13 | "0": 315,
14 | "1": 218
15 | },
16 | "flags": {},
17 | "order": 8,
18 | "mode": 0,
19 | "inputs": [
20 | {
21 | "name": "image",
22 | "type": "IMAGE",
23 | "link": 123
24 | }
25 | ],
26 | "outputs": [
27 | {
28 | "name": "IMAGE",
29 | "type": "IMAGE",
30 | "links": [
31 | 158
32 | ],
33 | "shape": 3,
34 | "slot_index": 0
35 | },
36 | {
37 | "name": "width",
38 | "type": "INT",
39 | "links": [],
40 | "shape": 3,
41 | "slot_index": 1
42 | },
43 | {
44 | "name": "height",
45 | "type": "INT",
46 | "links": [],
47 | "shape": 3,
48 | "slot_index": 2
49 | }
50 | ],
51 | "properties": {
52 | "Node name for S&R": "ImageResize+"
53 | },
54 | "widgets_values": [
55 | 512,
56 | 0,
57 | "nearest",
58 | true,
59 | "always",
60 | 8
61 | ]
62 | },
63 | {
64 | "id": 40,
65 | "type": "CLIPTextEncode",
66 | "pos": [
67 | 163.72314324655804,
68 | 457.7209877334219
69 | ],
70 | "size": {
71 | "0": 400,
72 | "1": 200
73 | },
74 | "flags": {},
75 | "order": 7,
76 | "mode": 0,
77 | "inputs": [
78 | {
79 | "name": "clip",
80 | "type": "CLIP",
81 | "link": 68
82 | }
83 | ],
84 | "outputs": [
85 | {
86 | "name": "CONDITIONING",
87 | "type": "CONDITIONING",
88 | "links": [
89 | 175
90 | ],
91 | "shape": 3,
92 | "slot_index": 0
93 | }
94 | ],
95 | "properties": {
96 | "Node name for S&R": "CLIPTextEncode"
97 | },
98 | "widgets_values": [
99 | "lowres, bad anatomy, bad hands, cropped, worst quality"
100 | ]
101 | },
102 | {
103 | "id": 68,
104 | "type": "PreviewImage",
105 | "pos": [
106 | 223.38496370859218,
107 | 1196.8616135979687
108 | ],
109 | "size": {
110 | "0": 210,
111 | "1": 246
112 | },
113 | "flags": {},
114 | "order": 11,
115 | "mode": 0,
116 | "inputs": [
117 | {
118 | "name": "images",
119 | "type": "IMAGE",
120 | "link": 225
121 | }
122 | ],
123 | "properties": {
124 | "Node name for S&R": "PreviewImage"
125 | }
126 | },
127 | {
128 | "id": 74,
129 | "type": "ICLightModelLoader",
130 | "pos": [
131 | 880,
132 | 770
133 | ],
134 | "size": {
135 | "0": 320,
136 | "1": 60
137 | },
138 | "flags": {},
139 | "order": 0,
140 | "mode": 0,
141 | "outputs": [
142 | {
143 | "name": "iclight",
144 | "type": "ICLIGHT",
145 | "links": [
146 | 173
147 | ],
148 | "shape": 3,
149 | "slot_index": 0
150 | }
151 | ],
152 | "properties": {
153 | "Node name for S&R": "ICLightModelLoader"
154 | },
155 | "widgets_values": [
156 | "iclight_sd15_fbc.safetensors"
157 | ],
158 | "color": "#432",
159 | "bgcolor": "#653"
160 | },
161 | {
162 | "id": 77,
163 | "type": "KSampler",
164 | "pos": [
165 | 1276,
166 | 896
167 | ],
168 | "size": {
169 | "0": 320,
170 | "1": 474
171 | },
172 | "flags": {},
173 | "order": 13,
174 | "mode": 0,
175 | "inputs": [
176 | {
177 | "name": "model",
178 | "type": "MODEL",
179 | "link": 185
180 | },
181 | {
182 | "name": "positive",
183 | "type": "CONDITIONING",
184 | "link": 186
185 | },
186 | {
187 | "name": "negative",
188 | "type": "CONDITIONING",
189 | "link": 187
190 | },
191 | {
192 | "name": "latent_image",
193 | "type": "LATENT",
194 | "link": 216
195 | }
196 | ],
197 | "outputs": [
198 | {
199 | "name": "LATENT",
200 | "type": "LATENT",
201 | "links": [
202 | 189
203 | ],
204 | "shape": 3,
205 | "slot_index": 0
206 | }
207 | ],
208 | "properties": {
209 | "Node name for S&R": "KSampler"
210 | },
211 | "widgets_values": [
212 | 995253983530172,
213 | "fixed",
214 | 20,
215 | 2,
216 | "euler_ancestral",
217 | "normal",
218 | 1
219 | ]
220 | },
221 | {
222 | "id": 6,
223 | "type": "CheckpointLoaderSimple",
224 | "pos": [
225 | 248.72314324655804,
226 | 16
227 | ],
228 | "size": {
229 | "0": 315,
230 | "1": 98
231 | },
232 | "flags": {},
233 | "order": 1,
234 | "mode": 0,
235 | "outputs": [
236 | {
237 | "name": "MODEL",
238 | "type": "MODEL",
239 | "links": [
240 | 219
241 | ],
242 | "shape": 3,
243 | "slot_index": 0
244 | },
245 | {
246 | "name": "CLIP",
247 | "type": "CLIP",
248 | "links": [
249 | 67,
250 | 68
251 | ],
252 | "shape": 3,
253 | "slot_index": 1
254 | },
255 | {
256 | "name": "VAE",
257 | "type": "VAE",
258 | "links": [
259 | 218,
260 | 220
261 | ],
262 | "shape": 3,
263 | "slot_index": 2
264 | }
265 | ],
266 | "properties": {
267 | "Node name for S&R": "CheckpointLoaderSimple"
268 | },
269 | "widgets_values": [
270 | "sd15\\photon_v1.safetensors"
271 | ]
272 | },
273 | {
274 | "id": 78,
275 | "type": "VAEDecode",
276 | "pos": [
277 | 1666,
278 | 639
279 | ],
280 | "size": {
281 | "0": 210,
282 | "1": 46
283 | },
284 | "flags": {},
285 | "order": 14,
286 | "mode": 0,
287 | "inputs": [
288 | {
289 | "name": "samples",
290 | "type": "LATENT",
291 | "link": 189
292 | },
293 | {
294 | "name": "vae",
295 | "type": "VAE",
296 | "link": 220,
297 | "slot_index": 1
298 | }
299 | ],
300 | "outputs": [
301 | {
302 | "name": "IMAGE",
303 | "type": "IMAGE",
304 | "links": [
305 | 191
306 | ],
307 | "shape": 3,
308 | "slot_index": 0
309 | }
310 | ],
311 | "properties": {
312 | "Node name for S&R": "VAEDecode"
313 | }
314 | },
315 | {
316 | "id": 79,
317 | "type": "PreviewImage",
318 | "pos": [
319 | 1675,
320 | 890
321 | ],
322 | "size": {
323 | "0": 451.9798889160156,
324 | "1": 489.39794921875
325 | },
326 | "flags": {},
327 | "order": 15,
328 | "mode": 0,
329 | "inputs": [
330 | {
331 | "name": "images",
332 | "type": "IMAGE",
333 | "link": 191
334 | }
335 | ],
336 | "properties": {
337 | "Node name for S&R": "PreviewImage"
338 | }
339 | },
340 | {
341 | "id": 39,
342 | "type": "CLIPTextEncode",
343 | "pos": [
344 | 163.72314324655804,
345 | 198
346 | ],
347 | "size": {
348 | "0": 400,
349 | "1": 200
350 | },
351 | "flags": {},
352 | "order": 6,
353 | "mode": 0,
354 | "inputs": [
355 | {
356 | "name": "clip",
357 | "type": "CLIP",
358 | "link": 67
359 | }
360 | ],
361 | "outputs": [
362 | {
363 | "name": "CONDITIONING",
364 | "type": "CONDITIONING",
365 | "links": [
366 | 174
367 | ],
368 | "shape": 3,
369 | "slot_index": 0
370 | }
371 | ],
372 | "properties": {
373 | "Node name for S&R": "CLIPTextEncode"
374 | },
375 | "widgets_values": [
376 | "beautiful woman, sunshine"
377 | ]
378 | },
379 | {
380 | "id": 87,
381 | "type": "Note",
382 | "pos": [
383 | -753,
384 | 28
385 | ],
386 | "size": {
387 | "0": 884.5147094726562,
388 | "1": 616.7295532226562
389 | },
390 | "flags": {},
391 | "order": 2,
392 | "mode": 0,
393 | "properties": {
394 | "text": ""
395 | },
396 | "widgets_values": [
397 | "beautiful woman, cinematic lighting\n\n\nstatue of an angel, natural lighting\n\n\nbeautiful woman, cinematic lighting\n\n\nhandsome man, cinematic lighting"
398 | ],
399 | "color": "#432",
400 | "bgcolor": "#653"
401 | },
402 | {
403 | "id": 64,
404 | "type": "ImageRemoveBackground+",
405 | "pos": [
406 | 133.3849637085923,
407 | 906.8616135979687
408 | ],
409 | "size": {
410 | "0": 241.79998779296875,
411 | "1": 46
412 | },
413 | "flags": {},
414 | "order": 9,
415 | "mode": 0,
416 | "inputs": [
417 | {
418 | "name": "rembg_session",
419 | "type": "REMBG_SESSION",
420 | "link": 157,
421 | "slot_index": 0
422 | },
423 | {
424 | "name": "image",
425 | "type": "IMAGE",
426 | "link": 158
427 | }
428 | ],
429 | "outputs": [
430 | {
431 | "name": "IMAGE",
432 | "type": "IMAGE",
433 | "links": [
434 | 223
435 | ],
436 | "shape": 3,
437 | "slot_index": 0
438 | },
439 | {
440 | "name": "MASK",
441 | "type": "MASK",
442 | "links": [
443 | 224
444 | ],
445 | "shape": 3,
446 | "slot_index": 1
447 | }
448 | ],
449 | "properties": {
450 | "Node name for S&R": "ImageRemoveBackground+"
451 | }
452 | },
453 | {
454 | "id": 88,
455 | "type": "GrayScaler",
456 | "pos": [
457 | 164,
458 | 1023
459 | ],
460 | "size": {
461 | "0": 210,
462 | "1": 46
463 | },
464 | "flags": {},
465 | "order": 10,
466 | "mode": 0,
467 | "inputs": [
468 | {
469 | "name": "image",
470 | "type": "IMAGE",
471 | "link": 223
472 | },
473 | {
474 | "name": "mask",
475 | "type": "MASK",
476 | "link": 224
477 | }
478 | ],
479 | "outputs": [
480 | {
481 | "name": "IMAGE",
482 | "type": "IMAGE",
483 | "links": [
484 | 225,
485 | 226
486 | ],
487 | "shape": 3,
488 | "slot_index": 0
489 | }
490 | ],
491 | "properties": {
492 | "Node name for S&R": "GrayScaler"
493 | }
494 | },
495 | {
496 | "id": 9,
497 | "type": "LoadImage",
498 | "pos": [
499 | -676.615036291409,
500 | 836.8616135979687
501 | ],
502 | "size": {
503 | "0": 315,
504 | "1": 314.0000305175781
505 | },
506 | "flags": {},
507 | "order": 3,
508 | "mode": 0,
509 | "outputs": [
510 | {
511 | "name": "IMAGE",
512 | "type": "IMAGE",
513 | "links": [
514 | 123
515 | ],
516 | "shape": 3,
517 | "slot_index": 0
518 | },
519 | {
520 | "name": "MASK",
521 | "type": "MASK",
522 | "links": null,
523 | "shape": 3
524 | }
525 | ],
526 | "properties": {
527 | "Node name for S&R": "LoadImage"
528 | },
529 | "widgets_values": [
530 | "i4 (2).png",
531 | "image"
532 | ]
533 | },
534 | {
535 | "id": 65,
536 | "type": "RemBGSession+",
537 | "pos": [
538 | -266.61503629140856,
539 | 836.8616135979687
540 | ],
541 | "size": {
542 | "0": 315,
543 | "1": 82
544 | },
545 | "flags": {},
546 | "order": 4,
547 | "mode": 0,
548 | "outputs": [
549 | {
550 | "name": "REMBG_SESSION",
551 | "type": "REMBG_SESSION",
552 | "links": [
553 | 157
554 | ],
555 | "shape": 3
556 | }
557 | ],
558 | "properties": {
559 | "Node name for S&R": "RemBGSession+"
560 | },
561 | "widgets_values": [
562 | "u2net_human_seg: human segmentation",
563 | "CPU"
564 | ]
565 | },
566 | {
567 | "id": 69,
568 | "type": "LoadImage",
569 | "pos": [
570 | 229,
571 | 1573
572 | ],
573 | "size": {
574 | "0": 315,
575 | "1": 314
576 | },
577 | "flags": {},
578 | "order": 5,
579 | "mode": 0,
580 | "outputs": [
581 | {
582 | "name": "IMAGE",
583 | "type": "IMAGE",
584 | "links": [
585 | 221
586 | ],
587 | "shape": 3,
588 | "slot_index": 0
589 | },
590 | {
591 | "name": "MASK",
592 | "type": "MASK",
593 | "links": null,
594 | "shape": 3
595 | }
596 | ],
597 | "title": "Background",
598 | "properties": {
599 | "Node name for S&R": "LoadImage"
600 | },
601 | "widgets_values": [
602 | "1 (2).webp",
603 | "image"
604 | ]
605 | },
606 | {
607 | "id": 75,
608 | "type": "ApplyICLight",
609 | "pos": [
610 | 876,
611 | 896
612 | ],
613 | "size": {
614 | "0": 320,
615 | "1": 180
616 | },
617 | "flags": {},
618 | "order": 12,
619 | "mode": 0,
620 | "inputs": [
621 | {
622 | "name": "model",
623 | "type": "MODEL",
624 | "link": 219
625 | },
626 | {
627 | "name": "vae",
628 | "type": "VAE",
629 | "link": 218
630 | },
631 | {
632 | "name": "iclight",
633 | "type": "ICLIGHT",
634 | "link": 173
635 | },
636 | {
637 | "name": "positive",
638 | "type": "CONDITIONING",
639 | "link": 174
640 | },
641 | {
642 | "name": "negative",
643 | "type": "CONDITIONING",
644 | "link": 175
645 | },
646 | {
647 | "name": "fg_pixels",
648 | "type": "IMAGE",
649 | "link": 226
650 | },
651 | {
652 | "name": "bg_pixels",
653 | "type": "IMAGE",
654 | "link": 221
655 | }
656 | ],
657 | "outputs": [
658 | {
659 | "name": "model",
660 | "type": "MODEL",
661 | "links": [
662 | 185
663 | ],
664 | "shape": 3,
665 | "slot_index": 0
666 | },
667 | {
668 | "name": "positive",
669 | "type": "CONDITIONING",
670 | "links": [
671 | 186
672 | ],
673 | "shape": 3,
674 | "slot_index": 1
675 | },
676 | {
677 | "name": "negative",
678 | "type": "CONDITIONING",
679 | "links": [
680 | 187
681 | ],
682 | "shape": 3,
683 | "slot_index": 2
684 | },
685 | {
686 | "name": "empty_latent",
687 | "type": "LATENT",
688 | "links": [
689 | 216
690 | ],
691 | "shape": 3,
692 | "slot_index": 3
693 | }
694 | ],
695 | "properties": {
696 | "Node name for S&R": "ApplyICLight"
697 | },
698 | "widgets_values": [
699 | 1.2
700 | ],
701 | "color": "#432",
702 | "bgcolor": "#653"
703 | }
704 | ],
705 | "links": [
706 | [
707 | 67,
708 | 6,
709 | 1,
710 | 39,
711 | 0,
712 | "CLIP"
713 | ],
714 | [
715 | 68,
716 | 6,
717 | 1,
718 | 40,
719 | 0,
720 | "CLIP"
721 | ],
722 | [
723 | 123,
724 | 9,
725 | 0,
726 | 28,
727 | 0,
728 | "IMAGE"
729 | ],
730 | [
731 | 157,
732 | 65,
733 | 0,
734 | 64,
735 | 0,
736 | "REMBG_SESSION"
737 | ],
738 | [
739 | 158,
740 | 28,
741 | 0,
742 | 64,
743 | 1,
744 | "IMAGE"
745 | ],
746 | [
747 | 173,
748 | 74,
749 | 0,
750 | 75,
751 | 2,
752 | "ICLIGHT"
753 | ],
754 | [
755 | 174,
756 | 39,
757 | 0,
758 | 75,
759 | 3,
760 | "CONDITIONING"
761 | ],
762 | [
763 | 175,
764 | 40,
765 | 0,
766 | 75,
767 | 4,
768 | "CONDITIONING"
769 | ],
770 | [
771 | 185,
772 | 75,
773 | 0,
774 | 77,
775 | 0,
776 | "MODEL"
777 | ],
778 | [
779 | 186,
780 | 75,
781 | 1,
782 | 77,
783 | 1,
784 | "CONDITIONING"
785 | ],
786 | [
787 | 187,
788 | 75,
789 | 2,
790 | 77,
791 | 2,
792 | "CONDITIONING"
793 | ],
794 | [
795 | 189,
796 | 77,
797 | 0,
798 | 78,
799 | 0,
800 | "LATENT"
801 | ],
802 | [
803 | 191,
804 | 78,
805 | 0,
806 | 79,
807 | 0,
808 | "IMAGE"
809 | ],
810 | [
811 | 216,
812 | 75,
813 | 3,
814 | 77,
815 | 3,
816 | "LATENT"
817 | ],
818 | [
819 | 218,
820 | 6,
821 | 2,
822 | 75,
823 | 1,
824 | "VAE"
825 | ],
826 | [
827 | 219,
828 | 6,
829 | 0,
830 | 75,
831 | 0,
832 | "MODEL"
833 | ],
834 | [
835 | 220,
836 | 6,
837 | 2,
838 | 78,
839 | 1,
840 | "VAE"
841 | ],
842 | [
843 | 221,
844 | 69,
845 | 0,
846 | 75,
847 | 6,
848 | "IMAGE"
849 | ],
850 | [
851 | 223,
852 | 64,
853 | 0,
854 | 88,
855 | 0,
856 | "IMAGE"
857 | ],
858 | [
859 | 224,
860 | 64,
861 | 1,
862 | 88,
863 | 1,
864 | "MASK"
865 | ],
866 | [
867 | 225,
868 | 88,
869 | 0,
870 | 68,
871 | 0,
872 | "IMAGE"
873 | ],
874 | [
875 | 226,
876 | 88,
877 | 0,
878 | 75,
879 | 5,
880 | "IMAGE"
881 | ]
882 | ],
883 | "groups": [
884 | {
885 | "title": "foreground",
886 | "bounding": [
887 | -753,
888 | 714,
889 | 1321,
890 | 791
891 | ],
892 | "color": "#3f789e",
893 | "font_size": 24,
894 | "locked": false
895 | }
896 | ],
897 | "config": {},
898 | "extra": {
899 | "ds": {
900 | "scale": 0.5209868481924383,
901 | "offset": {
902 | "0": 1352.427175693394,
903 | "1": 409.3948869517454
904 | }
905 | }
906 | },
907 | "version": 0.4
908 | }
--------------------------------------------------------------------------------
/examples/workflow-gaffer-iclight-fc-animated.json:
--------------------------------------------------------------------------------
1 | {
2 | "last_node_id": 104,
3 | "last_link_id": 259,
4 | "nodes": [
5 | {
6 | "id": 37,
7 | "type": "ICLightModelLoader",
8 | "pos": [
9 | 770.9998793615997,
10 | 1022.1874924601
11 | ],
12 | "size": {
13 | "0": 315,
14 | "1": 58
15 | },
16 | "flags": {},
17 | "order": 0,
18 | "mode": 0,
19 | "outputs": [
20 | {
21 | "name": "iclight",
22 | "type": "ICLIGHT",
23 | "links": [
24 | 150
25 | ],
26 | "shape": 3,
27 | "slot_index": 0
28 | }
29 | ],
30 | "properties": {
31 | "Node name for S&R": "ICLightModelLoader"
32 | },
33 | "widgets_values": [
34 | "iclight_sd15_fc.safetensors"
35 | ],
36 | "color": "#432",
37 | "bgcolor": "#653"
38 | },
39 | {
40 | "id": 84,
41 | "type": "Reroute",
42 | "pos": [
43 | 440,
44 | 620
45 | ],
46 | "size": [
47 | 75,
48 | 26
49 | ],
50 | "flags": {},
51 | "order": 8,
52 | "mode": 0,
53 | "inputs": [
54 | {
55 | "name": "",
56 | "type": "*",
57 | "link": 205
58 | }
59 | ],
60 | "outputs": [
61 | {
62 | "name": "",
63 | "type": "VAE",
64 | "links": [
65 | 206,
66 | 207,
67 | 210
68 | ],
69 | "slot_index": 0
70 | }
71 | ],
72 | "properties": {
73 | "showOutputText": false,
74 | "horizontal": false
75 | }
76 | },
77 | {
78 | "id": 40,
79 | "type": "CLIPTextEncode",
80 | "pos": [
81 | 110,
82 | 310
83 | ],
84 | "size": {
85 | "0": 400,
86 | "1": 200
87 | },
88 | "flags": {},
89 | "order": 7,
90 | "mode": 0,
91 | "inputs": [
92 | {
93 | "name": "clip",
94 | "type": "CLIP",
95 | "link": 68
96 | }
97 | ],
98 | "outputs": [
99 | {
100 | "name": "CONDITIONING",
101 | "type": "CONDITIONING",
102 | "links": [
103 | 147
104 | ],
105 | "shape": 3,
106 | "slot_index": 0
107 | }
108 | ],
109 | "properties": {
110 | "Node name for S&R": "CLIPTextEncode"
111 | },
112 | "widgets_values": [
113 | "lowres, bad anatomy, bad hands, cropped, worst quality"
114 | ]
115 | },
116 | {
117 | "id": 85,
118 | "type": "Reroute",
119 | "pos": [
120 | 1405,
121 | 620
122 | ],
123 | "size": [
124 | 75,
125 | 26
126 | ],
127 | "flags": {},
128 | "order": 11,
129 | "mode": 0,
130 | "inputs": [
131 | {
132 | "name": "",
133 | "type": "*",
134 | "link": 210
135 | }
136 | ],
137 | "outputs": [
138 | {
139 | "name": "",
140 | "type": "VAE",
141 | "links": [
142 | 211
143 | ],
144 | "slot_index": 0
145 | }
146 | ],
147 | "properties": {
148 | "showOutputText": false,
149 | "horizontal": false
150 | }
151 | },
152 | {
153 | "id": 36,
154 | "type": "VAEDecode",
155 | "pos": [
156 | 1620.9998793615996,
157 | 1142.1874924601
158 | ],
159 | "size": {
160 | "0": 210,
161 | "1": 46
162 | },
163 | "flags": {},
164 | "order": 23,
165 | "mode": 0,
166 | "inputs": [
167 | {
168 | "name": "samples",
169 | "type": "LATENT",
170 | "link": 237
171 | },
172 | {
173 | "name": "vae",
174 | "type": "VAE",
175 | "link": 211,
176 | "slot_index": 1
177 | }
178 | ],
179 | "outputs": [
180 | {
181 | "name": "IMAGE",
182 | "type": "IMAGE",
183 | "links": [
184 | 229
185 | ],
186 | "shape": 3,
187 | "slot_index": 0
188 | }
189 | ],
190 | "properties": {
191 | "Node name for S&R": "VAEDecode"
192 | }
193 | },
194 | {
195 | "id": 94,
196 | "type": "PreviewAnimation",
197 | "pos": [
198 | 174,
199 | 1631
200 | ],
201 | "size": [
202 | 320.85303331636123,
203 | 390.8810667803227
204 | ],
205 | "flags": {},
206 | "order": 19,
207 | "mode": 0,
208 | "inputs": [
209 | {
210 | "name": "images",
211 | "type": "IMAGE",
212 | "link": 227
213 | },
214 | {
215 | "name": "masks",
216 | "type": "MASK",
217 | "link": null
218 | }
219 | ],
220 | "title": "Preview Animation 32x512x512",
221 | "properties": {
222 | "Node name for S&R": "PreviewAnimation"
223 | },
224 | "widgets_values": [
225 | 8,
226 | null
227 | ]
228 | },
229 | {
230 | "id": 98,
231 | "type": "KSamplerSelect",
232 | "pos": [
233 | 770.9998793615997,
234 | 1382.1874924601
235 | ],
236 | "size": {
237 | "0": 315,
238 | "1": 58
239 | },
240 | "flags": {},
241 | "order": 1,
242 | "mode": 0,
243 | "outputs": [
244 | {
245 | "name": "SAMPLER",
246 | "type": "SAMPLER",
247 | "links": [
248 | 241
249 | ],
250 | "shape": 3
251 | }
252 | ],
253 | "properties": {
254 | "Node name for S&R": "KSamplerSelect"
255 | },
256 | "widgets_values": [
257 | "dpmpp_2m"
258 | ]
259 | },
260 | {
261 | "id": 6,
262 | "type": "CheckpointLoaderSimple",
263 | "pos": [
264 | -639,
265 | 242
266 | ],
267 | "size": {
268 | "0": 315,
269 | "1": 98
270 | },
271 | "flags": {},
272 | "order": 2,
273 | "mode": 0,
274 | "outputs": [
275 | {
276 | "name": "MODEL",
277 | "type": "MODEL",
278 | "links": [
279 | 243
280 | ],
281 | "shape": 3,
282 | "slot_index": 0
283 | },
284 | {
285 | "name": "CLIP",
286 | "type": "CLIP",
287 | "links": [
288 | 67,
289 | 68
290 | ],
291 | "shape": 3,
292 | "slot_index": 1
293 | },
294 | {
295 | "name": "VAE",
296 | "type": "VAE",
297 | "links": [
298 | 205
299 | ],
300 | "shape": 3,
301 | "slot_index": 2
302 | }
303 | ],
304 | "properties": {
305 | "Node name for S&R": "CheckpointLoaderSimple"
306 | },
307 | "widgets_values": [
308 | "sd15\\photon_v1.safetensors"
309 | ]
310 | },
311 | {
312 | "id": 102,
313 | "type": "ADE_BatchedContextOptions",
314 | "pos": [
315 | -450,
316 | -78
317 | ],
318 | "size": {
319 | "0": 317.4000244140625,
320 | "1": 106
321 | },
322 | "flags": {},
323 | "order": 3,
324 | "mode": 0,
325 | "inputs": [
326 | {
327 | "name": "prev_context",
328 | "type": "CONTEXT_OPTIONS",
329 | "link": null
330 | }
331 | ],
332 | "outputs": [
333 | {
334 | "name": "CONTEXT_OPTS",
335 | "type": "CONTEXT_OPTIONS",
336 | "links": [
337 | 246
338 | ],
339 | "shape": 3
340 | }
341 | ],
342 | "properties": {
343 | "Node name for S&R": "ADE_BatchedContextOptions"
344 | },
345 | "widgets_values": [
346 | 16,
347 | 0,
348 | 1
349 | ]
350 | },
351 | {
352 | "id": 100,
353 | "type": "ADE_UseEvolvedSampling",
354 | "pos": [
355 | 192,
356 | -117
357 | ],
358 | "size": {
359 | "0": 315,
360 | "1": 118
361 | },
362 | "flags": {},
363 | "order": 9,
364 | "mode": 0,
365 | "inputs": [
366 | {
367 | "name": "model",
368 | "type": "MODEL",
369 | "link": 243
370 | },
371 | {
372 | "name": "m_models",
373 | "type": "M_MODELS",
374 | "link": null
375 | },
376 | {
377 | "name": "context_options",
378 | "type": "CONTEXT_OPTIONS",
379 | "link": 246,
380 | "slot_index": 2
381 | },
382 | {
383 | "name": "sample_settings",
384 | "type": "SAMPLE_SETTINGS",
385 | "link": null
386 | }
387 | ],
388 | "outputs": [
389 | {
390 | "name": "MODEL",
391 | "type": "MODEL",
392 | "links": [
393 | 244
394 | ],
395 | "shape": 3,
396 | "slot_index": 0
397 | }
398 | ],
399 | "properties": {
400 | "Node name for S&R": "ADE_UseEvolvedSampling"
401 | },
402 | "widgets_values": [
403 | "autoselect"
404 | ]
405 | },
406 | {
407 | "id": 99,
408 | "type": "AlignYourStepsScheduler",
409 | "pos": [
410 | 760.9998793615997,
411 | 1502.1874924601
412 | ],
413 | "size": {
414 | "0": 315,
415 | "1": 106
416 | },
417 | "flags": {},
418 | "order": 4,
419 | "mode": 0,
420 | "outputs": [
421 | {
422 | "name": "SIGMAS",
423 | "type": "SIGMAS",
424 | "links": [
425 | 242
426 | ],
427 | "shape": 3,
428 | "slot_index": 0
429 | }
430 | ],
431 | "properties": {
432 | "Node name for S&R": "AlignYourStepsScheduler"
433 | },
434 | "widgets_values": [
435 | "SD1",
436 | 25,
437 | 1
438 | ]
439 | },
440 | {
441 | "id": 96,
442 | "type": "LatentBatchSeedBehavior",
443 | "pos": [
444 | 770.9998793615997,
445 | 1662.1874924601
446 | ],
447 | "size": {
448 | "0": 315,
449 | "1": 58
450 | },
451 | "flags": {},
452 | "order": 21,
453 | "mode": 0,
454 | "inputs": [
455 | {
456 | "name": "samples",
457 | "type": "LATENT",
458 | "link": 234
459 | }
460 | ],
461 | "outputs": [
462 | {
463 | "name": "LATENT",
464 | "type": "LATENT",
465 | "links": [
466 | 236
467 | ],
468 | "shape": 3,
469 | "slot_index": 0
470 | }
471 | ],
472 | "properties": {
473 | "Node name for S&R": "LatentBatchSeedBehavior"
474 | },
475 | "widgets_values": [
476 | "fixed"
477 | ]
478 | },
479 | {
480 | "id": 25,
481 | "type": "VAEEncode",
482 | "pos": [
483 | 769.9998793615997,
484 | 1796.1874924601
485 | ],
486 | "size": {
487 | "0": 266.0477294921875,
488 | "1": 46.57838821411133
489 | },
490 | "flags": {},
491 | "order": 20,
492 | "mode": 0,
493 | "inputs": [
494 | {
495 | "name": "pixels",
496 | "type": "IMAGE",
497 | "link": 228,
498 | "slot_index": 0
499 | },
500 | {
501 | "name": "vae",
502 | "type": "VAE",
503 | "link": 207,
504 | "slot_index": 1
505 | }
506 | ],
507 | "outputs": [
508 | {
509 | "name": "LATENT",
510 | "type": "LATENT",
511 | "links": [
512 | 234
513 | ],
514 | "shape": 3,
515 | "slot_index": 0
516 | }
517 | ],
518 | "properties": {
519 | "Node name for S&R": "VAEEncode"
520 | }
521 | },
522 | {
523 | "id": 97,
524 | "type": "SamplerCustom",
525 | "pos": [
526 | 1150.9998793615996,
527 | 1142.1874924601
528 | ],
529 | "size": [
530 | 360,
531 | 442.00000762939453
532 | ],
533 | "flags": {},
534 | "order": 22,
535 | "mode": 0,
536 | "inputs": [
537 | {
538 | "name": "model",
539 | "type": "MODEL",
540 | "link": 259
541 | },
542 | {
543 | "name": "positive",
544 | "type": "CONDITIONING",
545 | "link": 238
546 | },
547 | {
548 | "name": "negative",
549 | "type": "CONDITIONING",
550 | "link": 239
551 | },
552 | {
553 | "name": "sampler",
554 | "type": "SAMPLER",
555 | "link": 241,
556 | "slot_index": 3
557 | },
558 | {
559 | "name": "sigmas",
560 | "type": "SIGMAS",
561 | "link": 242,
562 | "slot_index": 4
563 | },
564 | {
565 | "name": "latent_image",
566 | "type": "LATENT",
567 | "link": 236
568 | }
569 | ],
570 | "outputs": [
571 | {
572 | "name": "output",
573 | "type": "LATENT",
574 | "links": [
575 | 237
576 | ],
577 | "shape": 3,
578 | "slot_index": 0
579 | },
580 | {
581 | "name": "denoised_output",
582 | "type": "LATENT",
583 | "links": null,
584 | "shape": 3
585 | }
586 | ],
587 | "properties": {
588 | "Node name for S&R": "SamplerCustom"
589 | },
590 | "widgets_values": [
591 | true,
592 | 954578819684788,
593 | "fixed",
594 | 2
595 | ]
596 | },
597 | {
598 | "id": 103,
599 | "type": "PreviewImage",
600 | "pos": [
601 | 199,
602 | 980
603 | ],
604 | "size": [
605 | 210,
606 | 246
607 | ],
608 | "flags": {},
609 | "order": 13,
610 | "mode": 0,
611 | "inputs": [
612 | {
613 | "name": "images",
614 | "type": "IMAGE",
615 | "link": 255
616 | }
617 | ],
618 | "properties": {
619 | "Node name for S&R": "PreviewImage"
620 | }
621 | },
622 | {
623 | "id": 39,
624 | "type": "CLIPTextEncode",
625 | "pos": [
626 | 110,
627 | 60
628 | ],
629 | "size": {
630 | "0": 400,
631 | "1": 200
632 | },
633 | "flags": {},
634 | "order": 6,
635 | "mode": 0,
636 | "inputs": [
637 | {
638 | "name": "clip",
639 | "type": "CLIP",
640 | "link": 67
641 | }
642 | ],
643 | "outputs": [
644 | {
645 | "name": "CONDITIONING",
646 | "type": "CONDITIONING",
647 | "links": [
648 | 148
649 | ],
650 | "shape": 3,
651 | "slot_index": 0
652 | }
653 | ],
654 | "properties": {
655 | "Node name for S&R": "CLIPTextEncode"
656 | },
657 | "widgets_values": [
658 | "beautiful woman, detailed face\nbest quality"
659 | ]
660 | },
661 | {
662 | "id": 28,
663 | "type": "ImageResize+",
664 | "pos": [
665 | -216,
666 | 977
667 | ],
668 | "size": {
669 | "0": 315,
670 | "1": 218
671 | },
672 | "flags": {},
673 | "order": 10,
674 | "mode": 0,
675 | "inputs": [
676 | {
677 | "name": "image",
678 | "type": "IMAGE",
679 | "link": 123
680 | }
681 | ],
682 | "outputs": [
683 | {
684 | "name": "IMAGE",
685 | "type": "IMAGE",
686 | "links": [
687 | 254,
688 | 255
689 | ],
690 | "shape": 3,
691 | "slot_index": 0
692 | },
693 | {
694 | "name": "width",
695 | "type": "INT",
696 | "links": [
697 | 232,
698 | 251
699 | ],
700 | "shape": 3,
701 | "slot_index": 1
702 | },
703 | {
704 | "name": "height",
705 | "type": "INT",
706 | "links": [
707 | 233,
708 | 250
709 | ],
710 | "shape": 3,
711 | "slot_index": 2
712 | }
713 | ],
714 | "properties": {
715 | "Node name for S&R": "ImageResize+"
716 | },
717 | "widgets_values": [
718 | 512,
719 | 512,
720 | "lanczos",
721 | false,
722 | "always",
723 | 8
724 | ]
725 | },
726 | {
727 | "id": 88,
728 | "type": "SplineEditor",
729 | "pos": [
730 | -810,
731 | 1637
732 | ],
733 | "size": [
734 | 550,
735 | 920
736 | ],
737 | "flags": {},
738 | "order": 14,
739 | "mode": 0,
740 | "inputs": [
741 | {
742 | "name": "mask_width",
743 | "type": "INT",
744 | "link": 251,
745 | "widget": {
746 | "name": "mask_width"
747 | }
748 | },
749 | {
750 | "name": "mask_height",
751 | "type": "INT",
752 | "link": 250,
753 | "widget": {
754 | "name": "mask_height"
755 | }
756 | }
757 | ],
758 | "outputs": [
759 | {
760 | "name": "mask",
761 | "type": "MASK",
762 | "links": null,
763 | "shape": 3
764 | },
765 | {
766 | "name": "coord_str",
767 | "type": "STRING",
768 | "links": [
769 | 222
770 | ],
771 | "shape": 3
772 | },
773 | {
774 | "name": "float",
775 | "type": "FLOAT",
776 | "links": null,
777 | "shape": 3
778 | },
779 | {
780 | "name": "count",
781 | "type": "INT",
782 | "links": null,
783 | "shape": 3
784 | }
785 | ],
786 | "properties": {
787 | "Node name for S&R": "SplineEditor",
788 | "points": "SplineEditor"
789 | },
790 | "widgets_values": [
791 | "[{\"x\":75.69397,\"y\":412.2905599999999},{\"x\":125.61977999999998,\"y\":115.95671999999999},{\"x\":402.62749999999994,\"y\":165.88252999999997},{\"x\":336.59658999999994,\"y\":426.78514999999993},{\"x\":91.79906999999999,\"y\":392.96443999999997}]",
792 | "[{\"x\":75.6939697265625,\"y\":412.2905578613281},{\"x\":75.34219360351562,\"y\":374.7549133300781},{\"x\":75.72114562988281,\"y\":337.2197570800781},{\"x\":77.02043914794922,\"y\":299.7056884765625},{\"x\":79.5219955444336,\"y\":262.2535095214844},{\"x\":83.68115997314453,\"y\":224.9512176513672},{\"x\":90.31674194335938,\"y\":188.01571655273438},{\"x\":101.1473388671875,\"y\":152.11468505859375},{\"x\":120.60784149169922,\"y\":120.31063842773438},{\"x\":152.09886169433594,\"y\":100.15477752685547},{\"x\":187.67138671875,\"y\":88.41542053222656},{\"x\":224.9127197265625,\"y\":84.17202758789062},{\"x\":262.3355407714844,\"y\":86.50228118896484},{\"x\":298.9200439453125,\"y\":94.73799133300781},{\"x\":333.7683410644531,\"y\":108.58255004882812},{\"x\":365.7750244140625,\"y\":128.0968017578125},{\"x\":393.2309875488281,\"y\":153.58026123046875},{\"x\":413.376953125,\"y\":185.1034393310547},{\"x\":424.10504150390625,\"y\":220.96420288085938},{\"x\":426.0916748046875,\"y\":258.3771667480469},{\"x\":420.75433349609375,\"y\":295.4828796386719},{\"x\":409.2727355957031,\"y\":331.1797180175781},{\"x\":392.3907775878906,\"y\":364.66558837890625},{\"x\":370.4845275878906,\"y\":395.09783935546875},{\"x\":343.6996765136719,\"y\":421.3212890625},{\"x\":310.3534240722656,\"y\":437.5181884765625},{\"x\":272.9679870605469,\"y\":439.5622253417969},{\"x\":235.72119140625,\"y\":435.0826721191406},{\"x\":199.03640747070312,\"y\":427.1634216308594},{\"x\":162.87457275390625,\"y\":417.10662841796875},{\"x\":127.1529541015625,\"y\":405.57867431640625},{\"x\":91.799072265625,\"y\":392.9644470214844}]",
793 | 512,
794 | 512,
795 | 32,
796 | "path",
797 | "cardinal",
798 | 0.5,
799 | 1,
800 | "list",
801 | 0,
802 | 1,
803 | null,
804 | null
805 | ]
806 | },
807 | {
808 | "id": 9,
809 | "type": "LoadImage",
810 | "pos": [
811 | -666.273984554625,
812 | 846.727290024094
813 | ],
814 | "size": [
815 | 315,
816 | 314.00000381469727
817 | ],
818 | "flags": {},
819 | "order": 5,
820 | "mode": 0,
821 | "outputs": [
822 | {
823 | "name": "IMAGE",
824 | "type": "IMAGE",
825 | "links": [
826 | 123
827 | ],
828 | "shape": 3,
829 | "slot_index": 0
830 | },
831 | {
832 | "name": "MASK",
833 | "type": "MASK",
834 | "links": null,
835 | "shape": 3
836 | }
837 | ],
838 | "properties": {
839 | "Node name for S&R": "LoadImage"
840 | },
841 | "widgets_values": [
842 | "640 (13).jpg",
843 | "image"
844 | ]
845 | },
846 | {
847 | "id": 62,
848 | "type": "ApplyICLight",
849 | "pos": [
850 | 770.9998793615997,
851 | 1142.1874924601
852 | ],
853 | "size": {
854 | "0": 315,
855 | "1": 178
856 | },
857 | "flags": {},
858 | "order": 12,
859 | "mode": 0,
860 | "inputs": [
861 | {
862 | "name": "model",
863 | "type": "MODEL",
864 | "link": 244
865 | },
866 | {
867 | "name": "vae",
868 | "type": "VAE",
869 | "link": 206
870 | },
871 | {
872 | "name": "iclight",
873 | "type": "ICLIGHT",
874 | "link": 150
875 | },
876 | {
877 | "name": "positive",
878 | "type": "CONDITIONING",
879 | "link": 148
880 | },
881 | {
882 | "name": "negative",
883 | "type": "CONDITIONING",
884 | "link": 147
885 | },
886 | {
887 | "name": "fg_pixels",
888 | "type": "IMAGE",
889 | "link": 254
890 | },
891 | {
892 | "name": "bg_pixels",
893 | "type": "IMAGE",
894 | "link": null
895 | }
896 | ],
897 | "outputs": [
898 | {
899 | "name": "model",
900 | "type": "MODEL",
901 | "links": [
902 | 259
903 | ],
904 | "shape": 3,
905 | "slot_index": 0
906 | },
907 | {
908 | "name": "positive",
909 | "type": "CONDITIONING",
910 | "links": [
911 | 238
912 | ],
913 | "shape": 3,
914 | "slot_index": 1
915 | },
916 | {
917 | "name": "negative",
918 | "type": "CONDITIONING",
919 | "links": [
920 | 239
921 | ],
922 | "shape": 3,
923 | "slot_index": 2
924 | },
925 | {
926 | "name": "empty_latent",
927 | "type": "LATENT",
928 | "links": null,
929 | "shape": 3
930 | }
931 | ],
932 | "properties": {
933 | "Node name for S&R": "ApplyICLight"
934 | },
935 | "widgets_values": [
936 | 1
937 | ],
938 | "color": "#432",
939 | "bgcolor": "#653"
940 | },
941 | {
942 | "id": 89,
943 | "type": "CreateShapeMaskOnPath",
944 | "pos": [
945 | -189,
946 | 2030
947 | ],
948 | "size": [
949 | 315,
950 | 222
951 | ],
952 | "flags": {},
953 | "order": 15,
954 | "mode": 0,
955 | "inputs": [
956 | {
957 | "name": "coordinates",
958 | "type": "STRING",
959 | "link": 222,
960 | "widget": {
961 | "name": "coordinates"
962 | },
963 | "slot_index": 0
964 | },
965 | {
966 | "name": "size_multiplier",
967 | "type": "FLOAT",
968 | "link": null,
969 | "widget": {
970 | "name": "size_multiplier"
971 | }
972 | },
973 | {
974 | "name": "frame_height",
975 | "type": "INT",
976 | "link": 233,
977 | "widget": {
978 | "name": "frame_height"
979 | }
980 | },
981 | {
982 | "name": "frame_width",
983 | "type": "INT",
984 | "link": 232,
985 | "widget": {
986 | "name": "frame_width"
987 | }
988 | }
989 | ],
990 | "outputs": [
991 | {
992 | "name": "mask",
993 | "type": "MASK",
994 | "links": [
995 | 223
996 | ],
997 | "shape": 3,
998 | "slot_index": 0
999 | },
1000 | {
1001 | "name": "mask_inverted",
1002 | "type": "MASK",
1003 | "links": null,
1004 | "shape": 3
1005 | }
1006 | ],
1007 | "properties": {
1008 | "Node name for S&R": "CreateShapeMaskOnPath"
1009 | },
1010 | "widgets_values": [
1011 | "circle",
1012 | "",
1013 | 512,
1014 | 512,
1015 | 256,
1016 | 256,
1017 | [
1018 | 1
1019 | ]
1020 | ]
1021 | },
1022 | {
1023 | "id": 90,
1024 | "type": "GrowMaskWithBlur",
1025 | "pos": [
1026 | -182,
1027 | 2315
1028 | ],
1029 | "size": {
1030 | "0": 315,
1031 | "1": 246
1032 | },
1033 | "flags": {},
1034 | "order": 16,
1035 | "mode": 0,
1036 | "inputs": [
1037 | {
1038 | "name": "mask",
1039 | "type": "MASK",
1040 | "link": 223
1041 | }
1042 | ],
1043 | "outputs": [
1044 | {
1045 | "name": "mask",
1046 | "type": "MASK",
1047 | "links": [
1048 | 224,
1049 | 258
1050 | ],
1051 | "shape": 3,
1052 | "slot_index": 0
1053 | },
1054 | {
1055 | "name": "mask_inverted",
1056 | "type": "MASK",
1057 | "links": null,
1058 | "shape": 3
1059 | }
1060 | ],
1061 | "properties": {
1062 | "Node name for S&R": "GrowMaskWithBlur"
1063 | },
1064 | "widgets_values": [
1065 | 0,
1066 | 0,
1067 | true,
1068 | false,
1069 | 58,
1070 | 1,
1071 | 1,
1072 | false
1073 | ]
1074 | },
1075 | {
1076 | "id": 92,
1077 | "type": "MaskToImage",
1078 | "pos": [
1079 | 259,
1080 | 2315
1081 | ],
1082 | "size": {
1083 | "0": 210,
1084 | "1": 26
1085 | },
1086 | "flags": {},
1087 | "order": 18,
1088 | "mode": 0,
1089 | "inputs": [
1090 | {
1091 | "name": "mask",
1092 | "type": "MASK",
1093 | "link": 258
1094 | }
1095 | ],
1096 | "outputs": [
1097 | {
1098 | "name": "IMAGE",
1099 | "type": "IMAGE",
1100 | "links": [
1101 | 227,
1102 | 228
1103 | ],
1104 | "shape": 3,
1105 | "slot_index": 0
1106 | }
1107 | ],
1108 | "properties": {
1109 | "Node name for S&R": "MaskToImage"
1110 | }
1111 | },
1112 | {
1113 | "id": 91,
1114 | "type": "RemapMaskRange",
1115 | "pos": [
1116 | 165,
1117 | 2437
1118 | ],
1119 | "size": {
1120 | "0": 315,
1121 | "1": 82
1122 | },
1123 | "flags": {},
1124 | "order": 17,
1125 | "mode": 0,
1126 | "inputs": [
1127 | {
1128 | "name": "mask",
1129 | "type": "MASK",
1130 | "link": 224
1131 | }
1132 | ],
1133 | "outputs": [
1134 | {
1135 | "name": "mask",
1136 | "type": "MASK",
1137 | "links": [],
1138 | "shape": 3,
1139 | "slot_index": 0
1140 | }
1141 | ],
1142 | "properties": {
1143 | "Node name for S&R": "RemapMaskRange"
1144 | },
1145 | "widgets_values": [
1146 | 0,
1147 | 0.78
1148 | ]
1149 | },
1150 | {
1151 | "id": 95,
1152 | "type": "VHS_VideoCombine",
1153 | "pos": [
1154 | 1636.9998793615996,
1155 | 1265.1874924601
1156 | ],
1157 | "size": [
1158 | 340.69565384430734,
1159 | 552.6956787109375
1160 | ],
1161 | "flags": {},
1162 | "order": 24,
1163 | "mode": 0,
1164 | "inputs": [
1165 | {
1166 | "name": "images",
1167 | "type": "IMAGE",
1168 | "link": 229
1169 | },
1170 | {
1171 | "name": "audio",
1172 | "type": "VHS_AUDIO",
1173 | "link": null
1174 | },
1175 | {
1176 | "name": "meta_batch",
1177 | "type": "VHS_BatchManager",
1178 | "link": null
1179 | }
1180 | ],
1181 | "outputs": [
1182 | {
1183 | "name": "Filenames",
1184 | "type": "VHS_FILENAMES",
1185 | "links": null,
1186 | "shape": 3
1187 | }
1188 | ],
1189 | "properties": {
1190 | "Node name for S&R": "VHS_VideoCombine"
1191 | },
1192 | "widgets_values": {
1193 | "frame_rate": 8,
1194 | "loop_count": 0,
1195 | "filename_prefix": "AnimateDiff",
1196 | "format": "image/gif",
1197 | "pingpong": false,
1198 | "save_output": false,
1199 | "videopreview": {
1200 | "hidden": false,
1201 | "paused": false,
1202 | "params": {
1203 | "filename": "AnimateDiff_00033.gif",
1204 | "subfolder": "",
1205 | "type": "temp",
1206 | "format": "image/gif"
1207 | }
1208 | }
1209 | }
1210 | }
1211 | ],
1212 | "links": [
1213 | [
1214 | 67,
1215 | 6,
1216 | 1,
1217 | 39,
1218 | 0,
1219 | "CLIP"
1220 | ],
1221 | [
1222 | 68,
1223 | 6,
1224 | 1,
1225 | 40,
1226 | 0,
1227 | "CLIP"
1228 | ],
1229 | [
1230 | 123,
1231 | 9,
1232 | 0,
1233 | 28,
1234 | 0,
1235 | "IMAGE"
1236 | ],
1237 | [
1238 | 147,
1239 | 40,
1240 | 0,
1241 | 62,
1242 | 4,
1243 | "CONDITIONING"
1244 | ],
1245 | [
1246 | 148,
1247 | 39,
1248 | 0,
1249 | 62,
1250 | 3,
1251 | "CONDITIONING"
1252 | ],
1253 | [
1254 | 150,
1255 | 37,
1256 | 0,
1257 | 62,
1258 | 2,
1259 | "ICLIGHT"
1260 | ],
1261 | [
1262 | 205,
1263 | 6,
1264 | 2,
1265 | 84,
1266 | 0,
1267 | "*"
1268 | ],
1269 | [
1270 | 206,
1271 | 84,
1272 | 0,
1273 | 62,
1274 | 1,
1275 | "VAE"
1276 | ],
1277 | [
1278 | 207,
1279 | 84,
1280 | 0,
1281 | 25,
1282 | 1,
1283 | "VAE"
1284 | ],
1285 | [
1286 | 210,
1287 | 84,
1288 | 0,
1289 | 85,
1290 | 0,
1291 | "*"
1292 | ],
1293 | [
1294 | 211,
1295 | 85,
1296 | 0,
1297 | 36,
1298 | 1,
1299 | "VAE"
1300 | ],
1301 | [
1302 | 222,
1303 | 88,
1304 | 1,
1305 | 89,
1306 | 0,
1307 | "STRING"
1308 | ],
1309 | [
1310 | 223,
1311 | 89,
1312 | 0,
1313 | 90,
1314 | 0,
1315 | "MASK"
1316 | ],
1317 | [
1318 | 224,
1319 | 90,
1320 | 0,
1321 | 91,
1322 | 0,
1323 | "MASK"
1324 | ],
1325 | [
1326 | 227,
1327 | 92,
1328 | 0,
1329 | 94,
1330 | 0,
1331 | "IMAGE"
1332 | ],
1333 | [
1334 | 228,
1335 | 92,
1336 | 0,
1337 | 25,
1338 | 0,
1339 | "IMAGE"
1340 | ],
1341 | [
1342 | 229,
1343 | 36,
1344 | 0,
1345 | 95,
1346 | 0,
1347 | "IMAGE"
1348 | ],
1349 | [
1350 | 232,
1351 | 28,
1352 | 1,
1353 | 89,
1354 | 3,
1355 | "INT"
1356 | ],
1357 | [
1358 | 233,
1359 | 28,
1360 | 2,
1361 | 89,
1362 | 2,
1363 | "INT"
1364 | ],
1365 | [
1366 | 234,
1367 | 25,
1368 | 0,
1369 | 96,
1370 | 0,
1371 | "LATENT"
1372 | ],
1373 | [
1374 | 236,
1375 | 96,
1376 | 0,
1377 | 97,
1378 | 5,
1379 | "LATENT"
1380 | ],
1381 | [
1382 | 237,
1383 | 97,
1384 | 0,
1385 | 36,
1386 | 0,
1387 | "LATENT"
1388 | ],
1389 | [
1390 | 238,
1391 | 62,
1392 | 1,
1393 | 97,
1394 | 1,
1395 | "CONDITIONING"
1396 | ],
1397 | [
1398 | 239,
1399 | 62,
1400 | 2,
1401 | 97,
1402 | 2,
1403 | "CONDITIONING"
1404 | ],
1405 | [
1406 | 241,
1407 | 98,
1408 | 0,
1409 | 97,
1410 | 3,
1411 | "SAMPLER"
1412 | ],
1413 | [
1414 | 242,
1415 | 99,
1416 | 0,
1417 | 97,
1418 | 4,
1419 | "SIGMAS"
1420 | ],
1421 | [
1422 | 243,
1423 | 6,
1424 | 0,
1425 | 100,
1426 | 0,
1427 | "MODEL"
1428 | ],
1429 | [
1430 | 244,
1431 | 100,
1432 | 0,
1433 | 62,
1434 | 0,
1435 | "MODEL"
1436 | ],
1437 | [
1438 | 246,
1439 | 102,
1440 | 0,
1441 | 100,
1442 | 2,
1443 | "CONTEXT_OPTIONS"
1444 | ],
1445 | [
1446 | 250,
1447 | 28,
1448 | 2,
1449 | 88,
1450 | 1,
1451 | "INT"
1452 | ],
1453 | [
1454 | 251,
1455 | 28,
1456 | 1,
1457 | 88,
1458 | 0,
1459 | "INT"
1460 | ],
1461 | [
1462 | 254,
1463 | 28,
1464 | 0,
1465 | 62,
1466 | 5,
1467 | "IMAGE"
1468 | ],
1469 | [
1470 | 255,
1471 | 28,
1472 | 0,
1473 | 103,
1474 | 0,
1475 | "IMAGE"
1476 | ],
1477 | [
1478 | 258,
1479 | 90,
1480 | 0,
1481 | 92,
1482 | 0,
1483 | "MASK"
1484 | ],
1485 | [
1486 | 259,
1487 | 62,
1488 | 0,
1489 | 97,
1490 | 0,
1491 | "MODEL"
1492 | ]
1493 | ],
1494 | "groups": [
1495 | {
1496 | "title": "Lighting Preference",
1497 | "bounding": [
1498 | -886,
1499 | 1520,
1500 | 1444,
1501 | 1104
1502 | ],
1503 | "color": "#3f789e",
1504 | "font_size": 24,
1505 | "locked": false
1506 | },
1507 | {
1508 | "title": "foreground",
1509 | "bounding": [
1510 | -879,
1511 | 726,
1512 | 1420,
1513 | 757
1514 | ],
1515 | "color": "#3f789e",
1516 | "font_size": 24,
1517 | "locked": false
1518 | },
1519 | {
1520 | "title": "Text-Conditioned Model",
1521 | "bounding": [
1522 | 692,
1523 | 727,
1524 | 1478,
1525 | 1899
1526 | ],
1527 | "color": "#3f789e",
1528 | "font_size": 24,
1529 | "locked": false
1530 | }
1531 | ],
1532 | "config": {},
1533 | "extra": {
1534 | "ds": {
1535 | "scale": 0.28966437973668846,
1536 | "offset": {
1537 | "0": 2559.0302342430914,
1538 | "1": 723.8915012519238
1539 | }
1540 | }
1541 | },
1542 | "version": 0.4
1543 | }
--------------------------------------------------------------------------------
/examples/workflow-gaffer-iclight-fc-normal.json:
--------------------------------------------------------------------------------
1 | {
2 | "last_node_id": 91,
3 | "last_link_id": 222,
4 | "nodes": [
5 | {
6 | "id": 49,
7 | "type": "ImageBatch",
8 | "pos": [
9 | -214.3392714767302,
10 | 1714.0930787287582
11 | ],
12 | "size": {
13 | "0": 210,
14 | "1": 46
15 | },
16 | "flags": {},
17 | "order": 17,
18 | "mode": 0,
19 | "inputs": [
20 | {
21 | "name": "image1",
22 | "type": "IMAGE",
23 | "link": 91
24 | },
25 | {
26 | "name": "image2",
27 | "type": "IMAGE",
28 | "link": 92
29 | }
30 | ],
31 | "outputs": [
32 | {
33 | "name": "IMAGE",
34 | "type": "IMAGE",
35 | "links": [
36 | 95
37 | ],
38 | "shape": 3,
39 | "slot_index": 0
40 | }
41 | ],
42 | "properties": {
43 | "Node name for S&R": "ImageBatch"
44 | }
45 | },
46 | {
47 | "id": 50,
48 | "type": "ImageBatch",
49 | "pos": [
50 | -204.33927147673026,
51 | 2174.0930787287552
52 | ],
53 | "size": {
54 | "0": 210,
55 | "1": 46
56 | },
57 | "flags": {},
58 | "order": 18,
59 | "mode": 0,
60 | "inputs": [
61 | {
62 | "name": "image1",
63 | "type": "IMAGE",
64 | "link": 93
65 | },
66 | {
67 | "name": "image2",
68 | "type": "IMAGE",
69 | "link": 94
70 | }
71 | ],
72 | "outputs": [
73 | {
74 | "name": "IMAGE",
75 | "type": "IMAGE",
76 | "links": [
77 | 96
78 | ],
79 | "shape": 3,
80 | "slot_index": 0
81 | }
82 | ],
83 | "properties": {
84 | "Node name for S&R": "ImageBatch"
85 | }
86 | },
87 | {
88 | "id": 51,
89 | "type": "ImageBatch",
90 | "pos": [
91 | 55.66072852326968,
92 | 1904.0930787287589
93 | ],
94 | "size": {
95 | "0": 210,
96 | "1": 46
97 | },
98 | "flags": {},
99 | "order": 21,
100 | "mode": 0,
101 | "inputs": [
102 | {
103 | "name": "image1",
104 | "type": "IMAGE",
105 | "link": 95
106 | },
107 | {
108 | "name": "image2",
109 | "type": "IMAGE",
110 | "link": 96
111 | }
112 | ],
113 | "outputs": [
114 | {
115 | "name": "IMAGE",
116 | "type": "IMAGE",
117 | "links": [
118 | 97,
119 | 99
120 | ],
121 | "shape": 3,
122 | "slot_index": 0
123 | }
124 | ],
125 | "properties": {
126 | "Node name for S&R": "ImageBatch"
127 | }
128 | },
129 | {
130 | "id": 46,
131 | "type": "LightSource",
132 | "pos": [
133 | -654.3392714767309,
134 | 1854.0930787287589
135 | ],
136 | "size": {
137 | "0": 315,
138 | "1": 178
139 | },
140 | "flags": {},
141 | "order": 13,
142 | "mode": 0,
143 | "inputs": [
144 | {
145 | "name": "width",
146 | "type": "INT",
147 | "link": 86,
148 | "widget": {
149 | "name": "width"
150 | }
151 | },
152 | {
153 | "name": "height",
154 | "type": "INT",
155 | "link": 85,
156 | "widget": {
157 | "name": "height"
158 | }
159 | },
160 | {
161 | "name": "multiplier",
162 | "type": "FLOAT",
163 | "link": 102,
164 | "widget": {
165 | "name": "multiplier"
166 | }
167 | }
168 | ],
169 | "outputs": [
170 | {
171 | "name": "IMAGE",
172 | "type": "IMAGE",
173 | "links": [
174 | 92
175 | ],
176 | "shape": 3,
177 | "slot_index": 0
178 | }
179 | ],
180 | "properties": {
181 | "Node name for S&R": "LightSource"
182 | },
183 | "widgets_values": [
184 | "Top Right Light",
185 | 1,
186 | "#ffffff",
187 | "#000000",
188 | 512,
189 | 512
190 | ],
191 | "color": "#432",
192 | "bgcolor": "#653"
193 | },
194 | {
195 | "id": 47,
196 | "type": "LightSource",
197 | "pos": [
198 | -654.3392714767309,
199 | 2094.093078728756
200 | ],
201 | "size": {
202 | "0": 315,
203 | "1": 178
204 | },
205 | "flags": {},
206 | "order": 14,
207 | "mode": 0,
208 | "inputs": [
209 | {
210 | "name": "width",
211 | "type": "INT",
212 | "link": 87,
213 | "widget": {
214 | "name": "width"
215 | }
216 | },
217 | {
218 | "name": "height",
219 | "type": "INT",
220 | "link": 88,
221 | "widget": {
222 | "name": "height"
223 | }
224 | },
225 | {
226 | "name": "multiplier",
227 | "type": "FLOAT",
228 | "link": 103,
229 | "widget": {
230 | "name": "multiplier"
231 | }
232 | }
233 | ],
234 | "outputs": [
235 | {
236 | "name": "IMAGE",
237 | "type": "IMAGE",
238 | "links": [
239 | 93
240 | ],
241 | "shape": 3,
242 | "slot_index": 0
243 | }
244 | ],
245 | "properties": {
246 | "Node name for S&R": "LightSource"
247 | },
248 | "widgets_values": [
249 | "Bottom Left Light",
250 | 1,
251 | "#ffffff",
252 | "#000000",
253 | 512,
254 | 512
255 | ],
256 | "color": "#432",
257 | "bgcolor": "#653"
258 | },
259 | {
260 | "id": 48,
261 | "type": "LightSource",
262 | "pos": [
263 | -654.3392714767309,
264 | 2324.093078728754
265 | ],
266 | "size": {
267 | "0": 315,
268 | "1": 178
269 | },
270 | "flags": {},
271 | "order": 15,
272 | "mode": 0,
273 | "inputs": [
274 | {
275 | "name": "width",
276 | "type": "INT",
277 | "link": 89,
278 | "widget": {
279 | "name": "width"
280 | }
281 | },
282 | {
283 | "name": "height",
284 | "type": "INT",
285 | "link": 90,
286 | "widget": {
287 | "name": "height"
288 | }
289 | },
290 | {
291 | "name": "multiplier",
292 | "type": "FLOAT",
293 | "link": 104,
294 | "widget": {
295 | "name": "multiplier"
296 | }
297 | }
298 | ],
299 | "outputs": [
300 | {
301 | "name": "IMAGE",
302 | "type": "IMAGE",
303 | "links": [
304 | 94
305 | ],
306 | "shape": 3,
307 | "slot_index": 0
308 | }
309 | ],
310 | "properties": {
311 | "Node name for S&R": "LightSource"
312 | },
313 | "widgets_values": [
314 | "Bottom Right Light",
315 | 1,
316 | "#ffffff",
317 | "#000000",
318 | 512,
319 | 512
320 | ],
321 | "color": "#432",
322 | "bgcolor": "#653"
323 | },
324 | {
325 | "id": 52,
326 | "type": "PrimitiveNode",
327 | "pos": [
328 | -1014.3392714767305,
329 | 2014.0930787287577
330 | ],
331 | "size": {
332 | "0": 210,
333 | "1": 82
334 | },
335 | "flags": {},
336 | "order": 0,
337 | "mode": 0,
338 | "outputs": [
339 | {
340 | "name": "FLOAT",
341 | "type": "FLOAT",
342 | "links": [
343 | 101,
344 | 102,
345 | 103,
346 | 104
347 | ],
348 | "slot_index": 0,
349 | "widget": {
350 | "name": "multiplier"
351 | }
352 | }
353 | ],
354 | "title": "multiplier",
355 | "properties": {
356 | "Run widget replace on values": false
357 | },
358 | "widgets_values": [
359 | 1,
360 | "fixed"
361 | ]
362 | },
363 | {
364 | "id": 42,
365 | "type": "LightSource",
366 | "pos": [
367 | -654.3392714767309,
368 | 1614.0930787287568
369 | ],
370 | "size": {
371 | "0": 315,
372 | "1": 178
373 | },
374 | "flags": {},
375 | "order": 12,
376 | "mode": 0,
377 | "inputs": [
378 | {
379 | "name": "width",
380 | "type": "INT",
381 | "link": 79,
382 | "widget": {
383 | "name": "width"
384 | }
385 | },
386 | {
387 | "name": "height",
388 | "type": "INT",
389 | "link": 78,
390 | "widget": {
391 | "name": "height"
392 | }
393 | },
394 | {
395 | "name": "multiplier",
396 | "type": "FLOAT",
397 | "link": 101,
398 | "widget": {
399 | "name": "multiplier"
400 | }
401 | }
402 | ],
403 | "outputs": [
404 | {
405 | "name": "IMAGE",
406 | "type": "IMAGE",
407 | "links": [
408 | 91
409 | ],
410 | "shape": 3,
411 | "slot_index": 0
412 | }
413 | ],
414 | "properties": {
415 | "Node name for S&R": "LightSource"
416 | },
417 | "widgets_values": [
418 | "Top Left Light",
419 | 1,
420 | "#ffffff",
421 | "#000000",
422 | 512,
423 | 512
424 | ],
425 | "color": "#432",
426 | "bgcolor": "#653"
427 | },
428 | {
429 | "id": 28,
430 | "type": "ImageResize+",
431 | "pos": [
432 | -483.05233047540605,
433 | 958.4874113477166
434 | ],
435 | "size": {
436 | "0": 315,
437 | "1": 218
438 | },
439 | "flags": {},
440 | "order": 9,
441 | "mode": 0,
442 | "inputs": [
443 | {
444 | "name": "image",
445 | "type": "IMAGE",
446 | "link": 123
447 | }
448 | ],
449 | "outputs": [
450 | {
451 | "name": "IMAGE",
452 | "type": "IMAGE",
453 | "links": [
454 | 158
455 | ],
456 | "shape": 3,
457 | "slot_index": 0
458 | },
459 | {
460 | "name": "width",
461 | "type": "INT",
462 | "links": [
463 | 79,
464 | 86,
465 | 87,
466 | 89
467 | ],
468 | "shape": 3,
469 | "slot_index": 1
470 | },
471 | {
472 | "name": "height",
473 | "type": "INT",
474 | "links": [
475 | 78,
476 | 85,
477 | 88,
478 | 90
479 | ],
480 | "shape": 3,
481 | "slot_index": 2
482 | }
483 | ],
484 | "properties": {
485 | "Node name for S&R": "ImageResize+"
486 | },
487 | "widgets_values": [
488 | 512,
489 | 0,
490 | "nearest",
491 | true,
492 | "always",
493 | 8
494 | ]
495 | },
496 | {
497 | "id": 40,
498 | "type": "CLIPTextEncode",
499 | "pos": [
500 | 150,
501 | 330
502 | ],
503 | "size": {
504 | "0": 400,
505 | "1": 200
506 | },
507 | "flags": {},
508 | "order": 7,
509 | "mode": 0,
510 | "inputs": [
511 | {
512 | "name": "clip",
513 | "type": "CLIP",
514 | "link": 68
515 | }
516 | ],
517 | "outputs": [
518 | {
519 | "name": "CONDITIONING",
520 | "type": "CONDITIONING",
521 | "links": [
522 | 147
523 | ],
524 | "shape": 3,
525 | "slot_index": 0
526 | }
527 | ],
528 | "properties": {
529 | "Node name for S&R": "CLIPTextEncode"
530 | },
531 | "widgets_values": [
532 | "lowres, bad anatomy, bad hands, cropped, worst quality"
533 | ]
534 | },
535 | {
536 | "id": 36,
537 | "type": "VAEDecode",
538 | "pos": [
539 | 1701.866122821997,
540 | 989.5944853880765
541 | ],
542 | "size": {
543 | "0": 210,
544 | "1": 46
545 | },
546 | "flags": {},
547 | "order": 25,
548 | "mode": 0,
549 | "inputs": [
550 | {
551 | "name": "samples",
552 | "type": "LATENT",
553 | "link": 75
554 | },
555 | {
556 | "name": "vae",
557 | "type": "VAE",
558 | "link": 211,
559 | "slot_index": 1
560 | }
561 | ],
562 | "outputs": [
563 | {
564 | "name": "IMAGE",
565 | "type": "IMAGE",
566 | "links": [
567 | 63,
568 | 155
569 | ],
570 | "shape": 3,
571 | "slot_index": 0
572 | }
573 | ],
574 | "properties": {
575 | "Node name for S&R": "VAEDecode"
576 | }
577 | },
578 | {
579 | "id": 10,
580 | "type": "PreviewImage",
581 | "pos": [
582 | 2031.8661228219937,
583 | 989.5944853880765
584 | ],
585 | "size": {
586 | "0": 452.2980041503906,
587 | "1": 581.5648803710938
588 | },
589 | "flags": {},
590 | "order": 26,
591 | "mode": 0,
592 | "inputs": [
593 | {
594 | "name": "images",
595 | "type": "IMAGE",
596 | "link": 63
597 | }
598 | ],
599 | "properties": {
600 | "Node name for S&R": "PreviewImage"
601 | }
602 | },
603 | {
604 | "id": 6,
605 | "type": "CheckpointLoaderSimple",
606 | "pos": [
607 | -330,
608 | 210
609 | ],
610 | "size": {
611 | "0": 315,
612 | "1": 98
613 | },
614 | "flags": {},
615 | "order": 1,
616 | "mode": 0,
617 | "outputs": [
618 | {
619 | "name": "MODEL",
620 | "type": "MODEL",
621 | "links": [
622 | 213
623 | ],
624 | "shape": 3,
625 | "slot_index": 0
626 | },
627 | {
628 | "name": "CLIP",
629 | "type": "CLIP",
630 | "links": [
631 | 67,
632 | 68
633 | ],
634 | "shape": 3,
635 | "slot_index": 1
636 | },
637 | {
638 | "name": "VAE",
639 | "type": "VAE",
640 | "links": [
641 | 205
642 | ],
643 | "shape": 3,
644 | "slot_index": 2
645 | }
646 | ],
647 | "properties": {
648 | "Node name for S&R": "CheckpointLoaderSimple"
649 | },
650 | "widgets_values": [
651 | "sd15\\photon_v1.safetensors"
652 | ]
653 | },
654 | {
655 | "id": 33,
656 | "type": "PreviewImage",
657 | "pos": [
658 | 62,
659 | 2011
660 | ],
661 | "size": {
662 | "0": 369.8701477050781,
663 | "1": 339.7276611328125
664 | },
665 | "flags": {},
666 | "order": 22,
667 | "mode": 0,
668 | "inputs": [
669 | {
670 | "name": "images",
671 | "type": "IMAGE",
672 | "link": 97
673 | }
674 | ],
675 | "properties": {
676 | "Node name for S&R": "PreviewImage"
677 | }
678 | },
679 | {
680 | "id": 68,
681 | "type": "PreviewImage",
682 | "pos": [
683 | 13,
684 | 1187
685 | ],
686 | "size": {
687 | "0": 210,
688 | "1": 246
689 | },
690 | "flags": {},
691 | "order": 19,
692 | "mode": 0,
693 | "inputs": [
694 | {
695 | "name": "images",
696 | "type": "IMAGE",
697 | "link": 221
698 | }
699 | ],
700 | "properties": {
701 | "Node name for S&R": "PreviewImage"
702 | }
703 | },
704 | {
705 | "id": 37,
706 | "type": "ICLightModelLoader",
707 | "pos": [
708 | 831.8661228220033,
709 | 869.5944853880765
710 | ],
711 | "size": {
712 | "0": 315,
713 | "1": 58
714 | },
715 | "flags": {},
716 | "order": 2,
717 | "mode": 0,
718 | "outputs": [
719 | {
720 | "name": "iclight",
721 | "type": "ICLIGHT",
722 | "links": [
723 | 150
724 | ],
725 | "shape": 3,
726 | "slot_index": 0
727 | }
728 | ],
729 | "properties": {
730 | "Node name for S&R": "ICLightModelLoader"
731 | },
732 | "widgets_values": [
733 | "iclight_sd15_fc.safetensors"
734 | ],
735 | "color": "#432",
736 | "bgcolor": "#653"
737 | },
738 | {
739 | "id": 65,
740 | "type": "RemBGSession+",
741 | "pos": [
742 | -483.05233047540605,
743 | 828.4874113477166
744 | ],
745 | "size": {
746 | "0": 315,
747 | "1": 82
748 | },
749 | "flags": {},
750 | "order": 3,
751 | "mode": 0,
752 | "outputs": [
753 | {
754 | "name": "REMBG_SESSION",
755 | "type": "REMBG_SESSION",
756 | "links": [
757 | 157
758 | ],
759 | "shape": 3
760 | }
761 | ],
762 | "properties": {
763 | "Node name for S&R": "RemBGSession+"
764 | },
765 | "widgets_values": [
766 | "u2net_human_seg: human segmentation",
767 | "CPU"
768 | ]
769 | },
770 | {
771 | "id": 9,
772 | "type": "LoadImage",
773 | "pos": [
774 | -893,
775 | 828
776 | ],
777 | "size": {
778 | "0": 315,
779 | "1": 314
780 | },
781 | "flags": {},
782 | "order": 4,
783 | "mode": 0,
784 | "outputs": [
785 | {
786 | "name": "IMAGE",
787 | "type": "IMAGE",
788 | "links": [
789 | 123
790 | ],
791 | "shape": 3,
792 | "slot_index": 0
793 | },
794 | {
795 | "name": "MASK",
796 | "type": "MASK",
797 | "links": null,
798 | "shape": 3
799 | }
800 | ],
801 | "properties": {
802 | "Node name for S&R": "LoadImage"
803 | },
804 | "widgets_values": [
805 | "i4.png",
806 | "image"
807 | ]
808 | },
809 | {
810 | "id": 41,
811 | "type": "KSampler",
812 | "pos": [
813 | 1211.866122821997,
814 | 989.5944853880765
815 | ],
816 | "size": {
817 | "0": 315,
818 | "1": 474
819 | },
820 | "flags": {},
821 | "order": 24,
822 | "mode": 0,
823 | "inputs": [
824 | {
825 | "name": "model",
826 | "type": "MODEL",
827 | "link": 151
828 | },
829 | {
830 | "name": "positive",
831 | "type": "CONDITIONING",
832 | "link": 152
833 | },
834 | {
835 | "name": "negative",
836 | "type": "CONDITIONING",
837 | "link": 153
838 | },
839 | {
840 | "name": "latent_image",
841 | "type": "LATENT",
842 | "link": 135
843 | }
844 | ],
845 | "outputs": [
846 | {
847 | "name": "LATENT",
848 | "type": "LATENT",
849 | "links": [
850 | 75
851 | ],
852 | "shape": 3,
853 | "slot_index": 0
854 | }
855 | ],
856 | "properties": {
857 | "Node name for S&R": "KSampler"
858 | },
859 | "widgets_values": [
860 | 995253983530173,
861 | "fixed",
862 | 20,
863 | 2,
864 | "euler_ancestral",
865 | "normal",
866 | 1
867 | ]
868 | },
869 | {
870 | "id": 39,
871 | "type": "CLIPTextEncode",
872 | "pos": [
873 | 150,
874 | 70
875 | ],
876 | "size": {
877 | "0": 400,
878 | "1": 200
879 | },
880 | "flags": {},
881 | "order": 6,
882 | "mode": 0,
883 | "inputs": [
884 | {
885 | "name": "clip",
886 | "type": "CLIP",
887 | "link": 67
888 | }
889 | ],
890 | "outputs": [
891 | {
892 | "name": "CONDITIONING",
893 | "type": "CONDITIONING",
894 | "links": [
895 | 148
896 | ],
897 | "shape": 3,
898 | "slot_index": 0
899 | }
900 | ],
901 | "properties": {
902 | "Node name for S&R": "CLIPTextEncode"
903 | },
904 | "widgets_values": [
905 | "beautiful woman, detailed face, sunshine, outdoor, warm atmosphere,\nbest quality"
906 | ]
907 | },
908 | {
909 | "id": 86,
910 | "type": "Reroute",
911 | "pos": [
912 | 474,
913 | 552
914 | ],
915 | "size": [
916 | 75,
917 | 26
918 | ],
919 | "flags": {},
920 | "order": 5,
921 | "mode": 0,
922 | "inputs": [
923 | {
924 | "name": "",
925 | "type": "*",
926 | "link": 213
927 | }
928 | ],
929 | "outputs": [
930 | {
931 | "name": "",
932 | "type": "MODEL",
933 | "links": [
934 | 214
935 | ],
936 | "slot_index": 0
937 | }
938 | ],
939 | "properties": {
940 | "showOutputText": false,
941 | "horizontal": false
942 | }
943 | },
944 | {
945 | "id": 84,
946 | "type": "Reroute",
947 | "pos": [
948 | 476,
949 | 604
950 | ],
951 | "size": [
952 | 75,
953 | 26
954 | ],
955 | "flags": {},
956 | "order": 8,
957 | "mode": 0,
958 | "inputs": [
959 | {
960 | "name": "",
961 | "type": "*",
962 | "link": 205
963 | }
964 | ],
965 | "outputs": [
966 | {
967 | "name": "",
968 | "type": "VAE",
969 | "links": [
970 | 206,
971 | 207,
972 | 210
973 | ],
974 | "slot_index": 0
975 | }
976 | ],
977 | "properties": {
978 | "showOutputText": false,
979 | "horizontal": false
980 | }
981 | },
982 | {
983 | "id": 85,
984 | "type": "Reroute",
985 | "pos": [
986 | 1472,
987 | 604
988 | ],
989 | "size": [
990 | 75,
991 | 26
992 | ],
993 | "flags": {},
994 | "order": 10,
995 | "mode": 0,
996 | "inputs": [
997 | {
998 | "name": "",
999 | "type": "*",
1000 | "link": 210
1001 | }
1002 | ],
1003 | "outputs": [
1004 | {
1005 | "name": "",
1006 | "type": "VAE",
1007 | "links": [
1008 | 211
1009 | ],
1010 | "slot_index": 0
1011 | }
1012 | ],
1013 | "properties": {
1014 | "showOutputText": false,
1015 | "horizontal": false
1016 | }
1017 | },
1018 | {
1019 | "id": 25,
1020 | "type": "VAEEncode",
1021 | "pos": [
1022 | 832,
1023 | 1904
1024 | ],
1025 | "size": {
1026 | "0": 266.0477294921875,
1027 | "1": 46.57838821411133
1028 | },
1029 | "flags": {},
1030 | "order": 23,
1031 | "mode": 0,
1032 | "inputs": [
1033 | {
1034 | "name": "pixels",
1035 | "type": "IMAGE",
1036 | "link": 99,
1037 | "slot_index": 0
1038 | },
1039 | {
1040 | "name": "vae",
1041 | "type": "VAE",
1042 | "link": 207,
1043 | "slot_index": 1
1044 | }
1045 | ],
1046 | "outputs": [
1047 | {
1048 | "name": "LATENT",
1049 | "type": "LATENT",
1050 | "links": [
1051 | 135
1052 | ],
1053 | "shape": 3,
1054 | "slot_index": 0
1055 | }
1056 | ],
1057 | "properties": {
1058 | "Node name for S&R": "VAEEncode"
1059 | }
1060 | },
1061 | {
1062 | "id": 91,
1063 | "type": "GrayScaler",
1064 | "pos": [
1065 | 10,
1066 | 1050
1067 | ],
1068 | "size": {
1069 | "0": 210,
1070 | "1": 46
1071 | },
1072 | "flags": {
1073 | "pinned": true
1074 | },
1075 | "order": 16,
1076 | "mode": 0,
1077 | "inputs": [
1078 | {
1079 | "name": "image",
1080 | "type": "IMAGE",
1081 | "link": 219
1082 | },
1083 | {
1084 | "name": "mask",
1085 | "type": "MASK",
1086 | "link": 220
1087 | }
1088 | ],
1089 | "outputs": [
1090 | {
1091 | "name": "IMAGE",
1092 | "type": "IMAGE",
1093 | "links": [
1094 | 221,
1095 | 222
1096 | ],
1097 | "shape": 3,
1098 | "slot_index": 0
1099 | }
1100 | ],
1101 | "properties": {
1102 | "Node name for S&R": "GrayScaler"
1103 | },
1104 | "color": "#432",
1105 | "bgcolor": "#653"
1106 | },
1107 | {
1108 | "id": 64,
1109 | "type": "ImageRemoveBackground+",
1110 | "pos": [
1111 | -83,
1112 | 898
1113 | ],
1114 | "size": {
1115 | "0": 241.79998779296875,
1116 | "1": 46
1117 | },
1118 | "flags": {},
1119 | "order": 11,
1120 | "mode": 0,
1121 | "inputs": [
1122 | {
1123 | "name": "rembg_session",
1124 | "type": "REMBG_SESSION",
1125 | "link": 157,
1126 | "slot_index": 0
1127 | },
1128 | {
1129 | "name": "image",
1130 | "type": "IMAGE",
1131 | "link": 158
1132 | }
1133 | ],
1134 | "outputs": [
1135 | {
1136 | "name": "IMAGE",
1137 | "type": "IMAGE",
1138 | "links": [
1139 | 219
1140 | ],
1141 | "shape": 3,
1142 | "slot_index": 0
1143 | },
1144 | {
1145 | "name": "MASK",
1146 | "type": "MASK",
1147 | "links": [
1148 | 220
1149 | ],
1150 | "shape": 3,
1151 | "slot_index": 1
1152 | }
1153 | ],
1154 | "properties": {
1155 | "Node name for S&R": "ImageRemoveBackground+"
1156 | }
1157 | },
1158 | {
1159 | "id": 62,
1160 | "type": "ApplyICLight",
1161 | "pos": [
1162 | 831.8661228220033,
1163 | 989.5944853880765
1164 | ],
1165 | "size": {
1166 | "0": 315,
1167 | "1": 178
1168 | },
1169 | "flags": {},
1170 | "order": 20,
1171 | "mode": 0,
1172 | "inputs": [
1173 | {
1174 | "name": "model",
1175 | "type": "MODEL",
1176 | "link": 214
1177 | },
1178 | {
1179 | "name": "vae",
1180 | "type": "VAE",
1181 | "link": 206
1182 | },
1183 | {
1184 | "name": "iclight",
1185 | "type": "ICLIGHT",
1186 | "link": 150
1187 | },
1188 | {
1189 | "name": "positive",
1190 | "type": "CONDITIONING",
1191 | "link": 148
1192 | },
1193 | {
1194 | "name": "negative",
1195 | "type": "CONDITIONING",
1196 | "link": 147
1197 | },
1198 | {
1199 | "name": "fg_pixels",
1200 | "type": "IMAGE",
1201 | "link": 222
1202 | },
1203 | {
1204 | "name": "bg_pixels",
1205 | "type": "IMAGE",
1206 | "link": null
1207 | }
1208 | ],
1209 | "outputs": [
1210 | {
1211 | "name": "model",
1212 | "type": "MODEL",
1213 | "links": [
1214 | 151
1215 | ],
1216 | "shape": 3,
1217 | "slot_index": 0
1218 | },
1219 | {
1220 | "name": "positive",
1221 | "type": "CONDITIONING",
1222 | "links": [
1223 | 152
1224 | ],
1225 | "shape": 3,
1226 | "slot_index": 1
1227 | },
1228 | {
1229 | "name": "negative",
1230 | "type": "CONDITIONING",
1231 | "links": [
1232 | 153
1233 | ],
1234 | "shape": 3,
1235 | "slot_index": 2
1236 | },
1237 | {
1238 | "name": "empty_latent",
1239 | "type": "LATENT",
1240 | "links": null,
1241 | "shape": 3
1242 | }
1243 | ],
1244 | "properties": {
1245 | "Node name for S&R": "ApplyICLight"
1246 | },
1247 | "widgets_values": [
1248 | 1.2
1249 | ],
1250 | "color": "#432",
1251 | "bgcolor": "#653"
1252 | },
1253 | {
1254 | "id": 63,
1255 | "type": "CalculateNormalMap",
1256 | "pos": [
1257 | 1635,
1258 | 1675
1259 | ],
1260 | "size": {
1261 | "0": 315,
1262 | "1": 102
1263 | },
1264 | "flags": {},
1265 | "order": 27,
1266 | "mode": 0,
1267 | "inputs": [
1268 | {
1269 | "name": "images",
1270 | "type": "IMAGE",
1271 | "link": 155
1272 | },
1273 | {
1274 | "name": "mask",
1275 | "type": "MASK",
1276 | "link": null
1277 | }
1278 | ],
1279 | "outputs": [
1280 | {
1281 | "name": "normal",
1282 | "type": "IMAGE",
1283 | "links": [
1284 | 156
1285 | ],
1286 | "shape": 3,
1287 | "slot_index": 0
1288 | }
1289 | ],
1290 | "properties": {
1291 | "Node name for S&R": "CalculateNormalMap"
1292 | },
1293 | "widgets_values": [
1294 | 10,
1295 | false
1296 | ],
1297 | "color": "#432",
1298 | "bgcolor": "#653"
1299 | },
1300 | {
1301 | "id": 45,
1302 | "type": "PreviewImage",
1303 | "pos": [
1304 | 2064,
1305 | 1674
1306 | ],
1307 | "size": {
1308 | "0": 403.2276611328125,
1309 | "1": 577.4949951171875
1310 | },
1311 | "flags": {},
1312 | "order": 28,
1313 | "mode": 0,
1314 | "inputs": [
1315 | {
1316 | "name": "images",
1317 | "type": "IMAGE",
1318 | "link": 156
1319 | }
1320 | ],
1321 | "properties": {
1322 | "Node name for S&R": "PreviewImage"
1323 | }
1324 | }
1325 | ],
1326 | "links": [
1327 | [
1328 | 63,
1329 | 36,
1330 | 0,
1331 | 10,
1332 | 0,
1333 | "IMAGE"
1334 | ],
1335 | [
1336 | 67,
1337 | 6,
1338 | 1,
1339 | 39,
1340 | 0,
1341 | "CLIP"
1342 | ],
1343 | [
1344 | 68,
1345 | 6,
1346 | 1,
1347 | 40,
1348 | 0,
1349 | "CLIP"
1350 | ],
1351 | [
1352 | 75,
1353 | 41,
1354 | 0,
1355 | 36,
1356 | 0,
1357 | "LATENT"
1358 | ],
1359 | [
1360 | 78,
1361 | 28,
1362 | 2,
1363 | 42,
1364 | 1,
1365 | "INT"
1366 | ],
1367 | [
1368 | 79,
1369 | 28,
1370 | 1,
1371 | 42,
1372 | 0,
1373 | "INT"
1374 | ],
1375 | [
1376 | 85,
1377 | 28,
1378 | 2,
1379 | 46,
1380 | 1,
1381 | "INT"
1382 | ],
1383 | [
1384 | 86,
1385 | 28,
1386 | 1,
1387 | 46,
1388 | 0,
1389 | "INT"
1390 | ],
1391 | [
1392 | 87,
1393 | 28,
1394 | 1,
1395 | 47,
1396 | 0,
1397 | "INT"
1398 | ],
1399 | [
1400 | 88,
1401 | 28,
1402 | 2,
1403 | 47,
1404 | 1,
1405 | "INT"
1406 | ],
1407 | [
1408 | 89,
1409 | 28,
1410 | 1,
1411 | 48,
1412 | 0,
1413 | "INT"
1414 | ],
1415 | [
1416 | 90,
1417 | 28,
1418 | 2,
1419 | 48,
1420 | 1,
1421 | "INT"
1422 | ],
1423 | [
1424 | 91,
1425 | 42,
1426 | 0,
1427 | 49,
1428 | 0,
1429 | "IMAGE"
1430 | ],
1431 | [
1432 | 92,
1433 | 46,
1434 | 0,
1435 | 49,
1436 | 1,
1437 | "IMAGE"
1438 | ],
1439 | [
1440 | 93,
1441 | 47,
1442 | 0,
1443 | 50,
1444 | 0,
1445 | "IMAGE"
1446 | ],
1447 | [
1448 | 94,
1449 | 48,
1450 | 0,
1451 | 50,
1452 | 1,
1453 | "IMAGE"
1454 | ],
1455 | [
1456 | 95,
1457 | 49,
1458 | 0,
1459 | 51,
1460 | 0,
1461 | "IMAGE"
1462 | ],
1463 | [
1464 | 96,
1465 | 50,
1466 | 0,
1467 | 51,
1468 | 1,
1469 | "IMAGE"
1470 | ],
1471 | [
1472 | 97,
1473 | 51,
1474 | 0,
1475 | 33,
1476 | 0,
1477 | "IMAGE"
1478 | ],
1479 | [
1480 | 99,
1481 | 51,
1482 | 0,
1483 | 25,
1484 | 0,
1485 | "IMAGE"
1486 | ],
1487 | [
1488 | 101,
1489 | 52,
1490 | 0,
1491 | 42,
1492 | 2,
1493 | "FLOAT"
1494 | ],
1495 | [
1496 | 102,
1497 | 52,
1498 | 0,
1499 | 46,
1500 | 2,
1501 | "FLOAT"
1502 | ],
1503 | [
1504 | 103,
1505 | 52,
1506 | 0,
1507 | 47,
1508 | 2,
1509 | "FLOAT"
1510 | ],
1511 | [
1512 | 104,
1513 | 52,
1514 | 0,
1515 | 48,
1516 | 2,
1517 | "FLOAT"
1518 | ],
1519 | [
1520 | 123,
1521 | 9,
1522 | 0,
1523 | 28,
1524 | 0,
1525 | "IMAGE"
1526 | ],
1527 | [
1528 | 135,
1529 | 25,
1530 | 0,
1531 | 41,
1532 | 3,
1533 | "LATENT"
1534 | ],
1535 | [
1536 | 147,
1537 | 40,
1538 | 0,
1539 | 62,
1540 | 4,
1541 | "CONDITIONING"
1542 | ],
1543 | [
1544 | 148,
1545 | 39,
1546 | 0,
1547 | 62,
1548 | 3,
1549 | "CONDITIONING"
1550 | ],
1551 | [
1552 | 150,
1553 | 37,
1554 | 0,
1555 | 62,
1556 | 2,
1557 | "ICLIGHT"
1558 | ],
1559 | [
1560 | 151,
1561 | 62,
1562 | 0,
1563 | 41,
1564 | 0,
1565 | "MODEL"
1566 | ],
1567 | [
1568 | 152,
1569 | 62,
1570 | 1,
1571 | 41,
1572 | 1,
1573 | "CONDITIONING"
1574 | ],
1575 | [
1576 | 153,
1577 | 62,
1578 | 2,
1579 | 41,
1580 | 2,
1581 | "CONDITIONING"
1582 | ],
1583 | [
1584 | 155,
1585 | 36,
1586 | 0,
1587 | 63,
1588 | 0,
1589 | "IMAGE"
1590 | ],
1591 | [
1592 | 156,
1593 | 63,
1594 | 0,
1595 | 45,
1596 | 0,
1597 | "IMAGE"
1598 | ],
1599 | [
1600 | 157,
1601 | 65,
1602 | 0,
1603 | 64,
1604 | 0,
1605 | "REMBG_SESSION"
1606 | ],
1607 | [
1608 | 158,
1609 | 28,
1610 | 0,
1611 | 64,
1612 | 1,
1613 | "IMAGE"
1614 | ],
1615 | [
1616 | 205,
1617 | 6,
1618 | 2,
1619 | 84,
1620 | 0,
1621 | "*"
1622 | ],
1623 | [
1624 | 206,
1625 | 84,
1626 | 0,
1627 | 62,
1628 | 1,
1629 | "VAE"
1630 | ],
1631 | [
1632 | 207,
1633 | 84,
1634 | 0,
1635 | 25,
1636 | 1,
1637 | "VAE"
1638 | ],
1639 | [
1640 | 210,
1641 | 84,
1642 | 0,
1643 | 85,
1644 | 0,
1645 | "*"
1646 | ],
1647 | [
1648 | 211,
1649 | 85,
1650 | 0,
1651 | 36,
1652 | 1,
1653 | "VAE"
1654 | ],
1655 | [
1656 | 213,
1657 | 6,
1658 | 0,
1659 | 86,
1660 | 0,
1661 | "*"
1662 | ],
1663 | [
1664 | 214,
1665 | 86,
1666 | 0,
1667 | 62,
1668 | 0,
1669 | "MODEL"
1670 | ],
1671 | [
1672 | 219,
1673 | 64,
1674 | 0,
1675 | 91,
1676 | 0,
1677 | "IMAGE"
1678 | ],
1679 | [
1680 | 220,
1681 | 64,
1682 | 1,
1683 | 91,
1684 | 1,
1685 | "MASK"
1686 | ],
1687 | [
1688 | 221,
1689 | 91,
1690 | 0,
1691 | 68,
1692 | 0,
1693 | "IMAGE"
1694 | ],
1695 | [
1696 | 222,
1697 | 91,
1698 | 0,
1699 | 62,
1700 | 5,
1701 | "IMAGE"
1702 | ]
1703 | ],
1704 | "groups": [
1705 | {
1706 | "title": "Lighting Preference",
1707 | "bounding": [
1708 | -1118,
1709 | 1500,
1710 | 1701,
1711 | 1050
1712 | ],
1713 | "color": "#3f789e",
1714 | "font_size": 24,
1715 | "locked": false
1716 | },
1717 | {
1718 | "title": "foreground",
1719 | "bounding": [
1720 | -1106,
1721 | 707,
1722 | 1689,
1723 | 772
1724 | ],
1725 | "color": "#3f789e",
1726 | "font_size": 24,
1727 | "locked": false
1728 | },
1729 | {
1730 | "title": "Text-Conditioned Model",
1731 | "bounding": [
1732 | 731,
1733 | 705,
1734 | 2081,
1735 | 1844
1736 | ],
1737 | "color": "#3f789e",
1738 | "font_size": 24,
1739 | "locked": false
1740 | }
1741 | ],
1742 | "config": {},
1743 | "extra": {
1744 | "ds": {
1745 | "scale": 0.35049389948139237,
1746 | "offset": {
1747 | "0": 2220.7743800231146,
1748 | "1": 321.1031645390776
1749 | }
1750 | }
1751 | },
1752 | "version": 0.4
1753 | }
--------------------------------------------------------------------------------
/examples/workflow-gaffer-iclight-fc-text.json:
--------------------------------------------------------------------------------
1 | {
2 | "last_node_id": 93,
3 | "last_link_id": 235,
4 | "nodes": [
5 | {
6 | "id": 40,
7 | "type": "CLIPTextEncode",
8 | "pos": [
9 | 163.72314324655804,
10 | 457.7209877334219
11 | ],
12 | "size": {
13 | "0": 400,
14 | "1": 200
15 | },
16 | "flags": {},
17 | "order": 6,
18 | "mode": 0,
19 | "inputs": [
20 | {
21 | "name": "clip",
22 | "type": "CLIP",
23 | "link": 68
24 | }
25 | ],
26 | "outputs": [
27 | {
28 | "name": "CONDITIONING",
29 | "type": "CONDITIONING",
30 | "links": [
31 | 175
32 | ],
33 | "shape": 3,
34 | "slot_index": 0
35 | }
36 | ],
37 | "properties": {
38 | "Node name for S&R": "CLIPTextEncode"
39 | },
40 | "widgets_values": [
41 | "lowres, bad anatomy, bad hands, cropped, worst quality"
42 | ]
43 | },
44 | {
45 | "id": 78,
46 | "type": "VAEDecode",
47 | "pos": [
48 | 1666,
49 | 639
50 | ],
51 | "size": {
52 | "0": 210,
53 | "1": 46
54 | },
55 | "flags": {},
56 | "order": 13,
57 | "mode": 0,
58 | "inputs": [
59 | {
60 | "name": "samples",
61 | "type": "LATENT",
62 | "link": 189
63 | },
64 | {
65 | "name": "vae",
66 | "type": "VAE",
67 | "link": 220,
68 | "slot_index": 1
69 | }
70 | ],
71 | "outputs": [
72 | {
73 | "name": "IMAGE",
74 | "type": "IMAGE",
75 | "links": [
76 | 191
77 | ],
78 | "shape": 3,
79 | "slot_index": 0
80 | }
81 | ],
82 | "properties": {
83 | "Node name for S&R": "VAEDecode"
84 | }
85 | },
86 | {
87 | "id": 79,
88 | "type": "PreviewImage",
89 | "pos": [
90 | 1675,
91 | 890
92 | ],
93 | "size": {
94 | "0": 451.9798889160156,
95 | "1": 489.39794921875
96 | },
97 | "flags": {},
98 | "order": 14,
99 | "mode": 0,
100 | "inputs": [
101 | {
102 | "name": "images",
103 | "type": "IMAGE",
104 | "link": 191
105 | }
106 | ],
107 | "properties": {
108 | "Node name for S&R": "PreviewImage"
109 | }
110 | },
111 | {
112 | "id": 74,
113 | "type": "ICLightModelLoader",
114 | "pos": [
115 | 875,
116 | 768
117 | ],
118 | "size": {
119 | "0": 320,
120 | "1": 60
121 | },
122 | "flags": {},
123 | "order": 0,
124 | "mode": 0,
125 | "outputs": [
126 | {
127 | "name": "iclight",
128 | "type": "ICLIGHT",
129 | "links": [
130 | 173
131 | ],
132 | "shape": 3,
133 | "slot_index": 0
134 | }
135 | ],
136 | "properties": {
137 | "Node name for S&R": "ICLightModelLoader"
138 | },
139 | "widgets_values": [
140 | "iclight_sd15_fc.safetensors"
141 | ],
142 | "color": "#432",
143 | "bgcolor": "#653"
144 | },
145 | {
146 | "id": 6,
147 | "type": "CheckpointLoaderSimple",
148 | "pos": [
149 | 248.72314324655804,
150 | 16
151 | ],
152 | "size": {
153 | "0": 315,
154 | "1": 98
155 | },
156 | "flags": {},
157 | "order": 1,
158 | "mode": 0,
159 | "outputs": [
160 | {
161 | "name": "MODEL",
162 | "type": "MODEL",
163 | "links": [
164 | 219
165 | ],
166 | "shape": 3,
167 | "slot_index": 0
168 | },
169 | {
170 | "name": "CLIP",
171 | "type": "CLIP",
172 | "links": [
173 | 67,
174 | 68
175 | ],
176 | "shape": 3,
177 | "slot_index": 1
178 | },
179 | {
180 | "name": "VAE",
181 | "type": "VAE",
182 | "links": [
183 | 218,
184 | 220
185 | ],
186 | "shape": 3,
187 | "slot_index": 2
188 | }
189 | ],
190 | "properties": {
191 | "Node name for S&R": "CheckpointLoaderSimple"
192 | },
193 | "widgets_values": [
194 | "sd15\\realisticVisionV51_v51VAE.safetensors"
195 | ]
196 | },
197 | {
198 | "id": 9,
199 | "type": "LoadImage",
200 | "pos": [
201 | -677,
202 | 835
203 | ],
204 | "size": {
205 | "0": 315,
206 | "1": 314.0000305175781
207 | },
208 | "flags": {},
209 | "order": 2,
210 | "mode": 0,
211 | "outputs": [
212 | {
213 | "name": "IMAGE",
214 | "type": "IMAGE",
215 | "links": [
216 | 123
217 | ],
218 | "shape": 3,
219 | "slot_index": 0
220 | },
221 | {
222 | "name": "MASK",
223 | "type": "MASK",
224 | "links": null,
225 | "shape": 3
226 | }
227 | ],
228 | "properties": {
229 | "Node name for S&R": "LoadImage"
230 | },
231 | "widgets_values": [
232 | "i3 (4).png",
233 | "image"
234 | ]
235 | },
236 | {
237 | "id": 64,
238 | "type": "ImageRemoveBackground+",
239 | "pos": [
240 | 137,
241 | 890
242 | ],
243 | "size": {
244 | "0": 241.79998779296875,
245 | "1": 46
246 | },
247 | "flags": {},
248 | "order": 8,
249 | "mode": 0,
250 | "inputs": [
251 | {
252 | "name": "rembg_session",
253 | "type": "REMBG_SESSION",
254 | "link": 157,
255 | "slot_index": 0
256 | },
257 | {
258 | "name": "image",
259 | "type": "IMAGE",
260 | "link": 158
261 | }
262 | ],
263 | "outputs": [
264 | {
265 | "name": "IMAGE",
266 | "type": "IMAGE",
267 | "links": [
268 | 230
269 | ],
270 | "shape": 3,
271 | "slot_index": 0
272 | },
273 | {
274 | "name": "MASK",
275 | "type": "MASK",
276 | "links": [
277 | 231
278 | ],
279 | "shape": 3,
280 | "slot_index": 1
281 | }
282 | ],
283 | "properties": {
284 | "Node name for S&R": "ImageRemoveBackground+"
285 | }
286 | },
287 | {
288 | "id": 87,
289 | "type": "Note",
290 | "pos": [
291 | -754,
292 | 26
293 | ],
294 | "size": {
295 | "0": 884.5147094726562,
296 | "1": 616.7295532226562
297 | },
298 | "flags": {},
299 | "order": 3,
300 | "mode": 0,
301 | "properties": {
302 | "text": ""
303 | },
304 | "widgets_values": [
305 | "beautiful woman, detailed face, sunshine, outdoor, warm atmosphere\n\nbeautiful woman, detailed face, neon, Wong Kar-wai, warm\n\nbeautiful woman, detailed face, sunshine from window\n\nbeautiful woman, detailed face, warm atmosphere, at home, bedroom\n\nbeautiful woman, detailed face, shadow from window\n\nbeautiful woman, detailed face, sunset over sea\n\nbeautiful woman, detailed face, light and shadow\n\nhandsome boy, detailed face, neon light, city\n\nBuddha, detailed face, sci-fi RGB glowing, cyberpunk\n\nBuddha, detailed face, natural lighting\n\ntoy, detailed face, shadow from window\n\ntoy, detailed face, sunset over sea\n\ndog, magic lit, sci-fi RGB glowing, studio lighting\n\nmysteriou human, warm atmosphere, warm atmosphere, at home, bedroom\n\n"
306 | ],
307 | "color": "#432",
308 | "bgcolor": "#653"
309 | },
310 | {
311 | "id": 39,
312 | "type": "CLIPTextEncode",
313 | "pos": [
314 | 163.72314324655804,
315 | 198
316 | ],
317 | "size": {
318 | "0": 400,
319 | "1": 200
320 | },
321 | "flags": {},
322 | "order": 5,
323 | "mode": 0,
324 | "inputs": [
325 | {
326 | "name": "clip",
327 | "type": "CLIP",
328 | "link": 67
329 | }
330 | ],
331 | "outputs": [
332 | {
333 | "name": "CONDITIONING",
334 | "type": "CONDITIONING",
335 | "links": [
336 | 174
337 | ],
338 | "shape": 3,
339 | "slot_index": 0
340 | }
341 | ],
342 | "properties": {
343 | "Node name for S&R": "CLIPTextEncode"
344 | },
345 | "widgets_values": [
346 | "beautiful woman, detailed face, sunshine from window"
347 | ]
348 | },
349 | {
350 | "id": 28,
351 | "type": "ImageResize+",
352 | "pos": [
353 | -266.61497525625225,
354 | 964.9773755650289
355 | ],
356 | "size": {
357 | "0": 315,
358 | "1": 218
359 | },
360 | "flags": {},
361 | "order": 7,
362 | "mode": 0,
363 | "inputs": [
364 | {
365 | "name": "image",
366 | "type": "IMAGE",
367 | "link": 123
368 | }
369 | ],
370 | "outputs": [
371 | {
372 | "name": "IMAGE",
373 | "type": "IMAGE",
374 | "links": [
375 | 158
376 | ],
377 | "shape": 3,
378 | "slot_index": 0
379 | },
380 | {
381 | "name": "width",
382 | "type": "INT",
383 | "links": [],
384 | "shape": 3,
385 | "slot_index": 1
386 | },
387 | {
388 | "name": "height",
389 | "type": "INT",
390 | "links": [],
391 | "shape": 3,
392 | "slot_index": 2
393 | }
394 | ],
395 | "properties": {
396 | "Node name for S&R": "ImageResize+"
397 | },
398 | "widgets_values": [
399 | 512,
400 | 0,
401 | "nearest",
402 | true,
403 | "always",
404 | 8
405 | ]
406 | },
407 | {
408 | "id": 65,
409 | "type": "RemBGSession+",
410 | "pos": [
411 | -266.61497525625225,
412 | 834.9773755650289
413 | ],
414 | "size": {
415 | "0": 315,
416 | "1": 82
417 | },
418 | "flags": {},
419 | "order": 4,
420 | "mode": 0,
421 | "outputs": [
422 | {
423 | "name": "REMBG_SESSION",
424 | "type": "REMBG_SESSION",
425 | "links": [
426 | 157
427 | ],
428 | "shape": 3
429 | }
430 | ],
431 | "properties": {
432 | "Node name for S&R": "RemBGSession+"
433 | },
434 | "widgets_values": [
435 | "u2net_human_seg: human segmentation",
436 | "CPU"
437 | ]
438 | },
439 | {
440 | "id": 93,
441 | "type": "PreviewImage",
442 | "pos": [
443 | 147,
444 | 1103
445 | ],
446 | "size": [
447 | 210,
448 | 246
449 | ],
450 | "flags": {},
451 | "order": 10,
452 | "mode": 0,
453 | "inputs": [
454 | {
455 | "name": "images",
456 | "type": "IMAGE",
457 | "link": 233
458 | }
459 | ],
460 | "properties": {
461 | "Node name for S&R": "PreviewImage"
462 | }
463 | },
464 | {
465 | "id": 92,
466 | "type": "GrayScaler",
467 | "pos": [
468 | 151,
469 | 995
470 | ],
471 | "size": {
472 | "0": 210,
473 | "1": 46
474 | },
475 | "flags": {},
476 | "order": 9,
477 | "mode": 0,
478 | "inputs": [
479 | {
480 | "name": "image",
481 | "type": "IMAGE",
482 | "link": 230
483 | },
484 | {
485 | "name": "mask",
486 | "type": "MASK",
487 | "link": 231
488 | }
489 | ],
490 | "outputs": [
491 | {
492 | "name": "IMAGE",
493 | "type": "IMAGE",
494 | "links": [
495 | 233,
496 | 235
497 | ],
498 | "shape": 3,
499 | "slot_index": 0
500 | }
501 | ],
502 | "properties": {
503 | "Node name for S&R": "GrayScaler"
504 | }
505 | },
506 | {
507 | "id": 75,
508 | "type": "ApplyICLight",
509 | "pos": [
510 | 876,
511 | 896
512 | ],
513 | "size": {
514 | "0": 320,
515 | "1": 180
516 | },
517 | "flags": {},
518 | "order": 11,
519 | "mode": 0,
520 | "inputs": [
521 | {
522 | "name": "model",
523 | "type": "MODEL",
524 | "link": 219
525 | },
526 | {
527 | "name": "vae",
528 | "type": "VAE",
529 | "link": 218
530 | },
531 | {
532 | "name": "iclight",
533 | "type": "ICLIGHT",
534 | "link": 173
535 | },
536 | {
537 | "name": "positive",
538 | "type": "CONDITIONING",
539 | "link": 174
540 | },
541 | {
542 | "name": "negative",
543 | "type": "CONDITIONING",
544 | "link": 175
545 | },
546 | {
547 | "name": "fg_pixels",
548 | "type": "IMAGE",
549 | "link": 235
550 | },
551 | {
552 | "name": "bg_pixels",
553 | "type": "IMAGE",
554 | "link": null
555 | }
556 | ],
557 | "outputs": [
558 | {
559 | "name": "model",
560 | "type": "MODEL",
561 | "links": [
562 | 185
563 | ],
564 | "shape": 3,
565 | "slot_index": 0
566 | },
567 | {
568 | "name": "positive",
569 | "type": "CONDITIONING",
570 | "links": [
571 | 186
572 | ],
573 | "shape": 3,
574 | "slot_index": 1
575 | },
576 | {
577 | "name": "negative",
578 | "type": "CONDITIONING",
579 | "links": [
580 | 187
581 | ],
582 | "shape": 3,
583 | "slot_index": 2
584 | },
585 | {
586 | "name": "empty_latent",
587 | "type": "LATENT",
588 | "links": [
589 | 216
590 | ],
591 | "shape": 3,
592 | "slot_index": 3
593 | }
594 | ],
595 | "properties": {
596 | "Node name for S&R": "ApplyICLight"
597 | },
598 | "widgets_values": [
599 | 1.3
600 | ],
601 | "color": "#432",
602 | "bgcolor": "#653"
603 | },
604 | {
605 | "id": 77,
606 | "type": "KSampler",
607 | "pos": [
608 | 1276,
609 | 896
610 | ],
611 | "size": {
612 | "0": 320,
613 | "1": 474
614 | },
615 | "flags": {},
616 | "order": 12,
617 | "mode": 0,
618 | "inputs": [
619 | {
620 | "name": "model",
621 | "type": "MODEL",
622 | "link": 185
623 | },
624 | {
625 | "name": "positive",
626 | "type": "CONDITIONING",
627 | "link": 186
628 | },
629 | {
630 | "name": "negative",
631 | "type": "CONDITIONING",
632 | "link": 187
633 | },
634 | {
635 | "name": "latent_image",
636 | "type": "LATENT",
637 | "link": 216
638 | }
639 | ],
640 | "outputs": [
641 | {
642 | "name": "LATENT",
643 | "type": "LATENT",
644 | "links": [
645 | 189
646 | ],
647 | "shape": 3,
648 | "slot_index": 0
649 | }
650 | ],
651 | "properties": {
652 | "Node name for S&R": "KSampler"
653 | },
654 | "widgets_values": [
655 | 995253983530196,
656 | "fixed",
657 | 20,
658 | 2,
659 | "dpmpp_2m",
660 | "karras",
661 | 1
662 | ]
663 | }
664 | ],
665 | "links": [
666 | [
667 | 67,
668 | 6,
669 | 1,
670 | 39,
671 | 0,
672 | "CLIP"
673 | ],
674 | [
675 | 68,
676 | 6,
677 | 1,
678 | 40,
679 | 0,
680 | "CLIP"
681 | ],
682 | [
683 | 123,
684 | 9,
685 | 0,
686 | 28,
687 | 0,
688 | "IMAGE"
689 | ],
690 | [
691 | 157,
692 | 65,
693 | 0,
694 | 64,
695 | 0,
696 | "REMBG_SESSION"
697 | ],
698 | [
699 | 158,
700 | 28,
701 | 0,
702 | 64,
703 | 1,
704 | "IMAGE"
705 | ],
706 | [
707 | 173,
708 | 74,
709 | 0,
710 | 75,
711 | 2,
712 | "ICLIGHT"
713 | ],
714 | [
715 | 174,
716 | 39,
717 | 0,
718 | 75,
719 | 3,
720 | "CONDITIONING"
721 | ],
722 | [
723 | 175,
724 | 40,
725 | 0,
726 | 75,
727 | 4,
728 | "CONDITIONING"
729 | ],
730 | [
731 | 185,
732 | 75,
733 | 0,
734 | 77,
735 | 0,
736 | "MODEL"
737 | ],
738 | [
739 | 186,
740 | 75,
741 | 1,
742 | 77,
743 | 1,
744 | "CONDITIONING"
745 | ],
746 | [
747 | 187,
748 | 75,
749 | 2,
750 | 77,
751 | 2,
752 | "CONDITIONING"
753 | ],
754 | [
755 | 189,
756 | 77,
757 | 0,
758 | 78,
759 | 0,
760 | "LATENT"
761 | ],
762 | [
763 | 191,
764 | 78,
765 | 0,
766 | 79,
767 | 0,
768 | "IMAGE"
769 | ],
770 | [
771 | 216,
772 | 75,
773 | 3,
774 | 77,
775 | 3,
776 | "LATENT"
777 | ],
778 | [
779 | 218,
780 | 6,
781 | 2,
782 | 75,
783 | 1,
784 | "VAE"
785 | ],
786 | [
787 | 219,
788 | 6,
789 | 0,
790 | 75,
791 | 0,
792 | "MODEL"
793 | ],
794 | [
795 | 220,
796 | 6,
797 | 2,
798 | 78,
799 | 1,
800 | "VAE"
801 | ],
802 | [
803 | 230,
804 | 64,
805 | 0,
806 | 92,
807 | 0,
808 | "IMAGE"
809 | ],
810 | [
811 | 231,
812 | 64,
813 | 1,
814 | 92,
815 | 1,
816 | "MASK"
817 | ],
818 | [
819 | 233,
820 | 92,
821 | 0,
822 | 93,
823 | 0,
824 | "IMAGE"
825 | ],
826 | [
827 | 235,
828 | 92,
829 | 0,
830 | 75,
831 | 5,
832 | "IMAGE"
833 | ]
834 | ],
835 | "groups": [
836 | {
837 | "title": "foreground",
838 | "bounding": [
839 | -753,
840 | 712,
841 | 1318,
842 | 809
843 | ],
844 | "color": "#3f789e",
845 | "font_size": 24,
846 | "locked": false
847 | }
848 | ],
849 | "config": {},
850 | "extra": {
851 | "ds": {
852 | "scale": 0.5730855330117124,
853 | "offset": {
854 | "0": 1030.3929200078123,
855 | "1": 375.5687335634062
856 | }
857 | }
858 | },
859 | "version": 0.4
860 | }
--------------------------------------------------------------------------------
/examples/workflow-gaffer-iclight-fc.json:
--------------------------------------------------------------------------------
1 | {
2 | "last_node_id": 88,
3 | "last_link_id": 231,
4 | "nodes": [
5 | {
6 | "id": 28,
7 | "type": "ImageResize+",
8 | "pos": [
9 | -271.50151972734375,
10 | 991.1887652515626
11 | ],
12 | "size": {
13 | "0": 315,
14 | "1": 218
15 | },
16 | "flags": {},
17 | "order": 7,
18 | "mode": 0,
19 | "inputs": [
20 | {
21 | "name": "image",
22 | "type": "IMAGE",
23 | "link": 123
24 | }
25 | ],
26 | "outputs": [
27 | {
28 | "name": "IMAGE",
29 | "type": "IMAGE",
30 | "links": [
31 | 158
32 | ],
33 | "shape": 3,
34 | "slot_index": 0
35 | },
36 | {
37 | "name": "width",
38 | "type": "INT",
39 | "links": [
40 | 79
41 | ],
42 | "shape": 3,
43 | "slot_index": 1
44 | },
45 | {
46 | "name": "height",
47 | "type": "INT",
48 | "links": [
49 | 78
50 | ],
51 | "shape": 3,
52 | "slot_index": 2
53 | }
54 | ],
55 | "properties": {
56 | "Node name for S&R": "ImageResize+"
57 | },
58 | "widgets_values": [
59 | 512,
60 | 0,
61 | "nearest",
62 | true,
63 | "always",
64 | 8
65 | ]
66 | },
67 | {
68 | "id": 36,
69 | "type": "VAEDecode",
70 | "pos": [
71 | 1520,
72 | 650
73 | ],
74 | "size": {
75 | "0": 210,
76 | "1": 46
77 | },
78 | "flags": {},
79 | "order": 15,
80 | "mode": 0,
81 | "inputs": [
82 | {
83 | "name": "samples",
84 | "type": "LATENT",
85 | "link": 75
86 | },
87 | {
88 | "name": "vae",
89 | "type": "VAE",
90 | "link": 222,
91 | "slot_index": 1
92 | }
93 | ],
94 | "outputs": [
95 | {
96 | "name": "IMAGE",
97 | "type": "IMAGE",
98 | "links": [
99 | 63
100 | ],
101 | "shape": 3,
102 | "slot_index": 0
103 | }
104 | ],
105 | "properties": {
106 | "Node name for S&R": "VAEDecode"
107 | }
108 | },
109 | {
110 | "id": 40,
111 | "type": "CLIPTextEncode",
112 | "pos": [
113 | 157,
114 | 601
115 | ],
116 | "size": {
117 | "0": 395.8106994628906,
118 | "1": 101.43054962158203
119 | },
120 | "flags": {},
121 | "order": 6,
122 | "mode": 0,
123 | "inputs": [
124 | {
125 | "name": "clip",
126 | "type": "CLIP",
127 | "link": 68
128 | }
129 | ],
130 | "outputs": [
131 | {
132 | "name": "CONDITIONING",
133 | "type": "CONDITIONING",
134 | "links": [
135 | 147
136 | ],
137 | "shape": 3,
138 | "slot_index": 0
139 | }
140 | ],
141 | "properties": {
142 | "Node name for S&R": "CLIPTextEncode"
143 | },
144 | "widgets_values": [
145 | "lowres, bad anatomy, bad hands, cropped, worst quality"
146 | ]
147 | },
148 | {
149 | "id": 39,
150 | "type": "CLIPTextEncode",
151 | "pos": [
152 | 152.8107011407742,
153 | 349
154 | ],
155 | "size": {
156 | "0": 400,
157 | "1": 200
158 | },
159 | "flags": {},
160 | "order": 5,
161 | "mode": 0,
162 | "inputs": [
163 | {
164 | "name": "clip",
165 | "type": "CLIP",
166 | "link": 67
167 | }
168 | ],
169 | "outputs": [
170 | {
171 | "name": "CONDITIONING",
172 | "type": "CONDITIONING",
173 | "links": [
174 | 148
175 | ],
176 | "shape": 3,
177 | "slot_index": 0
178 | }
179 | ],
180 | "properties": {
181 | "Node name for S&R": "CLIPTextEncode"
182 | },
183 | "widgets_values": [
184 | "beautiful woman, detailed face, sunshine, outdoor, warm atmosphere,\nbest quality"
185 | ]
186 | },
187 | {
188 | "id": 6,
189 | "type": "CheckpointLoaderSimple",
190 | "pos": [
191 | 237.8107011407742,
192 | 194
193 | ],
194 | "size": {
195 | "0": 315,
196 | "1": 98
197 | },
198 | "flags": {},
199 | "order": 0,
200 | "mode": 0,
201 | "outputs": [
202 | {
203 | "name": "MODEL",
204 | "type": "MODEL",
205 | "links": [
206 | 226
207 | ],
208 | "shape": 3,
209 | "slot_index": 0
210 | },
211 | {
212 | "name": "CLIP",
213 | "type": "CLIP",
214 | "links": [
215 | 67,
216 | 68
217 | ],
218 | "shape": 3,
219 | "slot_index": 1
220 | },
221 | {
222 | "name": "VAE",
223 | "type": "VAE",
224 | "links": [
225 | 222,
226 | 223,
227 | 224
228 | ],
229 | "shape": 3,
230 | "slot_index": 2
231 | }
232 | ],
233 | "properties": {
234 | "Node name for S&R": "CheckpointLoaderSimple"
235 | },
236 | "widgets_values": [
237 | "sd15\\photon_v1.safetensors"
238 | ]
239 | },
240 | {
241 | "id": 37,
242 | "type": "ICLightModelLoader",
243 | "pos": [
244 | 750,
245 | 790
246 | ],
247 | "size": {
248 | "0": 315,
249 | "1": 58
250 | },
251 | "flags": {},
252 | "order": 1,
253 | "mode": 0,
254 | "outputs": [
255 | {
256 | "name": "iclight",
257 | "type": "ICLIGHT",
258 | "links": [
259 | 150
260 | ],
261 | "shape": 3,
262 | "slot_index": 0
263 | }
264 | ],
265 | "properties": {
266 | "Node name for S&R": "ICLightModelLoader"
267 | },
268 | "widgets_values": [
269 | "iclight_sd15_fc.safetensors"
270 | ],
271 | "color": "#432",
272 | "bgcolor": "#653"
273 | },
274 | {
275 | "id": 10,
276 | "type": "PreviewImage",
277 | "pos": [
278 | 1530,
279 | 797
280 | ],
281 | "size": {
282 | "0": 452.2980041503906,
283 | "1": 581.5648803710938
284 | },
285 | "flags": {},
286 | "order": 16,
287 | "mode": 0,
288 | "inputs": [
289 | {
290 | "name": "images",
291 | "type": "IMAGE",
292 | "link": 63
293 | }
294 | ],
295 | "properties": {
296 | "Node name for S&R": "PreviewImage"
297 | }
298 | },
299 | {
300 | "id": 25,
301 | "type": "VAEEncode",
302 | "pos": [
303 | 755,
304 | 1570
305 | ],
306 | "size": {
307 | "0": 266.0477294921875,
308 | "1": 46.57838821411133
309 | },
310 | "flags": {},
311 | "order": 11,
312 | "mode": 0,
313 | "inputs": [
314 | {
315 | "name": "pixels",
316 | "type": "IMAGE",
317 | "link": 221,
318 | "slot_index": 0
319 | },
320 | {
321 | "name": "vae",
322 | "type": "VAE",
323 | "link": 224,
324 | "slot_index": 1
325 | }
326 | ],
327 | "outputs": [
328 | {
329 | "name": "LATENT",
330 | "type": "LATENT",
331 | "links": [
332 | 135
333 | ],
334 | "shape": 3,
335 | "slot_index": 0
336 | }
337 | ],
338 | "properties": {
339 | "Node name for S&R": "VAEEncode"
340 | }
341 | },
342 | {
343 | "id": 41,
344 | "type": "KSampler",
345 | "pos": [
346 | 1128,
347 | 914
348 | ],
349 | "size": {
350 | "0": 315,
351 | "1": 474
352 | },
353 | "flags": {},
354 | "order": 14,
355 | "mode": 0,
356 | "inputs": [
357 | {
358 | "name": "model",
359 | "type": "MODEL",
360 | "link": 151
361 | },
362 | {
363 | "name": "positive",
364 | "type": "CONDITIONING",
365 | "link": 152
366 | },
367 | {
368 | "name": "negative",
369 | "type": "CONDITIONING",
370 | "link": 153
371 | },
372 | {
373 | "name": "latent_image",
374 | "type": "LATENT",
375 | "link": 135
376 | }
377 | ],
378 | "outputs": [
379 | {
380 | "name": "LATENT",
381 | "type": "LATENT",
382 | "links": [
383 | 75
384 | ],
385 | "shape": 3,
386 | "slot_index": 0
387 | }
388 | ],
389 | "properties": {
390 | "Node name for S&R": "KSampler"
391 | },
392 | "widgets_values": [
393 | 995253983530175,
394 | "fixed",
395 | 20,
396 | 2,
397 | "euler_ancestral",
398 | "normal",
399 | 1
400 | ]
401 | },
402 | {
403 | "id": 62,
404 | "type": "ApplyICLight",
405 | "pos": [
406 | 750,
407 | 914
408 | ],
409 | "size": {
410 | "0": 315,
411 | "1": 178
412 | },
413 | "flags": {},
414 | "order": 13,
415 | "mode": 0,
416 | "inputs": [
417 | {
418 | "name": "model",
419 | "type": "MODEL",
420 | "link": 226
421 | },
422 | {
423 | "name": "vae",
424 | "type": "VAE",
425 | "link": 223
426 | },
427 | {
428 | "name": "iclight",
429 | "type": "ICLIGHT",
430 | "link": 150
431 | },
432 | {
433 | "name": "positive",
434 | "type": "CONDITIONING",
435 | "link": 148
436 | },
437 | {
438 | "name": "negative",
439 | "type": "CONDITIONING",
440 | "link": 147
441 | },
442 | {
443 | "name": "fg_pixels",
444 | "type": "IMAGE",
445 | "link": 231
446 | },
447 | {
448 | "name": "bg_pixels",
449 | "type": "IMAGE",
450 | "link": null
451 | }
452 | ],
453 | "outputs": [
454 | {
455 | "name": "model",
456 | "type": "MODEL",
457 | "links": [
458 | 151
459 | ],
460 | "shape": 3,
461 | "slot_index": 0
462 | },
463 | {
464 | "name": "positive",
465 | "type": "CONDITIONING",
466 | "links": [
467 | 152
468 | ],
469 | "shape": 3,
470 | "slot_index": 1
471 | },
472 | {
473 | "name": "negative",
474 | "type": "CONDITIONING",
475 | "links": [
476 | 153
477 | ],
478 | "shape": 3,
479 | "slot_index": 2
480 | },
481 | {
482 | "name": "empty_latent",
483 | "type": "LATENT",
484 | "links": null,
485 | "shape": 3
486 | }
487 | ],
488 | "properties": {
489 | "Node name for S&R": "ApplyICLight"
490 | },
491 | "widgets_values": [
492 | 1
493 | ],
494 | "color": "#432",
495 | "bgcolor": "#653"
496 | },
497 | {
498 | "id": 87,
499 | "type": "Note",
500 | "pos": [
501 | -758,
502 | 78
503 | ],
504 | "size": {
505 | "0": 884.5147094726562,
506 | "1": 616.7295532226562
507 | },
508 | "flags": {},
509 | "order": 2,
510 | "mode": 0,
511 | "properties": {
512 | "text": ""
513 | },
514 | "widgets_values": [
515 | "beautiful woman, detailed face, sunshine, outdoor, warm atmosphere\n\nbeautiful woman, detailed face, neon, Wong Kar-wai, warm\n\nbeautiful woman, detailed face, sunshine from window\n\nbeautiful woman, detailed face, warm atmosphere, at home, bedroom\n\nbeautiful woman, detailed face, shadow from window\n\nbeautiful woman, detailed face, sunset over sea\n\nbeautiful woman, detailed face, light and shadow\n\nhandsome boy, detailed face, neon light, city\n\nBuddha, detailed face, sci-fi RGB glowing, cyberpunk\n\nBuddha, detailed face, natural lighting\n\ntoy, detailed face, shadow from window\n\ntoy, detailed face, sunset over sea\n\ndog, magic lit, sci-fi RGB glowing, studio lighting\n\nmysteriou human, warm atmosphere, warm atmosphere, at home, bedroom\n\n"
516 | ],
517 | "color": "#432",
518 | "bgcolor": "#653"
519 | },
520 | {
521 | "id": 9,
522 | "type": "LoadImage",
523 | "pos": [
524 | -694.7181390945309,
525 | 851.10255243125
526 | ],
527 | "size": {
528 | "0": 315,
529 | "1": 314.0000305175781
530 | },
531 | "flags": {},
532 | "order": 3,
533 | "mode": 0,
534 | "outputs": [
535 | {
536 | "name": "IMAGE",
537 | "type": "IMAGE",
538 | "links": [
539 | 123
540 | ],
541 | "shape": 3,
542 | "slot_index": 0
543 | },
544 | {
545 | "name": "MASK",
546 | "type": "MASK",
547 | "links": null,
548 | "shape": 3
549 | }
550 | ],
551 | "properties": {
552 | "Node name for S&R": "LoadImage"
553 | },
554 | "widgets_values": [
555 | "i3 (6).png",
556 | "image"
557 | ]
558 | },
559 | {
560 | "id": 64,
561 | "type": "ImageRemoveBackground+",
562 | "pos": [
563 | 194,
564 | 915
565 | ],
566 | "size": {
567 | "0": 241.79998779296875,
568 | "1": 46
569 | },
570 | "flags": {},
571 | "order": 8,
572 | "mode": 0,
573 | "inputs": [
574 | {
575 | "name": "rembg_session",
576 | "type": "REMBG_SESSION",
577 | "link": 157,
578 | "slot_index": 0
579 | },
580 | {
581 | "name": "image",
582 | "type": "IMAGE",
583 | "link": 158
584 | }
585 | ],
586 | "outputs": [
587 | {
588 | "name": "IMAGE",
589 | "type": "IMAGE",
590 | "links": [
591 | 228
592 | ],
593 | "shape": 3,
594 | "slot_index": 0
595 | },
596 | {
597 | "name": "MASK",
598 | "type": "MASK",
599 | "links": [
600 | 229
601 | ],
602 | "shape": 3,
603 | "slot_index": 1
604 | }
605 | ],
606 | "properties": {
607 | "Node name for S&R": "ImageRemoveBackground+"
608 | }
609 | },
610 | {
611 | "id": 68,
612 | "type": "PreviewImage",
613 | "pos": [
614 | 232,
615 | 1146
616 | ],
617 | "size": {
618 | "0": 210,
619 | "1": 246
620 | },
621 | "flags": {},
622 | "order": 12,
623 | "mode": 0,
624 | "inputs": [
625 | {
626 | "name": "images",
627 | "type": "IMAGE",
628 | "link": 230
629 | }
630 | ],
631 | "properties": {
632 | "Node name for S&R": "PreviewImage"
633 | }
634 | },
635 | {
636 | "id": 88,
637 | "type": "GrayScaler",
638 | "pos": [
639 | 216,
640 | 1016
641 | ],
642 | "size": {
643 | "0": 210,
644 | "1": 46
645 | },
646 | "flags": {},
647 | "order": 10,
648 | "mode": 0,
649 | "inputs": [
650 | {
651 | "name": "image",
652 | "type": "IMAGE",
653 | "link": 228
654 | },
655 | {
656 | "name": "mask",
657 | "type": "MASK",
658 | "link": 229
659 | }
660 | ],
661 | "outputs": [
662 | {
663 | "name": "IMAGE",
664 | "type": "IMAGE",
665 | "links": [
666 | 230,
667 | 231
668 | ],
669 | "shape": 3,
670 | "slot_index": 0
671 | }
672 | ],
673 | "properties": {
674 | "Node name for S&R": "GrayScaler"
675 | }
676 | },
677 | {
678 | "id": 65,
679 | "type": "RemBGSession+",
680 | "pos": [
681 | -266,
682 | 834
683 | ],
684 | "size": {
685 | "0": 315,
686 | "1": 82
687 | },
688 | "flags": {},
689 | "order": 4,
690 | "mode": 0,
691 | "outputs": [
692 | {
693 | "name": "REMBG_SESSION",
694 | "type": "REMBG_SESSION",
695 | "links": [
696 | 157
697 | ],
698 | "shape": 3
699 | }
700 | ],
701 | "properties": {
702 | "Node name for S&R": "RemBGSession+"
703 | },
704 | "widgets_values": [
705 | "u2net_human_seg: human segmentation",
706 | "CPU"
707 | ]
708 | },
709 | {
710 | "id": 42,
711 | "type": "LightSource",
712 | "pos": [
713 | 191,
714 | 1570
715 | ],
716 | "size": {
717 | "0": 315,
718 | "1": 178
719 | },
720 | "flags": {},
721 | "order": 9,
722 | "mode": 0,
723 | "inputs": [
724 | {
725 | "name": "width",
726 | "type": "INT",
727 | "link": 79,
728 | "widget": {
729 | "name": "width"
730 | }
731 | },
732 | {
733 | "name": "height",
734 | "type": "INT",
735 | "link": 78,
736 | "widget": {
737 | "name": "height"
738 | }
739 | }
740 | ],
741 | "outputs": [
742 | {
743 | "name": "IMAGE",
744 | "type": "IMAGE",
745 | "links": [
746 | 221
747 | ],
748 | "shape": 3,
749 | "slot_index": 0
750 | }
751 | ],
752 | "title": "Lighting Preference",
753 | "properties": {
754 | "Node name for S&R": "LightSource"
755 | },
756 | "widgets_values": [
757 | "Top Left Light",
758 | 1,
759 | "#ffffff",
760 | "#000000",
761 | 512,
762 | 512
763 | ],
764 | "color": "#432",
765 | "bgcolor": "#653"
766 | }
767 | ],
768 | "links": [
769 | [
770 | 63,
771 | 36,
772 | 0,
773 | 10,
774 | 0,
775 | "IMAGE"
776 | ],
777 | [
778 | 67,
779 | 6,
780 | 1,
781 | 39,
782 | 0,
783 | "CLIP"
784 | ],
785 | [
786 | 68,
787 | 6,
788 | 1,
789 | 40,
790 | 0,
791 | "CLIP"
792 | ],
793 | [
794 | 75,
795 | 41,
796 | 0,
797 | 36,
798 | 0,
799 | "LATENT"
800 | ],
801 | [
802 | 78,
803 | 28,
804 | 2,
805 | 42,
806 | 1,
807 | "INT"
808 | ],
809 | [
810 | 79,
811 | 28,
812 | 1,
813 | 42,
814 | 0,
815 | "INT"
816 | ],
817 | [
818 | 123,
819 | 9,
820 | 0,
821 | 28,
822 | 0,
823 | "IMAGE"
824 | ],
825 | [
826 | 135,
827 | 25,
828 | 0,
829 | 41,
830 | 3,
831 | "LATENT"
832 | ],
833 | [
834 | 147,
835 | 40,
836 | 0,
837 | 62,
838 | 4,
839 | "CONDITIONING"
840 | ],
841 | [
842 | 148,
843 | 39,
844 | 0,
845 | 62,
846 | 3,
847 | "CONDITIONING"
848 | ],
849 | [
850 | 150,
851 | 37,
852 | 0,
853 | 62,
854 | 2,
855 | "ICLIGHT"
856 | ],
857 | [
858 | 151,
859 | 62,
860 | 0,
861 | 41,
862 | 0,
863 | "MODEL"
864 | ],
865 | [
866 | 152,
867 | 62,
868 | 1,
869 | 41,
870 | 1,
871 | "CONDITIONING"
872 | ],
873 | [
874 | 153,
875 | 62,
876 | 2,
877 | 41,
878 | 2,
879 | "CONDITIONING"
880 | ],
881 | [
882 | 157,
883 | 65,
884 | 0,
885 | 64,
886 | 0,
887 | "REMBG_SESSION"
888 | ],
889 | [
890 | 158,
891 | 28,
892 | 0,
893 | 64,
894 | 1,
895 | "IMAGE"
896 | ],
897 | [
898 | 221,
899 | 42,
900 | 0,
901 | 25,
902 | 0,
903 | "IMAGE"
904 | ],
905 | [
906 | 222,
907 | 6,
908 | 2,
909 | 36,
910 | 1,
911 | "VAE"
912 | ],
913 | [
914 | 223,
915 | 6,
916 | 2,
917 | 62,
918 | 1,
919 | "VAE"
920 | ],
921 | [
922 | 224,
923 | 6,
924 | 2,
925 | 25,
926 | 1,
927 | "VAE"
928 | ],
929 | [
930 | 226,
931 | 6,
932 | 0,
933 | 62,
934 | 0,
935 | "MODEL"
936 | ],
937 | [
938 | 228,
939 | 64,
940 | 0,
941 | 88,
942 | 0,
943 | "IMAGE"
944 | ],
945 | [
946 | 229,
947 | 64,
948 | 1,
949 | 88,
950 | 1,
951 | "MASK"
952 | ],
953 | [
954 | 230,
955 | 88,
956 | 0,
957 | 68,
958 | 0,
959 | "IMAGE"
960 | ],
961 | [
962 | 231,
963 | 88,
964 | 0,
965 | 62,
966 | 5,
967 | "IMAGE"
968 | ]
969 | ],
970 | "groups": [
971 | {
972 | "title": "foreground",
973 | "bounding": [
974 | -754,
975 | 737,
976 | 1247,
977 | 757
978 | ],
979 | "color": "#3f789e",
980 | "font_size": 24,
981 | "locked": false
982 | }
983 | ],
984 | "config": {},
985 | "extra": {
986 | "ds": {
987 | "scale": 0.5131581182307067,
988 | "offset": {
989 | "0": 1988.018452815201,
990 | "1": 247.8858309778409
991 | }
992 | }
993 | },
994 | "version": 0.4
995 | }
--------------------------------------------------------------------------------
/iclight.py:
--------------------------------------------------------------------------------
1 | import os
2 | import logging
3 | from typing import TypedDict, Callable
4 | import torch
5 | import numpy as np
6 | import folder_paths
7 | import comfy.model_management as model_management
8 | from comfy.sd import VAE
9 | from comfy.utils import load_torch_file
10 | from comfy.diffusers_convert import convert_unet_state_dict
11 | from comfy.ldm.models.autoencoder import AutoencoderKL
12 | from comfy.model_base import BaseModel
13 | from comfy.model_patcher import ModelPatcher
14 | from nodes import MAX_RESOLUTION
15 | from .utils.image import generate_gradient_image, LightPosition, resize_and_center_crop
16 | from .utils.patches import calculate_weight_adjust_channel
17 |
18 | # logger
19 | logging.basicConfig(level=logging.INFO)
20 | LOGGER = logging.getLogger(__name__)
21 |
22 | # contents
23 | MODEL_TYPE_ICLIGHT = "iclight"
24 |
25 | # set the models directory
26 | if MODEL_TYPE_ICLIGHT not in folder_paths.folder_names_and_paths:
27 | current_paths = [os.path.join(folder_paths.models_dir, MODEL_TYPE_ICLIGHT)]
28 | else:
29 | current_paths, _ = folder_paths.folder_names_and_paths[MODEL_TYPE_ICLIGHT]
30 | folder_paths.folder_names_and_paths[MODEL_TYPE_ICLIGHT] = (current_paths, folder_paths.supported_pt_extensions)
31 |
32 |
33 | class UnetParams(TypedDict):
34 | input: torch.Tensor
35 | timestep: torch.Tensor
36 | c: dict
37 | cond_or_uncond: torch.Tensor
38 |
39 | class ICLightPatch():
40 | def __init__(self, model: ModelPatcher, vae: VAE, iclight):
41 | model_type = str(type(model.model.model_config).__name__)
42 | if "SD15" not in model_type:
43 | raise Exception(f"Attempted to load {model_type} model, IC-Light is only compatible with SD 1.5 models.")
44 |
45 | assert isinstance(vae.first_stage_model, AutoencoderKL), "vae only supported for AutoencoderKL"
46 |
47 | self.device = model_management.get_torch_device()
48 | dtype = model_management.unet_dtype()
49 | if dtype not in [torch.float32, torch.float16, torch.bfloat16]:
50 | dtype = torch.float16 if model_management.should_use_fp16() else torch.float32
51 | self.dtype = dtype
52 |
53 | self.work_model = model.clone()
54 | self.vae = vae
55 |
56 | self.fbc = iclight.get("fbc", False)
57 | self.sd_dict = iclight.get("sd_dict", {})
58 |
59 | self.empty_latent = None
60 |
61 | def encode(self, pixels):
62 | original_sample_mode = self.vae.first_stage_model.regularization.sample
63 | self.vae.first_stage_model.regularization.sample = False
64 | out_samples = self.vae.encode(pixels)
65 | self.vae.first_stage_model.regularization.sample = original_sample_mode
66 | return out_samples
67 |
68 | def get_concat_conds(self, fg_pixels, bg_pixels=None):
69 | fg_samples = self.encode(fg_pixels)
70 | self.empty_latent = torch.zeros_like(fg_samples)
71 | if self.fbc:
72 | if bg_pixels is None:
73 | raise ValueError("When using background-conditioned Model, 'bg_pixel' is required")
74 |
75 | bg_pixels = resize_and_center_crop(bg_pixels, fg_pixels.shape[2], fg_pixels.shape[1])
76 | bg_samples = self.encode(bg_pixels)
77 |
78 | fg_batch_size = bg_samples.size(0) // fg_samples.size(0)
79 | bg_batch_size = fg_samples.size(0) // bg_samples.size(0)
80 |
81 | if fg_batch_size > 1:
82 | fg_samples = fg_samples.repeat(fg_batch_size, 1, 1, 1)
83 | if bg_batch_size > 1:
84 | bg_samples = bg_samples.repeat(bg_batch_size, 1, 1, 1)
85 |
86 | concat_samples = torch.cat((fg_samples, bg_samples), dim=1)
87 | else:
88 | concat_samples = fg_samples
89 |
90 |
91 |
92 | base_model: BaseModel = self.work_model.model
93 | scale_factor = base_model.model_config.latent_format.scale_factor
94 | concat_conds = concat_samples * scale_factor
95 | # concat_conds = torch.cat([c[None, ...] for c in concat_conds], dim=1)
96 |
97 | self.empty_latent = torch.zeros_like(fg_samples)
98 |
99 | return concat_conds
100 |
101 | def patch(self, strength_patch: float):
102 | # Patch ComfyUI's LoRA weight application to accept multi-channel inputs.
103 | try:
104 | ModelPatcher.calculate_weight = calculate_weight_adjust_channel(ModelPatcher.calculate_weight)
105 | except:
106 | raise Exception("Could not patch calculate_weight")
107 |
108 | ic_model_state_dict = self.sd_dict
109 |
110 | in_channels = ic_model_state_dict["input_blocks.0.0.weight"].shape[1]
111 | self.work_model.model.model_config.unet_config["in_channels"] = in_channels
112 |
113 | self.work_model.add_patches(
114 | patches={
115 | ("diffusion_model." + key): (value.to(dtype=self.dtype, device=self.device),)
116 | for key, value in ic_model_state_dict.items()
117 | }, strength_patch=strength_patch
118 | )
119 |
120 | def set_unet_function_wrapper(self, concat_conds):
121 | def apply_c_concat(params: UnetParams) -> UnetParams:
122 | sample = params["input"]
123 | params["c"]["c_concat"] = torch.cat(
124 | ([concat_conds.to(sample.device)] * (sample.shape[0] // concat_conds.shape[0])),
125 | dim=0,
126 | )
127 | return params
128 |
129 | def dummy_unet_apply(unet_apply: Callable, params: UnetParams):
130 | return unet_apply(x=params["input"], t=params["timestep"], **params["c"])
131 |
132 | model_function_wrapper = self.work_model.model_options.get("model_function_wrapper", dummy_unet_apply)
133 |
134 | def hook_model_function_wrapper(unet_apply: Callable, params: UnetParams):
135 | return model_function_wrapper(unet_apply, params=apply_c_concat(params))
136 |
137 | self.work_model.set_model_unet_function_wrapper(hook_model_function_wrapper)
138 |
139 |
140 | class ICLightModelLoader:
141 | """
142 | Class for loading and managing the weights of ICLight models.
143 | """
144 |
145 | def __init__(self):
146 | """
147 | Initializes the ICLight model loader with default state.
148 | """
149 | self.iclight = {"model": None, "sd_dict": None, "fbc": False}
150 |
151 | @classmethod
152 | def INPUT_TYPES(cls):
153 | """
154 | Class method defining the required input types for model loading.
155 |
156 | Returns:
157 | dict: A dictionary specifying the required input types for the model load operation.
158 | """
159 | return {"required": {"iclight_name": (folder_paths.get_filename_list(MODEL_TYPE_ICLIGHT),)}}
160 |
161 | RETURN_TYPES = ("ICLIGHT",)
162 | RETURN_NAMES = ("iclight",)
163 | FUNCTION = "load_iclight_model"
164 | CATEGORY = "gaffer"
165 |
166 | def load_iclight_model(self, iclight_name):
167 | """
168 | Loads the weights of an ICLight model.
169 |
170 | Parameters:
171 | iclight_name (str): The name of the ICLight model to load.
172 |
173 | Returns:
174 | tuple: A tuple containing the loaded ICLight model information.
175 |
176 | Raises:
177 | Exception: If the specified ICLight model file is not found.
178 | """
179 | LOGGER.info("Loading ICLight Model weights")
180 |
181 | # Safely retrieves the full path of the model and checks for its existence
182 | ckpt_path = folder_paths.get_full_path(MODEL_TYPE_ICLIGHT, iclight_name)
183 | if not os.path.exists(ckpt_path):
184 | error_message = f"Invalid ICLight model: {iclight_name}. File not found."
185 | LOGGER.error(error_message)
186 | raise Exception(error_message)
187 |
188 | # Loads the model securely
189 | model = load_torch_file(ckpt_path, safe_load=True)
190 |
191 | # converts it to a hardware-optimized precision
192 | sd_dict = convert_unet_state_dict(model)
193 |
194 | # Optimizes performance by converting the model's precision on demand
195 | sd_dict = {key: sd_dict[key].half() for key in sd_dict.keys()}
196 |
197 | # Updates the internal state to reflect the loaded model details
198 | self.iclight['model'] = model
199 | self.iclight['sd_dict'] = sd_dict
200 | self.iclight['fbc'] = 'fbc' in iclight_name.lower()
201 |
202 | LOGGER.info(f"ICLight model loaded from {iclight_name}")
203 | return (self.iclight,)
204 |
205 |
206 | class ApplyICLight:
207 | @classmethod
208 | def INPUT_TYPES(s):
209 | return {
210 | "required": {
211 | "model": ("MODEL",),
212 | "vae": ("VAE",),
213 | "iclight": ("ICLIGHT",),
214 | "positive": ("CONDITIONING",),
215 | "negative": ("CONDITIONING",),
216 | "fg_pixels": ("IMAGE",),
217 | "multiplier": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
218 | },
219 | "optional": {
220 | "bg_pixels": ("IMAGE",),
221 | },
222 | }
223 |
224 | RETURN_TYPES = ("MODEL", "CONDITIONING", "CONDITIONING", "LATENT")
225 | RETURN_NAMES = ("model", "positive", "negative", "empty_latent")
226 | FUNCTION = "apply"
227 | CATEGORY = "gaffer"
228 | DESCRIPTION = """"""
229 |
230 | def apply(self, model: ModelPatcher, vae: VAE, iclight, positive, negative, fg_pixels, multiplier, bg_pixels=None):
231 | iclight_patch = ICLightPatch(model, vae, iclight)
232 | # add iclight patches
233 | iclight_patch.patch(multiplier)
234 | concat_conds = iclight_patch.get_concat_conds(fg_pixels, bg_pixels)
235 | iclight_patch.set_unet_function_wrapper(concat_conds)
236 | return (iclight_patch.work_model, positive, negative, {"samples": iclight_patch.empty_latent})
237 |
238 |
239 | class LightSource:
240 | @classmethod
241 | def INPUT_TYPES(s):
242 | return {
243 | "required": {
244 | "light_position": ([member.value for member in LightPosition],),
245 | "multiplier": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 100.0, "step": 0.001}),
246 | "start_color": ("STRING", {"default": "#FFFFFF"}),
247 | "end_color": ("STRING", {"default": "#000000"}),
248 | "width": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 8, }),
249 | "height": ("INT", {"default": 512, "min": 0, "max": MAX_RESOLUTION, "step": 8, })
250 | }
251 | }
252 |
253 | RETURN_TYPES = ("IMAGE",)
254 | RETURN_NAMES = ("IMAGE",)
255 | FUNCTION = "execute"
256 | CATEGORY = "gaffer"
257 | DESCRIPTION = """
258 | Generates a gradient image that can be used
259 | as a simple light source. The color can be
260 | specified in RGB or hex format.
261 | """
262 |
263 | def execute(self, light_position, multiplier, start_color, end_color, width, height):
264 | def toRgb(color):
265 | if color.startswith('#') and len(color) == 7: # e.g. "#RRGGBB"
266 | color_rgb = tuple(int(color[i:i + 2], 16) for i in (1, 3, 5))
267 | else: # e.g. "255,255,255"
268 | color_rgb = tuple(int(i) for i in color.split(','))
269 | return color_rgb
270 |
271 | lightPosition = LightPosition(light_position)
272 | start_color_rgb = toRgb(start_color)
273 | end_color_rgb = toRgb(end_color)
274 | image = generate_gradient_image(width, height, start_color_rgb, end_color_rgb, multiplier, lightPosition)
275 |
276 | image = image.astype(np.float32) / 255.0
277 | image = torch.from_numpy(image)[None,]
278 | return (image,)
279 |
280 |
281 | class CalculateNormalMap:
282 | @classmethod
283 | def INPUT_TYPES(cls):
284 | return {
285 | "required": {
286 | "images": ("IMAGE",),
287 | "sigma": ("FLOAT", {"default": 10.0, "min": 0.01, "max": 100.0, "step": 0.01, }),
288 | "center_input_range": ("BOOLEAN", {"default": False, }),
289 | },
290 | "optional": {
291 | "mask": ("MASK",),
292 | }
293 | }
294 |
295 | RETURN_TYPES = ("IMAGE",)
296 | RETURN_NAMES = ("normal",)
297 | FUNCTION = "execute"
298 | CATEGORY = "gaffer"
299 | DESCRIPTION = """
300 | Calculates normal map from different directional exposures.
301 | Takes in 4 images as a batch:
302 | left, right, bottom, top
303 | """
304 |
305 | def execute(self, images, sigma, center_input_range, mask=None):
306 | """
307 | Executes an image processing algorithm to calculate and return a normal map.
308 |
309 | Parameters:
310 | images - A sequence of input images.
311 | sigma - The standard deviation for Gaussian blur, controlling the smoothness of the normal calculation.
312 | center_input_range - The range used to center the input images.
313 | mask - Optional, a mask image to specify the computation region.
314 |
315 | Returns:
316 | normal - The calculated normal map.
317 | """
318 |
319 | # Input validation
320 | self.validate_inputs(images, sigma, center_input_range, mask)
321 |
322 | # Centering images to adjust the brightness levels to have a mean closer to zero
323 | images = self.center_images(images, center_input_range)
324 |
325 | # Compute the normal based on image intensities and Gaussian blur
326 | normal = self.calculate_normal(images, sigma, mask)
327 |
328 | # Normalize and clamp the normal values to ensure they stay within valid ranges
329 | normal = self.normalize_and_clamp(normal)
330 |
331 | return (normal,)
332 |
333 | def validate_inputs(self, images, sigma, center_input_range, mask):
334 | if not isinstance(images, torch.Tensor) or images.ndim != 4:
335 | raise ValueError("images must be a 4-dimensional torch.Tensor")
336 | if not (0.01 <= sigma <= 100.0):
337 | raise ValueError("sigma must be between 0.01 and 100.0")
338 | if not isinstance(center_input_range, bool):
339 | raise ValueError("center_input_range must be a boolean")
340 | if mask is not None and (not isinstance(mask, torch.Tensor) or mask.ndim != 3):
341 | raise ValueError("mask must be a 3-dimensional torch.Tensor")
342 |
343 | def center_images(self, images, center_input_range):
344 | if center_input_range:
345 | images = images * 0.5 + 0.5
346 | return images
347 |
348 | def calculate_normal(self, images, sigma, mask):
349 | images_np = images.numpy().astype(np.float32)
350 | left = images_np[0]
351 | right = images_np[1]
352 | bottom = images_np[2]
353 | top = images_np[3]
354 | ambient = (left + right + bottom + top) / 4.0
355 | height, width, _ = ambient.shape
356 |
357 | def safe_divide(a, b):
358 | epsilon = 1e-5
359 | return ((a + epsilon) / (b + epsilon)) - 1.0
360 |
361 | left = safe_divide(left, ambient)
362 | right = safe_divide(right, ambient)
363 | bottom = safe_divide(bottom, ambient)
364 | top = safe_divide(top, ambient)
365 |
366 | u = (right - left) * 0.5
367 | v = (top - bottom) * 0.5
368 |
369 | u = np.mean(u, axis=2)
370 | v = np.mean(v, axis=2)
371 | h = (1.0 - u ** 2.0 - v ** 2.0).clip(0, 1e5) ** (0.5 * sigma)
372 | z = np.zeros_like(h)
373 |
374 | normal = np.stack([u, v, h], axis=2)
375 | normal /= np.sum(normal ** 2.0, axis=2, keepdims=True) ** 0.5
376 |
377 | if mask is not None:
378 | matting = mask.numpy().astype(np.float32)
379 | matting = matting[..., np.newaxis]
380 | normal = normal * matting + np.stack([z, z, 1 - z], axis=2) * (1 - matting)
381 | normal = torch.from_numpy(normal)
382 | else:
383 | normal += np.stack([z, z, 1 - z], axis=2)
384 | normal = torch.from_numpy(normal).unsqueeze(0)
385 |
386 | return normal
387 |
388 | def normalize_and_clamp(self, normal):
389 | normal = (normal + 1.0) / 2.0
390 | normal = torch.clamp(normal, 0, 1)
391 | return normal
392 |
393 |
394 | class GrayScaler:
395 | """Class to scale image regions to grey based on provided masks."""
396 | @classmethod
397 | def INPUT_TYPES(s):
398 | return {
399 | "required": {
400 | "image": ("IMAGE",),
401 | "mask": ("MASK",),
402 | "multiplier": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
403 | }
404 | }
405 |
406 | CATEGORY = "gaffer"
407 | RETURN_TYPES = ("IMAGE",)
408 | FUNCTION = "apply"
409 |
410 | def apply(self, image: torch.Tensor, mask: torch.Tensor, multiplier):
411 | """
412 | Applies grey scaling to image regions as indicated by the mask.
413 |
414 | Args:
415 | image: torch.Tensor: The input image tensor.
416 | mask: torch.Tensor: A mask tensor where 1 indicates areas to be converted to grey.
417 | multiplier: float: A value to control the intensity of the grey conversion.
418 | Returns:
419 | tuple: A tuple containing the image with masked regions turned grey.
420 | """
421 | # Validate inputs
422 | if not isinstance(image, torch.Tensor) or not isinstance(mask, torch.Tensor):
423 | raise ValueError("image and mask must be torch.Tensor types.")
424 | if image.ndim != 4 or mask.ndim not in [3, 4]:
425 | raise ValueError("image must be a 4D tensor, and mask must be a 3D or 4D tensor.")
426 |
427 | # Adjust mask dimensions if necessary
428 | if mask.ndim == 3:
429 | # [B, H, W] => [B, H, W, C=1]
430 | mask = mask.unsqueeze(-1)
431 |
432 | grey_value = 0.5 * multiplier
433 | image = image * mask + (1 - mask) * grey_value
434 |
435 | return (image,)
436 |
437 |
438 | NODE_CLASS_MAPPINGS = {
439 | "ICLightModelLoader": ICLightModelLoader,
440 | "ApplyICLight": ApplyICLight,
441 | "LightSource": LightSource,
442 | "CalculateNormalMap": CalculateNormalMap,
443 | "GrayScaler": GrayScaler
444 | }
445 | NODE_DISPLAY_NAME_MAPPINGS = {
446 | "ICLightModelLoader": "Load ICLight Model",
447 | "ApplyICLight": "Apply ICLight",
448 | "LightSource": "Simple Light Source",
449 | "CalculateNormalMap": "Calculate Normal Map",
450 | "GrayScaler": "Gray Scaler",
451 | }
452 |
--------------------------------------------------------------------------------
/image/all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/image/all.png
--------------------------------------------------------------------------------
/image/node_apply-iclight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/image/node_apply-iclight.png
--------------------------------------------------------------------------------
/image/node_calculate_normal_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/image/node_calculate_normal_map.png
--------------------------------------------------------------------------------
/image/node_gray-scaler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/image/node_gray-scaler.png
--------------------------------------------------------------------------------
/image/node_load-iclight-model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/image/node_load-iclight-model.png
--------------------------------------------------------------------------------
/image/node_simple-light-source.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/image/node_simple-light-source.png
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [project]
2 | name = "comfyui-gaffer"
3 | description = "Nodes:Load ICLight Model,Apply ICLight,Simple Light Source,Calculate Normal Map"
4 | version = "1.0.0"
5 | license = "LICENSE"
6 | dependencies = []
7 |
8 | [project.urls]
9 | Repository = "https://github.com/huagetai/ComfyUI-Gaffer"
10 | # Used by Comfy Registry https://comfyregistry.org
11 |
12 | [tool.comfy]
13 | PublisherId = ""
14 | DisplayName = "ComfyUI-Gaffer"
15 | Icon = ""
16 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/huagetai/ComfyUI-Gaffer/e2301a5dc9a169057dcd349ea6cd289aac881e9f/requirements.txt
--------------------------------------------------------------------------------
/utils/image.py:
--------------------------------------------------------------------------------
1 | ### Light Source
2 | import numpy as np
3 | from enum import Enum
4 |
5 | import torch
6 | import comfy
7 |
8 |
9 | class LightPosition(Enum):
10 | LEFT = "Left Light"
11 | RIGHT = "Right Light"
12 | TOP = "Top Light"
13 | BOTTOM = "Bottom Light"
14 | TOP_LEFT = "Top Left Light"
15 | TOP_RIGHT = "Top Right Light"
16 | BOTTOM_LEFT = "Bottom Left Light"
17 | BOTTOM_RIGHT = "Bottom Right Light"
18 |
19 |
20 | def generate_gradient_image(width: int, height: int, start_color: tuple, end_color: tuple, multiplier: float,
21 | lightPosition: LightPosition):
22 | """
23 | Generate a gradient image with a light source effect.
24 |
25 | Parameters:
26 | width (int): Width of the image.
27 | height (int): Height of the image.
28 | start_color: Starting color RGB of the gradient.
29 | end_color: Ending color RGB of the gradient.
30 | multiplier: Weight of light.
31 | lightPosition (LightPosition): Position of the light source.
32 |
33 | Returns:
34 | np.array: 2D gradient image array.
35 | """
36 | # Create a gradient from 0 to 1 and apply multiplier
37 | if lightPosition == LightPosition.LEFT:
38 | gradient = np.tile(np.linspace(0, 1, width) ** multiplier, (height, 1))
39 | elif lightPosition == LightPosition.RIGHT:
40 | gradient = np.tile(np.linspace(1, 0, width) ** multiplier, (height, 1))
41 | elif lightPosition == LightPosition.TOP:
42 | gradient = np.tile(np.linspace(0, 1, height) ** multiplier, (width, 1)).T
43 | elif lightPosition == LightPosition.BOTTOM:
44 | gradient = np.tile(np.linspace(1, 0, height) ** multiplier, (width, 1)).T
45 | elif lightPosition == LightPosition.BOTTOM_RIGHT:
46 | x = np.linspace(1, 0, width) ** multiplier
47 | y = np.linspace(1, 0, height) ** multiplier
48 | x_mesh, y_mesh = np.meshgrid(x, y)
49 | gradient = np.sqrt(x_mesh ** 2 + y_mesh ** 2) / np.sqrt(2.0)
50 | elif lightPosition == LightPosition.BOTTOM_LEFT:
51 | x = np.linspace(0, 1, width) ** multiplier
52 | y = np.linspace(1, 0, height) ** multiplier
53 | x_mesh, y_mesh = np.meshgrid(x, y)
54 | gradient = np.sqrt(x_mesh ** 2 + y_mesh ** 2) / np.sqrt(2.0)
55 | elif lightPosition == LightPosition.TOP_RIGHT:
56 | x = np.linspace(1, 0, width) ** multiplier
57 | y = np.linspace(0, 1, height) ** multiplier
58 | x_mesh, y_mesh = np.meshgrid(x, y)
59 | gradient = np.sqrt(x_mesh ** 2 + y_mesh ** 2) / np.sqrt(2.0)
60 | elif lightPosition == LightPosition.TOP_LEFT:
61 | x = np.linspace(0, 1, width) ** multiplier
62 | y = np.linspace(0, 1, height) ** multiplier
63 | x_mesh, y_mesh = np.meshgrid(x, y)
64 | gradient = np.sqrt(x_mesh ** 2 + y_mesh ** 2) / np.sqrt(2.0)
65 | else:
66 | raise ValueError(f"Unsupported position. Choose from {', '.join([member.value for member in LightPosition])}.")
67 |
68 | # Interpolate between start_color and end_color based on the gradient
69 | gradient_img = np.zeros((height, width, 3), dtype=np.float32)
70 | for i in range(3):
71 | gradient_img[..., i] = start_color[i] + (end_color[i] - start_color[i]) * gradient
72 |
73 | gradient_img = np.clip(gradient_img, 0, 255).astype(np.uint8)
74 | return gradient_img
75 |
76 |
77 | def p(image):
78 | return image.permute([0, 3, 1, 2])
79 |
80 |
81 | def pb(image):
82 | return image.permute([0, 2, 3, 1])
83 |
84 |
85 | def resize_and_center_crop(image: torch.Tensor, target_width: int, target_height: int):
86 | _, original_height, original_width, _ = image.shape
87 | if original_height == 0 or original_width == 0:
88 | raise ValueError("The width and height of the image cannot be 0")
89 |
90 | if original_width == target_width and original_height == target_height:
91 | return image
92 |
93 | outputs = p(image)
94 | outputs = comfy.utils.common_upscale(outputs, target_width, target_height, "lanczos", "center")
95 | outputs = pb(outputs)
96 |
97 | return outputs
98 |
--------------------------------------------------------------------------------
/utils/patches.py:
--------------------------------------------------------------------------------
1 | #credit to huchenlei for this
2 | #from https://github.com/huchenlei/ComfyUI-layerdiffuse/blob/151f7460bbc9d7437d4f0010f21f80178f7a84a6/layered_diffusion.py#L34-L96
3 |
4 | import torch
5 | import functools
6 | from comfy.model_patcher import ModelPatcher
7 | import comfy.model_management
8 |
9 | def calculate_weight_adjust_channel(func):
10 | """Patches ComfyUI's LoRA weight application to accept multi-channel inputs."""
11 |
12 | @functools.wraps(func)
13 | def calculate_weight(
14 | self: ModelPatcher, patches, weight: torch.Tensor, key: str
15 | ) -> torch.Tensor:
16 | weight = func(self, patches, weight, key)
17 |
18 | for p in patches:
19 | alpha = p[0]
20 | v = p[1]
21 |
22 | # The recursion call should be handled in the main func call.
23 | if isinstance(v, list):
24 | continue
25 |
26 | if len(v) == 1:
27 | patch_type = "diff"
28 | elif len(v) == 2:
29 | patch_type = v[0]
30 | v = v[1]
31 |
32 | if patch_type == "diff":
33 | w1 = v[0]
34 | if all(
35 | (
36 | alpha != 0.0,
37 | w1.shape != weight.shape,
38 | w1.ndim == weight.ndim == 4,
39 | )
40 | ):
41 | new_shape = [max(n, m) for n, m in zip(weight.shape, w1.shape)]
42 | print(
43 | f"IC-Light: Merged with {key} channel changed from {weight.shape} to {new_shape}"
44 | )
45 | new_diff = alpha * comfy.model_management.cast_to_device(
46 | w1, weight.device, weight.dtype
47 | )
48 | new_weight = torch.zeros(size=new_shape).to(weight)
49 | new_weight[
50 | : weight.shape[0],
51 | : weight.shape[1],
52 | : weight.shape[2],
53 | : weight.shape[3],
54 | ] = weight
55 | new_weight[
56 | : new_diff.shape[0],
57 | : new_diff.shape[1],
58 | : new_diff.shape[2],
59 | : new_diff.shape[3],
60 | ] += new_diff
61 | new_weight = new_weight.contiguous().clone()
62 | weight = new_weight
63 | return weight
64 |
65 | return calculate_weight
--------------------------------------------------------------------------------