海報場景樣機
上傳海報或廣告設計,並輸入你的品牌簡介,產生4個不同場景的海報樣機。
關於
The 'Poster Scene Mockups' workflow is designed to streamline the process of creating realistic mockups for poster or advertisement designs. By leveraging the power of AI models such as Nano Banana Pro and Google, this workflow allows users to input a design and a brief description of their brand to generate four distinct mockups in various scenes.
The workflow utilizes a series of nodes, including the GeminiImage2Node for image processing, LoadImage for uploading the initial design, and SaveImage for storing the final mockups. The comfyui_essentials custom nodes are integral to this workflow, providing additional functionalities that enhance the image editing and mockup generation process.
Technically, the workflow begins with the LoadImage node, which imports the user's design. The PrimitiveStringMultiline node captures the brand description, which is then processed alongside the design through nodes like RegexReplace and ResizeAndPadImage to ensure the mockups are correctly formatted and visually appealing. The ImageBatch and ImageFromBatch nodes are used to handle multiple images efficiently, while SimpleMath+ and GetImageSize help in adjusting dimensions and scaling.
This workflow is particularly useful for designers and marketers looking to quickly visualize how their posters will appear in real-world settings, saving time and resources in the mockup creation process.
您提供的內容
- 正在讀取工作流程
在 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
- 您的檔案
- 由程式碼透過其 URL 上傳
需要付費 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": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "2:3",
"images": [
"2",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": [
"41",
0
],
"resolution": "4K",
"response_modalities": "IMAGE",
"seed": 333,
"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)"
}
},
"2": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Poster Image"
}
},
"3": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_stitched",
"images": [
"1",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"18": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 0
},
"_meta": {
"title": "Crop Inset Grid Images"
}
},
"20": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_1",
"images": [
"19:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"21": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_2",
"images": [
"19:9",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"22": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_3",
"images": [
"19:10",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"23": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_4",
"images": [
"19:11",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"24": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Create a 2x2 grid composition featuring four distinct, high-quality mockups. Populate each of the four panels by integrating the poster shown in image 1 (maintain the input posters aspect ratio) into various {type}.\n\nThe entire grid must strictly adhere to a {aesthetic} aesthetic.\n\nApply coordinated {lighting} across all four scenarios to ensure visual consistency. Ensure the scenes in each panel are varied use-cases and look authentic to the chosen medium."
},
"_meta": {
"title": "Prompt Template"
}
},
"25": {
"class_type": "RegexReplace",
"inputs": {
"case_insensitive": True,
"count": 0,
"dotall": False,
"multiline": False,
"regex_pattern": "{type}",
"replace": [
"26",
0
],
"string": [
"24",
0
]
},
"_meta": {
"title": "Replace Text (Regex)"
}
},
"26": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "billboards"
},
"_meta": {
"title": "Describe the Mockup Medium"
}
},
"27": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "minimalist in a clean neutral toned environment"
},
"_meta": {
"title": "Describe the Aesthetic"
}
},
"28": {
"class_type": "RegexReplace",
"inputs": {
"case_insensitive": True,
"count": 0,
"dotall": False,
"multiline": False,
"regex_pattern": "{aesthetic}",
"replace": [
"27",
0
],
"string": [
"25",
0
]
},
"_meta": {
"title": "Replace Text (Regex)"
}
},
"30": {
"class_type": "ResizeAndPadImage",
"inputs": {
"image": [
"2",
0
],
"interpolation": "area",
"padding_color": "white",
"target_height": [
"34",
1
],
"target_width": [
"34",
0
]
},
"_meta": {
"title": "Resize And Pad Image"
}
},
"31": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"32",
0
],
"image2": [
"30",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"32": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": [
"33",
0
],
"image": [
"19:19",
0
],
"length": 1
},
"_meta": {
"title": "Get Image from Batch"
}
},
"33": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"36",
0
],
"b": 0,
"value": "a - 1"
},
"_meta": {
"title": "Image # as index"
}
},
"34": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"32",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"35": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "auto",
"images": [
"31",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": "Upscale image 1. Use the poster from image 2 as a reference to fix the text.",
"resolution": "4K",
"response_modalities": "IMAGE+TEXT",
"seed": 54321,
"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)"
}
},
"36": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1
},
"_meta": {
"title": "Select Image #"
}
},
"37": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_upscaled",
"images": [
"35",
0
]
},
"_meta": {
"title": "Save Upscaled Image"
}
},
"40": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "high-contrast studio lighting"
},
"_meta": {
"title": "Describe the Lighting"
}
},
"41": {
"class_type": "RegexReplace",
"inputs": {
"case_insensitive": True,
"count": 0,
"dotall": False,
"multiline": False,
"regex_pattern": "{lighting}",
"replace": [
"40",
0
],
"string": [
"28",
0
]
},
"_meta": {
"title": "Replace Text (Regex)"
}
},
"19:10": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"19:16",
0
],
"image": [
"1",
0
],
"width": [
"19:15",
0
],
"x": 0,
"y": [
"19:12",
0
]
},
"_meta": {
"title": "3"
}
},
"19:11": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"19:16",
0
],
"image": [
"1",
0
],
"width": [
"19:15",
0
],
"x": [
"19:13",
0
],
"y": [
"19:12",
0
]
},
"_meta": {
"title": "4"
}
},
"19:12": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"19:16",
0
],
"b": [
"19:14",
0
],
"value": "a + b"
},
"_meta": {
"title": "Row 2 - Y val"
}
},
"19:13": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"19:15",
0
],
"b": [
"19:14",
0
],
"value": "a + b"
},
"_meta": {
"title": "Col 2 - X val"
}
},
"19:14": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"18",
0
],
"b": 0,
"value": "a*2"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"19:15": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"19:17",
0
],
"b": [
"19:14",
0
],
"value": "(a-2*b) / 2"
},
"_meta": {
"title": "WIDTH"
}
},
"19:16": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"19:17",
1
],
"b": [
"19:14",
0
],
"value": "(a-2*b) / 2"
},
"_meta": {
"title": "HEIGHT"
}
},
"19:17": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"1",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"19:19": {
"class_type": "ImageBatchMulti",
"inputs": {
"image_1": [
"19:8",
0
],
"image_2": [
"19:9",
0
],
"image_3": [
"19:10",
0
],
"image_4": [
"19:11",
0
],
"inputcount": 4
},
"_meta": {
"title": "Image Batch Multi"
}
},
"19:4": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"19:8",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"19:5": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"19:9",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"19:6": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"19:10",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"19:7": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"19:11",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"19:8": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"19:16",
0
],
"image": [
"1",
0
],
"width": [
"19:15",
0
],
"x": 0,
"y": 0
},
"_meta": {
"title": "1"
}
},
"19:9": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"19:16",
0
],
"image": [
"1",
0
],
"width": [
"19:15",
0
],
"x": [
"19:13",
0
],
"y": 0
},
"_meta": {
"title": "2"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("2", "image", client.assets.from_url("https://example.com/replace-with-a-url/image"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
The LoadImage node supports common image formats such as JPEG, PNG, and TIFF for uploading your poster design.
You can install the required custom nodes by following the guide available at the ComfyUI documentation or visiting the respective GitHub repositories linked in the author notes.
Currently, the scenes are generated based on pre-defined settings in the workflow. Customization options may be added in future updates.
Ensure that your input design is properly formatted and that the brand description is clear. You may also want to adjust the image size settings in the workflow.
相關工作流程
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Nano Banana Pro
Try an outfit on a character
- Nano Banana Pro
Sharpen a product photo
- Nano Banana Pro, Google
1.3 入門-產品攝影
- Flux.2 Dev, Flux.2 Klein, GPT-Image-1.5, Grok, Nano Banana Pro, Qwen-Image-Edit, Seedream
1個輸入與多個編輯模型對比
- Gemini3 Pro Image Preview, Google, Nano Banana Pro
3x3 品牌圖示素材網格
- Nano Banana Pro, Google
3x3產品廣告產生
- Kling, Google, Nano Banana Pro, Gemini3 Pro Image Preview
LED廣告牌資訊
- Gemini3 Pro Image Preview, Google, Nano Banana Pro
Nano Banana Pro
- Gemini3 Pro Image Preview, Google, Nano Banana Pro
Nano Banana Pro:風格化藝術創意放大
- Google, Nano Banana Pro
Upscale:使用 Nano Banana Pro 進行 AI 圖像增強
- Nano Banana Pro
YouTube 縮圖產生器