Poster Scene Mockups
Upload a poster/ad design and with a short input about your brand, generate 4 mockups in multiple scenes.
About
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.
What you provide
- Reading the workflow
Runs in ComfyUI. This workflow can't run on this page. Open it in Comfy Cloud with everything loaded, or download it for your own ComfyUI.
Try in CloudInside the workflow
A read-only preview of the node graph. Open it in Comfy Cloud or download it to edit the nodes.
Loading the graph
Open full-size workflow preview- Author
- Rob
Requires custom nodes
- Reading the workflow
Use this workflow from code
Generated from the workflow graph and inputs when possible; stored examples are shown otherwise. Review credentials and endpoints before running code, which may incur charges.
What you need
- Runs on
- Comfy Cloud
- Key
- COMFY_API_KEY
- Your files
- Uploaded by the code from their urls
Needs a paid Cloud plan and credits.
# 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)Questions & answers
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.