從單張圖像產生3D模型
輸入單張圖像,自動產生三檢視。使用這些多檢視與Meshy建立帶紋理的3D模型。
下載工作流程在 Cloud 中試用 API 文件
關於
此 ComfyUI 工作流程可把單張圖片轉成完整貼圖的 3D 模型,方式是先生成三個正交視角。它利用 GeminiNanoBanana2 模型,從輸入圖生成精準的側面與背面視圖。接著把這些視圖交給 TripoImageToModelNode 來建構 3D 模型。工作流程分成兩個主要群組:Shots creation 與 3D Model creation。Shots creation 使用 LoadImage 與 BatchImagesNode 準備與處理輸入圖片;3D Model creation 則使用 Meshy 模型把視圖整合成一致的 3D 結構。此工作流程適合想用最少輸入快速做 3D 原型的美術與設計師。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用範例
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview需要自訂節點
- 正在讀取工作流程
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# 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": "templates_mjm_image_to_3d.png"
},
"_meta": {
"title": "Load Image"
}
},
"2": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "1:1",
"images": [
"1",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "Create a side shot from this image, do not change the pose and lighting\n\nNo background",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 138687889823595,
"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"
}
},
"4": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "1:1",
"images": [
"1",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "Create a rear shot from this image, do not change the pose and lighting\n\nNo background",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 226226946819998,
"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"
}
},
"6": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"23",
0
],
"images.image1": [
"2",
0
],
"images.image2": [
"4",
0
]
},
"_meta": {
"title": "Batch Images"
}
},
"7": {
"class_type": "TripoImageToModelNode",
"inputs": {
"auto_size": True,
"face_limit": -1,
"geometry_quality": "standard",
"image": [
"6",
0
],
"model_seed": 42,
"model_version": "v3.0-20250812",
"orientation": "default",
"pbr": True,
"quad": False,
"smart_low_poly": False,
"style": "person:person2cartoon",
"texture": True,
"texture_alignment": "geometry",
"texture_quality": "detailed",
"texture_seed": 42
},
"_meta": {
"title": "Tripo: Image to Model (Legacy)"
}
},
"23": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "1:1",
"images": [
"1",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "Remove the background",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 80526614165305,
"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"
}
},
"24": {
"class_type": "Preview3D",
"inputs": {
"model_file": [
"7",
0
]
},
"_meta": {
"title": "Preview 3D & Animation (DEPRECATED)"
}
},
"25": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"23",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"26": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"2",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"27": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"4",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"28": {
"class_type": "SaveGLB",
"inputs": {
"filename_prefix": "3d/tripo_image2model",
"mesh": [
"7",
2
]
},
"_meta": {
"title": "Save 3D Model"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
輪廓清楚、特徵明顯的圖片效果最好,因為能讓模型更準確生成側面與背面視圖。
工作流程可生成基本材質;若材質細節很高,可能需要在 3D 建模軟體中再做補強。
可以。已生成的 3D模型可匯出為 GLB 檔,並在任何相容的 3D 建模軟體中編輯。
準確度取決於輸入圖片品質與主體複雜度。越簡單、越清楚的圖片通常越準。