제품 광고 교체
참고 광고 스타일로 제품의 정지 광고를 만드세요
정보
이 ComfyUI 워크플로는 'Swap Product Into a Reference AD'라는 제목으로, 레퍼런스 광고의 스타일에 제품을 정밀하게 통합해 설득력 있는 정적 광고 이미지를 만들도록 설계되었습니다. Gemini3 Pro Image Preview 및 Nano Banana Pro 같은 고급 이미지 처리 노드와 모델을 활용하여 스타일 전이와 제품 배치를 정밀하게 처리합니다. 워크플로는 LoadImage 노드로 이미지를 로드하는 것에서 시작하며, 이 이미지는 레퍼런스 스타일로 사용됩니다. GeminiImage2Node가 제품 이미지를 처리해 레퍼런스 광고의 스타일 요소와 정렬합니다. RegexReplace 노드는 텍스트 요소를 조정하는 데 사용할 수 있어, 최종 출력이 원하는 미적 일관성을 유지하도록 돕습니다. ResizeAndPadImage 노드는 제품 이미지가 광고 크기에 맞게 정확히 들어가도록 보정하며, SaveImage 노드로 최종 결과를 쉽게 저장할 수 있습니다. 이 워크플로는 빠르게 시각적으로 일관된 광고를 만들어야 하는 마케터와 디자이너에게 특히 유용합니다.
제공할 항목
- 워크플로 읽는 중
ComfyUI에서 실행됩니다. 이 워크플로는 이 페이지에서 실행할 수 없습니다. 모든 항목이 로드된 Comfy Cloud에서 열거나, 자체 ComfyUI에서 사용하려면 다운로드하세요.
Cloud에서 사용해 보기워크플로 내부
노드 그래프의 읽기 전용 미리보기입니다. 노드를 편집하려면 Comfy Cloud에서 열거나 다운로드하세요.
Loading the graph
Open full-size workflow preview- 작성자
- Rob
사용자 지정 노드 필요
- 워크플로 읽는 중
코드에서 이 워크플로 사용하기
가능한 경우 워크플로 그래프와 입력을 기반으로 생성되며, 그렇지 않은 경우 저장된 예시가 표시됩니다. 비용이 발생할 수 있으므로 코드를 실행하기 전에 자격 증명과 엔드포인트를 검토하세요.
What you need
- Runs on
- Comfy Cloud
- 키
- COMFY_API_KEY
유료 Cloud 요금제와 크레딧이 필요합니다.
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"1": {
"class_type": "LoadImage",
"inputs": {
"image": "reference_ad.png"
},
"_meta": {
"title": "Load Ad Image"
}
},
"2": {
"class_type": "LoadImage",
"inputs": {
"image": "comfy_gpu.png"
},
"_meta": {
"title": "Load Product Image"
}
},
"3": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "auto",
"images": [
"18",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": [
"14",
0
],
"resolution": "4K",
"response_modalities": "IMAGE+TEXT",
"seed": 611482562925396,
"system_prompt": "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."
},
"_meta": {
"title": "Nano Banana Pro (Google Gemini Image)"
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"3",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"11": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "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."
},
"_meta": {
"title": "Prompt Template"
}
},
"14": {
"class_type": "RegexReplace",
"inputs": {
"case_insensitive": True,
"count": 0,
"dotall": False,
"multiline": False,
"regex_pattern": "{user_input}",
"replace": [
"15",
0
],
"string": [
"11",
0
]
},
"_meta": {
"title": "Replace Text (Regex)"
}
},
"15": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "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."
},
"_meta": {
"title": "Describe the Product and Ad Copy"
}
},
"16": {
"class_type": "ResizeAndPadImage",
"inputs": {
"image": [
"2",
0
],
"interpolation": "area",
"padding_color": "white",
"target_height": [
"17",
1
],
"target_width": [
"17",
0
]
},
"_meta": {
"title": "Resize And Pad Image"
}
},
"17": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"1",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"18": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"1",
0
],
"image2": [
"16",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)질문과 답변
네. 워크플로는 다양한 제품 이미지에서 동작하도록 설계되어 있습니다. 다만 입력 이미지의 품질과 해상도에 따라 결과는 달라질 수 있습니다.
ResizeAndPadImage 노드가 제품 이미지를 광고 크기에 맞추는 데 핵심입니다. 최적의 맞춤을 위해 여러 설정을 실험해야 할 수 있습니다.
RegexReplace 노드를 사용해 광고 내 텍스트 요소를 수정하여 최종 출력이 브랜드 메시지와 일치하도록 하세요.
네. ImageBatch 노드를 사용하면 여러 이미지를 동시에 처리할 수 있어 여러 광고를 만드는 과정을 간소화할 수 있습니다.