RioShiina commited on
Commit
078cf09
·
verified ·
1 Parent(s): 79e946f

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. LICENSE +674 -0
  2. README.md +3 -3
  3. app.py +12 -19
  4. chain_injectors/__init__.py +0 -0
  5. chain_injectors/anima_controlnet_lllite_injector.py +48 -0
  6. chain_injectors/conditioning_injector.py +81 -0
  7. chain_injectors/controlnet_injector.py +60 -0
  8. chain_injectors/diffsynth_controlnet_injector.py +75 -0
  9. chain_injectors/flux1_ipadapter_injector.py +46 -0
  10. chain_injectors/ipadapter_injector.py +106 -0
  11. chain_injectors/lora_injector.py +67 -0
  12. chain_injectors/newbie_lora_injector.py +63 -0
  13. chain_injectors/reference_latent_injector.py +157 -0
  14. chain_injectors/sd3_ipadapter_injector.py +66 -0
  15. chain_injectors/style_injector.py +71 -0
  16. chain_injectors/vae_injector.py +30 -0
  17. comfy_integration/nodes.py +29 -1
  18. comfy_integration/setup.py +52 -6
  19. core/generation_logic.py +5 -12
  20. core/model_manager.py +32 -0
  21. core/pipelines/base_pipeline.py +12 -2
  22. core/pipelines/sd_image_pipeline.py +594 -0
  23. core/pipelines/workflow_recipes/_partials/_base_sampler_sd.yaml +36 -0
  24. core/pipelines/workflow_recipes/_partials/conditioning/anima.yaml +58 -0
  25. core/pipelines/workflow_recipes/_partials/conditioning/chroma1-radiance.yaml +59 -0
  26. core/pipelines/workflow_recipes/_partials/conditioning/chroma1.yaml +61 -0
  27. core/pipelines/workflow_recipes/_partials/conditioning/ernie-image.yaml +54 -0
  28. core/pipelines/workflow_recipes/_partials/conditioning/flux1.yaml +64 -0
  29. core/pipelines/workflow_recipes/_partials/conditioning/flux2-kv.yaml +104 -0
  30. core/pipelines/workflow_recipes/_partials/conditioning/flux2.yaml +96 -0
  31. core/pipelines/workflow_recipes/_partials/conditioning/hidream.yaml +53 -0
  32. core/pipelines/workflow_recipes/_partials/conditioning/hunyuanimage.yaml +42 -0
  33. core/pipelines/workflow_recipes/_partials/conditioning/longcat-image.yaml +83 -0
  34. core/pipelines/workflow_recipes/_partials/conditioning/lumina.yaml +57 -0
  35. core/pipelines/workflow_recipes/_partials/conditioning/newbie-image.yaml +65 -0
  36. core/pipelines/workflow_recipes/_partials/conditioning/omnigen2.yaml +59 -0
  37. core/pipelines/workflow_recipes/_partials/conditioning/ovis-image.yaml +50 -0
  38. core/pipelines/workflow_recipes/_partials/conditioning/qwen-image.yaml +80 -0
  39. core/pipelines/workflow_recipes/_partials/conditioning/sd15.yaml +69 -0
  40. core/pipelines/workflow_recipes/_partials/conditioning/sd35.yaml +58 -0
  41. core/pipelines/workflow_recipes/_partials/conditioning/sdxl.yaml +63 -0
  42. core/pipelines/workflow_recipes/_partials/conditioning/z-image.yaml +65 -0
  43. core/pipelines/workflow_recipes/_partials/input/hires_fix.yaml +27 -0
  44. core/pipelines/workflow_recipes/_partials/input/img2img.yaml +20 -0
  45. core/pipelines/workflow_recipes/_partials/input/inpaint.yaml +23 -0
  46. core/pipelines/workflow_recipes/_partials/input/outpaint.yaml +41 -0
  47. core/pipelines/workflow_recipes/_partials/input/txt2img.yaml +2 -0
  48. core/pipelines/workflow_recipes/_partials/input/txt2img_chroma_radiance_latent.yaml +11 -0
  49. core/pipelines/workflow_recipes/_partials/input/txt2img_flux2_latent.yaml +11 -0
  50. core/pipelines/workflow_recipes/_partials/input/txt2img_hunyuan_latent.yaml +11 -0
LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
- title: ControlNet Preprocessors
3
  emoji: 🖼
4
  colorFrom: purple
5
  colorTo: red
6
  sdk: gradio
7
  sdk_version: "5.50.0"
8
  app_file: app.py
9
- short_description: ControlNet Auxiliary Preprocessors
10
- ---
 
1
  ---
2
+ title: ImageGen7
3
  emoji: 🖼
4
  colorFrom: purple
5
  colorTo: red
6
  sdk: gradio
7
  sdk_version: "5.50.0"
8
  app_file: app.py
9
+ short_description: Multi-task image generator with dynamic, chainable workflows
10
+ ---
app.py CHANGED
@@ -44,11 +44,11 @@ def dummy_gpu_for_startup():
44
  print("--- [GPU Startup] Startup check passed. ---")
45
  return "Startup check passed."
46
 
 
47
  def main():
48
- from utils.app_utils import print_welcome_message
49
  from scripts import build_sage_attention
50
-
51
- print_welcome_message()
52
 
53
  print("--- [Setup] Attempting to build and install SageAttention... ---")
54
  try:
@@ -57,6 +57,9 @@ def main():
57
  except Exception as e:
58
  print(f"--- [Setup] ❌ SageAttention installation failed: {e}. Continuing with default attention. ---")
59
 
 
 
 
60
  print("--- [Setup] Reloading site-packages to detect newly installed packages... ---")
61
  try:
62
  site.main()
@@ -64,28 +67,18 @@ def main():
64
  except Exception as e:
65
  print(f"--- [Setup] ⚠️ Warning: Could not fully reload site-packages: {e} ---")
66
 
67
- from comfy_integration import setup as setup_comfyui
68
- from utils.app_utils import (
69
- build_preprocessor_model_map,
70
- build_preprocessor_parameter_map
71
- )
72
-
73
- print("--- Starting Application Setup ---")
74
-
75
- setup_comfyui.initialize_comfyui()
76
-
77
  print("--- Initiating GPU Startup Check & SageAttention Patch ---")
78
  try:
79
  dummy_gpu_for_startup()
80
  except Exception as e:
81
  print(f"--- [GPU Startup] ⚠️ Warning: Startup check failed: {e} ---")
82
 
83
- print("--- Building ControlNet preprocessor maps ---")
84
- from core.generation_logic import build_reverse_map
85
- build_reverse_map()
86
- build_preprocessor_model_map()
87
- build_preprocessor_parameter_map()
88
- print("--- ✅ ControlNet preprocessor setup complete. ---")
89
 
90
  print("--- Environment configured. Proceeding with module imports. ---")
91
  from ui.layout import build_ui
 
44
  print("--- [GPU Startup] Startup check passed. ---")
45
  return "Startup check passed."
46
 
47
+
48
  def main():
 
49
  from scripts import build_sage_attention
50
+ from comfy_integration import setup as setup_comfyui
51
+ from utils.app_utils import load_ipadapter_presets
52
 
53
  print("--- [Setup] Attempting to build and install SageAttention... ---")
54
  try:
 
57
  except Exception as e:
58
  print(f"--- [Setup] ❌ SageAttention installation failed: {e}. Continuing with default attention. ---")
59
 
60
+ print("--- [Setup] Starting ComfyUI initialization ---")
61
+ setup_comfyui.initialize_comfyui()
62
+
63
  print("--- [Setup] Reloading site-packages to detect newly installed packages... ---")
64
  try:
65
  site.main()
 
67
  except Exception as e:
68
  print(f"--- [Setup] ⚠️ Warning: Could not fully reload site-packages: {e} ---")
69
 
 
 
 
 
 
 
 
 
 
 
70
  print("--- Initiating GPU Startup Check & SageAttention Patch ---")
71
  try:
72
  dummy_gpu_for_startup()
73
  except Exception as e:
74
  print(f"--- [GPU Startup] ⚠️ Warning: Startup check failed: {e} ---")
75
 
76
+ print("--- Starting Application Setup ---")
77
+
78
+ print("--- Loading IPAdapter presets ---")
79
+ load_ipadapter_presets()
80
+ print("--- ✅ IPAdapter setup complete. ---")
81
+
82
 
83
  print("--- Environment configured. Proceeding with module imports. ---")
84
  from ui.layout import build_ui
chain_injectors/__init__.py ADDED
File without changes
chain_injectors/anima_controlnet_lllite_injector.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
6
+ if ksampler_name not in assembler.node_map:
7
+ print(f"Warning: KSampler node '{ksampler_name}' not found for Anima LLLite chain. Skipping.")
8
+ return
9
+
10
+ ksampler_id = assembler.node_map[ksampler_name]
11
+
12
+ if 'model' not in assembler.workflow[ksampler_id]['inputs']:
13
+ print(f"Warning: KSampler node '{ksampler_name}' is missing 'model' input. Skipping.")
14
+ return
15
+
16
+ current_model_connection = assembler.workflow[ksampler_id]['inputs']['model']
17
+
18
+ for item_data in chain_items:
19
+ image_loader_id = assembler._get_unique_id()
20
+ image_loader_node = assembler._get_node_template("LoadImage")
21
+ image_loader_node['inputs']['image'] = item_data['image']
22
+ assembler.workflow[image_loader_id] = image_loader_node
23
+
24
+ image_scaler_id = assembler._get_unique_id()
25
+ image_scaler_node = assembler._get_node_template("ImageScaleToTotalPixels")
26
+ image_scaler_node['inputs']['image'] = [image_loader_id, 0]
27
+ image_scaler_node['inputs']['upscale_method'] = 'nearest-exact'
28
+ image_scaler_node['inputs']['megapixels'] = 1.0
29
+ assembler.workflow[image_scaler_id] = image_scaler_node
30
+
31
+ apply_cn_id = assembler._get_unique_id()
32
+ apply_cn_node = assembler._get_node_template("AnimaLLLiteApply")
33
+
34
+ apply_cn_node['inputs']['lllite_name'] = item_data['control_net_name']
35
+ apply_cn_node['inputs']['strength'] = item_data['strength']
36
+ apply_cn_node['inputs']['start_percent'] = item_data.get('start_percent', 0.0)
37
+ apply_cn_node['inputs']['end_percent'] = item_data.get('end_percent', 1.0)
38
+
39
+ apply_cn_node['inputs']['model'] = current_model_connection
40
+ apply_cn_node['inputs']['image'] = [image_scaler_id, 0]
41
+
42
+ assembler.workflow[apply_cn_id] = apply_cn_node
43
+
44
+ current_model_connection = [apply_cn_id, 0]
45
+
46
+ assembler.workflow[ksampler_id]['inputs']['model'] = current_model_connection
47
+
48
+ print(f"Anima LLLite injector applied. KSampler model input re-routed through {len(chain_items)} LLLite(s).")
chain_injectors/conditioning_injector.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
6
+
7
+ target_node_id = None
8
+ target_input_name = None
9
+
10
+ if ksampler_name in assembler.node_map:
11
+ ksampler_id = assembler.node_map[ksampler_name]
12
+ if 'positive' in assembler.workflow[ksampler_id]['inputs']:
13
+ target_node_id = ksampler_id
14
+ target_input_name = 'positive'
15
+ print(f"Conditioning injector targeting KSampler node '{ksampler_name}'.")
16
+ else:
17
+ print(f"Warning: KSampler node '{ksampler_name}' for Conditioning chain not found. Skipping.")
18
+ return
19
+
20
+ if not target_node_id:
21
+ print("Warning: Conditioning chain could not find a valid injection point (KSampler may be missing 'positive' input). Skipping.")
22
+ return
23
+
24
+ clip_source_str = chain_definition.get('clip_source')
25
+ if not clip_source_str:
26
+ print("Warning: 'clip_source' definition missing in the recipe for the Conditioning chain. Skipping.")
27
+ return
28
+ clip_node_name, clip_idx_str = clip_source_str.split(':')
29
+ if clip_node_name not in assembler.node_map:
30
+ print(f"Warning: CLIP source node '{clip_node_name}' for Conditioning chain not found. Skipping.")
31
+ return
32
+ clip_connection = [assembler.node_map[clip_node_name], int(clip_idx_str)]
33
+
34
+ original_positive_connection = assembler.workflow[target_node_id]['inputs'][target_input_name]
35
+
36
+ area_conditioning_outputs = []
37
+
38
+ for item_data in chain_items:
39
+ prompt = item_data.get('prompt', '')
40
+ if not prompt or not prompt.strip():
41
+ continue
42
+
43
+ text_encode_id = assembler._get_unique_id()
44
+ text_encode_node = assembler._get_node_template("CLIPTextEncode")
45
+ text_encode_node['inputs']['text'] = prompt
46
+ text_encode_node['inputs']['clip'] = clip_connection
47
+ assembler.workflow[text_encode_id] = text_encode_node
48
+
49
+ set_area_id = assembler._get_unique_id()
50
+ set_area_node = assembler._get_node_template("ConditioningSetArea")
51
+ set_area_node['inputs']['width'] = item_data.get('width', 1024)
52
+ set_area_node['inputs']['height'] = item_data.get('height', 1024)
53
+ set_area_node['inputs']['x'] = item_data.get('x', 0)
54
+ set_area_node['inputs']['y'] = item_data.get('y', 0)
55
+ set_area_node['inputs']['strength'] = item_data.get('strength', 1.0)
56
+ set_area_node['inputs']['conditioning'] = [text_encode_id, 0]
57
+ assembler.workflow[set_area_id] = set_area_node
58
+
59
+ area_conditioning_outputs.append([set_area_id, 0])
60
+
61
+ if not area_conditioning_outputs:
62
+ return
63
+
64
+ current_combined_conditioning = area_conditioning_outputs[0]
65
+ if len(area_conditioning_outputs) > 1:
66
+ for i in range(1, len(area_conditioning_outputs)):
67
+ combine_id = assembler._get_unique_id()
68
+ combine_node = assembler._get_node_template("ConditioningCombine")
69
+ combine_node['inputs']['conditioning_1'] = current_combined_conditioning
70
+ combine_node['inputs']['conditioning_2'] = area_conditioning_outputs[i]
71
+ assembler.workflow[combine_id] = combine_node
72
+ current_combined_conditioning = [combine_id, 0]
73
+
74
+ final_combine_id = assembler._get_unique_id()
75
+ final_combine_node = assembler._get_node_template("ConditioningCombine")
76
+ final_combine_node['inputs']['conditioning_1'] = original_positive_connection
77
+ final_combine_node['inputs']['conditioning_2'] = current_combined_conditioning
78
+ assembler.workflow[final_combine_id] = final_combine_node
79
+
80
+ assembler.workflow[target_node_id]['inputs'][target_input_name] = [final_combine_id, 0]
81
+ print(f"Conditioning injector applied. Redirected '{target_input_name}' input with {len(area_conditioning_outputs)} regional prompts.")
chain_injectors/controlnet_injector.py ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
6
+ if ksampler_name not in assembler.node_map:
7
+ print(f"Warning: Target node '{ksampler_name}' for ControlNet chain not found. Skipping chain injection.")
8
+ return
9
+
10
+ ksampler_id = assembler.node_map[ksampler_name]
11
+
12
+ if 'positive' not in assembler.workflow[ksampler_id]['inputs'] or \
13
+ 'negative' not in assembler.workflow[ksampler_id]['inputs']:
14
+ print(f"Warning: KSampler node '{ksampler_name}' is missing 'positive' or 'negative' inputs. Skipping ControlNet chain.")
15
+ return
16
+
17
+ vae_source_str = chain_definition.get('vae_source')
18
+ if not vae_source_str:
19
+ print("Warning: 'vae_source' definition missing in the recipe for the ControlNet chain. Skipping.")
20
+ return
21
+ vae_node_name, vae_idx_str = vae_source_str.split(':')
22
+ if vae_node_name not in assembler.node_map:
23
+ print(f"Warning: VAE source node '{vae_node_name}' for ControlNet chain not found. Skipping.")
24
+ return
25
+ vae_connection = [assembler.node_map[vae_node_name], int(vae_idx_str)]
26
+
27
+ current_positive_connection = assembler.workflow[ksampler_id]['inputs']['positive']
28
+ current_negative_connection = assembler.workflow[ksampler_id]['inputs']['negative']
29
+
30
+ for item_data in chain_items:
31
+ cn_loader_id = assembler._get_unique_id()
32
+ cn_loader_node = assembler._get_node_template("ControlNetLoader")
33
+ cn_loader_node['inputs']['control_net_name'] = item_data['control_net_name']
34
+ assembler.workflow[cn_loader_id] = cn_loader_node
35
+
36
+ image_loader_id = assembler._get_unique_id()
37
+ image_loader_node = assembler._get_node_template("LoadImage")
38
+ image_loader_node['inputs']['image'] = item_data['image']
39
+ assembler.workflow[image_loader_id] = image_loader_node
40
+
41
+ apply_cn_id = assembler._get_unique_id()
42
+ apply_cn_node = assembler._get_node_template(chain_definition['template'])
43
+
44
+ apply_cn_node['inputs']['strength'] = item_data['strength']
45
+
46
+ apply_cn_node['inputs']['positive'] = current_positive_connection
47
+ apply_cn_node['inputs']['negative'] = current_negative_connection
48
+ apply_cn_node['inputs']['control_net'] = [cn_loader_id, 0]
49
+ apply_cn_node['inputs']['image'] = [image_loader_id, 0]
50
+ apply_cn_node['inputs']['vae'] = vae_connection
51
+
52
+ assembler.workflow[apply_cn_id] = apply_cn_node
53
+
54
+ current_positive_connection = [apply_cn_id, 0]
55
+ current_negative_connection = [apply_cn_id, 1]
56
+
57
+ assembler.workflow[ksampler_id]['inputs']['positive'] = current_positive_connection
58
+ assembler.workflow[ksampler_id]['inputs']['negative'] = current_negative_connection
59
+
60
+ print(f"ControlNet injector applied. KSampler inputs redirected through {len(chain_items)} ControlNet nodes.")
chain_injectors/diffsynth_controlnet_injector.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ model_sampler_name = chain_definition.get('model_sampler_node')
6
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
7
+
8
+ target_node_id = None
9
+ target_input_name = 'model'
10
+
11
+ if model_sampler_name and model_sampler_name in assembler.node_map:
12
+ model_sampler_id = assembler.node_map[model_sampler_name]
13
+ if target_input_name in assembler.workflow[model_sampler_id]['inputs']:
14
+ target_node_id = model_sampler_id
15
+ print(f"ControlNet Model Patch injector targeting ModelSamplingAuraFlow node '{model_sampler_name}'.")
16
+
17
+ if not target_node_id:
18
+ if ksampler_name in assembler.node_map:
19
+ ksampler_id = assembler.node_map[ksampler_name]
20
+ if target_input_name in assembler.workflow[ksampler_id]['inputs']:
21
+ target_node_id = ksampler_id
22
+ print(f"ControlNet Model Patch injector targeting KSampler node '{ksampler_name}'.")
23
+ else:
24
+ print(f"Warning: Neither ModelSamplingAuraFlow node '{model_sampler_name}' nor KSampler node '{ksampler_name}' found for ControlNet patch chain. Skipping.")
25
+ return
26
+
27
+ if not target_node_id:
28
+ print(f"Warning: Could not find a valid 'model' input on target nodes. Skipping ControlNet patch chain.")
29
+ return
30
+
31
+ current_model_connection = assembler.workflow[target_node_id]['inputs'][target_input_name]
32
+
33
+ vae_source_str = chain_definition.get('vae_source')
34
+ vae_connection = None
35
+ if vae_source_str:
36
+ try:
37
+ vae_node_name, vae_idx_str = vae_source_str.split(':')
38
+ if vae_node_name in assembler.node_map:
39
+ vae_connection = [assembler.node_map[vae_node_name], int(vae_idx_str)]
40
+ else:
41
+ print(f"Warning: VAE source node '{vae_node_name}' not found for ControlNet patch chain. VAE will not be connected.")
42
+ except ValueError:
43
+ print(f"Warning: Invalid 'vae_source' format '{vae_source_str}' for ControlNet patch chain. Expected 'node_name:index'. VAE will not be connected.")
44
+ else:
45
+ print(f"Warning: 'vae_source' not defined for ControlNet patch chain definition. VAE may not be connected.")
46
+
47
+ for item_data in chain_items:
48
+ patch_loader_id = assembler._get_unique_id()
49
+ patch_loader_node = assembler._get_node_template("ModelPatchLoader")
50
+ patch_loader_node['inputs']['name'] = item_data['control_net_name']
51
+ assembler.workflow[patch_loader_id] = patch_loader_node
52
+
53
+ image_loader_id = assembler._get_unique_id()
54
+ image_loader_node = assembler._get_node_template("LoadImage")
55
+ image_loader_node['inputs']['image'] = item_data['image']
56
+ assembler.workflow[image_loader_id] = image_loader_node
57
+
58
+ apply_cn_id = assembler._get_unique_id()
59
+ apply_cn_node = assembler._get_node_template(chain_definition['template'])
60
+
61
+ apply_cn_node['inputs']['strength'] = item_data.get('strength', 1.0)
62
+ apply_cn_node['inputs']['model'] = current_model_connection
63
+ apply_cn_node['inputs']['model_patch'] = [patch_loader_id, 0]
64
+ apply_cn_node['inputs']['image'] = [image_loader_id, 0]
65
+
66
+ if 'vae' in apply_cn_node['inputs'] and vae_connection:
67
+ apply_cn_node['inputs']['vae'] = vae_connection
68
+
69
+ assembler.workflow[apply_cn_id] = apply_cn_node
70
+
71
+ current_model_connection = [apply_cn_id, 0]
72
+
73
+ assembler.workflow[target_node_id]['inputs'][target_input_name] = current_model_connection
74
+
75
+ print(f"ControlNet Model Patch injector applied. Target 'model' input re-routed through {len(chain_items)} patch(es).")
chain_injectors/flux1_ipadapter_injector.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
6
+ if ksampler_name not in assembler.node_map:
7
+ print(f"Warning: KSampler node '{ksampler_name}' not found for Flux1 IPAdapter chain. Skipping.")
8
+ return
9
+
10
+ ksampler_id = assembler.node_map[ksampler_name]
11
+
12
+ if 'model' not in assembler.workflow[ksampler_id]['inputs']:
13
+ print(f"Warning: KSampler node '{ksampler_name}' is missing 'model' input. Skipping Flux1 IPAdapter chain.")
14
+ return
15
+
16
+ current_model_connection = assembler.workflow[ksampler_id]['inputs']['model']
17
+
18
+ for item_data in chain_items:
19
+ image_loader_id = assembler._get_unique_id()
20
+ image_loader_node = assembler._get_node_template("LoadImage")
21
+ image_loader_node['inputs']['image'] = item_data['image']
22
+ assembler.workflow[image_loader_id] = image_loader_node
23
+
24
+ ipadapter_loader_id = assembler._get_unique_id()
25
+ ipadapter_loader_node = assembler._get_node_template("IPAdapterFluxLoader")
26
+ ipadapter_loader_node['inputs']['ipadapter'] = "ip-adapter.bin"
27
+ ipadapter_loader_node['inputs']['clip_vision'] = "google/siglip-so400m-patch14-384"
28
+ ipadapter_loader_node['inputs']['provider'] = "cuda"
29
+ assembler.workflow[ipadapter_loader_id] = ipadapter_loader_node
30
+
31
+ apply_ipa_id = assembler._get_unique_id()
32
+ apply_ipa_node = assembler._get_node_template("ApplyIPAdapterFlux")
33
+
34
+ apply_ipa_node['inputs']['weight'] = item_data['weight']
35
+ apply_ipa_node['inputs']['start_percent'] = item_data.get('start_percent', 0.0)
36
+ apply_ipa_node['inputs']['end_percent'] = item_data.get('end_percent', 0.6)
37
+
38
+ apply_ipa_node['inputs']['model'] = current_model_connection
39
+ apply_ipa_node['inputs']['ipadapter_flux'] = [ipadapter_loader_id, 0]
40
+ apply_ipa_node['inputs']['image'] = [image_loader_id, 0]
41
+
42
+ assembler.workflow[apply_ipa_id] = apply_ipa_node
43
+ current_model_connection = [apply_ipa_id, 0]
44
+
45
+ assembler.workflow[ksampler_id]['inputs']['model'] = current_model_connection
46
+ print(f"Flux1 IPAdapter injector applied. KSampler model input re-routed through {len(chain_items)} IPAdapter(s).")
chain_injectors/ipadapter_injector.py ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ final_settings = {}
6
+ if chain_items and isinstance(chain_items[-1], dict) and chain_items[-1].get('is_final_settings'):
7
+ final_settings = chain_items.pop()
8
+
9
+ if not chain_items:
10
+ return
11
+
12
+ end_node_name = chain_definition.get('end')
13
+ if not end_node_name or end_node_name not in assembler.node_map:
14
+ print(f"Warning: Target node '{end_node_name}' for IPAdapter chain not found. Skipping chain injection.")
15
+ return
16
+
17
+ end_node_id = assembler.node_map[end_node_name]
18
+
19
+ if 'model' not in assembler.workflow[end_node_id]['inputs']:
20
+ print(f"Warning: Target node '{end_node_name}' is missing 'model' input. Skipping IPAdapter chain.")
21
+ return
22
+
23
+ current_model_connection = assembler.workflow[end_node_id]['inputs']['model']
24
+
25
+ model_type = final_settings.get('model_type', 'sdxl')
26
+ megapixels = 1.05 if model_type == 'sdxl' else 0.39
27
+
28
+ pos_embed_outputs = []
29
+ neg_embed_outputs = []
30
+
31
+ for i, item_data in enumerate(chain_items):
32
+ loader_type = 'FaceID' if 'FACEID' in item_data.get('preset', '') else 'Unified'
33
+
34
+ loader_template_name = "IPAdapterUnifiedLoader"
35
+ if loader_type == 'FaceID':
36
+ loader_template_name = "IPAdapterUnifiedLoaderFaceID"
37
+
38
+ image_loader_id = assembler._get_unique_id()
39
+ image_loader_node = assembler._get_node_template("LoadImage")
40
+ image_loader_node['inputs']['image'] = item_data['image']
41
+ assembler.workflow[image_loader_id] = image_loader_node
42
+
43
+ image_scaler_id = assembler._get_unique_id()
44
+ image_scaler_node = assembler._get_node_template("ImageScaleToTotalPixels")
45
+ image_scaler_node['inputs']['image'] = [image_loader_id, 0]
46
+ image_scaler_node['inputs']['megapixels'] = megapixels
47
+ image_scaler_node['inputs']['upscale_method'] = "lanczos"
48
+ assembler.workflow[image_scaler_id] = image_scaler_node
49
+
50
+ ipadapter_loader_id = assembler._get_unique_id()
51
+ ipadapter_loader_node = assembler._get_node_template(loader_template_name)
52
+ ipadapter_loader_node['inputs']['model'] = current_model_connection
53
+ ipadapter_loader_node['inputs']['preset'] = item_data['preset']
54
+ if loader_type == 'FaceID':
55
+ ipadapter_loader_node['inputs']['lora_strength'] = item_data.get('lora_strength', 0.6)
56
+ assembler.workflow[ipadapter_loader_id] = ipadapter_loader_node
57
+
58
+ encoder_id = assembler._get_unique_id()
59
+ encoder_node = assembler._get_node_template("IPAdapterEncoder")
60
+ encoder_node['inputs']['weight'] = item_data['weight']
61
+ encoder_node['inputs']['ipadapter'] = [ipadapter_loader_id, 1]
62
+ encoder_node['inputs']['image'] = [image_scaler_id, 0]
63
+ assembler.workflow[encoder_id] = encoder_node
64
+
65
+ pos_embed_outputs.append([encoder_id, 0])
66
+ neg_embed_outputs.append([encoder_id, 1])
67
+
68
+ pos_combiner_id = assembler._get_unique_id()
69
+ pos_combiner_node = assembler._get_node_template("IPAdapterCombineEmbeds")
70
+ pos_combiner_node['inputs']['method'] = final_settings.get('final_combine_method', 'concat')
71
+ for i, conn in enumerate(pos_embed_outputs):
72
+ pos_combiner_node['inputs'][f'embed{i+1}'] = conn
73
+ assembler.workflow[pos_combiner_id] = pos_combiner_node
74
+
75
+ neg_combiner_id = assembler._get_unique_id()
76
+ neg_combiner_node = assembler._get_node_template("IPAdapterCombineEmbeds")
77
+ neg_combiner_node['inputs']['method'] = final_settings.get('final_combine_method', 'concat')
78
+ for i, conn in enumerate(neg_embed_outputs):
79
+ neg_combiner_node['inputs'][f'embed{i+1}'] = conn
80
+ assembler.workflow[neg_combiner_id] = neg_combiner_node
81
+
82
+ final_loader_type = 'FaceID' if 'FACEID' in final_settings.get('final_preset', '') else 'Unified'
83
+ final_loader_template_name = "IPAdapterUnifiedLoader"
84
+ if final_loader_type == 'FaceID':
85
+ final_loader_template_name = "IPAdapterUnifiedLoaderFaceID"
86
+
87
+ final_loader_id = assembler._get_unique_id()
88
+ final_loader_node = assembler._get_node_template(final_loader_template_name)
89
+ final_loader_node['inputs']['model'] = current_model_connection
90
+ final_loader_node['inputs']['preset'] = final_settings.get('final_preset', 'STANDARD (medium strength)')
91
+ if final_loader_type == 'FaceID':
92
+ final_loader_node['inputs']['lora_strength'] = final_settings.get('final_lora_strength', 0.6)
93
+ assembler.workflow[final_loader_id] = final_loader_node
94
+
95
+ apply_embeds_id = assembler._get_unique_id()
96
+ apply_embeds_node = assembler._get_node_template("IPAdapterEmbeds")
97
+ apply_embeds_node['inputs']['weight'] = final_settings.get('final_weight', 1.0)
98
+ apply_embeds_node['inputs']['embeds_scaling'] = final_settings.get('final_embeds_scaling', 'V only')
99
+ apply_embeds_node['inputs']['model'] = [final_loader_id, 0]
100
+ apply_embeds_node['inputs']['ipadapter'] = [final_loader_id, 1]
101
+ apply_embeds_node['inputs']['pos_embed'] = [pos_combiner_id, 0]
102
+ apply_embeds_node['inputs']['neg_embed'] = [neg_combiner_id, 0]
103
+ assembler.workflow[apply_embeds_id] = apply_embeds_node
104
+
105
+ assembler.workflow[end_node_id]['inputs']['model'] = [apply_embeds_id, 0]
106
+ print(f"IPAdapter injector applied. Redirected '{end_node_name}' model input through {len(chain_items)} reference images.")
chain_injectors/lora_injector.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from copy import deepcopy
2
+
3
+ def inject(assembler, chain_definition, chain_items):
4
+ if not chain_items:
5
+ return
6
+
7
+ start_node_name = chain_definition.get('start')
8
+ start_node_id = None
9
+ if start_node_name:
10
+ if start_node_name not in assembler.node_map:
11
+ print(f"Warning: Start node '{start_node_name}' for dynamic LoRA chain not found. Skipping chain.")
12
+ return
13
+ start_node_id = assembler.node_map[start_node_name]
14
+
15
+ output_map = chain_definition.get('output_map', {})
16
+ current_connections = {}
17
+ for key, type_name in output_map.items():
18
+ if ':' in str(key):
19
+ node_name, idx_str = key.split(':')
20
+ if node_name not in assembler.node_map:
21
+ print(f"Warning: Node '{node_name}' in chain's output_map not found. Skipping.")
22
+ continue
23
+ node_id = assembler.node_map[node_name]
24
+ start_output_idx = int(idx_str)
25
+ current_connections[type_name] = [node_id, start_output_idx]
26
+ elif start_node_id:
27
+ start_output_idx = int(key)
28
+ current_connections[type_name] = [start_node_id, start_output_idx]
29
+ else:
30
+ print(f"Warning: LoRA chain has no 'start' node defined, and an output_map key '{key}' is not in 'node:index' format. Skipping this connection.")
31
+
32
+
33
+ input_map = chain_definition.get('input_map', {})
34
+ chain_output_map = chain_definition.get('template_output_map', { "0": "model", "1": "clip" })
35
+
36
+ for item_data in chain_items:
37
+ template_name = chain_definition['template']
38
+ template = assembler._get_node_template(template_name)
39
+ node_data = deepcopy(template)
40
+
41
+ for param_name, value in item_data.items():
42
+ if param_name in node_data['inputs']:
43
+ node_data['inputs'][param_name] = value
44
+
45
+ for type_name, input_name in input_map.items():
46
+ if type_name in current_connections:
47
+ node_data['inputs'][input_name] = current_connections[type_name]
48
+
49
+ new_node_id = assembler._get_unique_id()
50
+ assembler.workflow[new_node_id] = node_data
51
+
52
+ for idx_str, type_name in chain_output_map.items():
53
+ current_connections[type_name] = [new_node_id, int(idx_str)]
54
+
55
+ end_input_map = chain_definition.get('end_input_map', {})
56
+ for type_name, targets in end_input_map.items():
57
+ if type_name in current_connections:
58
+ if not isinstance(targets, list):
59
+ targets = [targets]
60
+
61
+ for target_str in targets:
62
+ end_node_name, end_input_name = target_str.split(':')
63
+ if end_node_name in assembler.node_map:
64
+ end_node_id = assembler.node_map[end_node_name]
65
+ assembler.workflow[end_node_id]['inputs'][end_input_name] = current_connections[type_name]
66
+ else:
67
+ print(f"Warning: End node '{end_node_name}' for dynamic chain not found. Skipping connection.")
chain_injectors/newbie_lora_injector.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from copy import deepcopy
2
+
3
+ def inject(assembler, chain_definition, chain_items):
4
+ if not chain_items:
5
+ return
6
+
7
+ output_map = chain_definition.get('output_map', {})
8
+ current_connections = {}
9
+ for key, type_name in output_map.items():
10
+ if ':' in str(key):
11
+ node_name, idx_str = key.split(':')
12
+ if node_name not in assembler.node_map:
13
+ print(f"Warning: [NewBie LoRA Injector] Node '{node_name}' in chain's output_map not found. Skipping.")
14
+ continue
15
+ node_id = assembler.node_map[node_name]
16
+ start_output_idx = int(idx_str)
17
+ current_connections[type_name] = [node_id, start_output_idx]
18
+ else:
19
+ print(f"Warning: [NewBie LoRA Injector] output_map key '{key}' is not in 'node:index' format. Skipping this connection.")
20
+
21
+ template_name = chain_definition.get('template')
22
+ if not template_name:
23
+ print(f"Warning: [NewBie LoRA Injector] No 'template' defined for chain. Skipping.")
24
+ return
25
+
26
+ for item_data in chain_items:
27
+ template = assembler._get_node_template(template_name)
28
+ node_data = deepcopy(template)
29
+
30
+ node_data['inputs']['lora_name'] = item_data.get('lora_name')
31
+ node_data['inputs']['strength'] = item_data.get('strength_model', 1.0)
32
+ node_data['inputs']['enabled'] = True
33
+
34
+ if 'model' in current_connections:
35
+ node_data['inputs']['model'] = current_connections['model']
36
+ if 'clip' in current_connections:
37
+ node_data['inputs']['clip'] = current_connections['clip']
38
+
39
+ new_node_id = assembler._get_unique_id()
40
+ assembler.workflow[new_node_id] = node_data
41
+
42
+ current_connections['model'] = [new_node_id, 0]
43
+ current_connections['clip'] = [new_node_id, 1]
44
+
45
+ end_input_map = chain_definition.get('end_input_map', {})
46
+ for type_name, targets in end_input_map.items():
47
+ if type_name in current_connections:
48
+ if not isinstance(targets, list):
49
+ targets = [targets]
50
+
51
+ for target_str in targets:
52
+ try:
53
+ end_node_name, end_input_name = target_str.split(':')
54
+ if end_node_name in assembler.node_map:
55
+ end_node_id = assembler.node_map[end_node_name]
56
+ assembler.workflow[end_node_id]['inputs'][end_input_name] = current_connections[type_name]
57
+ else:
58
+ print(f"Warning: [NewBie LoRA Injector] End node '{end_node_name}' for dynamic chain not found. Skipping connection.")
59
+ except ValueError:
60
+ print(f"Warning: [NewBie LoRA Injector] Invalid target format '{target_str}' in end_input_map. Skipping.")
61
+
62
+ if chain_items:
63
+ print(f"NewBie LoRA injector applied. Re-routed model and clip through {len(chain_items)} LoRA(s).")
chain_injectors/reference_latent_injector.py ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ guider_node_name = chain_definition.get('guider_node')
6
+ guider_target_inputs = chain_definition.get('guider_target_inputs', [])
7
+ start_connections_map = chain_definition.get('start_connections', {})
8
+ vae_node_name = chain_definition.get('vae_node', 'vae_loader')
9
+
10
+ if guider_node_name and guider_node_name in assembler.node_map and guider_target_inputs:
11
+ guider_id = assembler.node_map[guider_node_name]
12
+ if vae_node_name not in assembler.node_map:
13
+ print(f"Warning: VAE node '{vae_node_name}' not found for Guider chain. Skipping.")
14
+ return
15
+ vae_node_id = assembler.node_map[vae_node_name]
16
+
17
+ print(f"ReferenceLatent injector targeting DualCFGGuider node '{guider_node_name}'.")
18
+
19
+ current_connections = {}
20
+ for target_input in guider_target_inputs:
21
+ conn_str = start_connections_map.get(target_input)
22
+ if not conn_str:
23
+ print(f"Warning: No start connection defined for '{target_input}' in Guider chain. Skipping this input.")
24
+ continue
25
+ try:
26
+ node_name, idx_str = conn_str.split(':')
27
+ node_id = assembler.node_map[node_name]
28
+ current_connections[target_input] = [node_id, int(idx_str)]
29
+ except (ValueError, KeyError):
30
+ print(f"Warning: Invalid start connection '{conn_str}' for '{target_input}'. Skipping.")
31
+
32
+ encoded_latents = []
33
+ for i, img_filename in enumerate(chain_items):
34
+ load_id = assembler._get_unique_id()
35
+ load_node = assembler._get_node_template("LoadImage")
36
+ load_node['inputs']['image'] = img_filename
37
+ assembler.workflow[load_id] = load_node
38
+
39
+ scale_id = assembler._get_unique_id()
40
+ scale_node = assembler._get_node_template("ImageScaleToTotalPixels")
41
+ scale_node['inputs']['megapixels'] = 1.0
42
+ scale_node['inputs']['upscale_method'] = "lanczos"
43
+ scale_node['inputs']['image'] = [load_id, 0]
44
+ assembler.workflow[scale_id] = scale_node
45
+
46
+ vae_encode_id = assembler._get_unique_id()
47
+ vae_encode_node = assembler._get_node_template("VAEEncode")
48
+ vae_encode_node['inputs']['pixels'] = [scale_id, 0]
49
+ vae_encode_node['inputs']['vae'] = [vae_node_id, 0]
50
+ assembler.workflow[vae_encode_id] = vae_encode_node
51
+ encoded_latents.append([vae_encode_id, 0])
52
+
53
+ for target_input_name, start_connection in current_connections.items():
54
+ current_chain_head = start_connection
55
+ for i, latent_conn in enumerate(encoded_latents):
56
+ ref_latent_id = assembler._get_unique_id()
57
+ ref_latent_node = assembler._get_node_template("ReferenceLatent")
58
+ ref_latent_node['inputs']['conditioning'] = current_chain_head
59
+ ref_latent_node['inputs']['latent'] = latent_conn
60
+ ref_latent_node['_meta']['title'] = f"{target_input_name} RefLatent {i+1}"
61
+ assembler.workflow[ref_latent_id] = ref_latent_node
62
+ current_chain_head = [ref_latent_id, 0]
63
+
64
+ assembler.workflow[guider_id]['inputs'][target_input_name] = current_chain_head
65
+ print(f" - Input '{target_input_name}' of node '{guider_node_name}' re-routed through {len(chain_items)} reference images.")
66
+
67
+ return
68
+
69
+ flux_guidance_name = chain_definition.get('flux_guidance_node')
70
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
71
+
72
+ if ksampler_name not in assembler.node_map:
73
+ print(f"Warning: KSampler node '{ksampler_name}' not found for ReferenceLatent chain. Skipping.")
74
+ return
75
+ if vae_node_name not in assembler.node_map:
76
+ print(f"Warning: VAE loader node '{vae_node_name}' not found for ReferenceLatent chain. Skipping.")
77
+ return
78
+
79
+ ksampler_id = assembler.node_map[ksampler_name]
80
+ vae_node_id = assembler.node_map[vae_node_name]
81
+
82
+ pos_target_node_id = None
83
+ pos_target_input_name = None
84
+ if flux_guidance_name and flux_guidance_name in assembler.node_map:
85
+ flux_guidance_id = assembler.node_map[flux_guidance_name]
86
+ if 'conditioning' in assembler.workflow[flux_guidance_id]['inputs']:
87
+ pos_target_node_id = flux_guidance_id
88
+ pos_target_input_name = 'conditioning'
89
+ print(f"ReferenceLatent injector targeting FluxGuidance node '{flux_guidance_name}' for positive chain.")
90
+
91
+ if not pos_target_node_id:
92
+ if 'positive' in assembler.workflow[ksampler_id]['inputs']:
93
+ pos_target_node_id = ksampler_id
94
+ pos_target_input_name = 'positive'
95
+ print(f"ReferenceLatent injector targeting KSampler node '{ksampler_name}' for positive chain.")
96
+ else:
97
+ print(f"Warning: Could not find a valid positive injection point for ReferenceLatent chain. Skipping.")
98
+ return
99
+
100
+ current_pos_conditioning = assembler.workflow[pos_target_node_id]['inputs'][pos_target_input_name]
101
+
102
+ neg_target_node_id = ksampler_id
103
+ neg_target_input_name = 'negative'
104
+ if 'negative' not in assembler.workflow[neg_target_node_id]['inputs']:
105
+ print(f"Warning: KSampler node '{ksampler_name}' has no 'negative' input. Skipping negative ReferenceLatent chain.")
106
+ neg_target_node_id = None
107
+
108
+ current_neg_conditioning = None
109
+ if neg_target_node_id:
110
+ current_neg_conditioning = assembler.workflow[neg_target_node_id]['inputs'][neg_target_input_name]
111
+
112
+ for i, img_filename in enumerate(chain_items):
113
+ load_id = assembler._get_unique_id()
114
+ load_node = assembler._get_node_template("LoadImage")
115
+ load_node['inputs']['image'] = img_filename
116
+ load_node['_meta']['title'] = f"Load Reference Image {i+1}"
117
+ assembler.workflow[load_id] = load_node
118
+
119
+ scale_id = assembler._get_unique_id()
120
+ scale_node = assembler._get_node_template("ImageScaleToTotalPixels")
121
+ scale_node['inputs']['megapixels'] = 1.0
122
+ scale_node['inputs']['upscale_method'] = "lanczos"
123
+ scale_node['inputs']['image'] = [load_id, 0]
124
+ scale_node['_meta']['title'] = f"Scale Reference {i+1}"
125
+ assembler.workflow[scale_id] = scale_node
126
+
127
+ vae_encode_id = assembler._get_unique_id()
128
+ vae_encode_node = assembler._get_node_template("VAEEncode")
129
+ vae_encode_node['inputs']['pixels'] = [scale_id, 0]
130
+ vae_encode_node['inputs']['vae'] = [vae_node_id, 0]
131
+ vae_encode_node['_meta']['title'] = f"VAE Encode Reference {i+1}"
132
+ assembler.workflow[vae_encode_id] = vae_encode_node
133
+
134
+ latent_conn = [vae_encode_id, 0]
135
+
136
+ pos_ref_latent_id = assembler._get_unique_id()
137
+ pos_ref_latent_node = assembler._get_node_template("ReferenceLatent")
138
+ pos_ref_latent_node['inputs']['conditioning'] = current_pos_conditioning
139
+ pos_ref_latent_node['inputs']['latent'] = latent_conn
140
+ pos_ref_latent_node['_meta']['title'] = f"Positive ReferenceLatent {i+1}"
141
+ assembler.workflow[pos_ref_latent_id] = pos_ref_latent_node
142
+ current_pos_conditioning = [pos_ref_latent_id, 0]
143
+
144
+ if neg_target_node_id:
145
+ neg_ref_latent_id = assembler._get_unique_id()
146
+ neg_ref_latent_node = assembler._get_node_template("ReferenceLatent")
147
+ neg_ref_latent_node['inputs']['conditioning'] = current_neg_conditioning
148
+ neg_ref_latent_node['inputs']['latent'] = latent_conn
149
+ neg_ref_latent_node['_meta']['title'] = f"Negative ReferenceLatent {i+1}"
150
+ assembler.workflow[neg_ref_latent_id] = neg_ref_latent_node
151
+ current_neg_conditioning = [neg_ref_latent_id, 0]
152
+
153
+ assembler.workflow[pos_target_node_id]['inputs'][pos_target_input_name] = current_pos_conditioning
154
+ if neg_target_node_id:
155
+ assembler.workflow[neg_target_node_id]['inputs'][neg_target_input_name] = current_neg_conditioning
156
+
157
+ print(f"ReferenceLatent injector applied. Re-routed inputs through {len(chain_items)} reference images.")
chain_injectors/sd3_ipadapter_injector.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
6
+ if ksampler_name not in assembler.node_map:
7
+ print(f"Warning: KSampler node '{ksampler_name}' not found for SD3 IPAdapter chain. Skipping.")
8
+ return
9
+
10
+ ksampler_id = assembler.node_map[ksampler_name]
11
+
12
+ if 'model' not in assembler.workflow[ksampler_id]['inputs']:
13
+ print(f"Warning: KSampler node '{ksampler_name}' is missing 'model' input. Skipping SD3 IPAdapter chain.")
14
+ return
15
+
16
+ current_model_connection = assembler.workflow[ksampler_id]['inputs']['model']
17
+
18
+ clip_vision_loader_id = assembler._get_unique_id()
19
+ clip_vision_loader_node = assembler._get_node_template("CLIPVisionLoader")
20
+ clip_vision_loader_node['inputs']['clip_name'] = "sigclip_vision_patch14_384.safetensors"
21
+ assembler.workflow[clip_vision_loader_id] = clip_vision_loader_node
22
+
23
+ ipadapter_loader_id = assembler._get_unique_id()
24
+ ipadapter_loader_node = assembler._get_node_template("IPAdapterSD3Loader")
25
+ ipadapter_loader_node['inputs']['ipadapter'] = "ip-adapter_sd35l_instantx.bin"
26
+ ipadapter_loader_node['inputs']['provider'] = "cuda"
27
+ assembler.workflow[ipadapter_loader_id] = ipadapter_loader_node
28
+
29
+ for item_data in chain_items:
30
+ image_loader_id = assembler._get_unique_id()
31
+ image_loader_node = assembler._get_node_template("LoadImage")
32
+ image_loader_node['inputs']['image'] = item_data['image']
33
+ assembler.workflow[image_loader_id] = image_loader_node
34
+
35
+ image_scaler_id = assembler._get_unique_id()
36
+ image_scaler_node = assembler._get_node_template("ImageScaleToTotalPixels")
37
+ image_scaler_node['inputs']['image'] = [image_loader_id, 0]
38
+ image_scaler_node['inputs']['upscale_method'] = 'nearest-exact'
39
+ image_scaler_node['inputs']['megapixels'] = 1.0
40
+ assembler.workflow[image_scaler_id] = image_scaler_node
41
+
42
+ clip_vision_encode_id = assembler._get_unique_id()
43
+ clip_vision_encode_node = assembler._get_node_template("CLIPVisionEncode")
44
+ clip_vision_encode_node['inputs']['crop'] = "center"
45
+ clip_vision_encode_node['inputs']['clip_vision'] = [clip_vision_loader_id, 0]
46
+ clip_vision_encode_node['inputs']['image'] = [image_scaler_id, 0]
47
+ assembler.workflow[clip_vision_encode_id] = clip_vision_encode_node
48
+
49
+ apply_ipa_id = assembler._get_unique_id()
50
+ apply_ipa_node = assembler._get_node_template("ApplyIPAdapterSD3")
51
+
52
+ apply_ipa_node['inputs']['weight'] = item_data.get('weight', 1.0)
53
+ apply_ipa_node['inputs']['start_percent'] = item_data.get('start_percent', 0.0)
54
+ apply_ipa_node['inputs']['end_percent'] = item_data.get('end_percent', 1.0)
55
+
56
+ apply_ipa_node['inputs']['model'] = current_model_connection
57
+ apply_ipa_node['inputs']['ipadapter'] = [ipadapter_loader_id, 0]
58
+ apply_ipa_node['inputs']['image_embed'] = [clip_vision_encode_id, 0]
59
+
60
+ assembler.workflow[apply_ipa_id] = apply_ipa_node
61
+
62
+ current_model_connection = [apply_ipa_id, 0]
63
+
64
+ assembler.workflow[ksampler_id]['inputs']['model'] = current_model_connection
65
+
66
+ print(f"SD3 IPAdapter injector applied. KSampler model input re-routed through {len(chain_items)} IPAdapter(s).")
chain_injectors/style_injector.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ flux_guidance_name = chain_definition.get('flux_guidance_node')
6
+ ksampler_name = chain_definition.get('ksampler_node', 'ksampler')
7
+
8
+ target_node_id = None
9
+ target_input_name = None
10
+
11
+ if flux_guidance_name and flux_guidance_name in assembler.node_map:
12
+ flux_guidance_id = assembler.node_map[flux_guidance_name]
13
+ if 'conditioning' in assembler.workflow[flux_guidance_id]['inputs']:
14
+ target_node_id = flux_guidance_id
15
+ target_input_name = 'conditioning'
16
+
17
+ if not target_node_id:
18
+ if ksampler_name in assembler.node_map:
19
+ ksampler_id = assembler.node_map[ksampler_name]
20
+ if 'positive' in assembler.workflow[ksampler_id]['inputs']:
21
+ target_node_id = ksampler_id
22
+ target_input_name = 'positive'
23
+ else:
24
+ return
25
+
26
+ if not target_node_id:
27
+ return
28
+
29
+ current_conditioning = assembler.workflow[target_node_id]['inputs'][target_input_name]
30
+
31
+ style_model_loader_id = assembler._get_unique_id()
32
+ style_model_loader_node = assembler._get_node_template("StyleModelLoader")
33
+ style_model_loader_node['inputs']['style_model_name'] = "flux1-redux-dev.safetensors"
34
+ assembler.workflow[style_model_loader_id] = style_model_loader_node
35
+
36
+ clip_vision_loader_id = assembler._get_unique_id()
37
+ clip_vision_loader_node = assembler._get_node_template("CLIPVisionLoader")
38
+ clip_vision_loader_node['inputs']['clip_name'] = "sigclip_vision_patch14_384.safetensors"
39
+ assembler.workflow[clip_vision_loader_id] = clip_vision_loader_node
40
+
41
+ for item_data in chain_items:
42
+ image = item_data.get('image')
43
+ strength = item_data.get('strength', 1.0)
44
+ if not image or strength is None:
45
+ continue
46
+
47
+ load_image_id = assembler._get_unique_id()
48
+ clip_vision_encode_id = assembler._get_unique_id()
49
+ style_apply_id = assembler._get_unique_id()
50
+
51
+ load_image_node = assembler._get_node_template("LoadImage")
52
+ clip_vision_encode_node = assembler._get_node_template("CLIPVisionEncode")
53
+ style_apply_node = assembler._get_node_template("StyleModelApply")
54
+
55
+ load_image_node['inputs']['image'] = image
56
+ clip_vision_encode_node['inputs']['crop'] = "center"
57
+ clip_vision_encode_node['inputs']['clip_vision'] = [clip_vision_loader_id, 0]
58
+ clip_vision_encode_node['inputs']['image'] = [load_image_id, 0]
59
+
60
+ style_apply_node['inputs']['strength'] = strength
61
+ style_apply_node['inputs']['strength_type'] = "multiply"
62
+ style_apply_node['inputs']['conditioning'] = current_conditioning
63
+ style_apply_node['inputs']['style_model'] = [style_model_loader_id, 0]
64
+ style_apply_node['inputs']['clip_vision_output'] = [clip_vision_encode_id, 0]
65
+
66
+ assembler.workflow[load_image_id] = load_image_node
67
+ assembler.workflow[clip_vision_encode_id] = clip_vision_encode_node
68
+ assembler.workflow[style_apply_id] = style_apply_node
69
+ current_conditioning = [style_apply_id, 0]
70
+
71
+ assembler.workflow[target_node_id]['inputs'][target_input_name] = current_conditioning
chain_injectors/vae_injector.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def inject(assembler, chain_definition, chain_items):
2
+ if not chain_items:
3
+ return
4
+
5
+ vae_name = chain_items[0] if isinstance(chain_items, list) else chain_items
6
+ if not vae_name or vae_name == "None":
7
+ return
8
+
9
+ targets = chain_definition.get('targets', [])
10
+ if not targets:
11
+ return
12
+
13
+ vae_loader_id = assembler._get_unique_id()
14
+ vae_loader_node = assembler._get_node_template("VAELoader")
15
+ vae_loader_node['inputs']['vae_name'] = vae_name
16
+ assembler.workflow[vae_loader_id] = vae_loader_node
17
+
18
+ injected_count = 0
19
+ for target_str in targets:
20
+ try:
21
+ node_name, input_name = target_str.split(':')
22
+ if node_name in assembler.node_map:
23
+ node_id = assembler.node_map[node_name]
24
+ assembler.workflow[node_id]['inputs'][input_name] = [vae_loader_id, 0]
25
+ injected_count += 1
26
+ except ValueError:
27
+ print(f"Warning: Invalid VAE injector target format '{target_str}'. Expected 'node_name:input_name'.")
28
+
29
+ if injected_count > 0:
30
+ print(f"VAE injector applied. Rerouted {injected_count} connection(s) to new VAELoader ({vae_name}).")
comfy_integration/nodes.py CHANGED
@@ -1,7 +1,12 @@
1
  import asyncio
2
  import execution
3
  import server
4
- from nodes import init_extra_nodes, NODE_CLASS_MAPPINGS
 
 
 
 
 
5
 
6
  def import_custom_nodes() -> None:
7
  loop = asyncio.new_event_loop()
@@ -13,4 +18,27 @@ def import_custom_nodes() -> None:
13
 
14
  import_custom_nodes()
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  print("✅ ComfyUI custom nodes and class mappings are ready.")
 
1
  import asyncio
2
  import execution
3
  import server
4
+ from nodes import (
5
+ init_extra_nodes, CheckpointLoaderSimple, EmptyLatentImage, KSampler,
6
+ VAEDecode, SaveImage, NODE_CLASS_MAPPINGS, LoadImage, VAEEncode,
7
+ VAEEncodeForInpaint, ImagePadForOutpaint, LatentUpscaleBy, RepeatLatentBatch
8
+ )
9
+
10
 
11
  def import_custom_nodes() -> None:
12
  loop = asyncio.new_event_loop()
 
18
 
19
  import_custom_nodes()
20
 
21
+ CLIPTextEncode = NODE_CLASS_MAPPINGS['CLIPTextEncode']
22
+ CLIPTextEncodeSDXL = NODE_CLASS_MAPPINGS['CLIPTextEncodeSDXL']
23
+ LoraLoader = NODE_CLASS_MAPPINGS['LoraLoader']
24
+ CLIPSetLastLayer = NODE_CLASS_MAPPINGS['CLIPSetLastLayer']
25
+
26
+ if 'EmptyHunyuanImageLatent' in NODE_CLASS_MAPPINGS:
27
+ EmptyHunyuanImageLatent = NODE_CLASS_MAPPINGS['EmptyHunyuanImageLatent']
28
+ else:
29
+ print("⚠️ Warning: 'EmptyHunyuanImageLatent' not found in NODE_CLASS_MAPPINGS. HunyuanImage txt2img may fail if this node is required.")
30
+
31
+ try:
32
+ KSamplerNode = NODE_CLASS_MAPPINGS['KSampler']
33
+ SAMPLER_CHOICES = KSamplerNode.INPUT_TYPES()["required"]["sampler_name"][0]
34
+ SCHEDULER_CHOICES = KSamplerNode.INPUT_TYPES()["required"]["scheduler"][0]
35
+ except Exception:
36
+ print("⚠️ Could not dynamically get sampler/scheduler choices, using fallback list.")
37
+ SAMPLER_CHOICES = ['euler', 'dpmpp_2m_sde_gpu']
38
+ SCHEDULER_CHOICES = ['normal', 'karras']
39
+
40
+ checkpointloadersimple = CheckpointLoaderSimple()
41
+ loraloader = LoraLoader()
42
+
43
+
44
  print("✅ ComfyUI custom nodes and class mappings are ready.")
comfy_integration/setup.py CHANGED
@@ -2,6 +2,8 @@ import os
2
  import sys
3
  import shutil
4
 
 
 
5
  def move_and_overwrite(src, dst):
6
  if os.path.isdir(src):
7
  if os.path.exists(dst):
@@ -37,16 +39,60 @@ def initialize_comfyui():
37
  except OSError as e:
38
  print(f"⚠️ Could not remove temporary directory '{COMFYUI_TEMP_DIR}': {e}")
39
 
 
40
  print("--- Cloning third-party extensions for ComfyUI ---")
41
- controlnet_aux_path = os.path.join(APP_DIR, "custom_nodes", "comfyui_controlnet_aux")
42
- if not os.path.exists(controlnet_aux_path):
43
- os.system(f"git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git {controlnet_aux_path}")
44
- print("✅ comfyui_controlnet_aux extension cloned.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  else:
46
- print("✅ comfyui_controlnet_aux extension already exists.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  print(f"✅ Current working directory is: {os.getcwd()}")
49
 
50
  import comfy.model_management
51
  print("--- Environment Ready ---")
52
- print("✅ ComfyUI initialized.")
 
 
 
 
 
 
 
 
 
 
2
  import sys
3
  import shutil
4
 
5
+ from core.settings import *
6
+
7
  def move_and_overwrite(src, dst):
8
  if os.path.isdir(src):
9
  if os.path.exists(dst):
 
39
  except OSError as e:
40
  print(f"⚠️ Could not remove temporary directory '{COMFYUI_TEMP_DIR}': {e}")
41
 
42
+
43
  print("--- Cloning third-party extensions for ComfyUI ---")
44
+
45
+ # 1. ComfyUI_IPAdapter_plus
46
+ ipadapter_plus_path = os.path.join(APP_DIR, "custom_nodes", "ComfyUI_IPAdapter_plus")
47
+ if not os.path.exists(ipadapter_plus_path):
48
+ os.system(f"git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git {ipadapter_plus_path}")
49
+ print("✅ ComfyUI_IPAdapter_plus extension cloned.")
50
+ else:
51
+ print("✅ ComfyUI_IPAdapter_plus extension already exists.")
52
+
53
+ # 2. ComfyUI-InstantX-IPAdapter-SD3
54
+ ipadapter_plus_path = os.path.join(APP_DIR, "custom_nodes", "ComfyUI-InstantX-IPAdapter-SD3")
55
+ if not os.path.exists(ipadapter_plus_path):
56
+ os.system(f"git clone https://github.com/Slickytail/ComfyUI-InstantX-IPAdapter-SD3.git {ipadapter_plus_path}")
57
+ print("✅ ComfyUI-InstantX-IPAdapter-SD3 extension cloned.")
58
+ else:
59
+ print("✅ ComfyUI-InstantX-IPAdapter-SD3 extension already exists.")
60
+
61
+ # 3. ComfyUI-IPAdapter-Flux
62
+ ipadapter_flux_path = os.path.join(APP_DIR, "custom_nodes", "ComfyUI-IPAdapter-Flux")
63
+ if not os.path.exists(ipadapter_flux_path):
64
+ os.system(f"git clone https://github.com/Shakker-Labs/ComfyUI-IPAdapter-Flux.git {ipadapter_flux_path}")
65
+ print("✅ ComfyUI-IPAdapter-Flux extension cloned.")
66
  else:
67
+ print("✅ ComfyUI-IPAdapter-Flux extension already exists.")
68
+
69
+ # 4. ComfyUI-Newbie-Nodes
70
+ newbie_nodes_path = os.path.join(APP_DIR, "custom_nodes", "ComfyUI-Newbie-Nodes")
71
+ if not os.path.exists(newbie_nodes_path):
72
+ os.system(f"git clone https://github.com/NewBieAI-Lab/ComfyUI-Newbie-Nodes.git {newbie_nodes_path}")
73
+ print("✅ ComfyUI-Newbie-Nodes extension cloned.")
74
+ else:
75
+ print("✅ ComfyUI-Newbie-Nodes extension already exists.")
76
+
77
+ # 5. ComfyUI-Anima-LLLite
78
+ anima_controlnet_lllite_nodes_path = os.path.join(APP_DIR, "custom_nodes", "ComfyUI-Anima-LLLite")
79
+ if not os.path.exists(anima_controlnet_lllite_nodes_path):
80
+ os.system(f"git clone https://github.com/kohya-ss/ComfyUI-Anima-LLLite.git {anima_controlnet_lllite_nodes_path}")
81
+ print("✅ ComfyUI-Anima-LLLite extension cloned.")
82
+ else:
83
+ print("✅ ComfyUI-Anima-LLLite extension already exists.")
84
 
85
  print(f"✅ Current working directory is: {os.getcwd()}")
86
 
87
  import comfy.model_management
88
  print("--- Environment Ready ---")
89
+
90
+ print("✅ ComfyUI initialized with default attention mechanism.")
91
+
92
+ for dir_path in CATEGORY_TO_DIR_MAP.values():
93
+ os.makedirs(os.path.join(APP_DIR, dir_path), exist_ok=True)
94
+
95
+ os.makedirs(os.path.join(APP_DIR, INPUT_DIR), exist_ok=True)
96
+ os.makedirs(os.path.join(APP_DIR, OUTPUT_DIR), exist_ok=True)
97
+
98
+ print("✅ All required model directories are present.")
core/generation_logic.py CHANGED
@@ -1,17 +1,10 @@
1
  from typing import Any, Dict
 
2
 
3
- from core.pipelines.controlnet_preprocessor import ControlNetPreprocessorPipeline
4
 
5
- controlnet_preprocessor_pipeline = ControlNetPreprocessorPipeline()
6
 
7
- def build_reverse_map():
8
- from nodes import NODE_DISPLAY_NAME_MAPPINGS
9
- import core.pipelines.controlnet_preprocessor as cn_module
10
-
11
- if cn_module.REVERSE_DISPLAY_NAME_MAP is None:
12
- cn_module.REVERSE_DISPLAY_NAME_MAP = {v: k for k, v in NODE_DISPLAY_NAME_MAPPINGS.items()}
13
- if "Semantic Segmentor (legacy, alias for UniFormer)" not in cn_module.REVERSE_DISPLAY_NAME_MAP:
14
- cn_module.REVERSE_DISPLAY_NAME_MAP["Semantic Segmentor (legacy, alias for UniFormer)"] = "SemSegPreprocessor"
15
 
16
- def run_cn_preprocessor_entry(*args, **kwargs):
17
- return controlnet_preprocessor_pipeline.run(*args, **kwargs)
 
1
  from typing import Any, Dict
2
+ import gradio as gr
3
 
4
+ from core.pipelines.sd_image_pipeline import SdImagePipeline
5
 
6
+ sd_image_pipeline = SdImagePipeline()
7
 
 
 
 
 
 
 
 
 
8
 
9
+ def generate_image_wrapper(ui_inputs: dict, progress=gr.Progress(track_tqdm=True)):
10
+ return sd_image_pipeline.run(ui_inputs=ui_inputs, progress=progress)
core/model_manager.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gc
2
+ from typing import List
3
+ import gradio as gr
4
+ from utils.app_utils import _ensure_model_downloaded
5
+ from core.settings import ALL_MODEL_MAP
6
+
7
+ class ModelManager:
8
+ _instance = None
9
+
10
+ def __new__(cls, *args, **kwargs):
11
+ if not cls._instance:
12
+ cls._instance = super(ModelManager, cls).__new__(cls, *args, **kwargs)
13
+ return cls._instance
14
+
15
+ def __init__(self):
16
+ if hasattr(self, 'initialized'):
17
+ return
18
+ self.initialized = True
19
+ print("✅ ModelManager initialized.")
20
+
21
+ def ensure_models_downloaded(self, required_models: List[str], progress):
22
+ print(f"--- [ModelManager] Ensuring models are downloaded: {required_models} ---")
23
+ for i, display_name in enumerate(required_models):
24
+ if progress and hasattr(progress, '__call__'):
25
+ progress(i / max(len(required_models), 1), desc=f"Checking file: {display_name}")
26
+ try:
27
+ _ensure_model_downloaded(display_name, progress)
28
+ except Exception as e:
29
+ raise gr.Error(f"Failed to download model '{display_name}'. Reason: {e}")
30
+ print(f"--- [ModelManager] ✅ All required models are present on disk. ---")
31
+
32
+ model_manager = ModelManager()
core/pipelines/base_pipeline.py CHANGED
@@ -1,5 +1,5 @@
1
  from abc import ABC, abstractmethod
2
- from typing import Any
3
  import gradio as gr
4
  import spaces
5
  import tempfile
@@ -8,12 +8,22 @@ import numpy as np
8
 
9
  class BasePipeline(ABC):
10
  def __init__(self):
 
 
 
 
 
11
  pass
12
 
13
  @abstractmethod
14
  def run(self, *args, progress: gr.Progress, **kwargs) -> Any:
15
  pass
16
 
 
 
 
 
 
17
  def _execute_gpu_logic(self, gpu_function: callable, duration: int, default_duration: int, task_name: str, *args, **kwargs):
18
  final_duration = default_duration
19
  try:
@@ -28,7 +38,7 @@ class BasePipeline(ABC):
28
 
29
  return gpu_runner(*args, **kwargs)
30
 
31
- def _encode_video_from_frames(self, frames_tensor_cpu, fps: int, progress: gr.Progress) -> str:
32
  progress(0.9, desc="Encoding video on CPU...")
33
  frames_np = (frames_tensor_cpu.numpy() * 255.0).astype(np.uint8)
34
 
 
1
  from abc import ABC, abstractmethod
2
+ from typing import List, Any, Dict
3
  import gradio as gr
4
  import spaces
5
  import tempfile
 
8
 
9
  class BasePipeline(ABC):
10
  def __init__(self):
11
+ from core.model_manager import model_manager
12
+ self.model_manager = model_manager
13
+
14
+ @abstractmethod
15
+ def get_required_models(self, **kwargs) -> List[str]:
16
  pass
17
 
18
  @abstractmethod
19
  def run(self, *args, progress: gr.Progress, **kwargs) -> Any:
20
  pass
21
 
22
+ def _ensure_models_downloaded(self, progress: gr.Progress, **kwargs):
23
+ """Ensures model files are downloaded before requesting GPU."""
24
+ required_models = self.get_required_models(**kwargs)
25
+ self.model_manager.ensure_models_downloaded(required_models, progress=progress)
26
+
27
  def _execute_gpu_logic(self, gpu_function: callable, duration: int, default_duration: int, task_name: str, *args, **kwargs):
28
  final_duration = default_duration
29
  try:
 
38
 
39
  return gpu_runner(*args, **kwargs)
40
 
41
+ def _encode_video_from_frames(self, frames_tensor_cpu: 'torch.Tensor', fps: int, progress: gr.Progress) -> str:
42
  progress(0.9, desc="Encoding video on CPU...")
43
  frames_np = (frames_tensor_cpu.numpy() * 255.0).astype(np.uint8)
44
 
core/pipelines/sd_image_pipeline.py ADDED
@@ -0,0 +1,594 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import random
3
+ import shutil
4
+ import torch
5
+ import gradio as gr
6
+ from PIL import Image, ImageChops
7
+ from typing import List, Dict, Any
8
+ from collections import defaultdict, deque
9
+ import numpy as np
10
+
11
+ from .base_pipeline import BasePipeline
12
+ from core.settings import *
13
+ from comfy_integration.nodes import *
14
+ from utils.app_utils import get_value_at_index, sanitize_prompt, get_lora_path, get_embedding_path, ensure_controlnet_model_downloaded, ensure_ipadapter_models_downloaded, sanitize_filename
15
+ from core.workflow_assembler import WorkflowAssembler
16
+
17
+ class SdImagePipeline(BasePipeline):
18
+ def get_required_models(self, model_display_name: str, **kwargs) -> List[str]:
19
+ model_info = ALL_MODEL_MAP.get(model_display_name)
20
+ if not model_info:
21
+ return [model_display_name]
22
+
23
+ path_or_components = model_info[1]
24
+ if isinstance(path_or_components, dict):
25
+ return [v for v in path_or_components.values() if v and v != "pixel_space"]
26
+ else:
27
+ return [model_display_name]
28
+
29
+ def _topological_sort(self, workflow: Dict[str, Any]) -> List[str]:
30
+ graph = defaultdict(list)
31
+ in_degree = {node_id: 0 for node_id in workflow}
32
+
33
+ for node_id, node_info in workflow.items():
34
+ for input_value in node_info.get('inputs', {}).values():
35
+ if isinstance(input_value, list) and len(input_value) == 2 and isinstance(input_value[0], str):
36
+ source_node_id = input_value[0]
37
+ if source_node_id in workflow:
38
+ graph[source_node_id].append(node_id)
39
+ in_degree[node_id] += 1
40
+
41
+ queue = deque([node_id for node_id, degree in in_degree.items() if degree == 0])
42
+
43
+ sorted_nodes = []
44
+ while queue:
45
+ current_node_id = queue.popleft()
46
+ sorted_nodes.append(current_node_id)
47
+
48
+ for neighbor_node_id in graph[current_node_id]:
49
+ in_degree[neighbor_node_id] -= 1
50
+ if in_degree[neighbor_node_id] == 0:
51
+ queue.append(neighbor_node_id)
52
+
53
+ if len(sorted_nodes) != len(workflow):
54
+ raise RuntimeError("Workflow contains a cycle and cannot be executed.")
55
+
56
+ return sorted_nodes
57
+
58
+ def _execute_workflow(self, workflow: Dict[str, Any], initial_objects: Dict[str, Any]):
59
+ with torch.no_grad():
60
+ computed_outputs = initial_objects
61
+
62
+ try:
63
+ sorted_node_ids = self._topological_sort(workflow)
64
+ print(f"--- [Workflow Executor] Execution order: {sorted_node_ids}")
65
+ except RuntimeError as e:
66
+ print("--- [Workflow Executor] ERROR: Failed to sort workflow. Dumping graph details. ---")
67
+ for node_id, node_info in workflow.items():
68
+ print(f" Node {node_id} ({node_info['class_type']}):")
69
+ for input_name, input_value in node_info['inputs'].items():
70
+ if isinstance(input_value, list) and len(input_value) == 2 and isinstance(input_value[0], str):
71
+ print(f" - {input_name} <- [{input_value[0]}, {input_value[1]}]")
72
+ raise e
73
+
74
+ for node_id in sorted_node_ids:
75
+ if node_id in computed_outputs:
76
+ continue
77
+
78
+ node_info = workflow[node_id]
79
+ class_type = node_info['class_type']
80
+
81
+ is_loader_with_filename = 'Loader' in class_type and any(key.endswith('_name') for key in node_info['inputs'])
82
+ if node_id in initial_objects and is_loader_with_filename:
83
+ continue
84
+
85
+ node_class = NODE_CLASS_MAPPINGS.get(class_type)
86
+ if node_class is None:
87
+ raise RuntimeError(f"Could not find node class '{class_type}'. Is it imported in comfy_integration/nodes.py?")
88
+
89
+ node_instance = node_class()
90
+
91
+ kwargs = {}
92
+ for param_name, param_value in node_info['inputs'].items():
93
+ if isinstance(param_value, list) and len(param_value) == 2 and isinstance(param_value[0], str):
94
+ source_node_id, output_index = param_value
95
+ if source_node_id not in computed_outputs:
96
+ raise RuntimeError(f"Workflow integrity error: Output of node {source_node_id} needed for {node_id} but not yet computed.")
97
+
98
+ source_output_tuple = computed_outputs[source_node_id]
99
+ kwargs[param_name] = get_value_at_index(source_output_tuple, output_index)
100
+ else:
101
+ kwargs[param_name] = param_value
102
+
103
+ function_name = getattr(node_class, 'FUNCTION')
104
+ execution_method = getattr(node_instance, function_name)
105
+
106
+ result = execution_method(**kwargs)
107
+ computed_outputs[node_id] = result
108
+
109
+ final_node_id = None
110
+ for node_id in reversed(sorted_node_ids):
111
+ if workflow[node_id]['class_type'] == 'SaveImage':
112
+ final_node_id = node_id
113
+ break
114
+
115
+ if not final_node_id:
116
+ raise RuntimeError("Workflow does not contain a 'SaveImage' node as the output.")
117
+
118
+ save_image_inputs = workflow[final_node_id]['inputs']
119
+ image_source_node_id, image_source_index = save_image_inputs['images']
120
+
121
+ return get_value_at_index(computed_outputs[image_source_node_id], image_source_index)
122
+
123
+ def _gpu_logic(self, ui_inputs: Dict, loras_string: str, workflow: Dict[str, Any], assembler: WorkflowAssembler, progress=gr.Progress(track_tqdm=True)):
124
+ model_display_name = ui_inputs['model_display_name']
125
+
126
+ progress(0.4, desc="Executing workflow...")
127
+
128
+ initial_objects = {}
129
+
130
+ decoded_images_tensor = self._execute_workflow(workflow, initial_objects=initial_objects)
131
+
132
+ output_images = []
133
+ start_seed = ui_inputs['seed'] if ui_inputs['seed'] != -1 else random.randint(0, 2**64 - 1)
134
+ for i in range(decoded_images_tensor.shape[0]):
135
+ img_tensor = decoded_images_tensor[i]
136
+ pil_image = Image.fromarray((img_tensor.cpu().numpy() * 255.0).astype("uint8"))
137
+ current_seed = start_seed + i
138
+
139
+ width_for_meta = ui_inputs.get('width', 'N/A')
140
+ height_for_meta = ui_inputs.get('height', 'N/A')
141
+
142
+ params_string = f"{ui_inputs['positive_prompt']}\nNegative prompt: {ui_inputs['negative_prompt']}\n"
143
+ params_string += f"Steps: {ui_inputs['num_inference_steps']}, Sampler: {ui_inputs['sampler']}, Scheduler: {ui_inputs['scheduler']}, CFG scale: {ui_inputs['guidance_scale']}, Seed: {current_seed}, Size: {width_for_meta}x{height_for_meta}, Base Model: {model_display_name}"
144
+ if ui_inputs['task_type'] != 'txt2img': params_string += f", Denoise: {ui_inputs['denoise']}"
145
+ if ui_inputs.get('clip_skip') and ui_inputs['clip_skip'] != 1: params_string += f", Clip skip: {abs(ui_inputs['clip_skip'])}"
146
+ if loras_string: params_string += f", {loras_string}"
147
+
148
+ pil_image.info = {'parameters': params_string.strip()}
149
+ output_images.append(pil_image)
150
+
151
+ return output_images
152
+
153
+ def run(self, ui_inputs: Dict, progress):
154
+ progress(0, desc="Preparing models...")
155
+
156
+ task_type = ui_inputs['task_type']
157
+ model_display_name = ui_inputs['model_display_name']
158
+ model_type = MODEL_TYPE_MAP.get(model_display_name, 'sdxl')
159
+
160
+ architectures_dict = ARCHITECTURES_CONFIG.get('architectures', {})
161
+ workflow_model_type = architectures_dict.get(model_type, {}).get("model_type", "sdxl")
162
+
163
+ ui_inputs['positive_prompt'] = sanitize_prompt(ui_inputs.get('positive_prompt', ''))
164
+ ui_inputs['negative_prompt'] = sanitize_prompt(ui_inputs.get('negative_prompt', ''))
165
+
166
+ if 'clip_skip' in ui_inputs and ui_inputs['clip_skip'] is not None:
167
+ ui_inputs['clip_skip'] = -int(ui_inputs['clip_skip'])
168
+ else:
169
+ ui_inputs['clip_skip'] = -1
170
+
171
+ required_models = self.get_required_models(model_display_name=model_display_name)
172
+ self.model_manager.ensure_models_downloaded(required_models, progress=progress)
173
+
174
+ lora_data = ui_inputs.get('lora_data', [])
175
+ active_loras_for_gpu, active_loras_for_meta = [], []
176
+ if lora_data:
177
+ sources, ids, scales, files = lora_data[0::4], lora_data[1::4], lora_data[2::4], lora_data[3::4]
178
+ for i, (source, lora_id, scale, _) in enumerate(zip(sources, ids, scales, files)):
179
+ if scale > 0 and lora_id and lora_id.strip():
180
+ lora_filename = None
181
+ if source == "File":
182
+ lora_filename = sanitize_filename(lora_id)
183
+ elif source == "Civitai":
184
+ local_path, status = get_lora_path(source, lora_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
185
+ if local_path: lora_filename = os.path.basename(local_path)
186
+ else: raise gr.Error(f"Failed to prepare LoRA {lora_id}: {status}")
187
+
188
+ if lora_filename:
189
+ active_loras_for_gpu.append({"lora_name": lora_filename, "strength_model": scale, "strength_clip": scale})
190
+ active_loras_for_meta.append(f"{source} {lora_id}:{scale}")
191
+
192
+ ui_inputs['denoise'] = 1.0
193
+ if task_type == 'img2img': ui_inputs['denoise'] = ui_inputs.get('img2img_denoise', 0.7)
194
+ elif task_type == 'hires_fix': ui_inputs['denoise'] = ui_inputs.get('hires_denoise', 0.55)
195
+
196
+ temp_files_to_clean = []
197
+ if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
198
+
199
+ if task_type == 'img2img':
200
+ input_image_pil = ui_inputs.get('img2img_image')
201
+ if not input_image_pil:
202
+ raise gr.Error("Please upload an image for Image-to-Image.")
203
+ temp_file_path = os.path.join(INPUT_DIR, f"temp_input_{random.randint(1000, 9999)}.png")
204
+ input_image_pil.save(temp_file_path, "PNG")
205
+ ui_inputs['input_image'] = os.path.basename(temp_file_path)
206
+ temp_files_to_clean.append(temp_file_path)
207
+ ui_inputs['width'] = input_image_pil.width
208
+ ui_inputs['height'] = input_image_pil.height
209
+
210
+ elif task_type == 'inpaint':
211
+ inpaint_dict = ui_inputs.get('inpaint_image_dict')
212
+ if not inpaint_dict or not inpaint_dict.get('background') or not inpaint_dict.get('layers'):
213
+ raise gr.Error("Inpainting requires an input image and a drawn mask.")
214
+
215
+ background_img = inpaint_dict['background'].convert("RGBA")
216
+ composite_mask_pil = Image.new('L', background_img.size, 0)
217
+ for layer in inpaint_dict['layers']:
218
+ if layer:
219
+ layer_alpha = layer.split()[-1]
220
+ composite_mask_pil = ImageChops.lighter(composite_mask_pil, layer_alpha)
221
+
222
+ inverted_mask_alpha = Image.fromarray(255 - np.array(composite_mask_pil), mode='L')
223
+ r, g, b, _ = background_img.split()
224
+ composite_image_with_mask = Image.merge('RGBA', [r, g, b, inverted_mask_alpha])
225
+
226
+ temp_file_path = os.path.join(INPUT_DIR, f"temp_inpaint_composite_{random.randint(1000, 9999)}.png")
227
+ composite_image_with_mask.save(temp_file_path, "PNG")
228
+
229
+ ui_inputs['input_image'] = os.path.basename(temp_file_path)
230
+ temp_files_to_clean.append(temp_file_path)
231
+ ui_inputs.pop('inpaint_mask', None)
232
+
233
+ elif task_type == 'outpaint':
234
+ input_image_pil = ui_inputs.get('outpaint_image')
235
+ if not input_image_pil:
236
+ raise gr.Error("Please upload an image for Outpainting.")
237
+ temp_file_path = os.path.join(INPUT_DIR, f"temp_input_{random.randint(1000, 9999)}.png")
238
+ input_image_pil.save(temp_file_path, "PNG")
239
+ ui_inputs['input_image'] = os.path.basename(temp_file_path)
240
+ temp_files_to_clean.append(temp_file_path)
241
+
242
+ ui_inputs['megapixels'] = 0.25
243
+ ui_inputs['grow_mask_by'] = ui_inputs.get('feathering', 10)
244
+
245
+ elif task_type == 'hires_fix':
246
+ input_image_pil = ui_inputs.get('hires_image')
247
+ if not input_image_pil:
248
+ raise gr.Error("Please upload an image for Hires Fix.")
249
+ temp_file_path = os.path.join(INPUT_DIR, f"temp_input_{random.randint(1000, 9999)}.png")
250
+ input_image_pil.save(temp_file_path, "PNG")
251
+ ui_inputs['input_image'] = os.path.basename(temp_file_path)
252
+ temp_files_to_clean.append(temp_file_path)
253
+
254
+ embedding_data = ui_inputs.get('embedding_data', [])
255
+ embedding_filenames = []
256
+ if embedding_data:
257
+ emb_sources, emb_ids, emb_files = embedding_data[0::3], embedding_data[1::3], embedding_data[2::3]
258
+ for i, (source, emb_id, _) in enumerate(zip(emb_sources, emb_ids, emb_files)):
259
+ if emb_id and emb_id.strip():
260
+ emb_filename = None
261
+ if source == "File":
262
+ emb_filename = sanitize_filename(emb_id)
263
+ elif source == "Civitai":
264
+ local_path, status = get_embedding_path(source, emb_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
265
+ if local_path: emb_filename = os.path.basename(local_path)
266
+ else: raise gr.Error(f"Failed to prepare Embedding {emb_id}: {status}")
267
+
268
+ if emb_filename:
269
+ embedding_filenames.append(emb_filename)
270
+
271
+ if embedding_filenames:
272
+ embedding_prompt_text = " ".join([f"embedding:{f}" for f in embedding_filenames])
273
+ if ui_inputs['positive_prompt']:
274
+ ui_inputs['positive_prompt'] = f"{ui_inputs['positive_prompt']}, {embedding_prompt_text}"
275
+ else:
276
+ ui_inputs['positive_prompt'] = embedding_prompt_text
277
+
278
+ controlnet_data = ui_inputs.get('controlnet_data', [])
279
+ active_controlnets = []
280
+ if controlnet_data:
281
+ (cn_images, _, _, cn_strengths, cn_filepaths) = [controlnet_data[i::5] for i in range(5)]
282
+ for i in range(len(cn_images)):
283
+ if cn_images[i] and cn_strengths[i] > 0 and cn_filepaths[i] and cn_filepaths[i] != "None":
284
+ ensure_controlnet_model_downloaded(cn_filepaths[i], progress)
285
+ if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
286
+ cn_temp_path = os.path.join(INPUT_DIR, f"temp_cn_{i}_{random.randint(1000, 9999)}.png")
287
+ cn_images[i].save(cn_temp_path, "PNG")
288
+ temp_files_to_clean.append(cn_temp_path)
289
+ active_controlnets.append({
290
+ "image": os.path.basename(cn_temp_path), "strength": cn_strengths[i],
291
+ "start_percent": 0.0, "end_percent": 1.0, "control_net_name": cn_filepaths[i]
292
+ })
293
+
294
+ anima_controlnet_lllite_data = ui_inputs.get('anima_controlnet_lllite_data', [])
295
+ active_anima_controlnets = []
296
+ if anima_controlnet_lllite_data:
297
+ (cn_images, _, _, cn_strengths, cn_filepaths, cn_starts, cn_ends) = [anima_controlnet_lllite_data[i::7] for i in range(7)]
298
+ for i in range(len(cn_images)):
299
+ if cn_images[i] and cn_strengths[i] > 0 and cn_filepaths[i] and cn_filepaths[i] != "None":
300
+ from utils.app_utils import _ensure_model_downloaded
301
+ _ensure_model_downloaded(cn_filepaths[i], progress)
302
+ if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
303
+ cn_temp_path = os.path.join(INPUT_DIR, f"temp_anima_cn_{i}_{random.randint(1000, 9999)}.png")
304
+ cn_images[i].save(cn_temp_path, "PNG")
305
+ temp_files_to_clean.append(cn_temp_path)
306
+ active_anima_controlnets.append({
307
+ "image": os.path.basename(cn_temp_path), "strength": cn_strengths[i],
308
+ "start_percent": cn_starts[i], "end_percent": cn_ends[i], "control_net_name": cn_filepaths[i]
309
+ })
310
+
311
+ diffsynth_controlnet_data = ui_inputs.get('diffsynth_controlnet_data', [])
312
+ active_diffsynth_controlnets = []
313
+ if diffsynth_controlnet_data:
314
+ (cn_images, _, _, cn_strengths, cn_filepaths) = [diffsynth_controlnet_data[i::5] for i in range(5)]
315
+ for i in range(len(cn_images)):
316
+ if cn_images[i] and cn_strengths[i] > 0 and cn_filepaths[i] and cn_filepaths[i] != "None":
317
+ ensure_controlnet_model_downloaded(cn_filepaths[i], progress)
318
+
319
+ if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
320
+ cn_temp_path = os.path.join(INPUT_DIR, f"temp_diffsynth_cn_{i}_{random.randint(1000, 9999)}.png")
321
+ cn_images[i].save(cn_temp_path, "PNG")
322
+ temp_files_to_clean.append(cn_temp_path)
323
+ active_diffsynth_controlnets.append({
324
+ "image": os.path.basename(cn_temp_path), "strength": cn_strengths[i],
325
+ "control_net_name": cn_filepaths[i]
326
+ })
327
+
328
+ ipadapter_data = ui_inputs.get('ipadapter_data', [])
329
+ active_ipadapters = []
330
+ if ipadapter_data:
331
+ num_ipa_units = (len(ipadapter_data) - 5) // 3
332
+ final_preset, final_weight, final_lora_strength, final_embeds_scaling, final_combine_method = ipadapter_data[-5:]
333
+ ipa_images, ipa_weights, ipa_lora_strengths = [ipadapter_data[i*num_ipa_units:(i+1)*num_ipa_units] for i in range(3)]
334
+ all_presets_to_download = set()
335
+ for i in range(num_ipa_units):
336
+ if ipa_images[i] and ipa_weights[i] > 0 and final_preset:
337
+ all_presets_to_download.add(final_preset)
338
+ if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
339
+ ipa_temp_path = os.path.join(INPUT_DIR, f"temp_ipa_{i}_{random.randint(1000, 9999)}.png")
340
+ ipa_images[i].save(ipa_temp_path, "PNG")
341
+ temp_files_to_clean.append(ipa_temp_path)
342
+ active_ipadapters.append({
343
+ "image": os.path.basename(ipa_temp_path), "preset": final_preset,
344
+ "weight": ipa_weights[i], "lora_strength": ipa_lora_strengths[i]
345
+ })
346
+ if active_ipadapters and final_preset:
347
+ all_presets_to_download.add(final_preset)
348
+ for preset in all_presets_to_download:
349
+ ensure_ipadapter_models_downloaded(preset, progress)
350
+
351
+ model_type_key = 'sd15' if workflow_model_type == 'sd15' else 'sdxl'
352
+ if active_ipadapters:
353
+ active_ipadapters.append({
354
+ 'is_final_settings': True, 'model_type': model_type_key, 'final_preset': final_preset,
355
+ 'final_weight': final_weight, 'final_lora_strength': final_lora_strength,
356
+ 'final_embeds_scaling': final_embeds_scaling, 'final_combine_method': final_combine_method
357
+ })
358
+
359
+ flux1_ipadapter_data = ui_inputs.get('flux1_ipadapter_data', [])
360
+ active_flux1_ipadapters = []
361
+ if flux1_ipadapter_data:
362
+ num_units = len(flux1_ipadapter_data) // 4
363
+ f_images = flux1_ipadapter_data[0*num_units : 1*num_units]
364
+ f_weights = flux1_ipadapter_data[1*num_units : 2*num_units]
365
+ f_starts = flux1_ipadapter_data[2*num_units : 3*num_units]
366
+ f_ends = flux1_ipadapter_data[3*num_units : 4*num_units]
367
+ for i in range(len(f_images)):
368
+ if f_images[i] and f_weights[i] > 0:
369
+ from utils.app_utils import _ensure_model_downloaded
370
+ for filename in ["ip-adapter.bin"]:
371
+ _ensure_model_downloaded(filename, progress)
372
+
373
+ from huggingface_hub import snapshot_download
374
+ progress(0.5, desc="Caching HF SigLIP model...")
375
+ snapshot_download(
376
+ repo_id="google/siglip-so400m-patch14-384",
377
+ allow_patterns=["*.json", "*.safetensors", "*.txt"],
378
+ ignore_patterns=["*.msgpack", "*.h5", "*.bin"]
379
+ )
380
+
381
+ temp_path = os.path.join(INPUT_DIR, f"temp_fipa_{i}_{random.randint(1000, 9999)}.png")
382
+ f_images[i].save(temp_path, "PNG")
383
+ temp_files_to_clean.append(temp_path)
384
+ active_flux1_ipadapters.append({
385
+ "image": os.path.basename(temp_path),
386
+ "weight": f_weights[i], "start_percent": f_starts[i], "end_percent": f_ends[i]
387
+ })
388
+
389
+ sd3_ipadapter_data = ui_inputs.get('sd3_ipadapter_chain', [])
390
+ active_sd3_ipadapters = []
391
+ if sd3_ipadapter_data:
392
+ num_units = len(sd3_ipadapter_data) // 4
393
+ s_images = sd3_ipadapter_data[0*num_units : 1*num_units]
394
+ s_weights = sd3_ipadapter_data[1*num_units : 2*num_units]
395
+ s_starts = sd3_ipadapter_data[2*num_units : 3*num_units]
396
+ s_ends = sd3_ipadapter_data[3*num_units : 4*num_units]
397
+ sd3_ipa_downloaded = False
398
+ for i in range(len(s_images)):
399
+ if s_images[i] and s_weights[i] > 0:
400
+ if not sd3_ipa_downloaded:
401
+ from utils.app_utils import ensure_sd3_ipadapter_models_downloaded
402
+ ensure_sd3_ipadapter_models_downloaded(progress)
403
+ sd3_ipa_downloaded = True
404
+ temp_path = os.path.join(INPUT_DIR, f"temp_s3ipa_{i}_{random.randint(1000, 9999)}.png")
405
+ s_images[i].save(temp_path, "PNG")
406
+ temp_files_to_clean.append(temp_path)
407
+ active_sd3_ipadapters.append({
408
+ "image": os.path.basename(temp_path),
409
+ "weight": s_weights[i], "start_percent": s_starts[i], "end_percent": s_ends[i]
410
+ })
411
+
412
+ style_data = ui_inputs.get('style_data', [])
413
+ active_styles = []
414
+ if style_data:
415
+ num_units = len(style_data) // 2
416
+ st_images = style_data[0*num_units : 1*num_units]
417
+ st_strengths = style_data[1*num_units : 2*num_units]
418
+ for i in range(len(st_images)):
419
+ if st_images[i] and st_strengths[i] > 0:
420
+ from utils.app_utils import _ensure_model_downloaded
421
+ _ensure_model_downloaded("sigclip_vision_patch14_384.safetensors", progress)
422
+ temp_path = os.path.join(INPUT_DIR, f"temp_style_{i}_{random.randint(1000, 9999)}.png")
423
+ st_images[i].save(temp_path, "PNG")
424
+ temp_files_to_clean.append(temp_path)
425
+ active_styles.append({
426
+ "image": os.path.basename(temp_path), "strength": st_strengths[i]
427
+ })
428
+
429
+ reference_latent_data = ui_inputs.get('reference_latent_data', [])
430
+ active_reference_latents = []
431
+ if reference_latent_data:
432
+ for img in reference_latent_data:
433
+ if img:
434
+ if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
435
+ temp_path = os.path.join(INPUT_DIR, f"temp_ref_{random.randint(1000, 9999)}.png")
436
+ img.save(temp_path, "PNG")
437
+ temp_files_to_clean.append(temp_path)
438
+ active_reference_latents.append(os.path.basename(temp_path))
439
+
440
+ from utils.app_utils import get_vae_path
441
+ vae_source = ui_inputs.get('vae_source')
442
+ vae_id = ui_inputs.get('vae_id')
443
+ vae_name_override = None
444
+ if vae_source and vae_source != "None":
445
+ if vae_source == "File":
446
+ vae_name_override = sanitize_filename(vae_id)
447
+ elif vae_source == "Civitai" and vae_id and vae_id.strip():
448
+ local_path, status = get_vae_path(vae_source, vae_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
449
+ if local_path: vae_name_override = os.path.basename(local_path)
450
+ else: raise gr.Error(f"Failed to prepare VAE {vae_id}: {status}")
451
+ if vae_name_override:
452
+ ui_inputs['vae_name'] = vae_name_override
453
+
454
+ conditioning_data = ui_inputs.get('conditioning_data', [])
455
+ active_conditioning = []
456
+ if conditioning_data:
457
+ num_units = len(conditioning_data) // 6
458
+ prompts, widths, heights, xs, ys, strengths = [conditioning_data[i*num_units : (i+1)*num_units] for i in range(6)]
459
+ for i in range(num_units):
460
+ if prompts[i] and prompts[i].strip():
461
+ active_conditioning.append({
462
+ "prompt": prompts[i], "width": int(widths[i]), "height": int(heights[i]),
463
+ "x": int(xs[i]), "y": int(ys[i]), "strength": float(strengths[i])
464
+ })
465
+
466
+ loras_string = f"LoRAs: [{', '.join(active_loras_for_meta)}]" if active_loras_for_meta else ""
467
+
468
+ progress(0.8, desc="Assembling workflow...")
469
+
470
+ if ui_inputs.get('seed') == -1:
471
+ ui_inputs['seed'] = random.randint(0, 2**32 - 1)
472
+
473
+ model_info = ALL_MODEL_MAP[model_display_name]
474
+ path_or_components = model_info[1]
475
+ latent_type = model_info[3] if len(model_info) > 3 and model_info[3] else 'latent'
476
+ latent_generator_template = "EmptyLatentImage"
477
+ if latent_type == 'sd3_latent':
478
+ latent_generator_template = "EmptySD3LatentImage"
479
+ elif latent_type == 'chroma_radiance_latent':
480
+ latent_generator_template = "EmptyChromaRadianceLatentImage"
481
+ elif latent_type == 'hunyuan_latent':
482
+ latent_generator_template = "EmptyHunyuanImageLatent"
483
+
484
+ dynamic_values = {
485
+ 'task_type': ui_inputs['task_type'],
486
+ 'model_type': workflow_model_type,
487
+ 'latent_type': latent_type,
488
+ 'latent_generator_template': latent_generator_template
489
+ }
490
+
491
+ recipe_path = os.path.join(os.path.dirname(__file__), "workflow_recipes", "sd_unified_recipe.yaml")
492
+ assembler = WorkflowAssembler(recipe_path, dynamic_values=dynamic_values)
493
+
494
+ workflow_inputs = {
495
+ **ui_inputs,
496
+ "positive_prompt": ui_inputs['positive_prompt'], "negative_prompt": ui_inputs['negative_prompt'],
497
+ "seed": ui_inputs['seed'], "steps": ui_inputs['num_inference_steps'], "cfg": ui_inputs['guidance_scale'],
498
+ "sampler_name": ui_inputs['sampler'], "scheduler": ui_inputs['scheduler'],
499
+ "batch_size": ui_inputs['batch_size'],
500
+ "clip_skip": ui_inputs['clip_skip'],
501
+ "denoise": ui_inputs['denoise'],
502
+ "vae_name": ui_inputs.get('vae_name'),
503
+ "guidance": ui_inputs.get('guidance', 3.5),
504
+ "lora_chain": active_loras_for_gpu,
505
+ "controlnet_chain": active_controlnets if not active_anima_controlnets else [],
506
+ "anima_controlnet_lllite_chain": active_anima_controlnets,
507
+ "diffsynth_controlnet_chain": active_diffsynth_controlnets,
508
+ "ipadapter_chain": active_ipadapters,
509
+ "flux1_ipadapter_chain": active_flux1_ipadapters,
510
+ "sd3_ipadapter_chain": active_sd3_ipadapters,
511
+ "style_chain": active_styles,
512
+ "conditioning_chain": active_conditioning,
513
+ "reference_latent_chain": active_reference_latents,
514
+ "vae_chain": [ui_inputs.get('vae_name')] if ui_inputs.get('vae_name') else [],
515
+ }
516
+
517
+ if isinstance(path_or_components, dict):
518
+ workflow_inputs.update({
519
+ 'unet_name': path_or_components.get('unet'),
520
+ 'vae_name': ui_inputs.get('vae_name') or path_or_components.get('vae'),
521
+ 'clip_name': path_or_components.get('clip'),
522
+ 'clip1_name': path_or_components.get('clip1'),
523
+ 'clip2_name': path_or_components.get('clip2'),
524
+ 'clip3_name': path_or_components.get('clip3'),
525
+ 'clip4_name': path_or_components.get('clip4'),
526
+ 'lora_name': path_or_components.get('lora'),
527
+ })
528
+ else:
529
+ workflow_inputs['model_name'] = path_or_components
530
+
531
+ if task_type == 'txt2img':
532
+ workflow_inputs['width'] = ui_inputs['width']
533
+ workflow_inputs['height'] = ui_inputs['height']
534
+
535
+ workflow = assembler.assemble(workflow_inputs)
536
+
537
+ progress(1.0, desc="All models ready. Requesting GPU for generation...")
538
+
539
+ try:
540
+ results = self._execute_gpu_logic(
541
+ self._gpu_logic,
542
+ duration=ui_inputs['zero_gpu_duration'],
543
+ default_duration=60,
544
+ task_name=f"ImageGen ({task_type})",
545
+ ui_inputs=ui_inputs,
546
+ loras_string=loras_string,
547
+ workflow=workflow,
548
+ assembler=assembler,
549
+ progress=progress
550
+ )
551
+
552
+ import json
553
+ import glob
554
+ from PIL import PngImagePlugin
555
+
556
+ prompt_json = json.dumps(workflow)
557
+
558
+ out_dir = os.path.abspath(OUTPUT_DIR)
559
+ os.makedirs(out_dir, exist_ok=True)
560
+
561
+ try:
562
+ existing_files = glob.glob(os.path.join(out_dir, "gen_*.png"))
563
+ existing_files.sort(key=os.path.getmtime)
564
+ while len(existing_files) > 50:
565
+ os.remove(existing_files.pop(0))
566
+ except Exception as e:
567
+ print(f"Warning: Failed to cleanup output dir: {e}")
568
+
569
+ final_results = []
570
+ for img in results:
571
+ if not isinstance(img, Image.Image):
572
+ final_results.append(img)
573
+ continue
574
+
575
+ metadata = PngImagePlugin.PngInfo()
576
+ params_string = img.info.get("parameters", "")
577
+ if params_string:
578
+ metadata.add_text("parameters", params_string)
579
+ metadata.add_text("prompt", prompt_json)
580
+
581
+ filename = f"gen_{random.randint(1000000, 9999999)}.png"
582
+ filepath = os.path.join(out_dir, filename)
583
+ img.save(filepath, "PNG", pnginfo=metadata)
584
+ final_results.append(filepath)
585
+
586
+ results = final_results
587
+
588
+ finally:
589
+ for temp_file in temp_files_to_clean:
590
+ if temp_file and os.path.exists(temp_file):
591
+ os.remove(temp_file)
592
+ print(f"✅ Cleaned up temp file: {temp_file}")
593
+
594
+ return results
core/pipelines/workflow_recipes/_partials/_base_sampler_sd.yaml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ pos_prompt:
3
+ class_type: CLIPTextEncode
4
+ title: "CLIP Text Encode (Positive)"
5
+ neg_prompt:
6
+ class_type: CLIPTextEncode
7
+ title: "CLIP Text Encode (Negative)"
8
+ ksampler:
9
+ class_type: KSampler
10
+ title: "KSampler"
11
+ params:
12
+ denoise: 1.0
13
+ vae_decode:
14
+ class_type: VAEDecode
15
+ title: "VAE Decode"
16
+ save_image:
17
+ class_type: SaveImage
18
+ title: "Save Image"
19
+ params: {}
20
+
21
+ connections:
22
+ - from: "ksampler:0"
23
+ to: "vae_decode:samples"
24
+ - from: "vae_decode:0"
25
+ to: "save_image:images"
26
+
27
+ ui_map:
28
+ positive_prompt: "pos_prompt:text"
29
+ negative_prompt: "neg_prompt:text"
30
+ seed: "ksampler:seed"
31
+ steps: "ksampler:steps"
32
+ cfg: "ksampler:cfg"
33
+ sampler_name: "ksampler:sampler_name"
34
+ scheduler: "ksampler:scheduler"
35
+ denoise: "ksampler:denoise"
36
+ filename_prefix: "save_image:filename_prefix"
core/pipelines/workflow_recipes/_partials/conditioning/anima.yaml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load CLIP"
13
+ params:
14
+ type: "stable_diffusion"
15
+ device: "default"
16
+
17
+ connections:
18
+ - from: "unet_loader:0"
19
+ to: "ksampler:model"
20
+ - from: "clip_loader:0"
21
+ to: "pos_prompt:clip"
22
+ - from: "clip_loader:0"
23
+ to: "neg_prompt:clip"
24
+ - from: "vae_loader:0"
25
+ to: "vae_decode:vae"
26
+ - from: "vae_loader:0"
27
+ to: "vae_encode:vae"
28
+ - from: "pos_prompt:0"
29
+ to: "ksampler:positive"
30
+ - from: "neg_prompt:0"
31
+ to: "ksampler:negative"
32
+
33
+ dynamic_lora_chains:
34
+ lora_chain:
35
+ template: "LoraLoader"
36
+ output_map:
37
+ "unet_loader:0": "model"
38
+ "clip_loader:0": "clip"
39
+ input_map:
40
+ "model": "model"
41
+ "clip": "clip"
42
+ end_input_map:
43
+ "model": ["ksampler:model"]
44
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
45
+
46
+ dynamic_anima_controlnet_lllite_chains:
47
+ anima_controlnet_lllite_chain:
48
+ ksampler_node: "ksampler"
49
+
50
+ dynamic_conditioning_chains:
51
+ conditioning_chain:
52
+ ksampler_node: "ksampler"
53
+ clip_source: "clip_loader:0"
54
+
55
+ ui_map:
56
+ unet_name: "unet_loader:unet_name"
57
+ vae_name: "vae_loader:vae_name"
58
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/conditioning/chroma1-radiance.yaml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ params:
11
+ vae_name: "pixel_space"
12
+ clip_loader:
13
+ class_type: CLIPLoader
14
+ title: "Load CLIP"
15
+ params:
16
+ type: "chroma"
17
+ device: "default"
18
+ t5_tokenizer:
19
+ class_type: T5TokenizerOptions
20
+ title: "T5TokenizerOptions"
21
+ params:
22
+ min_padding: 0
23
+ min_length: 3
24
+ model_sampler:
25
+ class_type: ModelSamplingAuraFlow
26
+ params:
27
+ shift: 3.0
28
+
29
+ connections:
30
+ - from: "unet_loader:0"
31
+ to: "model_sampler:model"
32
+ - from: "model_sampler:0"
33
+ to: "ksampler:model"
34
+
35
+ - from: "clip_loader:0"
36
+ to: "t5_tokenizer:clip"
37
+ - from: "t5_tokenizer:0"
38
+ to: "pos_prompt:clip"
39
+ - from: "t5_tokenizer:0"
40
+ to: "neg_prompt:clip"
41
+
42
+ - from: "pos_prompt:0"
43
+ to: "ksampler:positive"
44
+ - from: "neg_prompt:0"
45
+ to: "ksampler:negative"
46
+
47
+ - from: "vae_loader:0"
48
+ to: "vae_decode:vae"
49
+ - from: "vae_loader:0"
50
+ to: "vae_encode:vae"
51
+
52
+ dynamic_conditioning_chains:
53
+ conditioning_chain:
54
+ ksampler_node: "ksampler"
55
+ clip_source: "t5_tokenizer:0"
56
+
57
+ ui_map:
58
+ unet_name: "unet_loader:unet_name"
59
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/conditioning/chroma1.yaml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load CLIP"
13
+ params:
14
+ type: "chroma"
15
+ device: "default"
16
+ t5_tokenizer:
17
+ class_type: T5TokenizerOptions
18
+ title: "T5TokenizerOptions"
19
+ params:
20
+ min_padding: 1
21
+ min_length: 0
22
+ fresca:
23
+ class_type: FreSca
24
+ title: "FreSca"
25
+ params:
26
+ scale_low: 1.0
27
+ scale_high: 2.5
28
+ freq_cutoff: 30
29
+
30
+ connections:
31
+ - from: "unet_loader:0"
32
+ to: "fresca:model"
33
+ - from: "fresca:0"
34
+ to: "ksampler:model"
35
+
36
+ - from: "clip_loader:0"
37
+ to: "t5_tokenizer:clip"
38
+ - from: "t5_tokenizer:0"
39
+ to: "pos_prompt:clip"
40
+ - from: "t5_tokenizer:0"
41
+ to: "neg_prompt:clip"
42
+
43
+ - from: "pos_prompt:0"
44
+ to: "ksampler:positive"
45
+ - from: "neg_prompt:0"
46
+ to: "ksampler:negative"
47
+
48
+ - from: "vae_loader:0"
49
+ to: "vae_decode:vae"
50
+ - from: "vae_loader:0"
51
+ to: "vae_encode:vae"
52
+
53
+ dynamic_conditioning_chains:
54
+ conditioning_chain:
55
+ ksampler_node: "ksampler"
56
+ clip_source: "t5_tokenizer:0"
57
+
58
+ ui_map:
59
+ unet_name: "unet_loader:unet_name"
60
+ vae_name: "vae_loader:vae_name"
61
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/conditioning/ernie-image.yaml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ clip_loader:
8
+ class_type: CLIPLoader
9
+ title: "Load CLIP"
10
+ params:
11
+ type: "flux2"
12
+ device: "default"
13
+ vae_loader:
14
+ class_type: VAELoader
15
+ title: "Load VAE"
16
+
17
+ connections:
18
+ - from: "unet_loader:0"
19
+ to: "ksampler:model"
20
+ - from: "clip_loader:0"
21
+ to: "pos_prompt:clip"
22
+ - from: "clip_loader:0"
23
+ to: "neg_prompt:clip"
24
+ - from: "pos_prompt:0"
25
+ to: "ksampler:positive"
26
+ - from: "neg_prompt:0"
27
+ to: "ksampler:negative"
28
+ - from: "vae_loader:0"
29
+ to: "vae_decode:vae"
30
+ - from: "vae_loader:0"
31
+ to: "vae_encode:vae"
32
+
33
+ dynamic_lora_chains:
34
+ lora_chain:
35
+ template: "LoraLoader"
36
+ output_map:
37
+ "unet_loader:0": "model"
38
+ "clip_loader:0": "clip"
39
+ input_map:
40
+ "model": "model"
41
+ "clip": "clip"
42
+ end_input_map:
43
+ "model": ["ksampler:model"]
44
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
45
+
46
+ dynamic_conditioning_chains:
47
+ conditioning_chain:
48
+ ksampler_node: "ksampler"
49
+ clip_source: "clip_loader:0"
50
+
51
+ ui_map:
52
+ unet_name: "unet_loader:unet_name"
53
+ clip_name: "clip_loader:clip_name"
54
+ vae_name: "vae_loader:vae_name"
core/pipelines/workflow_recipes/_partials/conditioning/flux1.yaml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load FLUX UNET"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load FLUX VAE"
10
+ clip_loader:
11
+ class_type: DualCLIPLoader
12
+ title: "Load FLUX Dual CLIP"
13
+ params:
14
+ type: "flux"
15
+ device: "default"
16
+ flux_guidance:
17
+ class_type: FluxGuidance
18
+ title: "FluxGuidance"
19
+
20
+ connections:
21
+ - from: "unet_loader:0"
22
+ to: "ksampler:model"
23
+ - from: "clip_loader:0"
24
+ to: "pos_prompt:clip"
25
+ - from: "clip_loader:0"
26
+ to: "neg_prompt:clip"
27
+ - from: "vae_loader:0"
28
+ to: "vae_decode:vae"
29
+ - from: "vae_loader:0"
30
+ to: "vae_encode:vae"
31
+ - from: "pos_prompt:0"
32
+ to: "flux_guidance:conditioning"
33
+ - from: "flux_guidance:0"
34
+ to: "ksampler:positive"
35
+ - from: "neg_prompt:0"
36
+ to: "ksampler:negative"
37
+
38
+ dynamic_controlnet_chains:
39
+ controlnet_chain:
40
+ template: "ControlNetApplyAdvanced"
41
+ ksampler_node: "ksampler"
42
+ vae_source: "vae_loader:0"
43
+
44
+ dynamic_flux1_ipadapter_chains:
45
+ flux1_ipadapter_chain:
46
+ ksampler_node: "ksampler"
47
+
48
+ dynamic_style_chains:
49
+ style_chain:
50
+ flux_guidance_node: "flux_guidance"
51
+ ksampler_node: "ksampler"
52
+
53
+ dynamic_conditioning_chains:
54
+ conditioning_chain:
55
+ flux_guidance_node: "flux_guidance"
56
+ ksampler_node: "ksampler"
57
+ clip_source: "clip_loader:0"
58
+
59
+ ui_map:
60
+ unet_name: "unet_loader:unet_name"
61
+ vae_name: "vae_loader:vae_name"
62
+ clip1_name: "clip_loader:clip_name1"
63
+ clip2_name: "clip_loader:clip_name2"
64
+ guidance: "flux_guidance:guidance"
core/pipelines/workflow_recipes/_partials/conditioning/flux2-kv.yaml ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ clip_loader:
8
+ class_type: CLIPLoader
9
+ title: "Load CLIP"
10
+ params:
11
+ type: "flux2"
12
+ device: "default"
13
+ vae_loader:
14
+ class_type: VAELoader
15
+ title: "Load VAE"
16
+
17
+ flux_kv_cache:
18
+ class_type: FluxKVCache
19
+ title: "Flux KV Cache"
20
+
21
+ pos_prompt:
22
+ class_type: CLIPTextEncode
23
+ title: "CLIP Text Encode (Positive)"
24
+ neg_prompt:
25
+ class_type: CLIPTextEncode
26
+ title: "CLIP Text Encode (Negative)"
27
+
28
+ ksampler:
29
+ class_type: KSampler
30
+ title: "KSampler"
31
+ params:
32
+ denoise: 1.0
33
+
34
+ vae_decode:
35
+ class_type: VAEDecode
36
+ title: "VAE Decode"
37
+
38
+ save_image:
39
+ class_type: SaveImage
40
+ title: "Save Image"
41
+
42
+ connections:
43
+ - from: "unet_loader:0"
44
+ to: "flux_kv_cache:model"
45
+ - from: "flux_kv_cache:0"
46
+ to: "ksampler:model"
47
+
48
+ - from: "clip_loader:0"
49
+ to: "pos_prompt:clip"
50
+ - from: "clip_loader:0"
51
+ to: "neg_prompt:clip"
52
+
53
+ - from: "vae_loader:0"
54
+ to: "vae_decode:vae"
55
+ - from: "vae_loader:0"
56
+ to: "vae_encode:vae"
57
+
58
+ - from: "pos_prompt:0"
59
+ to: "ksampler:positive"
60
+ - from: "neg_prompt:0"
61
+ to: "ksampler:negative"
62
+
63
+ - from: "latent_source:0"
64
+ to: "ksampler:latent_image"
65
+
66
+ - from: "ksampler:0"
67
+ to: "vae_decode:samples"
68
+ - from: "vae_decode:0"
69
+ to: "save_image:images"
70
+
71
+ dynamic_lora_chains:
72
+ lora_chain:
73
+ template: "LoraLoader"
74
+ output_map:
75
+ "unet_loader:0": "model"
76
+ "clip_loader:0": "clip"
77
+ input_map:
78
+ "model": "model"
79
+ "clip": "clip"
80
+ end_input_map:
81
+ "model": ["flux_kv_cache:model"]
82
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
83
+
84
+ dynamic_reference_latent_chains:
85
+ reference_latent_chain:
86
+ ksampler_node: "ksampler"
87
+ vae_node: "vae_loader"
88
+
89
+ ui_map:
90
+ unet_name: "unet_loader:unet_name"
91
+ clip_name: "clip_loader:clip_name"
92
+ vae_name: "vae_loader:vae_name"
93
+
94
+ positive_prompt: "pos_prompt:text"
95
+ negative_prompt: "neg_prompt:text"
96
+
97
+ seed: "ksampler:seed"
98
+ steps: "ksampler:steps"
99
+ cfg: "ksampler:cfg"
100
+ sampler_name: "ksampler:sampler_name"
101
+ scheduler: "ksampler:scheduler"
102
+ denoise: "ksampler:denoise"
103
+
104
+ filename_prefix: "save_image:filename_prefix"
core/pipelines/workflow_recipes/_partials/conditioning/flux2.yaml ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ clip_loader:
8
+ class_type: CLIPLoader
9
+ title: "Load CLIP"
10
+ params:
11
+ type: "flux2"
12
+ device: "default"
13
+ vae_loader:
14
+ class_type: VAELoader
15
+ title: "Load VAE"
16
+
17
+ pos_prompt:
18
+ class_type: CLIPTextEncode
19
+ title: "CLIP Text Encode (Positive)"
20
+ neg_prompt:
21
+ class_type: CLIPTextEncode
22
+ title: "CLIP Text Encode (Negative)"
23
+
24
+ ksampler:
25
+ class_type: KSampler
26
+ title: "KSampler"
27
+ params:
28
+ denoise: 1.0
29
+
30
+ vae_decode:
31
+ class_type: VAEDecode
32
+ title: "VAE Decode"
33
+
34
+ save_image:
35
+ class_type: SaveImage
36
+ title: "Save Image"
37
+
38
+ connections:
39
+ - from: "unet_loader:0"
40
+ to: "ksampler:model"
41
+ - from: "clip_loader:0"
42
+ to: "pos_prompt:clip"
43
+ - from: "clip_loader:0"
44
+ to: "neg_prompt:clip"
45
+ - from: "vae_loader:0"
46
+ to: "vae_decode:vae"
47
+ - from: "vae_loader:0"
48
+ to: "vae_encode:vae"
49
+
50
+ - from: "pos_prompt:0"
51
+ to: "ksampler:positive"
52
+ - from: "neg_prompt:0"
53
+ to: "ksampler:negative"
54
+
55
+ - from: "latent_source:0"
56
+ to: "ksampler:latent_image"
57
+
58
+ - from: "ksampler:0"
59
+ to: "vae_decode:samples"
60
+ - from: "vae_decode:0"
61
+ to: "save_image:images"
62
+
63
+ dynamic_lora_chains:
64
+ lora_chain:
65
+ template: "LoraLoader"
66
+ output_map:
67
+ "unet_loader:0": "model"
68
+ "clip_loader:0": "clip"
69
+ input_map:
70
+ "model": "model"
71
+ "clip": "clip"
72
+ end_input_map:
73
+ "model": ["ksampler:model"]
74
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
75
+
76
+ dynamic_reference_latent_chains:
77
+ reference_latent_chain:
78
+ ksampler_node: "ksampler"
79
+ vae_node: "vae_loader"
80
+
81
+ ui_map:
82
+ unet_name: "unet_loader:unet_name"
83
+ clip_name: "clip_loader:clip_name"
84
+ vae_name: "vae_loader:vae_name"
85
+
86
+ positive_prompt: "pos_prompt:text"
87
+ negative_prompt: "neg_prompt:text"
88
+
89
+ seed: "ksampler:seed"
90
+ steps: "ksampler:steps"
91
+ cfg: "ksampler:cfg"
92
+ sampler_name: "ksampler:sampler_name"
93
+ scheduler: "ksampler:scheduler"
94
+ denoise: "ksampler:denoise"
95
+
96
+ filename_prefix: "save_image:filename_prefix"
core/pipelines/workflow_recipes/_partials/conditioning/hidream.yaml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load HiDream UNET"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load HiDream VAE"
10
+ clip_loader:
11
+ class_type: QuadrupleCLIPLoader
12
+ title: "Load HiDream Quadruple CLIP"
13
+
14
+ model_sampler:
15
+ class_type: ModelSamplingSD3
16
+ title: "ModelSamplingSD3"
17
+ params:
18
+ shift: 6.0
19
+
20
+ connections:
21
+ - from: "unet_loader:0"
22
+ to: "model_sampler:model"
23
+
24
+ - from: "model_sampler:0"
25
+ to: "ksampler:model"
26
+
27
+ - from: "clip_loader:0"
28
+ to: "pos_prompt:clip"
29
+ - from: "clip_loader:0"
30
+ to: "neg_prompt:clip"
31
+
32
+ - from: "pos_prompt:0"
33
+ to: "ksampler:positive"
34
+ - from: "neg_prompt:0"
35
+ to: "ksampler:negative"
36
+
37
+ - from: "vae_loader:0"
38
+ to: "vae_decode:vae"
39
+ - from: "vae_loader:0"
40
+ to: "vae_encode:vae"
41
+
42
+ dynamic_conditioning_chains:
43
+ conditioning_chain:
44
+ ksampler_node: "ksampler"
45
+ clip_source: "clip_loader:0"
46
+
47
+ ui_map:
48
+ unet_name: "unet_loader:unet_name"
49
+ vae_name: "vae_loader:vae_name"
50
+ clip1_name: "clip_loader:clip_name1"
51
+ clip2_name: "clip_loader:clip_name2"
52
+ clip3_name: "clip_loader:clip_name3"
53
+ clip4_name: "clip_loader:clip_name4"
core/pipelines/workflow_recipes/_partials/conditioning/hunyuanimage.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Hunyuan UNET"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load Hunyuan VAE"
10
+ clip_loader:
11
+ class_type: DualCLIPLoader
12
+ title: "Load Hunyuan Dual CLIP"
13
+ params:
14
+ type: "hunyuan_image"
15
+ device: "default"
16
+
17
+ connections:
18
+ - from: "unet_loader:0"
19
+ to: "ksampler:model"
20
+ - from: "clip_loader:0"
21
+ to: "pos_prompt:clip"
22
+ - from: "clip_loader:0"
23
+ to: "neg_prompt:clip"
24
+ - from: "vae_loader:0"
25
+ to: "vae_decode:vae"
26
+ - from: "vae_loader:0"
27
+ to: "vae_encode:vae"
28
+ - from: "pos_prompt:0"
29
+ to: "ksampler:positive"
30
+ - from: "neg_prompt:0"
31
+ to: "ksampler:negative"
32
+
33
+ dynamic_conditioning_chains:
34
+ conditioning_chain:
35
+ ksampler_node: "ksampler"
36
+ clip_source: "clip_loader:0"
37
+
38
+ ui_map:
39
+ unet_name: "unet_loader:unet_name"
40
+ vae_name: "vae_loader:vae_name"
41
+ clip1_name: "clip_loader:clip_name1"
42
+ clip2_name: "clip_loader:clip_name2"
core/pipelines/workflow_recipes/_partials/conditioning/longcat-image.yaml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load CLIP"
13
+ params:
14
+ type: "longcat_image"
15
+ device: "default"
16
+
17
+ cfg_norm:
18
+ class_type: CFGNorm
19
+ title: "CFGNorm"
20
+ params:
21
+ strength: 1.0
22
+
23
+ flux_guidance_pos:
24
+ class_type: FluxGuidance
25
+ title: "FluxGuidance (Positive)"
26
+ params:
27
+ guidance: 4.0
28
+
29
+ flux_guidance_neg:
30
+ class_type: FluxGuidance
31
+ title: "FluxGuidance (Negative)"
32
+ params:
33
+ guidance: 4.0
34
+
35
+ connections:
36
+ - from: "unet_loader:0"
37
+ to: "cfg_norm:model"
38
+ - from: "cfg_norm:0"
39
+ to: "ksampler:model"
40
+
41
+ - from: "clip_loader:0"
42
+ to: "pos_prompt:clip"
43
+ - from: "clip_loader:0"
44
+ to: "neg_prompt:clip"
45
+
46
+ - from: "pos_prompt:0"
47
+ to: "flux_guidance_pos:conditioning"
48
+ - from: "neg_prompt:0"
49
+ to: "flux_guidance_neg:conditioning"
50
+
51
+ - from: "flux_guidance_pos:0"
52
+ to: "ksampler:positive"
53
+ - from: "flux_guidance_neg:0"
54
+ to: "ksampler:negative"
55
+
56
+ - from: "vae_loader:0"
57
+ to: "vae_decode:vae"
58
+ - from: "vae_loader:0"
59
+ to: "vae_encode:vae"
60
+
61
+ dynamic_lora_chains:
62
+ lora_chain:
63
+ template: "LoraLoader"
64
+ output_map:
65
+ "unet_loader:0": "model"
66
+ "clip_loader:0": "clip"
67
+ input_map:
68
+ "model": "model"
69
+ "clip": "clip"
70
+ end_input_map:
71
+ "model": ["cfg_norm:model"]
72
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
73
+
74
+ dynamic_conditioning_chains:
75
+ conditioning_chain:
76
+ flux_guidance_node: "flux_guidance_pos"
77
+ ksampler_node: "ksampler"
78
+ clip_source: "clip_loader:0"
79
+
80
+ ui_map:
81
+ unet_name: "unet_loader:unet_name"
82
+ vae_name: "vae_loader:vae_name"
83
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/conditioning/lumina.yaml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ ckpt_loader:
3
+ class_type: CheckpointLoaderSimple
4
+ title: "Load Checkpoint"
5
+ model_sampler:
6
+ class_type: ModelSamplingAuraFlow
7
+ title: "ModelSamplingAuraFlow"
8
+ params:
9
+ shift: 4.0
10
+
11
+ connections:
12
+ - from: "ckpt_loader:0"
13
+ to: "model_sampler:model"
14
+ - from: "model_sampler:0"
15
+ to: "ksampler:model"
16
+
17
+ - from: "ckpt_loader:1"
18
+ to: "pos_prompt:clip"
19
+ - from: "ckpt_loader:1"
20
+ to: "neg_prompt:clip"
21
+ - from: "pos_prompt:0"
22
+ to: "ksampler:positive"
23
+ - from: "neg_prompt:0"
24
+ to: "ksampler:negative"
25
+
26
+ - from: "ckpt_loader:2"
27
+ to: "vae_decode:vae"
28
+ - from: "ckpt_loader:2"
29
+ to: "vae_encode:vae"
30
+
31
+ dynamic_vae_chains:
32
+ vae_chain:
33
+ targets:
34
+ - "vae_decode:vae"
35
+ - "vae_encode:vae"
36
+
37
+ dynamic_lora_chains:
38
+ lora_chain:
39
+ template: "LoraLoader"
40
+ start: "ckpt_loader"
41
+ output_map:
42
+ "0": "model"
43
+ "1": "clip"
44
+ input_map:
45
+ "model": "model"
46
+ "clip": "clip"
47
+ end_input_map:
48
+ "model": ["model_sampler:model"]
49
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
50
+
51
+ dynamic_conditioning_chains:
52
+ conditioning_chain:
53
+ ksampler_node: "ksampler"
54
+ clip_source: "ckpt_loader:1"
55
+
56
+ ui_map:
57
+ model_name: "ckpt_loader:ckpt_name"
core/pipelines/workflow_recipes/_partials/conditioning/newbie-image.yaml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: DualCLIPLoader
12
+ title: "Load Dual CLIP"
13
+ params:
14
+ type: "newbie"
15
+ device: "default"
16
+ model_sampler:
17
+ class_type: ModelSamplingAuraFlow
18
+ title: "ModelSamplingAuraFlow"
19
+ params:
20
+ shift: 6
21
+
22
+ connections:
23
+ - from: "unet_loader:0"
24
+ to: "model_sampler:model"
25
+ - from: "model_sampler:0"
26
+ to: "ksampler:model"
27
+
28
+ - from: "clip_loader:0"
29
+ to: "pos_prompt:clip"
30
+ - from: "clip_loader:0"
31
+ to: "neg_prompt:clip"
32
+
33
+ - from: "pos_prompt:0"
34
+ to: "ksampler:positive"
35
+ - from: "neg_prompt:0"
36
+ to: "ksampler:negative"
37
+
38
+ - from: "vae_loader:0"
39
+ to: "vae_decode:vae"
40
+ - from: "vae_loader:0"
41
+ to: "vae_encode:vae"
42
+
43
+ dynamic_newbie_lora_chains:
44
+ lora_chain:
45
+ template: "NewBieLoraLoader"
46
+ output_map:
47
+ "unet_loader:0": "model"
48
+ "clip_loader:0": "clip"
49
+ input_map:
50
+ "model": "model"
51
+ "clip": "clip"
52
+ end_input_map:
53
+ "model": ["model_sampler:model"]
54
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
55
+
56
+ dynamic_conditioning_chains:
57
+ conditioning_chain:
58
+ ksampler_node: "ksampler"
59
+ clip_source: "clip_loader:0"
60
+
61
+ ui_map:
62
+ unet_name: "unet_loader:unet_name"
63
+ vae_name: "vae_loader:vae_name"
64
+ clip1_name: "clip_loader:clip_name1"
65
+ clip2_name: "clip_loader:clip_name2"
core/pipelines/workflow_recipes/_partials/conditioning/omnigen2.yaml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load CLIP"
13
+ params:
14
+ type: "omnigen2"
15
+ device: "default"
16
+
17
+ connections:
18
+ - from: "unet_loader:0"
19
+ to: "ksampler:model"
20
+ - from: "clip_loader:0"
21
+ to: "pos_prompt:clip"
22
+ - from: "clip_loader:0"
23
+ to: "neg_prompt:clip"
24
+ - from: "pos_prompt:0"
25
+ to: "ksampler:positive"
26
+ - from: "neg_prompt:0"
27
+ to: "ksampler:negative"
28
+ - from: "vae_loader:0"
29
+ to: "vae_decode:vae"
30
+ - from: "vae_loader:0"
31
+ to: "vae_encode:vae"
32
+
33
+ dynamic_lora_chains:
34
+ lora_chain:
35
+ template: "LoraLoader"
36
+ output_map:
37
+ "unet_loader:0": "model"
38
+ "clip_loader:0": "clip"
39
+ input_map:
40
+ "model": "model"
41
+ "clip": "clip"
42
+ end_input_map:
43
+ "model": ["ksampler:model"]
44
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
45
+
46
+ dynamic_conditioning_chains:
47
+ conditioning_chain:
48
+ ksampler_node: "ksampler"
49
+ clip_source: "clip_loader:0"
50
+
51
+ dynamic_reference_latent_chains:
52
+ reference_latent_chain:
53
+ ksampler_node: "ksampler"
54
+ vae_node: "vae_loader"
55
+
56
+ ui_map:
57
+ unet_name: "unet_loader:unet_name"
58
+ vae_name: "vae_loader:vae_name"
59
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/conditioning/ovis-image.yaml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load CLIP"
13
+ params:
14
+ type: "ovis"
15
+ device: "default"
16
+ model_sampler:
17
+ class_type: ModelSamplingAuraFlow
18
+ params:
19
+ shift: 3.0
20
+
21
+ connections:
22
+ - from: "unet_loader:0"
23
+ to: "model_sampler:model"
24
+ - from: "model_sampler:0"
25
+ to: "ksampler:model"
26
+
27
+ - from: "clip_loader:0"
28
+ to: "pos_prompt:clip"
29
+ - from: "clip_loader:0"
30
+ to: "neg_prompt:clip"
31
+
32
+ - from: "pos_prompt:0"
33
+ to: "ksampler:positive"
34
+ - from: "neg_prompt:0"
35
+ to: "ksampler:negative"
36
+
37
+ - from: "vae_loader:0"
38
+ to: "vae_decode:vae"
39
+ - from: "vae_loader:0"
40
+ to: "vae_encode:vae"
41
+
42
+ dynamic_conditioning_chains:
43
+ conditioning_chain:
44
+ ksampler_node: "ksampler"
45
+ clip_source: "clip_loader:0"
46
+
47
+ ui_map:
48
+ unet_name: "unet_loader:unet_name"
49
+ vae_name: "vae_loader:vae_name"
50
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/conditioning/qwen-image.yaml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Qwen UNET"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load Qwen VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load Qwen CLIP"
13
+ params:
14
+ type: "qwen_image"
15
+ device: "default"
16
+
17
+ lora_loader:
18
+ class_type: LoraLoaderModelOnly
19
+ title: "Load Qwen Lightning LoRA"
20
+ params:
21
+ strength_model: 1.0
22
+ model_sampler:
23
+ class_type: ModelSamplingAuraFlow
24
+ title: "ModelSamplingAuraFlow"
25
+ params:
26
+ shift: 3.1
27
+
28
+ connections:
29
+ - from: "unet_loader:0"
30
+ to: "lora_loader:model"
31
+ - from: "lora_loader:0"
32
+ to: "model_sampler:model"
33
+
34
+ - from: "model_sampler:0"
35
+ to: "ksampler:model"
36
+
37
+ - from: "clip_loader:0"
38
+ to: "pos_prompt:clip"
39
+ - from: "clip_loader:0"
40
+ to: "neg_prompt:clip"
41
+
42
+ - from: "vae_loader:0"
43
+ to: "vae_decode:vae"
44
+ - from: "vae_loader:0"
45
+ to: "vae_encode:vae"
46
+
47
+ - from: "pos_prompt:0"
48
+ to: "ksampler:positive"
49
+ - from: "neg_prompt:0"
50
+ to: "ksampler:negative"
51
+
52
+ dynamic_lora_chains:
53
+ lora_chain:
54
+ template: "LoraLoader"
55
+ output_map:
56
+ "lora_loader:0": "model"
57
+ "clip_loader:0": "clip"
58
+ input_map:
59
+ "model": "model"
60
+ "clip": "clip"
61
+ end_input_map:
62
+ "model": ["model_sampler:model"]
63
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
64
+
65
+ dynamic_controlnet_chains:
66
+ controlnet_chain:
67
+ template: "ControlNetApplyAdvanced"
68
+ ksampler_node: "ksampler"
69
+ vae_source: "vae_loader:0"
70
+
71
+ dynamic_conditioning_chains:
72
+ conditioning_chain:
73
+ ksampler_node: "ksampler"
74
+ clip_source: "clip_loader:0"
75
+
76
+ ui_map:
77
+ unet_name: "unet_loader:unet_name"
78
+ vae_name: "vae_loader:vae_name"
79
+ clip_name: "clip_loader:clip_name"
80
+ lora_name: "lora_loader:lora_name"
core/pipelines/workflow_recipes/_partials/conditioning/sd15.yaml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ ckpt_loader:
3
+ class_type: CheckpointLoaderSimple
4
+ title: "Load Checkpoint"
5
+ clip_set_last_layer:
6
+ class_type: CLIPSetLastLayer
7
+ title: "CLIP Set Last Layer"
8
+
9
+ connections:
10
+ - from: "ckpt_loader:0"
11
+ to: "ksampler:model"
12
+ - from: "ckpt_loader:1"
13
+ to: "clip_set_last_layer:clip"
14
+ - from: "clip_set_last_layer:0"
15
+ to: "pos_prompt:clip"
16
+ - from: "clip_set_last_layer:0"
17
+ to: "neg_prompt:clip"
18
+ - from: "pos_prompt:0"
19
+ to: "ksampler:positive"
20
+ - from: "neg_prompt:0"
21
+ to: "ksampler:negative"
22
+ - from: "ckpt_loader:2"
23
+ to: "vae_decode:vae"
24
+ - from: "ckpt_loader:2"
25
+ to: "vae_encode:vae"
26
+
27
+ dynamic_vae_chains:
28
+ vae_chain:
29
+ targets:
30
+ - "vae_decode:vae"
31
+ - "vae_encode:vae"
32
+
33
+ dynamic_lora_chains:
34
+ lora_chain:
35
+ template: "LoraLoader"
36
+ start: "clip_set_last_layer"
37
+ output_map:
38
+ "ckpt_loader:0": "model"
39
+ "0": "clip"
40
+ input_map:
41
+ "model": "model"
42
+ "clip": "clip"
43
+ end_input_map:
44
+ "model": ["ksampler:model"]
45
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
46
+
47
+ dynamic_controlnet_chains:
48
+ controlnet_chain:
49
+ template: "ControlNetApplyAdvanced"
50
+ ksampler_node: "ksampler"
51
+ vae_source: "ckpt_loader:2"
52
+
53
+ dynamic_ipadapter_chains:
54
+ ipadapter_chain:
55
+ end: "ksampler"
56
+ final_preset: "{{ ipadapter_final_preset }}"
57
+ final_weight: "{{ ipadapter_final_weight }}"
58
+ final_embeds_scaling: "{{ ipadapter_embeds_scaling }}"
59
+ final_loader_type: "{{ ipadapter_final_loader_type }}"
60
+ final_lora_strength: "{{ ipadapter_final_lora_strength }}"
61
+
62
+ dynamic_conditioning_chains:
63
+ conditioning_chain:
64
+ ksampler_node: "ksampler"
65
+ clip_source: "clip_set_last_layer:0"
66
+
67
+ ui_map:
68
+ model_name: "ckpt_loader:ckpt_name"
69
+ clip_skip: "clip_set_last_layer:stop_at_clip_layer"
core/pipelines/workflow_recipes/_partials/conditioning/sd35.yaml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ ckpt_loader:
3
+ class_type: CheckpointLoaderSimple
4
+ title: "Load Checkpoint"
5
+
6
+ connections:
7
+ - from: "ckpt_loader:0"
8
+ to: "ksampler:model"
9
+ - from: "ckpt_loader:1"
10
+ to: "pos_prompt:clip"
11
+ - from: "ckpt_loader:1"
12
+ to: "neg_prompt:clip"
13
+ - from: "pos_prompt:0"
14
+ to: "ksampler:positive"
15
+ - from: "neg_prompt:0"
16
+ to: "ksampler:negative"
17
+ - from: "ckpt_loader:2"
18
+ to: "vae_decode:vae"
19
+ - from: "ckpt_loader:2"
20
+ to: "vae_encode:vae"
21
+
22
+ dynamic_vae_chains:
23
+ vae_chain:
24
+ targets:
25
+ - "vae_decode:vae"
26
+ - "vae_encode:vae"
27
+
28
+ dynamic_lora_chains:
29
+ lora_chain:
30
+ template: "LoraLoader"
31
+ start: "ckpt_loader"
32
+ output_map:
33
+ "0": "model"
34
+ "1": "clip"
35
+ input_map:
36
+ "model": "model"
37
+ "clip": "clip"
38
+ end_input_map:
39
+ "model": ["ksampler:model"]
40
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
41
+
42
+ dynamic_controlnet_chains:
43
+ controlnet_chain:
44
+ template: "ControlNetApplyAdvanced"
45
+ ksampler_node: "ksampler"
46
+ vae_source: "ckpt_loader:2"
47
+
48
+ dynamic_sd3_ipadapter_chains:
49
+ sd3_ipadapter_chain:
50
+ ksampler_node: "ksampler"
51
+
52
+ dynamic_conditioning_chains:
53
+ conditioning_chain:
54
+ ksampler_node: "ksampler"
55
+ clip_source: "ckpt_loader:1"
56
+
57
+ ui_map:
58
+ model_name: "ckpt_loader:ckpt_name"
core/pipelines/workflow_recipes/_partials/conditioning/sdxl.yaml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ ckpt_loader:
3
+ class_type: CheckpointLoaderSimple
4
+ title: "Load Checkpoint"
5
+
6
+ connections:
7
+ - from: "ckpt_loader:0"
8
+ to: "ksampler:model"
9
+ - from: "ckpt_loader:1"
10
+ to: "pos_prompt:clip"
11
+ - from: "ckpt_loader:1"
12
+ to: "neg_prompt:clip"
13
+ - from: "pos_prompt:0"
14
+ to: "ksampler:positive"
15
+ - from: "neg_prompt:0"
16
+ to: "ksampler:negative"
17
+ - from: "ckpt_loader:2"
18
+ to: "vae_decode:vae"
19
+ - from: "ckpt_loader:2"
20
+ to: "vae_encode:vae"
21
+
22
+ dynamic_vae_chains:
23
+ vae_chain:
24
+ targets:
25
+ - "vae_decode:vae"
26
+ - "vae_encode:vae"
27
+
28
+ dynamic_lora_chains:
29
+ lora_chain:
30
+ template: "LoraLoader"
31
+ start: "ckpt_loader"
32
+ output_map:
33
+ "0": "model"
34
+ "1": "clip"
35
+ input_map:
36
+ "model": "model"
37
+ "clip": "clip"
38
+ end_input_map:
39
+ "model": ["ksampler:model"]
40
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
41
+
42
+ dynamic_controlnet_chains:
43
+ controlnet_chain:
44
+ template: "ControlNetApplyAdvanced"
45
+ ksampler_node: "ksampler"
46
+ vae_source: "ckpt_loader:2"
47
+
48
+ dynamic_ipadapter_chains:
49
+ ipadapter_chain:
50
+ end: "ksampler"
51
+ final_preset: "{{ ipadapter_final_preset }}"
52
+ final_weight: "{{ ipadapter_final_weight }}"
53
+ final_embeds_scaling: "{{ ipadapter_embeds_scaling }}"
54
+ final_loader_type: "{{ ipadapter_final_loader_type }}"
55
+ final_lora_strength: "{{ ipadapter_final_lora_strength }}"
56
+
57
+ dynamic_conditioning_chains:
58
+ conditioning_chain:
59
+ ksampler_node: "ksampler"
60
+ clip_source: "ckpt_loader:1"
61
+
62
+ ui_map:
63
+ model_name: "ckpt_loader:ckpt_name"
core/pipelines/workflow_recipes/_partials/conditioning/z-image.yaml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ unet_loader:
3
+ class_type: UNETLoader
4
+ title: "Load Diffusion Model"
5
+ params:
6
+ weight_dtype: "default"
7
+ vae_loader:
8
+ class_type: VAELoader
9
+ title: "Load VAE"
10
+ clip_loader:
11
+ class_type: CLIPLoader
12
+ title: "Load CLIP"
13
+ params:
14
+ type: "lumina2"
15
+ device: "default"
16
+ model_sampler:
17
+ class_type: ModelSamplingAuraFlow
18
+ params:
19
+ shift: 3.0
20
+
21
+ connections:
22
+ - from: "unet_loader:0"
23
+ to: "model_sampler:model"
24
+ - from: "model_sampler:0"
25
+ to: "ksampler:model"
26
+
27
+ - from: "clip_loader:0"
28
+ to: "pos_prompt:clip"
29
+ - from: "clip_loader:0"
30
+ to: "neg_prompt:clip"
31
+
32
+ - from: "pos_prompt:0"
33
+ to: "ksampler:positive"
34
+ - from: "neg_prompt:0"
35
+ to: "ksampler:negative"
36
+
37
+ - from: "vae_loader:0"
38
+ to: "vae_decode:vae"
39
+ - from: "vae_loader:0"
40
+ to: "vae_encode:vae"
41
+
42
+ dynamic_lora_chains:
43
+ lora_chain:
44
+ template: "LoraLoader"
45
+ output_map:
46
+ "unet_loader:0": "model"
47
+ "clip_loader:0": "clip"
48
+ input_map:
49
+ "model": "model"
50
+ "clip": "clip"
51
+ end_input_map:
52
+ "model": ["model_sampler:model"]
53
+ "clip": ["pos_prompt:clip", "neg_prompt:clip"]
54
+
55
+ dynamic_diffsynth_controlnet_chains:
56
+ diffsynth_controlnet_chain:
57
+ template: "QwenImageDiffsynthControlnet"
58
+ model_sampler_node: "model_sampler"
59
+ ksampler_node: "ksampler"
60
+ vae_source: "vae_loader:0"
61
+
62
+ ui_map:
63
+ unet_name: "unet_loader:unet_name"
64
+ vae_name: "vae_loader:vae_name"
65
+ clip_name: "clip_loader:clip_name"
core/pipelines/workflow_recipes/_partials/input/hires_fix.yaml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ input_image_loader:
3
+ class_type: LoadImage
4
+ title: "Load Input Image"
5
+ vae_encode:
6
+ class_type: VAEEncode
7
+ title: "VAE Encode (Hires Pre-step)"
8
+ latent_upscaler:
9
+ class_type: LatentUpscaleBy
10
+ title: "Upscale Latent By"
11
+ latent_source:
12
+ class_type: RepeatLatentBatch
13
+ title: "Repeat Latent Batch for Hires"
14
+
15
+ connections:
16
+ - from: "input_image_loader:0"
17
+ to: "vae_encode:pixels"
18
+ - from: "vae_encode:0"
19
+ to: "latent_upscaler:samples"
20
+ - from: "latent_upscaler:0"
21
+ to: "latent_source:samples"
22
+
23
+ ui_map:
24
+ input_image: "input_image_loader:image"
25
+ hires_upscaler: "latent_upscaler:upscale_method"
26
+ hires_scale_by: "latent_upscaler:scale_by"
27
+ batch_size: "latent_source:amount"
core/pipelines/workflow_recipes/_partials/input/img2img.yaml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ input_image_loader:
3
+ class_type: LoadImage
4
+ title: "Load Input Image"
5
+ vae_encode:
6
+ class_type: VAEEncode
7
+ title: "VAE Encode (Img2Img)"
8
+ latent_source:
9
+ class_type: RepeatLatentBatch
10
+ title: "Repeat Latent Batch"
11
+
12
+ connections:
13
+ - from: "input_image_loader:0"
14
+ to: "vae_encode:pixels"
15
+ - from: "vae_encode:0"
16
+ to: "latent_source:samples"
17
+
18
+ ui_map:
19
+ input_image: "input_image_loader:image"
20
+ batch_size: "latent_source:amount"
core/pipelines/workflow_recipes/_partials/input/inpaint.yaml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ inpaint_loader:
3
+ class_type: LoadImage
4
+ title: "Load Inpaint Image+Mask"
5
+ vae_encode:
6
+ class_type: VAEEncodeForInpaint
7
+ title: "VAE Encode (for Inpainting)"
8
+ latent_source:
9
+ class_type: RepeatLatentBatch
10
+ title: "Repeat Latent Batch"
11
+
12
+ connections:
13
+ - from: "inpaint_loader:0"
14
+ to: "vae_encode:pixels"
15
+ - from: "inpaint_loader:1"
16
+ to: "vae_encode:mask"
17
+ - from: "vae_encode:0"
18
+ to: "latent_source:samples"
19
+
20
+ ui_map:
21
+ input_image: "inpaint_loader:image"
22
+ batch_size: "latent_source:amount"
23
+ grow_mask_by: "vae_encode:grow_mask_by"
core/pipelines/workflow_recipes/_partials/input/outpaint.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ input_image_loader:
3
+ class_type: LoadImage
4
+ title: "Load Image for Outpaint"
5
+ scale_image:
6
+ class_type: ImageScaleToTotalPixels
7
+ title: "Scale Image to Total Pixels"
8
+ params:
9
+ upscale_method: "nearest-exact"
10
+ pad_image:
11
+ class_type: ImagePadForOutpaint
12
+ title: "Pad Image for Outpainting"
13
+ vae_encode:
14
+ class_type: VAEEncodeForInpaint
15
+ title: "VAE Encode (for Inpainting)"
16
+ latent_source:
17
+ class_type: RepeatLatentBatch
18
+ title: "Repeat Latent Batch"
19
+
20
+ connections:
21
+ - from: "input_image_loader:0"
22
+ to: "scale_image:image"
23
+ - from: "scale_image:0"
24
+ to: "pad_image:image"
25
+ - from: "pad_image:0"
26
+ to: "vae_encode:pixels"
27
+ - from: "pad_image:1"
28
+ to: "vae_encode:mask"
29
+ - from: "vae_encode:0"
30
+ to: "latent_source:samples"
31
+
32
+ ui_map:
33
+ input_image: "input_image_loader:image"
34
+ megapixels: "scale_image:megapixels"
35
+ left: "pad_image:left"
36
+ top: "pad_image:top"
37
+ right: "pad_image:right"
38
+ bottom: "pad_image:bottom"
39
+ feathering: "pad_image:feathering"
40
+ grow_mask_by: "vae_encode:grow_mask_by"
41
+ batch_size: "latent_source:amount"
core/pipelines/workflow_recipes/_partials/input/txt2img.yaml ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ imports:
2
+ - "txt2img_{{ latent_type }}.yaml"
core/pipelines/workflow_recipes/_partials/input/txt2img_chroma_radiance_latent.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ latent_source:
3
+ class_type: "EmptyChromaRadianceLatentImage"
4
+ title: "EmptyChromaRadianceLatentImage"
5
+
6
+ connections: []
7
+
8
+ ui_map:
9
+ width: "latent_source:width"
10
+ height: "latent_source:height"
11
+ batch_size: "latent_source:batch_size"
core/pipelines/workflow_recipes/_partials/input/txt2img_flux2_latent.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ latent_source:
3
+ class_type: "EmptyFlux2LatentImage"
4
+ title: "Empty Flux 2 Latent"
5
+
6
+ connections: []
7
+
8
+ ui_map:
9
+ width: "latent_source:width"
10
+ height: "latent_source:height"
11
+ batch_size: "latent_source:batch_size"
core/pipelines/workflow_recipes/_partials/input/txt2img_hunyuan_latent.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ latent_source:
3
+ class_type: "EmptyHunyuanImageLatent"
4
+ title: "EmptyHunyuanImageLatent"
5
+
6
+ connections: []
7
+
8
+ ui_map:
9
+ width: "latent_source:width"
10
+ height: "latent_source:height"
11
+ batch_size: "latent_source:batch_size"