角色 ×4 場景探索
上傳參考圖並產生1x4網格。選擇所需圖像並使用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)問答
可以,你可以上傳任何圖像作為參考,但結果會依圖像品質與內容而異。
你可以更換參數或參考圖像,重新執行流程產生新變化。
Nano Banana Pro 模型會對圖像進行細緻化與放大,提升細節與解析度,讓最終輸出更精緻。
適合,本流程設計簡單易用,並有步驟指引協助用戶完成操作。