fantos Phr00t commited on
Commit
c60107d
·
verified ·
0 Parent(s):

Duplicate from Phr00t/Qwen-Image-Edit-Rapid-AIO

Browse files

Co-authored-by: Phr00t <[email protected]>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
Qwen-Rapid-AIO-v1-8step.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c98d037873f21bea336fa49ed812015508a23848535ea3ece38393d6418a44c9
3
+ size 28978617994
Qwen-Rapid-AIO-v1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:826b842be7091dbe013d8784b70c02df2768e16fa9328f3f445dd7638510752c
3
+ size 28978618010
Qwen-Rapid-AIO-v2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c38a63e347c0170865cea091dd0d1c07e857a19959b26414b92617bd7d4254e
3
+ size 28978618770
Qwen-Rapid-AIO-v3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24d0780a13490b523b1c06fbbdd67ad4aabbda069e50a887558c5766e7a0aa76
3
+ size 28978618442
Qwen-Rapid-AIO-v4.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fae21038986aabdd879cd7754a77abf56d3c200147362d1ebaa92c1662dafda9
3
+ size 28978619370
Qwen-Rapid-AIO.json ADDED
@@ -0,0 +1,539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "b058853e-412f-4f02-95e2-abe2a40ebc2e",
3
+ "revision": 0,
4
+ "last_node_id": 9,
5
+ "last_link_id": 18,
6
+ "nodes": [
7
+ {
8
+ "id": 1,
9
+ "type": "CheckpointLoaderSimple",
10
+ "pos": [
11
+ -239.19235229492188,
12
+ 25.397891998291016
13
+ ],
14
+ "size": [
15
+ 369.6529235839844,
16
+ 100.6932373046875
17
+ ],
18
+ "flags": {},
19
+ "order": 0,
20
+ "mode": 0,
21
+ "inputs": [],
22
+ "outputs": [
23
+ {
24
+ "name": "MODEL",
25
+ "type": "MODEL",
26
+ "links": [
27
+ 1
28
+ ]
29
+ },
30
+ {
31
+ "name": "CLIP",
32
+ "type": "CLIP",
33
+ "links": [
34
+ 2,
35
+ 7
36
+ ]
37
+ },
38
+ {
39
+ "name": "VAE",
40
+ "type": "VAE",
41
+ "links": [
42
+ 6,
43
+ 8,
44
+ 9
45
+ ]
46
+ }
47
+ ],
48
+ "properties": {
49
+ "Node name for S&R": "CheckpointLoaderSimple"
50
+ },
51
+ "widgets_values": [
52
+ "Qwen\\Qwen-Rapid-AIO-v1.safetensors"
53
+ ]
54
+ },
55
+ {
56
+ "id": 6,
57
+ "type": "PreviewImage",
58
+ "pos": [
59
+ 166.48406982421875,
60
+ 439.3702392578125
61
+ ],
62
+ "size": [
63
+ 266.2825927734375,
64
+ 346.3945617675781
65
+ ],
66
+ "flags": {},
67
+ "order": 8,
68
+ "mode": 0,
69
+ "inputs": [
70
+ {
71
+ "name": "images",
72
+ "type": "IMAGE",
73
+ "link": 10
74
+ }
75
+ ],
76
+ "outputs": [],
77
+ "properties": {
78
+ "Node name for S&R": "PreviewImage"
79
+ },
80
+ "widgets_values": []
81
+ },
82
+ {
83
+ "id": 5,
84
+ "type": "VAEDecode",
85
+ "pos": [
86
+ 229.74990844726562,
87
+ 338.609375
88
+ ],
89
+ "size": [
90
+ 140,
91
+ 46
92
+ ],
93
+ "flags": {},
94
+ "order": 7,
95
+ "mode": 0,
96
+ "inputs": [
97
+ {
98
+ "name": "samples",
99
+ "type": "LATENT",
100
+ "link": 5
101
+ },
102
+ {
103
+ "name": "vae",
104
+ "type": "VAE",
105
+ "link": 6
106
+ }
107
+ ],
108
+ "outputs": [
109
+ {
110
+ "name": "IMAGE",
111
+ "type": "IMAGE",
112
+ "links": [
113
+ 10
114
+ ]
115
+ }
116
+ ],
117
+ "properties": {
118
+ "Node name for S&R": "VAEDecode"
119
+ },
120
+ "widgets_values": []
121
+ },
122
+ {
123
+ "id": 9,
124
+ "type": "EmptyLatentImage",
125
+ "pos": [
126
+ -189.9932403564453,
127
+ 660.2916870117188
128
+ ],
129
+ "size": [
130
+ 270,
131
+ 106
132
+ ],
133
+ "flags": {},
134
+ "order": 1,
135
+ "mode": 0,
136
+ "inputs": [],
137
+ "outputs": [
138
+ {
139
+ "name": "LATENT",
140
+ "type": "LATENT",
141
+ "links": [
142
+ 13
143
+ ]
144
+ }
145
+ ],
146
+ "title": "Final Image Size",
147
+ "properties": {
148
+ "Node name for S&R": "EmptyLatentImage"
149
+ },
150
+ "widgets_values": [
151
+ 768,
152
+ 768,
153
+ 1
154
+ ]
155
+ },
156
+ {
157
+ "id": 2,
158
+ "type": "KSampler",
159
+ "pos": [
160
+ 165.2884979248047,
161
+ 23.94108009338379
162
+ ],
163
+ "size": [
164
+ 270,
165
+ 262
166
+ ],
167
+ "flags": {},
168
+ "order": 6,
169
+ "mode": 0,
170
+ "inputs": [
171
+ {
172
+ "name": "model",
173
+ "type": "MODEL",
174
+ "link": 1
175
+ },
176
+ {
177
+ "name": "positive",
178
+ "type": "CONDITIONING",
179
+ "link": 3
180
+ },
181
+ {
182
+ "name": "negative",
183
+ "type": "CONDITIONING",
184
+ "link": 4
185
+ },
186
+ {
187
+ "name": "latent_image",
188
+ "type": "LATENT",
189
+ "link": 13
190
+ }
191
+ ],
192
+ "outputs": [
193
+ {
194
+ "name": "LATENT",
195
+ "type": "LATENT",
196
+ "links": [
197
+ 5
198
+ ]
199
+ }
200
+ ],
201
+ "properties": {
202
+ "Node name for S&R": "KSampler"
203
+ },
204
+ "widgets_values": [
205
+ 65454653,
206
+ "fixed",
207
+ 4,
208
+ 1,
209
+ "sa_solver",
210
+ "beta",
211
+ 1
212
+ ]
213
+ },
214
+ {
215
+ "id": 4,
216
+ "type": "TextEncodeQwenImageEditPlus",
217
+ "pos": [
218
+ -259.2781677246094,
219
+ 417.37896728515625
220
+ ],
221
+ "size": [
222
+ 407.40655517578125,
223
+ 195.96002197265625
224
+ ],
225
+ "flags": {},
226
+ "order": 4,
227
+ "mode": 0,
228
+ "inputs": [
229
+ {
230
+ "name": "clip",
231
+ "type": "CLIP",
232
+ "link": 7
233
+ },
234
+ {
235
+ "name": "vae",
236
+ "shape": 7,
237
+ "type": "VAE",
238
+ "link": 9
239
+ },
240
+ {
241
+ "name": "image1",
242
+ "shape": 7,
243
+ "type": "IMAGE",
244
+ "link": null
245
+ },
246
+ {
247
+ "name": "image2",
248
+ "shape": 7,
249
+ "type": "IMAGE",
250
+ "link": null
251
+ },
252
+ {
253
+ "name": "image3",
254
+ "shape": 7,
255
+ "type": "IMAGE",
256
+ "link": null
257
+ }
258
+ ],
259
+ "outputs": [
260
+ {
261
+ "name": "CONDITIONING",
262
+ "type": "CONDITIONING",
263
+ "links": [
264
+ 4
265
+ ]
266
+ }
267
+ ],
268
+ "title": "TextEncodeQwenImageEditPlus Negative (leave blank)",
269
+ "properties": {
270
+ "Node name for S&R": "TextEncodeQwenImageEditPlus"
271
+ },
272
+ "widgets_values": [
273
+ ""
274
+ ]
275
+ },
276
+ {
277
+ "id": 3,
278
+ "type": "TextEncodeQwenImageEditPlus",
279
+ "pos": [
280
+ -230.1153106689453,
281
+ 170.6533660888672
282
+ ],
283
+ "size": [
284
+ 351.52020263671875,
285
+ 197.97994995117188
286
+ ],
287
+ "flags": {},
288
+ "order": 5,
289
+ "mode": 0,
290
+ "inputs": [
291
+ {
292
+ "name": "clip",
293
+ "type": "CLIP",
294
+ "link": 2
295
+ },
296
+ {
297
+ "name": "vae",
298
+ "shape": 7,
299
+ "type": "VAE",
300
+ "link": 8
301
+ },
302
+ {
303
+ "name": "image1",
304
+ "shape": 7,
305
+ "type": "IMAGE",
306
+ "link": 17
307
+ },
308
+ {
309
+ "name": "image2",
310
+ "shape": 7,
311
+ "type": "IMAGE",
312
+ "link": 18
313
+ },
314
+ {
315
+ "name": "image3",
316
+ "shape": 7,
317
+ "type": "IMAGE",
318
+ "link": null
319
+ }
320
+ ],
321
+ "outputs": [
322
+ {
323
+ "name": "CONDITIONING",
324
+ "type": "CONDITIONING",
325
+ "links": [
326
+ 3
327
+ ]
328
+ }
329
+ ],
330
+ "title": "TextEncodeQwenImageEditPlus Input Prompt",
331
+ "properties": {
332
+ "Node name for S&R": "TextEncodeQwenImageEditPlus"
333
+ },
334
+ "widgets_values": [
335
+ "Put the woman holding a balloon next to the ninja in the hallway."
336
+ ]
337
+ },
338
+ {
339
+ "id": 8,
340
+ "type": "LoadImage",
341
+ "pos": [
342
+ -525.282470703125,
343
+ 21.345966339111328
344
+ ],
345
+ "size": [
346
+ 259.9401550292969,
347
+ 326
348
+ ],
349
+ "flags": {},
350
+ "order": 2,
351
+ "mode": 0,
352
+ "inputs": [],
353
+ "outputs": [
354
+ {
355
+ "name": "IMAGE",
356
+ "type": "IMAGE",
357
+ "links": [
358
+ 18
359
+ ]
360
+ },
361
+ {
362
+ "name": "MASK",
363
+ "type": "MASK",
364
+ "links": null
365
+ }
366
+ ],
367
+ "title": "Optional Input Image",
368
+ "properties": {
369
+ "Node name for S&R": "LoadImage"
370
+ },
371
+ "widgets_values": [
372
+ "ComfyUI_temp_ljpig_00008_.png",
373
+ "image"
374
+ ]
375
+ },
376
+ {
377
+ "id": 7,
378
+ "type": "LoadImage",
379
+ "pos": [
380
+ -555.2627563476562,
381
+ 396.7561340332031
382
+ ],
383
+ "size": [
384
+ 274.080078125,
385
+ 314.0000305175781
386
+ ],
387
+ "flags": {},
388
+ "order": 3,
389
+ "mode": 0,
390
+ "inputs": [],
391
+ "outputs": [
392
+ {
393
+ "name": "IMAGE",
394
+ "type": "IMAGE",
395
+ "links": [
396
+ 17
397
+ ]
398
+ },
399
+ {
400
+ "name": "MASK",
401
+ "type": "MASK",
402
+ "links": null
403
+ }
404
+ ],
405
+ "title": "Optional Input Image",
406
+ "properties": {
407
+ "Node name for S&R": "LoadImage"
408
+ },
409
+ "widgets_values": [
410
+ "ComfyUI_temp_zmuag_00002_.png",
411
+ "image"
412
+ ]
413
+ }
414
+ ],
415
+ "links": [
416
+ [
417
+ 1,
418
+ 1,
419
+ 0,
420
+ 2,
421
+ 0,
422
+ "MODEL"
423
+ ],
424
+ [
425
+ 2,
426
+ 1,
427
+ 1,
428
+ 3,
429
+ 0,
430
+ "CLIP"
431
+ ],
432
+ [
433
+ 3,
434
+ 3,
435
+ 0,
436
+ 2,
437
+ 1,
438
+ "CONDITIONING"
439
+ ],
440
+ [
441
+ 4,
442
+ 4,
443
+ 0,
444
+ 2,
445
+ 2,
446
+ "CONDITIONING"
447
+ ],
448
+ [
449
+ 5,
450
+ 2,
451
+ 0,
452
+ 5,
453
+ 0,
454
+ "LATENT"
455
+ ],
456
+ [
457
+ 6,
458
+ 1,
459
+ 2,
460
+ 5,
461
+ 1,
462
+ "VAE"
463
+ ],
464
+ [
465
+ 7,
466
+ 1,
467
+ 1,
468
+ 4,
469
+ 0,
470
+ "CLIP"
471
+ ],
472
+ [
473
+ 8,
474
+ 1,
475
+ 2,
476
+ 3,
477
+ 1,
478
+ "VAE"
479
+ ],
480
+ [
481
+ 9,
482
+ 1,
483
+ 2,
484
+ 4,
485
+ 1,
486
+ "VAE"
487
+ ],
488
+ [
489
+ 10,
490
+ 5,
491
+ 0,
492
+ 6,
493
+ 0,
494
+ "IMAGE"
495
+ ],
496
+ [
497
+ 13,
498
+ 9,
499
+ 0,
500
+ 2,
501
+ 3,
502
+ "LATENT"
503
+ ],
504
+ [
505
+ 17,
506
+ 7,
507
+ 0,
508
+ 3,
509
+ 2,
510
+ "IMAGE"
511
+ ],
512
+ [
513
+ 18,
514
+ 8,
515
+ 0,
516
+ 3,
517
+ 3,
518
+ "IMAGE"
519
+ ]
520
+ ],
521
+ "groups": [],
522
+ "config": {},
523
+ "extra": {
524
+ "ds": {
525
+ "scale": 1.0435333929857133,
526
+ "offset": [
527
+ 919.9049410313564,
528
+ 75.66198687470876
529
+ ]
530
+ },
531
+ "ue_links": [],
532
+ "frontendVersion": "1.26.13",
533
+ "VHS_latentpreview": false,
534
+ "VHS_latentpreviewrate": 0,
535
+ "VHS_MetadataImage": true,
536
+ "VHS_KeepIntermediate": true
537
+ },
538
+ "version": 0.4
539
+ }
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - Qwen/Qwen-Image-Edit-2509
5
+ - lightx2v/Qwen-Image-Lightning
6
+ pipeline_tag: text-to-image
7
+ library_name: comfyUI
8
+ tags:
9
+ - qwen
10
+ - qwen-edit
11
+ - t2i
12
+ - i2i
13
+ ---
14
+
15
+ Merge of accelerators, VAE and CLIP to allow for easy and fast Qwen Image Edit (and text to image) support.
16
+
17
+ Use a "Load Checkpoint" node. 1 CFG, 4 step. Use the "TextEncodeQwenImageEditPlus" node for input images (which are optional) and prompt. Provide no images to just do pure text to image. FP8 precision.
18
+
19
+ **Both NSFW and SFW models are available!** v4 and older combine both NSFW and SFW uses in one model, but performance is subpar. v5+ separates out a NSFW and SFW version, so please pick which model for your use case.
20
+
21
+ **Having problems with scaling, cropping or zooming?** Scaling images in the TextEncoderQwenEditPlus node is the problem. There are many workarounds, but I prefer just fixing the node and I've supplied my version in the Files area. It also supports up to 4 input images. Just set the "target_size" to a little less than your output's largest size (like 896 if making a 1024x1024 image). I find this improves quality over skipping scaling entirely, as input images better match output resolutions.
22
+
23
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/631be8402ea8535ea48abbc6/ynDNK35eRLlUjha75fYHH.png)
24
+
25
+ **V1:** Uses Qwen-Image-Edit-2509 & 4-step Lightning v2.0. Includes a touch of NSFW LORAs, so it should be a very versatile model for both SFW and NSFW use. sa_solver/beta recommended, but euler_a/beta and er_sde/beta can give decent results too.
26
+
27
+ **V2:** Now uses a mix of Qwen-Image-Edit accelerators, mixing both 8 and 4 steps in one. Also significantly tweaked the NSFW LORAs for better all-around SFW and NSFW use. sa_solver/simple strongly recommended.
28
+
29
+ **V3:** Uses new Qwen-Image-Edit lightning LORAs for much better results. Also significantly adjusted NSFW LORA mix, removing poor ones and increasing quality ones. sa_solver/beta highly recommended.
30
+
31
+ **V4:** Mix of many Qwen Edit and base Qwen accelerators, which I think gives better results. Added a touch of a skin correction LORA. **4-5 steps: use sa_solver/simple, lcm/beta or euler_a/beta** and **6-8 steps: use lcm/beta or euler_a/beta only**.
32
+
33
+ **V5:** NSFW and SFW use cases interfered with eachother too much, so I separated them to specialize in their use cases. Updated "snofs" and "qwen4play" NSFW LORAs + Meta4 for v5.2, then added "Qwen Image NSFW Adv." by fok3827 for v5.3. **SFW: lcm/beta or er_sde/beta generally recommended** and **NSFW: lcm/normal recommended**. Prompting "Professional digital photography" helps reduce the plastic look.
34
+
35
+ **V6:** Attempt at valiantcat/Qwen-Image-Edit-MeiTu and partially chestnutlzj/Edit-R1-Qwen-Image-Edit-2509 as a base model. However, this was a broken merge. It appears using them as LORAs may work better and I need to cook some more to find something useable. Stay on v5 until something newer comes out.
36
+
37
+ **V7:** valiantcat/Qwen-Image-Edit-MeiTu and chestnutlzj/Edit-R1-Qwen-Image-Edit-2509 included as LORAs. Accelerator and NSFW LORAs tweaks (v7.1 is more NSFW-heavy). This seemed to be working much better. **lcm/sgm_uniform recommended for 4-6 steps, lcm/normal for 7-8 steps**.
fixed-textencode-node/.can_replace_comfyui_node_with_this ADDED
File without changes
fixed-textencode-node/nodes_qwen.py ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import node_helpers
2
+ import comfy.utils
3
+ import math
4
+ from typing_extensions import override
5
+ from comfy_api.latest import ComfyExtension, io
6
+
7
+ class TextEncodeQwenImageEdit(io.ComfyNode):
8
+ @classmethod
9
+ def define_schema(cls):
10
+ return io.Schema(
11
+ node_id="TextEncodeQwenImageEdit",
12
+ category="advanced/conditioning",
13
+ inputs=[
14
+ io.Clip.Input("clip"),
15
+ io.String.Input("prompt", multiline=True, dynamic_prompts=True),
16
+ io.Vae.Input("vae", optional=True),
17
+ io.Image.Input("image", optional=True),
18
+ ],
19
+ outputs=[
20
+ io.Conditioning.Output(),
21
+ ],
22
+ )
23
+
24
+ @classmethod
25
+ def execute(cls, clip, prompt, vae=None, image=None) -> io.NodeOutput:
26
+ ref_latent = None
27
+ if image is None:
28
+ images = []
29
+ else:
30
+ samples = image.movedim(-1, 1)
31
+ total = int(1024 * 1024)
32
+
33
+ scale_by = math.sqrt(total / (samples.shape[3] * samples.shape[2]))
34
+ width = round(samples.shape[3] * scale_by)
35
+ height = round(samples.shape[2] * scale_by)
36
+
37
+ s = comfy.utils.common_upscale(samples, width, height, "area", "disabled")
38
+ image = s.movedim(1, -1)
39
+ images = [image[:, :, :, :3]]
40
+ if vae is not None:
41
+ ref_latent = vae.encode(image[:, :, :, :3])
42
+
43
+ tokens = clip.tokenize(prompt, images=images)
44
+ conditioning = clip.encode_from_tokens_scheduled(tokens)
45
+ if ref_latent is not None:
46
+ conditioning = node_helpers.conditioning_set_values(conditioning, {"reference_latents": [ref_latent]}, append=True)
47
+ return io.NodeOutput(conditioning)
48
+
49
+
50
+ class TextEncodeQwenImageEditPlus(io.ComfyNode):
51
+ @classmethod
52
+ def define_schema(cls):
53
+ return io.Schema(
54
+ node_id="TextEncodeQwenImageEditPlus",
55
+ category="advanced/conditioning",
56
+ inputs=[
57
+ io.Clip.Input("clip"),
58
+ io.String.Input("prompt", multiline=True, dynamic_prompts=True),
59
+ io.Vae.Input("vae", optional=True),
60
+ io.Image.Input("image1", optional=True),
61
+ io.Image.Input("image2", optional=True),
62
+ io.Image.Input("image3", optional=True),
63
+ io.Image.Input("image4", optional=True),
64
+ io.Int.Input("target_size", optional=True, default=896, min=128, max=2048, step=32),
65
+ ],
66
+ outputs=[
67
+ io.Conditioning.Output(),
68
+ ],
69
+ )
70
+
71
+ @classmethod
72
+ def execute(cls, clip, prompt, vae=None, image1=None, image2=None, image3=None, image4=None, target_size=896) -> io.NodeOutput:
73
+ ref_latents = []
74
+ images = [image1, image2, image3, image4]
75
+ images_vl = []
76
+ llama_template = "<|im_start|>system\nDescribe key details of the input image (including any objects, characters, poses, facial features, clothing, setting, textures and style), then explain how the user's text instruction should alter, modify or recreate the image. Generate a new image that meets the user's requirements, which can vary from a small change to a completely new image using inputs as a guide.<|im_end|>\n<|im_start|>user\n{}<|im_end|>\n<|im_start|>assistant\n"
77
+ image_prompt = ""
78
+
79
+ for i, image in enumerate(images):
80
+ if image is not None:
81
+ samples = image.movedim(-1, 1)
82
+ total = int(384 * 384)
83
+
84
+ scale_by = math.sqrt(total / (samples.shape[3] * samples.shape[2]))
85
+ width = round(samples.shape[3] * scale_by)
86
+ height = round(samples.shape[2] * scale_by)
87
+
88
+ s = comfy.utils.common_upscale(samples, width, height, "area", "disabled")
89
+ images_vl.append(s.movedim(1, -1))
90
+ if vae is not None:
91
+ total = int(target_size * target_size)
92
+ scale_by = math.sqrt(total / (samples.shape[3] * samples.shape[2]))
93
+
94
+ height = int(samples.shape[2] * scale_by / 32) * 32
95
+ width = int(samples.shape[3] * scale_by / 32) * 32
96
+
97
+ s = comfy.utils.common_upscale(samples, width, height, "lanczos", "center")
98
+ ref_latents.append(vae.encode(s.movedim(1, -1)[:, :, :, :3]))
99
+
100
+ image_prompt += "Picture {}: <|vision_start|><|image_pad|><|vision_end|>".format(i + 1)
101
+
102
+ tokens = clip.tokenize(image_prompt + prompt, images=images_vl, llama_template=llama_template)
103
+ conditioning = clip.encode_from_tokens_scheduled(tokens)
104
+ if len(ref_latents) > 0:
105
+ conditioning = node_helpers.conditioning_set_values(conditioning, {"reference_latents": ref_latents}, append=True)
106
+ return io.NodeOutput(conditioning)
107
+
108
+ class QwenExtension(ComfyExtension):
109
+ @override
110
+ async def get_node_list(self) -> list[type[io.ComfyNode]]:
111
+ return [
112
+ TextEncodeQwenImageEdit,
113
+ TextEncodeQwenImageEditPlus,
114
+ ]
115
+
116
+
117
+ async def comfy_entrypoint() -> QwenExtension:
118
+ return QwenExtension()
v5/Qwen-Rapid-AIO-NSFW-v5.1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33c8fbd5e972c475744ede2bc3f1184ffa999b68fa055eae043e0f2f5c7f1125
3
+ size 28978662810
v5/Qwen-Rapid-AIO-NSFW-v5.2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78352adb263fea99b3509d37d7d6065d6db3a92e99040d1e7c77d688ea037d29
3
+ size 28978664186
v5/Qwen-Rapid-AIO-NSFW-v5.3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ee5f6b05158e9a9d203a7fe6b68c267d90d77e19b132032c1caded1f4508c12
3
+ size 28978664066
v5/Qwen-Rapid-AIO-NSFW-v5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dee3e6bb80ad947b89c192f14cb5e750f920f030125e87b179a0c16ff4e28e25
3
+ size 28978619282
v5/Qwen-Rapid-AIO-SFW-v5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa1ca5acdac9127cd00921b0d89bc25a4a2528bd9a45655e8822af7402568737
3
+ size 28978619898
v6/.this_was_broken_use_other_versions ADDED
File without changes
v7/Qwen-Rapid-AIO-NSFW-v7.1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06c2c34a3af76b82c4df0c1c6b4f3530dceb7f649a06d6b0e4c5677574be156f
3
+ size 28978666322
v7/Qwen-Rapid-AIO-NSFW-v7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce31dcd612dcda34ad99bab634a64ed8482ba88765b60832944c984cf996592f
3
+ size 28978666882
v7/Qwen-Rapid-AIO-SFW-v7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:064ff1688134ba47f2e38da3af21a6da58ba893e609f03591936656a8421261d
3
+ size 28978666882