Comfy para Publicidad - Visualización OOH
Acerca de
Este flujo de trabajo de ComfyUI ayuda a equipos de marca y creativos a colocar rápidamente un cartel existente en escenarios realistas de Out-of-Home (OOH). Está organizado en dos etapas claras. PASO 1 – REFORMATEO DE CARTEL toma tu cartel fuente y lo reformatea de manera no destructiva a múltiples proporciones (vertical, horizontal, cuadrado o personalizado) preservando el diseño original. Esta etapa utiliza LoadImage, PrimitiveNode (para valores de ancho/alto), PrimitiveBoolean (para habilitar/deshabilitar formatos), ComfySwitchNode (para enrutar solo los formatos que desees) y BatchImagesNode (para empaquetar múltiples salidas). SaveImage captura versiones limpias y reformateadas listas para su colocación.
PASO 2 – VISUALIZACIÓN OOH compone un cartel reformateado en un entorno real o descrito. Puedes suministrar una foto de ubicación con LoadImage en el grupo IMAGE ENVIRONMENT o describir una escena en lenguaje natural (por ejemplo, "valla publicitaria OOH en el centro de San Francisco, sobre un edificio de dos pisos, a nivel de peatón") en el grupo PROMPT ENVIRONMENT. GeminiImage2Node se usa como asistente de prompt para convertir tu descripción en notas de escena estructuradas y contexto de nombre de archivo. Dos nodos personalizados (ae42e662-5e2b-4f52-b31d-267bd68f1c6f y 88b611c3-ce43-4e7a-a59f-dd16f57a8853) gestionan el mapeo de perspectiva y la mezcla del cartel en la superficie objetivo, permitiendo ajustar escala, inclinación y fuerza de superposición para una colocación creíble. SaveImage luego exporta las maquetas finales, opcionalmente en lotes, para comparar formatos y escenas lado a lado.
Lo que proporcionas
- Leyendo el flujo de trabajo
Se ejecuta en ComfyUI. Este flujo de trabajo no puede ejecutarse en esta página. Ábrelo en Comfy Cloud con todo cargado o descárgalo para tu propio ComfyUI.
Probar en CloudProbar un ejemplo
Dentro del flujo de trabajo
Una vista previa de solo lectura del gráfico de nodos. Ábrelo en Comfy Cloud o descárgalo para editar los nodos.
Loading the graph
Open full-size workflow preview- Autor
- ComfyUI
Requiere nodos personalizados
- Leyendo el flujo de trabajo
Usa este flujo de trabajo desde código
Se genera a partir del gráfico y las entradas del flujo de trabajo cuando es posible; de lo contrario, se muestran ejemplos almacenados. Revisa las credenciales y los endpoints antes de ejecutar el código, ya que puede generar cargos.
What you need
- Runs on
- Comfy Cloud
- Clave
- COMFY_API_KEY
- Tus archivos
- El código los sube desde sus URL
Requiere un plan de pago de Cloud y 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({
"64": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Poster_Resize_Custom",
"images": [
"252:251",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"66": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "INPUT POSTER"
}
},
"127": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "1:1",
"images": [
"128",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": "visualize this poster (keep its aspect ratio) to a OOH billboard in the street of downtown San Francisco, on top of a two story building. Shot from the perspective of a pedestrian",
"resolution": "2K",
"response_modalities": "IMAGE+TEXT",
"seed": 0,
"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)"
}
},
"128": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_2_FILENAME"
},
"_meta": {
"title": "INPUT POSTER"
}
},
"129": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Poster_Mockup",
"images": [
"136",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"135": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"142",
0
],
"images.image1": [
"235:162",
0
]
},
"_meta": {
"title": "Batch Images"
}
},
"136": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"127",
0
],
"on_true": [
"138",
0
],
"switch": [
"141",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"138": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "auto",
"images": [
"135",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": "replace the billboard of the first image to the poster of the second image",
"resolution": "2K",
"response_modalities": "IMAGE+TEXT",
"seed": 303461698342474,
"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)"
}
},
"141": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "SWITCH TO IMAGE ENVIRONMENT"
}
},
"142": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_3_FILENAME"
},
"_meta": {
"title": "IMAGE"
}
},
"243": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Poster_Resize1",
"images": [
"252:250",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"245": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Poster_Resize2",
"images": [
"252:249",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"247": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Poster_Resize3",
"images": [
"252:248",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"235:152": {
"class_type": "Paste By Mask",
"inputs": {
"image_base": [
"235:230",
0
],
"image_to_paste": [
"235:229",
0
],
"mask": [
"235:229",
0
],
"resize_behavior": "keep_ratio_fit"
},
"_meta": {
"title": "Paste By Mask"
}
},
"235:153": {
"class_type": "ImageToMask",
"inputs": {
"channel": "red",
"image": [
"235:152",
0
]
},
"_meta": {
"title": "Convert Image to Mask"
}
},
"235:158": {
"class_type": "ImageToMask",
"inputs": {
"channel": "red",
"image": [
"235:231",
0
]
},
"_meta": {
"title": "Convert Image to Mask"
}
},
"235:159": {
"class_type": "InvertMask",
"inputs": {
"mask": [
"235:153",
0
]
},
"_meta": {
"title": "Invert Mask"
}
},
"235:162": {
"class_type": "ImageRemoveAlpha+",
"inputs": {
"image": [
"235:165",
0
]
},
"_meta": {
"title": "🔧 Image Remove Alpha"
}
},
"235:163": {
"class_type": "Get Image Size",
"inputs": {
"image": [
"128",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"235:165": {
"class_type": "Paste By Mask",
"inputs": {
"image_base": [
"235:231",
0
],
"image_to_paste": [
"128",
0
],
"mask": [
"235:152",
0
],
"resize_behavior": "keep_ratio_fit"
},
"_meta": {
"title": "Paste By Mask"
}
},
"235:168": {
"class_type": "MaskComposite",
"inputs": {
"destination": [
"235:158",
0
],
"operation": "add",
"source": [
"235:159",
0
],
"x": 0,
"y": 0
},
"_meta": {
"title": "Combine Masks"
}
},
"235:191": {
"class_type": "FluxResolutionNode",
"inputs": {
"aspect_ratio": "1:1 (Perfect Square)",
"custom_aspect_ratio": "1:1",
"custom_ratio": False,
"divisible_by": "8",
"megapixel": "2.1"
},
"_meta": {
"title": "Flux Resolution Calc"
}
},
"235:229": {
"class_type": "LayerUtility: ColorImage V2",
"inputs": {
"color": "#ffffff",
"custom_height": [
"235:163",
1
],
"custom_width": [
"235:163",
0
],
"size": "custom"
},
"_meta": {
"title": "LayerUtility: ColorImage V2"
}
},
"235:230": {
"class_type": "LayerUtility: ColorImage V2",
"inputs": {
"color": "#000000",
"custom_height": [
"235:191",
1
],
"custom_width": [
"235:191",
0
],
"size": "custom"
},
"_meta": {
"title": "LayerUtility: ColorImage V2"
}
},
"235:231": {
"class_type": "LayerUtility: ColorImage V2",
"inputs": {
"color": "#ffffff",
"custom_height": [
"235:191",
1
],
"custom_width": [
"235:191",
0
],
"size": "custom"
},
"_meta": {
"title": "LayerUtility: ColorImage V2"
}
},
"252:131": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": "",
"string_a": "Resize the OOH poster to ",
"string_b": "3:1"
},
"_meta": {
"title": "Concatenate Text"
}
},
"252:132": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": "",
"string_a": [
"252:131",
0
],
"string_b": " aspect ratio. Only move and rescale elements to fit the new format. Maintain all original typography, colors, graphics, logos, and visual hierarchy exactly as they are. No design changes."
},
"_meta": {
"title": "Concatenate Text"
}
},
"252:248": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"66",
0
],
"on_true": [
"252:260",
0
],
"switch": True
},
"_meta": {
"title": "If/Else Switch"
}
},
"252:249": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"66",
0
],
"on_true": [
"252:259",
0
],
"switch": True
},
"_meta": {
"title": "If/Else Switch"
}
},
"252:250": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"66",
0
],
"on_true": [
"252:258",
0
],
"switch": True
},
"_meta": {
"title": "If/Else Switch"
}
},
"252:251": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"66",
0
],
"on_true": [
"252:264",
0
],
"switch": True
},
"_meta": {
"title": "If/Else Switch"
}
},
"252:258": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "9:16",
"images": [
"66",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "Resize this OOH poster to the new aspect ratio. Only move and rescale elements to fit the new format. Maintain all original typography, colors, graphics, logos, and visual hierarchy exactly as they are. No design changes.",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 806105455324093,
"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.",
"thinking_level": "HIGH"
},
"_meta": {
"title": "Nano Banana 2"
}
},
"252:259": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "16:9",
"images": [
"66",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "Resize this OOH poster to the new aspect ratio. Only move and rescale elements to fit the new format. Maintain all original typography, colors, graphics, logos, and visual hierarchy exactly as they are. No design changes.",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 952769964755599,
"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.",
"thinking_level": "HIGH"
},
"_meta": {
"title": "Nano Banana 2"
}
},
"252:260": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "1:1",
"images": [
"66",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "Resize this OOH poster to the new aspect ratio. Only move and rescale elements to fit the new format. Maintain all original typography, colors, graphics, logos, and visual hierarchy exactly as they are. No design changes.",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 521333244527813,
"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.",
"thinking_level": "HIGH"
},
"_meta": {
"title": "Nano Banana 2"
}
},
"252:264": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "auto",
"images": [
"66",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": [
"252:132",
0
],
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 188565245405213,
"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.",
"thinking_level": "HIGH"
},
"_meta": {
"title": "Nano Banana 2"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("66", "image", client.assets.from_url("https://example.com/replace-with-a-url/image"))
workflow.set_input("128", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_2"))
workflow.set_input("142", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_3"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)Preguntas y respuestas
Puedes hacer ambas cosas. Usa IMAGE ENVIRONMENT con LoadImage para suministrar una foto real de ubicación, o usa PROMPT ENVIRONMENT si quieres que GeminiImage2Node convierta tu descripción en notas de escena y contexto de nombre de archivo. Puedes alternar entre rutas con los interruptores provistos.
El PASO 1 reformatea redimensionando y agregando relleno/recorte según las dimensiones de PrimitiveNode que configures, controlado por los interruptores de PrimitiveBoolean y el enrutamiento de ComfySwitchNode. Esto preserva tu diseño mientras produce lienzos estándar OOH (vertical, horizontal, cuadrado o personalizado).
Gestionan el paso de colocación OOH: deforman el cartel seleccionado para que coincida con el plano de la valla y lo mezclan en la escena. Usa sus controles para ajustar perspectiva (esquinas/escala/rotación) y la mezcla para un resultado realista.
Sí. Habilita los formatos que desees con los interruptores PrimitiveBoolean en el PASO 1. Luego, en el PASO 2, conecta esas salidas a tu ruta de entorno elegida. BatchImagesNode y SaveImage exportarán un set consistente de maquetas en una sola ejecución.
Flujos de trabajo relacionados
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Flux.2 Dev, Flux
Create a product mockup
- Nano Banana Pro
Try an outfit on a character
- Seedream
Put your product in a new scene
- SSeedVR2
Upscale and restore detail
- Nano Banana Pro
Sharpen a product photo
- Topaz
Upscale an illustration
- HHitPaw
Restore portrait detail
- FLUX.1 Fill
Edit a selected region
- FLUX.1 Fill
Extend an image’s borders