1.3 Starter - Product Photography
Learn how to create a product photography with image inputs, enter a subgraph, unbypass a node and get to know partner nodes using Nano Banana Pro.
简介
This ComfyUI workflow, titled '1.3 Starter - Product Photography,' is designed to streamline the process of creating high-quality product photography using AI-generated images. The workflow leverages the Nano Banana Pro model, a specialized AI model known for its ability to produce detailed and realistic product images.
The workflow begins with the 'LoadImage' node, allowing you to input existing images that serve as a base or reference for the AI to work from. Within the workflow, you'll encounter a subgraph, which you can enter by clicking the top-right icon. This subgraph contains essential nodes like 'comfyui-kjnodes' and 'comfyui_essentials' that facilitate the transformation and enhancement of the input images.
Technically, the workflow is structured to guide users through the process of unbypassing nodes, which is crucial for activating specific functionalities within the subgraph. The integration of the 'SaveImage' node ensures that the final output is easily saved and accessible. The 'MarkdownNote' node is used to provide inline documentation and guidance, making the workflow user-friendly even for beginners. This setup is particularly useful for e-commerce businesses and photographers looking to automate and enhance their product photography processes, ensuring consistent quality and style across their image assets.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview- 作者
- ComfyUI
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
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({
"2": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "comfyui-relight-product",
"images": [
"46:40:20",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"3": {
"class_type": "LoadImage",
"inputs": {
"image": "gsc3_landscape.png"
},
"_meta": {
"title": "Load Image"
}
},
"7": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"46:40:10": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"46:40:16",
0
],
"image": [
"7",
0
],
"width": [
"46:40:15",
0
],
"x": [
"46:40:24",
0
],
"y": [
"46:40:12",
0
]
},
"_meta": {
"title": "3"
}
},
"46:40:11": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"46:40:16",
0
],
"image": [
"7",
0
],
"width": [
"46:40:15",
0
],
"x": [
"46:40:13",
0
],
"y": [
"46:40:12",
0
]
},
"_meta": {
"title": "4"
}
},
"46:40:12": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"46:40:16",
0
],
"b": [
"46:40:14",
0
],
"value": "a + (b/2)"
},
"_meta": {
"title": "Row 2 - Y val"
}
},
"46:40:13": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"46:40:15",
0
],
"b": [
"46:40:14",
0
],
"value": "a + (b/2)"
},
"_meta": {
"title": "Col 2 - X val"
}
},
"46:40:14": {
"class_type": "SimpleMath+",
"inputs": {
"a": 0,
"b": 0,
"value": "a"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"46:40:15": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"46:40:17",
0
],
"b": [
"46:40:14",
0
],
"value": "(a-2*b) / 2"
},
"_meta": {
"title": "WIDTH"
}
},
"46:40:16": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"46:40:17",
1
],
"b": [
"46:40:14",
0
],
"value": "(a-2*b) / 2"
},
"_meta": {
"title": "HEIGHT"
}
},
"46:40:17": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"7",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"46:40:19": {
"class_type": "ImageBatchMulti",
"inputs": {
"image_1": [
"46:40:8",
0
],
"image_2": [
"46:40:9",
0
],
"image_3": [
"46:40:10",
0
],
"image_4": [
"46:40:11",
0
],
"inputcount": 4
},
"_meta": {
"title": "Image Batch Multi"
}
},
"46:40:20": {
"class_type": "ImageResizeKJv2",
"inputs": {
"crop_position": "center",
"device": "cpu",
"divisible_by": 2,
"height": [
"46:40:22",
0
],
"image": [
"46:40:19",
0
],
"keep_proportion": "stretch",
"pad_color": "0, 0, 0",
"upscale_method": "lanczos",
"width": [
"46:40:23",
0
]
},
"_meta": {
"title": "Resize Images"
}
},
"46:40:22": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"46:40:17",
1
],
"b": 0,
"value": "(a) / 2"
},
"_meta": {
"title": "HEIGHT / 2"
}
},
"46:40:23": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"46:40:17",
0
],
"b": 0,
"value": "(a) / 2"
},
"_meta": {
"title": "WIDTH / 2"
}
},
"46:40:24": {
"class_type": "SimpleMath+",
"inputs": {
"a": 0,
"b": [
"46:40:14",
0
],
"value": "b/2"
},
"_meta": {
"title": "Col 1 - X val"
}
},
"46:40:4": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"46:40:8",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"46:40:5": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"46:40:9",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"46:40:6": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"46:40:10",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"46:40:7": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"46:40:11",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"46:40:8": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"46:40:16",
0
],
"image": [
"7",
0
],
"width": [
"46:40:15",
0
],
"x": [
"46:40:24",
0
],
"y": [
"46:40:24",
0
]
},
"_meta": {
"title": "1"
}
},
"46:40:9": {
"class_type": "ImageCrop",
"inputs": {
"height": [
"46:40:16",
0
],
"image": [
"7",
0
],
"width": [
"46:40:15",
0
],
"x": [
"46:40:13",
0
],
"y": 0
},
"_meta": {
"title": "2"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("7", "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)常见问答
The subgraph contains specialized nodes that enhance and transform input images, allowing for more detailed and realistic product photography outputs.
To unbypass a node, enter the subgraph and click on the node you wish to activate, ensuring its functions are included in the image processing.
While this workflow is optimized for the Nano Banana Pro model, you can experiment with other models, but results may vary in quality and style.
For best results, use high-quality images that clearly depict the product, as these will serve as the foundation for the AI-generated enhancements.