Mockups de Cena de Pôster
Carregue um design de pôster/anúncio e com uma breve entrada sobre sua marca, gere 4 mockups em múltiplas cenas.
Sobre
O fluxo 'Mockups de Cena para Poster' foi criado para agilizar a criação de mockups realistas para designs de poster ou anúncios. Utilizando modelos de IA como Nano Banana Pro e Google, este fluxo permite que o usuário envie um design e uma breve descrição da marca para gerar quatro mockups distintos em diferentes cenas. O fluxo utiliza uma série de nós, incluindo GeminiImage2Node para processamento de imagem, LoadImage para upload do design inicial e SaveImage para salvar os mockups finais. Os nós personalizados comfyui_essentials são essenciais neste fluxo, oferecendo funcionalidades adicionais que aprimoram a edição de imagem e a geração dos mockups.
Tecnicamente, o fluxo começa com o nó LoadImage, que importa o design do usuário. O nó PrimitiveStringMultiline captura a descrição da marca, que é processada junto ao design por nós como RegexReplace e ResizeAndPadImage para garantir que os mockups estejam corretamente formatados e visualmente atraentes. Os nós ImageBatch e ImageFromBatch são usados para lidar com múltiplas imagens de forma eficiente, enquanto SimpleMath+ e GetImageSize ajudam no ajuste de dimensões e escala. Este fluxo é especialmente útil para designers e profissionais de marketing que precisam visualizar rapidamente como seus posters aparecerão em ambientes reais, economizando tempo e recursos na criação de mockups.
O que você fornece
- Lendo o fluxo de trabalho
É executado no ComfyUI. Este fluxo de trabalho não pode ser executado nesta página. Abra-o no Comfy Cloud com tudo carregado ou baixe-o para usar no seu próprio ComfyUI.
Experimentar no CloudDentro do workflow
Uma prévia somente leitura do gráfico de nós. Abra-o no Comfy Cloud ou faça o download para editar os nós.
Loading the graph
Open full-size workflow preview- Autor
- Rob
Requer nós personalizados
- Lendo o fluxo de trabalho
Use este fluxo de trabalho a partir do código
Gerado a partir do grafo e das entradas do fluxo de trabalho quando possível; caso contrário, são exibidos exemplos armazenados. Revise as credenciais e os endpoints antes de executar o código, pois isso pode gerar cobranças.
What you need
- Runs on
- Comfy Cloud
- Chave
- COMFY_API_KEY
- Seus arquivos
- Enviados pelo código a partir de suas URLs
Requer um plano pago do Cloud e créditos.
# 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)Perguntas e respostas
O nó LoadImage suporta formatos comuns como JPEG, PNG e TIFF para upload do design do poster.
Você pode instalar os nós personalizados seguindo o guia disponível na documentação do ComfyUI ou acessando os repositórios GitHub indicados nas notas do autor.
Atualmente, as cenas são geradas com base em configurações pré-definidas no fluxo. Opções de personalização podem ser adicionadas em futuras atualizações.
Certifique-se de que seu design de entrada está bem formatado e que a descrição da marca está clara. Você também pode ajustar as configurações de tamanho de imagem no fluxo.