ComfyPilotComfyPilot
工作流 / LLM / HeyGen Decision 1:判定与择优
HeyGen Decision 1:判定与择优

HeyGen Decision 1:判定与择优

Api Heygen Decision 1

让 HeyGen Decision 1 对文本、图像、音频或视频回答一个是/否问题或打分问题,再根据结果决定图的走向。同一个工作流里包含两种用法:用是/否判定为单张图片放行,或给两张图片分别打 1-10 分后比较,由开关把更好的那张传给下游。适合放在昂贵的生成步骤之前做低成本质检,也适合在多个候选里择优。

LLM 18 个节点 2 个输入 ComfyUI ≥ 0.46.0 ComfyUI 22 KB

下载工作流 JSON 查看官方来源

下载后把文件拖进 ComfyUI 窗口即可打开。

节点构成

PreviewAny × 7
MarkdownNote × 3
HeyGenDecisionScore × 2
LoadImage × 2
ComfyMathExpression × 1
ComfySwitchNode × 1
PreviewImage × 1
HeyGenDecisionYesNo × 1

官方标注的模型

HeyGen Decision 1

工作流 JSON

和上面「下载工作流 JSON」是同一份文件。

1{
2 "id": "fb40edf3-32e3-4b5d-a44f-51edfe06b78a",
3 "revision": 0,
4 "last_node_id": 25,
5 "last_link_id": 35,
6 "nodes": [
7 {
8 "id": 2,
9 "type": "HeyGenDecisionScore",
10 "pos": [
11 730,
12 2020
13 ],
14 "size": [
15 400,
16 240
17 ],
18 "flags": [],
19 "order": 5,
20 "mode": 0,
21 "inputs": [
22 {
23 "name": "images.image_1",
24 "shape": 7,
25 "type": "IMAGE",
26 "link": 3
27 },
28 {
29 "name": "images.image_2",
30 "shape": 7,
31 "type": "IMAGE",
32 "link": null
33 },
34 {
35 "name": "audio_1",
36 "shape": 7,
37 "type": "AUDIO",
38 "link": null
39 },
40 {
41 "name": "video_1",
42 "shape": 7,
43 "type": "VIDEO",
44 "link": null
45 },
46 {
47 "name": "text",
48 "shape": 7,
49 "type": "STRING",
50 "link": null
51 }
52 ],
53 "outputs": [
54 {
55 "name": "result",
56 "type": "BOOLEAN",
57 "links": [
58 10
59 ]
60 },
61 {
62 "name": "score",
63 "type": "FLOAT",
64 "links": [
65 11,
66 13
67 ]
68 }
69 ],
70 "properties": {
71 "Node name for S&R": "HeyGenDecisionScore"
72 },
73 "widgets_values": [
74 "heygen-decision-1",
75 "Rate the technical quality of the image from 1 (worst) to 10 (best).",
76 6
77 ],
78 "widgets_values_named": {
79 "model": "heygen-decision-1",
80 "question": "Rate the technical quality of the image from 1 (worst) to 10 (best).",
81 "threshold": 6
82 },
83 "color": "#432",
84 "bgcolor": "#653"
85 },
86 {
87 "id": 3,
88 "type": "LoadImage",
89 "pos": [
90 770,
91 1370
92 ],
93 "size": [
94 360,
95 400
96 ],
97 "flags": [],
98 "order": 0,
99 "mode": 0,
100 "inputs": [],
101 "outputs": [
102 {
103 "name": "IMAGE",
104 "type": "IMAGE",
105 "links": [
106 3,
107 29,
108 34
109 ]
110 },
111 {
112 "name": "MASK",
113 "type": "MASK",
114 "links": null
115 }
116 ],
117 "properties": {
118 "Node name for S&R": "LoadImage"
119 },
120 "widgets_values": [
121 "cartoon_kid_inventor.png",
122 "image"
123 ],
124 "widgets_values_named": {
125 "image": "cartoon_kid_inventor.png",
126 "upload": "image"
127 }
128 },
129 {
130 "id": 4,
131 "type": "LoadImage",
132 "pos": [
133 280,
134 2430
135 ],
136 "size": [
137 410,
138 400
139 ],
140 "flags": [],
141 "order": 1,
142 "mode": 0,
143 "inputs": [],
144 "outputs": [
145 {
146 "name": "IMAGE",
147 "type": "IMAGE",
148 "links": [
149 24,
150 35
151 ]
152 },
153 {
154 "name": "MASK",
155 "type": "MASK",
156 "links": []
157 }
158 ],
159 "properties": {
160 "Node name for S&R": "LoadImage"
161 },
162 "widgets_values": [
163 "tiefling_sorcerer.png",
164 "image"
165 ],
166 "widgets_values_named": {
167 "image": "tiefling_sorcerer.png",
168 "upload": "image"
169 }
170 },
171 {
172 "id": 7,
173 "type": "PreviewAny",
174 "pos": [
175 1290,
176 1990
177 ],
178 "size": [
179 210,
180 130
181 ],
182 "flags": [],
183 "order": 8,
184 "mode": 0,
185 "inputs": [
186 {
187 "name": "source",
188 "type": "*",
189 "link": 10
190 }
191 ],
192 "outputs": [
193 {
194 "name": "STRING",
195 "type": "STRING",
196 "links": null
197 }
198 ],
199 "properties": {
200 "Node name for S&R": "PreviewAny"
201 },
202 "widgets_values": [],
203 "widgets_values_named": []
204 },
205 {
206 "id": 8,
207 "type": "PreviewAny",
208 "pos": [
209 1290,
210 2200
211 ],
212 "size": [
213 210,
214 130
215 ],
216 "flags": [],
217 "order": 9,
218 "mode": 0,
219 "inputs": [
220 {
221 "name": "source",
222 "type": "*",
223 "link": 11
224 }
225 ],
226 "outputs": [
227 {
228 "name": "STRING",
229 "type": "STRING",
230 "links": []
231 }
232 ],
233 "properties": {
234 "Node name for S&R": "PreviewAny"
235 },
236 "widgets_values": [],
237 "widgets_values_named": []
238 },
239 {
240 "id": 9,
241 "type": "ComfyMathExpression",
242 "pos": [
243 1670,
244 2210
245 ],
246 "size": [
247 400,
248 150
249 ],
250 "flags": [],
251 "order": 14,
252 "mode": 0,
253 "inputs": [
254 {
255 "name": "values.a",
256 "type": "FLOAT,INT,BOOLEAN",
257 "link": 13
258 },
259 {
260 "name": "values.b",
261 "shape": 7,
262 "type": "FLOAT,INT,BOOLEAN",
263 "link": 20
264 },
265 {
266 "name": "values.c",
267 "shape": 7,
268 "type": "FLOAT,INT,BOOLEAN",
269 "link": null
270 }
271 ],
272 "outputs": [
273 {
274 "name": "FLOAT",
275 "type": "FLOAT",
276 "links": null
277 },
278 {
279 "name": "INT",
280 "type": "INT",
281 "links": null
282 },
283 {
284 "name": "BOOL",
285 "type": "BOOLEAN",
286 "links": [
287 15
288 ]
289 }
290 ],
291 "properties": {
292 "Node name for S&R": "ComfyMathExpression"
293 },
294 "widgets_values": [
295 "a > b"
296 ],
297 "widgets_values_named": {
298 "expression": "a > b"
299 }
300 },
301 {
302 "id": 12,
303 "type": "ComfySwitchNode",
304 "pos": [
305 1740,
306 2430
307 ],
308 "size": [
309 270,
310 80
311 ],
312 "flags": [],
313 "order": 16,
314 "mode": 0,
315 "inputs": [
316 {
317 "name": "on_false",
318 "shape": 7,
319 "type": "IMAGE",
320 "link": 35
321 },
322 {
323 "name": "on_true",
324 "shape": 7,
325 "type": "IMAGE",
326 "link": 34
327 },
328 {
329 "name": "switch",
330 "type": "BOOLEAN",
331 "widget": {
332 "name": "switch"
333 },
334 "link": 15
335 }
336 ],
337 "outputs": [
338 {
339 "name": "output",
340 "type": "IMAGE",
341 "links": [
342 19
343 ]
344 }
345 ],
346 "properties": {
347 "Node name for S&R": "ComfySwitchNode"
348 },
349 "widgets_values": [
350 false
351 ],
352 "widgets_values_named": {
353 "switch": false
354 },
355 "color": "#322",
356 "bgcolor": "#533"
357 },
358 {
359 "id": 14,
360 "type": "PreviewImage",
361 "pos": [
362 2280,
363 2000
364 ],
365 "size": [
366 470,
367 740
368 ],
369 "flags": [],
370 "order": 17,
371 "mode": 0,
372 "inputs": [
373 {
374 "name": "images",
375 "type": "IMAGE",
376 "link": 19
377 }
378 ],
379 "outputs": [
380 {
381 "name": "images",
382 "type": "IMAGE",
383 "links": []
384 }
385 ],
386 "properties": {
387 "Node name for S&R": "PreviewImage"
388 }
389 },
390 {
391 "id": 15,
392 "type": "HeyGenDecisionScore",
393 "pos": [
394 740,
395 2440
396 ],
397 "size": [
398 400,
399 240
400 ],
401 "flags": [],
402 "order": 7,
403 "mode": 0,
404 "inputs": [
405 {
406 "name": "images.image_1",
407 "shape": 7,
408 "type": "IMAGE",
409 "link": 24
410 },
411 {
412 "name": "images.image_2",
413 "shape": 7,
414 "type": "IMAGE",
415 "link": null
416 },
417 {
418 "name": "audio_1",
419 "shape": 7,
420 "type": "AUDIO",
421 "link": null
422 },
423 {
424 "name": "video_1",
425 "shape": 7,
426 "type": "VIDEO",
427 "link": null
428 },
429 {
430 "name": "text",
431 "shape": 7,
432 "type": "STRING",
433 "link": null
434 }
435 ],
436 "outputs": [
437 {
438 "name": "result",
439 "type": "BOOLEAN",
440 "links": [
441 27
442 ]
443 },
444 {
445 "name": "score",
446 "type": "FLOAT",
447 "links": [
448 20,
449 28
450 ]
451 }
452 ],
453 "properties": {
454 "Node name for S&R": "HeyGenDecisionScore"
455 },
456 "widgets_values": [
457 "heygen-decision-1",
458 "Rate the technical quality of the image from 1 (worst) to 10 (best).",
459 6
460 ],
461 "widgets_values_named": {
462 "model": "heygen-decision-1",
463 "question": "Rate the technical quality of the image from 1 (worst) to 10 (best).",
464 "threshold": 6
465 },
466 "color": "#432",
467 "bgcolor": "#653"
468 },
469 {
470 "id": 16,
471 "type": "PreviewAny",
472 "pos": [
473 1890,
474 1290
475 ],
476 "size": [
477 210,
478 130
479 ],
480 "flags": [],
481 "order": 10,
482 "mode": 0,
483 "inputs": [
484 {
485 "name": "source",
486 "type": "*",
487 "link": 30
488 }
489 ],
490 "outputs": [
491 {
492 "name": "STRING",
493 "type": "STRING",
494 "links": []
495 }
496 ],
497 "properties": {
498 "Node name for S&R": "PreviewAny"
499 },
500 "widgets_values": [],
501 "widgets_values_named": []
502 },
503 {
504 "id": 17,
505 "type": "PreviewAny",
506 "pos": [
507 1890,
508 1490
509 ],
510 "size": [
511 210,
512 130
513 ],
514 "flags": [],
515 "order": 11,
516 "mode": 0,
517 "inputs": [
518 {
519 "name": "source",
520 "type": "*",
521 "link": 31
522 }
523 ],
524 "outputs": [
525 {
526 "name": "STRING",
527 "type": "STRING",
528 "links": []
529 }
530 ],
531 "properties": {
532 "Node name for S&R": "PreviewAny"
533 },
534 "widgets_values": [],
535 "widgets_values_named": []
536 },
537 {
538 "id": 18,
539 "type": "PreviewAny",
540 "pos": [
541 1890,
542 1690
543 ],
544 "size": [
545 210,
546 130
547 ],
548 "flags": [],
549 "order": 12,
550 "mode": 0,
551 "inputs": [
552 {
553 "name": "source",
554 "type": "*",
555 "link": 32
556 }
557 ],
558 "outputs": [
559 {
560 "name": "STRING",
561 "type": "STRING",
562 "links": []
563 }
564 ],
565 "properties": {
566 "Node name for S&R": "PreviewAny"
567 },
568 "widgets_values": [],
569 "widgets_values_named": []
570 },
571 {
572 "id": 19,
573 "type": "PreviewAny",
574 "pos": [
575 1290,
576 2610
577 ],
578 "size": [
579 210,
580 130
581 ],
582 "flags": [],
583 "order": 15,
584 "mode": 0,
585 "inputs": [
586 {
587 "name": "source",
588 "type": "*",
589 "link": 28
590 }
591 ],
592 "outputs": [
593 {
594 "name": "STRING",
595 "type": "STRING",
596 "links": []
597 }
598 ],
599 "properties": {
600 "Node name for S&R": "PreviewAny"
601 },
602 "widgets_values": [],
603 "widgets_values_named": []
604 },
605 {
606 "id": 20,
607 "type": "PreviewAny",
608 "pos": [
609 1290,
610 2410
611 ],
612 "size": [
613 210,
614 130
615 ],
616 "flags": [],
617 "order": 13,
618 "mode": 0,
619 "inputs": [
620 {
621 "name": "source",
622 "type": "*",
623 "link": 27
624 }
625 ],
626 "outputs": [
627 {
628 "name": "STRING",
629 "type": "STRING",
630 "links": []
631 }
632 ],
633 "properties": {
634 "Node name for S&R": "PreviewAny"
635 },
636 "widgets_values": [],
637 "widgets_values_named": []
638 },
639 {
640 "id": 21,
641 "type": "HeyGenDecisionYesNo",
642 "pos": [
643 1230,
644 1370
645 ],
646 "size": [
647 400,
648 240
649 ],
650 "flags": [],
651 "order": 6,
652 "mode": 0,
653 "inputs": [
654 {
655 "name": "images.image_1",
656 "shape": 7,
657 "type": "IMAGE",
658 "link": 29
659 },
660 {
661 "name": "images.image_2",
662 "shape": 7,
663 "type": "IMAGE",
664 "link": null
665 },
666 {
667 "name": "audio_1",
668 "shape": 7,
669 "type": "AUDIO",
670 "link": null
671 },
672 {
673 "name": "video_1",
674 "shape": 7,
675 "type": "VIDEO",
676 "link": null
677 },
678 {
679 "name": "text",
680 "shape": 7,
681 "type": "STRING",
682 "link": null
683 }
684 ],
685 "outputs": [
686 {
687 "name": "result",
688 "type": "BOOLEAN",
689 "links": [
690 30
691 ]
692 },
693 {
694 "name": "answer",
695 "type": "STRING",
696 "links": [
697 31
698 ]
699 },
700 {
701 "name": "probability",
702 "type": "FLOAT",
703 "links": [
704 32
705 ]
706 }
707 ],
708 "properties": {
709 "Node name for S&R": "HeyGenDecisionYesNo"
710 },
711 "widgets_values": [
712 "heygen-decision-1",
713 "Is there a person in the image?",
714 0.5
715 ],
716 "widgets_values_named": {
717 "model": "heygen-decision-1",
718 "question": "Is there a person in the image?",
719 "threshold": 0.5
720 },
721 "color": "#432",
722 "bgcolor": "#653"
723 },
724 {
725 "id": 24,
726 "type": "MarkdownNote",
727 "pos": [
728 280,
729 1400
730 ],
731 "size": [
732 410,
733 350
734 ],
735 "flags": [],
736 "order": 2,
737 "mode": 0,
738 "inputs": [],
739 "outputs": [],
740 "properties": [],
741 "widgets_values": [
742 "### Case 1 · one image, one verdict\n\n`Load Image → Decision (Yes/No) → Preview as Text`\n\nThe question is *\"Is there a person in the image?\"*. `probability` is the confidence in \"yes\"; `result`\nturns true once it clears the threshold (0.5 here).\n\nGood for publish-ready checks, subject facing the camera, clean background, watermark / logo detection,\ncontent gates. Change the question, run it, watch `probability` move — then wire `result` into a switch.\n"
743 ],
744 "widgets_values_named": {
745 "text": "### Case 1 · one image, one verdict\n\n`Load Image → Decision (Yes/No) → Preview as Text`\n\nThe question is *\"Is there a person in the image?\"*. `probability` is the confidence in \"yes\"; `result`\nturns true once it clears the threshold (0.5 here).\n\nGood for publish-ready checks, subject facing the camera, clean background, watermark / logo detection,\ncontent gates. Change the question, run it, watch `probability` move — then wire `result` into a switch.\n"
746 },
747 "color": "#222",
748 "bgcolor": "#000"
749 },
750 {
751 "id": 25,
752 "type": "MarkdownNote",
753 "pos": [
754 280,
755 2020
756 ],
757 "size": [
758 410,
759 310
760 ],
761 "flags": [],
762 "order": 3,
763 "mode": 0,
764 "inputs": [],
765 "outputs": [],
766 "properties": [],
767 "widgets_values": [
768 "### Case 2 · two images, scored and compared\n\nEach image gets its own 1–10 score against the same question; `Comfy Math Expression` compares the two floats\nand `If/Else Switch` passes the winner to `Preview Image`.\n\nRules you can drop into the expression: `a > b` (current) · `a < b` · `abs(a - b) > 1` (only when clearly\nbetter) · `a > 6 && a > b` (good in absolute terms *and* better). Both calls are billed — this is \"best of two\",\nworth it when the next step is far more expensive.\n"
769 ],
770 "widgets_values_named": {
771 "text": "### Case 2 · two images, scored and compared\n\nEach image gets its own 1–10 score against the same question; `Comfy Math Expression` compares the two floats\nand `If/Else Switch` passes the winner to `Preview Image`.\n\nRules you can drop into the expression: `a > b` (current) · `a < b` · `abs(a - b) > 1` (only when clearly\nbetter) · `a > 6 && a > b` (good in absolute terms *and* better). Both calls are billed — this is \"best of two\",\nworth it when the next step is far more expensive.\n"
772 },
773 "color": "#222",
774 "bgcolor": "#000"
775 },
776 {
777 "id": 22,
778 "type": "MarkdownNote",
779 "pos": [
780 -420,
781 1240
782 ],
783 "size": [
784 530,
785 580
786 ],
787 "flags": [],
788 "order": 4,
789 "mode": 0,
790 "inputs": [],
791 "outputs": [],
792 "properties": [],
793 "widgets_values": [
794 "# HeyGen Decision — two cases\n\nThe same partner node used two ways in one graph.\n\n- **Case 1 · one image, one verdict** — ask a yes/no question, read the boolean and the probability. The cheapest gate you can put in front of an expensive node.\n- **Case 2 · two images, scored and compared** — score both candidates, compare the numbers with a math rule, and let a switch pass the winner downstream.\n\nBoth cases run in one queue. These are API (partner) nodes: sign in with a Comfy account, or set an API key\n(Settings → API Keys → My API Key).\n\n## What the nodes return\n\n| Node | Outputs |\n| --- | --- |\n| **HeyGen Decision (Yes/No)** | `result` (BOOLEAN), `answer` (\"yes\"/\"no\"), `probability` (0–1) — flips at the threshold widget, 0.01–0.99 |\n| **HeyGen Decision (Score)** | `result` (BOOLEAN), `score` (1–10) — true when score ≥ threshold, 1–10 |\n\nConnect text (optional), up to **4 images** (`image_1…image_4`), one **audio** (`audio_1`) or one **video**\n(`video_1`, ≤60 s). Name them in the question, e.g. *\"Does image_2 show the same person as image_1?\"*\n\n## How to use\n\n1. Sign in, or paste an API key.\n2. Swap the demo images in the two `Load Image` nodes.\n3. Ask one thing per node, and phrase it so **\"yes\" is the case you act on**.\n4. Tune the threshold — raise it when a false positive is expensive.\n5. Route `result` into `If/Else Switch` (two branches) or into `Comfy Math Expression` + switch (a rule).\n\n**Cost** is per input token, so a short question or one image costs a fraction of a cent. Put the decision\n*before* the expensive step and put that step on the accepted branch — the rejected branch then costs nothing.\n"
795 ],
796 "widgets_values_named": {
797 "text": "# HeyGen Decision — two cases\n\nThe same partner node used two ways in one graph.\n\n- **Case 1 · one image, one verdict** — ask a yes/no question, read the boolean and the probability. The cheapest gate you can put in front of an expensive node.\n- **Case 2 · two images, scored and compared** — score both candidates, compare the numbers with a math rule, and let a switch pass the winner downstream.\n\nBoth cases run in one queue. These are API (partner) nodes: sign in with a Comfy account, or set an API key\n(Settings → API Keys → My API Key).\n\n## What the nodes return\n\n| Node | Outputs |\n| --- | --- |\n| **HeyGen Decision (Yes/No)** | `result` (BOOLEAN), `answer` (\"yes\"/\"no\"), `probability` (0–1) — flips at the threshold widget, 0.01–0.99 |\n| **HeyGen Decision (Score)** | `result` (BOOLEAN), `score` (1–10) — true when score ≥ threshold, 1–10 |\n\nConnect text (optional), up to **4 images** (`image_1…image_4`), one **audio** (`audio_1`) or one **video**\n(`video_1`, ≤60 s). Name them in the question, e.g. *\"Does image_2 show the same person as image_1?\"*\n\n## How to use\n\n1. Sign in, or paste an API key.\n2. Swap the demo images in the two `Load Image` nodes.\n3. Ask one thing per node, and phrase it so **\"yes\" is the case you act on**.\n4. Tune the threshold — raise it when a false positive is expensive.\n5. Route `result` into `If/Else Switch` (two branches) or into `Comfy Math Expression` + switch (a rule).\n\n**Cost** is per input token, so a short question or one image costs a fraction of a cent. Put the decision\n*before* the expensive step and put that step on the accepted branch — the rejected branch then costs nothing.\n"
798 },
799 "color": "#222",
800 "bgcolor": "#000"
801 }
802 ],
803 "links": [
804 [
805 10,
806 2,
807 0,
808 7,
809 0,
810 "BOOLEAN"
811 ],
812 [
813 11,
814 2,
815 1,
816 8,
817 0,
818 "FLOAT"
819 ],
820 [
821 15,
822 9,
823 2,
824 12,
825 2,
826 "BOOLEAN"
827 ],
828 [
829 19,
830 12,
831 0,
832 14,
833 0,
834 "IMAGE"
835 ],
836 [
837 27,
838 15,
839 0,
840 20,
841 0,
842 "BOOLEAN"
843 ],
844 [
845 28,
846 15,
847 1,
848 19,
849 0,
850 "FLOAT"
851 ],
852 [
853 30,
854 21,
855 0,
856 16,
857 0,
858 "BOOLEAN"
859 ],
860 [
861 31,
862 21,
863 1,
864 17,
865 0,
866 "STRING"
867 ],
868 [
869 32,
870 21,
871 2,
872 18,
873 0,
874 "FLOAT"
875 ],
876 [
877 34,
878 3,
879 0,
880 12,
881 1,
882 "IMAGE"
883 ],
884 [
885 35,
886 4,
887 0,
888 12,
889 0,
890 "IMAGE"
891 ],
892 [
893 3,
894 3,
895 0,
896 2,
897 0,
898 "IMAGE"
899 ],
900 [
901 13,
902 2,
903 1,
904 9,
905 0,
906 "FLOAT"
907 ],
908 [
909 20,
910 15,
911 1,
912 9,
913 1,
914 "FLOAT"
915 ],
916 [
917 24,
918 4,
919 0,
920 15,
921 0,
922 "IMAGE"
923 ],
924 [
925 29,
926 3,
927 0,
928 21,
929 0,
930 "IMAGE"
931 ]
932 ],
933 "groups": [
934 {
935 "id": 1,
936 "title": "Case 1 · One image, one verdict",
937 "bounding": [
938 210,
939 1200,
940 2610,
941 670
942 ],
943 "color": "#3f789e",
944 "flags": []
945 },
946 {
947 "id": 2,
948 "title": "Case 2 · Two images, scored and compared",
949 "bounding": [
950 210,
951 1890,
952 2612.690699489064,
953 1180
954 ],
955 "color": "#3f789e",
956 "flags": []
957 },
958 {
959 "id": 3,
960 "title": "Dispatch · math rule picks the winner",
961 "bounding": [
962 1620,
963 2110,
964 510,
965 480
966 ],
967 "color": "#3f789e",
968 "flags": []
969 }
970 ],
971 "config": [],
972 "extra": {
973 "ds": {
974 "scale": 0.3833354836973329,
975 "offset": [
976 1429.0371560122658,
977 -707.7022981703481
978 ]
979 },
980 "frontendVersion": "1.59.10"
981 },
982 "version": 0.4
983}