工作流 /
图像 /
HiDream O1 Full:图像生成

HiDream O1 Full:图像生成
HiDream O1 Full: Image generation
输入文本提示词,并可选择上传参考图像。通过文生图、编辑或主体驱动个性化,生成高达2048x2048的高分辨率图像。
图像
30 个节点 1 个输入 17 次使用 ComfyUI ≥ 0.21.1 ComfyUI 65 KB
需要的权重
这个工作流引用了 2 个权重文件,其中 2 个能在本站模型库里找到。
节点构成
ComfySwitchNode
× 4
MarkdownNote
× 3
CLIPTextEncode
× 2
PrimitiveBoolean
× 2
ComfyMathExpression
× 2
EmptyHiDreamO1LatentImage
× 2
SamplerCustom
× 1
BasicScheduler
× 1
CheckpointLoaderSimple
× 1
ModelNoiseScale
× 1
HiDreamO1ReferenceImages
× 1
VAEDecode
× 1
GetImageSize
× 1
fa7296b5-c974-4466-bfe3-a1f05f43b880
× 1
ImageScaleToTotalPixels
× 1
LoadImage
× 1
官方标注的模型
HiDream
工作流 JSON
和上面「下载工作流 JSON」是同一份文件。
1{
2 "id": "a2143803-dd9d-4fd4-9370-31ce70307498",
3 "revision": 0,
4 "last_node_id": 234,
5 "last_link_id": 364,
6 "nodes": [
7 {
8 "id": 108,
9 "type": "SamplerCustom",
10 "pos": [
11 -980,
12 4600
13 ],
14 "size": [
15 280,
16 500
17 ],
18 "flags": [],
19 "order": 27,
20 "mode": 0,
21 "showAdvanced": false,
22 "inputs": [
23 {
24 "name": "model",
25 "type": "MODEL",
26 "link": 356
27 },
28 {
29 "name": "positive",
30 "type": "CONDITIONING",
31 "link": 323
32 },
33 {
34 "name": "negative",
35 "type": "CONDITIONING",
36 "link": 324
37 },
38 {
39 "name": "sampler",
40 "type": "SAMPLER",
41 "link": 351
42 },
43 {
44 "name": "sigmas",
45 "type": "SIGMAS",
46 "link": 139
47 },
48 {
49 "name": "latent_image",
50 "type": "LATENT",
51 "link": 321
52 }
53 ],
54 "outputs": [
55 {
56 "name": "output",
57 "type": "LATENT",
58 "links": [
59 322
60 ]
61 },
62 {
63 "name": "denoised_output",
64 "type": "LATENT",
65 "links": []
66 }
67 ],
68 "properties": {
69 "Node name for S&R": "SamplerCustom",
70 "cnr_id": "comfy-core",
71 "ver": "0.21.0",
72 "enableTabs": false,
73 "tabWidth": 65,
74 "tabXOffset": 10,
75 "hasSecondTab": false,
76 "secondTabText": "Send Back",
77 "secondTabOffset": 80,
78 "secondTabWidth": 65
79 },
80 "widgets_values": [
81 true,
82 493576922569549,
83 "randomize",
84 5
85 ]
86 },
87 {
88 "id": 112,
89 "type": "BasicScheduler",
90 "pos": [
91 -1340,
92 5060
93 ],
94 "size": [
95 280,
96 150
97 ],
98 "flags": [],
99 "order": 14,
100 "mode": 0,
101 "inputs": [
102 {
103 "name": "model",
104 "type": "MODEL",
105 "link": 182
106 }
107 ],
108 "outputs": [
109 {
110 "name": "SIGMAS",
111 "type": "SIGMAS",
112 "links": [
113 139
114 ]
115 }
116 ],
117 "properties": {
118 "Node name for S&R": "BasicScheduler",
119 "cnr_id": "comfy-core",
120 "ver": "0.21.0",
121 "enableTabs": false,
122 "tabWidth": 65,
123 "tabXOffset": 10,
124 "hasSecondTab": false,
125 "secondTabText": "Send Back",
126 "secondTabOffset": 80,
127 "secondTabWidth": 65
128 },
129 "widgets_values": [
130 "normal",
131 40,
132 1
133 ]
134 },
135 {
136 "id": 6,
137 "type": "CheckpointLoaderSimple",
138 "pos": [
139 -3240,
140 4620
141 ],
142 "size": [
143 470,
144 140
145 ],
146 "flags": [],
147 "order": 0,
148 "mode": 0,
149 "inputs": [],
150 "outputs": [
151 {
152 "name": "MODEL",
153 "type": "MODEL",
154 "links": [
155 192
156 ]
157 },
158 {
159 "name": "CLIP",
160 "type": "CLIP",
161 "links": [
162 146,
163 274
164 ]
165 },
166 {
167 "name": "VAE",
168 "type": "VAE",
169 "links": [
170 147
171 ]
172 }
173 ],
174 "properties": {
175 "Node name for S&R": "CheckpointLoaderSimple",
176 "cnr_id": "comfy-core",
177 "ver": "0.21.0",
178 "models": [
179 {
180 "name": "hidream_o1_image_bf16.safetensors",
181 "url": "https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_bf16.safetensors",
182 "directory": "checkpoints"
183 }
184 ],
185 "enableTabs": false,
186 "tabWidth": 65,
187 "tabXOffset": 10,
188 "hasSecondTab": false,
189 "secondTabText": "Send Back",
190 "secondTabOffset": 80,
191 "secondTabWidth": 65
192 },
193 "widgets_values": [
194 "hidream_o1_image_bf16.safetensors"
195 ]
196 },
197 {
198 "id": 124,
199 "type": "ModelNoiseScale",
200 "pos": [
201 -1700,
202 4880
203 ],
204 "size": [
205 280,
206 80
207 ],
208 "flags": [],
209 "order": 10,
210 "mode": 0,
211 "inputs": [
212 {
213 "name": "model",
214 "type": "MODEL",
215 "link": 192
216 }
217 ],
218 "outputs": [
219 {
220 "name": "MODEL",
221 "type": "MODEL",
222 "links": [
223 182,
224 355
225 ]
226 }
227 ],
228 "properties": {
229 "Node name for S&R": "ModelNoiseScale",
230 "cnr_id": "comfy-core",
231 "ver": "0.21.0",
232 "enableTabs": false,
233 "tabWidth": 65,
234 "tabXOffset": 10,
235 "hasSecondTab": false,
236 "secondTabText": "Send Back",
237 "secondTabOffset": 80,
238 "secondTabWidth": 65
239 },
240 "widgets_values": [
241 8
242 ]
243 },
244 {
245 "id": 104,
246 "type": "HiDreamO1ReferenceImages",
247 "pos": [
248 -2050,
249 5090
250 ],
251 "size": [
252 250,
253 120
254 ],
255 "flags": [],
256 "order": 24,
257 "mode": 0,
258 "inputs": [
259 {
260 "name": "positive",
261 "type": "CONDITIONING",
262 "link": 141
263 },
264 {
265 "name": "negative",
266 "type": "CONDITIONING",
267 "link": 275
268 },
269 {
270 "label": "image_1",
271 "name": "images.image_1",
272 "type": "IMAGE",
273 "link": 362
274 },
275 {
276 "label": "image_2",
277 "name": "images.image_2",
278 "shape": 7,
279 "type": "IMAGE",
280 "link": null
281 }
282 ],
283 "outputs": [
284 {
285 "name": "positive",
286 "type": "CONDITIONING",
287 "links": [
288 218
289 ]
290 },
291 {
292 "name": "negative",
293 "type": "CONDITIONING",
294 "links": [
295 220
296 ]
297 }
298 ],
299 "properties": {
300 "Node name for S&R": "HiDreamO1ReferenceImages",
301 "cnr_id": "comfy-core",
302 "ver": "0.21.0",
303 "enableTabs": false,
304 "tabWidth": 65,
305 "tabXOffset": 10,
306 "hasSecondTab": false,
307 "secondTabText": "Send Back",
308 "secondTabOffset": 80,
309 "secondTabWidth": 65
310 },
311 "widgets_values": [],
312 "color": "#322",
313 "bgcolor": "#533"
314 },
315 {
316 "id": 110,
317 "type": "CLIPTextEncode",
318 "pos": [
319 -2540,
320 4600
321 ],
322 "size": [
323 420,
324 480
325 ],
326 "flags": [],
327 "order": 22,
328 "mode": 0,
329 "inputs": [
330 {
331 "name": "clip",
332 "type": "CLIP",
333 "link": 146
334 },
335 {
336 "name": "text",
337 "type": "STRING",
338 "widget": {
339 "name": "text"
340 },
341 "link": 327
342 }
343 ],
344 "outputs": [
345 {
346 "name": "CONDITIONING",
347 "type": "CONDITIONING",
348 "links": [
349 141,
350 217
351 ]
352 }
353 ],
354 "properties": {
355 "Node name for S&R": "CLIPTextEncode",
356 "cnr_id": "comfy-core",
357 "ver": "0.21.0",
358 "enableTabs": false,
359 "tabWidth": 65,
360 "tabXOffset": 10,
361 "hasSecondTab": false,
362 "secondTabText": "Send Back",
363 "secondTabOffset": 80,
364 "secondTabWidth": 65
365 },
366 "widgets_values": [
367 ""
368 ],
369 "color": "#232",
370 "bgcolor": "#353"
371 },
372 {
373 "id": 105,
374 "type": "VAEDecode",
375 "pos": [
376 -950,
377 5140
378 ],
379 "size": [
380 230,
381 80
382 ],
383 "flags": [],
384 "order": 28,
385 "mode": 0,
386 "inputs": [
387 {
388 "name": "samples",
389 "type": "LATENT",
390 "link": 322
391 },
392 {
393 "name": "vae",
394 "type": "VAE",
395 "link": 147
396 }
397 ],
398 "outputs": [
399 {
400 "name": "IMAGE",
401 "type": "IMAGE",
402 "links": [
403 347
404 ]
405 }
406 ],
407 "properties": {
408 "Node name for S&R": "VAEDecode",
409 "cnr_id": "comfy-core",
410 "ver": "0.21.0",
411 "enableTabs": false,
412 "tabWidth": 65,
413 "tabXOffset": 10,
414 "hasSecondTab": false,
415 "secondTabText": "Send Back",
416 "secondTabOffset": 80,
417 "secondTabWidth": 65
418 },
419 "widgets_values": []
420 },
421 {
422 "id": 152,
423 "type": "ComfySwitchNode",
424 "pos": [
425 -2050,
426 4660
427 ],
428 "size": [
429 270,
430 130
431 ],
432 "flags": [],
433 "order": 25,
434 "mode": 0,
435 "inputs": [
436 {
437 "name": "on_false",
438 "type": "CONDITIONING",
439 "link": 217
440 },
441 {
442 "name": "on_true",
443 "type": "CONDITIONING",
444 "link": 218
445 },
446 {
447 "name": "switch",
448 "type": "BOOLEAN",
449 "widget": {
450 "name": "switch"
451 },
452 "link": 224
453 }
454 ],
455 "outputs": [
456 {
457 "name": "output",
458 "type": "CONDITIONING",
459 "links": [
460 323
461 ]
462 }
463 ],
464 "properties": {
465 "Node name for S&R": "ComfySwitchNode",
466 "cnr_id": "comfy-core",
467 "ver": "0.21.0",
468 "enableTabs": false,
469 "tabWidth": 65,
470 "tabXOffset": 10,
471 "hasSecondTab": false,
472 "secondTabText": "Send Back",
473 "secondTabOffset": 80,
474 "secondTabWidth": 65
475 },
476 "widgets_values": [
477 false
478 ]
479 },
480 {
481 "id": 153,
482 "type": "ComfySwitchNode",
483 "pos": [
484 -2050,
485 4840
486 ],
487 "size": [
488 270,
489 130
490 ],
491 "flags": [],
492 "order": 26,
493 "mode": 0,
494 "inputs": [
495 {
496 "name": "on_false",
497 "type": "CONDITIONING",
498 "link": 276
499 },
500 {
501 "name": "on_true",
502 "type": "CONDITIONING",
503 "link": 220
504 },
505 {
506 "name": "switch",
507 "type": "BOOLEAN",
508 "widget": {
509 "name": "switch"
510 },
511 "link": 225
512 }
513 ],
514 "outputs": [
515 {
516 "name": "output",
517 "type": "CONDITIONING",
518 "links": [
519 324
520 ]
521 }
522 ],
523 "properties": {
524 "Node name for S&R": "ComfySwitchNode",
525 "cnr_id": "comfy-core",
526 "ver": "0.21.0",
527 "enableTabs": false,
528 "tabWidth": 65,
529 "tabXOffset": 10,
530 "hasSecondTab": false,
531 "secondTabText": "Send Back",
532 "secondTabOffset": 80,
533 "secondTabWidth": 65
534 },
535 "widgets_values": [
536 false
537 ]
538 },
539 {
540 "id": 155,
541 "type": "ComfySwitchNode",
542 "pos": [
543 -1180,
544 5400
545 ],
546 "size": [
547 230,
548 130
549 ],
550 "flags": [],
551 "order": 23,
552 "mode": 0,
553 "inputs": [
554 {
555 "name": "on_false",
556 "type": "LATENT",
557 "link": 233
558 },
559 {
560 "name": "on_true",
561 "type": "LATENT",
562 "link": 350
563 },
564 {
565 "name": "switch",
566 "type": "BOOLEAN",
567 "widget": {
568 "name": "switch"
569 },
570 "link": 235
571 }
572 ],
573 "outputs": [
574 {
575 "name": "output",
576 "type": "LATENT",
577 "links": [
578 321
579 ]
580 }
581 ],
582 "properties": {
583 "Node name for S&R": "ComfySwitchNode",
584 "cnr_id": "comfy-core",
585 "ver": "0.21.0",
586 "enableTabs": false,
587 "tabWidth": 65,
588 "tabXOffset": 10,
589 "hasSecondTab": false,
590 "secondTabText": "Send Back",
591 "secondTabOffset": 80,
592 "secondTabWidth": 65
593 },
594 "widgets_values": [
595 false
596 ]
597 },
598 {
599 "id": 157,
600 "type": "GetImageSize",
601 "pos": [
602 -1490,
603 5720
604 ],
605 "size": [
606 225,
607 8
608 ],
609 "flags": {
610 "collapsed": true
611 },
612 "order": 16,
613 "mode": 0,
614 "inputs": [
615 {
616 "name": "image",
617 "type": "IMAGE",
618 "link": 318
619 }
620 ],
621 "outputs": [
622 {
623 "name": "width",
624 "type": "INT",
625 "links": [
626 319
627 ]
628 },
629 {
630 "name": "height",
631 "type": "INT",
632 "links": [
633 320
634 ]
635 },
636 {
637 "name": "batch_size",
638 "type": "INT",
639 "links": null
640 }
641 ],
642 "properties": {
643 "Node name for S&R": "GetImageSize",
644 "cnr_id": "comfy-core",
645 "ver": "0.21.0",
646 "enableTabs": false,
647 "tabWidth": 65,
648 "tabXOffset": 10,
649 "hasSecondTab": false,
650 "secondTabText": "Send Back",
651 "secondTabOffset": 80,
652 "secondTabWidth": 65
653 },
654 "widgets_values": []
655 },
656 {
657 "id": 154,
658 "type": "PrimitiveBoolean",
659 "pos": [
660 -3420,
661 5630
662 ],
663 "size": [
664 270,
665 80
666 ],
667 "flags": [],
668 "order": 1,
669 "mode": 0,
670 "inputs": [],
671 "outputs": [
672 {
673 "name": "BOOLEAN",
674 "type": "BOOLEAN",
675 "links": [
676 224,
677 225,
678 235
679 ]
680 }
681 ],
682 "title": "Switch to Image Edit",
683 "properties": {
684 "Node name for S&R": "PrimitiveBoolean",
685 "cnr_id": "comfy-core",
686 "ver": "0.21.0",
687 "enableTabs": false,
688 "tabWidth": 65,
689 "tabXOffset": 10,
690 "hasSecondTab": false,
691 "secondTabText": "Send Back",
692 "secondTabOffset": 80,
693 "secondTabWidth": 65
694 },
695 "widgets_values": [
696 false
697 ]
698 },
699 {
700 "id": 175,
701 "type": "fa7296b5-c974-4466-bfe3-a1f05f43b880",
702 "pos": [
703 -3060,
704 4890
705 ],
706 "size": [
707 430,
708 180
709 ],
710 "flags": [],
711 "order": 13,
712 "mode": 0,
713 "inputs": [
714 {
715 "label": "user_prompt",
716 "name": "replace",
717 "type": "STRING",
718 "widget": {
719 "name": "replace"
720 },
721 "link": 260
722 },
723 {
724 "name": "image",
725 "shape": 7,
726 "type": "IMAGE",
727 "link": 363
728 }
729 ],
730 "outputs": [
731 {
732 "name": "output",
733 "type": "STRING",
734 "links": [
735 266
736 ]
737 }
738 ],
739 "properties": {
740 "proxyWidgets": [
741 [
742 "170",
743 "replace"
744 ],
745 [
746 "167",
747 "clip_name"
748 ]
749 ],
750 "cnr_id": "comfy-core",
751 "ver": "0.21.0",
752 "enableTabs": false,
753 "tabWidth": 65,
754 "tabXOffset": 10,
755 "hasSecondTab": false,
756 "secondTabText": "Send Back",
757 "secondTabOffset": 80,
758 "secondTabWidth": 65
759 },
760 "widgets_values": []
761 },
762 {
763 "id": 176,
764 "type": "ComfySwitchNode",
765 "pos": [
766 -3060,
767 5110
768 ],
769 "size": [
770 225,
771 8
772 ],
773 "flags": {
774 "collapsed": true
775 },
776 "order": 17,
777 "mode": 0,
778 "inputs": [
779 {
780 "name": "on_false",
781 "type": "STRING",
782 "link": 267
783 },
784 {
785 "name": "on_true",
786 "type": "STRING",
787 "link": 266
788 },
789 {
790 "name": "switch",
791 "type": "BOOLEAN",
792 "widget": {
793 "name": "switch"
794 },
795 "link": 265
796 }
797 ],
798 "outputs": [
799 {
800 "name": "output",
801 "type": "STRING",
802 "links": [
803 326
804 ]
805 }
806 ],
807 "properties": {
808 "Node name for S&R": "ComfySwitchNode",
809 "cnr_id": "comfy-core",
810 "ver": "0.21.0",
811 "enableTabs": false,
812 "tabWidth": 65,
813 "tabXOffset": 10,
814 "hasSecondTab": false,
815 "secondTabText": "Send Back",
816 "secondTabOffset": 80,
817 "secondTabWidth": 65
818 },
819 "widgets_values": [
820 false
821 ]
822 },
823 {
824 "id": 177,
825 "type": "PrimitiveBoolean",
826 "pos": [
827 -3420,
828 5430
829 ],
830 "size": [
831 270,
832 80
833 ],
834 "flags": [],
835 "order": 2,
836 "mode": 0,
837 "inputs": [],
838 "outputs": [
839 {
840 "name": "BOOLEAN",
841 "type": "BOOLEAN",
842 "links": [
843 265
844 ]
845 }
846 ],
847 "title": "Enable Prompt Refine?",
848 "properties": {
849 "Node name for S&R": "PrimitiveBoolean",
850 "cnr_id": "comfy-core",
851 "ver": "0.21.0",
852 "enableTabs": false,
853 "tabWidth": 65,
854 "tabXOffset": 10,
855 "hasSecondTab": false,
856 "secondTabText": "Send Back",
857 "secondTabOffset": 80,
858 "secondTabWidth": 65
859 },
860 "widgets_values": [
861 false
862 ]
863 },
864 {
865 "id": 188,
866 "type": "CLIPTextEncode",
867 "pos": [
868 -2540,
869 5160
870 ],
871 "size": [
872 234.765625,
873 8
874 ],
875 "flags": {
876 "collapsed": true
877 },
878 "order": 11,
879 "mode": 0,
880 "inputs": [
881 {
882 "name": "clip",
883 "type": "CLIP",
884 "link": 274
885 }
886 ],
887 "outputs": [
888 {
889 "name": "CONDITIONING",
890 "type": "CONDITIONING",
891 "links": [
892 275,
893 276
894 ]
895 }
896 ],
897 "properties": {
898 "Node name for S&R": "CLIPTextEncode",
899 "cnr_id": "comfy-core",
900 "ver": "0.21.0",
901 "enableTabs": false,
902 "tabWidth": 65,
903 "tabXOffset": 10,
904 "hasSecondTab": false,
905 "secondTabText": "Send Back",
906 "secondTabOffset": 80,
907 "secondTabWidth": 65
908 },
909 "widgets_values": [
910 ""
911 ],
912 "color": "#223",
913 "bgcolor": "#335"
914 },
915 {
916 "id": 195,
917 "type": "MarkdownNote",
918 "pos": [
919 -1890,
920 5960
921 ],
922 "size": [
923 980,
924 560
925 ],
926 "flags": [],
927 "order": 3,
928 "mode": 0,
929 "inputs": [],
930 "outputs": [],
931 "title": "Note: About Image Size",
932 "properties": [],
933 "widgets_values": [
934 "Select and Ctrl-B to enable the `ImageScaleToTotalPixels` node, if your input image is too large\n\nThe O1 model is trained under the following resolutions:\n| Width | Height | Category |\n|-------|--------|------------|\n| 2048 | 2048 | Square |\n| 2304 | 1728 | Landscape |\n| 2304 | 1792 | Landscape |\n| 2496 | 1664 | Landscape |\n| 2560 | 1440 | Landscape |\n| 3104 | 1312 | Landscape |\n| 1728 | 2304 | Portrait |\n| 1792 | 2304 | Portrait |\n| 1664 | 2496 | Portrait |\n| 1440 | 2560 | Portrait |\n| 1312 | 3104 | Portrait |"
935 ],
936 "color": "#222",
937 "bgcolor": "#000"
938 },
939 {
940 "id": 196,
941 "type": "ImageScaleToTotalPixels",
942 "pos": [
943 -1830,
944 5700
945 ],
946 "size": [
947 320,
948 150
949 ],
950 "flags": [],
951 "order": 12,
952 "mode": 4,
953 "inputs": [
954 {
955 "name": "image",
956 "type": "IMAGE",
957 "link": 364
958 }
959 ],
960 "outputs": [
961 {
962 "name": "IMAGE",
963 "type": "IMAGE",
964 "links": [
965 318
966 ]
967 }
968 ],
969 "properties": {
970 "Node name for S&R": "ImageScaleToTotalPixels",
971 "cnr_id": "comfy-core",
972 "ver": "0.21.0",
973 "enableTabs": false,
974 "tabWidth": 65,
975 "tabXOffset": 10,
976 "hasSecondTab": false,
977 "secondTabText": "Send Back",
978 "secondTabOffset": 80,
979 "secondTabWidth": 65
980 },
981 "widgets_values": [
982 "lanczos",
983 4,
984 1
985 ]
986 },
987 {
988 "id": 205,
989 "type": "MarkdownNote",
990 "pos": [
991 -4330,
992 4560
993 ],
994 "size": [
995 820,
996 810.359375
997 ],
998 "flags": [],
999 "order": 4,
1000 "mode": 0,
1001 "inputs": [],
1002 "outputs": [],
1003 "properties": [],
1004 "widgets_values": [
1005 "Related PR: [#13817](https://github.com/Comfy-Org/ComfyUI/pull/13817)\n\n## Model Links\n\n- [Hugging Face:Comfy-Org/HiDream-O1-Image](https://huggingface.co/Comfy-Org/HiDream-O1-Image)\n- [ModelScope:Comfy-Org/HiDream-O1-Image](https://modelscope.cn/models/Comfy-Org/HiDream-O1-Image)\n- [Hugging Face:Comfy-Org/gemma-4](https://huggingface.co/Comfy-Org/gemma-4)\n- [ModelScope:Comfy-Org/gemma-4](https://modelscope.cn/models/Comfy-Org/gemma-4)\n\n**checkpoints**\n\n- [hidream_o1_image_bf16.safetensors](https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_bf16.safetensors) (15.24 GB)\n- [hidream_o1_image_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_fp8_scaled.safetensors) (7.51 GB)\n- [hidream_o1_image_mxfp8.safetensors](https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_mxfp8.safetensors) (8.31 GB)\n\n**text_encoders**\n\n- [gemma4_e4b_it_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors) (8.44 GB)\n\n\n## Model Storage Location\n\n```\n📂 ComfyUI/\n├── 📂 models/\n│ ├── 📂 checkpoints/\n│ │ ├── hidream_o1_image_mxfp8.safetensors\n│ │ ├── hidream_o1_image_bf16.safetensors\n│ │ └── hidream_o1_image_fp8_scaled.safetensors\n│ └── 📂 text_encoders/\n│ └── gemma4_e4b_it_fp8_scaled.safetensors\n```\n\n## Report Issue\n\nNote: Please update ComfyUI first ([guide](https://docs.comfy.org/installation/update_comfyui)) and prepare required models. Desktop/Cloud updates follow stable releases, so some nightly-supported models may not be available yet.\n\n- Cannot run / runtime errors: [ComfyUI/issues](https://github.com/comfyanonymous/ComfyUI/issues)\n- UI / frontend issues: [ComfyUI_frontend/issues](https://github.com/Comfy-Org/ComfyUI_frontend/issues)\n- Workflow issues: [workflow_templates/issues](https://github.com/Comfy-Org/workflow_templates/issues)\n"
1006 ],
1007 "color": "#222",
1008 "bgcolor": "#000"
1009 },
1010 {
1011 "id": 213,
1012 "type": "LoadImage",
1013 "pos": [
1014 -3030,
1015 5410
1016 ],
1017 "size": [
1018 310,
1019 430
1020 ],
1021 "flags": [],
1022 "order": 5,
1023 "mode": 0,
1024 "inputs": [],
1025 "outputs": [
1026 {
1027 "name": "IMAGE",
1028 "type": "IMAGE",
1029 "links": [
1030 362,
1031 363,
1032 364
1033 ]
1034 },
1035 {
1036 "name": "MASK",
1037 "type": "MASK",
1038 "links": null
1039 }
1040 ],
1041 "properties": {
1042 "Node name for S&R": "LoadImage",
1043 "cnr_id": "comfy-core",
1044 "ver": "0.21.0",
1045 "enableTabs": false,
1046 "tabWidth": 65,
1047 "tabXOffset": 10,
1048 "hasSecondTab": false,
1049 "secondTabText": "Send Back",
1050 "secondTabOffset": 80,
1051 "secondTabWidth": 65
1052 },
1053 "widgets_values": [
1054 "noir_portrait.png",
1055 "image"
1056 ]
1057 },
1058 {
1059 "id": 218,
1060 "type": "ComfyMathExpression",
1061 "pos": [
1062 -1490,
1063 5770
1064 ],
1065 "size": [
1066 225,
1067 8
1068 ],
1069 "flags": {
1070 "collapsed": true
1071 },
1072 "order": 18,
1073 "mode": 0,
1074 "inputs": [
1075 {
1076 "label": "a",
1077 "name": "values.a",
1078 "type": "FLOAT,INT,BOOLEAN",
1079 "link": 319
1080 },
1081 {
1082 "label": "b",
1083 "name": "values.b",
1084 "shape": 7,
1085 "type": "FLOAT,INT,BOOLEAN",
1086 "link": null
1087 }
1088 ],
1089 "outputs": [
1090 {
1091 "name": "FLOAT",
1092 "type": "FLOAT",
1093 "links": null
1094 },
1095 {
1096 "name": "INT",
1097 "type": "INT",
1098 "links": [
1099 310
1100 ]
1101 },
1102 {
1103 "name": "BOOL",
1104 "type": "BOOLEAN",
1105 "links": null
1106 }
1107 ],
1108 "properties": {
1109 "Node name for S&R": "ComfyMathExpression",
1110 "cnr_id": "comfy-core",
1111 "ver": "0.21.0",
1112 "enableTabs": false,
1113 "tabWidth": 65,
1114 "tabXOffset": 10,
1115 "hasSecondTab": false,
1116 "secondTabText": "Send Back",
1117 "secondTabOffset": 80,
1118 "secondTabWidth": 65
1119 },
1120 "widgets_values": [
1121 "floor(a/32)*32"
1122 ]
1123 },
1124 {
1125 "id": 219,
1126 "type": "ComfyMathExpression",
1127 "pos": [
1128 -1490,
1129 5820
1130 ],
1131 "size": [
1132 225,
1133 8
1134 ],
1135 "flags": {
1136 "collapsed": true
1137 },
1138 "order": 19,
1139 "mode": 0,
1140 "inputs": [
1141 {
1142 "label": "a",
1143 "name": "values.a",
1144 "type": "FLOAT,INT,BOOLEAN",
1145 "link": 320
1146 },
1147 {
1148 "label": "b",
1149 "name": "values.b",
1150 "shape": 7,
1151 "type": "FLOAT,INT,BOOLEAN",
1152 "link": null
1153 }
1154 ],
1155 "outputs": [
1156 {
1157 "name": "FLOAT",
1158 "type": "FLOAT",
1159 "links": null
1160 },
1161 {
1162 "name": "INT",
1163 "type": "INT",
1164 "links": [
1165 311
1166 ]
1167 },
1168 {
1169 "name": "BOOL",
1170 "type": "BOOLEAN",
1171 "links": null
1172 }
1173 ],
1174 "properties": {
1175 "Node name for S&R": "ComfyMathExpression",
1176 "cnr_id": "comfy-core",
1177 "ver": "0.21.0",
1178 "enableTabs": false,
1179 "tabWidth": 65,
1180 "tabXOffset": 10,
1181 "hasSecondTab": false,
1182 "secondTabText": "Send Back",
1183 "secondTabOffset": 80,
1184 "secondTabWidth": 65
1185 },
1186 "widgets_values": [
1187 "floor(a/32)*32"
1188 ]
1189 },
1190 {
1191 "id": 221,
1192 "type": "PreviewAny",
1193 "pos": [
1194 -2830,
1195 5100
1196 ],
1197 "size": [
1198 230,
1199 160
1200 ],
1201 "flags": {
1202 "collapsed": false
1203 },
1204 "order": 20,
1205 "mode": 0,
1206 "inputs": [
1207 {
1208 "name": "source",
1209 "type": "*",
1210 "link": 326
1211 }
1212 ],
1213 "outputs": [
1214 {
1215 "name": "STRING",
1216 "type": "STRING",
1217 "links": [
1218 327
1219 ]
1220 }
1221 ],
1222 "properties": {
1223 "Node name for S&R": "PreviewAny",
1224 "cnr_id": "comfy-core",
1225 "ver": "0.21.0",
1226 "enableTabs": false,
1227 "tabWidth": 65,
1228 "tabXOffset": 10,
1229 "hasSecondTab": false,
1230 "secondTabText": "Send Back",
1231 "secondTabOffset": 80,
1232 "secondTabWidth": 65
1233 },
1234 "widgets_values": [
1235 null,
1236 null,
1237 null
1238 ]
1239 },
1240 {
1241 "id": 156,
1242 "type": "EmptyHiDreamO1LatentImage",
1243 "pos": [
1244 -1850,
1245 5420
1246 ],
1247 "size": [
1248 280,
1249 150
1250 ],
1251 "flags": [],
1252 "order": 6,
1253 "mode": 0,
1254 "inputs": [],
1255 "outputs": [
1256 {
1257 "name": "LATENT",
1258 "type": "LATENT",
1259 "links": [
1260 233
1261 ]
1262 }
1263 ],
1264 "properties": {
1265 "Node name for S&R": "EmptyHiDreamO1LatentImage",
1266 "cnr_id": "comfy-core",
1267 "ver": "0.21.0",
1268 "enableTabs": false,
1269 "tabWidth": 65,
1270 "tabXOffset": 10,
1271 "hasSecondTab": false,
1272 "secondTabText": "Send Back",
1273 "secondTabOffset": 80,
1274 "secondTabWidth": 65
1275 },
1276 "widgets_values": [
1277 2048,
1278 2048,
1279 1
1280 ]
1281 },
1282 {
1283 "id": 172,
1284 "type": "EmptyHiDreamO1LatentImage",
1285 "pos": [
1286 -1220,
1287 5690
1288 ],
1289 "size": [
1290 280,
1291 150
1292 ],
1293 "flags": [],
1294 "order": 21,
1295 "mode": 0,
1296 "inputs": [
1297 {
1298 "name": "width",
1299 "type": "INT",
1300 "widget": {
1301 "name": "width"
1302 },
1303 "link": 310
1304 },
1305 {
1306 "name": "height",
1307 "type": "INT",
1308 "widget": {
1309 "name": "height"
1310 },
1311 "link": 311
1312 }
1313 ],
1314 "outputs": [
1315 {
1316 "name": "LATENT",
1317 "type": "LATENT",
1318 "links": [
1319 350
1320 ]
1321 }
1322 ],
1323 "properties": {
1324 "Node name for S&R": "EmptyHiDreamO1LatentImage",
1325 "cnr_id": "comfy-core",
1326 "ver": "0.21.0",
1327 "enableTabs": false,
1328 "tabWidth": 65,
1329 "tabXOffset": 10,
1330 "hasSecondTab": false,
1331 "secondTabText": "Send Back",
1332 "secondTabOffset": 80,
1333 "secondTabWidth": 65
1334 },
1335 "widgets_values": [
1336 2048,
1337 2048,
1338 1
1339 ]
1340 },
1341 {
1342 "id": 226,
1343 "type": "MarkdownNote",
1344 "pos": [
1345 -2560,
1346 5430
1347 ],
1348 "size": [
1349 360,
1350 240
1351 ],
1352 "flags": [],
1353 "order": 7,
1354 "mode": 0,
1355 "inputs": [],
1356 "outputs": [],
1357 "title": "Note: Reference Images",
1358 "properties": [],
1359 "widgets_values": [
1360 "The HiDream O1 supports up to 10 reference images. You can add more Load Image nodes, then link them to the HiDream-O1 Reference Images node."
1361 ],
1362 "color": "#222",
1363 "bgcolor": "#000"
1364 },
1365 {
1366 "id": 171,
1367 "type": "PrimitiveStringMultiline",
1368 "pos": [
1369 -3440,
1370 4890
1371 ],
1372 "size": [
1373 310,
1374 320
1375 ],
1376 "flags": [],
1377 "order": 8,
1378 "mode": 0,
1379 "inputs": [],
1380 "outputs": [
1381 {
1382 "name": "STRING",
1383 "type": "STRING",
1384 "links": [
1385 260,
1386 267
1387 ]
1388 }
1389 ],
1390 "title": "User Prompt",
1391 "properties": {
1392 "Node name for S&R": "PrimitiveStringMultiline",
1393 "cnr_id": "comfy-core",
1394 "ver": "0.21.0",
1395 "enableTabs": false,
1396 "tabWidth": 65,
1397 "tabXOffset": 10,
1398 "hasSecondTab": false,
1399 "secondTabText": "Send Back",
1400 "secondTabOffset": 80,
1401 "secondTabWidth": 65
1402 },
1403 "widgets_values": [
1404 "Graceful female skincare shot, light nude makeup, holding essence bottle, warm ivory backdrop, soft diffused light"
1405 ]
1406 },
1407 {
1408 "id": 227,
1409 "type": "SaveImage",
1410 "pos": [
1411 -630,
1412 4560
1413 ],
1414 "size": [
1415 1260,
1416 1330
1417 ],
1418 "flags": [],
1419 "order": 29,
1420 "mode": 0,
1421 "inputs": [
1422 {
1423 "name": "images",
1424 "type": "IMAGE",
1425 "link": 347
1426 }
1427 ],
1428 "outputs": [],
1429 "properties": {
1430 "Node name for S&R": "SaveImage",
1431 "cnr_id": "comfy-core",
1432 "ver": "0.21.1",
1433 "enableTabs": false,
1434 "tabWidth": 65,
1435 "tabXOffset": 10,
1436 "hasSecondTab": false,
1437 "secondTabText": "Send Back",
1438 "secondTabOffset": 80,
1439 "secondTabWidth": 65
1440 },
1441 "widgets_values": [
1442 "hidream_o1"
1443 ]
1444 },
1445 {
1446 "id": 230,
1447 "type": "KSamplerSelect",
1448 "pos": [
1449 -1340,
1450 4920
1451 ],
1452 "size": [
1453 270,
1454 90
1455 ],
1456 "flags": [],
1457 "order": 9,
1458 "mode": 0,
1459 "inputs": [],
1460 "outputs": [
1461 {
1462 "name": "SAMPLER",
1463 "type": "SAMPLER",
1464 "links": [
1465 351
1466 ]
1467 }
1468 ],
1469 "properties": {
1470 "Node name for S&R": "KSamplerSelect",
1471 "cnr_id": "comfy-core",
1472 "ver": "0.21.1",
1473 "enableTabs": false,
1474 "tabWidth": 65,
1475 "tabXOffset": 10,
1476 "hasSecondTab": false,
1477 "secondTabText": "Send Back",
1478 "secondTabOffset": 80,
1479 "secondTabWidth": 65
1480 },
1481 "widgets_values": [
1482 "dpmpp_2m_sde_gpu"
1483 ]
1484 },
1485 {
1486 "id": 232,
1487 "type": "HiDreamO1PatchSeamSmoothing",
1488 "pos": [
1489 -1370,
1490 4600
1491 ],
1492 "size": [
1493 340,
1494 280
1495 ],
1496 "flags": [],
1497 "order": 15,
1498 "mode": 0,
1499 "inputs": [
1500 {
1501 "name": "model",
1502 "type": "MODEL",
1503 "link": 355
1504 }
1505 ],
1506 "outputs": [
1507 {
1508 "name": "MODEL",
1509 "type": "MODEL",
1510 "links": [
1511 356
1512 ]
1513 }
1514 ],
1515 "properties": {
1516 "Node name for S&R": "HiDreamO1PatchSeamSmoothing",
1517 "cnr_id": "comfy-core",
1518 "ver": "0.21.1",
1519 "enableTabs": false,
1520 "tabWidth": 65,
1521 "tabXOffset": 10,
1522 "hasSecondTab": false,
1523 "secondTabText": "Send Back",
1524 "secondTabOffset": 80,
1525 "secondTabWidth": 65
1526 },
1527 "widgets_values": [
1528 0.8,
1529 1,
1530 "single_shift",
1531 "ramp_2_4",
1532 "median",
1533 1
1534 ]
1535 }
1536 ],
1537 "links": [
1538 [
1539 139,
1540 112,
1541 0,
1542 108,
1543 4,
1544 "SIGMAS"
1545 ],
1546 [
1547 141,
1548 110,
1549 0,
1550 104,
1551 0,
1552 "CONDITIONING"
1553 ],
1554 [
1555 146,
1556 6,
1557 1,
1558 110,
1559 0,
1560 "CLIP"
1561 ],
1562 [
1563 147,
1564 6,
1565 2,
1566 105,
1567 1,
1568 "VAE"
1569 ],
1570 [
1571 182,
1572 124,
1573 0,
1574 112,
1575 0,
1576 "MODEL"
1577 ],
1578 [
1579 192,
1580 6,
1581 0,
1582 124,
1583 0,
1584 "MODEL"
1585 ],
1586 [
1587 217,
1588 110,
1589 0,
1590 152,
1591 0,
1592 "CONDITIONING"
1593 ],
1594 [
1595 218,
1596 104,
1597 0,
1598 152,
1599 1,
1600 "CONDITIONING"
1601 ],
1602 [
1603 220,
1604 104,
1605 1,
1606 153,
1607 1,
1608 "CONDITIONING"
1609 ],
1610 [
1611 224,
1612 154,
1613 0,
1614 152,
1615 2,
1616 "BOOLEAN"
1617 ],
1618 [
1619 225,
1620 154,
1621 0,
1622 153,
1623 2,
1624 "BOOLEAN"
1625 ],
1626 [
1627 233,
1628 156,
1629 0,
1630 155,
1631 0,
1632 "LATENT"
1633 ],
1634 [
1635 235,
1636 154,
1637 0,
1638 155,
1639 2,
1640 "BOOLEAN"
1641 ],
1642 [
1643 260,
1644 171,
1645 0,
1646 175,
1647 0,
1648 "STRING"
1649 ],
1650 [
1651 265,
1652 177,
1653 0,
1654 176,
1655 2,
1656 "BOOLEAN"
1657 ],
1658 [
1659 266,
1660 175,
1661 0,
1662 176,
1663 1,
1664 "STRING"
1665 ],
1666 [
1667 267,
1668 171,
1669 0,
1670 176,
1671 0,
1672 "STRING"
1673 ],
1674 [
1675 274,
1676 6,
1677 1,
1678 188,
1679 0,
1680 "CLIP"
1681 ],
1682 [
1683 275,
1684 188,
1685 0,
1686 104,
1687 1,
1688 "CONDITIONING"
1689 ],
1690 [
1691 276,
1692 188,
1693 0,
1694 153,
1695 0,
1696 "CONDITIONING"
1697 ],
1698 [
1699 310,
1700 218,
1701 1,
1702 172,
1703 0,
1704 "INT"
1705 ],
1706 [
1707 311,
1708 219,
1709 1,
1710 172,
1711 1,
1712 "INT"
1713 ],
1714 [
1715 318,
1716 196,
1717 0,
1718 157,
1719 0,
1720 "IMAGE"
1721 ],
1722 [
1723 319,
1724 157,
1725 0,
1726 218,
1727 0,
1728 "INT"
1729 ],
1730 [
1731 320,
1732 157,
1733 1,
1734 219,
1735 0,
1736 "INT"
1737 ],
1738 [
1739 321,
1740 155,
1741 0,
1742 108,
1743 5,
1744 "LATENT"
1745 ],
1746 [
1747 322,
1748 108,
1749 0,
1750 105,
1751 0,
1752 "LATENT"
1753 ],
1754 [
1755 323,
1756 152,
1757 0,
1758 108,
1759 1,
1760 "CONDITIONING"
1761 ],
1762 [
1763 324,
1764 153,
1765 0,
1766 108,
1767 2,
1768 "CONDITIONING"
1769 ],
1770 [
1771 326,
1772 176,
1773 0,
1774 221,
1775 0,
1776 "STRING"
1777 ],
1778 [
1779 327,
1780 221,
1781 0,
1782 110,
1783 1,
1784 "STRING"
1785 ],
1786 [
1787 347,
1788 105,
1789 0,
1790 227,
1791 0,
1792 "IMAGE"
1793 ],
1794 [
1795 350,
1796 172,
1797 0,
1798 155,
1799 1,
1800 "LATENT"
1801 ],
1802 [
1803 351,
1804 230,
1805 0,
1806 108,
1807 3,
1808 "SAMPLER"
1809 ],
1810 [
1811 355,
1812 124,
1813 0,
1814 232,
1815 0,
1816 "MODEL"
1817 ],
1818 [
1819 356,
1820 232,
1821 0,
1822 108,
1823 0,
1824 "MODEL"
1825 ],
1826 [
1827 362,
1828 213,
1829 0,
1830 104,
1831 2,
1832 "IMAGE"
1833 ],
1834 [
1835 363,
1836 213,
1837 0,
1838 175,
1839 1,
1840 "IMAGE"
1841 ],
1842 [
1843 364,
1844 213,
1845 0,
1846 196,
1847 0,
1848 "IMAGE"
1849 ]
1850 ],
1851 "groups": [
1852 {
1853 "id": 2,
1854 "title": "Sampling",
1855 "bounding": [
1856 -1730,
1857 4530,
1858 1050,
1859 720
1860 ],
1861 "color": "#3f789e",
1862 "flags": []
1863 },
1864 {
1865 "id": 3,
1866 "title": "Prompt",
1867 "bounding": [
1868 -2560,
1869 4530,
1870 450,
1871 720
1872 ],
1873 "color": "#3f789e",
1874 "flags": []
1875 },
1876 {
1877 "id": 4,
1878 "title": "Model",
1879 "bounding": [
1880 -3450,
1881 4530,
1882 860,
1883 260
1884 ],
1885 "color": "#3f789e",
1886 "flags": []
1887 },
1888 {
1889 "id": 6,
1890 "title": "Image Size",
1891 "bounding": [
1892 -2080,
1893 5280,
1894 1400,
1895 620
1896 ],
1897 "color": "#3f789e",
1898 "flags": []
1899 },
1900 {
1901 "id": 7,
1902 "title": "I2V or Image Edit Switch",
1903 "bounding": [
1904 -2080,
1905 4530,
1906 320,
1907 460
1908 ],
1909 "color": "#3f789e",
1910 "flags": []
1911 },
1912 {
1913 "id": 8,
1914 "title": "Image Input for Image Edit",
1915 "bounding": [
1916 -3080,
1917 5280,
1918 970,
1919 620
1920 ],
1921 "color": "#3f789e",
1922 "flags": []
1923 },
1924 {
1925 "id": 9,
1926 "title": "Prompt Enhancement",
1927 "bounding": [
1928 -3080,
1929 4820,
1930 490,
1931 430
1932 ],
1933 "color": "#3f789e",
1934 "flags": []
1935 },
1936 {
1937 "id": 10,
1938 "title": "Feature Switch",
1939 "bounding": [
1940 -3450,
1941 5280,
1942 340,
1943 620
1944 ],
1945 "color": "#A88",
1946 "flags": []
1947 },
1948 {
1949 "id": 11,
1950 "title": "User Prompt",
1951 "bounding": [
1952 -3450,
1953 4820,
1954 340,
1955 430
1956 ],
1957 "color": "#A88",
1958 "flags": []
1959 },
1960 {
1961 "id": 12,
1962 "title": "Size: Image Edit",
1963 "bounding": [
1964 -1850,
1965 5630,
1966 920,
1967 242.65625
1968 ],
1969 "color": "#3f789e",
1970 "flags": []
1971 },
1972 {
1973 "id": 13,
1974 "title": "Size: Text to Image",
1975 "bounding": [
1976 -1860,
1977 5350,
1978 300,
1979 230
1980 ],
1981 "color": "#3f789e",
1982 "flags": []
1983 },
1984 {
1985 "id": 14,
1986 "title": "Group",
1987 "bounding": [
1988 -2080,
1989 5000,
1990 320,
1991 250
1992 ],
1993 "color": "#3f789e",
1994 "flags": []
1995 }
1996 ],
1997 "definitions": {
1998 "subgraphs": [
1999 {
2000 "id": "fa7296b5-c974-4466-bfe3-a1f05f43b880",
2001 "version": 1,
2002 "state": {
2003 "lastGroupId": 14,
2004 "lastNodeId": 234,
2005 "lastLinkId": 364,
2006 "lastRerouteId": 0
2007 },
2008 "revision": 0,
2009 "config": [],
2010 "name": "Prompt Enhancement",
2011 "inputNode": {
2012 "id": -10,
2013 "bounding": [
2014 -4280,
2015 5580,
2016 128,
2017 108
2018 ]
2019 },
2020 "outputNode": {
2021 "id": -20,
2022 "bounding": [
2023 -130,
2024 5680,
2025 128,
2026 68
2027 ]
2028 },
2029 "inputs": [
2030 {
2031 "id": "8e257a84-6ce5-4e50-b571-2118cc7a0b8f",
2032 "name": "replace",
2033 "type": "STRING",
2034 "linkIds": [
2035 248
2036 ],
2037 "localized_name": "replace",
2038 "label": "user_prompt",
2039 "pos": [
2040 -4176,
2041 5604
2042 ]
2043 },
2044 {
2045 "id": "eae67611-94a9-4fb3-abd7-a29bc95db936",
2046 "name": "clip_name",
2047 "type": "COMBO",
2048 "linkIds": [
2049 263
2050 ],
2051 "pos": [
2052 -4176,
2053 5624
2054 ]
2055 },
2056 {
2057 "id": "46f381cb-503d-4a53-b419-f510752553e6",
2058 "name": "image",
2059 "type": "IMAGE",
2060 "linkIds": [
2061 269
2062 ],
2063 "pos": [
2064 -4176,
2065 5644
2066 ]
2067 }
2068 ],
2069 "outputs": [
2070 {
2071 "id": "54294308-5a73-4d61-a8dd-ff5b58aa91e8",
2072 "name": "output",
2073 "type": "STRING",
2074 "linkIds": [
2075 292
2076 ],
2077 "localized_name": "output",
2078 "pos": [
2079 -106,
2080 5704
2081 ]
2082 }
2083 ],
2084 "widgets": [],
2085 "nodes": [
2086 {
2087 "id": 165,
2088 "type": "PrimitiveStringMultiline",
2089 "pos": [
2090 -3930,
2091 5440
2092 ],
2093 "size": [
2094 510,
2095 440
2096 ],
2097 "flags": {
2098 "collapsed": false
2099 },
2100 "order": 0,
2101 "mode": 0,
2102 "inputs": [],
2103 "outputs": [
2104 {
2105 "localized_name": "STRING",
2106 "name": "STRING",
2107 "type": "STRING",
2108 "links": [
2109 243
2110 ]
2111 }
2112 ],
2113 "title": "REWRITE_SYSTEM_PROMPT",
2114 "properties": {
2115 "Node name for S&R": "PrimitiveStringMultiline",
2116 "cnr_id": "comfy-core",
2117 "ver": "0.21.0",
2118 "enableTabs": false,
2119 "tabWidth": 65,
2120 "tabXOffset": 10,
2121 "hasSecondTab": false,
2122 "secondTabText": "Send Back",
2123 "secondTabOffset": 80,
2124 "secondTabWidth": 65
2125 },
2126 "widgets_values": [
2127 "<|turn>system\n你是专业的AI图像生成Prompt工程师的Prompt Engineering Engine,也是一名拥有百科知识和视觉导演能力的创意总监.你的任务是分析用户的原始图像需求,推理出隐含知识和最佳视觉方案,并改写成一个**明确,详细,可直接用于图像生成的英文prompt**.\n\n## 核心目标\n\n图像生成模型只能执行直接的视觉描述,不能自行补全背景知识,逻辑关系或文字内容.因此,你必须提前完成知识解析,空间规划和视觉导演,把结果显式写入prompt中.\n\n使用 SCALIST 框架扩写每个画面:\n- **Subject**: 主体的身份,外观,颜色,材质,纹理,动作,表情,服饰.\n- **Composition**: 镜头景别,视角,主体位置,前景/中景/背景层次,留白和视觉焦点.\n- **Action**: 主体正在做什么,动作方向,姿态,互动关系.\n- **Location**: 场景地点,室内/室外,时代,天气,时间段,环境细节.\n- **Image style**: photorealistic, cinematic, oil painting, watercolor, anime, 3D render 等,并匹配合适的光线和色彩氛围.\n- **Specs**: 摄影/渲染参数,如 85mm lens, low-angle shot, shallow depth of field, soft diffused light, dramatic backlighting, matte texture, sharp focus.\n- **Text rendering**: 如果用户要求文字,必须把准确文字放在英文双引号中,并说明字体风格,颜色,大小,材质和精确位置.\n\n1. **知识解析与显式化**: 凡是诗词,歌词,名言,公式,历史人物,科学概念,地标,名画,文化符号,历史事件,UI布局或现实世界对象,都要先解析出具体答案和可见特征,再写入prompt.不要只写 \"Mona Lisa\",\"Dunkirk evacuation\",\"freedom\" 这类需要模型自行理解的词.\n2. **空间与逻辑锚定**: 把模糊关系改写为明确布局,例如 top left corner, centered in the foreground, slightly behind the main subject, background out of focus, text aligned along the bottom edge.不要使用\"旁边\"\"一些\"\"好看\"等含糊表达.\n3. **文字排版精度**: 中文,英文,公式,多语言文本都必须逐字保留在引号中,例如 \"床前明月光,疑是地上霜.举头望明月,低头思故乡.\" 或 \"E = mc²\";同时指定字体(calligraphy, serif, sans-serif, handwritten),颜色,材质和位置.\n4. **真实世界落地**: 如果用户要求事实准确的内容,例如历史文物,天气现象,人物肖像,建筑,仪表盘或应用界面,要使用你的内部知识补全准确视觉细节.\n5. **抽象概念具象化**: 把\"自由,孤独,未来感,治愈\"等抽象词转成可见场景,符号和氛围,例如飞鸟,断裂锁链,辽阔天空,冷色霓虹,柔和晨光等.\n\n## 示例与学习\n\n- 用户说\"李白的静夜思写在墙上\",prompt 应写出完整中文诗句,并指定它以优雅中国书法写在古旧石墙的哪个位置.\n- 用户说\"三大力学的奠基人\"或\"爱因斯坦写质能方程\",prompt 应解析出 Isaac Newton 或 Albert Einstein,并描述人物外貌,时代服饰,黑板,公式 \"E = mc²\" 等可见内容.\n- 用户说\"蒙娜丽莎\"\"比萨斜塔\"\"福字\"\"敦刻尔克大撤退\",prompt 应描述对应画面特征: 神秘微笑与交叠双手,倾斜白色大理石钟楼与拱廊,红底金色/黑色书法 \"福\",1940年海滩上等待撤离的士兵和海面船只.\n\n## 输出prompt要求\n\n- prompt 必须是一个英文的,连贯自然的单段落,像 Creative Director's Brief,而不是关键词堆砌或 tag soup.\n- 长度通常为 80-220 词;简单需求可以更短,复杂画面可以更长.\n- 最重要的主体和画面意图放在开头,然后自然展开构图,动作,地点,风格,技术参数和文字渲染.\n- 使用完整句子,丰富但准确的形容词,摄影/绘画/设计术语.\n- 不要包含任何需要图像模型继续推理才能理解的表达.\n- prompt 必须自包含,仅凭prompt本身就能准确生成图片.\n\n## 执行步骤\n\n1. **Analyze**: 识别核心主体,用户意图,文字要求,参考限制和需要解析的隐含知识.\n2. **Reason**: 选择最适宜画面的光线,镜头,角度,纹理,风格,空间布局和事实细节.\n3. **Rewrite**: 输出最终增强后的英文单段落prompt.\n\n只输出JSON,不加任何其他文字:\n{\"prompt\": \"英文单段落prompt\", \"reasoning\": \"你的推理和知识解析过程(需要用用户输入的提示词语言来生成)\", \"resolved_knowledge\": \"你解析了哪些隐含知识(根据输入用户语言简述,如果没有隐含知识用对应语言写'无')\"} \n<|turn|>"
2128 ]
2129 },
2130 {
2131 "id": 170,
2132 "type": "StringReplace",
2133 "pos": [
2134 -3930,
2135 5930
2136 ],
2137 "size": [
2138 510,
2139 260
2140 ],
2141 "flags": {
2142 "collapsed": false
2143 },
2144 "order": 4,
2145 "mode": 0,
2146 "inputs": [
2147 {
2148 "localized_name": "replace",
2149 "name": "replace",
2150 "type": "STRING",
2151 "widget": {
2152 "name": "replace"
2153 },
2154 "link": 248
2155 }
2156 ],
2157 "outputs": [
2158 {
2159 "localized_name": "STRING",
2160 "name": "STRING",
2161 "type": "STRING",
2162 "links": [
2163 244
2164 ]
2165 }
2166 ],
2167 "properties": {
2168 "Node name for S&R": "StringReplace",
2169 "cnr_id": "comfy-core",
2170 "ver": "0.21.0",
2171 "enableTabs": false,
2172 "tabWidth": 65,
2173 "tabXOffset": 10,
2174 "hasSecondTab": false,
2175 "secondTabText": "Send Back",
2176 "secondTabOffset": 80,
2177 "secondTabWidth": 65
2178 },
2179 "widgets_values": [
2180 "<|turn>user\n{user_prompt}<|turn|>\n<|turn>model\n",
2181 "{user_prompt}",
2182 ""
2183 ]
2184 },
2185 {
2186 "id": 166,
2187 "type": "StringConcatenate",
2188 "pos": [
2189 -3350,
2190 5440
2191 ],
2192 "size": [
2193 230,
2194 220
2195 ],
2196 "flags": {
2197 "collapsed": false
2198 },
2199 "order": 2,
2200 "mode": 0,
2201 "inputs": [
2202 {
2203 "localized_name": "string_a",
2204 "name": "string_a",
2205 "type": "STRING",
2206 "widget": {
2207 "name": "string_a"
2208 },
2209 "link": 243
2210 },
2211 {
2212 "localized_name": "string_b",
2213 "name": "string_b",
2214 "type": "STRING",
2215 "widget": {
2216 "name": "string_b"
2217 },
2218 "link": 244
2219 }
2220 ],
2221 "outputs": [
2222 {
2223 "localized_name": "STRING",
2224 "name": "STRING",
2225 "type": "STRING",
2226 "links": [
2227 251
2228 ]
2229 }
2230 ],
2231 "properties": {
2232 "Node name for S&R": "StringConcatenate",
2233 "cnr_id": "comfy-core",
2234 "ver": "0.21.0",
2235 "enableTabs": false,
2236 "tabWidth": 65,
2237 "tabXOffset": 10,
2238 "hasSecondTab": false,
2239 "secondTabText": "Send Back",
2240 "secondTabOffset": 80,
2241 "secondTabWidth": 65
2242 },
2243 "widgets_values": [
2244 "",
2245 "",
2246 ""
2247 ]
2248 },
2249 {
2250 "id": 164,
2251 "type": "TextGenerate",
2252 "pos": [
2253 -3070,
2254 5220
2255 ],
2256 "size": [
2257 400,
2258 420
2259 ],
2260 "flags": [],
2261 "order": 1,
2262 "mode": 0,
2263 "showAdvanced": true,
2264 "inputs": [
2265 {
2266 "localized_name": "clip",
2267 "name": "clip",
2268 "type": "CLIP",
2269 "link": 241
2270 },
2271 {
2272 "localized_name": "image",
2273 "name": "image",
2274 "shape": 7,
2275 "type": "IMAGE",
2276 "link": 269
2277 },
2278 {
2279 "localized_name": "video",
2280 "name": "video",
2281 "shape": 7,
2282 "type": "IMAGE",
2283 "link": null
2284 },
2285 {
2286 "localized_name": "audio",
2287 "name": "audio",
2288 "shape": 7,
2289 "type": "AUDIO",
2290 "link": null
2291 },
2292 {
2293 "localized_name": "prompt",
2294 "name": "prompt",
2295 "type": "STRING",
2296 "widget": {
2297 "name": "prompt"
2298 },
2299 "link": 251
2300 }
2301 ],
2302 "outputs": [
2303 {
2304 "localized_name": "generated_text",
2305 "name": "generated_text",
2306 "type": "STRING",
2307 "links": [
2308 281
2309 ]
2310 }
2311 ],
2312 "properties": {
2313 "Node name for S&R": "TextGenerate",
2314 "cnr_id": "comfy-core",
2315 "ver": "0.21.0",
2316 "enableTabs": false,
2317 "tabWidth": 65,
2318 "tabXOffset": 10,
2319 "hasSecondTab": false,
2320 "secondTabText": "Send Back",
2321 "secondTabOffset": 80,
2322 "secondTabWidth": 65
2323 },
2324 "widgets_values": [
2325 "",
2326 2048,
2327 "on",
2328 0.7,
2329 64,
2330 0.95,
2331 0.05,
2332 1.05,
2333 0,
2334 0,
2335 false,
2336 false
2337 ]
2338 },
2339 {
2340 "id": 167,
2341 "type": "CLIPLoader",
2342 "pos": [
2343 -3930,
2344 5220
2345 ],
2346 "size": [
2347 510,
2348 160
2349 ],
2350 "flags": [],
2351 "order": 3,
2352 "mode": 0,
2353 "inputs": [
2354 {
2355 "localized_name": "clip_name",
2356 "name": "clip_name",
2357 "type": "COMBO",
2358 "widget": {
2359 "name": "clip_name"
2360 },
2361 "link": 263
2362 }
2363 ],
2364 "outputs": [
2365 {
2366 "localized_name": "CLIP",
2367 "name": "CLIP",
2368 "type": "CLIP",
2369 "links": [
2370 241
2371 ]
2372 }
2373 ],
2374 "properties": {
2375 "Node name for S&R": "CLIPLoader",
2376 "cnr_id": "comfy-core",
2377 "ver": "0.21.0",
2378 "models": [
2379 {
2380 "name": "gemma4_e4b_it_fp8_scaled.safetensors",
2381 "url": "https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors",
2382 "directory": "text_encoders"
2383 }
2384 ],
2385 "enableTabs": false,
2386 "tabWidth": 65,
2387 "tabXOffset": 10,
2388 "hasSecondTab": false,
2389 "secondTabText": "Send Back",
2390 "secondTabOffset": 80,
2391 "secondTabWidth": 65
2392 },
2393 "widgets_values": [
2394 "gemma4_e4b_it_fp8_scaled.safetensors",
2395 "stable_diffusion",
2396 "default"
2397 ]
2398 },
2399 {
2400 "id": 198,
2401 "type": "JsonExtractString",
2402 "pos": [
2403 -1360,
2404 5710
2405 ],
2406 "size": [
2407 400,
2408 200
2409 ],
2410 "flags": [],
2411 "order": 5,
2412 "mode": 0,
2413 "inputs": [
2414 {
2415 "localized_name": "json_string",
2416 "name": "json_string",
2417 "type": "STRING",
2418 "widget": {
2419 "name": "json_string"
2420 },
2421 "link": 288
2422 }
2423 ],
2424 "outputs": [
2425 {
2426 "localized_name": "STRING",
2427 "name": "STRING",
2428 "type": "STRING",
2429 "links": [
2430 291,
2431 292
2432 ]
2433 }
2434 ],
2435 "properties": {
2436 "Node name for S&R": "JsonExtractString",
2437 "cnr_id": "comfy-core",
2438 "ver": "0.21.0",
2439 "enableTabs": false,
2440 "tabWidth": 65,
2441 "tabXOffset": 10,
2442 "hasSecondTab": false,
2443 "secondTabText": "Send Back",
2444 "secondTabOffset": 80,
2445 "secondTabWidth": 65
2446 },
2447 "widgets_values": [
2448 "",
2449 "prompt"
2450 ]
2451 },
2452 {
2453 "id": 199,
2454 "type": "PreviewAny",
2455 "pos": [
2456 -2590,
2457 5220
2458 ],
2459 "size": [
2460 460,
2461 980
2462 ],
2463 "flags": [],
2464 "order": 6,
2465 "mode": 4,
2466 "inputs": [
2467 {
2468 "localized_name": "source",
2469 "name": "source",
2470 "type": "*",
2471 "link": 281
2472 }
2473 ],
2474 "outputs": [
2475 {
2476 "localized_name": "STRING",
2477 "name": "STRING",
2478 "type": "STRING",
2479 "links": [
2480 285
2481 ]
2482 }
2483 ],
2484 "properties": {
2485 "Node name for S&R": "PreviewAny",
2486 "cnr_id": "comfy-core",
2487 "ver": "0.21.0",
2488 "enableTabs": false,
2489 "tabWidth": 65,
2490 "tabXOffset": 10,
2491 "hasSecondTab": false,
2492 "secondTabText": "Send Back",
2493 "secondTabOffset": 80,
2494 "secondTabWidth": 65
2495 },
2496 "widgets_values": [
2497 null,
2498 null,
2499 null
2500 ]
2501 },
2502 {
2503 "id": 200,
2504 "type": "PreviewAny",
2505 "pos": [
2506 -1640,
2507 5240
2508 ],
2509 "size": [
2510 250,
2511 220
2512 ],
2513 "flags": [],
2514 "order": 7,
2515 "mode": 4,
2516 "inputs": [
2517 {
2518 "localized_name": "source",
2519 "name": "source",
2520 "type": "*",
2521 "link": 286
2522 }
2523 ],
2524 "outputs": [
2525 {
2526 "localized_name": "STRING",
2527 "name": "STRING",
2528 "type": "STRING",
2529 "links": []
2530 }
2531 ],
2532 "properties": {
2533 "Node name for S&R": "PreviewAny",
2534 "cnr_id": "comfy-core",
2535 "ver": "0.21.0",
2536 "enableTabs": false,
2537 "tabWidth": 65,
2538 "tabXOffset": 10,
2539 "hasSecondTab": false,
2540 "secondTabText": "Send Back",
2541 "secondTabOffset": 80,
2542 "secondTabWidth": 65
2543 },
2544 "widgets_values": [
2545 null,
2546 null,
2547 null
2548 ]
2549 },
2550 {
2551 "id": 201,
2552 "type": "RegexReplace",
2553 "pos": [
2554 -2080,
2555 5230
2556 ],
2557 "size": [
2558 400,
2559 400
2560 ],
2561 "flags": [],
2562 "order": 8,
2563 "mode": 0,
2564 "showAdvanced": true,
2565 "inputs": [
2566 {
2567 "localized_name": "string",
2568 "name": "string",
2569 "type": "STRING",
2570 "widget": {
2571 "name": "string"
2572 },
2573 "link": 285
2574 }
2575 ],
2576 "outputs": [
2577 {
2578 "localized_name": "STRING",
2579 "name": "STRING",
2580 "type": "STRING",
2581 "links": [
2582 286,
2583 287
2584 ]
2585 }
2586 ],
2587 "properties": {
2588 "Node name for S&R": "RegexReplace",
2589 "cnr_id": "comfy-core",
2590 "ver": "0.21.0",
2591 "enableTabs": false,
2592 "tabWidth": 65,
2593 "tabXOffset": 10,
2594 "hasSecondTab": false,
2595 "secondTabText": "Send Back",
2596 "secondTabOffset": 80,
2597 "secondTabWidth": 65
2598 },
2599 "widgets_values": [
2600 "",
2601 "^```(?:json)?\\s*\\n?",
2602 "",
2603 false,
2604 false,
2605 false,
2606 1
2607 ]
2608 },
2609 {
2610 "id": 202,
2611 "type": "RegexReplace",
2612 "pos": [
2613 -2080,
2614 5710
2615 ],
2616 "size": [
2617 400,
2618 400
2619 ],
2620 "flags": [],
2621 "order": 9,
2622 "mode": 0,
2623 "showAdvanced": false,
2624 "inputs": [
2625 {
2626 "localized_name": "string",
2627 "name": "string",
2628 "type": "STRING",
2629 "widget": {
2630 "name": "string"
2631 },
2632 "link": 287
2633 }
2634 ],
2635 "outputs": [
2636 {
2637 "localized_name": "STRING",
2638 "name": "STRING",
2639 "type": "STRING",
2640 "links": [
2641 288,
2642 290
2643 ]
2644 }
2645 ],
2646 "properties": {
2647 "Node name for S&R": "RegexReplace",
2648 "cnr_id": "comfy-core",
2649 "ver": "0.21.0",
2650 "enableTabs": false,
2651 "tabWidth": 65,
2652 "tabXOffset": 10,
2653 "hasSecondTab": false,
2654 "secondTabText": "Send Back",
2655 "secondTabOffset": 80,
2656 "secondTabWidth": 65
2657 },
2658 "widgets_values": [
2659 "",
2660 "\\n?```\\s*$",
2661 "",
2662 false,
2663 false,
2664 false,
2665 1
2666 ]
2667 },
2668 {
2669 "id": 203,
2670 "type": "PreviewAny",
2671 "pos": [
2672 -1630,
2673 5710
2674 ],
2675 "size": [
2676 230,
2677 170
2678 ],
2679 "flags": [],
2680 "order": 10,
2681 "mode": 4,
2682 "inputs": [
2683 {
2684 "localized_name": "source",
2685 "name": "source",
2686 "type": "*",
2687 "link": 290
2688 }
2689 ],
2690 "outputs": [
2691 {
2692 "localized_name": "STRING",
2693 "name": "STRING",
2694 "type": "STRING",
2695 "links": []
2696 }
2697 ],
2698 "properties": {
2699 "Node name for S&R": "PreviewAny",
2700 "cnr_id": "comfy-core",
2701 "ver": "0.21.0",
2702 "enableTabs": false,
2703 "tabWidth": 65,
2704 "tabXOffset": 10,
2705 "hasSecondTab": false,
2706 "secondTabText": "Send Back",
2707 "secondTabOffset": 80,
2708 "secondTabWidth": 65
2709 },
2710 "widgets_values": [
2711 null,
2712 null,
2713 null
2714 ]
2715 },
2716 {
2717 "id": 204,
2718 "type": "PreviewAny",
2719 "pos": [
2720 -900,
2721 5710
2722 ],
2723 "size": [
2724 300,
2725 400
2726 ],
2727 "flags": [],
2728 "order": 11,
2729 "mode": 4,
2730 "inputs": [
2731 {
2732 "localized_name": "source",
2733 "name": "source",
2734 "type": "*",
2735 "link": 291
2736 }
2737 ],
2738 "outputs": [
2739 {
2740 "localized_name": "STRING",
2741 "name": "STRING",
2742 "type": "STRING",
2743 "links": []
2744 }
2745 ],
2746 "properties": {
2747 "Node name for S&R": "PreviewAny",
2748 "cnr_id": "comfy-core",
2749 "ver": "0.21.0",
2750 "enableTabs": false,
2751 "tabWidth": 65,
2752 "tabXOffset": 10,
2753 "hasSecondTab": false,
2754 "secondTabText": "Send Back",
2755 "secondTabOffset": 80,
2756 "secondTabWidth": 65
2757 },
2758 "widgets_values": [
2759 null,
2760 null,
2761 null
2762 ]
2763 }
2764 ],
2765 "groups": [
2766 {
2767 "id": 5,
2768 "title": "Prompt Enhancement",
2769 "bounding": [
2770 -3960,
2771 5130,
2772 1350,
2773 1070
2774 ],
2775 "color": "#3f789e",
2776 "flags": []
2777 }
2778 ],
2779 "links": [
2780 {
2781 "id": 243,
2782 "origin_id": 165,
2783 "origin_slot": 0,
2784 "target_id": 166,
2785 "target_slot": 0,
2786 "type": "STRING"
2787 },
2788 {
2789 "id": 244,
2790 "origin_id": 170,
2791 "origin_slot": 0,
2792 "target_id": 166,
2793 "target_slot": 1,
2794 "type": "STRING"
2795 },
2796 {
2797 "id": 241,
2798 "origin_id": 167,
2799 "origin_slot": 0,
2800 "target_id": 164,
2801 "target_slot": 0,
2802 "type": "CLIP"
2803 },
2804 {
2805 "id": 251,
2806 "origin_id": 166,
2807 "origin_slot": 0,
2808 "target_id": 164,
2809 "target_slot": 4,
2810 "type": "STRING"
2811 },
2812 {
2813 "id": 248,
2814 "origin_id": -10,
2815 "origin_slot": 0,
2816 "target_id": 170,
2817 "target_slot": 0,
2818 "type": "STRING"
2819 },
2820 {
2821 "id": 263,
2822 "origin_id": -10,
2823 "origin_slot": 1,
2824 "target_id": 167,
2825 "target_slot": 0,
2826 "type": "COMBO"
2827 },
2828 {
2829 "id": 269,
2830 "origin_id": -10,
2831 "origin_slot": 2,
2832 "target_id": 164,
2833 "target_slot": 1,
2834 "type": "IMAGE"
2835 },
2836 {
2837 "id": 281,
2838 "origin_id": 164,
2839 "origin_slot": 0,
2840 "target_id": 199,
2841 "target_slot": 0,
2842 "type": "STRING"
2843 },
2844 {
2845 "id": 285,
2846 "origin_id": 199,
2847 "origin_slot": 0,
2848 "target_id": 201,
2849 "target_slot": 0,
2850 "type": "STRING"
2851 },
2852 {
2853 "id": 286,
2854 "origin_id": 201,
2855 "origin_slot": 0,
2856 "target_id": 200,
2857 "target_slot": 0,
2858 "type": "STRING"
2859 },
2860 {
2861 "id": 287,
2862 "origin_id": 201,
2863 "origin_slot": 0,
2864 "target_id": 202,
2865 "target_slot": 0,
2866 "type": "STRING"
2867 },
2868 {
2869 "id": 288,
2870 "origin_id": 202,
2871 "origin_slot": 0,
2872 "target_id": 198,
2873 "target_slot": 0,
2874 "type": "STRING"
2875 },
2876 {
2877 "id": 290,
2878 "origin_id": 202,
2879 "origin_slot": 0,
2880 "target_id": 203,
2881 "target_slot": 0,
2882 "type": "STRING"
2883 },
2884 {
2885 "id": 291,
2886 "origin_id": 198,
2887 "origin_slot": 0,
2888 "target_id": 204,
2889 "target_slot": 0,
2890 "type": "STRING"
2891 },
2892 {
2893 "id": 292,
2894 "origin_id": 198,
2895 "origin_slot": 0,
2896 "target_id": -20,
2897 "target_slot": 0,
2898 "type": "STRING"
2899 }
2900 ],
2901 "extra": []
2902 }
2903 ]
2904 },
2905 "config": [],
2906 "extra": {
2907 "ds": {
2908 "scale": 0.2491414514189808,
2909 "offset": [
2910 5605.438261548385,
2911 -3699.5635990679543
2912 ]
2913 },
2914 "frontendVersion": "1.43.18",
2915 "linearData": {
2916 "inputs": [],
2917 "outputs": []
2918 },
2919 "VHS_latentpreview": false,
2920 "VHS_latentpreviewrate": 0,
2921 "VHS_MetadataImage": true,
2922 "VHS_KeepIntermediate": true
2923 },
2924 "version": 0.4
2925}