工作流 /
产品与广告 /
产品广告替换

产品广告替换
Swap Product Into a Reference AD
以参考广告风格为你的产品创建静态广告
产品与广告
10 个节点 2 个输入 20 次使用 ComfyUI ≥ 0.8.0 hellorob 14 KB
节点构成
LoadImage
× 2
PrimitiveStringMultiline
× 2
ImageBatch
× 1
GetImageSize
× 1
ResizeAndPadImage
× 1
RegexReplace
× 1
SaveImage
× 1
GeminiImage2Node
× 1
官方标注的模型
Gemini3 Pro Image PreviewNano Banana ProGoogleByteDanceSeedance
工作流 JSON
和上面「下载工作流 JSON」是同一份文件。
1{
2 "id": "c28dc1c5-217d-4ee0-8baf-1929aaf5162e",
3 "revision": 0,
4 "last_node_id": 18,
5 "last_link_id": 29,
6 "nodes": [
7 {
8 "id": 18,
9 "type": "ImageBatch",
10 "pos": [
11 13173.13786277583,
12 470
13 ],
14 "size": [
15 186.8621372241705,
16 54.07495555706066
17 ],
18 "flags": {
19 "collapsed": false
20 },
21 "order": 7,
22 "mode": 0,
23 "inputs": [
24 {
25 "name": "image1",
26 "type": "IMAGE",
27 "link": 27
28 },
29 {
30 "name": "image2",
31 "type": "IMAGE",
32 "link": 28
33 }
34 ],
35 "outputs": [
36 {
37 "name": "IMAGE",
38 "type": "IMAGE",
39 "links": [
40 24
41 ]
42 }
43 ],
44 "properties": {
45 "cnr_id": "comfy-core",
46 "ver": "0.3.76",
47 "Node name for S&R": "ImageBatch",
48 "enableTabs": false,
49 "tabWidth": 65,
50 "tabXOffset": 10,
51 "hasSecondTab": false,
52 "secondTabText": "Send Back",
53 "secondTabOffset": 80,
54 "secondTabWidth": 65
55 },
56 "widgets_values": []
57 },
58 {
59 "id": 2,
60 "type": "LoadImage",
61 "pos": [
62 12500,
63 930
64 ],
65 "size": [
66 277.7486114575398,
67 401.9161721263047
68 ],
69 "flags": [],
70 "order": 0,
71 "mode": 0,
72 "inputs": [],
73 "outputs": [
74 {
75 "name": "IMAGE",
76 "type": "IMAGE",
77 "links": [
78 19
79 ]
80 },
81 {
82 "name": "MASK",
83 "type": "MASK",
84 "links": null
85 }
86 ],
87 "title": "Load Product Image",
88 "properties": {
89 "cnr_id": "comfy-core",
90 "ver": "0.3.76",
91 "Node name for S&R": "LoadImage",
92 "enableTabs": false,
93 "tabWidth": 65,
94 "tabXOffset": 10,
95 "hasSecondTab": false,
96 "secondTabText": "Send Back",
97 "secondTabOffset": 80,
98 "secondTabWidth": 65
99 },
100 "widgets_values": [
101 "comfy_gpu.png",
102 "image"
103 ]
104 },
105 {
106 "id": 1,
107 "type": "LoadImage",
108 "pos": [
109 12500.645333985722,
110 463.0647416496788
111 ],
112 "size": [
113 268.375511297599,
114 386.8404557997061
115 ],
116 "flags": [],
117 "order": 1,
118 "mode": 0,
119 "inputs": [],
120 "outputs": [
121 {
122 "name": "IMAGE",
123 "type": "IMAGE",
124 "links": [
125 18,
126 27
127 ]
128 },
129 {
130 "name": "MASK",
131 "type": "MASK",
132 "links": null
133 }
134 ],
135 "title": "Load Ad Image",
136 "properties": {
137 "cnr_id": "comfy-core",
138 "ver": "0.3.76",
139 "Node name for S&R": "LoadImage",
140 "enableTabs": false,
141 "tabWidth": 65,
142 "tabXOffset": 10,
143 "hasSecondTab": false,
144 "secondTabText": "Send Back",
145 "secondTabOffset": 80,
146 "secondTabWidth": 65
147 },
148 "widgets_values": [
149 "reference_ad.png",
150 "image"
151 ]
152 },
153 {
154 "id": 17,
155 "type": "GetImageSize",
156 "pos": [
157 12840,
158 470
159 ],
160 "size": [
161 220,
162 136
163 ],
164 "flags": {
165 "collapsed": true
166 },
167 "order": 4,
168 "mode": 0,
169 "inputs": [
170 {
171 "name": "image",
172 "type": "IMAGE",
173 "link": 18
174 }
175 ],
176 "outputs": [
177 {
178 "name": "width",
179 "type": "INT",
180 "links": [
181 16
182 ]
183 },
184 {
185 "name": "height",
186 "type": "INT",
187 "links": [
188 17
189 ]
190 },
191 {
192 "name": "batch_size",
193 "type": "INT",
194 "links": null
195 }
196 ],
197 "properties": {
198 "cnr_id": "comfy-core",
199 "ver": "0.3.76",
200 "Node name for S&R": "GetImageSize",
201 "enableTabs": false,
202 "tabWidth": 65,
203 "tabXOffset": 10,
204 "hasSecondTab": false,
205 "secondTabText": "Send Back",
206 "secondTabOffset": 80,
207 "secondTabWidth": 65
208 },
209 "widgets_values": []
210 },
211 {
212 "id": 16,
213 "type": "ResizeAndPadImage",
214 "pos": [
215 12840,
216 540
217 ],
218 "size": [
219 210,
220 122
221 ],
222 "flags": {
223 "collapsed": true
224 },
225 "order": 6,
226 "mode": 0,
227 "inputs": [
228 {
229 "name": "image",
230 "type": "IMAGE",
231 "link": 19
232 },
233 {
234 "name": "target_width",
235 "type": "INT",
236 "widget": {
237 "name": "target_width"
238 },
239 "link": 16
240 },
241 {
242 "name": "target_height",
243 "type": "INT",
244 "widget": {
245 "name": "target_height"
246 },
247 "link": 17
248 }
249 ],
250 "outputs": [
251 {
252 "name": "IMAGE",
253 "type": "IMAGE",
254 "links": [
255 28
256 ]
257 }
258 ],
259 "properties": {
260 "cnr_id": "comfy-core",
261 "ver": "0.3.76",
262 "Node name for S&R": "ResizeAndPadImage",
263 "enableTabs": false,
264 "tabWidth": 65,
265 "tabXOffset": 10,
266 "hasSecondTab": false,
267 "secondTabText": "Send Back",
268 "secondTabOffset": 80,
269 "secondTabWidth": 65
270 },
271 "widgets_values": [
272 512,
273 512,
274 "white",
275 "area"
276 ]
277 },
278 {
279 "id": 11,
280 "type": "PrimitiveStringMultiline",
281 "pos": [
282 12840,
283 740
284 ],
285 "size": [
286 210,
287 110
288 ],
289 "flags": {
290 "collapsed": true
291 },
292 "order": 2,
293 "mode": 0,
294 "inputs": [],
295 "outputs": [
296 {
297 "name": "STRING",
298 "type": "STRING",
299 "links": [
300 13
301 ]
302 }
303 ],
304 "title": "Prompt Template",
305 "properties": {
306 "cnr_id": "comfy-core",
307 "ver": "0.3.76",
308 "Node name for S&R": "PrimitiveStringMultiline",
309 "enableTabs": false,
310 "tabWidth": 65,
311 "tabXOffset": 10,
312 "hasSecondTab": false,
313 "secondTabText": "Send Back",
314 "secondTabOffset": 80,
315 "secondTabWidth": 65
316 },
317 "widgets_values": [
318 "Objective: Create a composite commercial image by synthesizing layout inputs with subject inputs. Target Product: {user_input}\n\n1. Inputs\nReference Input 1 (Style & Layout): Acts as the strict structural blueprint. This dictates composition, graphic elements, lighting direction, and text layout.\n\nReference Input 2 (Subject): Provides the primary subject matter (product shape, texture, branding).\n\n2. Execution Instructions\nPhase A: Scene & Design Analysis\nEnvironmental Scan: Analyze the perspective, depth, and lighting environment of [Input 1].\n\nDNA Deconstruction: Identify font styles, graphic shapes, and specific noise/grain levels.\n\nPhase B: Object Replacement\nRemoval: Remove the main product currently featured in [Input 1].\n\nInsertion: Insert the product isolated from [Input 2] into the exact focal point and scale defined by the original layout.\n\nPhase C: Text Modification (Content & Style)\nCondition Check: Analyze [Input 1] for existing Copy text elements (excluding text physically on the product).\n\nIf Copy Text Exists: Replace the existing copy with text relevant to the target product. You must replicate the exact font, weight, kerning, and drop-shadows of the original.\n\nIf No Copy Text Exists: Strictly do not generate any text. Preserve the negative space exactly as it appears in [Input 1].\n\nPhase D: Harmonize & Finish\nLighting: Adjust lighting, cast shadows, and reflections on the inserted product to match the environment.\n\nTexture: Apply the original image's texture (film grain, halftone, print artifacts) to the new elements to ensure a cohesive \"print ad\" look.\n\n3. Final Output\nAspect Ratio: Must match Input 1.\n\nQuality: A seamless, professional advertisement where the design layout is preserved, but the subject and color story are synthesized according to the user's preference."
319 ]
320 },
321 {
322 "id": 14,
323 "type": "RegexReplace",
324 "pos": [
325 13150,
326 690
327 ],
328 "size": [
329 210,
330 292
331 ],
332 "flags": {
333 "collapsed": false
334 },
335 "order": 5,
336 "mode": 0,
337 "inputs": [
338 {
339 "name": "string",
340 "type": "STRING",
341 "widget": {
342 "name": "string"
343 },
344 "link": 13
345 },
346 {
347 "name": "replace",
348 "type": "STRING",
349 "widget": {
350 "name": "replace"
351 },
352 "link": 15
353 }
354 ],
355 "outputs": [
356 {
357 "name": "STRING",
358 "type": "STRING",
359 "links": [
360 29
361 ]
362 }
363 ],
364 "properties": {
365 "cnr_id": "comfy-core",
366 "ver": "0.3.76",
367 "Node name for S&R": "RegexReplace",
368 "enableTabs": false,
369 "tabWidth": 65,
370 "tabXOffset": 10,
371 "hasSecondTab": false,
372 "secondTabText": "Send Back",
373 "secondTabOffset": 80,
374 "secondTabWidth": 65
375 },
376 "widgets_values": [
377 "",
378 "{user_input}",
379 "",
380 true,
381 false,
382 false,
383 0
384 ]
385 },
386 {
387 "id": 15,
388 "type": "PrimitiveStringMultiline",
389 "pos": [
390 12830,
391 820
392 ],
393 "size": [
394 289.7916666666667,
395 319.58333333333337
396 ],
397 "flags": [],
398 "order": 3,
399 "mode": 0,
400 "inputs": [],
401 "outputs": [
402 {
403 "name": "STRING",
404 "type": "STRING",
405 "links": [
406 15
407 ]
408 }
409 ],
410 "title": "Describe the Product and Ad Copy",
411 "properties": {
412 "cnr_id": "comfy-core",
413 "ver": "0.3.76",
414 "Node name for S&R": "PrimitiveStringMultiline",
415 "enableTabs": false,
416 "tabWidth": 65,
417 "tabXOffset": 10,
418 "hasSecondTab": false,
419 "secondTabText": "Send Back",
420 "secondTabOffset": 80,
421 "secondTabWidth": 65
422 },
423 "widgets_values": [
424 "A ComfyUI branded RTX PRO 6000. This ad is promoting Comfy Cloud. The header 1 says \"The Comfy Cloud\". The smaller copy should inform that Comfy Cloud switched to Blackwell RTX 6000 Pros, which are approimately twice as fast as A100s. They also have 96GB of VRAM and 180GB of RAM, which will unlock much heavier workflows such as video upscaling."
425 ],
426 "color": "#232",
427 "bgcolor": "#353"
428 },
429 {
430 "id": 9,
431 "type": "SaveImage",
432 "pos": [
433 13960,
434 470
435 ],
436 "size": [
437 540,
438 890
439 ],
440 "flags": [],
441 "order": 9,
442 "mode": 0,
443 "inputs": [
444 {
445 "name": "images",
446 "type": "IMAGE",
447 "link": 10
448 }
449 ],
450 "outputs": [],
451 "properties": {
452 "cnr_id": "comfy-core",
453 "ver": "0.3.76",
454 "enableTabs": false,
455 "tabWidth": 65,
456 "tabXOffset": 10,
457 "hasSecondTab": false,
458 "secondTabText": "Send Back",
459 "secondTabOffset": 80,
460 "secondTabWidth": 65
461 },
462 "widgets_values": [
463 "ComfyUI"
464 ]
465 },
466 {
467 "id": 3,
468 "type": "GeminiImage2Node",
469 "pos": [
470 13550,
471 470
472 ],
473 "size": [
474 384.2057291666667,
475 373.33333333333337
476 ],
477 "flags": [],
478 "order": 8,
479 "mode": 0,
480 "inputs": [
481 {
482 "name": "images",
483 "shape": 7,
484 "type": "IMAGE",
485 "link": 24
486 },
487 {
488 "name": "files",
489 "shape": 7,
490 "type": "GEMINI_INPUT_FILES",
491 "link": null
492 },
493 {
494 "name": "prompt",
495 "type": "STRING",
496 "widget": {
497 "name": "prompt"
498 },
499 "link": 29
500 }
501 ],
502 "outputs": [
503 {
504 "name": "IMAGE",
505 "type": "IMAGE",
506 "links": [
507 10
508 ]
509 },
510 {
511 "name": "STRING",
512 "type": "STRING",
513 "links": null
514 }
515 ],
516 "properties": {
517 "cnr_id": "comfy-core",
518 "ver": "0.3.76",
519 "Node name for S&R": "GeminiImage2Node",
520 "enableTabs": false,
521 "tabWidth": 65,
522 "tabXOffset": 10,
523 "hasSecondTab": false,
524 "secondTabText": "Send Back",
525 "secondTabOffset": 80,
526 "secondTabWidth": 65
527 },
528 "widgets_values": [
529 "",
530 "gemini-3-pro-image-preview",
531 611482562925396,
532 "randomize",
533 "auto",
534 "4K",
535 "IMAGE+TEXT",
536 "You are an expert image-generation engine. You must ALWAYS produce an image.\nInterpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition.\nIf a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept.\nPrioritize generating the visual representation above any text, formatting, or conversational requests."
537 ],
538 "color": "#432",
539 "bgcolor": "#653"
540 }
541 ],
542 "links": [
543 [
544 10,
545 3,
546 0,
547 9,
548 0,
549 "IMAGE"
550 ],
551 [
552 13,
553 11,
554 0,
555 14,
556 0,
557 "STRING"
558 ],
559 [
560 15,
561 15,
562 0,
563 14,
564 1,
565 "STRING"
566 ],
567 [
568 16,
569 17,
570 0,
571 16,
572 1,
573 "INT"
574 ],
575 [
576 17,
577 17,
578 1,
579 16,
580 2,
581 "INT"
582 ],
583 [
584 18,
585 1,
586 0,
587 17,
588 0,
589 "IMAGE"
590 ],
591 [
592 19,
593 2,
594 0,
595 16,
596 0,
597 "IMAGE"
598 ],
599 [
600 24,
601 18,
602 0,
603 3,
604 0,
605 "IMAGE"
606 ],
607 [
608 27,
609 1,
610 0,
611 18,
612 0,
613 "IMAGE"
614 ],
615 [
616 28,
617 16,
618 0,
619 18,
620 1,
621 "IMAGE"
622 ],
623 [
624 29,
625 14,
626 0,
627 3,
628 2,
629 "STRING"
630 ]
631 ],
632 "groups": [],
633 "config": [],
634 "extra": {
635 "ds": {
636 "scale": 0.8404357701300693,
637 "offset": [
638 -12217.463532297625,
639 -159.29895968199293
640 ]
641 },
642 "frontendVersion": "1.39.19",
643 "workflowRendererVersion": "LG",
644 "VHS_latentpreview": false,
645 "VHS_latentpreviewrate": 0,
646 "VHS_MetadataImage": true,
647 "VHS_KeepIntermediate": true
648 },
649 "version": 0.4
650}