工作流 /
图像 /
HiDream O1 Dev

HiDream O1 Dev
HiDream O1 Dev
输入文本提示词和可选的参考图像。生成高分辨率图像(最高2048x2048),支持文生图、图像编辑和主体驱动个性化。
图像
29 个节点 1 个输入 24 次使用 ComfyUI ≥ 0.21.1 ComfyUI 64 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
SamplerLCM
× 1
GetImageSize
× 1
fa7296b5-c974-4466-bfe3-a1f05f43b880
× 1
ImageScaleToTotalPixels
× 1
官方标注的模型
HiDream
工作流 JSON
和上面「下载工作流 JSON」是同一份文件。
1{
2 "id": "a2143803-dd9d-4fd4-9370-31ce70307498",
3 "revision": 0,
4 "last_node_id": 228,
5 "last_link_id": 350,
6 "nodes": [
7 {
8 "id": 108,
9 "type": "SamplerCustom",
10 "pos": [
11 -1350,
12 4620
13 ],
14 "size": [
15 280,
16 500
17 ],
18 "flags": [],
19 "order": 26,
20 "mode": 0,
21 "showAdvanced": false,
22 "inputs": [
23 {
24 "name": "model",
25 "type": "MODEL",
26 "link": 213
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": 185
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 "enableTabs": false,
70 "tabWidth": 65,
71 "tabXOffset": 10,
72 "hasSecondTab": false,
73 "secondTabText": "Send Back",
74 "secondTabOffset": 80,
75 "secondTabWidth": 65,
76 "cnr_id": "comfy-core",
77 "ver": "0.21.0",
78 "Node name for S&R": "SamplerCustom"
79 },
80 "widgets_values": [
81 true,
82 270186383729385,
83 "randomize",
84 1
85 ]
86 },
87 {
88 "id": 112,
89 "type": "BasicScheduler",
90 "pos": [
91 -1700,
92 4990
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 "enableTabs": false,
119 "tabWidth": 65,
120 "tabXOffset": 10,
121 "hasSecondTab": false,
122 "secondTabText": "Send Back",
123 "secondTabOffset": 80,
124 "secondTabWidth": 65,
125 "cnr_id": "comfy-core",
126 "ver": "0.21.0",
127 "Node name for S&R": "BasicScheduler"
128 },
129 "widgets_values": [
130 "normal",
131 28,
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 "enableTabs": false,
176 "tabWidth": 65,
177 "tabXOffset": 10,
178 "hasSecondTab": false,
179 "secondTabText": "Send Back",
180 "secondTabOffset": 80,
181 "secondTabWidth": 65,
182 "cnr_id": "comfy-core",
183 "ver": "0.21.0",
184 "Node name for S&R": "CheckpointLoaderSimple",
185 "models": [
186 {
187 "name": "hidream_o1_image_dev_fp8_scaled.safetensors",
188 "url": "https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_dev_fp8_scaled.safetensors",
189 "directory": "checkpoints"
190 }
191 ]
192 },
193 "widgets_values": [
194 "hidream_o1_image_dev_fp8_scaled.safetensors"
195 ]
196 },
197 {
198 "id": 124,
199 "type": "ModelNoiseScale",
200 "pos": [
201 -1700,
202 4620
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 213
225 ]
226 }
227 ],
228 "properties": {
229 "enableTabs": false,
230 "tabWidth": 65,
231 "tabXOffset": 10,
232 "hasSecondTab": false,
233 "secondTabText": "Send Back",
234 "secondTabOffset": 80,
235 "secondTabWidth": 65,
236 "cnr_id": "comfy-core",
237 "ver": "0.21.0",
238 "Node name for S&R": "ModelNoiseScale"
239 },
240 "widgets_values": [
241 7.6
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": 23,
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": 300
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 "enableTabs": false,
301 "tabWidth": 65,
302 "tabXOffset": 10,
303 "hasSecondTab": false,
304 "secondTabText": "Send Back",
305 "secondTabOffset": 80,
306 "secondTabWidth": 65,
307 "cnr_id": "comfy-core",
308 "ver": "0.21.0",
309 "Node name for S&R": "HiDreamO1ReferenceImages"
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": 21,
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 "enableTabs": false,
356 "tabWidth": 65,
357 "tabXOffset": 10,
358 "hasSecondTab": false,
359 "secondTabText": "Send Back",
360 "secondTabOffset": 80,
361 "secondTabWidth": 65,
362 "cnr_id": "comfy-core",
363 "ver": "0.21.0",
364 "Node name for S&R": "CLIPTextEncode"
365 },
366 "widgets_values": [
367 ""
368 ],
369 "color": "#232",
370 "bgcolor": "#353"
371 },
372 {
373 "id": 105,
374 "type": "VAEDecode",
375 "pos": [
376 -1320,
377 5160
378 ],
379 "size": [
380 230,
381 80
382 ],
383 "flags": [],
384 "order": 27,
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 "enableTabs": false,
409 "tabWidth": 65,
410 "tabXOffset": 10,
411 "hasSecondTab": false,
412 "secondTabText": "Send Back",
413 "secondTabOffset": 80,
414 "secondTabWidth": 65,
415 "cnr_id": "comfy-core",
416 "ver": "0.21.0",
417 "Node name for S&R": "VAEDecode"
418 },
419 "widgets_values": []
420 },
421 {
422 "id": 125,
423 "type": "SamplerLCM",
424 "pos": [
425 -1700,
426 4760
427 ],
428 "size": [
429 280,
430 160
431 ],
432 "flags": [],
433 "order": 1,
434 "mode": 0,
435 "inputs": [],
436 "outputs": [
437 {
438 "name": "SAMPLER",
439 "type": "SAMPLER",
440 "links": [
441 185
442 ]
443 }
444 ],
445 "properties": {
446 "enableTabs": false,
447 "tabWidth": 65,
448 "tabXOffset": 10,
449 "hasSecondTab": false,
450 "secondTabText": "Send Back",
451 "secondTabOffset": 80,
452 "secondTabWidth": 65,
453 "cnr_id": "comfy-core",
454 "ver": "0.21.0",
455 "Node name for S&R": "SamplerLCM"
456 },
457 "widgets_values": [
458 1,
459 1,
460 2.5
461 ]
462 },
463 {
464 "id": 152,
465 "type": "ComfySwitchNode",
466 "pos": [
467 -2050,
468 4660
469 ],
470 "size": [
471 270,
472 130
473 ],
474 "flags": [],
475 "order": 24,
476 "mode": 0,
477 "inputs": [
478 {
479 "name": "on_false",
480 "type": "CONDITIONING",
481 "link": 217
482 },
483 {
484 "name": "on_true",
485 "type": "CONDITIONING",
486 "link": 218
487 },
488 {
489 "name": "switch",
490 "type": "BOOLEAN",
491 "widget": {
492 "name": "switch"
493 },
494 "link": 224
495 }
496 ],
497 "outputs": [
498 {
499 "name": "output",
500 "type": "CONDITIONING",
501 "links": [
502 323
503 ]
504 }
505 ],
506 "properties": {
507 "enableTabs": false,
508 "tabWidth": 65,
509 "tabXOffset": 10,
510 "hasSecondTab": false,
511 "secondTabText": "Send Back",
512 "secondTabOffset": 80,
513 "secondTabWidth": 65,
514 "cnr_id": "comfy-core",
515 "ver": "0.21.0",
516 "Node name for S&R": "ComfySwitchNode"
517 },
518 "widgets_values": [
519 false
520 ]
521 },
522 {
523 "id": 153,
524 "type": "ComfySwitchNode",
525 "pos": [
526 -2050,
527 4840
528 ],
529 "size": [
530 270,
531 130
532 ],
533 "flags": [],
534 "order": 25,
535 "mode": 0,
536 "inputs": [
537 {
538 "name": "on_false",
539 "type": "CONDITIONING",
540 "link": 276
541 },
542 {
543 "name": "on_true",
544 "type": "CONDITIONING",
545 "link": 220
546 },
547 {
548 "name": "switch",
549 "type": "BOOLEAN",
550 "widget": {
551 "name": "switch"
552 },
553 "link": 225
554 }
555 ],
556 "outputs": [
557 {
558 "name": "output",
559 "type": "CONDITIONING",
560 "links": [
561 324
562 ]
563 }
564 ],
565 "properties": {
566 "enableTabs": false,
567 "tabWidth": 65,
568 "tabXOffset": 10,
569 "hasSecondTab": false,
570 "secondTabText": "Send Back",
571 "secondTabOffset": 80,
572 "secondTabWidth": 65,
573 "cnr_id": "comfy-core",
574 "ver": "0.21.0",
575 "Node name for S&R": "ComfySwitchNode"
576 },
577 "widgets_values": [
578 false
579 ]
580 },
581 {
582 "id": 155,
583 "type": "ComfySwitchNode",
584 "pos": [
585 -1340,
586 5360
587 ],
588 "size": [
589 230,
590 130
591 ],
592 "flags": [],
593 "order": 22,
594 "mode": 0,
595 "inputs": [
596 {
597 "name": "on_false",
598 "type": "LATENT",
599 "link": 233
600 },
601 {
602 "name": "on_true",
603 "type": "LATENT",
604 "link": 350
605 },
606 {
607 "name": "switch",
608 "type": "BOOLEAN",
609 "widget": {
610 "name": "switch"
611 },
612 "link": 235
613 }
614 ],
615 "outputs": [
616 {
617 "name": "output",
618 "type": "LATENT",
619 "links": [
620 321
621 ]
622 }
623 ],
624 "properties": {
625 "enableTabs": false,
626 "tabWidth": 65,
627 "tabXOffset": 10,
628 "hasSecondTab": false,
629 "secondTabText": "Send Back",
630 "secondTabOffset": 80,
631 "secondTabWidth": 65,
632 "cnr_id": "comfy-core",
633 "ver": "0.21.0",
634 "Node name for S&R": "ComfySwitchNode"
635 },
636 "widgets_values": [
637 false
638 ]
639 },
640 {
641 "id": 157,
642 "type": "GetImageSize",
643 "pos": [
644 -1680,
645 5730
646 ],
647 "size": [
648 225,
649 8
650 ],
651 "flags": {
652 "collapsed": true
653 },
654 "order": 15,
655 "mode": 0,
656 "inputs": [
657 {
658 "name": "image",
659 "type": "IMAGE",
660 "link": 318
661 }
662 ],
663 "outputs": [
664 {
665 "name": "width",
666 "type": "INT",
667 "links": [
668 319
669 ]
670 },
671 {
672 "name": "height",
673 "type": "INT",
674 "links": [
675 320
676 ]
677 },
678 {
679 "name": "batch_size",
680 "type": "INT",
681 "links": null
682 }
683 ],
684 "properties": {
685 "enableTabs": false,
686 "tabWidth": 65,
687 "tabXOffset": 10,
688 "hasSecondTab": false,
689 "secondTabText": "Send Back",
690 "secondTabOffset": 80,
691 "secondTabWidth": 65,
692 "cnr_id": "comfy-core",
693 "ver": "0.21.0",
694 "Node name for S&R": "GetImageSize"
695 },
696 "widgets_values": []
697 },
698 {
699 "id": 154,
700 "type": "PrimitiveBoolean",
701 "pos": [
702 -3420,
703 5630
704 ],
705 "size": [
706 270,
707 80
708 ],
709 "flags": [],
710 "order": 2,
711 "mode": 0,
712 "inputs": [],
713 "outputs": [
714 {
715 "name": "BOOLEAN",
716 "type": "BOOLEAN",
717 "links": [
718 224,
719 225,
720 235
721 ]
722 }
723 ],
724 "title": "Switch to Image Edit",
725 "properties": {
726 "enableTabs": false,
727 "tabWidth": 65,
728 "tabXOffset": 10,
729 "hasSecondTab": false,
730 "secondTabText": "Send Back",
731 "secondTabOffset": 80,
732 "secondTabWidth": 65,
733 "cnr_id": "comfy-core",
734 "ver": "0.21.0",
735 "Node name for S&R": "PrimitiveBoolean"
736 },
737 "widgets_values": [
738 true
739 ]
740 },
741 {
742 "id": 175,
743 "type": "fa7296b5-c974-4466-bfe3-a1f05f43b880",
744 "pos": [
745 -3060,
746 4890
747 ],
748 "size": [
749 430,
750 180
751 ],
752 "flags": [],
753 "order": 13,
754 "mode": 0,
755 "inputs": [
756 {
757 "label": "user_prompt",
758 "name": "replace",
759 "type": "STRING",
760 "widget": {
761 "name": "replace"
762 },
763 "link": 260
764 },
765 {
766 "name": "image",
767 "shape": 7,
768 "type": "IMAGE",
769 "link": 301
770 }
771 ],
772 "outputs": [
773 {
774 "name": "output",
775 "type": "STRING",
776 "links": [
777 266
778 ]
779 }
780 ],
781 "properties": {
782 "proxyWidgets": [
783 [
784 "170",
785 "replace"
786 ],
787 [
788 "167",
789 "clip_name"
790 ]
791 ],
792 "enableTabs": false,
793 "tabWidth": 65,
794 "tabXOffset": 10,
795 "hasSecondTab": false,
796 "secondTabText": "Send Back",
797 "secondTabOffset": 80,
798 "secondTabWidth": 65,
799 "cnr_id": "comfy-core",
800 "ver": "0.21.0"
801 },
802 "widgets_values": []
803 },
804 {
805 "id": 176,
806 "type": "ComfySwitchNode",
807 "pos": [
808 -3060,
809 5110
810 ],
811 "size": [
812 225,
813 8
814 ],
815 "flags": {
816 "collapsed": true
817 },
818 "order": 16,
819 "mode": 0,
820 "inputs": [
821 {
822 "name": "on_false",
823 "type": "STRING",
824 "link": 267
825 },
826 {
827 "name": "on_true",
828 "type": "STRING",
829 "link": 266
830 },
831 {
832 "name": "switch",
833 "type": "BOOLEAN",
834 "widget": {
835 "name": "switch"
836 },
837 "link": 265
838 }
839 ],
840 "outputs": [
841 {
842 "name": "output",
843 "type": "STRING",
844 "links": [
845 326
846 ]
847 }
848 ],
849 "properties": {
850 "enableTabs": false,
851 "tabWidth": 65,
852 "tabXOffset": 10,
853 "hasSecondTab": false,
854 "secondTabText": "Send Back",
855 "secondTabOffset": 80,
856 "secondTabWidth": 65,
857 "cnr_id": "comfy-core",
858 "ver": "0.21.0",
859 "Node name for S&R": "ComfySwitchNode"
860 },
861 "widgets_values": [
862 false
863 ]
864 },
865 {
866 "id": 177,
867 "type": "PrimitiveBoolean",
868 "pos": [
869 -3420,
870 5430
871 ],
872 "size": [
873 270,
874 80
875 ],
876 "flags": [],
877 "order": 3,
878 "mode": 0,
879 "inputs": [],
880 "outputs": [
881 {
882 "name": "BOOLEAN",
883 "type": "BOOLEAN",
884 "links": [
885 265
886 ]
887 }
888 ],
889 "title": "Enable Prompt Refine?",
890 "properties": {
891 "enableTabs": false,
892 "tabWidth": 65,
893 "tabXOffset": 10,
894 "hasSecondTab": false,
895 "secondTabText": "Send Back",
896 "secondTabOffset": 80,
897 "secondTabWidth": 65,
898 "cnr_id": "comfy-core",
899 "ver": "0.21.0",
900 "Node name for S&R": "PrimitiveBoolean"
901 },
902 "widgets_values": [
903 false
904 ]
905 },
906 {
907 "id": 188,
908 "type": "CLIPTextEncode",
909 "pos": [
910 -2540,
911 5120
912 ],
913 "size": [
914 420,
915 120
916 ],
917 "flags": [],
918 "order": 11,
919 "mode": 0,
920 "inputs": [
921 {
922 "name": "clip",
923 "type": "CLIP",
924 "link": 274
925 }
926 ],
927 "outputs": [
928 {
929 "name": "CONDITIONING",
930 "type": "CONDITIONING",
931 "links": [
932 275,
933 276
934 ]
935 }
936 ],
937 "properties": {
938 "enableTabs": false,
939 "tabWidth": 65,
940 "tabXOffset": 10,
941 "hasSecondTab": false,
942 "secondTabText": "Send Back",
943 "secondTabOffset": 80,
944 "secondTabWidth": 65,
945 "cnr_id": "comfy-core",
946 "ver": "0.21.0",
947 "Node name for S&R": "CLIPTextEncode"
948 },
949 "widgets_values": [
950 ""
951 ],
952 "color": "#223",
953 "bgcolor": "#335"
954 },
955 {
956 "id": 195,
957 "type": "MarkdownNote",
958 "pos": [
959 -2020,
960 5960
961 ],
962 "size": [
963 980,
964 560
965 ],
966 "flags": [],
967 "order": 4,
968 "mode": 0,
969 "inputs": [],
970 "outputs": [],
971 "title": "Note: About Image Size",
972 "properties": [],
973 "widgets_values": [
974 "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 |"
975 ],
976 "color": "#222",
977 "bgcolor": "#000"
978 },
979 {
980 "id": 196,
981 "type": "ImageScaleToTotalPixels",
982 "pos": [
983 -2020,
984 5710
985 ],
986 "size": [
987 320,
988 150
989 ],
990 "flags": [],
991 "order": 12,
992 "mode": 4,
993 "inputs": [
994 {
995 "name": "image",
996 "type": "IMAGE",
997 "link": 302
998 }
999 ],
1000 "outputs": [
1001 {
1002 "name": "IMAGE",
1003 "type": "IMAGE",
1004 "links": [
1005 318
1006 ]
1007 }
1008 ],
1009 "properties": {
1010 "enableTabs": false,
1011 "tabWidth": 65,
1012 "tabXOffset": 10,
1013 "hasSecondTab": false,
1014 "secondTabText": "Send Back",
1015 "secondTabOffset": 80,
1016 "secondTabWidth": 65,
1017 "cnr_id": "comfy-core",
1018 "ver": "0.21.0",
1019 "Node name for S&R": "ImageScaleToTotalPixels"
1020 },
1021 "widgets_values": [
1022 "lanczos",
1023 4,
1024 1
1025 ]
1026 },
1027 {
1028 "id": 205,
1029 "type": "MarkdownNote",
1030 "pos": [
1031 -4330,
1032 4560
1033 ],
1034 "size": [
1035 820,
1036 760
1037 ],
1038 "flags": [],
1039 "order": 5,
1040 "mode": 0,
1041 "inputs": [],
1042 "outputs": [],
1043 "properties": [],
1044 "widgets_values": [
1045 "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_dev_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/HiDream-O1-Image/resolve/main/checkpoints/hidream_o1_image_dev_fp8_scaled.safetensors) (7.51 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_dev_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"
1046 ],
1047 "color": "#222",
1048 "bgcolor": "#000"
1049 },
1050 {
1051 "id": 213,
1052 "type": "LoadImage",
1053 "pos": [
1054 -3000,
1055 5420
1056 ],
1057 "size": [
1058 310,
1059 430
1060 ],
1061 "flags": [],
1062 "order": 6,
1063 "mode": 0,
1064 "inputs": [],
1065 "outputs": [
1066 {
1067 "name": "IMAGE",
1068 "type": "IMAGE",
1069 "links": [
1070 300,
1071 301,
1072 302
1073 ]
1074 },
1075 {
1076 "name": "MASK",
1077 "type": "MASK",
1078 "links": null
1079 }
1080 ],
1081 "properties": {
1082 "enableTabs": false,
1083 "tabWidth": 65,
1084 "tabXOffset": 10,
1085 "hasSecondTab": false,
1086 "secondTabText": "Send Back",
1087 "secondTabOffset": 80,
1088 "secondTabWidth": 65,
1089 "cnr_id": "comfy-core",
1090 "ver": "0.21.0",
1091 "Node name for S&R": "LoadImage"
1092 },
1093 "widgets_values": [
1094 "noir_portrait.png",
1095 "image"
1096 ]
1097 },
1098 {
1099 "id": 218,
1100 "type": "ComfyMathExpression",
1101 "pos": [
1102 -1680,
1103 5780
1104 ],
1105 "size": [
1106 225,
1107 8
1108 ],
1109 "flags": {
1110 "collapsed": true
1111 },
1112 "order": 17,
1113 "mode": 0,
1114 "inputs": [
1115 {
1116 "label": "a",
1117 "name": "values.a",
1118 "type": "FLOAT,INT,BOOLEAN",
1119 "link": 319
1120 },
1121 {
1122 "label": "b",
1123 "name": "values.b",
1124 "shape": 7,
1125 "type": "FLOAT,INT,BOOLEAN",
1126 "link": null
1127 }
1128 ],
1129 "outputs": [
1130 {
1131 "name": "FLOAT",
1132 "type": "FLOAT",
1133 "links": null
1134 },
1135 {
1136 "name": "INT",
1137 "type": "INT",
1138 "links": [
1139 310
1140 ]
1141 },
1142 {
1143 "name": "BOOL",
1144 "type": "BOOLEAN",
1145 "links": null
1146 }
1147 ],
1148 "properties": {
1149 "enableTabs": false,
1150 "tabWidth": 65,
1151 "tabXOffset": 10,
1152 "hasSecondTab": false,
1153 "secondTabText": "Send Back",
1154 "secondTabOffset": 80,
1155 "secondTabWidth": 65,
1156 "cnr_id": "comfy-core",
1157 "ver": "0.21.0",
1158 "Node name for S&R": "ComfyMathExpression"
1159 },
1160 "widgets_values": [
1161 "floor(a/32)*32"
1162 ]
1163 },
1164 {
1165 "id": 219,
1166 "type": "ComfyMathExpression",
1167 "pos": [
1168 -1680,
1169 5830
1170 ],
1171 "size": [
1172 225,
1173 8
1174 ],
1175 "flags": {
1176 "collapsed": true
1177 },
1178 "order": 18,
1179 "mode": 0,
1180 "inputs": [
1181 {
1182 "label": "a",
1183 "name": "values.a",
1184 "type": "FLOAT,INT,BOOLEAN",
1185 "link": 320
1186 },
1187 {
1188 "label": "b",
1189 "name": "values.b",
1190 "shape": 7,
1191 "type": "FLOAT,INT,BOOLEAN",
1192 "link": null
1193 }
1194 ],
1195 "outputs": [
1196 {
1197 "name": "FLOAT",
1198 "type": "FLOAT",
1199 "links": null
1200 },
1201 {
1202 "name": "INT",
1203 "type": "INT",
1204 "links": [
1205 311
1206 ]
1207 },
1208 {
1209 "name": "BOOL",
1210 "type": "BOOLEAN",
1211 "links": null
1212 }
1213 ],
1214 "properties": {
1215 "enableTabs": false,
1216 "tabWidth": 65,
1217 "tabXOffset": 10,
1218 "hasSecondTab": false,
1219 "secondTabText": "Send Back",
1220 "secondTabOffset": 80,
1221 "secondTabWidth": 65,
1222 "cnr_id": "comfy-core",
1223 "ver": "0.21.0",
1224 "Node name for S&R": "ComfyMathExpression"
1225 },
1226 "widgets_values": [
1227 "floor(a/32)*32"
1228 ]
1229 },
1230 {
1231 "id": 221,
1232 "type": "PreviewAny",
1233 "pos": [
1234 -2830,
1235 5100
1236 ],
1237 "size": [
1238 230,
1239 160
1240 ],
1241 "flags": {
1242 "collapsed": false
1243 },
1244 "order": 19,
1245 "mode": 0,
1246 "inputs": [
1247 {
1248 "name": "source",
1249 "type": "*",
1250 "link": 326
1251 }
1252 ],
1253 "outputs": [
1254 {
1255 "name": "STRING",
1256 "type": "STRING",
1257 "links": [
1258 327
1259 ]
1260 }
1261 ],
1262 "properties": {
1263 "enableTabs": false,
1264 "tabWidth": 65,
1265 "tabXOffset": 10,
1266 "hasSecondTab": false,
1267 "secondTabText": "Send Back",
1268 "secondTabOffset": 80,
1269 "secondTabWidth": 65,
1270 "cnr_id": "comfy-core",
1271 "ver": "0.21.0",
1272 "Node name for S&R": "PreviewAny"
1273 },
1274 "widgets_values": [
1275 null,
1276 null,
1277 null
1278 ]
1279 },
1280 {
1281 "id": 156,
1282 "type": "EmptyHiDreamO1LatentImage",
1283 "pos": [
1284 -2030,
1285 5420
1286 ],
1287 "size": [
1288 280,
1289 150
1290 ],
1291 "flags": [],
1292 "order": 7,
1293 "mode": 0,
1294 "inputs": [],
1295 "outputs": [
1296 {
1297 "name": "LATENT",
1298 "type": "LATENT",
1299 "links": [
1300 233
1301 ]
1302 }
1303 ],
1304 "properties": {
1305 "enableTabs": false,
1306 "tabWidth": 65,
1307 "tabXOffset": 10,
1308 "hasSecondTab": false,
1309 "secondTabText": "Send Back",
1310 "secondTabOffset": 80,
1311 "secondTabWidth": 65,
1312 "cnr_id": "comfy-core",
1313 "ver": "0.21.0",
1314 "Node name for S&R": "EmptyHiDreamO1LatentImage"
1315 },
1316 "widgets_values": [
1317 2048,
1318 2048,
1319 1
1320 ]
1321 },
1322 {
1323 "id": 172,
1324 "type": "EmptyHiDreamO1LatentImage",
1325 "pos": [
1326 -1410,
1327 5700
1328 ],
1329 "size": [
1330 280,
1331 150
1332 ],
1333 "flags": [],
1334 "order": 20,
1335 "mode": 0,
1336 "inputs": [
1337 {
1338 "name": "width",
1339 "type": "INT",
1340 "widget": {
1341 "name": "width"
1342 },
1343 "link": 310
1344 },
1345 {
1346 "name": "height",
1347 "type": "INT",
1348 "widget": {
1349 "name": "height"
1350 },
1351 "link": 311
1352 }
1353 ],
1354 "outputs": [
1355 {
1356 "name": "LATENT",
1357 "type": "LATENT",
1358 "links": [
1359 350
1360 ]
1361 }
1362 ],
1363 "properties": {
1364 "enableTabs": false,
1365 "tabWidth": 65,
1366 "tabXOffset": 10,
1367 "hasSecondTab": false,
1368 "secondTabText": "Send Back",
1369 "secondTabOffset": 80,
1370 "secondTabWidth": 65,
1371 "cnr_id": "comfy-core",
1372 "ver": "0.21.0",
1373 "Node name for S&R": "EmptyHiDreamO1LatentImage"
1374 },
1375 "widgets_values": [
1376 2048,
1377 2048,
1378 1
1379 ]
1380 },
1381 {
1382 "id": 226,
1383 "type": "MarkdownNote",
1384 "pos": [
1385 -2540,
1386 5430
1387 ],
1388 "size": [
1389 360,
1390 240
1391 ],
1392 "flags": [],
1393 "order": 8,
1394 "mode": 0,
1395 "inputs": [],
1396 "outputs": [],
1397 "title": "Note: Reference Images",
1398 "properties": [],
1399 "widgets_values": [
1400 "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."
1401 ],
1402 "color": "#222",
1403 "bgcolor": "#000"
1404 },
1405 {
1406 "id": 171,
1407 "type": "PrimitiveStringMultiline",
1408 "pos": [
1409 -3440,
1410 4890
1411 ],
1412 "size": [
1413 310,
1414 320
1415 ],
1416 "flags": [],
1417 "order": 9,
1418 "mode": 0,
1419 "inputs": [],
1420 "outputs": [
1421 {
1422 "name": "STRING",
1423 "type": "STRING",
1424 "links": [
1425 260,
1426 267
1427 ]
1428 }
1429 ],
1430 "title": "User Prompt",
1431 "properties": {
1432 "enableTabs": false,
1433 "tabWidth": 65,
1434 "tabXOffset": 10,
1435 "hasSecondTab": false,
1436 "secondTabText": "Send Back",
1437 "secondTabOffset": 80,
1438 "secondTabWidth": 65,
1439 "cnr_id": "comfy-core",
1440 "ver": "0.21.0",
1441 "Node name for S&R": "PrimitiveStringMultiline"
1442 },
1443 "widgets_values": [
1444 "Transform the background into a rainy neon city street at night, with wet asphalt reflections, blurred neon signs"
1445 ]
1446 },
1447 {
1448 "id": 227,
1449 "type": "SaveImage",
1450 "pos": [
1451 -1010,
1452 4560
1453 ],
1454 "size": [
1455 1260,
1456 1330
1457 ],
1458 "flags": [],
1459 "order": 28,
1460 "mode": 0,
1461 "inputs": [
1462 {
1463 "name": "images",
1464 "type": "IMAGE",
1465 "link": 347
1466 }
1467 ],
1468 "outputs": [],
1469 "properties": {
1470 "enableTabs": false,
1471 "tabWidth": 65,
1472 "tabXOffset": 10,
1473 "hasSecondTab": false,
1474 "secondTabText": "Send Back",
1475 "secondTabOffset": 80,
1476 "secondTabWidth": 65,
1477 "cnr_id": "comfy-core",
1478 "ver": "0.21.1",
1479 "Node name for S&R": "SaveImage"
1480 },
1481 "widgets_values": [
1482 "hidream_o1"
1483 ]
1484 }
1485 ],
1486 "links": [
1487 [
1488 139,
1489 112,
1490 0,
1491 108,
1492 4,
1493 "SIGMAS"
1494 ],
1495 [
1496 141,
1497 110,
1498 0,
1499 104,
1500 0,
1501 "CONDITIONING"
1502 ],
1503 [
1504 146,
1505 6,
1506 1,
1507 110,
1508 0,
1509 "CLIP"
1510 ],
1511 [
1512 147,
1513 6,
1514 2,
1515 105,
1516 1,
1517 "VAE"
1518 ],
1519 [
1520 182,
1521 124,
1522 0,
1523 112,
1524 0,
1525 "MODEL"
1526 ],
1527 [
1528 185,
1529 125,
1530 0,
1531 108,
1532 3,
1533 "SAMPLER"
1534 ],
1535 [
1536 192,
1537 6,
1538 0,
1539 124,
1540 0,
1541 "MODEL"
1542 ],
1543 [
1544 213,
1545 124,
1546 0,
1547 108,
1548 0,
1549 "MODEL"
1550 ],
1551 [
1552 217,
1553 110,
1554 0,
1555 152,
1556 0,
1557 "CONDITIONING"
1558 ],
1559 [
1560 218,
1561 104,
1562 0,
1563 152,
1564 1,
1565 "CONDITIONING"
1566 ],
1567 [
1568 220,
1569 104,
1570 1,
1571 153,
1572 1,
1573 "CONDITIONING"
1574 ],
1575 [
1576 224,
1577 154,
1578 0,
1579 152,
1580 2,
1581 "BOOLEAN"
1582 ],
1583 [
1584 225,
1585 154,
1586 0,
1587 153,
1588 2,
1589 "BOOLEAN"
1590 ],
1591 [
1592 233,
1593 156,
1594 0,
1595 155,
1596 0,
1597 "LATENT"
1598 ],
1599 [
1600 235,
1601 154,
1602 0,
1603 155,
1604 2,
1605 "BOOLEAN"
1606 ],
1607 [
1608 260,
1609 171,
1610 0,
1611 175,
1612 0,
1613 "STRING"
1614 ],
1615 [
1616 265,
1617 177,
1618 0,
1619 176,
1620 2,
1621 "BOOLEAN"
1622 ],
1623 [
1624 266,
1625 175,
1626 0,
1627 176,
1628 1,
1629 "STRING"
1630 ],
1631 [
1632 267,
1633 171,
1634 0,
1635 176,
1636 0,
1637 "STRING"
1638 ],
1639 [
1640 274,
1641 6,
1642 1,
1643 188,
1644 0,
1645 "CLIP"
1646 ],
1647 [
1648 275,
1649 188,
1650 0,
1651 104,
1652 1,
1653 "CONDITIONING"
1654 ],
1655 [
1656 276,
1657 188,
1658 0,
1659 153,
1660 0,
1661 "CONDITIONING"
1662 ],
1663 [
1664 300,
1665 213,
1666 0,
1667 104,
1668 2,
1669 "IMAGE"
1670 ],
1671 [
1672 301,
1673 213,
1674 0,
1675 175,
1676 1,
1677 "IMAGE"
1678 ],
1679 [
1680 302,
1681 213,
1682 0,
1683 196,
1684 0,
1685 "IMAGE"
1686 ],
1687 [
1688 310,
1689 218,
1690 1,
1691 172,
1692 0,
1693 "INT"
1694 ],
1695 [
1696 311,
1697 219,
1698 1,
1699 172,
1700 1,
1701 "INT"
1702 ],
1703 [
1704 318,
1705 196,
1706 0,
1707 157,
1708 0,
1709 "IMAGE"
1710 ],
1711 [
1712 319,
1713 157,
1714 0,
1715 218,
1716 0,
1717 "INT"
1718 ],
1719 [
1720 320,
1721 157,
1722 1,
1723 219,
1724 0,
1725 "INT"
1726 ],
1727 [
1728 321,
1729 155,
1730 0,
1731 108,
1732 5,
1733 "LATENT"
1734 ],
1735 [
1736 322,
1737 108,
1738 0,
1739 105,
1740 0,
1741 "LATENT"
1742 ],
1743 [
1744 323,
1745 152,
1746 0,
1747 108,
1748 1,
1749 "CONDITIONING"
1750 ],
1751 [
1752 324,
1753 153,
1754 0,
1755 108,
1756 2,
1757 "CONDITIONING"
1758 ],
1759 [
1760 326,
1761 176,
1762 0,
1763 221,
1764 0,
1765 "STRING"
1766 ],
1767 [
1768 327,
1769 221,
1770 0,
1771 110,
1772 1,
1773 "STRING"
1774 ],
1775 [
1776 347,
1777 105,
1778 0,
1779 227,
1780 0,
1781 "IMAGE"
1782 ],
1783 [
1784 350,
1785 172,
1786 0,
1787 155,
1788 1,
1789 "LATENT"
1790 ]
1791 ],
1792 "groups": [
1793 {
1794 "id": 2,
1795 "title": "Sampling",
1796 "bounding": [
1797 -1730,
1798 4530,
1799 690,
1800 720
1801 ],
1802 "color": "#3f789e",
1803 "flags": []
1804 },
1805 {
1806 "id": 3,
1807 "title": "Prompt",
1808 "bounding": [
1809 -2560,
1810 4530,
1811 450,
1812 720
1813 ],
1814 "color": "#3f789e",
1815 "flags": []
1816 },
1817 {
1818 "id": 4,
1819 "title": "Model",
1820 "bounding": [
1821 -3450,
1822 4530,
1823 860,
1824 260
1825 ],
1826 "color": "#3f789e",
1827 "flags": []
1828 },
1829 {
1830 "id": 6,
1831 "title": "Image Size",
1832 "bounding": [
1833 -2080,
1834 5280,
1835 1040,
1836 620
1837 ],
1838 "color": "#3f789e",
1839 "flags": []
1840 },
1841 {
1842 "id": 7,
1843 "title": "I2V or Image Edit Switch",
1844 "bounding": [
1845 -2080,
1846 4530,
1847 320,
1848 460
1849 ],
1850 "color": "#3f789e",
1851 "flags": []
1852 },
1853 {
1854 "id": 8,
1855 "title": "Image Input for Image Edit",
1856 "bounding": [
1857 -3080,
1858 5280,
1859 970,
1860 620
1861 ],
1862 "color": "#3f789e",
1863 "flags": []
1864 },
1865 {
1866 "id": 9,
1867 "title": "Prompt Enhancement",
1868 "bounding": [
1869 -3080,
1870 4820,
1871 490,
1872 430
1873 ],
1874 "color": "#3f789e",
1875 "flags": []
1876 },
1877 {
1878 "id": 10,
1879 "title": "Feature Switch",
1880 "bounding": [
1881 -3450,
1882 5280,
1883 340,
1884 620
1885 ],
1886 "color": "#A88",
1887 "flags": []
1888 },
1889 {
1890 "id": 11,
1891 "title": "User Prompt",
1892 "bounding": [
1893 -3450,
1894 4820,
1895 340,
1896 430
1897 ],
1898 "color": "#A88",
1899 "flags": []
1900 },
1901 {
1902 "id": 12,
1903 "title": "Size: Image Edit",
1904 "bounding": [
1905 -2040,
1906 5630,
1907 920,
1908 242.65625
1909 ],
1910 "color": "#3f789e",
1911 "flags": []
1912 },
1913 {
1914 "id": 13,
1915 "title": "Size: Text to Image",
1916 "bounding": [
1917 -2040,
1918 5350,
1919 300,
1920 230
1921 ],
1922 "color": "#3f789e",
1923 "flags": []
1924 },
1925 {
1926 "id": 14,
1927 "title": "Group",
1928 "bounding": [
1929 -2080,
1930 5000,
1931 320,
1932 250
1933 ],
1934 "color": "#3f789e",
1935 "flags": []
1936 }
1937 ],
1938 "definitions": {
1939 "subgraphs": [
1940 {
1941 "id": "fa7296b5-c974-4466-bfe3-a1f05f43b880",
1942 "version": 1,
1943 "state": {
1944 "lastGroupId": 14,
1945 "lastNodeId": 228,
1946 "lastLinkId": 350,
1947 "lastRerouteId": 0
1948 },
1949 "revision": 0,
1950 "config": [],
1951 "name": "Prompt Enhancement",
1952 "inputNode": {
1953 "id": -10,
1954 "bounding": [
1955 -4280,
1956 5580,
1957 128,
1958 108
1959 ]
1960 },
1961 "outputNode": {
1962 "id": -20,
1963 "bounding": [
1964 -130,
1965 5680,
1966 128,
1967 68
1968 ]
1969 },
1970 "inputs": [
1971 {
1972 "id": "8e257a84-6ce5-4e50-b571-2118cc7a0b8f",
1973 "name": "replace",
1974 "type": "STRING",
1975 "linkIds": [
1976 248
1977 ],
1978 "localized_name": "replace",
1979 "label": "user_prompt",
1980 "pos": [
1981 -4176,
1982 5604
1983 ]
1984 },
1985 {
1986 "id": "eae67611-94a9-4fb3-abd7-a29bc95db936",
1987 "name": "clip_name",
1988 "type": "COMBO",
1989 "linkIds": [
1990 263
1991 ],
1992 "pos": [
1993 -4176,
1994 5624
1995 ]
1996 },
1997 {
1998 "id": "46f381cb-503d-4a53-b419-f510752553e6",
1999 "name": "image",
2000 "type": "IMAGE",
2001 "linkIds": [
2002 269
2003 ],
2004 "pos": [
2005 -4176,
2006 5644
2007 ]
2008 }
2009 ],
2010 "outputs": [
2011 {
2012 "id": "54294308-5a73-4d61-a8dd-ff5b58aa91e8",
2013 "name": "output",
2014 "type": "STRING",
2015 "linkIds": [
2016 292
2017 ],
2018 "localized_name": "output",
2019 "pos": [
2020 -106,
2021 5704
2022 ]
2023 }
2024 ],
2025 "widgets": [],
2026 "nodes": [
2027 {
2028 "id": 165,
2029 "type": "PrimitiveStringMultiline",
2030 "pos": [
2031 -3930,
2032 5440
2033 ],
2034 "size": [
2035 510,
2036 440
2037 ],
2038 "flags": {
2039 "collapsed": false
2040 },
2041 "order": 0,
2042 "mode": 0,
2043 "inputs": [],
2044 "outputs": [
2045 {
2046 "localized_name": "STRING",
2047 "name": "STRING",
2048 "type": "STRING",
2049 "links": [
2050 243
2051 ]
2052 }
2053 ],
2054 "title": "REWRITE_SYSTEM_PROMPT",
2055 "properties": {
2056 "enableTabs": false,
2057 "tabWidth": 65,
2058 "tabXOffset": 10,
2059 "hasSecondTab": false,
2060 "secondTabText": "Send Back",
2061 "secondTabOffset": 80,
2062 "secondTabWidth": 65,
2063 "cnr_id": "comfy-core",
2064 "ver": "0.21.0",
2065 "Node name for S&R": "PrimitiveStringMultiline"
2066 },
2067 "widgets_values": [
2068 "<|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|>"
2069 ]
2070 },
2071 {
2072 "id": 170,
2073 "type": "StringReplace",
2074 "pos": [
2075 -3930,
2076 5930
2077 ],
2078 "size": [
2079 510,
2080 260
2081 ],
2082 "flags": {
2083 "collapsed": false
2084 },
2085 "order": 4,
2086 "mode": 0,
2087 "inputs": [
2088 {
2089 "localized_name": "replace",
2090 "name": "replace",
2091 "type": "STRING",
2092 "widget": {
2093 "name": "replace"
2094 },
2095 "link": 248
2096 }
2097 ],
2098 "outputs": [
2099 {
2100 "localized_name": "STRING",
2101 "name": "STRING",
2102 "type": "STRING",
2103 "links": [
2104 244
2105 ]
2106 }
2107 ],
2108 "properties": {
2109 "enableTabs": false,
2110 "tabWidth": 65,
2111 "tabXOffset": 10,
2112 "hasSecondTab": false,
2113 "secondTabText": "Send Back",
2114 "secondTabOffset": 80,
2115 "secondTabWidth": 65,
2116 "cnr_id": "comfy-core",
2117 "ver": "0.21.0",
2118 "Node name for S&R": "StringReplace"
2119 },
2120 "widgets_values": [
2121 "<|turn>user\n{user_prompt}<|turn|>\n<|turn>model\n",
2122 "{user_prompt}",
2123 ""
2124 ]
2125 },
2126 {
2127 "id": 166,
2128 "type": "StringConcatenate",
2129 "pos": [
2130 -3350,
2131 5440
2132 ],
2133 "size": [
2134 230,
2135 220
2136 ],
2137 "flags": {
2138 "collapsed": false
2139 },
2140 "order": 2,
2141 "mode": 0,
2142 "inputs": [
2143 {
2144 "localized_name": "string_a",
2145 "name": "string_a",
2146 "type": "STRING",
2147 "widget": {
2148 "name": "string_a"
2149 },
2150 "link": 243
2151 },
2152 {
2153 "localized_name": "string_b",
2154 "name": "string_b",
2155 "type": "STRING",
2156 "widget": {
2157 "name": "string_b"
2158 },
2159 "link": 244
2160 }
2161 ],
2162 "outputs": [
2163 {
2164 "localized_name": "STRING",
2165 "name": "STRING",
2166 "type": "STRING",
2167 "links": [
2168 251
2169 ]
2170 }
2171 ],
2172 "properties": {
2173 "enableTabs": false,
2174 "tabWidth": 65,
2175 "tabXOffset": 10,
2176 "hasSecondTab": false,
2177 "secondTabText": "Send Back",
2178 "secondTabOffset": 80,
2179 "secondTabWidth": 65,
2180 "cnr_id": "comfy-core",
2181 "ver": "0.21.0",
2182 "Node name for S&R": "StringConcatenate"
2183 },
2184 "widgets_values": [
2185 "",
2186 "",
2187 ""
2188 ]
2189 },
2190 {
2191 "id": 164,
2192 "type": "TextGenerate",
2193 "pos": [
2194 -3070,
2195 5220
2196 ],
2197 "size": [
2198 400,
2199 420
2200 ],
2201 "flags": [],
2202 "order": 1,
2203 "mode": 0,
2204 "showAdvanced": true,
2205 "inputs": [
2206 {
2207 "localized_name": "clip",
2208 "name": "clip",
2209 "type": "CLIP",
2210 "link": 241
2211 },
2212 {
2213 "localized_name": "image",
2214 "name": "image",
2215 "shape": 7,
2216 "type": "IMAGE",
2217 "link": 269
2218 },
2219 {
2220 "localized_name": "video",
2221 "name": "video",
2222 "shape": 7,
2223 "type": "IMAGE",
2224 "link": null
2225 },
2226 {
2227 "localized_name": "audio",
2228 "name": "audio",
2229 "shape": 7,
2230 "type": "AUDIO",
2231 "link": null
2232 },
2233 {
2234 "localized_name": "prompt",
2235 "name": "prompt",
2236 "type": "STRING",
2237 "widget": {
2238 "name": "prompt"
2239 },
2240 "link": 251
2241 }
2242 ],
2243 "outputs": [
2244 {
2245 "localized_name": "generated_text",
2246 "name": "generated_text",
2247 "type": "STRING",
2248 "links": [
2249 281
2250 ]
2251 }
2252 ],
2253 "properties": {
2254 "enableTabs": false,
2255 "tabWidth": 65,
2256 "tabXOffset": 10,
2257 "hasSecondTab": false,
2258 "secondTabText": "Send Back",
2259 "secondTabOffset": 80,
2260 "secondTabWidth": 65,
2261 "cnr_id": "comfy-core",
2262 "ver": "0.21.0",
2263 "Node name for S&R": "TextGenerate"
2264 },
2265 "widgets_values": [
2266 "",
2267 2048,
2268 "on",
2269 0.7,
2270 64,
2271 0.95,
2272 0.05,
2273 1.05,
2274 0,
2275 0,
2276 false,
2277 false
2278 ]
2279 },
2280 {
2281 "id": 167,
2282 "type": "CLIPLoader",
2283 "pos": [
2284 -3930,
2285 5220
2286 ],
2287 "size": [
2288 510,
2289 160
2290 ],
2291 "flags": [],
2292 "order": 3,
2293 "mode": 0,
2294 "inputs": [
2295 {
2296 "localized_name": "clip_name",
2297 "name": "clip_name",
2298 "type": "COMBO",
2299 "widget": {
2300 "name": "clip_name"
2301 },
2302 "link": 263
2303 }
2304 ],
2305 "outputs": [
2306 {
2307 "localized_name": "CLIP",
2308 "name": "CLIP",
2309 "type": "CLIP",
2310 "links": [
2311 241
2312 ]
2313 }
2314 ],
2315 "properties": {
2316 "enableTabs": false,
2317 "tabWidth": 65,
2318 "tabXOffset": 10,
2319 "hasSecondTab": false,
2320 "secondTabText": "Send Back",
2321 "secondTabOffset": 80,
2322 "secondTabWidth": 65,
2323 "cnr_id": "comfy-core",
2324 "ver": "0.21.0",
2325 "Node name for S&R": "CLIPLoader",
2326 "models": [
2327 {
2328 "name": "gemma4_e4b_it_fp8_scaled.safetensors",
2329 "url": "https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors",
2330 "directory": "text_encoders"
2331 }
2332 ]
2333 },
2334 "widgets_values": [
2335 "gemma4_e4b_it_fp8_scaled.safetensors",
2336 "stable_diffusion",
2337 "default"
2338 ]
2339 },
2340 {
2341 "id": 198,
2342 "type": "JsonExtractString",
2343 "pos": [
2344 -1360,
2345 5710
2346 ],
2347 "size": [
2348 400,
2349 200
2350 ],
2351 "flags": [],
2352 "order": 5,
2353 "mode": 0,
2354 "inputs": [
2355 {
2356 "localized_name": "json_string",
2357 "name": "json_string",
2358 "type": "STRING",
2359 "widget": {
2360 "name": "json_string"
2361 },
2362 "link": 288
2363 }
2364 ],
2365 "outputs": [
2366 {
2367 "localized_name": "STRING",
2368 "name": "STRING",
2369 "type": "STRING",
2370 "links": [
2371 291,
2372 292
2373 ]
2374 }
2375 ],
2376 "properties": {
2377 "enableTabs": false,
2378 "tabWidth": 65,
2379 "tabXOffset": 10,
2380 "hasSecondTab": false,
2381 "secondTabText": "Send Back",
2382 "secondTabOffset": 80,
2383 "secondTabWidth": 65,
2384 "cnr_id": "comfy-core",
2385 "ver": "0.21.0",
2386 "Node name for S&R": "JsonExtractString"
2387 },
2388 "widgets_values": [
2389 "",
2390 "prompt"
2391 ]
2392 },
2393 {
2394 "id": 199,
2395 "type": "PreviewAny",
2396 "pos": [
2397 -2590,
2398 5220
2399 ],
2400 "size": [
2401 460,
2402 980
2403 ],
2404 "flags": [],
2405 "order": 6,
2406 "mode": 4,
2407 "inputs": [
2408 {
2409 "localized_name": "source",
2410 "name": "source",
2411 "type": "*",
2412 "link": 281
2413 }
2414 ],
2415 "outputs": [
2416 {
2417 "localized_name": "STRING",
2418 "name": "STRING",
2419 "type": "STRING",
2420 "links": [
2421 285
2422 ]
2423 }
2424 ],
2425 "properties": {
2426 "enableTabs": false,
2427 "tabWidth": 65,
2428 "tabXOffset": 10,
2429 "hasSecondTab": false,
2430 "secondTabText": "Send Back",
2431 "secondTabOffset": 80,
2432 "secondTabWidth": 65,
2433 "cnr_id": "comfy-core",
2434 "ver": "0.21.0",
2435 "Node name for S&R": "PreviewAny"
2436 },
2437 "widgets_values": [
2438 null,
2439 null,
2440 null
2441 ]
2442 },
2443 {
2444 "id": 200,
2445 "type": "PreviewAny",
2446 "pos": [
2447 -1640,
2448 5240
2449 ],
2450 "size": [
2451 250,
2452 220
2453 ],
2454 "flags": [],
2455 "order": 7,
2456 "mode": 4,
2457 "inputs": [
2458 {
2459 "localized_name": "source",
2460 "name": "source",
2461 "type": "*",
2462 "link": 286
2463 }
2464 ],
2465 "outputs": [
2466 {
2467 "localized_name": "STRING",
2468 "name": "STRING",
2469 "type": "STRING",
2470 "links": []
2471 }
2472 ],
2473 "properties": {
2474 "enableTabs": false,
2475 "tabWidth": 65,
2476 "tabXOffset": 10,
2477 "hasSecondTab": false,
2478 "secondTabText": "Send Back",
2479 "secondTabOffset": 80,
2480 "secondTabWidth": 65,
2481 "cnr_id": "comfy-core",
2482 "ver": "0.21.0",
2483 "Node name for S&R": "PreviewAny"
2484 },
2485 "widgets_values": [
2486 null,
2487 null,
2488 null
2489 ]
2490 },
2491 {
2492 "id": 201,
2493 "type": "RegexReplace",
2494 "pos": [
2495 -2080,
2496 5230
2497 ],
2498 "size": [
2499 400,
2500 400
2501 ],
2502 "flags": [],
2503 "order": 8,
2504 "mode": 0,
2505 "showAdvanced": true,
2506 "inputs": [
2507 {
2508 "localized_name": "string",
2509 "name": "string",
2510 "type": "STRING",
2511 "widget": {
2512 "name": "string"
2513 },
2514 "link": 285
2515 }
2516 ],
2517 "outputs": [
2518 {
2519 "localized_name": "STRING",
2520 "name": "STRING",
2521 "type": "STRING",
2522 "links": [
2523 286,
2524 287
2525 ]
2526 }
2527 ],
2528 "properties": {
2529 "enableTabs": false,
2530 "tabWidth": 65,
2531 "tabXOffset": 10,
2532 "hasSecondTab": false,
2533 "secondTabText": "Send Back",
2534 "secondTabOffset": 80,
2535 "secondTabWidth": 65,
2536 "cnr_id": "comfy-core",
2537 "ver": "0.21.0",
2538 "Node name for S&R": "RegexReplace"
2539 },
2540 "widgets_values": [
2541 "",
2542 "^```(?:json)?\\s*\\n?",
2543 "",
2544 false,
2545 false,
2546 false,
2547 1
2548 ]
2549 },
2550 {
2551 "id": 202,
2552 "type": "RegexReplace",
2553 "pos": [
2554 -2080,
2555 5710
2556 ],
2557 "size": [
2558 400,
2559 400
2560 ],
2561 "flags": [],
2562 "order": 9,
2563 "mode": 0,
2564 "showAdvanced": false,
2565 "inputs": [
2566 {
2567 "localized_name": "string",
2568 "name": "string",
2569 "type": "STRING",
2570 "widget": {
2571 "name": "string"
2572 },
2573 "link": 287
2574 }
2575 ],
2576 "outputs": [
2577 {
2578 "localized_name": "STRING",
2579 "name": "STRING",
2580 "type": "STRING",
2581 "links": [
2582 288,
2583 290
2584 ]
2585 }
2586 ],
2587 "properties": {
2588 "enableTabs": false,
2589 "tabWidth": 65,
2590 "tabXOffset": 10,
2591 "hasSecondTab": false,
2592 "secondTabText": "Send Back",
2593 "secondTabOffset": 80,
2594 "secondTabWidth": 65,
2595 "cnr_id": "comfy-core",
2596 "ver": "0.21.0",
2597 "Node name for S&R": "RegexReplace"
2598 },
2599 "widgets_values": [
2600 "",
2601 "\\n?```\\s*$",
2602 "",
2603 false,
2604 false,
2605 false,
2606 1
2607 ]
2608 },
2609 {
2610 "id": 203,
2611 "type": "PreviewAny",
2612 "pos": [
2613 -1630,
2614 5710
2615 ],
2616 "size": [
2617 230,
2618 170
2619 ],
2620 "flags": [],
2621 "order": 10,
2622 "mode": 4,
2623 "inputs": [
2624 {
2625 "localized_name": "source",
2626 "name": "source",
2627 "type": "*",
2628 "link": 290
2629 }
2630 ],
2631 "outputs": [
2632 {
2633 "localized_name": "STRING",
2634 "name": "STRING",
2635 "type": "STRING",
2636 "links": []
2637 }
2638 ],
2639 "properties": {
2640 "enableTabs": false,
2641 "tabWidth": 65,
2642 "tabXOffset": 10,
2643 "hasSecondTab": false,
2644 "secondTabText": "Send Back",
2645 "secondTabOffset": 80,
2646 "secondTabWidth": 65,
2647 "cnr_id": "comfy-core",
2648 "ver": "0.21.0",
2649 "Node name for S&R": "PreviewAny"
2650 },
2651 "widgets_values": [
2652 null,
2653 null,
2654 null
2655 ]
2656 },
2657 {
2658 "id": 204,
2659 "type": "PreviewAny",
2660 "pos": [
2661 -900,
2662 5710
2663 ],
2664 "size": [
2665 300,
2666 400
2667 ],
2668 "flags": [],
2669 "order": 11,
2670 "mode": 4,
2671 "inputs": [
2672 {
2673 "localized_name": "source",
2674 "name": "source",
2675 "type": "*",
2676 "link": 291
2677 }
2678 ],
2679 "outputs": [
2680 {
2681 "localized_name": "STRING",
2682 "name": "STRING",
2683 "type": "STRING",
2684 "links": []
2685 }
2686 ],
2687 "properties": {
2688 "enableTabs": false,
2689 "tabWidth": 65,
2690 "tabXOffset": 10,
2691 "hasSecondTab": false,
2692 "secondTabText": "Send Back",
2693 "secondTabOffset": 80,
2694 "secondTabWidth": 65,
2695 "cnr_id": "comfy-core",
2696 "ver": "0.21.0",
2697 "Node name for S&R": "PreviewAny"
2698 },
2699 "widgets_values": [
2700 null,
2701 null,
2702 null
2703 ]
2704 }
2705 ],
2706 "groups": [
2707 {
2708 "id": 5,
2709 "title": "Prompt Enhancement",
2710 "bounding": [
2711 -3960,
2712 5130,
2713 1350,
2714 1070
2715 ],
2716 "color": "#3f789e",
2717 "flags": []
2718 }
2719 ],
2720 "links": [
2721 {
2722 "id": 243,
2723 "origin_id": 165,
2724 "origin_slot": 0,
2725 "target_id": 166,
2726 "target_slot": 0,
2727 "type": "STRING"
2728 },
2729 {
2730 "id": 244,
2731 "origin_id": 170,
2732 "origin_slot": 0,
2733 "target_id": 166,
2734 "target_slot": 1,
2735 "type": "STRING"
2736 },
2737 {
2738 "id": 241,
2739 "origin_id": 167,
2740 "origin_slot": 0,
2741 "target_id": 164,
2742 "target_slot": 0,
2743 "type": "CLIP"
2744 },
2745 {
2746 "id": 251,
2747 "origin_id": 166,
2748 "origin_slot": 0,
2749 "target_id": 164,
2750 "target_slot": 4,
2751 "type": "STRING"
2752 },
2753 {
2754 "id": 248,
2755 "origin_id": -10,
2756 "origin_slot": 0,
2757 "target_id": 170,
2758 "target_slot": 0,
2759 "type": "STRING"
2760 },
2761 {
2762 "id": 263,
2763 "origin_id": -10,
2764 "origin_slot": 1,
2765 "target_id": 167,
2766 "target_slot": 0,
2767 "type": "COMBO"
2768 },
2769 {
2770 "id": 269,
2771 "origin_id": -10,
2772 "origin_slot": 2,
2773 "target_id": 164,
2774 "target_slot": 1,
2775 "type": "IMAGE"
2776 },
2777 {
2778 "id": 281,
2779 "origin_id": 164,
2780 "origin_slot": 0,
2781 "target_id": 199,
2782 "target_slot": 0,
2783 "type": "STRING"
2784 },
2785 {
2786 "id": 285,
2787 "origin_id": 199,
2788 "origin_slot": 0,
2789 "target_id": 201,
2790 "target_slot": 0,
2791 "type": "STRING"
2792 },
2793 {
2794 "id": 286,
2795 "origin_id": 201,
2796 "origin_slot": 0,
2797 "target_id": 200,
2798 "target_slot": 0,
2799 "type": "STRING"
2800 },
2801 {
2802 "id": 287,
2803 "origin_id": 201,
2804 "origin_slot": 0,
2805 "target_id": 202,
2806 "target_slot": 0,
2807 "type": "STRING"
2808 },
2809 {
2810 "id": 288,
2811 "origin_id": 202,
2812 "origin_slot": 0,
2813 "target_id": 198,
2814 "target_slot": 0,
2815 "type": "STRING"
2816 },
2817 {
2818 "id": 290,
2819 "origin_id": 202,
2820 "origin_slot": 0,
2821 "target_id": 203,
2822 "target_slot": 0,
2823 "type": "STRING"
2824 },
2825 {
2826 "id": 291,
2827 "origin_id": 198,
2828 "origin_slot": 0,
2829 "target_id": 204,
2830 "target_slot": 0,
2831 "type": "STRING"
2832 },
2833 {
2834 "id": 292,
2835 "origin_id": 198,
2836 "origin_slot": 0,
2837 "target_id": -20,
2838 "target_slot": 0,
2839 "type": "STRING"
2840 }
2841 ],
2842 "extra": []
2843 }
2844 ]
2845 },
2846 "config": [],
2847 "extra": {
2848 "ds": {
2849 "scale": 0.24909319871250796,
2850 "offset": [
2851 5602.630861809338,
2852 -3420.418124119812
2853 ]
2854 },
2855 "frontendVersion": "1.43.18",
2856 "linearData": {
2857 "inputs": [],
2858 "outputs": []
2859 },
2860 "VHS_latentpreview": false,
2861 "VHS_latentpreviewrate": 0,
2862 "VHS_MetadataImage": true,
2863 "VHS_KeepIntermediate": true
2864 },
2865 "version": 0.4
2866}