產品樣機(FLUX.2 Dev FP8)
透過使用多參考一致性將設計圖案應用到包裝、馬克杯等產品上,建立產品模型圖。
下載工作流程在 Cloud 中試用 API 文件
關於
此 ComfyUI 工作流程專為將設計圖樣套用於各類產品(如包裝、馬克杯)生成寫實樣機而設計。流程採用 FLUX.2 Dev 模型,具備多參考一致性,確保設計圖樣在不同表面與角度均勻呈現。流程運用多個關鍵節點,包括 SaveImage 與 LoadImage,有效管理輸入與輸出。另有 MarkdownNote 節點作為文件說明,並以特定節點(具唯一 ID)處理圖像運算。採用 FLUX.2 Dev 量化權重,兼顧效能與品質,適合設計師與行銷人員快速視覺化產品設計。
您提供的內容
- 正在讀取工作流程
在 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({
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux2",
"images": [
"62:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"42": {
"class_type": "LoadImage",
"inputs": {
"image": "image_flux2_input_ref_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"46": {
"class_type": "LoadImage",
"inputs": {
"image": "image_flux2_input_Illustration.png"
},
"_meta": {
"title": "Load Image"
}
},
"64": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux2",
"images": [
"63:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"62:10": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"62:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux2_dev_fp8mixed.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"62:13": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"62:22",
0
],
"latent_image": [
"62:47",
0
],
"noise": [
"62:25",
0
],
"sampler": [
"62:16",
0
],
"sigmas": [
"62:48",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"62:16": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"62:22": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"62:39",
0
],
"model": [
"62:12",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"62:25": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 120839687766682
},
"_meta": {
"title": "RandomNoise"
}
},
"62:26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"62:6",
0
],
"guidance": 4
},
"_meta": {
"title": "FluxGuidance"
}
},
"62:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "mistral_3_small_flux2_fp8.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"62:39": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"62:43",
0
],
"latent": [
"62:40",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"62:40": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"62:41",
0
],
"vae": [
"62:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"62:41": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"46",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"62:43": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"62:26",
0
],
"latent": [
"62:44",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"62:44": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"62:45",
0
],
"vae": [
"62:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"62:45": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"42",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"62:47": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"62:63",
1
],
"width": [
"62:63",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"62:48": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"62:63",
1
],
"steps": 20,
"width": [
"62:63",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"62:6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"62:38",
0
],
"text": "Apply the design from Reference Image 1 onto objects in Reference Image 2.\n"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"62:63": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"62:45",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"62:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"62:13",
0
],
"vae": [
"62:10",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"63:10": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"63:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux2_dev_fp8mixed.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"63:13": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"63:22",
0
],
"latent_image": [
"63:47",
0
],
"noise": [
"63:25",
0
],
"sampler": [
"63:16",
0
],
"sigmas": [
"63:48",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"63:16": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"63:22": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"63:39",
0
],
"model": [
"63:63",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"63:25": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 120839687766682
},
"_meta": {
"title": "RandomNoise"
}
},
"63:26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"63:6",
0
],
"guidance": 4
},
"_meta": {
"title": "FluxGuidance"
}
},
"63:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "mistral_3_small_flux2_fp8.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"63:39": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"63:43",
0
],
"latent": [
"63:40",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"63:40": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"63:41",
0
],
"vae": [
"63:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"63:41": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"46",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"63:43": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"63:26",
0
],
"latent": [
"63:44",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"63:44": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"63:45",
0
],
"vae": [
"63:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"63:45": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"42",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "area"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"63:47": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"63:65",
1
],
"width": [
"63:65",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"63:48": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"63:65",
1
],
"steps": 8,
"width": [
"63:65",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"63:6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"63:38",
0
],
"text": "Apply the design from Reference Image 1 onto objects in Reference Image 2.\n"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"63:63": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Flux2TurboComfyv2.safetensors",
"model": [
"63:12",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"63:65": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"63:45",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"63:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"63:13",
0
],
"vae": [
"63:10",
0
]
},
"_meta": {
"title": "VAE Decode"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
多參考一致性確保設計圖樣在不同表面與角度均勻呈現,維持整體視覺一致。
量化權重可提升模型運算效能,加快處理速度,同時維持圖像品質。
可以,只要有清晰產品圖與相容設計圖樣,流程可彈性應用於各類產品。
請使用高品質輸入圖像,並正確設定節點,確保設計圖樣在產品上保持一致。