Character × 4 Scene Explorer
Upload a reference image and generate a 1x4 grid. Select desired image and upscale/refine with Nano Banana Pro.
简介
The 'Character × 4 Scene Explorer' workflow is designed to help users generate a variety of character images based on a single reference image. This workflow leverages the power of Google Gemini Image and Nano Banana Pro models to create a 1x4 grid of character variations. By using nodes such as LoadImage and GeminiImage2Node, the workflow first processes the input image to produce four distinct character scenes. Once generated, users can select their preferred image for further refinement and upscaling using the Nano Banana Pro model, ensuring high-quality output.
Technically, this workflow utilizes several custom nodes, including those from comfyui-kjnodes and comfyui_essentials, which streamline the image processing and refinement tasks. Nodes like Reroute, PrimitiveInt, and RegexReplace are employed to manage data flow and transform inputs efficiently. This workflow is particularly useful for artists and designers looking to explore multiple character design options quickly, as it automates the generation and refinement process, saving time and enhancing creativity.
你需要提供
- 正在读取工作流
在 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": "cube_robot.jpg"
},
"_meta": {
"title": "Load Image"
}
},
"2": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "9:16",
"images": [
"1",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": [
"24",
0
],
"resolution": "4K",
"response_modalities": "IMAGE+TEXT",
"seed": 123,
"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)"
}
},
"3": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-split_stack",
"images": [
"2",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"10": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_1",
"images": [
"7:29",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"11": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_2",
"images": [
"7:101",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"12": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_2",
"images": [
"7:187",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"13": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_1",
"images": [
"7:145",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"15": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "16:9",
"images": [
"14:78",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": "Upscale image 1 and add subtle details. Crop if necessary.",
"resolution": "4K",
"response_modalities": "IMAGE+TEXT",
"seed": 321,
"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)"
}
},
"16": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-selected_image-upscaled",
"images": [
"15",
0
]
},
"_meta": {
"title": "Save Upscaled Image"
}
},
"18": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-selected_image",
"images": [
"14:78",
0
]
},
"_meta": {
"title": "Save Selected Image"
}
},
"21": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1
},
"_meta": {
"title": "Select Image Number"
}
},
"22": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "The subject is inside a giant computer motherboard landscape - towering capacitors, circuit trace pathways like roads, and LED lights creating a Tron-like microverse where the robot fits the scale perfectly. Dark eerie atmosphere."
},
"_meta": {
"title": "Describe the Scene"
}
},
"23": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Use the input image. Divide the frame in 4 different stacked 16:9 frames.\nFor each frame choose the angle and type of shot (close up, extreme close up, dutch, over-shoulder, wide shot, Cowboy shot, full shot, etc).\n\nEnsure that subject is present in each frame and the environment is consistent between frames:\n{scene}"
},
"_meta": {
"title": "Prompt Template"
}
},
"24": {
"class_type": "RegexReplace",
"inputs": {
"case_insensitive": True,
"count": 0,
"dotall": False,
"multiline": False,
"regex_pattern": "{scene}",
"replace": [
"22",
0
],
"string": [
"23",
0
]
},
"_meta": {
"title": "Replace Text (Regex)"
}
},
"14:78": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": [
"14:89",
0
],
"image": [
"7:333",
0
],
"length": 1
},
"_meta": {
"title": "Get Image from Batch"
}
},
"14:83": {
"class_type": "ResizeAndPadImage",
"inputs": {
"image": [
"1",
0
],
"interpolation": "area",
"padding_color": "white",
"target_height": [
"14:86",
1
],
"target_width": [
"14:86",
0
]
},
"_meta": {
"title": "Resize And Pad Image"
}
},
"14:86": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"14:78",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"14:87": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"14:78",
0
],
"image2": [
"14:83",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"14:89": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"21",
0
],
"b": 0,
"value": "a - 1"
},
"_meta": {
"title": "Image # as index"
}
},
"7:101": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"7:66",
0
],
"image": [
"2",
0
],
"width": [
"7:65",
0
],
"x": 0,
"y": [
"7:63",
0
]
},
"_meta": {
"title": "2"
}
},
"7:109": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"7:101",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"7:136": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"7:145",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"7:144": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"7:66",
0
],
"b": 0,
"value": "2*a"
},
"_meta": {
"title": "Row 3 - Y val"
}
},
"7:145": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"7:66",
0
],
"image": [
"2",
0
],
"width": [
"7:65",
0
],
"x": 0,
"y": [
"7:144",
0
]
},
"_meta": {
"title": "3"
}
},
"7:164": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"7:187",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"7:172": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"7:66",
0
],
"b": 0,
"value": "3*a"
},
"_meta": {
"title": "Row 4 - Y val"
}
},
"7:18": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"2",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"7:187": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"7:66",
0
],
"image": [
"2",
0
],
"width": [
"7:65",
0
],
"x": 0,
"y": [
"7:172",
0
]
},
"_meta": {
"title": "4"
}
},
"7:29": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"7:66",
0
],
"image": [
"2",
0
],
"width": [
"7:65",
0
],
"x": 0,
"y": 0
},
"_meta": {
"title": "1"
}
},
"7:32": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"7:29",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"7:333": {
"class_type": "ImageBatchMulti",
"inputs": {
"image_1": [
"7:29",
0
],
"image_2": [
"7:101",
0
],
"image_3": [
"7:145",
0
],
"image_4": [
"7:187",
0
],
"inputcount": 4
},
"_meta": {
"title": "Image Batch Multi"
}
},
"7:353": {
"class_type": "SimpleMath+",
"inputs": {
"a": 0,
"b": 0,
"value": "(2*a) + (3*b)"
},
"_meta": {
"title": "Row 3 - Y val"
}
},
"7:63": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"7:66",
0
],
"b": 0,
"value": "a"
},
"_meta": {
"title": "Row 2 - Y val"
}
},
"7:65": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"7:18",
0
],
"b": 0,
"value": "a"
},
"_meta": {
"title": "WIDTH"
}
},
"7:66": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"7:18",
1
],
"b": 0,
"value": "a / 4"
},
"_meta": {
"title": "HEIGHT"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)常见问答
Yes, you can upload any image as a reference, but results may vary based on the quality and content of the image.
You can rerun the workflow with different parameters or a new reference image to generate new variations.
The Nano Banana Pro model refines and upscales images, improving details and resolution for a polished final output.
Yes, the workflow is designed to be user-friendly, with step-by-step instructions to guide users through the process.